Search completed in 1.68 seconds.
5536 results for "Other":
Your results are loading. Please wait...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
in this article we will take a look at how flexbox fits in with all the other css modules.
... we’ll find out which specifications you also need to take notice of if you want to learn flexbox, and find out why flexbox is different to some other modules.
...these modules relate to each other, and are at different stages of development.
...And 13 more matches
From object to iframe — other embedding technologies - Learn web development
<iframe>s are for embedding other web pages, and the other two allow you to embed pdfs, svg, and even flash — a technology that is on the way out, but which you'll still see semi-regularly.
... objective: to learn how to embed items into web pages using <object>, <embed>, and <iframe>, like flash movies and other webpages.
... 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 is used regularly today.
...And 12 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
css grid layout has been designed to work alongside other parts of css, as part of a complete system for doing the layout.
... in this guide, i will explain how a grid fits together with other techniques you may already be using.
... in addition to the one-dimensional versus two-dimensional distinction, there is another way to decide if you should use flexbox or grid for a layout.
...And 8 more matches
Other form controls - Learn web development
previous overview: forms next we now look at the functionality of non-<input> form elements in detail, from other control types such as drop-down lists and multi-line text fields, to other useful form features such as the <output> element (which we saw in action in the previous article), and progress bars.
... note that even though you can put anything inside a <textarea> element (including other html elements, css, and javascript), because of its nature, it is all rendered as if it was plain text content.
... other form features there are a few other form features that are not as obvious as the ones we have already mentioned, but still useful in some situations, so we thought it would be worth giving them a brief mention.
...And 5 more matches
Communicating With Other Scripts - Archive of obsolete content
this section of the guide explains how content scripts can communicate with: your main.js file, or any other modules in your add-on other content scripts loaded by your add-on page scripts (that is, scripts embedded in the web page or included using <script> tags) main.js your content scripts can communicate with your add-on's "main.js" (or any other modules you're written for your add-on) by sending it messages, using either the port.emit() api or the postmessage() api.
... content scripts content scripts loaded into the same document at the same time using the same method can interact with each other directly as well as with the web content itself.
... however, content scripts which have been loaded into different documents cannot interact directly with each other.
...And 4 more matches
Test your skills: Other controls - Learn web development
this aim of this skill test is to assess whether you've understood our other form controls article.
... other controls 1 in our first "other controls" assessment, we'll get you to create a multi-line text input.
... other controls 2 now it's time to have a go at implementing a drop-down select menu, to allow a user to pick their favourite food from the choices provided.
...And 2 more matches
Other content in SVG - SVG: Scalable Vector Graphics
« previousnext » apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well.
...this means, that you can use clips, masks, filters, rotations and all other tools of svg on the content: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"> <image x="90" y="-65" width="128" height="146" transform="rotate(45)" xlink:href="https://developer.mozilla.org/static/img/favicon144.png"/> </svg> screenshotlive sample embedding arbitrary xml since svg is an xml application, you can o...
...its sole purpose is to be a container for other markup and a carrier for svg styling attributes (most prominently width and height to define the space the object will take).
...another often cited use case is the embedding of formulas with mathml.
<xsl:otherwise> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:otherwise> element is used to define the action that should be taken when none of the <xsl:when> conditions apply.
... it is similar to the else or default case in other programing languages.
... syntax <xsl:otherwise> template </xsl:otherwise> required attributes none.
303 See Other - HTTP
WebHTTPStatus303
the hypertext transfer protocol (http) 303 see other redirect status response code indicates that the redirects don't link to the newly uploaded resources, but to another page (such as a confirmation page or an upload progress page).
... status 303 see other specifications specification title rfc 7231, section 6.4.4: 303 see other hypertext transfer protocol (http/1.1): semantics and content ...
Other Mozilla customization pages - Archive of obsolete content
other mozilla customization pages mcd, mission control desktop aka autoconfig pre-configuring mozilla mozexec, a mozilla launcher that writes a registry.bat before launching mozilla (contributed by petr kristan) mozptch: the main difference of the mozptch approach is, not to patch the registry.dat, but to create a new one with mozillas comandline option -createprofile.
Other Resources - Archive of obsolete content
all other resources dave winer's rss weblog dave winer's rss 2.0 political faq ...
Other Resources - Archive of obsolete content
all other resources offical mozilla xforms project page w3c test suite xformstest.org ...
Information for Governments and Other Organizations Evaluating Mozilla
mozilla's w3c user agent guidelines evaluation report w3c's wai is advancing another important set of accessibility standards called uaag.
Other Resources
other resources embedding mozilla xpconnect - javascript-xpcom bridge blackconnect - java-xpcom bridge (no longer supported) xpidl to java types - from blackconnect ...
Using Mozilla code in other projects
there are also modules that aren't used in firefox but are available for use by other applications; an example of this is rhino, the javascript engine written in java.
Other Resources - SVG: Scalable Vector Graphics
here is a list of additional resources on svg: mozilla svg resources svg.org svgbasics tutorials w3c svg homepage svg wiki http://wiki.svg.org/index.php?title=..._configuration i moved this from the other resources category, not sure why it's in other resources -nickolay http://developer.mozilla.org/en/docs...%28external%29 ...
Index - Web APIs
WebAPIIndex
it's basically an average between the current buffer and the last buffer the analysernode processed, and results in a much smoother set of value changes over time.
...anywhere you see animationtimeline, you should use documenttimeline or any other timeline type instead.
... 167 audioparam.cancelandholdattime() api, audio, audioparam, experimental, method, reference, web audio api, cancelandholdattime, cancelvaluesandholdattime the cancelandholdattime() property of the audioparam interface cancels all scheduled future changes to the audioparam but holds its value at a given time until further changes are made using other methods.
...And 196 more matches
Index - Archive of obsolete content
2 .htaccess ( hypertext access ) 301 redirect, cache control, custom error pages, htaccess, permanent redirect, redirect file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other.
... 14 communicating with other scripts no summary!
... 15 communicating using "port" to enable add-on scripts and content scripts to communicate with each other, each end of the conversation has access to a port object.
...And 111 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
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.
...in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums.
...And 64 more matches
Index
it is separated in 2 parts, one section related to debugging and another section related to drafting optimizations.
...otherwise, int_fits_in_jsval returns false.
...in other words, it returns the global object on the current scope chain.
...And 53 more matches
Index
applications built with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards.
...it's free and open source software, and many other software projects have decided to use it.
...(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.
...And 46 more matches
WebIDL bindings
adding webidl bindings to a class to add a webidl binding for interface myinterface to a class mozilla::dom::myinterface that's supposed to implement that interface, you need to do the following: if your interface doesn't inherit from any other interfaces, inherit from nswrappercache and hook up the class to the cycle collector so it will trace the wrapper cache properly.
... note that you may not need to do this if your objects can only be created, never gotten from other objects.
...if your interface does inherit from another interface, just inherit from the c++ type that the other interface corresponds to.
...And 43 more matches
Index - Learn web development
you can do that with other people's code too!
...you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there.
...you should understand these concepts before working through the other articles in the module.
...And 39 more matches
Index
MozillaTechXPCOMIndex
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.
... 15 language bindings embedding, landing, mozilla, xpcom, xpcom:language bindings an xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.
... 53 other resources javaxpcom, xpcom:language bindings no summary!
...And 36 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
encryption and decryption allow two communicating parties to disguise information they send to each other.
...ion 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 ids, a certificate provides generally recognized proof of a person's identity.
...And 33 more matches
sslfnc.html
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.
...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.
...And 33 more matches
Codecs used by WebRTC - Web media technologies
the webrtc api makes it possible to construct web sites and apps that let users communicate in real time, using audio and/or video as well as optional data and other information.
...this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc.
... containerless media webrtc uses bare mediastreamtrack objects for each track being shared from one peer to another, without a container or even a mediastream associated with the tracks.
...And 30 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
the same process occurs when decreasing the size, except in the other direction.
... 422 deprecated and defunct markup reference, xul {many elements on this page are wrongly marked as deprecated, this page needs review} 423 dynamically modifying xul-based user interface add-ons, dom, extensions, xul this article discusses manipulating xul interfaces, using dom and other apis.
...an output stream is an object which can be used to write bytes, strings and other values to a file.
...And 29 more matches
Signaling and video calling - Web APIs
a form of discovery and media format negotiation must take place, as discussed elsewhere, in order for two devices on different networks to locate one another.
...through this third server, the two devices can locate one another, and exchange negotiation messages.
...what does matter is when the ice subsystem instructs you to send signaling data to the other peer, you do so, and the other peer knows how to receive this information and deliver it to its own ice subsystem.
...And 28 more matches
Rendering and the WebXR frame animation callback - Web APIs
before you can render the virtual environment, you need to establish a webxr session by creating an xrsession using the navigator.xr.requestsession() method; you also need to associate the session with a framebuffer and perform other setup tasks.
...instead, the frame rendering code—in this case, a function named mydrawframe()—is responsible for scheduling time to draw another frame by once again calling requestanimationframe().
... hardare vertical refresh rate when the browser is ready to refresh the <canvas> within which your webxr content is displayed, it calls your frame rendering callback, which uses the specified timestamp and any other relevant data, such as models and textures, as well as application state, to render the scene—as it should appear at the specified time—into the webgl backbuffer.
...And 27 more matches
MMgc - Archive of obsolete content
it is a static library that is linked into the flash player but kept separate, and can be incorporated into other programs.
...another way to think about it: unmanaged memory is c++ operators new and delete managed memory is c++ operator new, with optional delete mmgc contains a page allocator called gcheap, which allocates large blocks (megabytes) of memory from the system and doles out 4kb pages to the unmanaged memory allocator (fixedmalloc) and the managed memory allocator (gc).
... each instance manages its own set of objects; objects are not allowed to reference objects in other gc instances.
...And 26 more matches
CustomizableUI.jsm
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.
...this can be useful if other parts of the code need to react to changes in the customization of the user interface.
...note that customizableui won't restore state in the area, allow the user to customize it in customize mode, or otherwise deal with it, until the area has been registered.
...And 26 more matches
XUL Structure - Archive of obsolete content
how xul is handled in mozilla, xul is handled in much the same way as html or other types of content are handled.
...style sheets (css), images, and other technologies are used to control the presentation.
...however, there are some features that are specific to html, such as forms, and others which are specific to xul, such as overlays.
...And 25 more matches
Drawing graphics - Learn web development
while you could use css and javascript to animate (and otherwise manipulate) svg vector images — as they are represented by markup — there was still no way to do the same for bitmap images, and the tools available were rather limited.
... the web still had no way to effectively create animations, games, 3d scenes, and other requirements commonly handled by lower level languages such as c++ or java.
... the situation started to improve when browsers began to support the <canvas> element and associated canvas api — apple invented it in around 2004, and other browsers followed by implementing it in the years that followed.
...And 25 more matches
Bytecode Descriptions
otherwise push false.
...pop two values, convert them to numeric values, subtract the top value from the other one, and push the result.
...format: jof_ic other expressions globalthis stack: ⇒ this push the global this value.
...And 25 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
xul, on the other hand, was conceived from the ground up as a markup language for user interfaces, and makes it possible to insert ui components with sophisticated features just by writing tags, without any particular scripting.
... xul display methods xul is used almost exclusively in mozilla applications like firefox and thunderbird, and extensions for them, but other web browsers based on firefox or the gecko engine, and even web-based content also used xul.
... fixme: explain how setting this option and use next listings if we want to run firefox displaying none of its gui and only the contents of a certain xul file, we can launch firefox and set the option: -chrome file_url.xul another way, as shown in listing 1, is to use the window.opendialog() method, which can be used only within a xul window.
...And 24 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
this means that a web application using those apis can only request resources from the same origin the application was loaded from unless the response from other origins includes the right cors headers.
...another article for server developers discussing cross-origin sharing from a server perspective (with php code snippets) is supplementary reading.
...additionally, for http request methods that can cause side-effects on server data (in particular, http methods other than get, or post with certain mime types), the specification mandates that browsers "preflight" the request, soliciting supported methods from the server with the http options request method, and then, upon "approval" from the server, sending the actual request.
...And 24 more matches
Mozilla
accessibility and mozilla accessibility is the idea that software (among other things) should be designed to be usable and, as much as possible, convenient to use for people with disabilities.
... bugzilla bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-tracking system, a database for recording bugs and enhancement requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects.
... building mozilla in this article, we list documents that will guide you in building firefox or other projects based upon mozilla code.
...And 23 more matches
The Essentials of an Extension - Archive of obsolete content
firefox needs this to distinguish your extension from other extensions, so it is required that you have an id that is unique.
...the other standard practice is to use a generated uuid string, which is extremely unlikely to be duplicated.
...there are many other tags that can be added, for contributors and translators.
...And 22 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
note that some other browsers such as safari are reporting (like gecko) in their user agent strings and can confuse simple tests.
...unlike other browsers, gecko is truly cross platform and provides consistent behavior across all supported operating systems.
...unfortunately, no other browser supports web standards as completely as gecko.
...And 22 more matches
LiveConnect Overview - Archive of obsolete content
this chapter describes using liveconnect technology to let java and javascript code communicate with each other.
... note: because java is a strongly typed language and javascript is weakly typed, the javascript runtime engine converts argument values into the appropriate data types for the other language when you use liveconnect.
...(although this functionality (along with some others) had been broken in gecko 1.9 (see bug 391642) as the mozilla-specific liveconnect code had not been maintained inside mozilla, with java 6 update 11 and 12 building support for reliance on mozilla's implementation of the generic (and cross-browser) npapi plugin code, this has again been fixed.) for example, suppose you are using the java forname method to assign the name of a java class to a va...
...And 22 more matches
Handling common accessibility problems - Learn web development
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 magnification/zoom to access text people with motor function impairments using the keyboard (or other non-mouse features) to activate website functionality.
... people with hearing impairments relying on captions/subtitles or other text alternatives for audio/video content.
...we've already talked about other spheres such as responsive design and performance in other places in the module.
...And 22 more matches
JSAPI User Guide
note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and jsapi.
...but in mozilla, all of these features are actually provided by other components, not the spidermonkey engine itself.
...they cannot travel to other runtimes or be shared across runtimes.
...And 22 more matches
Web video codec guide - Web media technologies
in some situations, a greater sacrifice of quality in order to bring down the data size is worth that lost quality; other times, the loss of quality is unacceptable and it's necessary to accept a codec configuration that results in a correspondingly larger file.
...if the codec converts the media into an internal pixel format, or otherwise represents the image using a means other than simple pixels, the format of the original image doesn't make any difference.
...to a point, the higher the frame rate, the smoother and more realistic the motion will appear.
...And 22 more matches
Handling common HTML and CSS problems - Learn web development
in other cases, nascent features are not supported consistently across browsers, which can make some features and styles not work for some users.
... note: one common problem with css and html arises when different css rules begin to conflict with one another.
... linters another good option to choose is a so-called linter application, which not only points out errors, but can also flag up warnings about bad practices in your css, and other points besides.
...And 21 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
other technologies besides html are generally used to describe a web page's appearance/presentation (css) or functionality/behavior (javascript).
...the attribute value must consist of a single printable character (which includes accented and other characters that can be generated by the keyboard).
...this value must be less than or equal to the value of maxlength, otherwise the value will never be valid, as it is impossible to meet both criteria.
...And 21 more matches
Handling common JavaScript problems - Learn web development
these days, most cross-browser javascript problems are seen: when poor-quality browser-sniffing code, feature-detection code, and vendor prefix usage block browsers from running code they could otherwise use just fine.
...install this first (using the install button), as other linters rely on it to work.
... after the packages have finished installing, try loading up a javascript file: you'll see any issues highlighted with green (for warnings) and red (for errors) circles next to the line numbers, and a separate panel at the bottom provides line numbers, error messages, and sometimes suggested values or other fixes.
...And 20 more matches
Starting WebLock
using them is a good way for objects to pass messages to each other without the objects having explicit knowledge of one another.
...if your object would like to register for this or other events, it first must implement the nsiobserver interface.
...in other words, the observe method should never be called in response to some event for which the object is not registered.
...And 20 more matches
Using IndexedDB - Web APIs
opening a database is just like any other operation — you have to "request" it.
...most other asynchronous functions in indexeddb do the same thing - return an idbrequest object with the result or error.
...it also means that you can't use a float, otherwise it will be converted to the closest lower integer and the transaction may not start, nor the upgradeneeded event trigger.
...And 20 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.
... in terms of accessibility, the use of certain color-combinations have more impact than others.
... how the viewer perceives color after it gets to his eyes is yet another matter, and can be affected by overall health.
...And 20 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
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 you're not an experienced c++ developer, i wouldn't even bother.
...And 19 more matches
Mozilla Crypto FAQ - Archive of obsolete content
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.
...shortly thereafter the nss developers began work on an open source implementation of the rsa algorithm; that code, together with code previously developed for other cryptographic algorithms, will be included in a new version 3.1 of the nss open source cryptographic and pki library.
... (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 code being developed as part of the mozilla project, see the pki project page and of course the source code itself.
...And 19 more matches
XUL accessibility guidelines - Archive of obsolete content
when creating an extension (for firefox or another xul application), make sure the keyboard shortcuts you assign do not interfere with those already defined by the base application.
...consider using context menu items or other xul elements along with keyboard shortcuts.
...other elements, such as arrowscrollbox and listbox, are made to scroll automatically.
...And 19 more matches
Introduction to SSL - Archive of obsolete content
most other red hat products plan to support the protocol in future versions.
...other protocols, such as the hypertext transport protocol (http), lightweight directory access protocol (ldap), or internet messaging access protocol (imap), run "on top of" tcp/ip in the sense that they all use tcp/ip to support typical application tasks such as displaying web pages or running email servers.
... these capabilities address fundamental concerns about communication over the internet and other tcp/ip networks: ssl server authentication allows a user to confirm a server's identity.
...And 19 more matches
An Overview of XPCOM
the goal of xpcom is to allow different pieces of software to be developed and built independently of one another.
...the most important use of xpcom is within gecko, an open source, standards compliant, embeddable web browser and toolkit for creating web browsers and other applications.
... modular, component-based programming makes software easier to develop and maintain and has some well-known advantages: benefit description reuse modular code can be reused in other applications and other contexts.
...And 19 more matches
Mozilla release FAQ - Archive of obsolete content
various other people have contributed to this faq.
...the project is maintained by employees of netscape (now a division of aol), red hat, some other companies, as well as contributors from the community.
...if built from cvs, the date of the cvs checkout is the best way to refer to the version, otherwise use the release number.
...And 18 more matches
Manipulating documents - Learn web development
in this article we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways.
... objective: to gain familiarity with the core dom apis, and the other apis commonly associated with dom and document manipulation the important parts of a web browser web browsers are very complicated pieces of software with a lot of moving parts, many of which can't be controlled or manipulated by a web developer using javascript.
...imagine if a web site could get access to your stored passwords or other sensitive information, and log into websites as if it were you?
...And 18 more matches
Inputs and input sources - Web APIs
by combining these two types of input with the changing of viewing position and/or orientation through the headset or other mechanisms, you can create an interactive simulated environment.
... motion-sensing controllers, which use accelerometers, magnetometers, and other sensors for motion tracking and targeting and may additionally include any number of buttons, joysticks, thumbpads, touchpads, force sensors, and so on to provide additional input sources for both targeting and selection.
... spatially-tracked articulated hands, such as haptic gloves can provide both targeting and squeeze actions, as well as selection if outfitted with buttons or other sources of selection actions.
...And 18 more matches
Introduction to client-side frameworks - Learn web development
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.
...users write papers, manage their budgets, stream music, watch movies, and communicate with others over great distances instantaneously, with text, audio or video chat.
...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.
...And 17 more matches
nsITextInputProcessor
createinstance(components.interfaces.nsitextinputprocessor); next, you need to get the rights to create composition or dispatch keyboard events with begininputtransaction() or begininputtransactionfortests(): if (!tip.begininputtransaction(window, callback)) { return; } if begininputtransaction() or begininputtransactionfortests() returns false, it means that another instance of nsitextinputprocessor has composition on the window or is dispatching an event.
... in this case, other instances cannot create composition nor dispatch keyboard events on the window.
... }); // the other attributes are always ignored.
...And 17 more matches
Web audio codec guide - Web media technologies
for more information about these and other features of audio data, see audio data format and structure in digital audio concepts.
...some of these are a matter of the form of the source audio; others are related to decisions made while encoding the audio.
... 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 pluck the important information out of imperfect or noisy audio.
...And 17 more matches
Performance fundamentals - Web Performance
all other things being equal, code optimized for some target besides user-perceived performance (hereafter upp) loses when competing against code optimized for upp.
...of course, it's by no means pointless to optimize other metrics, but real upp targets come first.
... memory usage memory usage is another key metric.
...And 17 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
8 other resources reference, svg here is a list of additional resources on svg: 9 project svg no summary!
...this allows representation of values that would otherwise be clamped to 0 or 1.
... 85 font-weight svg, svg attribute the font-weight attribute refers to the boldness or lightness of the glyphs used to render the text, relative to other fonts in the same font family.
...And 17 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
there will be no usage of the add-on sdk or any other external libraries here.
...if not, see if you still can't do things any other way.
... if you need to read data, or otherwise access files within your bundle, there are two options.
...And 16 more matches
Web Replay
replaying processes preserve all the same js behavior, dom structures, graphical updates, and most other behaviors that occurred while recording.
... this requires using the same build of firefox and a reasonably similar version of the operating system; otherwise the tab will probably crash.
... intra-thread non-deterministic behaviors are non-deterministic even in the absence of actions by other threads, and inter-thread non-deterministic behaviors are those affected by interleaving execution with other threads, and which always behave the same given the same interleaving.
...And 16 more matches
Handling Mozilla Security Bugs
at the same time, mozilla.org is also creating a larger "mozilla security bug group" by which mozilla contributors and others can participate in addressing security vulnerabilities in mozilla.
...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 financial information) could be exposed, users' data could be destroyed, and users' systems could be used as platforms for attacks on other systems.
...And 16 more matches
Window.open() - Web APIs
WebAPIWindowopen
this can be a path or url to an html page, image file, or any other resource that is supported by the browser.
...otherwise the call to window.open() will just create a new window.
...google chrome (55.0.2883.87 m ) on the other hand will do it only from the same parent (as if the window was created dependent, which is the "opener").
...And 16 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
they need to know about focus changes and other events, and it needs to know what objects are contained in the current document or dialog box.
...this is so commonly done, that no one even bothers to support the msaa caret, after all the hack is general solution works with pretty much all applications.
... myth: "msaa sucks" reality: this statement may come from another engineer or even an employee of an at vendor.
...And 16 more matches
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
all other elements must be descendants of this element.
...metadata for styles and scripts may be defined in the page or link to another file that has the information.
...this element is most commonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
...And 16 more matches
HTML: A good basis for accessibility - Learn web development
even better, semantic markup has other benefits beyond accessibility: easier to develop with — as mentioned above, you get some functionality for free, plus it is arguably easier to understand.
...an excellent semantic example might look something like the following: <h1>my heading</h1> <p>this is the first section of my document.</p> <p>i'll add another paragraph here too.</p> <ol> <li>here is</li> <li>a list for</li> <li>you to read</li> </ol> <h2>my subheading</h2> <p>this is the first subsection of my document.
...<br><br> i'll add another paragraph here too.
...And 15 more matches
HTML: A good basis for accessibility - Learn web development
even better, semantic markup has other benefits beyond accessibility: easier to develop with — as mentioned above, you get some functionality for free, plus it is arguably easier to understand.
...an excellent semantic example might look something like the following: <h1>my heading</h1> <p>this is the first section of my document.</p> <p>i'll add another paragraph here too.</p> <ol> <li>here is</li> <li>a list for</li> <li>you to read</li> </ol> <h2>my subheading</h2> <p>this is the first subsection of my document.
...<br><br> i'll add another paragraph here too.
...And 15 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.
... since also other contemporary browsers have a standards mode, activating the standards mode or the almost standards mode in other browsers as well (using the above-mentioned exact doctypes) is the best way to get consistent css layout results across different browsers.
... on the other hand, the quirks implemented in the quirks modes of different browsers vary from browser to browser.
...And 15 more matches
Drag Operations - Web APIs
for other elements, they must be part of a selection for a default drag to occur.
... in html, apart from the default behavior for images, links, and selections, no other elements are draggable by default.
... to make other html elements draggable, three things must be done: set the draggable="true" on the element that you wish to make draggable.
...And 15 more matches
Media container formats (file types) - Web media technologies
instead, it streams the encoded audio and video tracks directly from one peer to another using mediastreamtrack objects to represent each track.
...some support only audio while others support both audio and video.
...however, you may also encounter mp3, ogg, webm, avi, and other formats.
...And 15 more matches
The Implementation of the Application Object Model - Archive of obsolete content
rdf can suck up data from different places (like your bookmarks and history or another web site), and it can combine them.
...for example, the traditional bookmarks tree view could contain anything from mail messages to local files to maps of other sites.
... this same ability to aggregate data leads to another capability of rdf.
...And 14 more matches
The box model - Learn web development
previous overview: building blocks next 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.
...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.
... padding, margin and border will cause other elements to be pushed away from the box unless we decide to change the display type to inline, elements such as headings (e.g.
...And 14 more matches
Introduction to CSS layout - Learn web development
css page layout techniques allow us to take elements contained in a web page and control where they are positioned relative to their default position in normal layout flow, the other elements around them, their parent container, or the main viewport/window.
...let's look at a quick html example: <p>i love my cat.</p> <ul> <li>buy cat food</li> <li>exercise</li> <li>cheer up friend</li> </ul> <p>the end!</p> by default, the browser will display this code as follows: note here how the html is displayed in the exact order in which it appears in the source code, with elements stacked up on top of one another — the first paragraph, followed by the unordered list, followed by the second paragraph.
... the elements that appear one below the other are described as block elements, in contrast to inline elements, which appear one beside the other, like the individual words in a paragraph.
...And 14 more matches
Gecko info for Windows accessibility vendors
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.
...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 14 more matches
Building the WebLock UI
in this chapter, however, we are going to be building a user interface for the weblock component that's meant to be added to the existing mozilla browser[other-mozlike-browsers].
...the overlay section, where we discuss how to import scripts, images, and other resources from mozilla into your own ui, is by far the more complicated of the two.
... if the weblock component is being installed in mozilla or another gecko-based browser, then this third section shows you how to create the entry point in the browser for controlling the web locking.
...And 14 more matches
Creating the Component Code
an xpcom component needs to implement at least three interfaces that xpcom requires, and often others as well.
... component registration all xpcom components - whether they're stored in shared libraries (dlls, dsos, dylibs), javascript files, or otherwise - need to be registered before they can be used.
... registration is a process that happens in all xpcom applications, whether they're embedded gecko clients, mozilla, netscape 7, compuserve, or any other software that uses xpcom.
...And 14 more matches
nsIAnnotationService
if they haven't visited a page in a couple of months, they probably aren't interested in many other annotations, the positions of things, or other stuff you create, so put that in the weeks policy.
... do not use characters that are not valid in urls such as spaces, ":", commas, or most other symbols.
...for other types, only c++ consumers may use the type-specific methods.
...And 14 more matches
Debugger - Firefox Developer Tools
it is an accessor property with a getter and setter: assigning to it enables or disables this debugger instance; reading it produces true if the instance is enabled, or false otherwise.
... 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.
... assigning anything other than a callable value or null to this property throws a typeerror exception.
...And 14 more matches
Key Values - Web APIs
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.
... varies varies varies varies modifier keys modifiers are special keys which are used to generate special characters or cause special actions when used in combination with other keys.
...toggles the numeric keypad between number entry some other mode (often directional arrows).
...And 14 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
negotiation is an inherently asymmetric operation: one side needs to serve as the "caller" while the other peer is the "callee." the perfect negotiation pattern smooths this difference away by separating that difference out into independent negotiation logic, so that your application doesn't need to care which end of the connection it is.
... the best thing about perfect negotiation is that the same code is used for both the caller and the callee, so there's no repetition or otherwise added levels of negotiation code to write.
...a polite peer, essentially, is one which may send out offers, but then responds if an offer arrives from the other peer with "okay, never mind, drop my offer and i'll consider yours instead." an impolite peer, which always ignores incoming offers that collide with its own offers.
...And 14 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
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.
... by extension, if you and another person are standing in an empty field of solid stone with nothing else visible as far as the eye can see, if you move three meters toward the other person, the result looks the same as if the other person had moved three meters toward you.
... in single-screen 2d games, the camera is not associated directly with the player or any other character in the game, but is instead either fixed above or next to the game play area, or follows the action as the action moves around a scrolling game world.
...And 14 more matches
Lighting a WebXR setting - Web APIs
because the webxr device api relies on other technologies—namely, webgl and frameworks based upon it—to perform all rendering, texturing, and lighting of a scene, the same general lighting concepts apply to webxr settings or scenes as to any other webgl-generated display.
... because the bouncing and scattering of light can be expensive to compute in real time, especially if multiple light sources are involved, it's common to use ambient lighting to simulate the scattered light caused by all the other light sources in the scene, instead of actually calculating the true effect of light scattering.
...due to its directionality, the faces of an object facing a diffuse light source will be brighter than the other faces.
...And 14 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
alt valid for the image button only, the alt attribute provides alternative text for the image, displaying the value of the attribute if the image src is missing or otherwise fails to load.
... see the html autocomplete attribute for additional information, including information on password security and how autocomplete is slightly different for hidden than for other input types.
...(only the htmlinputelement’s checked idl attribute is updated.) note: unlike other input controls, a checkboxes and radio buttons value are only included in the submitted data if they are currently checked.
...And 14 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
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 gnome (one of the most popular guis for gnu/linux operating systems), and others.
...javascript also supports functional programming — because they are objects, functions may be stored in variables and passed around like any other object.
...they have methods as well that allow you to manipulate the string and access information about the string: 'hello'.charat(0); // "h" 'hello, world'.replace('world', 'mars'); // "hello, mars" 'hello'.touppercase(); // "hello" other types javascript distinguishes between null, which is a value that indicates a deliberate non-value (and is only accessible through the null keyword), and undefined, which is a value of type undefined that indicates an uninitialized variable — that is, a value hasn't even been assigned yet.
...And 14 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
duplication: copying a piece of software distribution: passing a piece of software to another person modification: modifying the software a typical software license will grant these permissions in return for a fee, and will still restrict some normally unrestricted uses.
...pen source definition stipulates the following minimum conditions: the integrity of the author’s source code must be preserved; no discrimination may be made against individuals or organizations; no discrimination may be made based on field of endeavor; no additional licensing can be required when redistributing; license must not be specific to a product; license must not interfere with other software.
...modifications to bsd-licensed software can be published under commercial licenses or other different licenses.
...And 13 more matches
Layout System Overview - Archive of obsolete content
in other words, the same html or xml document could be viewed as a normal galley presentation in a browser window, while simultaneously being presented in a paged presentation to a printer, or even an aural presentation to a speech-synthesizer.
...the style context is associated with the frame via a reference because it is needed for many other computations during the formatting of the frames.
...each frame implements a reflow method to compute its position and size, among other things.
...And 13 more matches
Organizing your CSS - Learn web development
in this article we will take a brief look at some best practices for writing your css to make it easily maintainable, and some of the solutions you will find in use by others to help improve maintainability.
...some developers put all of the rules onto a single line, like so: .box { background-color: #567895; } h2 { background-color: black; color: white; } other developers prefer to break everything onto a new line: .box { background-color: #567895; } h2 { background-color: black; color: white; } css doesn't mind which one you use.
...} 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.
...And 13 more matches
Making decisions in your code — conditionals - Learn web development
human beings (and other animals) make decisions all the time that affect their lives, from small ("should i eat one cookie or two?") to large ("should i stay in my home country and work on my father's farm, or should i move to america and study astrophysics?") conditional statements allow us to represent such decision making in javascript, from the choice that must be made (for example, "one cookie or two"), to the res...
...else syntax basic if...else syntax looks like the following in pseudocode: if (condition) { code to run if condition is true } else { run some other code instead } here we've got: the keyword if followed by some parentheses.
... a condition to test, placed inside the parentheses (typically "is this value bigger than this other value?", or "does this value exist?").
...And 13 more matches
Component Internals
a set of default libraries stored in this components directory makes up a typical gecko installation, providing functionality that consists of networking, layout, composition, a cross-platform user interface, and others.
... another, even more basic view of this relationship of components to the files and interfaces that define them is shown in onion peel view of xpcom component creation in the next chapter.
...another application may delay this startup until xpcom is needed for the first time.
...And 13 more matches
HTTP Index - HTTP
WebHTTPIndex
it was designed for communication between web browsers and web servers, but it can also be used for other purposes.
...this is used to explicitly allow some cross-origin requests while rejecting others.
...this header specifies a comma-delineated list of the http methods which may be used when using cors to access the url specified in the request; if the request is using any other method, this error occurs.
...And 13 more matches
JXON - Archive of obsolete content
all other information (like processing instructions, schemas, comments, etc.) will be lost.
... algorithm #2: a less verbose way here is another, simpler, conversion method, in which nodeattributes are listed under the same object of child nodes but have the “@” prefix (as suggested by the badgerfish convention).
... algorithm #3: a synthetic technique here is another method of conversion.
...And 12 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
in this article, i will describe mozilla's quirks mode, which provides strong backwards html compatibility with internet explorer and other legacy browsers.
...for example, rather than: if (ismozilla || isie5) you would use: if (document.getelementbyid) this would allow other browsers that support that w3c standard method, such as opera or safari, to work without any changes.
... for all other purposes you should check for the feature you need rather than the browsers you think will support that feature.
...And 12 more matches
Anatomy of a video game - Game development
other games demand control over each of the smallest possible individual timeslices.
...modern browsers strive to call methods right as they are needed and idle (or do their other tasks) in the gaps.
... some code needs to be run frame-by-frame so why attach that function to anything other than the browser's redraw schedule?
...And 12 more matches
Getting started with HTML - Learn web development
to get you started, this article defines elements, attributes, and all the other important terms you may have heard.
...you will learn how html elements are structured, how a typical html page is structured, and other important basic language features.
...the enclosing tags can make content into a hyperlink to connect to another page, italicize words, and so on.
...And 12 more matches
Introduction to automated testing - Learn web development
for example, this could be every time you save a file, or at some other point.
...(if you already have node and npm installed, jump to point 4) install it like you would any other program.
... note that node comes with node package manager (npm), which allows you to easily install packages, share your own packages with others, and run useful scripts on your projects.
...And 12 more matches
Package management basics - Learn web development
it makes more sense to use a package manager such as npm, as this will guarantee that the code is added and removed cleanly, as well as a host of other advantages.
... writing the code to include the package(s) in your application (this tends to be done using javascript modules, another subject that is worth reading up on and understanding).
... for example, if your project relied on webpack with a certain configuration, you'd want to ensure that if you installed that project on another machine or returned to it much later on, the configuration would still work.
...And 12 more matches
Localization content best practices
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.
...please select another.
... example: search %1$s for "%2$s" non-directional single, and double, quotation marks should be used in reference to html code, or other languages where ascii character usage is required, such as html.
...And 12 more matches
NSS API Guidelines
the areas which need the most work (both here and throughout the code) is: the relationship of the certificate library with just about every other component (most noticeably pkcs #12, pkcs #7, and pkcs #11) splitting low key and high key components more clearly the crypto wrappers (pkcs #11 wrappers) and high key pkcs #12 and pkcs #5 libraries nss compiles into the libraries described below.
...pkcs #12 can be used to to encode keys, and certificates, for export or import into other applications.
... ssl lib/ssl ssl.h, sslerr.h, sslproto.h, preenc.h secutil provides utility functions and data types used by other libraries.
...And 12 more matches
PKCS #11 Module Specs
in additions applications/libraries should be able to ignore additional name value pairs which are used to specify configuration for other applications.
...other applications and libraries can safely ignore this line.
...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).
...And 12 more matches
Mozilla internal string guide
es will outlive the string instance in addition, there is a special string class, ns[c]autostring, that additionally contains an internal 64-unit buffer (intended primarily for use on the stack), leading to a fourth ownership model: storage within an auto string's stack buffer auto strings will prefer reference counting an existing reference-counted buffer over their stack buffer, but will otherwise use their stack buffer for anything that will fit in it.
... there are a number of additional string classes: classes which exist primarily as constructors for the other types, particularly nsdependent[c]string and nsdependent[c]substring.
...nsliteral[c]string is trivially constructible and destructible, and therefore does not emit construction/destruction code when stored in statics, as opposed to the other string classes.
...And 12 more matches
Getting Started Guide
in fact, if two objects somehow end up owning each other (even transitively) it becomes difficult for either of those object to be reclaimed without adding some `out-of-band' mechanism for breaking the ownership cycle.
... nscomptr manages addref, release, and other red-tape for you.
... */ mfooptr = afooptr; additionally, the class using raw xpcom interface pointers will need a destructor to release mfooptr; and a constructor to ensure that mfooptr is initially set to null (or some other reasonable value).
...And 12 more matches
Debugger.Object - Firefox Developer Tools
this allows the code using each debugger instance to place whatever properties it likes on its own debugger.object instances, without worrying about interfering with other debuggers.
...this accessor may throw if the referent is a scripted proxy or some other sort of exotic object (an opaque wrapper, for example).
... callable true if the referent is a callable object (such as a function or a function proxy); false otherwise.
...And 12 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
when greetuser() calls localgreeting(), another context is created to run that function.
... when greetuser() calls localgreeting(), another context is created to run that function.
... when greetuser() calls localgreeting(), another context is created to run that function.
...And 12 more matches
ARIA Test Cases - Accessibility
screen magnifier should show the focused button or emulate any other standard behavior found in notification dialogs in windows or respective operating systems.
... n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoom (leopard) pass n/a pass pass zoomtext fail- announced as 'alert' pass - - orca - - - - button basic button button with description dojo nightly build -- lots of other types of buttons there as well.
... when the button is pressed, the menu should be tracked like any other menu.
...And 12 more matches
Content Processes - Archive of obsolete content
the problem with the multiprocess model is that add-ons and content are now in different processes, and scripts in one process cannot interact directly with scripts in another.
...the other emit function is associated with another event emitter: it was passed as an argument to the constructor of this event emitter, and made into a method.
... calling this method causes an event to be emitted on the other event emitter.
...And 11 more matches
lang/type - Archive of obsolete content
globals functions isundefined(value) returns true if value is undefined, false otherwise.
... isnull(value) returns true if value is null, false otherwise.
... isstring(value) returns true if value is a string, false otherwise.
...And 11 more matches
Appendix D: Loading Scripts - Archive of obsolete content
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.
...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 synchronously.
... flexibility: script tags provide a means to specify the character set and javascript version of the scripts to be loaded, which many other methods do not.
...And 11 more matches
Images, Tables, and Mysterious Gaps - Archive of obsolete content
there's another obvious fix, which is to make sure your document doesn't trigger the "standards"rendering mode.
...isplay: block;} consider this rule when applied to the following markup: <table cellspacing="0" cellpadding="0" border="0" width="500"> <tr><td><img src="nav1.gif"><img src="nav2.gif"><img src="nav3.gif"><img src="nav4.gif"><img src="nav5.gif"></td></tr> <tr><td style="background: red;"> <img src="smallred.gif" height="1" width="1"></td></tr> <tr><td> <p style="margin: 0.5em;">this is text in another cell of the table.
... within the textthere is an icon <img src="icon2.gif"> that indicates a link to another site.
...And 11 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
another benefit of this standards-based approach to ui development is that your application is cross-platform "out of the box".
... 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.
...our platform also can take advantage of other internet standards such as xslt and rdf.
...And 11 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
if you know how to program in javascript, then you can write your own code that does other things.
...use other tutorials and articles to find out more—the main extensions page here is a good starting point.
...seamonkey 2 is being reworked to support the same process as firefox, thunderbird and others.
...And 11 more matches
CSS and JavaScript accessibility best practices - Learn web development
to put it another way, it is important that you consider some best practice advice to make sure that your use of css and javascript doesn't ruin the accessibility of your documents.
... web: <p>visit the <a href="https://www.mozilla.org">mozilla homepage</a>.</p> some very simple link styling is shown below: a { color: #ff0000; } a:hover, a:visited, a:focus { color: #a60000; text-decoration: none; } a:active { color: #000000; background-color: #a60000; } the standard link conventions are underlined and a different color (default: blue) in their standard state, another color variation when the link has previously been visited (default: purple), and yet another color when the link is activated (default: red).
... another tip is to not rely on color alone for signposts/information, as this will be no good for those who can't see the color.
...And 11 more matches
WAI-ARIA basics - Learn web development
as another example, apps started to feature complex controls like date pickers for choosing dates, sliders for choosing values, etc.
...role="navigation" (<nav>) or role="complementary" (<aside>), but there are also others that describe different pages structures, such as role="banner", role="search", role="tabgroup", role="tab", etc., which are commonly found in uis.
... enhancing keyboard accessibility: there are built-in html elements that have native keyboard accessibility; when other elements are used along with javascript to simulate similar interactions, keyboard accessibility and screenreader reporting suffers as a result.
...And 11 more matches
UI pseudo-classes - Learn web development
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.
... there are many others too, but the ones listed above are the most obviously useful.
... some of the others are aimed at solving very specific niche problems, or simply not very well supported in browsers yet.
...And 11 more matches
Client-Server Overview - Learn web development
as part of processing the browser may discover links to other resources (e.g.
...the x-frame-options: deny line tells the browser not to allow this page to be embedded in an <iframe> in another site).
...the information is otherwise similar to that for the response to a get request.
...And 11 more matches
Server-side web frameworks - Learn web development
#list our other teams ) team_level = models.charfield(max_length=3,choices=team_levels,default='u11') the django model provides a simple query api for searching the database.
...templates are often used to create html, but can also create other types of document.
... web frameworks often provide a mechanism to make it easy to generate other formats from stored data, including json and xml.
...And 11 more matches
Website security - Learn web development
in other high-profile cases, millions of passwords, email addresses, and credit card details have been leaked into the public domain, exposing website users to both personal embarrassment and financial risk.
...other attacks can be mitigated through your web server configuration, for example by enabling https.
... cross-site scripting (xss) xss is a term used to describe a class of attacks that allow an attacker to inject client-side scripts through the website into the browsers of other users.
...And 11 more matches
Strategies for carrying out testing - Learn web development
note: you can only have one version of ie or edge installed on a machine at once, so you will probably have to use virtual machine, or other strategy to do the testing you need.
... the next page provides you with some code snippets and other instructions.
..."we have no firefox mobile users" might lead you to not bother supporting firefox mobile.
...And 11 more matches
Accessibility API cross-reference
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.
... aria is a standard developed as part of the web accessibility initiative, which uses markup syntax quite familiar to users of html, xml, sgml and others.
...aria can be used to 'fill out' the missing semantics of html, but may also be used in other markup languages (such as svg) and expresses semantics using attributes, compared with html, which tends to have distinct named elements for its roles.
...And 11 more matches
Using XPCOM Components
« previousnext » one of the best ways to begin working with xpcom - especially when you are designing the interface to a component that will be used by others, as we do in starting weblock - is to look at how clients are already using xpcom components.
...in fact, virtually all of the functionality that you associate with a browser - navigation, window management, managing cookies, bookmarks, security, searching, rendering, and other features - is defined in xpcom components and accessed by means of those component interfaces.
...the interfaces are public, in other words, and the implementations are private[private-xpcom-interfaces].
...And 11 more matches
Using XPCOM Utilities to Make Things Easier
though they overlap somewhat (e.g., high-level macros expand to other macros), they fall into the following general categories.
... the module macros include one set of macros that define the exported nsgetmodule entry point, the required nsimodule implementation code and another that creates a generic factory for your implementation class.
...the four required parts[other-parts] of the structure contain the following information: a human readable class name the class id (cid) the contract id (an optional but recommended argument) a constructor for the given object static const nsmodulecomponentinfo components[] = { { "pretty class name", cid, contract_id, constructor }, // ...
...And 11 more matches
nsIDOMWindowUtils
true if it's open, otherwise false.
..."basic" is unaccelerated; other types are accelerated.
... paintingsuppressed boolean true if painting is currently suppressed for this window; otherwise false.
...And 11 more matches
WebRTC connectivity - Web APIs
this article describes how the various webrtc-related protocols interact with one another in order to create a connection and transfer data and/or media among peers.
...the description includes information about the kind of media being sent, its format, the transfer protocol being used, the endpoint's ip address and port, and other information needed to describe a media transfer endpoint.
... when a user starts a webrtc call to another user, a special description is created called an offer.
...And 11 more matches
Background audio processing using AudioWorklet - Web APIs
with the processor registered, you can create a new audioworkletnode which passes the audio through the processor's code when the node is linked into the chain of audio nodes along with any other audio nodes.
... connect the created audioworkletnodes into your audio processing pipeline as you would any other node, then use your audio pipeline as usual.
... glitch project page see the code try it live creating an audio worklet processor fundamentally, an audio worklet processor (which we'll refer to usually as either an "audio processor" or simply as a "processor" because otherwise this article will be about twice as long) is implemented using a javascript module that defines and installs the custom audio processor class.
...And 11 more matches
window.postMessage() - Web APIs
normally, scripts on different pages are allowed to access each other if and only if the pages they originate from share the same protocol, port number, and host (also known as the "same-origin policy").
... broadly, one window may obtain a reference to another (e.g., via targetwindow = window.opener), and then dispatch a messageevent on it with targetwindow.postmessage().
... message data to be sent to the other window.
...And 11 more matches
position - CSS: Cascading Style Sheets
WebCSSposition
the offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static.
...it is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block.
...the margins of absolutely positioned boxes do not collapse with other margins.
...And 11 more matches
Redirections in HTTP - HTTP
they imply that the original url should no longer be used, and replaced with the new one.search engine robots, rss readers, and other crawlers will update the original url for the resource.
... others may or may not be changed to get.[1] reorganization of a web site.
... temporary redirections sometimes the requested resource can't be accessed from its canonical location, but it can be accessed from another place.
...And 11 more matches
Digital audio concepts - Web media technologies
sound enters the computer through a microphone or other input in the form of a stream of electrons whose voltage varies to represent the amplitude of the sound wave.
...the more samples you take, the smoother the wave becomes.
...most audio files use 16-bit signed integers for each sample, but others use 32-bit floating-point values or 24-bit or 32-bit integers.
...And 11 more matches
Image file type and format guide - Web media technologies
bit depth, on the other hand, is the total number of bits used to represent each pixel in memory.
... apng is ideal for basic animations that do not need to synchronize to other activities or to a sound track, such as progress indicators, activity throbbers, and other animated sequences.
... while other data representations are defined in the specification, they are not widely used and often completely unimplemented.
...And 11 more matches
Understanding WebAssembly text format - WebAssembly
so this is similar to functions in other languages, even if it looks different because it is an s-expression.
... 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.
... calling functions from other functions in the same module the call instruction calls a single function, given its index or name.
...And 11 more matches
StringView - Archive of obsolete content
ew in javascript) based upon the javascript arraybuffer interface to create a highly extensible library that anyone can extend by adding methods to the object stringview.prototype to create a collection of methods for such string-like objects (since now: stringviews) which work strictly on arrays of numbers rather than on creating new immutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data.
...nstartidx + nlength : ninptlen); break typeswitch; default: /* the input argument is an array or another serializable object: a new typedarray will be created.
...*/ 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...
...And 10 more matches
Custom toolbar button - Archive of obsolete content
if you know how to program in javascript, then you can write your own code that does other things.
...use other tutorials and articles to find out more—the main extensions page here is a good starting point.
... note: there is a similar tutorial for seamonkey 1.x on the page: custom toolbar button:seamonkey earlier versions and other mozilla applications also support extensions, but some parts of this tutorial are not appropriate for them.
...And 10 more matches
Templates - Archive of obsolete content
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.
... this example and any others that reference internal rdf datasources will only work if you load them from a chrome url.
...And 10 more matches
XUL element attributes - Archive of obsolete content
otherwise, events are passed to the element only.
...when multiple datasources are used, one may override an assertion from another.
...when multiple datasources are used, one may override an assertion from another.
...And 10 more matches
Gecko FAQ - Gecko Redirect 1
gecko is the open source browser engine designed to support open internet standards such as html 5, css 3, the w3c dom, xml, javascript, and others.
... gecko is used in multiple browsers, including mozilla firefox, seamonkey, and others.
...in other words, gecko will not only be displaying the document's content, but it will also be painting the scrollbars, toolbars, and menus on the screen as well.
...And 10 more matches
Fundamental text and font styling - Learn web development
here we'll go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing.
...text content effectively behaves like a series of inline elements, being laid out on lines adjacent to one another, and not creating line breaks until the end of the line is reached, or unless you force a line break manually using the <br> element.
... text layout styles: properties that affect the spacing and other layout features of the text, allowing manipulation of, for example, the space between lines and letters, and how the text is aligned within the content box.
...And 10 more matches
Client-side form validation - Learn web development
minlength and maxlength: specifies the minimum and maximum length of textual data (strings) min and max: specifies the minimum and maximum values of numerical input types type: specifies whether the data needs to be a number, an email address, or some other specific preset type.
... when an element is invalid, the following things are true: the element matches the :invalid css pseudo-class, and sometimes other ui pseudo-classes (e.g., :out-of-range) depending on the error, which lets you apply a specific style to invalid elements.
... validating against a regular expression another useful validation feature is the pattern attribute, which expects a regular expression as its value.
...And 10 more matches
Advanced text formatting - Learn web development
previous overview: introduction to html next there are many other elements in html for formatting text, which we didn't get to in the html text fundamentals article.
...here you'll learn about marking up quotations, description lists, computer code and other related text, subscript and superscript, contact information, and more.
...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.
...And 10 more matches
Introduction to events - Learn web development
the example output is as follows: it's not just web pages another thing worth mentioning at this point is that events are not unique to javascript — most programming languages have some kind of event model, and the way the model works often differs from javascript's way.
... in fact, the event model in javascript for web pages differs from the event model for javascript as it is used in other environments.
... 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.
...And 10 more matches
Introduction to the server side - Learn web development
it can even allow interaction with users of the site, sending notifications and updates via email or through other channels.
... a dynamic site can return different data for a url based on information provided by the user or stored preferences and can perform other operations as part of returning a response (e.g.
...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.
...And 10 more matches
Getting started with React - Learn web development
it's used 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.
...react and reactdom are often discussed in the same spaces as — and utilized to solve the same problems as — other true web development frameworks.
...And 10 more matches
Introduction to cross browser testing - Learn web development
you need to think about: different browsers other than the one or two that you use regularly on your devices, including slightly older browsers that some people might still be using, which don't support all the latest, shiniest css and javascript features.
... on the other hand, it is not ok for a site to work fine for sighted users, but be completely inaccessible for visually impaired users because their screen reader application can't read any of the information stored on it.
...as a web developer, you need to agree on a range of browsers and devices that the code definitely needs to work on with the site owner, but beyond that, you need to code defensively to give other browsers the best chance possible of being able to use your content.
...And 10 more matches
Setting up your own test automation environment - Learn web development
there are other ways, but the best way to use selenium is via webdriver, a powerful api that builds on top of selenium and makes calls to a browser to automate it, carrying out actions such as "open this web page", "move over this element on the page", "click this link", "see whether the link opens this url", etc.
... note: if you want to find out how to use webdriver with other server-side environments, also check out platforms supported by selenium for some useful links.
... create another new file inside your project directory called google_test_multiple.js.
...And 10 more matches
Mozilla Quirks Mode Behavior
add padding if the very first node in an li is another ul or ol (bug 98636).
... (this also applies to getelementsbyclassname.) stylesheets linked in the document with an advisory mime type of text/css will still be treated as css even if the server gives a content-type header other than text/css.
... the css parser interprets unitless numbers as px (except for line-height and any other properties where they have distinct meaning, and except in shorthands).
...And 10 more matches
Introduction to NSPR
the netscape portable runtime (nspr) api allows compliant applications to use system facilities such as threads, thread synchronization, i/o, interval timing, atomic operations, and several other low-level services in a platform-independent manner.
...each thread is an execution entity that is scheduled independently from other threads in the same process.
...this, and the fact that threads share an address space with other threads in the same process, makes it important to remember that threads are not processes .
...And 10 more matches
Shell global objects
unwrappedobjectshavesameshape(obj1, obj2) returns true iff obj1 and obj2 have the same shape, false otherwise.
...if an error occurred, throw the appropriate exception; otherwise, run the script and return its value.
...if an error occurred, throw the appropriate exception; otherwise, return the module object timeout([seconds], [func]) get/set the limit in seconds for the execution time for the current context.
...And 10 more matches
EventTarget.addEventListener() - Web APIs
if a passive listener does call preventdefault(), the user agent will do nothing other than generate a console warning.
...event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, when both elements have registered a handle for that event.
...that means that if the browser checks the value of the passive property on the options object, passivesupported will be set to true; otherwise, it will remain false.
...And 10 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.
... 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.
...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.
...And 10 more matches
Grammar and types - JavaScript
(spaces, tabs, and newline characters are considered whitespace.) comments the syntax of comments is the same as in c++ and in many other languages: // a one line comment /* this is a longer, * multi-line comment */ /* you can't, however, /* nest comments */ syntaxerror */ comments behave like whitespace, and are discarded during script execution.
...for example: var n = null; console.log(n * 32); // will log 0 to the console variable scope when you declare a variable outside of any function, it is called a global variable, because it is available to any other code in the current document.
... if (true) { let y = 5; } console.log(y); // referenceerror: y is not defined variable hoisting another unusual thing about variables in javascript is that you can refer to a variable declared later, without getting an exception.
...And 10 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
for example, in the firefox browser window, everything other than the web page being displayed in the content area is chrome.
... normal overlay: adding the xul-overlay instruction to the target xul document overlays it with another xul document cross-package overlay: adding a cross manifest permits one xul file to overlay another without any xul-overlay instruction.
...assuming you’ve done that, you’ll be able to confirm the changes to overlay.xul and clock.xul without the bother of relaunching firefox or reinstalling the extension.
...And 9 more matches
Menus - Archive of obsolete content
submenus may be created by nesting one menu inside of another.
...instead of creating a standard button, this will create a button with a small arrow or other indicator.
...this works just like it does for other buttons.
...And 9 more matches
OpenClose - Archive of obsolete content
for menupopups attached to other elements using the popup or context attributes, see opening a popup below.
... as with other ways of opening a menu, the popupshowing event will be fired to provide an opportunity to customize the commands that appear on the menu.
... if the menu is a child of another menu and the parent menu is not open.
...And 9 more matches
Anonymous Content - Archive of obsolete content
xbl content xbl can be used to automatically add a set of elements inside another element.
...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.
...these elements would in turn be bound to other bindings that use the base xul elements.
...And 9 more matches
Document Object Model - Archive of obsolete content
for example, the following two lines which open a new window are functionally equivalent: window.open("test.xul","_new"); open("test.xul","_new"); when you declare a function or a variable at the top level of a script, that is outside another function, you are actually declaring a property of the global object.
... function gettext(){ return "message"; } alert(gettext()); alert(window.gettext()); thus, if you want to access variables or call a function declared in a script used by another window, you just need to access it using the other window's window object.
... for example, if we combined the last two examples into a single file, we might want to call the gettext() function from within the other window (for example, the test.xul window).
...And 9 more matches
Archived Mozilla and build documentation - Archive of obsolete content
because of this close association between methods and attributes on the one hand, and content on the other, calicalendarview implementations are particularly well suited to xbl.
...a sequence of characters) that matches patterns of characters in other strings.
... devmo 1.0 launch roadmap comments, ideas, questions and other discussion should be added on the devmo talk:1.0 launch roadmap page.
...And 9 more matches
The Business Benefits of Web Standards - Archive of obsolete content
a lot of other sites would greatly increase their seo by simply using proper tags for the content.
...while some browsers have quirks that cause different behavior by platform, mozilla-based browsers are designed to behave identically on all supported platforms (mac, linux, unix, windows...) web content is increasingly being accessed by a growing number of user agents other than browsers, or by browsers on different platforms - for example mobile telephones.
...familiarity with dreamweaver or any other legacy software is not a good basis for hiring creative development personnel.
...And 9 more matches
What is CSS? - Learn web development
a document is usually a text file structured using a markup language — html is the most common markup language, but you may also come across other markup languages such as svg or xml.
...there are other user agents available — such as those which convert html and css documents into pdfs to be printed.
... a css stylesheet will contain many such rules, written one after the other.
...And 9 more matches
Styling links - Learn web development
link states the first thing to understand is the concept of link states — different states that links can exist in, which can be styled using different pseudo-classes: link (unvisited): the default state that a link resides in, when it isn't in any other state.
...you should at least: use underlining for links, but not for other things.
... if you don't want to underline links, at least highlight them in some other way.
...And 9 more matches
Creating hyperlinks - Learn web development
hyperlinks allow us to link documents to other documents or resources, link to specific parts of documents, or make apps available at a web address.
... almost any web content can be converted to a link so that when clicked or otherwise activated the web browser goes to another web address (url).
... anatomy of a link a basic link is created by wrapping the text or other content, see block level links, inside an <a> element and using the href attribute, also known as a hypertext reference, or target, that contains the web address.
...And 9 more matches
Graceful asynchronous programming with Promises - Learn web development
since getusermedia() has to ensure that the user has permission to use those devices and ask the user which microphone to use and which camera to use (or whether to be a voice-only call, among other possible options), it can block until not only all of those decisions are made, but also the camera and microphone have been engaged.
...it then calls getusermedia(), asking for a stream that has both video and audio tracks, then once that's been obtained, sets up a video element to show the stream coming from the camera as a "self view," then takes each of the stream's tracks and adds them to the webrtc rtcpeerconnection representing a connection to another user.
...mething like this: choosetoppings(function(toppings) { placeorder(toppings, function(order) { collectorder(order, function(pizza) { eatpizza(pizza); }, failurecallback); }, failurecallback); }, failurecallback); this is messy and hard to read (often referred to as "callback hell"), requires the failurecallback() to be called multiple times (once for each nested function), with other issues besides.
...And 9 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
it's important to know that you can (and often will) run other code before a settimeout() call executes, or between iterations of setinterval().
...(in other words, when the stack is empty.) you will learn more on this matter as you progress through this article.
... in any case, these functions are used for running constant animations and other background processing on a web site or application.
...And 9 more matches
Client-side storage - Learn web development
you will see that if you load two websites (say google.com and amazon.com) and try storing an item on one website, it won't be available to the other website.
... this makes sense — you can imagine the security issues that would arise if websites could see each other's data!
... note: there is another, slightly more complex example to explore at using the web storage api.
...And 9 more matches
What is JavaScript? - Learn web development
it is the third layer of the layer cake of standard web technologies, two of which (html and css) we have covered in much more detail in other parts of the learning area.
...(okay, not everything, but it is amazing what you can achieve with a few lines of javascript code.) the three layers build on top of one another nicely.
... 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.
...And 9 more matches
Displaying Places information using views
you may specify as few or as many of these magic columns as you want, and your tree may of course contain other columns as well.
...this is useful when you need the id for another purpose or when a treecol is contained in anonymous content, as in xbl.
...if you need to display additional data or otherwise require more control over your view, you may need to write your own.
...And 9 more matches
Script security
the rules for determining whether an object is same-origin with another, and what access is allowed cross-origin, are now mostly standardized across browsers.
... security policy gecko implements the following security policy: objects that are same-origin are able to access each other freely.
... for example, the objects associated with a document served from https://example.org/ can access each other, and they can also access objects served from https://example.org/foo.
...And 9 more matches
HTTP Cache
other parallel openers of the same cache entry are blocked (wait) for invocation of their oncacheentryavailable until one of the following occurs: the writer simply throws the entry away: other waiting opener in line gets the entry again as "new", the cycle repeats.
... the writer stored all necessary meta data in the cache entry and called metadataready on it: other consumers now get the entry and may examine and potentially modify the meta data and read the data (if any) of the cache entry.
... 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.
...And 9 more matches
IPDL Tutorial
the c++ signature will accept a pprotocolparent* on one side and convert it to a pprotocolchild* on the other.
...maybe); }; custom primitive types when you need to send data of a type other than one built into ipdl, you can add a using declaration in an ipdl specification.
... struct namevaluepair { nscstring name; nscstring value; }; in implementation code, these structs can be created and used like so: namevaluepair entry(astring, anotherstring); foo(entry.name(), entry.value()); // named accessor functions return references to the members arrays ipdl has simple syntax for arrays: invokemethod(nscstring[] args); in c++ this is translated into a nstarray reference: virtual bool recvinvokemethod(nstarray<nscstring>& args); ipdl's generated data structures can be used in several protocols if they are defined in a separate...
...And 9 more matches
source-editor.jsm
ignorecase boolean true if the search was case sensitive; otherwise false.
... return value true if there are changes that can be redone, otherwise false.
... return value true if there are changes that can be undone, otherwise false.
...And 9 more matches
Hacking Tips
it is separated in 2 parts, one section related to debugging and another section related to drafting optimizations.
...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.
... one way to investigate is to let valgrind start gdb for you, the other way documented here is to let valgrind act as a gdb server which can be manipulated from the gdb remote.
...And 9 more matches
TPS Tests
} note that in this example, the foobar@restmail.net account must be registered on stage, otherwise authentication will fail (and the whole test will fail as well.
...typically there are two profiles used, but any number of profiles could be used in theory (other than 0).
... phase implementation (mandatory) it's worth noting that some parts of tps assume that it can read the number off the end of the phase or profile to get to the next one, so try to stick to the convention established in the other tests.
...And 9 more matches
Gecko Roles
role_window represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window.
... role_grouping logically groups other objects.
... role_statictext represents read-only text, such as labels for other controls or instructions in a dialog box.
...And 9 more matches
nsIAccessibleRole
role_window 9 represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window.
... role_grouping 20 logically groups other objects.
... role_statictext 41 represents read-only text, such as labels for other controls or instructions in a dialog box.
...And 9 more matches
nsITreeView
return value true if a drop is allowed at the current location; otherwise false.
...otherwise false.
...otherwise false.
...And 9 more matches
nsIURI
vice.newuri(aurl, aorigincharset, abaseuri); } components of a uri prepath path scheme userpass host port ref ftp :// username@password @ hostname : portnumber /pathname?query=value #ref method overview nsiuri clone(); nsiuri cloneignoringref(); boolean equals(in nsiuri other); boolean equalsexceptref(in nsiuri other); autf8string resolve(in autf8string relativepath); boolean schemeis(in string scheme); attributes attribute type description asciihost acstring the uri host with an ascii compatible encoding.
...other parts are url-escaped per the rules of rfc3986.
... if this value is something other than utf-8 then the uri components (for example spec, prepath, username, and so on) are all fully url-escaped.
...And 9 more matches
nsIZipWriter
if the operation is performed on the queue then the channel will be opened asynchronously, otherwise the channel must support being opened synchronously.
... ns_error_in_progress the zip writer is already performing another operation.
... ns_error_in_progress the zip writer is already performing another operation.
...And 9 more matches
XPIDL
types can of course be one of the fundamental types, or any other type declared via a typedef, interface, or a native type.
... other webidl types (e.g.
...furthermore, interfaces can also inherit from another interface.
...And 9 more matches
Using images - Web APIs
you can even use the image produced by other canvas elements on the same page as the source!
... importing images into a canvas is basically a two step process: get a reference to an htmlimageelement object or to another canvas element as a source.
... htmlcanvaselement you can use another <canvas> element as your image source.
...And 9 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
this lets the given function run without the risk of interfering with another script's execution, yet also ensures that the microtask runs before the user agent has the opportunity to react to actions taken by the microtask.
... javascript promises and the mutation observer api both use the microtask queue to run their callbacks, but there are other times when the ability to defer work until the current event loop pass is wrapping up.
... the event loop driving your code handles these tasks one after another, in the order in which they were enqueued.
...And 9 more matches
Fundamentals of WebXR - Web APIs
mixed reality is a large and complex subject, with much to learn and many other apis to bring together in order to create an engaging experience for users.
...this includes both managing the process of rendering the views needed to simulate the 3d experience and the ability to sense the movement of the headset or other motion sensing apparatus to provide the needed data to let you update the imagery shown to the user based on that movement.
... another key difference is that webxr has integrated support for the advanced input controllers that are used with most mixed reality headsets, while webvr relied on the gamepad api to support the controllers.
...And 9 more matches
Geometry and reference spaces in WebXR - Web APIs
however, in order to provide the ability to present scenes in true 3d using xr headsets and other such equipment, webxr has additional concepts that must be understood.
... in this article, we introduce the ways in which webxr expands upon the geometry of webgl, and how the positions and orientations of objects—both physical and virtual—are described in relation to one another using spaces and, in particular, reference spaces.
... the article spatial tracking in webxr builds upon the information provided here to cover how the physical position and orientation of the user's head, as well as potentially other parts of their body such as the hands, are mapped into the digital world, as well as how the relative positions of both physical and virtual objects are tracked as they move around, so that the scene can be properly rendered and composited.
...And 9 more matches
Starting up and shutting down a WebXR session - Web APIs
otherwise, the polyfill falls back to an implementation which uses google's cardboard vr api.
...additionally, it is updated to maintain compatibility with browsers as their support for webxr and other technologies related to it and to the implementation of the polyfill change over time.
... other improvements include updating the emulator to rename the xr interface to xrsystem, introduce support for squeeze (grip) input sources, and add support for the xrinputsource property profiles.
...And 9 more matches
Cognitive accessibility - Accessibility
other permanent cognitive impairments include aphasia, speech and language, autism, add/adhd, dyslexia, and dyscalculia.
...another form it can take is depression, such as when mourning the loss of a loved one, or being momentarily saddened by a tweet or video they just saw online.
... if moving, blinking, scrolling, or auto-updating information starts automatically, lasts more than five seconds, and is presented in parallel with other content, the user must able to pause, stop, hide or control it, unless it's an essential functionality.
...And 9 more matches
Perceivable - Accessibility
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.
...see other text alternative mechanisms for the argument against longdesc.
... see text alternatives for static caption options, and audio transcripts, video text tracks, and other multimedia content for other alternatives.
...And 9 more matches
Browser detection using the user agent - HTTP
also, experts, or simply people with another point of view, can give you ideas for working around the bug.
...browser makers do pay attention to bug reports, and the analysis may hint about other workarounds for the bug.
...this is the worst reason to use user agent detection because odds are eventually all the other browsers will catch up.
...And 9 more matches
Functions - JavaScript
in javascript, functions are first-class objects, because they can have properties and methods just like any other object.
... what distinguishes them from other objects is that functions can be called.
... to return a value other than the default, a function must have a return statement that specifies the value to return.
...And 9 more matches
Authoring MathML - MathML
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.
...of course, the list is by no means exhaustive and you are invited to check out the w3c mathml software list where you can find various other tools.
...there is also a similar script to display a warning at the top of the page for browsers without good mathml support and let the users choose between one of the fallback above: <script src="https://fred-wang.github.io/mathml-warning.js/mpadded-min.js"></script> if you don't want to use this link to github but instead to integrate these polyfills or others in your own project, you might need the detection scripts to verify the level of mathml support.
...And 9 more matches
Content Scripts - Archive of obsolete content
there are five basic principles: the add-on's main code, including "main.js" and other modules in "lib", can use the sdk high-level and low-level apis, but can't access web content directly content scripts can't use the sdk's apis (no access to globals exports, require) but can access web content sdk apis that use content scripts, like page-mod and tabs, provide functions that enable the add-on's main code to load content scripts into web pages content scripts can be loaded in a...
... a message-passing api allows the main code and content scripts to communicate with each other this complete add-on illustrates all of these principles.
...b.attach({ contentscript: ['document.body.style.border = "5px solid red";', 'window.alert("hi");'] }); }); // main.js var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: [data.url("jquery.min.js"), data.url("my-content-script.js")] }); if you do this, the scripts can interact directly with each other, just like scripts loaded by the same web page.
...And 8 more matches
Intercepting Page Loads - Archive of obsolete content
some of the techniques presented here apply only to content loaded in the main browser area, while others detect content being loaded in other xul windows, or even detect xul content being loaded.
...you can close the tab, redirect the tab to about:blank or another page, or tell the browser to stop loading this page, but in general you don't want to do this because it will be visible to the user and it will look like a bug.
... http observers another common way of detecting and intercepting loads is using http observer topics.
...And 8 more matches
JavaScript Object Management - Archive of obsolete content
« previousnext » chrome javascript in this section we'll look into how to handle javascript data effectively, beginning with chrome code, in ways which will prevent pollution of shared namespaces and conflicts with other add-ons resulting from such global namespace pollution.
... the first step to good javascript object management is having a namespace, or a javascript object that contains our code and data, that you know will not conflict with firefox code or other extensions.
... javascript has a host of features that make it extremely flexible, but it also has some disadvantages, as it is not as strict as other languages, such as java.
...And 8 more matches
The Box Model - Archive of obsolete content
an hbox is oriented horizontally by default, meaning that its child nodes are displayed next to each other from left to right.
... a vbox is oriented vertically by default, its child nodes displayed one below the other from top to bottom.
...the same applies to a vbox, but in the other direction.
...And 8 more matches
Source code directories overview - Archive of obsolete content
tools contains scripts for automatically generating certain source code and other special tools for building this module.
...the format of the date and time for different cultures) and other localization facilities.
...it includes all the code for managing mail, reading newsgroup messages, importing other mail formats, composing new messages and so on.
...And 8 more matches
Style System Overview - Archive of obsolete content
style system style sheets & rules ↓ rule tree ↓ style context interface style sheets & rules nsistyleruleprocessor and nsistylesheet describe in c++ what a css stylesheet can do nsistylerule describes in c++ what a css style rule can do main implementations are for css, but we have other implementations in c++ that: do what css can't do do things faster than css would css style sheets at basic level, sheet is collection of rules other special things: @import, @media, @namespace, etc.
... detail: !important declarations cause an extra rule object cssimportantrule to be created since they are in a separate part of the cascade other nsistylerule implementations nshtmlmappedattributes represents stylistic html attributes turned into a style rule (one instance per unique set of attributes) bodyrule handles marginwidth/marginheight mixes on body and on frame.
... various rules in nshtmlstylesheet.cpp do other things with presentational color-related attributes and with tables.
...And 8 more matches
TCP/IP Security - Archive of obsolete content
other commonly used protocols at the network layer are internet control message protocol (icmp) and internet group management protocol (igmp).
... another good source of information is nist sp 800-52, guidelines on the selection and use of transport layer security, available from https://csrc.nist.gov/publications/nistpubs/.) the use of tls typically requires each application to support tls; however, unlike application layer controls, which typically involve extensive customization of the application, transport layer controls such as tls are much l...
... another advantage of network layer controls is that since ip information (e.g., ip addresses) is added at this layer, the controls can protect both the data within the packets and the ip information for each packet.
...And 8 more matches
Game promotion - Game development
if you make a good game for a competition and win some prizes in the process your game will automatically be promoted by the organizers and other attendees.
...continually publishing information about your games will help educate others, increase your reputation in the community, and further improve seo.
... social media your social media presence is very important — follow the right hashtags, make friends, engage in conversations, help other devs in need.
...And 8 more matches
Cascade and inheritance - Learn web development
while working through this lesson may seem less immediately relevant and a little more academic than some other parts of the course, an understanding of these things will save you much pain later on!
... let's start by taking a quick look at the key things we are dealing with, then we'll look at each in turn and see how they interact with each other and your css.
... we'll explain specificity scoring and other such things later on.
...And 8 more matches
CSS values and units - Learn web development
<percentage> a <percentage> represents a fraction of some other value, for example 50%.
... percentage values are always relative to another quantity, for example an element's length is relative to its parent element's length.
...the benefit of using relative units is that with some careful planning you can make it so the size of text or other elements scale relative to everything else on the page.
...And 8 more matches
Positioning - Learn web development
previous overview: css layout next positioning allows you to take elements out of the normal document layout flow, and make them behave differently; for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
...or if you want to create a ui element that floats over the top of other parts of the page, and/or always sits in the same place inside the browser window no matter how much the page is scrolled?
...this is very similar to static positioning, except that once the positioned element has taken its place in the normal layout flow, you can then modify its final position, including making it overlap other elements on the page.
...And 8 more matches
Document and website structure - Learn web development
basic sections of a document webpages can and will look pretty different from one another, but they all tend to share similar standard components, unless the page is displaying a fullscreen video or game, is part of some kind of art project, or is just badly structured: header: usually a big strip across the top with a big heading, logo, and perhaps a tagline.
... this usually stays the same from one webpage to another.
...like the header, this content usually remains consistent from one webpage to another — having inconsistent navigation on your website will just lead to confused, frustrated users.
...And 8 more matches
Third-party APIs - Learn web development
third party apis, on the other hand, are located on third party servers.
... other apis may require that you include the key in a slightly different way, but the pattern is relatively similar for most of them.
... extending the mapquest example let's add some more functionality to the mapquest example to show how to use some other features of the api.
...And 8 more matches
Getting started with Svelte - Learn web development
svelte: a new approach to building rich user interfaces svelte provides a different approach to building web apps than some of the other frameworks covered in this module.
...it arguably has fewer concepts and tools to learn than some of the other framework options.
... it extends css by adding a scoping mechanism, allowing each component to define their own styles without the risk of clashing with other component's styles.
...And 8 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
and that makes sense, because otherwise svelte would be aware of the inner workings of the foreach() method; the same would therefore be true for any method attached to any object or array.
... 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 {...t, completed: completed} }) } in this case we are using the map() method, which returns a new a...
... add the following import statement below the others inside todos.svelte: import newtodo from './newtodo.svelte' and update the addtodo() function like so: function addtodo(name) { todos = [...todos, { id: newtodoid, name, completed: false }] } addtodo() now receives the name of the new todo directly, so we no longer need the newtodoname variable to give it its value.
...And 8 more matches
Command line crash course - Learn web development
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 number of others are installable from package registries.
... windows as with some other programming tools, using the terminal (or command line) on windows has traditionally not been as simple or easy as on other operating systems.
...if you wanted to go to a directory called src, located inside a directory called project, located on the desktop, you could type these three commands to get there from your home folder: cd desktop cd project cd src but this a waste of time — instead, you can type one command, with the different items in the path separated by forward slashes, just like you do when specifying paths to images or other assets in css, html, or javascript code: cd desktop/project/src note that including a leading slash on your path makes the path absolute, for example /users/your-user-name/desktop.
...And 8 more matches
Client-side tooling overview - Learn web development
you can also find linting tools for other languages, such as csslint.
...there is usually a way of controlling and coordinating what changes are made to the "master" copy of the code, and when, so a team of developers doesn’t end up overwriting each other’s work all the time.
... webpack is another very popular packaging tool that does similar things.
...And 8 more matches
The Firefox codebase: CSS Guidelines
also, it is good practice to introduce a common class when the new element you are styling reuses some styles from another element, this allows the maintenance cost and the amount of code duplication to be reduced.
... other tips assume ="true" in attribute selectors.
... once the two things above have been checked, check if the other rule you are overriding contains !important, if that is case, try putting it in question, because it might have become obsolete.
...And 8 more matches
IME handling guide
this is a technical term from windows but these days, this is used on other platforms as well.
...otherwise, we call it "ime is open".
... one of the other important jobs of this is, when a focused editor handles a dispatched ecompositionchange event, this modifies the stored composition string and its clause information.
...And 8 more matches
about:memory
it also lets you do other memory-related operations like trigger gc and cc, dump gc & cc logs, and dump dmd reports.
... 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.
...this will cause the privacy-sensitive data to be stripped out, but it may also make it harder for others to investigate the memory usage.
...And 8 more matches
Mozilla Projects
mozilla has a number of projects other than firefox itself.
... many of these are components of firefox or are tools used to create firefox, but may be used by other projects as well.
... compare-locales compare-locales is a python script that helps localizers to check their work without running firefox or another application.
...And 8 more matches
Observer Notifications
unless otherwise noted you register for the topics using the nsiobserverservice.
... topic description browser:purge-session-history sent when the sanitizer runs to purge all history and other information.
... browser:purge-domain-data sent after domain-specific history and other information have been purged.
...And 8 more matches
nsIFile
otherwise it returns false.
...otherwise it returns false.
...otherwise it returns false.
...And 8 more matches
nsIPrincipal
boolean equals(in nsiprincipal other); jsprincipals getjsprincipals(in jscontext cx); native code only!
... boolean subsumes(in nsiprincipal other); attributes attribute type description certificate nsisupports the certificate associated with this principal, if any.
...note: other policies might override this, such as the access-control specification.
...And 8 more matches
Reference Manual
reference-counting safeguards all of the operations that extract the underlying raw pointer out of an nscomptr use a c trick to implement another safety feature.
...such a cast can easily by-pass nscomptrs machinery, causing leaks, type mismatches, and other calamities.
...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.
...And 8 more matches
Timing element visibility with the Intersection Observer API - Web APIs
it turns out that one of the most common uses of flash or other script in advertising on the web is to record how long each ad is visible, for the purpose of billing and payment of revenues.
... without the intersection observer api, this winds up being done using intervals and timeouts for each individual ad, or other techniques that tend to slow the page down.
...we'll be using css grid to style and lay out the site, so we can be pretty straightforward here: <div class="wrapper"> <header> <h1>a fake blog</h1> <h2>showing intersection observer in action!</h2> </header> <aside> <nav> <ul> <li><a href="#link1">a link</a></li> <li><a href="#link2">another link</a></li> <li><a href="#link3">one more link</a></li> </ul> </nav> </aside> <main> </main> </div> this is the framework for the entire site.
...And 8 more matches
RTCPeerConnection - Web APIs
if sctp hasn't been negotiated, this value is null.signalingstate read only the read-only signalingstate property on the rtcpeerconnection interface returns one of the string values specified by the rtcsignalingstate enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer.
...this happens whenever the local ice agent needs to deliver a message to the other peer through the signaling server.oniceconnectionstatechange the rtcpeerconnection.oniceconnectionstatechange property is an event handler which specifies a function to be called when the iceconnectionstatechange event is fired on an rtcpeerconnection instance.
...instead of using this obsolete method, you should instead use addtrack() once for each track you wish to send to the remote peer.addtrack()the rtcpeerconnection method addtrack() adds a new media track to the set of tracks which will be transmitted to the other peer.close() the rtcpeerconnection.close() method closes the current peer connection.createanswer() the createanswer() method on the rtcpeerconnection interface creates an sdp answer to an offer received from a remote peer during the offer/answer negotiation of a webrtc connection.
...And 8 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
other hardware elements can be used similarly to represent other parts of the body, providing additional data to use when simulating the user's actions in their environment.
... 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 offset from another coordinate system that is itself defined by some other space.
... the target ray; each controller or other handheld device may have a targeting ray associated with it, which is represented by a space whose origin is at the point on the controller at which the ray is emitted, and is oriented so that -z extends in the direction of the target it's pointing at.
...And 8 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
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.
...modern layout methods encompass the range of writing modes and so we no longer assume that a line of text will start at the top left of a document and run towards the right hand side, with new lines appearing one under the other.
...And 8 more matches
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
some of the items may have a position on the grid, but others may be auto-placed.
...otherwise they will stay by default in the order that they are entered in the document source.
...you can see how those items are placed and the other items then auto-place in the spaces.
...And 8 more matches
background-position - CSS: Cascading Style Sheets
the other dimension is then set to 50%, so the item is placed in the middle of the edge specified.
... 2-value syntax: one value defines x and the other defines y.
...if left or right are given here, then this defines x and the other given value defines y.
...And 8 more matches
Creating a cross-browser video player - Developer guides
note: ie9 behaves differently than most other browsers when a poster attribute is set.
...ie9 will only use the specified poster image in this way if preload="none" is set; otherwise, it will take the first still of the video and display that instead.
...in addition, the fullscreen button will use the fullscreen api, another w3c api that controls the ability of web browsers to show apps using your computer's full screen.
...And 8 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
among the options for the shadow is the shadow's base color (which is then blurred and blended with the background based on the other parameters).
...this outline is different from the border in that it doesn't get space set aside for it in the document (so it may overlap other content).
... other ways to use color css isn't the only web technology that supports color.
...And 8 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
not allowed annotation annotation opener creates an auxiliary browsing context if the hyperlink would otherwise create a top-level browsing context that is not anauxiliary browsing context (i.e., has "_blank" as target attribute value).
...if the attribute is omitted or if none of the values in the attribute are supported, then the document has no particular relationship with the destination resource other than there being a hyperlink between the two.
... note: apple's ios does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a webpage icon for web clip or a start-up placeholder.
...And 8 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
(only the htmlinputelement’s checked idl attribute is updated.) note: unlike other input controls, a checkboxes value is only included in the submitted data if the checkbox is currently checked.
... unlike other browsers, firefox by default persists the dynamic checked state of an <input> across page loads.
...this may happen, for instance, if the state of the checkbox depends on multiple other checkboxes, and those checkboxes have different values.
...And 8 more matches
HTML: Hypertext Markup Language
WebHTML
other technologies besides html are generally used to describe a web page's appearance/presentation (css) or functionality/behavior (javascript).
... "hypertext" refers to links that connect web pages to one another, either within a single website or between websites.
...by uploading content to the internet and linking it to pages created by other people, you become an active participant in the world wide web.
...And 8 more matches
MIME types (IANA media types) - HTTP
each type has its own set of possible subtypes, and a mime type always has both a type and a subtype, never just one or the other.
... discrete types the discrete types currently registered with the iana are: applicationlist at iana any kind of binary data that doesn't fall explicitly into one of the other types; either data that will be executed or interpreted in some way or binary data that requires a specific application or category of application to use.
...other common examples include application/pdf, application/pkcs8, and application/zip.
...And 8 more matches
Details of the object model - JavaScript
an instance, on the other hand, is the instantiation of a class; that is.
...in addition, any object can be associated as the prototype for another object, allowing the second object to share the first object's properties.
...a constructor method can specify initial values for the instance's properties and perform other processing appropriate at creation time.
...And 8 more matches
Populating the page: how browsers work - Web Performance
it occurs whenever a user requests a page by entering a url into the address bar, clicking a link, submitting a form, as well as other actions.
... tls negotiation for secure connections established over https, another "handshake" is required.
... <!doctype html> <html> <head> <meta charset="utf-8"/> <title>my simple page</title> <link rel="stylesheet" src="styles.css"/> <script src="myscript.js"></script> </head> <body> <h1 class="heading">my page</h1> <p>a paragraph with a <a href="https://example.com/about">link</a></p> <div> <img src="myimage.jpg" alt="image description"/> </div> <script src="anotherscript.js"></script> </body> </html> this response for this initial request contains the first byte of data received.
...And 8 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
other articles will discuss the functionality in more detail, but here we're interested in the layout.
...when you click on an image in the gallery it brings up options to delete or cancel deletion of the card, and you don't want two buttons on top of one another.
... font-size: 6.8vw; -webkit-flex: 1; -moz-flex: 1; -ms-flex: 1; flex: 1; border-left: 1px solid rgba(100,100,100,0.4); } nav button:first-child { border-left: 0; } } in this last set of rules, we change the display value of the <nav> to flex to make it show (it was set to none in the default css at the top of the stylesheet, as it wasn't needed for the other views.) we then use absolute positioning and z-index to make it take up no space in the document flow, and sit on top of the x-cards (this is why we gave the x-cards that top-margin earlier).
...And 8 more matches
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
later, we will learn how paths can be transformed to suit other needs.
...there is no real performance penalty or bonus for using one or the other.
...the other two are control points.
...And 8 more matches
Modules - Archive of obsolete content
like any other custom loader, cuddlefish is created using the loader constructor.
...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.
...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 = instance.getservice(ci.mozijssubscriptloader); function loadscript(url) { loader.loadsubscript(url); } when a script is loaded, it is evaluated in the scope of the global object of the script that loaded it.
...And 7 more matches
Extension Etiquette - Archive of obsolete content
ideally, the location would be below the add-ons item, grouped with the other extension-related commands (menuitem:insertafter="javascriptconsole,devtoolsseparator").
... 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.
...they allow for easy identification among other extensions in the extensions manager.
...And 7 more matches
XPCOM Objects - Archive of obsolete content
we often mention other "mozilla based applications".
... another useful resource is this xpcom reference.
... passing parameters passing parameters to xpcom methods is no different from other js objects, with some exceptions.
...And 7 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
a sequence of characters) that matches patterns of characters in other strings.
... urls 101 urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters.
... 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.
...And 7 more matches
Creating XPI Installer Modules - Archive of obsolete content
mozilla has introduced major changes to the way that themes and all the other parts of the ui are packaged.
...where before a single manifest.rdf file described the resources in an entire package directory or archive, now contents.rdf files can be used for as large or as small a part of your package description as you want; you can use several contents.rdf files in your package to describe the various parts (e.g., one for the skin of your package, another for the content, and so on), or you can use a single one, as was common before.
...one way of another, the chrome registry is shown the contents.rdf files; the contents.rdf files in turn point to new resources, and the resources are then registered with mozilla and accessible to the user.
...And 7 more matches
Introduction to XUL - Archive of obsolete content
though the former term seems more concrete than the other, and therefore is not an exact replacement, no one is completely certain why we have both.
...relative placement of widgets, their interactions with each other, and optionally some of their configuration, will be controlled by a ui layout specified in a script whose structure is defined in this and related documents.
... most of the details of writing a xul document are identical to those for writing an xml document, a description of which we will leave to other excellent xml documentation which we assume must exist but have never seen.
...And 7 more matches
Template Logging - Archive of obsolete content
if other flags are used as well, separate them with spaces.
...for other datasources, this may be a somewhat random value.
...in other words, the generated content will only change when active results are involved.
...And 7 more matches
Introduction - Archive of obsolete content
xul has all the advantages of other xml languages.
... for example xhtml or other xml languages such as mathml or svg can be inserted within it.
... also, text displayed with xul is easily localizable, which means that it can be translated into other languages with little effort.
...And 7 more matches
Writing Skinnable XUL and CSS - Archive of obsolete content
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.
...css files that import another skin file are calledderived skin files.
... css files that don't import another skin file are calledbase skin files.
...And 7 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
sure, there are other reasons -– accountability, checkpoints, and scheduling, for example.
... other standards it is also important to follow other types of standards across an organization.
...in other words, there must be long-term potential.
...And 7 more matches
Mobile accessibility - Learn web development
press the voiceover slider to enable it (you'll also see a number of other options related to voiceover on this page).
... note: for a more complete reference covering the voiceover gestures available and other hints on accessibility testing on ios, see test accessibility on your device with voiceover.
...to recap, these cause accessibility issues because other control mechanisms can't activate the associated functionality.
...And 7 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.
... 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.
...if we want the two <div>s to be floated alongside one another, we need to set their widths to total 100% of the width of their parent element or smaller so they can fit alongside one another.
...And 7 more matches
Practical positioning examples - Learn web development
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 using absolute positioning.
...first, add the following rule at the bottom of your css to remove the default padding-left and margin-top from the unordered 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.
...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.
...And 7 more matches
Images in HTML - Learn web development
fortunately, it wasn't too long before the ability to embed images (and other more interesting types of content) inside web pages was added.
... there are other types of multimedia to consider, but it is logical to start with the humble <img> element, used to embed a simple image in a webpage.
...in other words, what you lose if your image doesn't show up: decoration.
...And 7 more matches
Fetching data from the server - Learn web development
previous overview: client-side web apis next another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entire new page.
...this isn't strictly necessary here — xhr returns text by default — but it is a good idea to get into the habit of setting this in case you want to fetch other types of data in the future.
... add this next: request.responsetype = 'text'; fetching a resource from the network is an asynchronous operation, meaning that you have to wait for that operation to complete (e.g., the resource is returned from the network) before you can do anything with that response, otherwise, an error will be thrown.
...And 7 more matches
Introduction to web APIs - Learn web development
as a real-world example, think about the electricity supply in your house, apartment, or other dwellings.
... in the same way, if you want to say, program some 3d graphics, it is a lot easier to do it using an api written in a higher-level language such as javascript or python, rather than try to directly write low level code (say c or c++) that directly controls the computer's gpu or other graphics functions.
... relationship between javascript, apis, and other javascript tools so above, we talked about what client-side javascript apis are, and how they relate to the javascript language.
...And 7 more matches
Inheritance in JavaScript - Learn web development
how do we create an object in javascript that inherits from another object?
...later you'll see how these can be inherited by other constructors.
...the first parameter specifies the value of this that you want to use when running the function, and the other parameters are those that should be passed to the function when it is invoked.
...And 7 more matches
Aprender y obtener ayuda - Learn web development
there are also several other great resources on the web, some of which we'll mention below.
... note: you might favor one learning method over the others, but realistically a hybrid approach is probably what you will end up with.
... and you'll probably come up with other methods than the three we covered above.
...And 7 more matches
Software accessibility: Where are we today?
select text, pictures, and other information using a mouse react to sounds played.
... physically disabled: users have amputations, paralysis, repetitive stress, cerebral palsy, muscular dystrophy, parkinson's or other problems limiting mobility.
...talking programs are also useful for print disabilities other than visual impairments, such as dyslexia.
...And 7 more matches
Eclipse CDT
to tab to another view, use cmd-f7/ctrl-f7.
...this will open another tab containing the same file.
...changes you make in one editor will be immediately reflected in the other.
...And 7 more matches
Storage access policy: Block cookies from trackers
firefox includes a new storage access policy that blocks cookies and other site data from third-party tracking resources.
...the cookie policy can be enabled in other versions of firefox through the content blocking settings (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate firefox version).
... the storage access policy blocks resources identified as trackers from accessing their cookies and other site storage when they are loaded in a third-party context.
...And 7 more matches
OS.File for the main thread
for other uses of os.file, please see the corresponding page.
...tory: let promise = os.file.stat(somepath); promise = promise.then( function onsuccess(stat) { if (stat.isdir) { // the path represents a directory } else { // the path represents a file, not a directory } }, function onfailure(reason) { if (reason instanceof os.file.error && reason.becausenosuchfile) { // the file does not exist } else { // some other error throw reason; } } ); example: copy a file by chunks the following snippet writes a (presumably large) buffer by chunks.
...depending on other fields, it may also be opened for writing.
...And 7 more matches
Mozilla DOM Hacking Guide
otherwise, for more detailed xpcom documentation, please see the xpcom project page.
...other browsers allow the history object to be used like an array, e.g.
...we can see that the nseventrecieversh helper class inherits from nsdomgenericsh: class nseventrecieversh : public nsdomgenericsh and nsdomgenericsh is typedef'ed to nsdomclassinfo: typedef nsdomclassinfo nsdomgenericsh; another example is nswindowsh, which inherits from nseventreceiversh, thus inheriting from nsdomclassinfo.
...And 7 more matches
Memory reporting
this is important because sometimes an object might be embedded in another object that is measured separately.
...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.
...And 7 more matches
Power profiling overview
the other states have higher numbers and reflect increasing deeper idle states.
... the other thing to note about c-states is that they apply both to cores and the entire package — i.e.
... one consequence of the existence of c-states is that observations made during power profiling — even more than with other kinds of profiling — can disturb what is being observed.
...And 7 more matches
SpiderMonkey Build Documentation
before you begin, make sure you have the right build tools for your computer: linux, windows, mac, others.
... this can help debug memory leaks and other memory-related problems.
... for a list of other available build options, type (assuming the current working directory is one of the above-created build directories): /bin/sh ../configure.in --help generating a compilation database some tools (like ides, static analyzers and refactoring tools) consume a file called compile_commands.json which contains a description of all the pieces required to build a piece of software so that tools don't have to also understand a build system.
...And 7 more matches
Introduction to XPCOM for the DOM
xpcom provides a handy method to get a pointer to an interface when you have a pointer to another interface, and both interfaces are implemented by the same object.
...if you have to assign it another address later, you can easily do ifooptr2 = do_queryinterface(another_pointer); this syntax however is just a convenient shortcut to the real function.
... the next section is a tutorial on how to add a new interface to the mozilla dom, with build instructions et al, and the last section is a discussion of the more advanced topics of object-oriented c++ , interface inheritance, and other fun stuff.
...And 7 more matches
mozIRegistry
this issue needs to be resolved in order to enable alternative moziregistry implementations or to permit other service implementations to be bound at runtime.
...worst case, clients would obtain the moziregistry singleton via some other means (i.e., a "nsgetregistry" function).
... architecture this diagram illustrates the various components that you will be using to interoperate with other mozilla components.
...And 7 more matches
DOM Inspector internals - Firefox Developer Tools
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.
...one panel reacts to changes to the inspected document, and the other panel reacts to changes to the selection in the first panel.
...And 7 more matches
Applying styles and colors - Web APIs
the globalalpha property can be useful if you want to draw a lot of shapes on the canvas with similar transparency, but otherwise it's generally more useful to set the transparency on individual shapes when setting their colors.
...by overlaying ever more circles on top of each other, we effectively reduce the transparency of the circles that have already been drawn.
...0.2; // draw semi transparent circles for (var i = 0; i < 7; i++) { ctx.beginpath(); ctx.arc(75, 75, 10 + 10 * i, 0, math.pi * 2, true); ctx.fill(); } } <canvas id="canvas" width="150" height="150"></canvas> draw(); screenshotlive sample an example using rgba() in this second example, we do something similar to the one above, but instead of drawing circles on top of each other, i've drawn small rectangles with increasing opacity.
...And 7 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
these characters allow you to format your code in a way that will make it easily readable by yourself and other people.
... let’s take another really simple example.
... another text node (consisting only of tabs and spaces).
...And 7 more matches
Basic concepts - Web APIs
big concepts if you have assumptions from working with other types of databases, you might get thrown off when working with indexeddb.
...without transactional operations, the two instances could interfere with each other's modifications.
...error events, on the other hand, do bubble, and can be cancelled.
...And 7 more matches
Lifetime of a WebRTC session - Web APIs
this page is currently under construction, and some of the content will move to other pages as the webrtc guide material is built out.
...but they realized that it would take longer to complete the transition than 32-bit addresses would last, so other smart people came up with a way to let multiple computers share the same 32-bit ip address.
... the problem for users is that each individual computer on the internet no longer necessarily has a unique ip address, and, in fact, each device’s ip address may change not only if they move from one network to another, but if their network’s address is changed by nat and/or dhcp.
...And 7 more matches
Using DTMF with WebRTC - Web APIs
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.
...when you wish to transmit dtmf signals, you first need to decide which track to send them on, since dtmf is sent as a series of out-of-band payloads on the rtcrtpsender responsible for transmitting that track's data to the other peer.
...from there, you can simply call rtcdtmfsender.insertdtmf() to enqueue dtmf signals to be sent on the track to the other peer.
...And 7 more matches
Web accessibility for seizures and physical reactions - Accessibility
this article introduces concepts behind making web content accessibile for those with vestibular disorders, and how to measure and prevent content leading to seizures and / or other physical reactions.
...web technologies that use video, animated gifs, animated pngs, animated svgs, canvas, and css or javascript animations are all capable of content that can induce seizures or other incapacitating physical reactions.
...in the case of photosensitive epilepsy, seizures are triggered specifically by flashing lights, but other types of reflex epilepsies may be triggered by the act of reading, or by noises.
...And 7 more matches
Using CSS animations - CSS: Cascading Style Sheets
css animations make it possible to animate transitions from one css style configuration to another.
...the rendering engine can use frame-skipping and other techniques to keep the performance as smooth as possible.
...this lets you configure the timing, duration, and other details of how the animation sequence should progress.
...And 7 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
in other browsers, these degrade gracefully to simple <input type="text"> controls.
...in other words, an implementation should allow any valid combination of year, month, day, hour, and minute - even if such a combination is invalid in the user's local time zone (such as times within a daylight saving time spring-forward transition gap).
...another option is to use separate date and time inputs, each of which is more widely supported than datetime-local.
...And 7 more matches
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
support is good in modern browsers, with safari being the sole major browser not yet implementing it; in safari, and any other browsers that don't support <time>, it degrades gracefully to <input type="text">.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...And 7 more matches
HTTP caching - HTTP
WebHTTPCaching
on the other side, it has to be configured properly as not all resources stay identical forever: it is important to cache a resource only until it changes, not longer.
...however, common http caches are typically limited to caching responses to get and may decline other methods.
... responses other than get if something suitable for use as a cache key is defined.
...And 7 more matches
Concurrency model and the event loop - JavaScript
this model is quite different from models in other languages like c and java.
... "run-to-completion" each message is processed completely before any other message is processed.
... this offers some nice properties when reasoning about your program, including the fact that whenever a function runs, it cannot be pre-empted and will run entirely before any other code runs (and can modify data the function manipulates).
...And 7 more matches
Functions - JavaScript
1 : n * fac(n - 1) } console.log(factorial(3)) function expressions are convenient when passing a function as an argument to another function.
...rial(n) { if ((n === 0) || (n === 1)) return 1; else return (n * factorial(n - 1)); } you could then compute the factorials of 1 through 5 as follows: var a, b, c, d, e; a = factorial(1); // a gets the value 1 b = factorial(2); // b gets the value 2 c = factorial(3); // c gets 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.
... in other words, a function defined in the global scope can access all variables defined in the global scope.
...And 7 more matches
JavaScript modules - JavaScript
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).
...node.js has had this ability for a long time, and there are a number of javascript libraries and frameworks that enable module usage (for example, other commonjs and amd-based module systems like requirejs, and more recently webpack and babel).
... aside — .mjs versus .js throughout this article, we've used .js extensions for our module files, but in other resources you may see the .mjs extension used instead.
...And 7 more matches
Types of attacks - Web security
that is other than what the user thinks it is.
...the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content.
... the malicious content often includes javascript, but sometimes html, flash, or any other code the browser can execute.
...And 7 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
an instruction, on the other hand, is associated with a template.
...the element must be defined before any other output document element inside the output document element for which it establishes attribute values.
...otherwise, nodes are processed in document order.
...And 7 more matches
Preferences - Archive of obsolete content
information here applies to the mozilla suite, firefox, thunderbird, and possibly other mozilla-based applications.
... if you haven't yet, read other documents about mozilla preferences on mdn (links below in resources section).
...ii.value", components.interfaces.nsisupportsstring).data; // example 2: setting unicode value var str = components.classes["@mozilla.org/supports-string;1"] .createinstance(components.interfaces.nsisupportsstring); str.data = "some non-ascii text"; prefs.setcomplexvalue("preference.with.non.ascii.value", components.interfaces.nsisupportsstring, str); nsipreflocalizedstring another complex type supported by mozilla is nsipreflocalizedstring.
...And 6 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
it's a comma-separated list of ids, and it can also include other special values: spacer, separator and spring.
...the other types, checkbox and radio are useful when you have buttons that change state when the user clicks on them.
... you can have a different skin directory for each operating system using manifest flags in the chrome.manifest file: skin xulschoolhello classic/1.0 skin/unix/ skin xulschoolhello classic/1.0 skin/win/ os=winnt skin xulschoolhello classic/1.0 skin/mac/ os=darwin the osversion flag can be used in case we wanted to have different icons for mac os x lion and above, and others for older systems.
...And 6 more matches
Adding sidebars - Archive of obsolete content
to sum up both of these references: you can choose an obscure key combination that won't conflict with firefox, such as ctrl+shift+(some letter), but there's no way of knowing if any other extension uses that same combination as well.
... the xul page for the sidebar can hold any content you want and it's no different from other xul windows or overlays.
... another, more important difference to take into account is that users can resize the sidebar to their liking, and in most cases, the sidebar is going to be fairly narrow.
...And 6 more matches
New Security Model for Web Services - Archive of obsolete content
client-controlled solutions several client-controlled solutions have been designed to prevent sandboxed applications loaded behind a firewall from compromising other resources protected behind the firewall.
... same source restriction by restricting sandboxed scripts to access only resources in the domain from which they were loaded, any script loaded from one domain into another is prevented from accessing resources in the domain into which it has been loaded.
...a white list is a good tool for including always-trusted domains, but on the web, it is often a script from a relatively-untrusted domain that must be granted access to other untrusted domains, without compromising internal domains.
...And 6 more matches
Venkman Introduction - Archive of obsolete content
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.
...And 6 more matches
XML in Mozilla - Archive of obsolete content
several world wide web consortium (w3c) recommendations and drafts from the xml family of specifications are supported, as well as other related technologies.
...dtds and other external entities mozilla does not load external entities from the web.
...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.
...And 6 more matches
Stacks and Decks - Archive of obsolete content
containers each xul box is a container that can contain any other element.
... in fact, many components can contain other elements.
... we've already seen that buttons may contain other things besides the default.
...And 6 more matches
Using Spacers - Archive of obsolete content
some users may have larger displays with higher resolutions and others may have lower resolutions.
...if adding support for multiple languages, the text for one language may require more room than another.
...before we get into detail about boxes, we'll introduce another xul element that is useful for layout, the spacer.
...And 6 more matches
XUL Event Propagation - Archive of obsolete content
the following image describes in a very basic way how the various actors in the event model interact with one another.
...this button responds to the user action by raising an event, a message meant to travel from one element within the interface to another.
...any element that is interested in the event -- any part of the interface, in other words, that needs to know about and respond to the user's click action on the button -- "handles" the event with an event handler, or chunk of code to be executed when the given event is "heard".
...And 6 more matches
textbox - Archive of obsolete content
as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the script code only runs in the context of the <textbox> element, matching the behavior of all other event handlers.
...the event is not sent until the focus is moved to another element.
...as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the script code only runs in the context of the <textbox> element, matching the behavior of all other event handlers.
...And 6 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
in recent developments we also see the advent of other performant engines for javascript such as v8 from google and squirrelfish for webkit, these engines are raising the bar on performance and help to maintain a competitive environment that will hopefully direct competitive focus on the performance aspect of all the major javascript implementations.
...spidermonkey on the other hand is the javascript engine (written in c) in the highly popular mozilla firefox browser.
...in addition, the jaxer “ajax server” (a project i work on at aptana) is an example of ssjs that uses not only spidermonkey, but also embeds the entire firefox browser engine in the application server such that you can do server-side dom manipulation and other ajaxy things server-side that rhino was not built to do.
...And 6 more matches
Reference - Archive of obsolete content
well if you combine the two, you can have inherited private variables: function myclass(){ var property = 5; this.tellme = function(){ return property; } } function myotherclass(){ myclass.apply( this ); } var o = new myotherclass; alert( o.tellme() ); //alerts 5 as you'd expect — the preceding comment was added by psygnisfive (talk – contribs) on 22:23, 4 december 2006 terminology we need a terminology appendix.
... otherwise, i think we should just remove the "behavior in other versions" sections, and rename the "javascript 1.2" section headings to something like "differences with javascript 1.2," as well as include a link to the yet-to-be-written javascript 1.2 page documenting the various oddities and deviations made in that version, something which i think we should do anyway.
...others just capitalize the first word.
...And 6 more matches
Game distribution - Game development
an html5 game is just another website.
... if you want to make money out of game dev, you should secure your source code one way or another against people who could easily take it and sell it as their own.
...another good measure to take is to provide an online demo if you're planning on packaging it and selling it in a closed store like itunes or steam.
...And 6 more matches
What is accessibility? - Learn web development
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.
...providing accessible sites is part of the law in some countries, which can open up some significant markets that otherwise would not be able to use your services or buy your products.
... other good practices that improve accessibility also make your site more usable by other groups, such as mobile phone users or those on low network speed.
...And 6 more matches
Images, media, and form elements - Learn web development
images, other media, and form elements behave a little differently in terms of your ability to style them with css than regular boxes.
...this means that css cannot affect the internal layout of these elements — only their position on the page amongst other elements.
... the other is larger than 200 pixels and overflows the box.
...And 6 more matches
How CSS is structured - Learn web development
a class is rated as being more specific, as in having more specificity than the element selector, so it cancels the other conflicting style declaration.
... important: in css (and other web standards), it has been agreed that us spelling is the standard where there is language variation or uncertainty.
... another example would be the various values for transform, such as rotate().
...And 6 more matches
Basic native form controls - Learn web development
note: html5 enhanced the basic original single line text field by adding special values for the type attribute that enforce specific validation constraints and other features, for example specific to entering urls or numbers.
...with dots or asterisks) so it can't be easily read by others.
... hidden content another original text control is the hidden input type.
...And 6 more matches
The HTML5 input types - Learn web development
any other content causes the browser to display an error when the form is submitted.
... this is another good reason for using these newer input types — improving the user experience for users of these devices.
... client-side validation as you can see above, email, along with other newer input types, provides built-in client-side error validation — performed by the browser before the data gets sent to the server.
...And 6 more matches
Functions — reusable blocks of code - Learn web development
previous overview: building blocks next another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
...and functions can contain whatever code you like — you can even call other functions from inside functions.
... you can also assign an anonymous function to be the value of a variable, for example: const mygreeting = function() { alert('hello'); } this function could now be invoked using: mygreeting(); this effectively gives the function a name; you can also assign the function to be the value of multiple variables, for example: let anothergreeting = mygreeting; this function could now be invoked using either of: mygreeting(); anothergreeting(); but this would just be confusing, so don't do it!
...And 6 more matches
A first splash into JavaScript - Learn web development
you won't be expected to understand all of the code in detail immediately — we just want to introduce you to the high-level concepts for now, and give you an idea of how javascript (and other programming languages) work.
... note: many of the code features you'll see in javascript are the same as in other programming languages — functions, loops, etc.
... allow them to enter another guess.
...And 6 more matches
Basic math in JavaScript — numbers and operators - Learn web development
previous overview: first steps next at this point in the course we discuss math in javascript — how we can use operators and other features to successfully manipulate numbers to do our bidding.
...this is especially true when we are learning to program javascript (or any other language for that matter) — so much of what we do relies on processing numerical data, calculating new values, and so on, that you won't be surprised to learn that javascript has a full-featured set of math functions available.
...for a start, we are just going to stick to decimal numbers throughout this course; you'll rarely come across a need to start thinking about other types, if ever.
...And 6 more matches
JavaScript object basics - Learn web development
next you write a dot, then the item you want to access — this can be the name of a simple property, an item of an array property, or a call to one of the object'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.
...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.
...And 6 more matches
Object prototypes - Learn web development
previous overview: objects next prototypes are the mechanism by which javascript objects inherit features from one another.
...this is often referred to as a prototype chain, and explains why different objects have properties and methods defined on other objects available to them.
...you will however also see some other members — tostring, valueof, etc — these are defined on person1's prototype object's prototype object, which is object.prototype.
...And 6 more matches
Introducing a complete toolchain - Learn web development
javascript) or another language entirely (e.g.
...git is currently the most popular source code revision control tool available to developers — revision control provides many advantages, such as a way to backup your work in a remote place, and a mechanism to work in a team on the same project without fear of overwriting each other's code.
... 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" issues will be caught early on.
...And 6 more matches
Mozilla accessibility architecture
the situation for other accessibility apis is similar.
...common implementations shared by html and xul implementations accessible/src/html/ document and html object implementations accessible/src/xul/ user interface and xul object implementations accessible/src/msaa/ windows implementations accessible/src/atk/ atk implementations, may eventually be used on platforms other than linux and unix accessible/src/mac/ empty implementations of platform-specific classes for os x.
... accessible/src/other/ empty implementations of platform-specific classes so that builds don't fail on platforms currently not-supported where we put toolkit-specific code because atk and msaa are different accessibility api toolkits which share only about 75% of their code, there is a lot of toolkit-specific code that needs to live somewhere.
...And 6 more matches
Adding a new CSS property
if you need more details on any of the points mentioned here, a good place to find them is by looking at other changes in the version control history of the files mentioned.
... see the documentation at the top of the file and the other entries for examples.
... again, see the documentation at the top of the file and the other entries for examples, and also see the next section for details about parsing.
...And 6 more matches
Experimental features in Firefox
nightly 53 yes developer edition 53 no beta 53 no release 53 no preference name dom.dialog_element.enabled global attribute: inputmode our implementation of the inputmode global attribute has been updated as per the whatwg spec (bug 1509527), but we still need to make other changes too, like making it available on contenteditable content.
... nightly 78 yes developer edition 78 yes beta 78 yes release 78 no preference name network.preload css display stray control characters in css as hex boxes this feature renders control characters (unicode category cc) other than tab (u+0009), line feed (u+000a), form feed (u+000c), and carriage return (u+000d) as a hexbox when they are not expected.
...when tabbing between elements), and not when they are focused using a mouse or other pointing device.
...And 6 more matches
Multiple Firefox profiles
a profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox.
... web developers might want a secondary profile for testing websites, apps, or other projects on different firefox channels.
...you can remove such add-ons from your profile for nightly use while keeping them for use with other profiles.
...And 6 more matches
Localization Use Cases
eappfreespace() { var self = this; this.getfreespace(this.appstorage, function(freespace) { devicestoragehelper.showformatedsize(self.appstoragedesc, 'availablesize', freespace); }); }, problem definition for all values of freespace, the following string is enough to construct a grammatically-correct sentence in english: availablesize = {{$size}} {{$unit}} available however, other languages might need to pluralize this string with different forms of the available adjective.
... 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[one] = {{$size}} {{$unit}} disponibile availablesize[other] = {{$size}} {{$unit}} disponibili it's easy to imagine how developers might forget to pluralize some strings that in other languages might require pluralization (or other grammatical features that the framework supports).
... solution l20n isolates each language so that grammatical requirements of one don't affect others.
...And 6 more matches
An overview of NSS Internals
it's free and open source software, and many other software projects have decided to use it.
...(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.
...a certificate contains lots of other details; for example, it contains a signature by a third party that expresses trust in the ownership relationship for the certificate.
...And 6 more matches
Invariants
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.
...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.
...(we don't bother locking when accessing slots of a sealed object.
...And 6 more matches
JIT Optimization Strategies
with uniquely-typed objects, it is guaranteed that no other object has that same type.
...this strategy is used when all the others fail.
... inline caches are an order of magnitude slower than the other optimization strategies, and are an indication that the type inference engine has failed to collect enough information to guide the optimization process.
...And 6 more matches
IAccessibleTable
other-licenses/ia2/accessibletable.idlnot scriptable this interface gives access to a two-dimensional table.
...otherwise a null pointer is returned.
...isselected returns true if the specified column is selected completely and false otherwise.
...And 6 more matches
Introduction to DOM Inspector - Firefox Developer Tools
if the dom inspector doesn't automatically load a document or loads a document other than the one you'd like to inspect, you can select the desired document a few different ways.
...it's possible to use other viewers, but for now we'll stick to describing the dom nodes viewer and the dom node viewer.
...one common use of the dom inspector is to find the name and location of particular icon being used in the user interface, which is not an easy task otherwise.
...And 6 more matches
Index - Firefox Developer Tools
3 accessibility inspector accessibility, accessibility inspector, devtools, guide, tools the accessibility inspector provides a means to access important information exposed to assistive technologies on the current page via the accessibility tree, allowing you to check what's missing or otherwise needs attention.
... 17 debugger-api debugger, intermediate, intro, javascript, tools mozilla’s javascript engine, spidermonkey, provides a debugging interface named debugger which lets javascript code observe and manipulate the execution of other javascript code.
...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.
...And 6 more matches
Introduction to the File and Directory Entries API - Web APIs
the file and directory entries api interacts with other related apis.
...the synchronous api, on the other hand, allows for simpler programming model, but it must be used with webworkers.
... 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.
...And 6 more matches
Writing WebSocket servers - Web APIs
websocket servers are often separate and specialized servers (for load-balancing or other practical reasons), so you will often use a reverse proxy (such as a regular http server) to detect websocket handshakes, pre-process them, and send those clients to a real websocket server.
... 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.
...the server must be careful to understand everything the client asks for, otherwise security issues can occur.
...And 6 more matches
Accessibility documentation index - Accessibility
it is used to provide a generic landmark for people to be able to navigate to easily when none of the other landmark roles are appropriate.
...it is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page.
...a figure is generally 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.
...And 6 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
we can use other values to control how the items align: align-items: flex-start align-items: flex-end align-items: center align-items: stretch align-items: baseline in the live example below, the value of align-items is stretch.
... try the other values and see how all of the items align against each other in the flex container.
...i have targeted the first item using a first-child selector and set that item to align-self: stretch; another item has been selected using its class of selected and given align-self: center.
...And 6 more matches
OpenType font features guide - CSS: Cascading Style Sheets
these include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others.
... some fonts will have one or more of these features enabled by default (kerning and default ligatures are common examples), while others are left to the designer or developer to choose to enable in specific scenarios.
...in the latter case, these alterations are actually necessary to properly express the language, so they go beyond the more stylistic preference of most other opentype features.
...And 6 more matches
place-items - CSS: Cascading Style Sheets
in absolutely-positioned layouts, the keyword behaved like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
... 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.
...And 6 more matches
Event reference
this article offers a list of events that can be sent; some are standard events defined in official specifications, while others are events used internally by specific browsers; for example, mozilla-specific events are listed so that add-ons can use them to interact with the browser.
...ubmit button is pressed printing events event name fired when beforeprint the print dialog is opened afterprint the print dialog is closed text composition events event name fired when compositionstart the composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).
... compositionstart compositionevent dom l3 the composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).
...And 6 more matches
Using HTML sections and outlines - Developer guides
semantic sectioning elements are specifically designed to communicate structural meaning to browsers and other technologies interpreting the document on behalf of users, such as screen readers and voice assistants.
...by contrast, the <nav> sectioning element more clearly describes to browsers and other devices the content contained: links or other navigational structures to help users move through and understand where they are in a site's or page's content.
...you can have primary and secondary menus, but you cannot nest a <nav> element inside another <nav> element.
...And 6 more matches
itemprop - HTML: Hypertext Markup Language
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.
...items that are not part of others are called top-level microdata items.
...the first item has two properties, "name", set to "amanda", and "band", set to another item.
...And 6 more matches
Using HTTP cookies - HTTP
WebHTTPCookies
cookies are mainly used for three purposes: session management logins, shopping carts, game scores, or anything else the server should remember personalization user preferences, themes, and other settings tracking recording and analyzing user behavior cookies were once used for general client-side storage.
... to see stored cookies (and other storage that a web page can use), you can enable the storage inspector in developer tools and select cookies from the storage tree.
... a vulnerable application on a sub-domain can set a cookie with the domain attribute, which gives access to that cookie on all other subdomains.
...And 6 more matches
Proxy Auto-Configuration (PAC) file - HTTP
notes: the javascript function should always be saved to a file by itself but not be embedded in a html file or any other file.
...otherwise, they are assumed to be in the local timezone.
...otherwise, the local timezone is used.
...And 6 more matches
Expressions and operators - JavaScript
these operators work as they do in most other programming languages when used with floating point numbers (in particular, note that division by zero produces infinity).
... logical operators operator usage description logical and (&&) expr1 && expr2 returns expr1 if it can be converted to false; otherwise, returns expr2.
... thus, when used with boolean values, && returns true if both operands are true; otherwise, returns false.
...And 6 more matches
Indexed collections - JavaScript
it has a property for determining the array length and other properties for use with regular expressions.
... 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.
...otherwise, an array with a single element (the provided value) will be created.
...And 6 more matches
The "codecs" parameter in common media types - Web media technologies
all of these file types support a variety of codecs, and those codecs may have any number of profiles, levels, and other configuration factors.
...some media types only let you specify the names of the codecs to use, while others allow you to specify various constraints on those codecs as well.
...this value must be one of 8, 10, or 12; which values are valid varies depending on the profile and other properties.
...And 6 more matches
File I/O - Archive of obsolete content
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.
...var file = url.queryinterface(components.interfaces.nsifileurl).file; // file is a nsifile to load from file://, http://, chrome://, resource:// and other urls directly, use xmlhttprequest or netutil.asyncfetch().
...And 5 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
introduction javascript lacks functions for opening files and character-code conversion, among other things.
... note: if you're developing components in c++ or other compiled languages, be sure to include binaries for every platform.
...for other components, you can create as many instances as you need.
...And 5 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
this article is aimed at presenting alternatives to common eval uses in add-ons and other javascript code.
...even if you trust the remote server; for example, because it is one you rent and administer yourself, there is a huge security risk, because of, but not limited to: you might discontinue your project or sell it, so that it is possible another person with malicious intentions takes over your domain.
... jsonp, which really is just another script tag containing generated, remotely retrieved code, is generally not secure.
...And 5 more matches
Custom XUL Elements with XBL - Archive of obsolete content
« previousnext » 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.
...in this case we're adding the "persons" dynamically, so you'll have to look into the js file to see how xshelloperson elements are created and added to the dom just like any other.
...on the other hand, if your bindings are small and have a strong relationship with each other, it makes sense to keep them together.
...And 5 more matches
Security best practices in extensions - Archive of obsolete content
other items are recommendations.
... 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.
...files loaded using the file protocol can access files on the user's disk and other local devices.
...And 5 more matches
Tabbed browser - Archive of obsolete content
furthermore another meaning of 'browser' in this document and in some firefox source is "the tabbrowser element" in a firefox xul window.
...the code given is for a menuitem, but will work equally well for other xul elements.
... window.open(url); } } } reusing by other criteria sometimes you want to reuse a previously-opened tab regardless of which url/uri it displays.
...And 5 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
this includes rules and guidelines applying to everything from headers, footers, page hierarchy, titles, typography, iconography, navigation, and others.
...a developer would tell me something wasn't possible, and i could prove otherwise every time.
... like other designers and html whizzes, i became a master at manipulating and troubleshooting tables, nesting them in intricate ways to produce any layout or effect that could be imagined.
...And 5 more matches
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
if the menu is a context menu, it is called as beforehide(menu, context) and otherwise as beforehide(menu).
...if the menu is a context menu, it is called as beforeshow(menu, context) and otherwise as beforeshow(menu).
... isshowing boolean true if the menu is currently visible and false otherwise.
...And 5 more matches
panel - Archive of obsolete content
ArchiveMozillaXULpanel
on linux, the default value is top, otherwise, the default value is parent.
... if a panel has one or more text fields, this attribute should not be set, otherwise ime or on-screen keyboard popups will appear incorrectly.
... top the panel is shown in front of all other normal windows, including those of other applications.
...And 5 more matches
Encryption and Decryption - Archive of obsolete content
in most cases, two related functions are employed, one for encryption and the other for decryption.
...symmetric-key encryption also provides a degree of authentication, since information encrypted with one symmetric key cannot be decrypted with any other symmetric key.
... thus, as long as the symmetric key is kept secret by the two parties using it to encrypt communications, each party can be sure that it is communicating with the other as long as the decrypted messages continue to make sense.
...And 5 more matches
Parsing microformats in JavaScript - Archive of obsolete content
otherwise this is the microformat node.
...otherwise this is the microformat node.
...otherwise this is the microformat node.
...And 5 more matches
Common causes of memory leaks in extensions - Extensions
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.
... strict mode also excludes several other error-prone code patterns.
...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.
...And 5 more matches
Game monetization - Game development
how much you charge for your game depends on the market, quality of your game and a lot of other small factors.
... freemium games that feature iaps are often referred to a freemium — a freemium game can be acquired and played for free, but you can pay for extra (premium) features, virtual goods or other benefits.
...the worst cases were when you could use real money to pay for getting advantages over other players, or when they restricted access to the next stages of the game unless the players paid.
...And 5 more matches
Accessible multimedia - Learn web development
previous overview: accessibility next 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 on the other hand looks at another general class of content that arguably isn't as easy to ensure accessibility for — multimedia.
... creating custom audio and video controls html5 video and audio share an api — html media element — which allows you to map custom functionality to buttons and other controls — both of which you define yourself.
...And 5 more matches
Advanced styling effects - Learn web development
other box shadow features unlike text-shadow, box-shadow has an inset keyword available — putting this at the start of a shadow declaration causes it to become an inner shadow, rather than an outer shadow.
... note: there is another item that can be set in the box-shadow value — another length value can be optionally set just before the color value, which is a spread radius.
...you could also swap the values for some others.
...And 5 more matches
Flexbox - Learn web development
so for example, you can replace flex-direction: row; flex-wrap: wrap; with flex-flow: row wrap; flexible sizing of flex items let's now return to our first example, and look at how we can control what proportion of space flex items take up compared to the other flex items.
... first, add the following rule to the bottom of your css: article { flex: 1; } this is a unitless proportion value that dictates how much of the available space along the main axis each flex item will take up compared to other flex items.
...it is relative to other flex items, meaning that giving each flex item a value of 400000 would have exactly the same effect.
...And 5 more matches
What is the difference between webpage, website, web server, and search engine? - Learn web development
search engine a web service that helps you find other web pages, such as google, bing, yahoo, or duckduckgo.
... deeper dive so, let's dig deeper into how those four terms are related and why they are sometimes confused with each other.
...such documents are written in the html language (which we look into in more detail in other articles).
...And 5 more matches
How to build custom form controls - Learn web development
the control was active and the user moves the focus to another control using the keyboard (e.g.
... the control is in its open state when: the control is in any other state than open and the user clicks on 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?
...And 5 more matches
Styling web forms - Learn web development
the good to style form controls that are easy to style with css, you shouldn't face much if any difficulties, since they mostly behave like any other html element.
...this is another reason to use <button> elements over their equivalent input types!
...to give the same size to several different widgets, you can use the box-sizing property along with some consistent values for other properties: input, textarea, select, button { width : 150px; padding: 0; margin: 0; box-sizing: border-box; } in the screenshot below, the left column shows the default rendering of an <input type="radio">, <input type="checkbox">, <input type="range">, <input type="text">, <input type="date"> input, <select>, <textarea>,<input type="submit">, and <button>.
...And 5 more matches
Debugging HTML - Learn web development
<strong>strong <em>strong emphasised?</strong> what is this?</em> <li>unclosed attributes: another common source of html problems.
...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.
... in the dom inspector, you can see what the rendered markup looks like: using the dom inspector, let's explore our code in detail to see how the browser has tried to fix our html errors (we did the review in firefox; other modern browsers should give the same result): the paragraphs and list items have been given closing tags.
...And 5 more matches
What’s in the head? Metadata in HTML - Learn web development
it contains information such as the page <title>, links to css (if you choose to style your html content with css), links to custom favicons, and other 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.
... the <title> element contents are also used in other ways.
...of course, the other stuff we are talking about in this article could also be thought of as metadata too.
...And 5 more matches
HTML table advanced features and accessibility - Learn web development
the <tbody> element needs to wrap the other parts of the table content that aren't in the table header or footer.
...you might wonder why you ought to bother including it at all — you should, because it gives you more control over your table structure and styling.
... nesting tables it is possible to nest a table inside another one, as long as you include the complete structure, including the <table> element.
...And 5 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
okay, so it's not quite that simple — there are some other differentiators as you drill down deeper.
...you should see an error message along the following lines: this is a pretty easy error to track down, and the browser gives you several useful bits of information to help you out (the screenshot above is from firefox, but other browsers provide similar information).
...another error!
...And 5 more matches
Framework main features - Learn web development
it was invented by the react team for use in react applications, but can be used to develop other applications — like vue apps, for instance.
... given this handlebars template: <header> <h1>hello, {{subject}}!</h1> </header> and this data: { subject: "world" } handlebars will build html like this: <header> <h1>hello, world!</h1> </header> typescript typescript is a superset of javascript, meaning it extends javascript — all javascript code is valid typescript, but not the other way around.
...to render this component, we would write code like this in the place where we want it rendered (which will probably be inside another component): <authorcredit src="./assets/zelda.png" alt="portrait of zelda schiff" byline="zelda schiff is editor-in-chief of the library times." /> this will ultimately render the following <figure> element in the browser, with its structure as defined in the authorcredit component, and its content as defined in the props included on the authorcredit component call: <figure> <img s...
...And 5 more matches
Componentizing our Svelte app - Learn web development
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.
... other people apply the same techniques used for deciding if you should create a new function or object.
... both approaches should complement each other, and help you decide how to better organize your components.
...And 5 more matches
Working with Svelte stores - Learn web development
in this article we will show another way to handle state management in svelte — stores.
...in this case, the alert component is independent from the rest — it is not a parent or child of any other — so the messages don't fit into the component hierarchy.
... repl to code along with us using the repl, start at https://svelte.dev/repl/d1fa84a5a4494366b179c87395940039?version=3.23.2 dealing with our app state we have already seen how our components can communicate with each other using props, two-way data binding, and events.
...And 5 more matches
Getting started with Vue - Learn web development
a clearer vue vue is a modern javascript framework that provides useful facilities for progressive enhancement — unlike many other frameworks, you can use vue to enhance existing html.
... as you work through this tutorial, you might want to keep the vue guide and api documentation open in other tabs, so you can refer to them if you want more information on any sub topic.
... for a good (but potentially biased) comparison between vue and many of the other frameworks, see vue docs: comparison with other frameworks.
...And 5 more matches
Debugging on Mac OS X
these builds enable hardened runtime and only differ from production builds in that they are not notarized which should not otherwise affect functionality, (other than the ability to easily launch the browser on macos 10.15+ -- see quarantine note below).
...select the "cross-platform" tab then under the "other" template group select the "empty" project type.
...set the executable by clicking on "none" and selecting "other...".
...And 5 more matches
Eclipse CDT Manual Setup
some of it like the section on building the index and usage tips are still relevant, and other parts still may provide useful background information to understand it in more detail on how eclipse works.
...like some other ides, that are used with projects like mozilla that have their own build system.
... select "general > workspace" and select "refresh using native hooks or polling" and "refresh on access" to prevent eclipse giving you annoying "resource is out of sync" messages when files change from under it due to mercurial or other external activity.
...And 5 more matches
mach
you can add the command to your .profile so it will run automatically when you start the shell: source /path/to/mozilla-central/python/mach/bash-completion.sh this will enable tab completion of mach command names, and in the future it may complete flags and other arguments too.
...why even bother with a competing build system in arch when octopi does what you want and even has a gui?
... another possible reason: mach gives you an error, while running, say bootstrap.py directly (that is to type in a bash shell: python2 ./bootstrap.py enter-key ) in an otherwise empty ..../subdir/ may work for you!
...And 5 more matches
Performance best practices for Firefox front-end engineers
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.
...doing so might cause flushes to occur for other promisedocumentflushed callbacks that are scheduled to fire in the same tick of the refresh driver.
...And 5 more matches
HTML parser threading
it also has another lazily initialized tokenizer/tree builder for speculatively scanning the tail of document.write() data when the parser blocks without parsing the document.write() data to completion.
...each tree op represents a small operation, such as element creation or appending a node into another, that can later be performed on the main thread.
...for other atoms, the parser uses nshtml5atom objects that are atomic only within the scope of an nshtml5atomtable.
...And 5 more matches
Using JavaScript code modules
creating a javascript code module a very simple javascript module looks like this: var exported_symbols = ["foo", "bar"]; function foo() { return "foo"; } var bar = { name : "bar", size : 3 }; var dummy = "dummy"; notice that the module uses normal javascript to create functions, objects, constants, and any other javascript type.
...r example: components.utils.import("resource://app/my_module.jsm"); alert(foo()); // displays "foo" alert(bar.size + 3); // displays "6" alert(dummy); // displays "dummy is not defined" because 'dummy' was not exported from the module note: when you're testing changes to a code module, be sure to change the application's build id (e.g., the version) before your next test run; otherwise, you may find yourself running the previous version of your module's code.
... if you're writing an extension for firefox 4 and already have a chrome.manifest with a content instruction in it, you can put the code module in your content folder and reference it like your other content files via chrome://<yourextension>/content/<yourmodule>.jsm.
...And 5 more matches
sslerr.html
it is a generic error, used when none of the other more specific error codes defined in this file applies.
...it is a generic error, used when none of the other more specific error codes defined in this file applies.
... ssl_error_fortezza_pqg -12267 "cannot connect: ssl peer is in another fortezza domain." the local system and the remote system are in different fortezza domains.
...And 5 more matches
Tracing JIT
the nanojit component is language agnostic, and contains no knowledge about spidermonkey or any other part of the mozilla codebase.
... a fragment represents a single linear code sequence, typically terminating in a jump to another fragment or back to the beginning of the fragment.
...in other words, an assembler transforms lir code into native code.
...And 5 more matches
JS_THREADSAFE
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).
...in a multithreaded program, even if the calling thread has been idle, other threads may be active or may call js_gc().
...when one thread calls js_gc or otherwise finds that garbage collection is necessary, it must wait for all other threads that are in requests to pause before garbage collection can occur.
...And 5 more matches
Redis Tips
but obviously, calling ice cream a nowhale food doesn't give you any sense of how good the ice cream is, or what sets it apart from other kinds of food that aren't made from whale meat but that are also very unlike ice cream -- it just gives the whaling industry a way to lump together people who don't use their products.
... redis> get foo (nil) redis> setnx foo 17 (integer) 1 redis> get foo "17" redis> setnx foo 42 (integer) 0 the return value from setnx is 1 if the value was set, 0 otherwise.
... note that if one of your commands crashes, the others still all execute!
...And 5 more matches
Places Developer Guide
other bookmarks apis note: this document covers the toolkit places services.
... apis that are browser-specific: fuel - a collection of wrapper apis for easing access to a number of firefox utilities and services nsiplacestransactionsservice - a firefox service for modifying bookmarks in a transactional manner, providing facilities for undo/redo places utilities for javascript - accessors and helper functions for firefox and extensions creating bookmarks, folders and other items creating a bookmark // create an nsiuri for the url to be bookmarked.
... moveitem (afolderid, anewparentid, aindex) - move an item from one folder to another.
...And 5 more matches
Packaging WebLock
« previousnext » in this final part of the tutorial, we'll put all of the pieces of the web locking component - the library itself, the type library, the header file, and the user interface resources - into a package that can be installed on other systems.
... like the windows registry, the chrome registry is a database of information about applications, skins, and other extensions that have been installed in a gecko application.
... since mozilla and other gecko-based applications are cross-platform, this database is abstracted above the operating system or any particular platform's registry.
...And 5 more matches
IAccessibleTable2
other-licenses/ia2/accessibletable2.idlnot scriptable this interface gives access to a two-dimensional table.
...otherwise a null pointer is returned.
...isselected returns true if the specified column is selected completely and false otherwise.
...And 5 more matches
IAccessibleText
other-licenses/ia2/accessibletext.idlnot scriptable a structure containing a substring and the start and end offsets in the enclosing string.
... return value s_false if the caret is not currently active on this object, that is the caret is located on some other object.
...it represents the current input position and will therefore typically be queried by at more often than other positions.
...And 5 more matches
nsINavBookmarksService
note: renamed from bookmarksroot in gecko 1.9 placesroot long long the item id of the top-level folder that contains bookmarks, tags and all other places data.
...for js or from other components, just please be very careful to close the batch, especially when encountering an error and returning early.
... return value returns true if the folder is marked as read-only, otherwise returns false.
...And 5 more matches
nsINavHistoryResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this is the base class for all places history result nodes, containing the uri, title, and other general information.
...for other nodes, this value is 0.
...for other nodes, this value is set to -1.
...And 5 more matches
nsIScriptableIO
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.
...for example: io.getfile("profile", "cookies.txt"); from an xpcom component, however, you will need to get a reference as with other components: var scriptableio = components.classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profile", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath); nsisupports newinputstream(in nsivariant abase, in...
... nsiinputstream: a stream returned by a previous call to this method, or any other object that implements nsiinputstream.
...And 5 more matches
Add to iPhoto
this extension for mac os x serves as a demonstration of how to use js-ctypes to call mac os x carbon, core foundation, and other system frameworks from an extension written entirely in javascript.
...among these are routines for managing cfstring, cfurl, and cfarray objects, among others.
... these are core system data formats that are used by other frameworks, and we'll be making use of them.
...And 5 more matches
Plug-in Basics - Plugins
a plug-in consumes no resources other than disk space when it is not loaded.
...plug-ins consume no resources (other than disk space) when not loaded.
...i found other way how check which paths support firefox : $ strace -y /usr/bin/firefox 2>&1 | grep acces | grep -v search | grep plugins access("/home/user_name/.mozilla/firefox/dqh2nb5k.default-1441864569209/plugins", f_ok) = -1 enoent (no such file or directory) access("/home/user_name/.mozilla/plugins", f_ok) = -1 enoent (no such file or directory) access("/usr/lib64/firefox/browser/plugins", f_ok) = -1 en...
...And 5 more matches
Debugger.Script - Firefox Developer Tools
a dom event handler, whether embedded in html or attached to the element by other javascript code.
...this allows the code using each debugger instance to place whatever properties it likes on its debugger.script instances, without worrying about interfering with other debuggers.) a debugger.script instance is a strong reference to a jsscript object; it protects the script it refers to from being garbage collected.
...false otherwise.
...And 5 more matches
AudioListener - Web APIs
the forward and up values are linearly independent of each other.
...the forward and up values are linearly independent of each other.
...the forward and up values are linearly independent of each other.
...And 5 more matches
Drawing shapes with canvas - Web APIs
all other shapes must be created by combining one or more paths.
...the anticlockwise parameter is a boolean value which, when true, draws the arc anticlockwise; otherwise, the arc is drawn clockwise.
... note: this example requires a slightly larger canvas than the others on this page: 150 x 200 pixels.
...And 5 more matches
Using files from web applications - Web APIs
if you want to use the dom file api from extensions or other browser chrome code, you can; however, note there are some additional features to be aware of.
...note that in this case the input element must not be hidden using display: none (nor visibility: hidden), otherwise the label would not be keyboard-accessible.
...in addition, it displays other file information including their names and sizes.
...And 5 more matches
The HTML DOM API - Web APIs
access to the browser navigation history supporting and connective interfaces for other apis such as web components, web storage, web workers, websocket, and server-sent events.
...discussion of other areas, such as drag and drop, websockets, web storage, etc.
... nodes may be strictly organizational, providing a means for grouping other nodes together or for providing a point at which a hierarchy can be constructed; other nodes may represent visible components of a document.
...And 5 more matches
Pointer events - Web APIs
however, since many devices support other types of pointing input devices, such as pen/stylus and touch surfaces, extensions to the existing pointing device event models are needed.
... 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.
... pointer capture pointer capture allows the events for a pointer to be retargeted to a particular element other than the normal hit test result of the pointer's location.
...And 5 more matches
Service Worker API - Web APIs
they are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server.
...the point where this event fires is generally a good time to clean up old caches and other things associated with the previous version of your service worker.
... other use case ideas service workers are also intended to be used for such things as: background data synchronization.
...And 5 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
zero or more characters other than those noted above.
...the example where we wanted the transcription text to be red highlighted and the other part to remain normal, we can define it as follows using css.
... in addition to the three escape sequences mentioned above, there are fours others.
...And 5 more matches
Using Web Workers - Web APIs
worker()) that runs a named javascript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window.
...it accepts zero or more uris as parameters to resources to import; all of the following examples are valid: importscripts(); /* imports nothing */ importscripts('foo.js'); /* imports just "foo.js" */ importscripts('foo.js', 'bar.js'); /* imports two scripts */ importscripts('//example.com/hello.js'); /* you can import scripts from other origins */ the browser loads each listed script and executes it.
... however, since web workers have carefully controlled communication points with other threads, it's actually very hard to cause concurrency problems.
...And 5 more matches
ARIA: application role - Accessibility
description the application role indicates to assistive technologies that this part of the web content contains elements that do not conform to any other known html element or wai-aria widget.
... in this mode, the web author is completely responsible for handling any and all keyboard input, focus management, and other interactions and cannot assume assistive technologies would do any processing on their end.
... background 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.
...And 5 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
for elements with a block formatting context, the spec says: “in a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block.
... in a block formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left formatting, right edges touch).” - 9.4.1 for elements with an inline formatting context: “in an inline formatting context, boxes are laid out horizontally, one after the other, beginning at the top of a containing block.
... elements participating in a block formatting context block elements in a horizontal writing mode such as english, layout vertically, one below the other.
...And 5 more matches
Variable fonts guide - CSS: Cascading Style Sheets
however, the w3c’s intent was for this syntax not to be used when other attributes are available.
... therefore wherever possible, the appropriate property should be used, with the lower-level syntax of font-variation-settings only being used to set values or axes not available otherwise.
... it should be noted that at this point there is no way in the @font-face declaration to 'map' a specific point on the variation axis of a variable font to the keyword bold (or any other keyword).
...And 5 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
for this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs.
...in the code snippet below, the item is placed 20 pixels from the top, and 30 pixels from the left of the container: .container { position: relative; } .item { position: absolute; top: 20px; left: 30px; } <div class="container"> <div class="item">item</div> </div> another place you might see physical keywords in use, is when using text-align: right to align text to the right.
... css writing modes i’m going to introduce another specification here, that i will be using in my examples: the css writing modes specification.
...And 5 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
the supporting browsers other than in internet explorer, css grid layout is unprefixed in safari, chrome, opera, firefox and edge.
...you could start by simply enhancing elements in your design with grid, that could otherwise display using an older method.
... overwriting of legacy methods with grid layout works surprisingly well, due to the way grid interacts with these other methods.
...And 5 more matches
place-content - CSS: Cascading Style Sheets
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.
...And 5 more matches
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
you should also include other explanatory text nearby.
...it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content.
...this may be based upon a parent's spellcheck setting or other factors.
...And 5 more matches
Link types - HTML: Hypertext Markup Language
in html, link types indicate the relationship between two documents, in which one links to the other using an <a>, <area>, <form>, or <link> element.
... otherwise, the link defines an alternative page, of one of these types: for another medium, like a handheld device (if the media attribute is set) in another language (if the hreflang attribute is set), in another format, such as a pdf (if the type attribute is set) a combination of these <a>, <area>, <link> <form> archives de...
... note: other link types related to linking resources in the same sequence are last, prev, next.
...And 5 more matches
Using the application cache - HTML: Hypertext Markup Language
subsequent visits to that document cause the browser to load the document and other assets specified in the manifest file from the application cache (not from the server).
... important: do not specify the manifest itself in the cache manifest file, otherwise it will be nearly impossible to inform the browser a new manifest is available.
... example 2: a more complete cache manifest file the following is a more complete cache manifest file for the imaginary web site at www.example.com: cache manifest # v1 2011-08-14 # this is another comment index.html cache.html style.css image1.png # use from network if available network: network.html # fallback content fallback: .
...And 5 more matches
Content negotiation - HTTP
over the years, other content negotiation proposals, like transparent content negotiation and the alternates header, have been proposed.
... server-driven content negotiation in server-driven content negotiation, or proactive content negotiation, the browser (or any other kind of user-agent) sends several http headers along with the url.
... the accept header is defined by the browser, or any other user-agent, and can vary according to the context, like fetching an html page or an image, a video, or a script: it is different when fetching a document entered in the address bar or an element linked via an <img>, <video> or <audio> element.
...And 5 more matches
Index - HTTP
WebHTTPHeadersIndex
the apis that are restricted are: 33 csp: default-src csp, directive, http, reference, security the http content-security-policy (csp) default-src directive serves as a fallback for the other csp fetch directives.
...on the other side, if the content has changed, etags are useful to help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions").
...for put and other non-safe methods, it will only upload the resource in this case.
...And 5 more matches
HTTP headers - HTTP
WebHTTPHeaders
custom proprietary headers have historically been used with an x- prefix, but this convention was deprecated in june 2012 because of the inconveniences it caused when nonstandard fields became standard in rfc 6648; others are listed in an iana registry, whose original content was defined in rfc 4229.
... timing-allow-origin specifies origins that are allowed to see values of attributes retrieved via features of the resource timing api, which would otherwise be reported as zero due to cross-origin restrictions.
... cross-origin-opener-policy (coop) prevents other domains from opening/controlling a window.
...And 5 more matches
Closures - JavaScript
in other words, a closure gives you access to an outer function’s scope from an inner function.
...one way of doing this is to specify the font-size of the body element (in pixels), and then set the size of the other elements on the page (such as headers) using the relative em unit: body { font-family: helvetica, arial, sans-serif; font-size: 12px; } h1 { font-size: 1.5em; } h2 { font-size: 1.2em; } such interactive text size buttons can change the font-size property of the body element, and the adjustments are picked up by other elements on the page thanks to the relative units.
... emulating private methods with closures languages such as java allow you to declare methods as private, meaning that they can be called only by other methods in the same class.
...And 5 more matches
Working with objects - JavaScript
objects overview objects in javascript, just as in many other programming languages, can be compared to objects in real life.
...lt = []; for(objecttoinspect = o; objecttoinspect !== null; objecttoinspect = object.getprototypeof(objecttoinspect)) { result = result.concat( object.getownpropertynames(objecttoinspect) ); } return result; } this can be useful to reveal "hidden" properties (properties in the prototype chain which are not accessible through the object, because another property has the same name earlier in the prototype chain).
...identical object initializers create distinct objects that will not compare to each other as equal.
...And 5 more matches
Promise - JavaScript
not to be confused with: several other languages have mechanisms for lazy evaluation and deferring a computation, which they also call "promises", e.g.
...you will also hear the term resolved used with promises — this means that the promise is settled or “locked in” to match the state of another promise.
...(see throw -999 in the example, below, for a technique to handle the consequences.) on the other hand, in the absence of an immediate need, it is simpler to leave out error handling until a final .catch() statement.
...And 5 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
sume 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 engages with media frequently, or manually through preferences or other user interface features if the autoplay feature policy is used to grant autoplay support to an <iframe> and its document.
... otherwise, the playback will likely be blocked.
... 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.
...And 5 more matches
Web Performance
we cover them in this section: key performance guides animation performance and frame rateanimation on the web can be done via svg, javascript, including <canvas> and webgl, css animation, <video>, animated gifs and even animated pngs and other image types.
... 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.critical rendering paththe critical rendering path is the sequence of steps the browser goes through to convert the html, css, and javascript into pixels on the screen.
...these perceptions are impacted by actual page load time, idling, responsiveness to user interaction, and the smoothness of scrolling and other animations.
...And 5 more matches
Namespaces crash course - SVG: Scalable Vector Graphics
the problem with mixing content from different xml dialects in a single xml document is that the elements defined by one dialect may have the same name as elements defined by another.
...(in fact uris are used so frequently that the term "namespace uri" is commonly used instead of "namespace name".) redeclaring the default namespace so if all the descendants of the root element are also defined to be in the default namespace, how do you mix in content from another namespace?
...this parameter is commonly used by other xml dialects as a means to link to external resources.
...And 5 more matches
Same-origin policy - Web security
the same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin.
...(a "tuple" is a set of items that together comprise a whole — a generic form for double/triple/quadruple/quintuple/etc.) the following table gives examples of origin comparisons with the url http://store.company.com/dir/page.html: url outcome reason http://store.company.com/dir2/other.html same origin only the path differs http://store.company.com/dir/inner/another.html same origin only the path differs https://store.company.com/page.html failure different protocol http://store.company.com:81/dir/page.html failure different port (http:// is port 80 by default) http://news.company.com/dir/page.html failure differ...
... these exceptions are nonstandard and unsupported in any other browser.
...And 5 more matches
context-menu - Archive of obsolete content
it does not occur when the user invokes the context menu on a link, image, or other non-text node, or while a selection exists.
... array an array of any of the other types.
...like other apis in the sdk, the context-menu api uses content scripts to let your add-on interact with pages in the browser.
...And 4 more matches
JavaScript Daemons Management - Archive of obsolete content
* all other optional instances methods depend on this one or on the previous ones.
... when a method requires the presence of another method (it is relatively rare), there is a comment which explains why.
...this.index : this.length - this.index, breverse, bforce); }; daemon.prototype.reclose = function (bforce) { /* warning: this method requires the daemon.prototype.makesteps() and daemon.prototype.close() methods */ return this.close(this.isatend() !== this.backw, bforce || false); }; /* others */ daemon.prototype.restart = function () { this.stop(); this.start(); }; daemon.prototype.loopuntil = function (vdate) { if (!isfinite(this.length)) { return; } var ntime = vdate.constructor === date ?
...And 4 more matches
Enhanced Extension Installation - Archive of obsolete content
this can lead to incompatibilities, mysterious crashes and other problems.
... tracking item type item type is tracked for the most part by containment in one or other of the two containers.
...these include: the application profile directory <profile>/extensions/ the application install directory <application>/extensions/ any location specified in a text file with a {guid} name placed in one of the above locations, useful for developing extensions at another location, e.g.
...And 4 more matches
Appendix A: Add-on Performance - Archive of obsolete content
other add-ons have most of their features depend on a user being logged in to a service.
... page loads this is another critical route that many add-ons tap into.
...this is what you should do first to make sure that you filter out all cases that don't interest you so that your add-on doesn't slow down other requests.
...And 4 more matches
Local Storage - Archive of obsolete content
otherwise you may run into problems if the same extension is installed in multiple profiles.
... let localdir = directoryservice.get("profd", ci.nsifile); localdir.append("xulschool"); if (!localdir.exists() || !localdir.isdirectory()) { // read and write permissions to owner and group, read-only for others.
...in general this is the only directory flag you'll need, but sometimes you'll need access to other system directories, and you don't want to have to worry about which operating system or system language your extension is running on.
...And 4 more matches
Setting Up a Development Environment - Archive of obsolete content
on the other hand, extensions use the same (or similar) languages that are used for web development, so most text editors and ides are up to the task.
...that is more than what you can get with most other editors, so we recommend you to give it a try.
... 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.
...And 4 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
that new page may have links that take you to other pages, which may in turn have more links, and so on.
...for web developers, for example, it provides less fine-grained control over the experience, and it can strain bandwidth and other resources.
...an implementation can also use other transport technologies such as soap-based remote procedure calls, xmlhttprequest interfaces, or dom 3 load.
...And 4 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
for netscape 4.x the convert function from the client customization kit (cck) could also do that (and other things like personalize auto-installation...): http://developer.netscape.com/docs/manuals/deploymt/config.htm.
... 569 01-01-2010 00:00 defaults/profile/mimetypes.rdf 76 01-01-2010 00:00 defaults/preferences/firefox-l10n.js 91656 01-01-2010 00:00 defaults/preferences/firefox.js 1593 01-01-2010 00:00 defaults/preferences/firefox-branding.js 473 01-01-2010 00:00 defaults/profile/prefs.js unlike old thunderbird 8, firefox 8 didn't include prefcalls.js in omni.jar , but other .js files though: [root@arvouin firefox]# jar tvf omni.jar | grep defaults/pref 0 fri nov 04 21:34:18 cet 2011 defaults/preferences/ 604 fri nov 04 21:34:18 cet 2011 defaults/preferences/all-redhat.js 1389 fri nov 04 21:34:18 cet 2011 defaults/preferences/firefox-branding.js 76 fri nov 04 21:34:18 cet 2011 defaults/preferences/firefox-l10n.js 50295 fri nov 04 21:34:18 cet 2011 def...
...c=int-evry,dc=fr","uid=" + env_user,"uid,cn,mail,labeleduri"); // close the try, and call the catch() } catch(e) {displayerror("lockedpref", e);} debug if you set a username and the mozilla_debug variable ($export mozilla_debug=1; export user=procacci), then the displayerror() will show you this popup: that's a popup titled as "error", but it's just a debug tool for me as i didn't find any other way to popup information.
...And 4 more matches
JavaScript Client API - Archive of obsolete content
records are transformed to wbo's, uploaded to a collection in a sync server and eventually downloaded by other sync clients.
...the name store is somewhat of a misnomer, as stores don't actually persistently store anything, but rather serve as short-lived data stores during the course of a single sync and act as proxies to other data stores within the application (like the places database) outside of sync.
...it is possible for other components, including 3rd party extensions, to supplement the set of engines and synchronize their own data.
...And 4 more matches
New Skin Notes - Archive of obsolete content
devmo skin vs cavendish skin --callek i can probably pull-off this patch if needed (quickly), so dria or others do not have to hunt up "how".
...in all other dev centres there is no "visited link color" and we should remove imho.
...this is not what user expects (well, i don't expect sites to style visited and non-visited links the same), and it's false that other documentation sites do this (i just checked apple's and microsoft's sites).
...And 4 more matches
Elements - Archive of obsolete content
please do not edit only on the basis of another xbl specification.
...it should usually declare xbl as the default namespace (unless an xbl namespace prefix is used) and it may additionally declare other namespace prefixes used in your binding.
...each binding child element defines a unique binding that can be attached to elements in other documents.
...And 4 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
xpi packages, like zip files, "contain" other files, typically: the software component to be installed.
... install the plugin software to another location on the user's hard disk, so that other mozilla-based browsers that the user may install later can find the plugin (the browser specific components) and pick it up.
...rather than re-initiate the download of the plugin with the yet another browser, the second netscape gecko browser can detect that an installation has already occurred.
...And 4 more matches
A XUL Bestiary - Archive of obsolete content
in other words, a chrome url like the global pointer above picks up a file called global.css, and the help pointer above could also be written as chrome://help/content, because the name of the package itself is "help." viewing chromes other than mozilla's there is a special flag you can use to start mozilla with some chrome other than the default.
...this section describes xul, xptoolkit, and xpfe, which are in some respects synonymous and in others quite different.
...a loosely analogous relationship might be that xul, xptoolkit, and xpfe are to one another what html, the actual html tags, and an html web page are to one another, respectively.
...And 4 more matches
Reading from Files - Archive of obsolete content
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.
...an input stream provides a means of reading bytes, strings or other values from the file.
...however, a number of other character encodings are available; see reading other character encodings below for details about reading text in other encodings.
...And 4 more matches
Building Trees - Archive of obsolete content
you can use a template with a tree just like any other template.
...the tree builder implements the nsitreeview interface, so it becomes the tree’s view—in other words, the tree’s view and the tree’s builder are the same object.
...m messages </query> <action> <treechildren> <treeitem uri="?"> <treerow> <treecell label="?subject"/> <treecell label="?sender"/> <treecell label="?date"/> </treerow> </treeitem> </treechildren> </action> </template> </tree> features of the tree builder besides the label of a cell, there are several other cell properties you can set when using the tree builder.
...And 4 more matches
Commands - Archive of obsolete content
in addition, text fields and other widgets have a number of commands which they already support that you can invoke.
... the other advantage is that several buttons or other ui elements can be hooked up to the same command.
... it is normal to put a group of commands inside a commandset element, together near the top of the xul file, as in the following: <commandset> <command id="cmd_open" oncommand="alert('open!');"/> <command id="cmd_help" oncommand="alert('help!');"/> </commandset> a command is invoked when the user activates the button or other element attached to the command.
...And 4 more matches
Cross Package Overlays - Archive of obsolete content
applying overlays to other packages note: this section talks about contents.rdf which has been replaced in gecko 1.8 by manifest files.
... overlays have another very useful feature.
...you can also go the other way and have the overlays specify which windows that they apply to.
...And 4 more matches
Element Positioning - Archive of obsolete content
note that the css global skin of the xul application may also specify a min-width for the buttons and other elements, thus if simply setting the width property does not set the button width as you expect, try also to modify the button min-width property.
...if you specify only one size property, the other is calculated as needed.
...the following example demonstrates this: example 2 : source view <window orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox> <button label="yes" flex="1"/> <button label="no"/> <button label="i really don't know one way or the other"/> </hbox> </window> the window will initially appear like in the image earlier.
...And 4 more matches
Features of a Window - Archive of obsolete content
creating another window you can create a second window for your application in the same manner as you would create the first one.
...you can use this reference to call functions of the other window.
...if you only specify one, the other will be set to 0.
...And 4 more matches
Manifest Files - Archive of obsolete content
you can specify multiple packages by including another line in the manifest file.
...otherwise, if an extension attempted to call the modified versions, it would likely not work properly, or worse, create a security hole.
... installing a package for an application to be installed, you will need to create an installer for it, or include it as part of another application.
...And 4 more matches
Skinning XUL Files by Hand - Archive of obsolete content
button.plain { border: 0px !important; } the global skin, in which styles for these several button classes and dozens of other elements are defined, is described in the following section.
...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.
...the following table shows the basic format for these two common types of style definitions: class id element.class { attribute: value; } element#id { attribute: value; } menu.baseline { border: 0px; font-size: 9pt; } menu#edit { color: red; } other style subgroups contextualsubgroups -- elements appearing within other elements, such as italicized text anywhere within a <p> element or a <div> -- can be grouped in css, but this is an extremely inefficient way to style xul, and is frowned upon in the mozilla development community (again, refer to the skinning guidelines in writing skinnable xul and css for more info); css2 also provides some ...
...And 4 more matches
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
for instance, you cannot change the appearance of the tree rows using the style attribute or with other css properties and the box related features such as flexibility and orientation cannot be used.
... in addition, mouse and other user interface events do not fire at these elements.
...however, there are special ways of styling the tree and setting other features which we will see in later sections.
...And 4 more matches
XPCOM Interfaces - Archive of obsolete content
the syntax of a contract id is: @<internetdomain>/module[/submodule[...]];<version>[?<name>=<value>[&<name>=<value>[...]]] other components can be referred to in a similar way.
...for example, to get a sound interface, you can do the following: var sound = components.classes["@mozilla.org/sound;1"].createinstance(); if (sound) sound.queryinterface(components.interfaces.nsisound); xpcom interfaces can inherit from other interfaces.
... the interfaces that inherit from others have their own functions and the functions of all the interfaces that they inherit from.
...And 4 more matches
listbox - Archive of obsolete content
if the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...upnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata additemtoselection( item ) return type: no return value selects the given item, without deselecting any other items that are already selected.
...And 4 more matches
calICalendarView - Archive of obsolete content
because of this close association between methods and attributes on the one hand, and content on the other, calicalendarview implementations are particularly well suited to xbl.
...this link allows the calicalendarview to have a way of creating, modifying, and deleting events based on user interaction with the dom nodes it controls, often without requiring any other user interaction.
... in general, therefore, a calicalendarview will not provide its own controller, but rather rely on other code to set this attribute.
...And 4 more matches
Sunbird Theme Tutorial - Archive of obsolete content
you might be able to apply the same method to other mozilla applications by changing some of the details.
... adding other components your theme only modifies the calendar component.
...to understand the user interface provided by these other components, unpack the other jar files.
...And 4 more matches
Theme changes in Firefox 2 - Archive of obsolete content
tton:hover:active toolbar[iconsize="small"] #print-button:hover toolbar[iconsize="small"] #print-button:hover:active toolbar[iconsize="small"] #reload-button:hover toolbar[iconsize="small"] #reload-button:hover:active toolbar[iconsize="small"] #stop-button:hover toolbar[iconsize="small"] #stop-button:hover:active toolbarbutton.bookmark-item-microsummarized you may need to make changes to other styles as well.
...chbar-engine-button .search-go-button .search-go-button:hover .search-go-button:hover:active .search-go-button[disabled="true"] .searchbar-engine-button .searchbar-engine-button:hover .searchbar-engine-button[addengines="true"] .searchbar-engine-button[open="true"] .searchbar-engine-menuitem[selected="true"] > .menu-iconic-text .searchbar-left you may of course wish to make changes to other styles as well.
...o[pane=panemain]:active radio[pane=panemain]:hover radio[pane=panemain][selected="true"] radio[pane=paneprivacy]:hover radio[pane=paneprivacy][selected="true"] radio[pane=panesecurity] radio[pane=panesecurity]:active radio[pane=panesecurity]:hover radio[pane=panesecurity][selected="true"] radio[pane=panetabs]:hover radio[pane=panetabs][selected="true"] you may of course wish to change other styles as well.
...And 4 more matches
Introduction to game development for the Web - Game development
instead, you can advertise and promote your game all over the web as well as other media, taking advantage of the web's inherent linkability and shareability to reach new customers.
...no waiting breathlessly for approval while someone hidden within another company decides whether or not your critical bug fix will ship today or tomorrow.
... gamepad api if you want your users to be able to use gamepads or other game controllers to work your game, you'll need this api.
...And 4 more matches
Audio for Web games - Game development
for other more active sounds that are to be used during the game we could consider priming them as soon as something like a start button is pressed.
...loading synchronously might mean parts of your music are ready earlier and you can start playing them while others load.
...avi</a> <p class="loading-text">loading...</p> <button data-playing="false" aria-describedby="clavi-play-label"> <span id="clavi-play-label">play</span> </button> </li> </ul> <p class="sourced">all tracks sourced from <a href="http://jplayer.org/">jplayer.org</a></p> </section> all of these tracks are the same tempo and are designed to be synchronized with each other, so we need to make sure they are loaded and available to the api before we are able to play them.
...And 4 more matches
Backgrounds and borders - Learn web development
in the example below, we have two boxes — one has a background image which is larger than the box, the other has a small image of a star.
... you can use keywords such as top and right (look up the others on the background-position page): .box { background-image: url(star.png); background-repeat: no-repeat; background-position: top center; } and lengths, and percentages: .box { background-image: url(star.png); background-repeat: no-repeat; background-position: 20px 10%; } you can also mix keyword values with lengths or percentages, for example: .box { background-image: url(...
... when you do this you may end up with background images overlapping each other.
...And 4 more matches
Grids - Learn web development
by default these display in normal flow so the boxes display one below the other.
...declaring display: grid gives you a one column grid, so your items will continue to display one below the other as they do in normal flow.
...the fr unit distributes space in proportion, therefore you can give different positive values to your tracks, for example if you change the definition like so: .container { display: grid; grid-template-columns: 2fr 1fr 1fr; } the first track now gets 2fr of the available space and the other two tracks get 1fr, making the first track larger.
...And 4 more matches
What is a URL? - Learn web development
a url is composed of different parts, some mandatory and others optional.
...the web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don't be surprised if you see such protocols.
...otherwise it is mandatory.
...And 4 more matches
How the Web works - Learn web development
the other parts of the toolbox the client and server we've described above don't tell the whole story.
... there are many other parts involved, and we'll describe them below.
...on the other end of the road is the server, which is a shop you want to buy something from.
...And 4 more matches
Video and audio content - Learn web development
another such situation is the always-popular mp3 file.
... other <video> features there are a number of other features you can include when displaying an html video.
...other differences from html video are as follows: the <audio> element doesn't support the width/height attributes — again, there is no visual component, so there is nothing to assign a width or height to.
...And 4 more matches
Looping code - Learn web development
previous overview: building blocks next programming languages are very useful for rapidly completing repetitive tasks, from multiple basic calculations to just about any other situation where you've got a lot of similar items of work to complete.
... why bother?
...let's look at another example that takes a number as an input, and returns only the numbers that are squares of integers (whole numbers).
...And 4 more matches
Storing the information you need — Variables - Learn web development
previous overview: first steps next after reading the last couple of articles you should now know what javascript is, what it can do for you, how you use it alongside other web technologies, and what its main features look like from a high level.
... another special thing about variables is that they can contain just about anything — not just strings and numbers.
... you shouldn't use other characters because they may cause errors or be hard to understand for an international audience.
...And 4 more matches
Object-oriented JavaScript for beginners - Learn web development
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.
...in oop, we can create new classes based on other classes — these new child classes can be made to inherit the data and code features of their parent class, so you can reuse functionality common to all the object types rather than having to duplicate it.
...you can now see that we have two new objects on the page, each of which is stored under a different namespace — when you access their properties and methods, you have to start calls with person1 or person2; the functionality contained within is neatly packaged away so it won't clash with other functionality.
...And 4 more matches
Object building practice - Learn web development
our little balls will bounce around on the screen, and change color when they touch each other.
...along the way we'll make use of some nifty objects, and show you a couple of nice techniques like bouncing balls off walls, and checking whether they have hit each other (otherwise known as collision detection).
...25)'; ctx.fillrect(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.
...And 4 more matches
React interactivity: Events and state - Learn web development
there are a couple of other things to note: the camel-cased nature of onclick is important — jsx will not recognize onclick (again, it is already used in javascript for a specific purpose, which is related but different — standard onclick handler properties).
... callback props in react applications, interactivity is rarely confined to just one component: events that happen in one component will affect other parts of the app.
...another common convention you may well come across in react code is to prefix callback prop names with the word on, followed by the name of the event that will cause them to be run.
...And 4 more matches
Creating our first Vue component - Learn web development
along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props, and saving data state.
... objective: to learn how to create a vue component, render it inside another component, pass data into it using props, and save its state.
...additionally, prop validation functions are invoked before the component instance is created, so they do not have access to the component state (or other props).
...And 4 more matches
Implementing feature detection - Learn web development
lation), unzip the zip file, copy the html5shiv-printshiv.min.js and html5shiv.min.js files into your example directory, and link to one of the files by putting the following under your <title> element: <script src="html5shiv.min.js"></script> have a look at your example css files — you'll see that basic-styling.css handles all the styling that we want to give to every browser, whereas the other two css files contain the css we want to selectively apply to browser depending on their support levels.
... @supports also has or and not logic available — the other block applies the float layout if the flexbox properties are not available: @supports not (flex-flow: row) and (flex: 1) { /* rules in here */ } this may look a lot more convenient than the previous example — we can do all of our feature detection in css, no javascript required, and we can handle all the logic in a single css file, cutting down on http requests.
...generally, such tests are done via one of the following common patterns: summary of javascript feature detection techniques feature detection type explanation example if member in object check whether a certain method or property (typically an entry point into using the api or other feature you are detecting for) exists in its parent object.
...And 4 more matches
Deploying our app - Learn web development
parcel (and indeed many other tools) will generate filenames that are unique to each new build.
... 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 changes will be deployed.
...And 4 more matches
Adding a new event
otherwise, i.e., the event class is just used for internal event class of a dom event class, it should be internal.
... please note that aname must not be same as other event classes even if aprefix is different.
... textevents.h this header file should be used for defining input events from keyboard or ime and also other text edit related events like querying focused content information.
...And 4 more matches
A bird's-eye view of the Mozilla framework
when an html, xml, svg or other type of document is loaded, the nglayout engine (also known as gecko) parses the contents into a dom tree, and handles the layout and rendering of the document pages.
... core services modules such as the nglayout engine comprise the core application services available to other core modules, and xul packages core application modules are implemented as a set of one or more xpcom (cross-platform com) objects.
...mozilla architectural modules are comprised of groups of related xpcom objects that provide services to and access services from each other through dynamically queryable interfaces.
...And 4 more matches
What to do and what not to do in Bugzilla
the bug has been reproduced by some people but can't be reproduced by other people.
... the bug reporter reports that they can no longer see the bug and no other people report that they are still seeing the bug.
...the exceptions are bugs in other software which we have to work around and bugs that involve certain core gecko modules.
...And 4 more matches
Command line options
firefox -new-instance -p "another profile" note: not available for windows, see bug 855899.
... firefox -no-remote -p "another profile" note: since firefox 9, this does really mean what its name implies on all platforms, i.e.
...other platforms accept both upper and lower case.
...And 4 more matches
Creating reftest-based unit tests
so, if the effect of complex markup is being tested, put that complex markup into a page and create another page that uses simple markup to achieve the same visual effect.
...if you try to run the full suite, you may experience stalls or other issues.
...the file can include other things, but it does not get very complicated.
...And 4 more matches
Error codes returned by Mozilla APIs
these components usually provide an initialization method, often called init, which must be called before other methods are used.
... ns_error_no_aggregation (0x80040110) ns_error_not_available (0x80040111) an operation could not be completed because some other necessary component or resource was not available.
...while these errors can occur when using the file apis, they can also occur with other components that use files.
...And 4 more matches
Profile Manager
firefox and other xulrunner applications store user settings and data in special folders, called profiles.
... by default, profile manager will manage firefox profiles, but you can also use it to work with profiles of other xulrunner apps, like thunderbird or seamonkey.
... to use profile manager with an application other than firefox, you need to launch it using the application's name as an argument, for example: profilemanager-bin seamonkey profiles and application versions profile manager manages two different lists: one of user profiles, and the other of application versions that can be used with the profiles.
...And 4 more matches
Midas
otherwise, all selected characters will become bold.
... insertbronreturn true/false selects whether pressing return inside a paragraph creates another paragraph or just inserts a <br> tag.
...otherwise, all selected characters will become italic.
...And 4 more matches
nss tech note5
ck_mechanism_type wrapmech = ckm_des3_ecb; <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(wrapmech, null); or pk11slotinfo* slot = pk11_getinternalkeyslot(); /* always returns int slot, may not be optimal */ <big>regarding the choice of slot and wrapmech, if you know one, you can derive the other.
...to move keys to the desired slot, see section moving a key from one slot to another <big>secstatus s = pk11_wrapsymkey(wrapmech, secparam, wrappingsymkey, tobewrappedsymkey, &wrappedkey);</big> <big><big>transport/store or do whatever with the wrapped key (wrappedkey.data, wrappedkey.len)</big></big> <big><big>unwrapping.
... <big>regarding the choice of slot and wrapmech, if you know one, you can derive the other.
...And 4 more matches
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
other certificates on the token are also loaded (to allow building certificate chains), but it's not necessary to include the full chain, as long as the full chain is available in the regular certificate database.
... will nss get the user's ca certificate via pkcs #11 and push it into the ca certificate database or is the ca certificate database expected to obtain the ca certificate by some other means?
...all other certificates in the module are loaded into the temporary database with no special trust bits associated with them.
...And 4 more matches
Python binding for NSS
in other words they can be iterated over, indexed by position, or used as slices.
...this allows other python threads to execute during the time a nss/nspr function is progress in another thread.
... other documentation the doc directory contains other files you may wish to review.
...And 4 more matches
GC Rooting Guide
there are typedefs for js::mutablehandle<t>, the same as for the other templates: template class typedef js::mutablehandle<js::value> js::mutablehandlevalue js::mutablehandle<jsobject*> js::mutablehandleobject js::mutablehandle<jsstring*> js::mutablehandlestring js::mutablehandle<jsscript*> js::mutablehandlescript js::mutablehandle<jsid> js::mutablehandleid js::mutablehandle<t> shoul...
... if (!waserror) *valueout = resultvalue; return waserror; } void otherfunction(jscontext *cx) { js::value value; bool success = maybegetvalue(cx, &value); // ...
... if (!waserror) valueout.set(resultvalue); return waserror; } void otherfunction(jscontext *cx) { js::rootedvalue value(cx); bool success = maybegetvalue(cx, &value); // ...
...And 4 more matches
Garbage collection
in other words, from the point of view of the rest of the engine, the job of the gc is to allocate cells and automatically collect them.
...(some cells are shared across all compartments in a zone.) an object may not hold a direct pointer to an object in another compartment.
... instead, it must store a wrapper for the other object.
...And 4 more matches
Property cache
(informally: if another property shadows x'.p, the shape of x' will change.) o---->o---->o---->o ^x ^x' ^object.prototype, perhaps (----> indicates the proto relation) scope chain shadowing guarantee — if at time t0 the object x has shape s and a name lookup for p starting at scope chain head x finds p on an object x' of shape s', where x !== x'; and the lookup called no resolve hooks or non-...
...(informally: if another variable or property shadows x'.p, the shape of x' will change.) o this object is x, perhaps a call object.
... ↓ o another call object.
...And 4 more matches
SpiderMonkey 24
it continues to improve performance over previous spidermonkey releases, with a significantly improved garbage collector, a new jit compilation mode, and other features.
...on some other platforms (sparc, mips), the jit is provided but not supported.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
...And 4 more matches
A Web PKI x509 certificate primer
one issue that is not commonly known is that the x509 trust graph is not a forest (a bunch of trees where each root is a trusted root) but a cyclic graph, where the same key/issuer can be a root or an intermediate for another root in the browsers key store (when roots create intermediates for each other it is called cross-signing).
...certificates can have other extensions not described on rfc 5280, but that is out of the scope of this document.
... subject alternate name this extension defines what other names (such as dns names) are valid for this certificate.
...And 4 more matches
AT APIs Support
but in the meantime it more up-to-date and contains more details than existed analogues for at-spi and msaa this documentation explains how makers of screen readers, voice dictation packages, onscreen keyboards, magnification software and other assitive technologies can support gecko-based software.
... open komodo - platform for building developer environments miro - a free, open source internet tv and video player any xulrunner application (songbird media player, etc.) extensions to other xul apps (e.g.
... firefox extensions) gecko version for firefox and all other gecko-based products: this documentation applies to up-to-date product builds based on gecko 1.9.2 -- currently not available on official releases.
...And 4 more matches
History Service Design
places core history service (nsinavhistoryservice.idl) is the core of places, every other places service depends on it to correctly work, so it gets always initialized at application startup.
...in case the database has been created for the first time history service will create all tables, indexes and triggers, calling related inittables static methods of other dependant services.
...the same pre-compiled statements approach is used in other dependant services and in autocomplete.
...And 4 more matches
Places utilities for JavaScript
unfiledbookmarksfolderid other other attributes stored in placesutils.
... return type return true if the node is a folder, false otherwise.
... other other functions that i'm not sure how to file.
...And 4 more matches
XPCOM array guide
MozillaTechXPCOMGuideArrays
note that this class differs from the other array types by using unsigned indices.
... some other arrays: fallibletarray, autofallibletarray, infallibletarray, autoinfallibletarray, nstobserverarray, nsautotobserverarray.
... otherwise use nsiarray and make liberal use of queryelementat().
...And 4 more matches
nsIDocShell
instead, retrieve an nsidocshell from a browser or other document container element.
... forcedcharset nsiatom a character set to override the page's default character set while processing; this is tried before using any other character set during page loads.
...docshells are not app tabs unless told otherwise.
...And 4 more matches
nsIWebProgressListener
(see below for a description of document requests.) other types of requests, such as requests for inline content (for example images and stylesheets) are considered normal requests.
...this includes other document requests (for example corresponding to html <iframe> elements).
...this flag is accompanied by either state_start or state_stop, and it may be combined with other state type flags.
...And 4 more matches
XUL Overlays
MozillaTechXULOverlays
when plug-ins, browser extensions, or other applications provide new ui elements to the browser, these elements should be defined in overlay files.
...any number of overlays can be loaded into a master document, and an overlay can also load other overlays.
...loading overlays at runtime firefox 1.5 and other gecko 1.8-based applications also support loading overlays on-the-fly via the document.loadoverlay() function.
...And 4 more matches
Zombie compartments
│ │ │ ├──3.78 mb (00.76%) ++ js-compartment(https://www.google.de/?gws_rd=ssl) │ │ │ ├──0.51 mb (00.10%) ── style-sheets │ │ │ ├──0.33 mb (00.07%) -- dom │ │ │ │ ├──0.17 mb (00.04%) ── text-nodes │ │ │ │ ├──0.13 mb (00.03%) ── element-nodes │ │ │ │ ├──0.02 mb (00.00%) ── other │ │ │ │ ├──0.01 mb (00.00%) ── orphan-nodes │ │ │ │ └──0.00 mb (00.00%) ── event-targets │ │ │ └──0.00 mb (00.00%) ── property-tables │ │ └───5.93 mb (01.19%) -- js-zone(0x13ffa0000) │ │ ├──1.92 mb (00.39%) ── unused-gc-things │ │ ├──1.28 mb (00.26%) -- lazy-scripts │ │ ...
... first, many sites utilize scripts from other sites to provide advertisements, "like" and "+1" buttons, twitter feeds, etc.
.....) compartment(https://plusone.google.com/_/+1/fastbutton?...) compartment(http://platform.twitter.com/widgets/...utton.html?...) compartment(http://cdn.at.atwola.com/_media/uac/tcode3.html) compartment(https://s-static.ak.fbcdn.net/connec..._proxy.php?...) compartment(http://ads.tw.adsonar.com/adserving/getads.jsp?...) (some of those compartment urls are long and have been truncated.) another thing to beware is each compartment is created for an origin (e.g.
...And 4 more matches
Initialization and Destruction - Plugins
plug-ins consume no resources, other than disk space, if not referenced.
... the other table lists all api calls from the browser to the plug-in.
...however, because np_initialize is called at the end of the initialization process, you can call other methods, such as npn_memalloc and npn_status, from np_initialize.
...And 4 more matches
Accessibility Inspector - Firefox Developer Tools
the accessibility inspector provides a means to access important information exposed to assistive technologies on the current page via the accessibility tree, allowing you to check what's missing or otherwise needs attention.
...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.
... roles and other information exposed by browser accessibility apis are presented in a hierarchical structure called the accessibility tree.
...And 4 more matches
Background Tasks API - Web APIs
in the past, there's been no way to do this reliably other than by writing code that's as efficient as possible and by offloading as much work as possible to workers.
... 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.
...while the browser, your code, and the web in general will continue to run normally if you go over the specified time limit (even if you go way over it), the time restriction is intended to ensure that you leave the system enough time to finish the current pass through the event loop and get on to the next one without causing other code to stutter or animation effects to lag.
...And 4 more matches
Introduction to the DOM - Web APIs
this is expanded upon as needed by other apis that add new features and capabilities to the dom.
... this following javascript will display an alert when the document is loaded (and when the whole dom is available for use): <body onload="window.alert('welcome to my home page!');"> another example.
... this function creates a new h1 element, adds text to that element, and then adds the h1 to the tree for this document: <html> <head> <script> // run this function when the document is loaded window.onload = function() { // create a couple of elements in an otherwise empty html page const heading = document.createelement("h1"); const heading_text = document.createtextnode("big head!"); heading.appendchild(heading_text); document.body.appendchild(heading); } </script> </head> <body> </body> </html> fundamental data types this reference tries to describe the various objects and types in simple terms.
...And 4 more matches
Using Fetch - Web APIs
fetch provides a better alternative that can be easily used by other technologies such as service workers.
... fetch also provides a single logical place to define other http-related concepts such as cors and extensions to http.
...set-cookie headers from other sites are silently ignored.
...And 4 more matches
Fullscreen API - Web APIs
this makes it possible to present desired content—such as an online game—using the user's entire screen, removing all browser user interface elements and other applications from the screen until full-screen mode is shut off.
...instead, it augments several other interfaces to add the methods, properties, and event handlers needed to provide full-screen functionality.
... methods on the element interface element.requestfullscreen() asks the user agent to place the specified element (and, by extension, its descendants) into full-screen mode, removing all of the browser's ui elements as well as all other applications from the screen.
...And 4 more matches
HTMLMediaElement - Web APIs
htmlmediaelement.mozfragmentend is a double that provides access to the fragment end time if the media element has a fragment uri for currentsrc, otherwise it is equal to the media duration.
...using any other size results in an exception being thrown.
...true if the audio is muted and false otherwise.
...And 4 more matches
Intersection Observer API - Web APIs
historically, detecting visibility of an element, or the relative visibility of two elements in relation to each other, has been a difficult task for which solutions have been unreliable and prone to causing the browser and the sites the user is accessing to become sluggish.
...intersection information is needed for many reasons, such as: lazy-loading of images or other content as a page is scrolled.
... the intersection observer api lets code register a callback function that is executed whenever an element they wish to monitor enters or exits another element (or the viewport), or when the amount by which the two intersect changes by a requested amount.
...And 4 more matches
MediaDevices.getUserMedia() - Web APIs
that stream can include, for example, a video track (produced by either a hardware or virtual video source such as a camera, video recording device, screen sharing service, and so forth), an audio track (similarly, produced by a physical or virtual audio source like a microphone, a/d converter, or the like), and possibly other track types.
...see security for more information on this and other security issues related to using getusermedia().
...the following expresses a preference for 1280x720 camera resolution: { audio: true, video: { width: 1280, height: 720 } } the browser will try to honour this, but may return other resolutions if an exact match is not available, or the user overrides it.
...And 4 more matches
WebXR Device API - Web APIs
once both eyes' perspectives on the scene have been rendered, the resulting framebuffer is delivered to the webxr device to be presented to the user through their headset or other appropriate display device.
... the equipment may also include an accelerometer, barometer, or other sensors which are used to sense when the user moves through space, rotates their head, or the like.
...one view is offset to the left slightly from the viewer's position, and the other view is offset to the right by the same distance.
...And 4 more matches
Using the Web Animations API - Web APIs
this means that a keyframe object with three keys will play the middle key 50% of the way through each loop of the animation unless told otherwise.
... when we want to explicitly set a key’s offset from the other keys, we can specify an offset directly in the object, separated from the declaration with a comma.
... the other thing you’ll notice is that it’s iterations, not iteration-count.
...And 4 more matches
Using XMLHttpRequest - Web APIs
if this argument is true or not specified, the xmlhttprequest is processed asynchronously, otherwise the process is handled synchronously.
...otherwise the progress events will not fire.
... using nothing but xmlhttprequest submitting forms without the formdata api does not require other apis for most use cases.
...And 4 more matches
Grid template areas - CSS: Cascading Style Sheets
late-areas: "hd hd hd hd hd hd hd hd hd" "sd sd sd main main main main main main" "sd sd sd ft ft ft ft ft ft"; } <div class="wrapper"> <div class="header">header</div> <div class="sidebar">sidebar</div> <div class="content">content</div> <div class="footer">footer</div> </div> the value of grid-template-areas must show a complete grid, otherwise it is invalid (and the property is ignored).
...this is a component with space for an image or other media on one side and content on the other.
... </div> </div> displaying the image on the other side of the box we might want to be able to display our box with the image the other way around.
...And 4 more matches
CSS values and units - CSS: Cascading Style Sheets
grid-area: content; } in comparison, a data type that is a <string>, such as a string value of the content property, must be quoted: .item::after { content: "this is my content."; } while you can generally create any name you want, including using emojis, the identifier can't be none, unset, initial, or inherit, start with a digit or two dashes, and generally you don't want it to be any other pre-defined css keyword.
...there is never a space or any other characters between a the number and the unit identifier: i.e.
...otherwise, the unit identifier is required, is case insensitive, and must come immediately after the numeric part of the value, with no space in-between.
...And 4 more matches
Using media queries - CSS: Cascading Style Sheets
to target specific media for the <style>, <link>, <source>, and other html elements with the media= attribute.
... not the not operator is used to negate a media query, returning true if the query would otherwise return false.
...each query in a comma-separated list is treated separately from the others.
...And 4 more matches
grid-area - CSS: Cascading Style Sheets
WebCSSgrid-area
when grid-column-end is omitted, if grid-column-start is a <custom-ident>, grid-column-end is set to that <custom-ident>; otherwise, it is set to auto.
... when grid-row-end is omitted, if grid-row-start is a <custom-ident>, grid-row-end is set to that <custom-ident>; otherwise, it is set to auto.
...otherwise, it is set to auto.
...And 4 more matches
justify-content - CSS: Cascading Style Sheets
retch; /* distribute items evenly stretch 'auto'-sized items to fit the container */ /* overflow alignment */ justify-content: safe center; justify-content: unsafe center; /* global values */ justify-content: inherit; justify-content: initial; justify-content: unset; values start the items are packed flush to each other toward the start edge of the alignment container in the main axis.
... end the items are packed flush to each other toward the end edge of the alignment container in the main 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 side.
...And 4 more matches
Getting Started - Developer guides
then, mozilla, safari, and other browsers followed, implementing an xmlhttprequest object that supported the methods and properties of microsoft's original activex object.
...}; next, after declaring what happens when you receive the response, you need to actually make the request, by calling the open() and send() methods of the http request object, like this: httprequest.open('get', 'http://www.example.org/some.file', true); httprequest.send(); the first parameter of the call to open() is the http request method – get, post, head, or another method supported by your server.
... keep the method all-capitals as per the http standard, otherwise some browsers (like firefox) might not process the request.
...And 4 more matches
Adding captions and subtitles to HTML5 video - Developer guides
in other articles we looked at how to build a cross browser video player using the htmlmediaelement and window.fullscreen apis, and also at how to style the player.
... no image is used for the captions button, so it is simply styled as: .controls button[data-state="subtitles"] { height:85%; text-indent:0; font-size:16px; font-size:1rem; font-weight:bold; color:#666; background:#000; border-radius:2px; } there are also other css changes that are specific to some extra javascript implementation, but these will be mentioned at the appropriate place below.
... initial setup as with all the other buttons, one of the first things we need to do is store a handle to the subtitles' button: var subtitles = document.getelementbyid('subtitles'); we also initially turn off all subtitles, in case the browser turns any of them on by default: for (var i = 0; i < video.texttracks.length; i++) { video.texttracks[i].mode = 'hidden'; } the video.texttracks property contains an array of all the te...
...And 4 more matches
Constraint validation - Developer guides
in other words, this method sends the form data to the server even if doesn't satisfy the constraints.
... basically, the idea is to trigger javascript on some form field event (like onchange) to calculate whether the constraint is violated, and then to use the method field.setcustomvalidity() to set the result of the validation: an empty string means the constraint is satisfied, and any other string means there is an error and this string is the error message to display to the user.
... constraint combining several fields: postal code validation the postal code format varies from one country to another.
...And 4 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary.
...links are not restricted to http-based urls — they can use any url scheme supported by browsers: sections of a page with fragment urls pieces of media files with media fragments telephone numbers with tel: urls email addresses with mailto: urls while web browsers may not support other url schemes, web sites can with registerprotocolhandler() hreflang hints at the human language of the linked url.
... permitted parents any element that accepts phrasing content, or any element that accepts flow content, but not other <a> elements.
...And 4 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
in a similar manner to the <img> element, we include a path to the media we want to embed inside the src attribute; we can include other attributes to specify information such as whether we want it to autoplay and loop, whether we want to show the browser's default audio controls, etc.
...in other words, it sends the origin: http header without a cookie, x.509 certificate, or performing http basic authentication.
...in other words, it sends the origin: http header with a cookie, a certificate, or performing http basic authentication.
...And 4 more matches
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
the html inline frame element (<iframe>) represents a nested browsing context, embedding another html page into the current one.
...the browsing context that embeds the others is called the parent browsing context.
... because each browsing context is a complete document environment, every <iframe> in a page requires increased memory and other computing resources.
...And 4 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
there are many other attributes to achieve various purposes: referrer/cors control for security and privacy: see crossorigin and referrerpolicy.
...for these reasons and others, provide a useful value for alt whenever possible.
...allowed values: sync decode the image synchronously, for atomic presentation with other content.
...And 4 more matches
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
in other words, the user does not have to enter even one e-mail address when multiple is specified, regardless of the value of required.
...you should also include other explanatory text nearby.
...it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content.
...And 4 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
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 .
... table { border: 1px solid black; } th, td { border: 1px solid black; } result row and column spanning now, let's introduce another column that shows the date the user's membership ended, along with a super-heading above the "joined" and "canceled" dates called "membership dates".
... result let's actually look at the output first this time: notice how the heading area here is actually two rows, one with "name", "id", "membership dates", and "balance" headings, and the other with "joined" and "canceled", which are sub-headings below "membership dates".
...And 4 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
in a similar manner to the <img> element, we include a path to the media we want to display inside the src attribute; we can include other attributes to specify information such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's default video controls, etc.
... attributes like all other html elements, this element supports the global attributes.
... autopictureinpicture a boolean attribute which if true indicates that the element should automatically toggle picture-in-picture mode when the user switches back and forth between this document and another document or application.
...And 4 more matches
An overview of HTTP - HTTP
WebHTTPOverview
this role is primarily performed by the web browser; other possibilities are programs used by engineers and web developers to debug their applications.
...a server appears as only a single machine virtually: this is because it may actually be a collection of servers, sharing the load (load balancing) or a complex piece of software interrogating other computers (like cache, a db server, or e-commerce servers), totally or partially generating the document on demand.
... relaxing the origin constraint to prevent snooping and other privacy invasions, web browsers enforce strict separation between web sites.
...And 4 more matches
JavaScript data types and data structures - JavaScript
programming languages all have built-in data structures, but these often differ from one language to another.
...these can be used to build other data structures.
... wherever possible, comparisons with other languages are drawn.
...And 4 more matches
Numbers and dates - JavaScript
see also javascript data types and structures for context with other primitive types in javascript.
... decimal numbers 1234567890 42 // caution when using leading zeros: 0888 // 888 parsed as decimal 0777 // parsed as octal in non-strict mode (511 in decimal) note that decimal literals can start with a zero (0) followed by another decimal digit, but if every digit after the leading 0 is smaller than 8, the number gets parsed as an octal number.
...these include trigonometric, logarithmic, exponential, and other functions.
...And 4 more matches
Regular expression syntax cheatsheet - JavaScript
\s matches a single white space character, including space, tab, form feed, line feed, and other unicode spaces.
... \s matches a single character other than white space.
...do not follow this with another digit.
...And 4 more matches
Memory Management - JavaScript
allocation in javascript value initialization in order to not bother the programmer with allocations, javascript will automatically allocate memory when values are initially declared.
...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).
...this algorithm reduces the problem from determining whether or not an object is still needed to determining if an object still has any other objects referencing it.
...And 4 more matches
this - JavaScript
a function's this keyword behaves a little differently in javascript compared to other languages.
...the same applies to arrow functions created inside other functions: their this remains that of the enclosing lexical context.
...console.log(fn2()() == window); // true in the above, the function (call it anonymous function a) assigned to obj.bar returns another function (call it anonymous function b) that is created as an arrow function.
...And 4 more matches
JavaScript
this section is dedicated to the javascript language itself, and not the parts that are specific to web pages or other host environments.
...and other countries.
... javascript guide javascript guide a much more detailed guide to the javascript language, aimed at those with previous programming experience either in javascript or another language.
...And 4 more matches
OpenSearch description format
the opensearch description format lets a website describe a search engine for itself, so that a browser or other client application can use that search engine.
...(see reference material for links to other browsers' documentation.) firefox also supports additional features not in the opensearch standard, such as search suggestions and the <searchform> element.
...xmlns:moz="http://www.mozilla.org/2006/browser/search/"> <shortname>[snk]</shortname> <description>[search engine full name and summary]</description> <inputencoding>[utf-8]</inputencoding> <image width="16" height="16" type="image/x-icon">[https://example.com/favicon.ico]</image> <url type="text/html" template="[searchurl]"> <param name="[key name]" value="{searchterms}"/> <!-- other params if you need them… --> <param name="[other key name]" value="[parameter value]"/> </url> <url type="application/x-suggestions+json" template="[suggestionurl]"/> <moz:searchform>[https://example.com/search]</moz:searchform> </opensearchdescription> shortname a short name for the search engine.
...And 4 more matches
Gradients in SVG - SVG: Scalable Vector Graphics
you must give the gradient an id attribute; otherwise it can't be referenced by other elements inside the file.
... the <lineargradient> element also takes several other attributes, which specify the size and appearance of the gradient.
...when it is used, attributes and stops from one gradient can be included on another.
...And 4 more matches
WebAssembly Concepts - WebAssembly
like other web code, it will enforce the browser's same-origin and permissions policies.
... don't break the web — webassembly is designed so that it plays nicely with other web technologies and maintains backwards compatibility.
...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).
...And 4 more matches
Exported WebAssembly functions - WebAssembly
an example let's look at an example to clear things up (you can find this on github as table-set.html; see it running live also, and check out the wasm text representation): var othertable = new webassembly.table({ element: "anyfunc", initial: 2 }); webassembly.instantiatestreaming(fetch('table.wasm')) .then(obj => { var tbl = obj.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 othertable.set(0,tbl.get(0)); othertable.set(1,tbl.get(1)); console.log(othertable.get(0)()); console.log(othertable.get(1)()); }); here we crea...
...te a table (othertable) from javascript using the webassembly.table constructor, then we load table.wasm into our page using the webassembly.instantiatestreaming() method.
...next, we use set() to make the othertable table contain references to the same functions as the tbl table.
...And 4 more matches
Private Properties - Archive of obsolete content
unlike other languages, javascript does not have native support for private properties.
...this article discusses two common techniques: one using prefixes, the other closures.
... using closures another common technique, is to define private properties as variables and their getter and setter functions as a closure over these variables: function point(_x, _y) { this.getx = function () { return _x; }; this.setx = function (x) { _x = x; }; this.gety = function () { return _y; }; this.sety = function (y) { _y = y; }; } note that ...
...And 3 more matches
/loader - Archive of obsolete content
n setup looks like this: let { loader } = require('toolkit/loader'); let loader = loader({ paths: { // resolve all modules starting with `toolkit/` as follows: // toolkit/foo -> resource://gre/modules/commonjs/toolkit/foo.js // toolkit/foo/bar -> resource://gre/modules/commonjs/toolkit/foo/bar.js 'toolkit/': 'resource://gre/modules/commonjs/toolkit/', // resolve all other non-relative module requirements as follows: // devtools/gcli -> resource:///modules/devtools/gcli.js // panel -> resource:///modules/panel.js '': 'resource:///modules/', } }) all relative url require() statements (those that start with ".") are first resolved relative to the requirer module id and the result of it is then resolved using the paths option.
...ropriate mapping for it: let { loader } = require('toolkit/loader'); let loader = loader({ paths: { // resolve all modules starting with `toolkit/` as follows: // toolkit/foo -> resource://gre/modules/commonjs/toolkit/foo.js // toolkit/foo/bar -> resource://gre/modules/commonjs/toolkit/foo/bar.js 'toolkit/': 'resource://gre/modules/commonjs/toolkit/', // resolev all other non-relative module requirements as follows: // devtools/gcli -> resource:///modules/devtools/gcli.js // panel -> resource:///modules/panel.js '': 'resource:///modules/', // allow relative urls and resolve them to add-on root: // ./main -> resource://my-addon/root/main.js './': 'resource://my-addon/root/' } }); the order of keys in paths is ir...
...all other modules will be loaded by this module or its dependencies: let { main, loader } = require('toolkit/loader'); let loader = loader(options); let program = main(loader, './main'); a module can find out whether it was loaded as main: if (require.main === module) main(); it is possible to load other modules before a main one, but it's inherently harder to do.
...And 3 more matches
remote/parent - Archive of obsolete content
usage in multiprocess firefox: the browser ui runs in one process, sometimes called the chrome process or the parent process web content runs in one or more other processes, sometimes called content processes or remote processes or child processes.
...these sdk modules have higher privileges than content scripts, and have their own module loader so they can load other sdk modules.
...multiprocess applications can have other remote processes where untrusted content like webpages are loaded.
...And 3 more matches
ui/frame - Archive of obsolete content
if you know the target uri, you should use it, as this is more secure: it prevents another window from intercepting messages that were intended for someone else.
...var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var frame = new frame({ url: "./city-info.html", onmessage: function(e) { // message only the frame that pinged us e.source.postmessage("pong", e.origin); } }); var toolbar = toolbar({ name: "ping-pong", title: "ping pong", items: [frame] }); this does not have to be the message event: the other events frame can emit: attach, load and ready, also provide access to source and origin.
...n this case you should pass the frame's url property as the targetorigin: frame.postmessage("ping", frame.url); on(event, listener) assign a listener to a frame event: var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.on("message", pong) function pong(e) { if (e.data == "ping") { // message only the sender, and not any frames attached to other browser windows e.source.postmessage("pong", "*"); } } parameters event : string the name of the event to listen to.
...And 3 more matches
Install Manifests - Archive of obsolete content
required property reference your install manifest must specify these properties correctly otherwise your add-on may not install.
...firefox 1.5 has checking to ensure that your id falls into one format or the other and will refuse to install add-ons that have malformed ids.
... 2 extensions 4 themes 8 locale 32 multiple item package 64 spell check dictionary 128 telemetry experiment 256 webextension experiment examples <em:type>2</em:type> this property was added for firefox 1.5, and is only required for add-on types other than extensions and themes.
...And 3 more matches
Adding menus and submenus - Archive of obsolete content
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.
... another example of a menu like this is the view > sidebars menu.
...And 3 more matches
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
a few others require cleanup code to be run after the add-on is uninstalled.
...you should also change the preference value before you run any other first run code.
...if an add-on is uninstalled and later installed again, it might be desirable for preferences and other settings to be kept.
...And 3 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
onclick: function (event) { alert(event.target.href); } }, text], ["span", { class: "stuff" }, "stuff"]]], document, nodes)); alert(nodes.link); function addentrytopopup(menupopup, doc, chromewindow) { var newitem = doc.createelement("menuitem"); newitem.setattribute("value", "testvalue"); newitem.setattribute("label", "another popup menu item"); menupopup.appendchild(newitem); }; var jsontemplatebtn = ["xul:toolbarbutton", { id: "mytestbutton", class: "toolbarbutton-1", type: "menu", label: "test button label", tooltiptext: "test button tooltip", removable: true, key: "mytestbutton123" }, [ "menupopup", ...
... toolbox = doc.getelementbyid("navigator-toolbox"); var palette = toolbox.palette; var domfragment = jsontodom(jsontemplatebtn, document, capturednodes); palette.appendchild(domfragment); alert("capturednodes contains any created nodes that have optionally been captured (for later convenient javascript access) by giving them a 'key' attribute; for example: " + capturednodes.mytestbutton123); another example this here is another example of using jsontodom but in the html scope, a complex form is created with ease.
...in these cases, multiple attributes should be used, one for each variable: function clickify(elem, address) { elem.setattribute("href", address); elem.setattribute("onclick", "openwindow(this.getattribute('href'))"); } escaping functions when the code fragment in question is not an event handler attribute and there is no feasible way to pass the data through other means, they must be escaped with functions such as uneval, string.quote, json.stringify, or number.
...And 3 more matches
Handling Preferences - Archive of obsolete content
this file is never written to by firefox, but you may wish to set preferences manually in this file to override other settings.
... firefox exposes its most common high-level preferences through the preferences window and other parts of its ui.
... in reality there are thousands of other preferences firefox handles that are not readily available to the user.
...And 3 more matches
Mozilla Documentation Roadmap - Archive of obsolete content
it encompasses firefox, other mozilla products, javascript, css, xul, web and extension development guidelines, accessibility, usability, best practices...
...it brings together the feeds of most mozilla employees, as well as several other members of the mozilla community.
...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.
...And 3 more matches
Same-origin policy for file: URIs - Archive of obsolete content
in other words, any html file on your local disk can read any other file on your local disk.
... starting in gecko 1.9, files are allowed to read only certain other files.
... specifically, a file can read another file only if the parent directory of the originating file is an ancestor directory of the target file.
...And 3 more matches
Making it into a static overlay - Archive of obsolete content
now that we have a working mozilla extension that shows tinderbox status, we need to make it distributable to other users.
...a xul overlay is a xul file containing elements to be inserted into another xul file when the other xul file is rendered into an application interface.
...overlays provide a way to break up a large xul file into several different files (one that describes the overall structure of an application window and the others to implement specific portions of the window) to improve code readability, maintainability, and extensability.
...And 3 more matches
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
dramatis personae this document focuses on the interaction of three classes with each other, but other mozilla components are also involved.
...some facilities are provided for starting loads, canceling loads, and other such micromanagement.
...otherwise, dispatchcontent goes through a three-step process to try to find the correct listener.
...And 3 more matches
Using microformats - Archive of obsolete content
tag used to add tags to other microformats.
... showhidden if true, hidden microformats are added; otherwise they're left out.
... debug specify true if debug mode is in use; otherwise, specify false.
...And 3 more matches
Creating a Help Content Pack - Archive of obsolete content
this is still very much a work in progress, tho, and i need to complete the rest of it soon (where "complete" means "use what's there that's good, build on the stuff that's not as good, and add other useful information as necessary".
...the data source specified by toc will always be displayed, while the other data sources may only be available by searching through the loaded content pack.
...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 searc...
...And 3 more matches
How to Write and Land Nanojit Patches - Archive of obsolete content
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 it's major you'll need to do a private update of that other repo in order to test.
...And 3 more matches
Space Manager High Level Design - Archive of obsolete content
when elements are floated to the left or right in a layout, they take up space and influence where other elements can be placed.
...this information is used by block layout to correctly compute where other floated elements should be placed, and how much space is available to normal in-flow elements that flow around the floated bits.
... the space manager works in concert with several other classes to do its job.
...And 3 more matches
Multiple Queries - Archive of obsolete content
however, you will probably notice that the one photo that matches the first query has appeared differently that the others.
... in fact, the content for this photo is that of the first query with the button, whereas the content for the other photos are that of the second query with the normal images.
...it doesn't matter whether other variables are the same or not.
...And 3 more matches
Static Content - Archive of obsolete content
one interesting thing about this example is that only one menupopup will be created, even though there are two in the code, one outside the template and another one inside the action body.
...instead of creating another menupopup, the builder uses the existing one.
...if you were to change the static content to be some other element besides a menupopup, it won't match, so the builder will create a new one when handling the action.
...And 3 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
the following values are possible, although custom components may be installed which add others.
...if the user types another character, the timer resets.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...And 3 more matches
The Joy of XUL - Archive of obsolete content
easy customization, localization, or branding another highly practical benefit of the separation that xul provides among application logic, presentation, and language text is the ease of customizing for different customers or groups of users.
...while such changes are extensive and affect most (if not all) of the application, they are also isolated from one another, enabling the core xul definition and application logic to be shared among all of the custom versions.
... supporting technologies there are number of other technologies introduced by mozilla that complement xul for building cross platform web applications.
...And 3 more matches
Box Objects - Archive of obsolete content
some of these subtypes, such as the stack or listbox are needed for more complex layouts than the basic box, while others such as the button are used only to add extra mouse and key event handling.
... the layout object associated with an element can be removed and a completely different type of object created just by changing the css display property, among others.
...the others have functions which are more easily accessible by methods mapped directly onto the element, since those types are generally only used with one particular element.
...And 3 more matches
Broadcasters and Observers - Archive of obsolete content
the technique also works for other attributes as well.
...we saw something like this in a previous section where the disabled attribute was adjusted once and propagated to other elements.
...you should always use an id attribute so that it can be referred to by other elements.
...And 3 more matches
Grids - Archive of obsolete content
ArchiveMozillaXULTutorialGrids
if you wanted one particular cell to contain multiple elements, you can use a nested hbox or other box element.
...you could add additional nested boxes or even another grid inside a single cell.
... if you resize the window of the last example, you will see that the textboxes resize, but no other elements do.
...And 3 more matches
RDF Datasources - Archive of obsolete content
other mozilla datasources mozilla provides a number of other built-in datasources.
...late> <rule> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://home.netscape.com/nc-rdf#name"/> <treecell label="rdf:http://home.netscape.com/nc-rdf#url"/> <treecell label="rdf:http://home.netscape.com/nc-rdf#date"/> </treerow> </treeitem> </treechildren> </rule> </template> </tree> other datasources the tables below list some of the other datasources available with mozilla.
...instead, only the files and directories that the tree element (or other elements) will need to display at a given time will be determined.
...And 3 more matches
The Box Model - Archive of obsolete content
added elements will be placed underneath each other in a column.
...login prompt example you can add as many elements as you want inside a box, including other boxes.
...aligning textboxes if you look closely at the image of the login dialog, you can see that the two textboxes are not aligned with each other horizontally.
...And 3 more matches
Using Remote XUL - Archive of obsolete content
this isn't a problem inside an organization that uses mozilla-based browsers exclusively, but for other sites you may need to provide another form of navigation as well.
...the window element is the root (outermost) element in a xul document and encompasses all other elements.
... [optionally show what this looks like] the value of the flex attribute determines the extent to which the element will stretch relative to other flexible elements.
...And 3 more matches
XUL accessibility tool - Archive of obsolete content
(aaronandy) enable tabs, context menu, and other browser extras in report window.
... possible false positives in some of the other tests processing is slower than we would like.
... add usability, i18n, security and other considerations to xul a11y guidelines -- make them more general sprinkle the a11y techniques throughout the turorial and reference.
...And 3 more matches
XML - Archive of obsolete content
xml is a language for creating other languages.
...an actual memo using the memoml to represent itself might look like this: <memo> <from>ian oeschger</from> <to>steve rudman</to> <body>i think the first draft of the guide is done!</body> </memo> note how the memo element -- the root element in our brief definition, ordeclaration, above -- surrounds the other three elements.
...xul is little beyond the set of tags used to define interface widgets, the relationship between them, or grammar, and some built-in flexibility for using extra resources like images, html elements, and other standards-based technologies.
...And 3 more matches
button - Archive of obsolete content
event handlers can be used to trap mouse, keyboard and other events.
... normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right or top to bottom in the order they appear in the xul code.
...for other elements, they are placed right to left or bottom to top.
...And 3 more matches
richlistbox - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...pnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata additemtoselection( item ) return type: no return value selects the given item, without deselecting any other items that are already selected.
... removeitemfromselection( item ) return type: no return value deselects the specified item without deselecting other items.
...And 3 more matches
tree - Archive of obsolete content
ArchiveMozillaXULtree
unlike other elements, the data to display inside the tree is not specified using tags, but is determined from a view object.
...if the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows.
...otherwise, the entire row will be highlighted.
...And 3 more matches
nsIContentPolicy - Archive of obsolete content
t, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra, in nsiprincipal arequestprincipal); constants content types constant value description type_other 1 indicates content whose type is unknown, or is not interesting outside a limited use case.
... in general, you should try not to use this type unless none of the others is a fit.
... type_subdocument 7 indicates a document contained within another document (for example, <iframe> and <frame> elements).
...And 3 more matches
Gecko Compatibility Handbook - Archive of obsolete content
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.
... 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.
... symptom possible problem solution site works correctly in netscape 6.x but not netscape 7.x or other browsers based upon gecko.
...And 3 more matches
NPClass - Archive of obsolete content
called by npn_createobject() if non-null, otherwise the browser calls malloc().
...returns true if the method exists, otherwise returns false.
...returns true if the specified property exists, otherwise returns false.
...And 3 more matches
Building a Theme - Archive of obsolete content
other tutorials exist for building themes for earlier versions of firefox.
...inside your new theme folder, create two new empty text files, one called chrome.manifest and the other called install.rdf.
...it contains several folders, modules, jssubloader and others.
...And 3 more matches
Index - Game development
the concern is mostly with switching to another option.
...as with any other 3d library it provides built-in functions to help you implement common 3d functionality more quickly.
...fragment shaders compute the renderings of a shape's colors and other attributes.
...And 3 more matches
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.
...we are not trying to say it is better than any other webgl library available, and you should feel free to try another library, such as copperlicht, glge, or playcanvas.
...there are a few different renderers: webgl is the default, and others you can use are canvas, svg, css, and dom.
...And 3 more matches
Efficient animation for web games - Game development
though some browsers make some effort for other properties to be animated quickly, these are pretty much the only ones semi-guaranteed to be fast across all browsers.
... something to be careful of is that overflow may end up causing re-layout, or other expensive calculations.
... remember that when you do drawing with requestanimationframe (and in general), you may be blocking the browser from updating other things.
...And 3 more matches
Debugging CSS - Learn web development
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.
...perhaps you want to see if another color looks better, or wish to tweak the size of something?
... note: there are other useful features in the rules view too, for example declarations with invalid values are crossed out.
...And 3 more matches
Getting started with CSS - Learn web development
however, you will often want something other than the choice the browser has made.
...most of the time that isn't the case and so you will need to find a way to select a subset of the elements without changing the others.
...if you were to do this then you would no longer be able to apply the class to a <span> or another element by simply adding the class to it; you would have to add that element to the list of selectors: li.special, span.special { color: orange; font-weight: bold; } as you can imagine, some classes might be applied to many elements and you don't want to have to keep editing your css every time something new needs to take on that style.
...And 3 more matches
How can we design for all types of users? - Learn web development
this unit is relative to the root element's size and not to any other parent.
...this works as of internet explorer 9 and in every other current browser, so please feel free to use this unit.
...it will end up setting its own font size, so don't bother feeding it font units.
...And 3 more matches
How do you upload your files to a web server? - Learn web development
note: of course there are lots of other options.
... fill in the correct port and other information.
...this directory is effectively the root of your website — where your index.html file and other assets will go.
...And 3 more matches
What are hyperlinks? - Learn web development
before the web, it was quite hard to access documents and move from one to another.
... deeper dive as we said, a link is a text string tied to a url, and we use links to allow easy jumping from one document to another.
...we'll talk about designing website navigation in another article, but as a rule, whenever you add a new webpage, make sure at least one of your other pages links to that new page.
...And 3 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.
...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).
...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.
...And 3 more matches
JavaScript basics - Learn web development
third-party apis that allow developers to incorporate functionality in sites from other content providers, such as twitter or facebook.
...you can learn more in mdn's javascript learning area, as well as in other parts of mdn.
...if you master these fundamentals, you have a head start on coding in other languages too!
...And 3 more matches
HTML Cheatsheet - Learn web development
by default, "inline elements" appear next to one another in a webpage.
...f="https://realityripple.com/">a link to realityripple</a> a link to realityripple a simple image <img src="https://udn.realityripple.com/samples/6e/d6ed76c6c7.png" width="25" /> a generic inline container <p>p its used to <span style="color:blue">style and group</span> particular elements </p> p its used to style and group particular elements another inline container <p>span its used to differentiate a part <span style="color:blue">of the content</span> that we will work on differently </p> span its used to differentiate a part of the content that we will work on differently emphasize some text <em>i'm posh</em> i'm posh italic textt you can mark a phrase in the text in <i>italics</i> you can mark...
... block elements "block elements," on the other hand, take up the entire width of a webpage.
...And 3 more matches
Making asynchronous programming easier with async and await - Learn web development
in the meantime, other code that may be waiting for a chance to execute gets to do so.
...the await keyword causes the javascript runtime to pause your code on this line, allowing other code to execute in the meantime, until the async function call has returned its result.
...it does allow other tasks to continue to run in the meantime, but your own code is blocked.
...And 3 more matches
General asynchronous programming concepts - Learn web development
you should understand these concepts before working through the other articles in the module.
...if a function relies on the result of another function, it has to wait for the other function to finish and return, and until that happens, the entire program is essentially stopped from the perspective of the user.
...there's no sense sitting there waiting for something when you could let the other task chug along on another processor core and let you know when it's done.
...And 3 more matches
Introducing asynchronous JavaScript - Learn web development
let's look at a simple example (see it live here, and see the source): const btn = document.queryselector('button'); btn.addeventlistener('click', () => { alert('you clicked me!'); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); in this block, the lines are executed one after the other: we grab a reference to a <button> element that is already available in the dom.
... when we pass a callback function as an argument to another function, we are only passing the function's reference as an argument, i.e, the callback function is not executed immediately.
...let's look at another example that loads a resource via the xmlhttprequest api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } loadasset('coffee.jpg', ...
...And 3 more matches
Arrays - Learn web development
array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value.
...paste the following code into the console: let shopping = ['bread', 'milk', 'cheese', 'hummus', 'noodles']; shopping; in the above example, each element is a string, but in an array we can store various data types — strings, numbers, objects, and even other arrays.
... we can also mix data types in a single array — we do not have to limit ourselves to storing only numbers in one array, and in another only strings.
...And 3 more matches
Handling text — strings in JavaScript - Learn web development
the following will return an error: let badquotes = 'what on earth?"; the browser will think the string has not been closed because the other type of quote you are not using to contain your strings can appear in the string.
...you can escape other characters in the same way, e.g.
...we then use a window.alert() function in line 5 to display another popup containing a string we've assembled from two string literals and the name variable, via concatenation.
...And 3 more matches
Useful string methods - Learn web development
previous overview: first steps next now that we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
... this can be done in another way, which is possibly even more effective.
...there are other options too; study the slice() page to see what else you can find out.
...And 3 more matches
Solve common problems in your JavaScript code - Learn web development
to see which one is bigger, or to see if one value is equal to another).
... how do you replace one specific substring with another?
... how do you use breakpoints and other javascript debugging features?
...And 3 more matches
Working with JSON - Learn web development
you can include the same basic data types inside json as you can in a standard javascript object — strings, numbers, arrays, booleans, and other object literals.
... other notes json is purely a data format — it contains only properties, no methods.
...add the following line: request.open('get', requesturl); this takes at least two parameters — there are other optional parameters available.
...And 3 more matches
Ember interactivity: Events, classes and state - Learn web development
one component's this will be different from another component's this.
...this is a vanilla javascript class and has no special meaning to ember, other than extending from the component super-class.
... note: a decorator is basically a wrapper function, which wraps and calls other functions or properties, providing additional functionality along the way.
...And 3 more matches
TypeScript support in Svelte - Learn web development
this extension offers type checking, inspecting, refactoring, intellisense, hover-information, auto-completion, and other features.
... this kind of developer assistance is another good reason to start using typescript in your projects.
...if you are running this in your regular terminal, you are advised to keep it running in the background in a separate terminal window of its own so that it can keep reporting errors but won't interfere with other terminal usage.
...And 3 more matches
Understanding client-side JavaScript frameworks - Learn web development
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.
...ember resources and troubleshooting our final ember article provides you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other information.
...along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props and saving data state.
...And 3 more matches
Mozilla's Section 508 Compliance
the united states federal rehabilitation act's section 508 is a new standard for defining accessibility requirements for software and other electronic and information technology.
... caveats: 1) although sidebar cannot be customized without a mouse, all sidebar functions that come with the browser are available through other means 2) java and in-page plugins cannot be used with the keyboard, so they must not be installed for keyboard-only users additional features for the keyboard: 1) find as you type allows for quick navigation to links and convenient text searching 2) browse with caret (f7 key toggles) allows users to select arbitrary content with the keyboard and move through content as if ins...
... (b) applications shall not disrupt or disable activated features of other products that are identified as accessibility features, where those features are developed and documented according to industry standards.
...And 3 more matches
Mozilla’s UAAG evaluation report
zooming can be controlled via hotkeys ctrl+plus and ctrl+minus the prefs are at preferences, appearances, fonts there is also a hidden pref line that can be added to prefs.js, if you just want to change the minimum font size for a certain font: user_pref("font.minimum-size.x-western", newfontsizeinpoints); for other i18n charsets, change x-western to x-central-euro, x-cyrillic, x-unicode, x-user-def, x-baltic, el, tr, he, ar, th, ja, zh-cn or zh-tw 4.2 configure font family.
...(p1) na 4.7 slow other multimedia.
... (p2) na this is similar to checkpoint 4.4, except that includes animation through style cannot control animation rate of animated images 4.8 control other multimedia.
...And 3 more matches
Accessible Toolkit Checklist
make sure that parent-child relationships are exposed correctly in each window's msaa tree general msaa support focus events handling event callbacks, which requires a unique id for each non-windowed child of every widget that can be focused or have any other event associated with it.
... the high contrast theme can be toggled dynamically with leftalt+leftshift+printscreen expose the spi_getscreenreader flag to xml/scripts so that apps can alter behavior use system highlight color where possible for item selection, but never use that exact color in more than 1 place at a time, otherwise screen reader will read everything with that color whenever highlight changes pay attention to spi_getcaretwidth for the correct width of the caret pay attention to 'route mouse pointer to default button' setting it's possible that the user wants mnemonics hidden except when the alt key is pressed.
... msaa support, including the haspopup state default buttons ability to define in xml enter key fires it, but not when another widget has focus that needs the enter key layout engine - drawing dark border dynamically when the currently focused widget does not need the enter key events - making keystrokes do the right thing msaa support (default state) links enter key activates link (thus default button no longer shows dark border when link is focused) msaa support, including l...
...And 3 more matches
Debugging on Windows
enable it by going its configuration menu in "debug > other debugging targets > child process debugging settings", and ticking the box.
... here are some wildcards you can use (tested with vc 8): nscomptr.*\:\:.*=nostepinto (nsg|g)etter_*addrefs.*=nostepinto ns_convertutf.* ; might be too broad: (ns|promise)[^\:]*[ss]tring.* ...add common functions to this list should probably make a .reg file for easy importing obtaining stdout and other file handles running the following command in the command window in visual studio returns the value of stdout, which can be used with various debugging methods (such as nsgenericelement::list) that take a file* param: debug.evaluatestatement {,,msvcr80d}(&__iob_func()[1]) (alternatively you can evaluate {,,msvcr80d}(&__iob_func()[1]) in the quickwatch window) similarly, you can open a file o...
...one requires setting an environment variable, while the other affects only the currently running program instance in memory.
...And 3 more matches
How Mozilla's build system works
however, mozilla's config.status is different from many other config.status files, as it's written in python!
...in reality, the main moz.build files include other moz.build files, such as /toolkit/toolkit.mozbuild, which define the tiers.
... tools is used to install tests and other support tools.
...And 3 more matches
Interface Compatibility
web content apis which are visible to web content are not modified, except as a last resort when inherent security vulnerabilities or incompatibility with other browsers make it the only option.
... in micro/maintenance releases, there should be no incompatible changes to interfaces, except as a last resort when a security fix leaves no other option.
... this includes not only xpcom interfaces, but javascript functions, xbl bindings, and any other visible behavior.
...And 3 more matches
PBackground
pbackground is a mechanism available since gecko 30 (see bug 956218) that builds on top of ipdl to provide a solution to common problems that arise when handling multiple threads in the chrome process, for example communication between workers and multiple child processes and other parent-process worker threads.
...ipdl protocols are used to specify how the chrome and content processes talk to each other and verify that a content process is "following the rules".
...these actors can live in different processes due to ipdl, which automatically serializes calls on one side and transmits them to the other.
...And 3 more matches
JavaScript OS.Constants
debug set to true on debug build configurations, non-existent otherwise.
...useful mostly for using js-ctypes to interact with the following platforms: macos x; android; linux; other variants of unix.
... s_irwxo all other users can read, write, execute the file.
...And 3 more matches
Promise
this is the only state that may transition to one of the other two states.
...for example, the os.file.exists function returns a promise that will eventually fulfill with a boolean: promise<boolean> exists(string path); the rejection reason may be specified separately in the function's documentation, and is considered to be an error object unless otherwise specified.
...if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing.
...And 3 more matches
PromiseWorker.jsm
the first is with atransferlist argument and other with basepromiseworker.meta.
...the above example can be rewritten like this: myworker.post('func', [new basepromiseworker.meta(buffer, {transfers: [buffer]})]); this is convenient if the function's arguments are generated by some other functions or passed from somewhere else.
... sending a message from worker with all other workers, to send a message to the main thread, postmessage is typically used.
...And 3 more matches
Localization and Plurals
in this case, there are 2 forms, but other languages can have 1 or many more.
... 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 (;).
... french some french speaking places treat 0 as plural while others treat it as singular.
...And 3 more matches
Localizing with Koala
for example: c:\users\stas> cd c:\mozilla\l10n\locale\x-testing c:\mozilla\l10n\locale\x-testing> rmdir 3.6 c:\mozilla\l10n\locale\x-testing> hg clone http://bitbucket.org/mozillal10n/x-testing 3.6 otherwise, it's a good idea to create your local repository in order to be able to track changes you make to the localization files.
...on the other hand, "manage search engines..." is generated only once, on start-up, and doesn't need to change.
... once you translated the searchendcap.label entity, add the other one from this file, i.e.
...And 3 more matches
gettext
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.
...consider another example, gaeilge (irish): plural-forms: nplurals=3; plural=n==1 ?
...*/ ___('a string with context.', 'unique context string'); $num = 1; // l10n: this is another block comment that will be extracted by xgettext.
...And 3 more matches
Basics
this tri-state mode is aimed at limiting conflicts with other agents that compete for the mouse.
... f ( 4 ) ( η ) , a ≤ η ≤ b | x | = { - x if x < 0 x otherwise you can also typeset 2d mathematical constructs such as matrices.
..., ain , x1 are on the same baseline, other alignments are possible): i-th row [ a11 a12 a13 ...
...And 3 more matches
Fonts for Mozilla's MathML engine
note that most of these instructions may as well apply to other web rendering engines.
...if desired, you may also do the same for the other font files.
...if desired, you may also do the same for the other font files.
...And 3 more matches
Mozilla Web Services Security Model
please do not depend on anything in it being correct for security.) to prevent the browser from being used as a tool for web sites to obtain priveleges that belong to the browser's user (such as being behind a firewall or getting the benefits of the user's cookies), web browsers restrict what web pages can do when accessing things in other domains.
... however, web services can be designed to be accessed from other domains, or even from any domain.
... mozilla allows sites hosting such web services to tell mozilla that other sites can access the service.
...And 3 more matches
Mozilla Development Strategies
when you land your bug-free code, it's qa's job to assure others that it's really bug free.
...for your other tree, don't update as often.
...in your other trees, work on smaller, easier bugs.
...And 3 more matches
DMD
this can be used to investigate leaks by figuring out which objects might be holding references to other objects.
...name the file dmd_fennec and enter this as the contents: #!/system/bin/sh export moz_replace_malloc_lib=/sdcard/libdmd.so exec "$@" if you want to use other dmd options, you can enter additional environment variables above.
...if you are using a dmd-enabled try build, or build from other source, adjust the app identifier as necessary.
...And 3 more matches
Gecko Profiler FAQ
another approach to get more precision is also raising the sampling frequency to sub-millisecond ranges (it won’t work on windows.) high frequency sampling may also be an area where native profilers are a useful alternative tool to try.
...we have not attempted to register other threads with the profiler.
...i want to profile all threads, not just main plus a couple of others) we haven’t done any measurements of how frequent sampling distorts measurement or operation.
...And 3 more matches
Leak-hunting strategies and tips
strategy for finding leaks when trying to make a particular testcase not leak, i recommend focusing first on the largest object graphs (since these entrain many smaller objects), then on smaller reference-counted object graphs, and then on any remaining individual objects or small object graphs that don't entrain other objects.
...then go on to selecting a folder, then selecting a message, and then other activities one does while reading mail.
... tool finds platforms requires leak tools for large object graphs leak gauge windows, documents, and docshells only all platforms any build gc and cc logs js objects, dom objects, many other kinds of objects all platforms any build leak tools for medium-size object graphs bloatview, refcount tracing and balancing objects that implement nsisupports or use moz_count_{ctor,dtor} all tier 1 platforms debug build (or build opt with --enable-logrefcnt) leaksoup (part of tracemalloc) all objects?
...And 3 more matches
A brief guide to Mozilla preferences
a preference is any value or defined behavior that can be set (presumably, one setting is preferable to another).
...they are: default preference files firefox ships default preferences in several files, all in the application directory: greprefs.js - preferences shared by all applications using the mozilla platform services/common/services-common.js - preferences for some shared services code, this should arguably be included in some other file defaults/pref/services-sync.js - default preferences for firefox sync, also oddly misplaced browser/app/profile/channel-prefs.js - a file indicating the user's update channel.
... this is kept separate from other preferences because it can affect how updates are applied.
...And 3 more matches
AsyncTestUtils extended framework
see mailnews automated testing for a description of the other testing mechanisms.
...the default is that every message is its own thread; no message is a reply to any other message.
... set manipulation union(aotherset) take the union of this set and the provided other set and return the (new, not modified) result.
...And 3 more matches
NSS Sample Code Sample1
as an alternative to token symmetric keys as a way to store large numbers of symmetric keys wrapping symmetric keys using an rsa key from another server unwrapping keys using your own rsa key pair the main part of the program shows a typical sequence of events for two servers that are trying to extablish a shared key pair.
... the other hosts (secondary) request keys from the // primary host.
... int generatekeys(); // gets the server's public key (wrapping key) to // send to another server.
...And 3 more matches
NSS tools : signtool
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 if you have a signing certificate, you can use netscape signing tool to digitally sign files and package them as a jar file.
...you can, for example, move an object-signing certificate and its associated private key from one computer to another on a credit-card-sized device called a smart card.
... the unix version of signtool assumes ~/.netscape unless told otherwise.
...And 3 more matches
Rhino overview
for other versions, a warning will be generated.
...if other properties files with extensions corresponding to the current locale exist, they will be used instead.
...otherwise the ecma conformant version is used (an array is constructed with no elements but with length property equal to i).
...And 3 more matches
SpiderMonkey Internals
it runs automatically only when maxbytes (as passed to js_newruntime) bytes of gc things have been allocated and another thing-allocation request is made.
...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.
...(otherwise, spidermonkey converts primitive values to objects before invoking their methods, per ecma 262-3 §11.2.1.) error handling spidermonkey has two interdependent error-handling systems: javascript exceptions (which are not implemented with, or even compatible with, any kind of native c/c++ exception handling) and error reporting.
...And 3 more matches
Introduction to the JavaScript shell
for a list of other javascript shells, see javascript shells.
...otherwise, the new object is placed in the scope of the object specified by scope.
...anything other than 0 will make javascript run extremely slow but may help reveal or reproduce gc-related bugs.
...And 3 more matches
JS_ShutDown
syntax void js_shutdown(void); description destroys all free-standing resources allocated by spidermonkey, not associated with any jsruntime, jscontext, or other structure.
... this method should be called after all other jsapi data has been properly cleaned up: every jsruntime created with js_newruntime must have been destroyed with js_destroyruntime, every jscontext created with js_newcontext must have been destroyed with js_destroycontext, and so on.
... calling this method before all other resources have been destroyed has undefined behavior.
...And 3 more matches
JSAPI reference
note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and the jsapi.
...pi 31 js_addroot obsolete since javascript 1.8.5 js_addnamedroot obsolete since javascript 1.8.5 js_addnamedrootrt obsolete since javascript 1.8.5 js_removeroot obsolete since javascript 1.8.5 js_removerootrt obsolete since javascript 1.8.5 js_mapgcroots obsolete since jsapi 19 jsgcmaprootfun obsolete since jsapi 19 js_dumpnamedroots obsolete since jsapi 19 local root scopes were another way of protecting objects from the garbage collector.
... they have been removed in js 1.8.5, though js_enterlocalrootscope obsolete since javascript 1.8.5 js_leavelocalrootscope obsolete since javascript 1.8.5 js_leavelocalrootscopewithresult obsolete since javascript 1.8.5 js_forgetlocalroot obsolete since javascript 1.8.5 added in spidermonkey 1.8 if an object contains references to other gc things that are not stored in spidermonkey data structures ("slots"), it must implement the jstraceop hook to enable the garbage collector to traverse those references.
...And 3 more matches
SpiderMonkey 1.8.8
on some other platforms (sparc, mips), the jit is provided but not supported.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... these and other changes are explained in detail below.
...And 3 more matches
SpiderMonkey 17
on some other platforms (sparc, mips), the jit is provided but not supported.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... these and other changes are explained in detail below.
...And 3 more matches
SpiderMonkey 31
it continues to improve performance over previous spidermonkey releases, with a significantly improved garbage collector and other features.
...on some other platforms (sparc, mips), the jit is provided but not supported.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
...And 3 more matches
Split object
each half of a split object always has a pointer to the other half.
...programs other than mozilla that embed spidermonkey should avoid using split objects.
...suppose a script in page a, in tab ta, has a reference to the window object of page b in another tab tb.
...And 3 more matches
Animated PNG graphics
MozillaTechAPNG
otherwise, the default image is not part of the animation.
... other ancillary chunks are allowed to appear among the apng chunks, including between 'fdat' chunks.
... added information for png interaction with other chunks in section 3.2.
...And 3 more matches
Finishing the Component
however, some point in the future, the nsifoo interface requires a major change, and methods are reordered, some are added, others are removed.
... moreover, since this interface was never supposed to be used by clients other than gecko or mozilla, the maintainers of the interface don't know that it's being used, and don't change the iid of the interface.
...ooks as follows: class weblock: public nsiobserver, public iweblock, public nsicontentpolicy { public: weblock(); virtual ~weblock(); ns_decl_isupports ns_decl_nsiobserver ns_decl_iweblock ns_decl_nsicontentpolicy private: urlnode* mrooturlnode; prbool mlocked; }; remember to change the nsisupports implementation macro to include nsicontentpolicy so that other parts of gecko will know weblock supports the nsicontentpolicy interface without modifying this macro.
...And 3 more matches
mozIStorageConnection
otherwise returns false.
... exceptions thrown ns_error_unexpected thrown if the method was called on a thread other than the one that opened the connection.
... exceptions thrown ns_error_unexpected thrown if any statement has been executed asynchronously on the connection, or if the method was called on a thread other than the one that opened the connection.
...And 3 more matches
nsIClipboardCommands
return value true if an image is selected, false otherwise.
...return value true if an image is selected, false otherwise.
...return value true if a link is selected, false otherwise.
...And 3 more matches
nsIMsgHeaderParser
aline, [array, size_is(count)] out wstring aemailaddresses, [array, size_is(count)] out wstring anames, [array, size_is(count)] out wstring afullnames, [retval] out unsigned long count); void reformatheaderaddresses(in string line, out string reformattedaddress); wstring reformatunquotedaddresses(in wstring line); void removeduplicateaddresses(in string addrs, in string other_addrs, in prbool removealiasestome, out string newaddress); string unquotephraseoraddr(in string line, in boolean preserveintegrity); wstring unquotephraseoraddrwstring(in wstring line, in boolean preserveintegrity); methods extractheaderaddressmailboxes() given a string which contains a list of header addresses, returns a comma-separated list of just the 'mailbox' port...
...addresses are removed if they are already in either addrs or other_addrs.
... (if other_addrs contain addresses which are not in addrs, they are not added.
...And 3 more matches
nsIXULTemplateQueryProcessor
the template builder creates the query processor, and there is no other means to retrieve it.
...the template builder creates the query processor, and there is no other means to retrieve it.
...the template builder must call initializeforbuilding() before the other methods, except for translateref().
...And 3 more matches
nsIZipReader
set this parameter to null (javascript) or emptycstring() (c++) to get all entries; otherwise, use the following syntax: * matches anything.
...this may be used to perform filtering upon the results of one pattern to remove all matches which also match another pattern.
...escaping is required for all special characters unless otherwise specified.
...And 3 more matches
Using the clipboard
for other types of data, such as urls or images, you will need to use a more complex method.
...another reason is that the transferable can hold multiple representations of the same data.
...this allows the clipboard to be used by another application right away.
...And 3 more matches
XPCOM
the majority of xpcom components are not part of this core set and are provided by other parts of the platform (e.g.
... 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.
...yclical-ownership leak, this page is for you.introduction to xpcom for the domwarning: this document has not yet been reviewed by the dom gurus, it might contain some errors.language bindingsan xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.monitoring http activitygecko includes the nsihttpactivityobserver interface, which you can implement in your code to monitor http transactions in real time, receiving a callback as the transactions take place.nscomptr versus refptrgecko code uses both nscomptr and refptr as smart pointers.
...And 3 more matches
Index
these pages document thunderbird and the mailnews backend which is also used in other projects such as seamonkey and postbox.
... 4 account interfaces code snippets, extension development, thunderbird this page contains a list of the interfaces that you'll will most likely use when writing extensions that work with email or other accounts.
...others are internal to gecko or other parts of mozilla application code.
...And 3 more matches
Working with windows in chrome code
=== example: opening a window only if it's not opened already === xxx tbd passing data between windows when working with multiple windows, you often need to pass information from one window to another.
... advanced data sharing the above code is useful when you need to pass data from one window to another or to a set of windows, but sometimes you just want to share a javascript variable in common between different windows.
... using javascript code modules javascript code modules is a simple method for creating shared global singleton objects that can be imported into any other javascript scope.
...And 3 more matches
Debugger.Environment - Firefox Developer Tools
this allows the code using each debugger instance to place whatever properties it likes on its own debugger.object instances, without worrying about interfering with other debuggers.) if a debugger.environment instance’s referent is not a debuggee environment, then attempting to access its properties (other than inspectable) or call any its methods throws an instance of error.
...false otherwise.
... all other properties and methods of debugger.environment instances throw if applied to a non-inspectable environment.
...And 3 more matches
Debugger.Frame - Firefox Developer Tools
this allows the code using each debugger instance to place whatever properties it likes on its debugger.frame instances, without worrying about interfering with other debuggers.) when the debuggee pops a stack frame (say, because a function call has returned or an exception has been thrown from it), the debugger.frame instance referring to that frame becomes inactive: its live property becomes false, and accessing its other properties or calling its methods throws an exception.
... live true if the frame this debugger.frame instance refers to is still on the stack; false if it has completed execution or been popped in some other way.
... generator true if this frame is a generator frame, false otherwise.
...And 3 more matches
Debugger.Memory - Firefox Developer Tools
reading the accessor produces true if the debugger is capturing stacks for object allocations, and false otherwise.
...returns false otherwise.
...any value assigned to a debugging handler must be either a function or undefined; otherwise a typeerror is thrown.
...And 3 more matches
Debugger.Source - Firefox Developer Tools
sourcemapurl if the instance refers to javascript source, if this source was produced by a minimizer or translated from some other language, and we know the url of a source map document relating the source positions in this source to the corresponding source positions in the original source, then this property’s value is that url.
... otherwise, this is null.
...otherwise, this is null.
...And 3 more matches
Debugger.Object - Firefox Developer Tools
this allows the code using each debugger instance to place whatever properties it likes on its own debugger.object instances, without worrying about interfering with other debuggers.
... callable true if the referent is a callable object (such as a function or a function proxy); false otherwise.
...the host annotation object's other properties provide further details, as appropriate for the type.
...And 3 more matches
DevTools API - Firefox Developer Tools
a target is usually a web page (a tab), but can be other things (a chrome window, a remote tab,…).
... return value: a tooldefinition if a tool with the given id exists and is enabled, null otherwise.
... return value: a themedefinition object if the theme exists, null otherwise.
...And 3 more matches
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
in other words, if the animation isn't in its active interval, the affected element is not visible.
...otherwise, the result is "both".
...below that, another <div> serves as a button that will trigger the animation to begin.
...And 3 more matches
Recommended Drag Types - Web APIs
it is recommended to always add data of the text/plain type as a fallback for applications or drop targets that do not support other types, unless there is no logical text alternative.
...you can use comments to indicate the purpose of a url, the title associated with a url, or other data.
...to do this, use the text/uri-list type as with other urls.
...And 3 more matches
Capabilities, constraints, and settings - Web APIs
this object contains zero or more individual constraints, as well as an optional sub-object named advanced, which contains another set of zero or more constraints which the user agent must satisfy if at all possible.
...if you provide an ideal value, the browser will try to get as close as possible to matching that value, given the other constraints specified.
...if you need to know the true format and other properties of the media, you can obtain those settings by calling mediastreamtrack.getsettings().
...And 3 more matches
Pointer Lock API - Web APIs
the buttons are then freed up for other actions.
... other examples include apps for viewing maps or satellite imagery.
...game players can now click buttons and swipe the mouse cursor back and forth without worrying about leaving the game play area and accidentally clicking another application that would take mouse focus away from the game.
...And 3 more matches
USBDevice - Web APIs
WebAPIUSBDevice
the other two properties are usbdevice.devicesubclass and usbdevice.deviceprotocol.
...the other two properties are usbdevice.deviceclass and usbdevice.devicesubclass.
...the other two properties are usbdevice.deviceclass and usbdevice.deviceprotocol.
...And 3 more matches
Using bounded reference spaces - Web APIs
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.
...this is the only type of bounded reference space currently available; in all others, if you need boundaries, you will have to manage them yourself.
... because bounded-floor is a floor-bound reference space, the user starts out on the floor of the space, which is sensible given the real-world implications otherwise.
...And 3 more matches
Web Audio API - Web APIs
outputs of these nodes could be linked to inputs of others, which mix or modify these streams of sound samples into different streams.
... we also have other tutorials and comprehensive reference material available that covers all features of the api.
... if you are more familiar with the musical side of things, are familiar with music theory concepts, want to start building instruments, then you can go ahead and start building things with the advance tutorial and others as a guide (the above linked tutorial covers scheduling notes, creating bespoke oscillators and envelopes, as well as an lfo among other things.) if you aren't familiar with the programming basics, you might want to consult some beginner's javascript tutorials first and then come back here — see our beginner's javascript learning module for a great place to begin.
...And 3 more matches
Web Authentication API - Web APIs
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).
...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.
...this is a new concept in authentication: when authenticating using passwords, the password is stored in a user's brain and no other device is needed; when authenticating using web authentication, the password is replaced with a key pair that is stored in an authenticator.
...And 3 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
function () { vcallback.apply(null, aargs); } : vcallback, ndelay); }; window.setinterval.ispolyfill = true; } another possibility is to use an anonymous function to call your callback, although this solution is a bit more expensive.
... example: var intervalid = setinterval(function() { myfunc('one', 'two', 'three'); }, 1000); another possibility is to use function's bind.
... the "this" problem when you pass a method to setinterval() or any other function, it is invoked with the wrong this value.
...And 3 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
function() { vcallback.apply(null, aargs); } : vcallback, ndelay); }; }, 0, 'test'); }()) ie-only fix if you want a completely unobtrusive fix for every other mobile or desktop browser, including ie 9 and below, you can either use javascript conditional comments: /*@cc_on // conditional ie < 9 only fix @if (@_jscript_version <= 9) (function(f){ window.settimeout = f(window.settimeout); window.setinterval = f(window.setinterval); })(function(f){return function(c,t){var a=[].slice.call(arguments,2);return f(function(){c instanceof func...
...or go for a very clean approach based on the ie html conditional feature: <!--[if lte ie 9]><script> (function(f){ window.settimeout=f(window.settimeout); window.setinterval=f(window.setinterval); })(function(f){return function(c,t){ var a=[].slice.call(arguments,2);return f(function(){c instanceof function?c.apply(this,a):eval(c)},t)} }); </script><![endif]--> workarounds another possibility is to use an anonymous function to call your callback, but this solution is a bit more expensive.
... example: var intervalid = settimeout(function() { myfunc('one', 'two', 'three'); }, 1000); the above example can also be written with the help of an arrow function: var intervalid = settimeout(() => { myfunc('one', 'two', 'three'); }, 1000); yet another possibility is to use function's bind.
...And 3 more matches
Introduction to formatting contexts - CSS: Cascading Style Sheets
elements participating in a bfc use the rules outlined by the css box model, which defines how an element's margins, borders, and padding interact with other blocks in the same context.
...situations: elements made to float using float absolutely positioned elements (including position: fixed or position: sticky) elements with display: inline-block table cells or elements with display: table-cell, including anonymous table cells created when using the display: table-* properties table captions or elements with display: table-caption block elements where overflow has a value other than visible elements with display: flow-root or display: flow-root list-item elements with contain: layout, content, or strict flex items grid items multicol containers elements with column-span set to all this is useful because a new bfc will behave much like the outermost document in that it becomes a mini-layout inside the main layout.
...a typical way to do this in the past has been to set overflow: auto or set other values than the initial value of overflow: visible.
...And 3 more matches
The stacking context - CSS: Cascading Style Sheets
element with a position value absolute or relative and z-index value other than auto.
... element that is a child of a flex (flexbox) container, with z-index value other than auto.
... element that is a child of a grid (grid) container, with z-index value other than auto.
...And 3 more matches
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
the last declaration of a block doesn't need to be terminated by a semi-colon, though it is often considered good style to do it as it prevents forgetting to add it when extending the block with another declaration.
... as an element of the page may be matched by several selectors, and therefore by several rules potentially containing a given property several times, with different values, the css standard defines which one has precedence over the other and must be applied: this is called the cascade algorithm.
...but there is other information that a web author wants to convey in the style sheet, like the character set, other external style sheets to import, font face or list counter descriptions and many more.
...And 3 more matches
Visual formatting model - CSS: Cascading Style Sheets
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.
...this situation happens when, for example, you declare display: flex on a parent element, and directly inside there is a run of text not contained in another element.
...the part of the string before the paragraph element is wrapped in an anonymous box, then we have the <p>, which generates a box, and then another anonymous box.
...And 3 more matches
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
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.
...it behaves as block-level things do in relationship to other boxes in the layout.
...it therefore behaves like other inline-level things, and doesn't take up the full width (or size in the inline dimension) that a block-level box does.
...And 3 more matches
justify-items - CSS: Cascading Style Sheets
in absolutely-positioned layouts, the keyword behaved like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
... 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.
...And 3 more matches
justify-self - CSS: Cascading Style Sheets
in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
... 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.
...And 3 more matches
Video player styling basics - Developer guides
:none; } .controls[data-state=visible] { display:block; } there are a number of properties that also need to be set for all elements within the video controls: .controls > * { float:left; width:3.90625%; height:100%; margin-left:0.1953125%; display:block; } .controls > *:first-child { margin-left:0; } all elements are floated left, as they are to be aligned next to one another, and each element is set to have a width of nearly 4% (again the actual value was calculated based on the required dimensions of the buttons), and a height of 100%.
... the <div> container for the <progress> element also requires some specific settings; it is set to be much wider than the other child elements and its cursor value is set to be pointer: .controls .progress { cursor:pointer; width:75.390625%; } buttons the first major styling task to tackle is to make the video control's buttons actually look like and act like real buttons.
...all the other buttons are treated in a similar way.
...And 3 more matches
Audio and Video Delivery - Developer guides
other tips for audio/video stopping the download of media while stopping the playback of media is as easy as calling the element's pause() method, the browser keeps downloading the media until the media element is disposed of through garbage collection.
...this causes the browser to attempt another download to something that is unlikely to be a valid video.
... if at that point you add another source, by inserting a new <source> element as a child of the media element, gecko attempts to load the specified resource.
...And 3 more matches
Writing forward-compatible websites - Developer guides
this is especially important for intranets and other non-public websites; if we can't see your code, we can't see that it broke.
...don't assume that browsers with support for a given dom feature must also have some other, especially nonstandard, dom feature.
... or, conversely, that they don't have support for some other feature (e.g., don't assume that a browser that supports onload on script elements will never support onreadystatechange on them).
...And 3 more matches
The HTML autocomplete attribute - HTML: Hypertext Markup Language
in countries with two administrative levels, this would typically be the city, town, village, or other locality in which the address is located.
... "cc-number" a credit card number or other number identifying a payment method, such as an account number.
...if you need to break the phone number up into its components, you can use these values for those fields: "tel-country-code" the country code, such as "1" for the united states, canada, and other areas in north america and parts of the caribbean.
...And 3 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
otherwise, the <select> element represents a control for selecting a single <option> from the list of options.
...others do not.
...ad: </label> <input type="file" id="uploads" name="uploads" accept=".jpg, .jpeg, .png, .svg, .gif" multiple> </p> <p> <label for="text">pick a text file to upload: </label> <input type="file" id="text" name="text" accept=".txt"> </p> <p> <input type="submit" value="submit"> </p> </form> note the difference in appearance between the example with multiple set and the other file input without.
...And 3 more matches
HTML attribute reference - HTML: Hypertext Markup Language
for all other elements, use the css height property.
... start <ol> defines the first number if other than 1.
... note: for all other instances, such as <div>, this is a legacy attribute, in which case the css width property should be used instead.
...And 3 more matches
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...And 3 more matches
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
if the required property is specified, then the password edit box must contain a value other than an empty string to be valid.
...you should also include other explanatory text nearby.
...it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content.
...And 3 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
this element is most commonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
... there are a number of other common types you'll come across.
... for example, a link to the site's favicon: <link rel="icon" href="favicon.ico"> there are a number of other icon rel values, mainly used to indicate special icon types for use on various mobile platforms, e.g.: <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-icon-114.png" type="image/png"> the sizes attribute indicates the icon size, while the type contains the mime type of the resource being linked.
...And 3 more matches
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
compared to other form elements it is relatively easy to style, with its box model, fonts, color scheme, etc.
...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.
... note: in browsers other than firefox, such as chrome, the disabled textarea content may be selectable and copyable.
...And 3 more matches
Identifying resources on the Web - HTTP
there are sometimes reasons identity and location are not given by the same uri: http uses a specific http header, alt-svc when the resource requested wants the client to access it at another location.
... a url is composed of different parts, some mandatory and others are optional.
...the web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don't be surprised if you see such protocols.
...And 3 more matches
Character classes - JavaScript
\s matches a single white space character, including space, tab, form feed, line feed, and other unicode spaces.
... \s matches a single character other than white space.
...do not follow this with another digit.
...And 3 more matches
Using Promises - JavaScript
imagine a function, createaudiofileasync(), which asynchronously generates a sound file given a configuration record and two callback functions, one called if the audio file is successfully created, and the other called if an error occurs.
...each callback is executed one after another, in the order in which they were inserted.
...function returns a new promise, different from the original: const promise = dosomething(); const promise2 = promise.then(successcallback, failurecallback); or const promise2 = dosomething().then(successcallback, failurecallback); this second promise (promise2) represents the completion not just of dosomething(), but also of the successcallback or failurecallback you passed in, which can be other asynchronous functions returning a promise.
...And 3 more matches
Inheritance and the prototype chain - JavaScript
each object has a private property which holds a link to another object called its prototype.
...an inherited function acts just as any other property, including property shadowing as shown above (in this case, a form of method overriding).
...please note that the code below is free-standing (it is safe to assume there is no other javascript on the webpage other than the below code).
...And 3 more matches
Date.parse() - JavaScript
(other formats may be used, but results are implementation-dependent.) return value a number representing the milliseconds elapsed since january 1, 1970, 00:00:00 utc and the date obtained by parsing the given string representation of a date.
... other examples: new date('foo-bar 2014').tostring(); // returns: "invalid date" date.parse('foo-bar 2014'); // returns: nan differences in assumed time zone this section contains implementation-specific behavior that can be inconsistent across implementations.
...the first according to es5 will imply utc time, and the others are specifying utc timezone via the iso date specification (z and +00:00) date.parse("2019-01-01") date.parse("2019-01-01t00:00:00.000z") date.parse("2019-01-01t00:00:00.000+00:00") the following call, which does not specify a time zone will be set to 2019-01-01 at 00:00:00 in the local timezone of the system.
...And 3 more matches
Reflect.construct() - JavaScript
function oneclass() { this.name = 'one' } function otherclass() { this.name = 'other' } // calling this: let obj1 = reflect.construct(oneclass, args, otherclass) // ...has the same result as this: let obj2 = object.create(otherclass.prototype) oneclass.apply(obj2, args) console.log(obj1.name) // 'one' console.log(obj2.name) // 'one' console.log(obj1 instanceof oneclass) // false console.log(obj2 instanceof oneclass) // false console.log(ob...
...j1 instanceof otherclass) // true console.log(obj2 instanceof otherclass) // true //another example to demonstrate below: function func1(a, b, c, d) { console.log(arguments[3]); } function func2(d, e, f, g) { consol.log(arguments[3]); } let obj1 = reflect.construct(func1, ['i', 'love', 'my', 'india']) obj1 however, while the end result is the same, there is one important difference in the process.
... when invoking reflect.construct(), on the other hand, the new.target operator will point to the newtarget parameter if supplied, or target if not.
...And 3 more matches
String - JavaScript
creating strings strings can be created as primitives, from string literals, or as objects, using the string() constructor: const string1 = "a string primitive"; const string2 = 'also a string primitive'; const string3 = `yet another string primitive`; const string4 = new string("a string object"); string primitives and string objects can be used interchangeably in most situations.
...the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in ecmascript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed.
...primitives passed to eval are treated as source code; string objects are treated as all other objects are, by returning the object.
...And 3 more matches
eval() - JavaScript
var expression = new string('2 + 2'); eval(expression.tostring()); // returns 4 if you use the eval function indirectly, by invoking it via a reference other than eval, as of ecmascript 5 it works in the global scope rather than the local scope.
... function test() { var x = 2, y = 4; console.log(eval('x + y')); // direct call, uses local scope, result is 6 var geval = eval; // equivalent to calling eval in the global scope console.log(geval('x + y')); // indirect call, uses global scope, throws referenceerror because `x` is undefined (0, eval)('x + y'); // another example of indirect call } never use eval()!
... eval() is also slower than the alternatives, since it has to invoke the javascript interpreter, while many other constructs are optimized by modern js engines.
...And 3 more matches
Lexical grammar - JavaScript
white space white space characters improve the readability of source text and separate tokens from each other.
... \f u+0020 space <sp> normal space u+00a0 no-break space <nbsp> normal space, but no point at which a line may break others other unicode space characters <usp> spaces in unicode on wikipedia line terminators in addition to white space characters, line terminator characters are used to improve the readability of the source text.
... 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).
...And 3 more matches
Strict mode - JavaScript
strict mode for scripts to invoke strict mode for an entire script, put the exact statement "use strict"; (or 'use strict';) before any other statements.
... strict mode for functions likewise, to invoke strict mode for a function, put the exact statement "use strict"; (or 'use strict';) in the function's body before any other statements.
...assignments, which would accidentally create global variables, instead throw an error in strict mode: 'use strict'; // assuming no global variable mistypedvariable exists mistypevariable = 17; // this line throws a referenceerror due to the // misspelling of variable second, strict mode makes assignments which would otherwise silently fail to throw an exception.
...And 3 more matches
Critical rendering path - Web Performance
if another set of starttag and endtag tokens come between a set of starttag and endtags, you have a node inside a node, which is how we define the hierarchy of the dom tree.
...there are other ways to optimize css, such as minification, and separating defered css into non-blocking requests by using media queries.
...the layout step determines where and how the elements are positioned on the page, determining the width and height of each element, and where they are in relation to each other.
...And 3 more matches
Graphic design for responsive sites - Progressive web apps (PWAs)
you could use css3 properties for generating effects like drop shadows, gradients and rounded corners, and you could also consider using svg for other ui elements, instead of raster graphics formats.
... using fonts for icons another technique to consider is using web fonts for icons.
... interactive images if your images need to feature some level of interactivity, such as links, other clickable areas, or animation, there are a number of options available.
...And 3 more matches
Media - Progressive web apps (PWAs)
this css (below) removes the navigation area when printing the document: @media print { #nav-area {display: none;} } some common media types are: screen color device display print printed paged media projection projected display all all media (the default) more details there are other ways to specify the media type for a set of rules.
... in css, you can use @import at the start of a stylesheet to import another stylesheet from a url, optionally specifying the media type.
... like other features of css, printing depends on browser choice and its settings.
...And 3 more matches
Mobile first - Progressive web apps (PWAs)
this way, mobile devices don't have to load assets and other information twice.
... mobile constraints we have already mentioned the fact that mobiles generally have less memory, processing power and bandwidth than other devices (although bear in mind that smart tvs are also generally pretty low powered.) they also have less viewport size available.
... control mechanisms control mechanisms are another large constraint on mobile devices.
...And 3 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
pwas can be built using any approach you like, but some will work better than the others.
...in addition to the basic shell, you can add other features such as add to home screen or push notifications, safe in the knowledge that the app will still work ok if they are not supported by the user's browser — this is the beauty of progressive enhancement.
... another approach: streams an entirely different approach to server- or client-side rendering can be achieved with the streams api.
...And 3 more matches
Tutorials
intermediate level multimedia and embedding this module explores how to use html to include multimedia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages.
... css first steps css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
... styling text here we look at text styling fundamentals, including setting font, boldness, and italics, line and letter spacing, and drop shadows and other text features.
...And 3 more matches
An Overview - XSLT: Extensible Stylesheet Language Transformations
so the model for transformation is that one xml document is used to transform another xml document.
...other namespaces and three optional attributes may also be included.
...another string that is occasionally seen in stylesheets, "http://www.w3.org/tr/wd-xsl", indicates compliance with an earlier working draft (hence the wd) of the w3c document.
...And 3 more matches
Module structure of the SDK - Archive of obsolete content
commonjs defines: an object called exports which contains all the objects which a commonjs module wants to make available to other modules a function called require which a module can use to import the exports object of another module.
...each module is a separate file stored under your add-on's "lib" directory, and exports the objects you want to make available to other modules in your add-on.
... for example, the following add-on contains an additional module directly under "lib", and other modules under subdirectories of "lib": my-addon lib main.js password-dialog.js secrets hash.js storage password-store.js to import modules into main: // main.js code var dialog = require("./password-dialog"); var hash = require("./secrets/hash"); to import modules into password-store: // password-store.js code var dialog = require("../password-dialog"); var hash = require("../secrets/hash"); external modules as well as using the sdk's modules and wri...
...And 2 more matches
test/assert - Archive of obsolete content
other pairs that do not both pass typeof value == "object", equivalence is determined by ==.
... for all other object pairs, including array objects, equivalence is determined by having the same number of owned properties (as verified with object.prototype.hasownproperty.call), the same set of keys (although not necessarily the same order), equivalent values for every corresponding key, and an identical "prototype" property.
...n contains a specific message, pass a regular expression here: the message property of the exception thrown must match the regular expression for example, suppose we define two different custom exceptions: function myerror(message) { this.name = "myerror"; this.message = message || "default message"; } myerror.prototype = new error(); myerror.prototype.constructor = myerror; function anothererror(message) { this.name = "anothererror"; this.message = message || "default message"; console.log(this.message); } anothererror.prototype = new error(); anothererror.prototype.constructor = anothererror; we can check the type of exception by passing a function as the error argument: exports["test exception type 1 expected to pass"] = function(assert) { assert.throws(function() { ...
...And 2 more matches
util/array - Archive of obsolete content
globals functions has(array, element) returns true if the given array contains the element or false otherwise.
... hasany(array, elements) returns true if the given array contains any of the elements in the elements array, or false otherwise.
...otherwise, this function does not add the element and returns false.
...And 2 more matches
jpm - Archive of obsolete content
on debian and ubuntu, this can be remedied by ensuring you installed the compatibility package, nodejs-legacy: sudo apt-get install nodejs-legacy on other distributions, you may have to create a local symlink to nodejs manually: sudo ln -s "$(which nodejs)" /usr/local/bin/node installing jpm after you have npm installed and node on your path, install jpm just as you would any other npm package.
...you can also chat with other sdk users in #jetpack on mozilla's irc network.
...it includes all other files.
...And 2 more matches
package.json - Archive of obsolete content
the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons.
... others, such as lib, permissions, and preferences, represent instructions to the jpm tool itself to generate and include particular code and data structures in your add-on.
...it looks like this (assuming the add-on's directory is "my-addon"): { "name": "my-addon", "title": "my-addon", "id": "jid1-1fergv45e4f4f@jetpack", "description": "a basic add-on", "author": "", "license": "mpl-2.0", "version": "0.1" } if you are using the new jpm tool, you can easily access manifest data from package.json by requiring it like any other module: var title = require("./package.json").title; key reference package.json may contain the following keys: author the name of the package's original author; this could be the name of a person or a company.
...And 2 more matches
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
unicharutils has been modified to provide a frozen-linkage comparator: nsstring mystring = somestring; - if (mystring.equals(otherstring, nscaseinsensitivestringcomparator())) + if (mystring.equals(otherstring, caseinsensitivecompare)) return ns_ok; // woot, we're equal in all things but case when using unicharutils from frozen-linkage code, link against the unicharutil_external_s static library.
...use += or append() instead of using +, and use nsstring or nscstring instead of promiseflatstring: nsstring firststring = somestring; nsstring secondstring = someotherstring; - nsstring combostring = firststring + secondstring; + nsstring combostring = firststring;+ combostring += secondstring; // or: combostring.append(secondstring); - nsresult rv = somefunc(promiseflatstring(combostring)); + nsresult rv = somefunc(combostring); removing the nsreadableutils.h from the headers list also means that we would not have access to appendutf16toutf8 kind of functions.
...- #include "nscrt.h" + #include <string.h> const char *str = "foo"; - pruint32 len = nscrt::strlen(str); + pruint32 len = strlen(str); - #include "nscrt.h" + #include "nscrtglue.h" const prunichar str[] = {'f','o','o','\0'}; - pruint32 len = nscrt::strlen(str); + pruint32 len = 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.
...And 2 more matches
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
for more information on these technologies, please refer to other sources.
... an element can include other elements as well as text in its content, and all information is structured as a tree.
... as the "extensible" part of xml implies, elements from various xml-based languages such as xhtml and svg can be interspersed in one another as a means to extend the language.
...And 2 more matches
Adding Events and Commands - Archive of obsolete content
the most commonly used event is the onload event, which is used in overlays and other windows to detect when the window has loaded and then run initialization code: // rest of overlay code goes here.
... another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="xulschoolhello-browser-overlay" onload="xulschoolchrome.browseroverlay.init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> we prefer the first method because it keeps a better separation of content and behavior.
...the advantage of using the event argument is that the method is not dependent of the specific button, so it can also be used for other elements.
...And 2 more matches
Connecting to Remote Content - Archive of obsolete content
besides xml, it can be used to retrieve data in other formats, for example json, html and plain text.
...the json page explains in detail how to parse json data in different versions of firefox and other applications.
...you can then use this object like any other javascript objects in your code.
...And 2 more matches
User Notifications and Alerts - Archive of obsolete content
another advantage is that you use an xpcom service to do this (nsialertsservice), so you can easily trigger alerts from chrome and non-chrome code.
... on the other hand, alerts are displayed only temporarily using the alerts service is similar to using notification boxes: let alertsservice = cc["@mozilla.org/alerts-service;1"].getservice(ci.nsialertsservice); let title = this._bundle.getstring("xulschoolhello.greeting.title"); let message = this._bundle.getstring("xulschoolhello.greeting.label"); alertsservice.showalertnotification( "chrome://xulschoolhello/skin/hello-notification.png", title, message, true, "", this, "xulschool hello message"); we pass this as an argument, assuming that this is an object that implements nsiobserver.
... because of the inconsistent support and temporary nature of these alerts, we don't recommend using this service to show information the user needs to know and can't get in any other way.
...And 2 more matches
Setting up an extension development environment - Archive of obsolete content
on ubuntu (and many other linux distributions): /usr/bin/firefox -no-remote -p dev on other distributions of linux/unix: /usr/local/bin/firefox -no-remote -p dev on macos mavericks (10.9) and newer: /applications/firefox.app/contents/macos/firefox-bin -no-remote -p dev & on windows: start -> run "%programfiles%\mozilla firefox\firefox.exe" -no-remote -p dev on windows 64 bit: start -> run "%programfiles(x86)%\...
...if you are already running a firefox instance without -no-remote, and you attempt to start another instance with -p profilename (but without the -no-remote parameter), that second invocation would ignore its -p profilename parameter, instead opening a new window for the already running instance; sharing all its profile, sessions etc.
...(linux, mac os x, windows instructions.) you'll see the list of available user profiles one which is default (stable) and other (unstable) profile(s) created automatically when you run other versions of firefox earlier.
...And 2 more matches
Adding preferences to an extension - Archive of obsolete content
it also adds a preference dialog that lets you switch to a stock other than one of the ones included in the popup menu.
... establish the defaults in order to set a default preference for the stock to monitor, we need to add a new folder to our extension's package, called "defaults", which in turn contains another folder called "preferences".
... inside that, we create a file, defaults.js, that describes the default value of our preferences: pref("extensions.stockwatcher2.symbol", "goog"); the standard for third-party preferences, such as those used in extensions, is to use the string "extensions", a period, the name of the extension, another period, then a preference name, as seen in the example above.
...And 2 more matches
XML data - Archive of obsolete content
by linking a css stylesheet with the xml document, you can define other ways to display it.
... stylesheet, you specify how info elements are to be displayed: info { display: block; margin: 1em 0; } the most common values for the display property are: block displayed like html's div (for headings, paragraphs) inline displayed like html's span (for emphasis within text) add your own style rules that specify the font, spacing and other details in the same way as for html.
... more details other values of display display the element like a list item, or like a component of a table.
...And 2 more matches
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
other major commercial browsers based on gecko have committed to providing these keys as well.
...examples given for "product x.y" were using netscape 6 but other possible mozilla based browsers exist as well; all gecko-based browsers are encouraged to write these keys, so that plugin vendors can write plugin installers that install correctly to all gecko-based browsers.
...examples given for "product x.y" were using netscape 6, but other possible mozilla based browsers exist as well; all gecko-based browsers are encouraged to write these keys, so that plugin vendors can write a plugin installer that is able to find the information it needs across all gecko-based browsers.
...And 2 more matches
Notes on HTML Reflow - Archive of obsolete content
the xul box layout model, on the other hand, is constraint based , meaning that geometric preferences and constraints of neighboring elements are taken into consideration before the elements' final geometry can be computed.
...other reflows are incremental and are dealt with asynchronously; for example, when content streams in from the network.
...instead, it queues the command, and processes it asynchronously along with other queued reflow commands en masse .
...And 2 more matches
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
note: starting in gecko 2.0, the new omni.jar file contains the skin, among other resources.
... go to contents/macos/chrome/classic.jar copy classic.jar to another easily accessible folder -- classic is recommended -- extract the contents of that folder, being sure to maintain the directory structure.
... skin skin simply contains another directory, classic which holds all the good stuff.
...And 2 more matches
Download Manager preferences - Archive of obsolete content
in other applications the default value is false.
... in other applications the default value is true.
... in other applications the default is true.
...And 2 more matches
JavaScript crypto - Archive of obsolete content
warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
...very authority (kra) (passed in in the form of a certificate as part of the script, and checked against a pre-installed certificate copy in the local certificate database) the public keys, wrapped encryption private key, and text string from the script (possibly containing naming or enrollment info) are signed by the user signed blob is returned to the script script submits signed blob and any other necessary info to the ca/ra ca/ra verifies signature on signed blob ca/ra validates identity of user ca/ra sends wrapped encryption private key to kra kra sends escrow verification back to ca ca creates and signs certificates ca sends certificates back to the user (importusercertificates) typical use the ca's enrollment page could look something like this: <!doctype html> <h2>request a ...
...therefore, these bits should always be set to 0; otherwise, mozilla might exhibit unpredictable behavior.
...And 2 more matches
Plug-n-Hack Phase1 - Archive of obsolete content
the configuration document should then listen for a number of other events: configuresectoolstarted - this notifies the document that the browser is processing the configuration; if this event is not received within a reasonable amount of time after the configuresectool event has been fired, you might want to warn the user that pnh does not seem to be supported by this browser (perhaps prompting them to install the appropriate addon).
...there’s another (possibly out of date) example here.
... an example manifest (for owasp zap) is: { "toolname":"owasp zap", "protocolversion":"0.2", "features":{ "proxy":{ "pac":"http://localhost:8080/proxy.pac", "cacert":"http://localhost:8080/other/core/other/rootcert/" }, "commands":{ "prefix":"zap", "manifest":"http://localhost:8080/other/mitm/other/service/" } } } the top level manifest includes optional links to a proxy pac and a root ca certificate.
...And 2 more matches
Space Manager Detailed Design - Archive of obsolete content
if the (adjusted) y offset is between the band top and bottom, then get the available space for the band by calling getbandavailablespace otherwise, move to the next band getbandavailablespace: this method is called from getbanddata only.
... otherwise, create another entry in the band collection, marked as available, and with a rect corresponding to the area remain in in the band(e.g.
...insert the part that is totally above the bandrect before the current bandrect, as in case #1 above, and adjust the other band rect to exclude the part already added.
...And 2 more matches
Anonymous Content - Archive of obsolete content
explicit insertion points on other bindings are ignored.
...if anonymous content that contains an insertion point is removed, then any explicit children found underneath the insertion point are relocated to any other insertion points that match.
...the tabindex values used in one scope are ignored by other scopes.
...And 2 more matches
Accessing Files - Archive of obsolete content
other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
...to retrieve other files, you will need to use nsiscriptableio.getfile() to access a directory and iterate through subdirectories until you come to the file that you want.
...there are several other values which may be used as the first argument to nsiscriptableio.getfile(), listed in the following table.
...And 2 more matches
Writing to Files - Archive of obsolete content
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.
...an output stream is an object which can be used to write bytes, strings and other values to a file.
...other character encodings are available; see writing other character encodings below for details about writing text in other encodings.
...And 2 more matches
ContextMenus - Archive of obsolete content
on other platforms, the attribute will just be ignored and the menuitem will be displayed normally.
... note that the default attribute just affects how the item is displayed, it performs no other function itself.
... another alternative is to disable the menuitem instead of hiding it, by setting the item's disabled property.
...And 2 more matches
Extensions - Archive of obsolete content
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.
...And 2 more matches
MenuItems - Archive of obsolete content
item id="add-bookmark" class="menuitem-iconic" label="add bookmark" image="addbookmark.png"/> #add-bookmark { list-style-image: url('addbookmark.png'); } #add-bookmark .menu-iconic-icon { -moz-image-region: rect(0px, 16px, 16px, 0px) !important; } #add-bookmark:hover .menu-iconic-icon { -moz-image-region: rect(16px, 16px, 32px, 0px) !important; } this behavior is fundamentally different to other html elements, such as <li> or <div> where list-style-image and -moz-image-region can be applied at the same element level.
...<menuitem label="show toolbar" accesskey="t" type="checkbox" oncommand="changetoolbarstate();"/> in this example, we show the toolbar when the menuitem is checked and hide the toolbar otherwise.
...this works similarly to the checkbox type, except when selecting an item, all others in the same group are automatically unchecked.
...And 2 more matches
PopupEvents - Archive of obsolete content
otherwise, the adjustfilemenu function would be called whenever the outer menupopup is opened and when the inner menupopup is opened.
... one possible use of the popupshown event is to open another menu.
...otherwise, the user will be distracted with a popup that they cannot close.
...And 2 more matches
Popup Guide - Archive of obsolete content
a popup is a menu or floating window without a title bar, borders or other window decorations that may extend outside of the edge of the main window.
... popup types xul provides a number of different types of elements which may be used to create popup menus or other types of popup widgets, which vary based on the manner in which they are attached to an element and the manner in which they are opened.
...a popup is not created as a separate window or file, instead it is included inside another window or dialog.
...And 2 more matches
Additional Navigation - Archive of obsolete content
the others won't be able to match when evaluating the triple.
...another thing that you cannot have is a triple where both variables would be unknown as in the following: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?category" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> in this case when the template builder gets to the triple, neither the ?category nor the ?ti...
...one possibility is to just add another predicate for each photo with a literal value set to the category.
...And 2 more matches
Multiple Rules - Archive of obsolete content
however, you will probably notice that the one photo that matches the first rule has appeared differently that the others.
... in fact, the content for this photo is that of the first rule with the button, whereas the content for the other photos is that of the second rule with the normal images.
... here is another example for an xml source: <radiogroup datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <rule> <where subject="?gender" rel="equals" value="male"/> <action> <radio uri="?" label="?name is male"/> </action> </rule> <rule> <action> <radio uri="?" label="?name is female" disabled="true"/> </action> </rule> </template> </radiogroup> in this example, all male people are matched with the first rule, and a radio button is generated for each one.
...And 2 more matches
Adding HTML Elements - Archive of obsolete content
« previousnext » now that we've added some buttons, let's add some other elements.
...you can also add labels to controls either by using the html label element, or you can simply put the text inside another html block element (such as p or div) as in the example below.
...in each case, the window and other common information has been left out for simplicity.
...And 2 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
note that the less-than symbol has to be escaped because otherwise it would look like the start of a tag.
...however, in the future, other languages may be used with xbl.
...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.
...And 2 more matches
Numeric Controls - Archive of obsolete content
other characters are not allowed and are just ignored if typed.
... as with other textboxes, the default value can be specified with the value attribute.
...other numeric textbox attributes the increment attribute may be used to specify by how much the value changes when the arrows are pressed.
...And 2 more matches
Styling a Tree - Archive of obsolete content
styling the tree you can style the tree border and the column headers in the same way as other elements.
... the body of the tree must be styled in a somewhat different way than other elements.
... this is because the tree body is stored in a different way to other elements.
...And 2 more matches
Tabboxes - Archive of obsolete content
in other words, this is the row of tabs.
...that means that if there are ten textboxes on one tab page and only one on another, the tab page will be sized to fit the one with the ten on it as this takes up more room.
...mple example 1 : source view <tabbox> <tabs> <tab label="mail"/> <tab label="news"/> </tabs> <tabpanels> <tabpanel id="mailtab"> <checkbox label="automatically check for mail"/> </tabpanel> <tabpanel id="newstab"> <button label="clear news buffer"/> </tabpanel> </tabpanels> </tabbox> here, two tabs have been added, the first labeled 'mail' and the other 'news'.
...And 2 more matches
Tree Box Objects - Archive of obsolete content
in this case, there are other drawing functions that can be used.
... other redrawing functions are invalidatecell() to redraw only a single cell invalidatecolumn() to redraw a column invalidaterange() to redraw a range of rows invalidate() to redraw the entire tree.
...you might notice that the tree box object can be retrieved in the same way as other box objects using the boxobject (fixme: deallink)property, however we need to call queryinterface() to cast the box object to the more specific tree box object.
...And 2 more matches
Using the Editor from XUL - Archive of obsolete content
the contentwindow (another settable attribute on nsieditorshell) points to the xul element which is to become editable.
... editorstartup() does some other minor bits of setup before finally kicking off the url load, which the most important part here.
... nstexteditorkeylistener this event listener handles key presses for typing, and other editing operations (backspace, delete, enter/return).
...And 2 more matches
key - Archive of obsolete content
ArchiveMozillaXULkey
keys will map to other keys on platforms that do not have them.
...on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text.
... access: the access key for activating menus and other elements.
...And 2 more matches
prefwindow - Archive of obsolete content
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.
...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.
...And 2 more matches
toolbarbutton - Archive of obsolete content
normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right or top to bottom in the order they appear in the xul code.
...for other elements, they are placed right to left or bottom to top.
...if the user selects one the buttons, the others in the group are unchecked.
...And 2 more matches
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
to build just one of the projects, remove the name of the other from moz_build_projects.
...you can also add other options to this section if you want them to apply to your app only.
...of course, you only really need the mozilla build system since all the other mozilla files are in the xulrunner sdk, and there is a bug filed to make it possible to check out the build system only.
...And 2 more matches
Dialogs in XULRunner - Archive of obsolete content
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.
... buttonlabelaccept label for the accept button; similar attributes exist for the other button types.
... buttonaccesskeyaccept access key for the accept button; similar attributes exist for the other button types.
...And 2 more matches
NPN_GetURL - Archive of obsolete content
description npn_geturl() is used to load a url into the current window or another target or stream.
... plug-ins can use this capability to provide hyperlinks to other documents or to retrieve data from anywhere on the network.
...the following recommendations about target choice apply to other methods that handle urls as well.
...And 2 more matches
Syndicating content with RSS - Archive of obsolete content
syndication (or web syndication) is a method which lets a web site make its content available for others to read, listen to, or watch.
... we've already discussed the first step—creating rss feeds— so we'll focus on the other two steps here.
... linking from the the html web page where the data in an rss feed is also contained makes the rss feed available for use: <a rel="alternate" type="application/rss+xml" href="http://example.com/feed">...</a> feed icons rss (and other) feeds use a special icon.
...And 2 more matches
Using the W3C DOM - Archive of obsolete content
you can get a reference to the element to which that style corresponds by using the dom's getelementbyid or one of the other methods described in the dom access section above.
... css 1 and css 2.x specifications require that non-zero values must be specified with a length unit; otherwise, the css declaration will be ignored.
... mozilla-based browsers, msie 6+, opera 7+ and other w3c standards-compliant browsers enforce such handling of parsing error.
...And 2 more matches
Archive of obsolete content
.htaccess ( hypertext access ) file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other.
...it also adds a preference dialog that lets you switch to a stock other than one of the ones included in the popup menu.
...it is a static library that is linked into the flash player but kept separate, and can be incorporated into other programs.
...And 2 more matches
3D games on the Web - Game development
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.
...there are other popular game development libraries and frameworks worth checking too; a-frame, playcanvas and babylon.js are among the most recognizable ones with rich documentation, online editors and active communities.
...as with any other 3d library, it provides built-in functions to help you implement common 3d functionality more quickly.
...And 2 more matches
2D maze game with device orientation - Game development
we're loading two images first that will be used later in the preload state to show the progress of loading all the other assets.
...ototype = { create: function() {}, initlevels: function() {}, showlevel: function(level) {}, updatecounter: function() {}, managepause: function() {}, manageaudio: function() {}, update: function() {}, wallcollision: function() {}, handleorientation: function(e) {}, finishlevel: function() {} }; the create and update functions are framework-specific, while others will be our own creations: initlevels initializes the level data.
... wallcollision is executed when the ball hits the walls or other objects.
...And 2 more matches
First-class Function - MDN Web Docs Glossary: Definitions of Web-related terms
a programming language is said to have first-class functions when functions in that language are treated like any other variable.
... for example, in such a language, a function can be passed as an argument to other functions, can be returned by another function and can be assigned as a value to a variable.
... the function that we pass as an argument to another function, is called a callback function.
...And 2 more matches
Styling tables - Learn web development
next, create a new file called style.css and save it in the same directory as your other files.
...it is useful to have multiple nested elements available so you can layer styles on top of one another.
...this causes the caption to be positioned on the bottom of the table, which along with the other declarations gives us this final look (see it live at punk-bands-complete.html): table styling quick tips before moving on, we thought we'd provide you with a quick list of the most useful points illustrated above: make your table markup as simple as possible, and keep things flexible, e.g.
...And 2 more matches
CSS building blocks - Learn web development
note: if you are working on a computer/tablet/another device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
...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.
... overflowing content in this lesson we will look at another important concept in css — overflow.
...And 2 more matches
Beginner's guide to media queries - Learn web development
media queries are a key part of responsive web design, as they allow you to create different layouts depending on the size 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.
... note: there were a number of other media types defined in the level 3 media queries specification; these have been deprecated and should be avoided.
... there are a number of other media features that you can test for, although some of the newer features introduced in level 4 and 5 of the media queries specification have limited browser support.
...And 2 more matches
CSS layout - Learn web development
now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another.
... note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... positioning positioning allows you to take elements out of the normal document layout flow, and make them behave differently, for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
...And 2 more matches
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
/* 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.
...</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.
...And 2 more matches
Styling lists - Learn web development
previous overview: styling text next lists behave like any other text for the most part, but there are some css properties specific to lists that you need to know about, and some best practices to consider.
...</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> <h2>ingredient description list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <dl> <dt>hummus</dt> <dd>a thick dip/sauce generally made from chick peas blended with tahini, lemon juice, salt, garlic, and other ingredients.</dd> <dt>pita</dt> <dd>a soft, slightly leavened flatbread.</dd> <dt>halloumi</dt> <dd>a semi-hard, unripened, brined cheese with a higher-than-usual melting point, usually made from goat/sheep milk.</dd> <dt>green salad</dt> <dd>that green healthy stuff that many of us just use to garnish kebabs.</dd> </dl> if you go to the live example now and investigate the list elem...
... handling list spacing when styling lists, you need to adjust their styles so they keep the same vertical spacing as their surrounding elements (such as paragraphs and images; sometimes called vertical rhythm), and the same horizontal spacing as each other (you can see the finished styled example on github, and find the source code too.) the css used for the text styling and spacing is as follows: /* general styles */ html { font-family: helvetica, arial, sans-serif; font-size: 10px; } h2 { font-size: 2rem; } ul,ol,dl,p { font-size: 1.5rem; } li, p { line-height: 1.5; } /* description list styles */ dd, dt { line-height: 1.5; }...
...And 2 more matches
How much does it cost to do something on the Web? - Learn web development
if at some point you need to exchange projects with other designers, you should find out what tools they're using.
... 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.
... on the other hand, you'll need a high-bandwidth connection, such as dsl, cable, or fiber access, if you want a more advanced website with hundreds of files, or if you want to deliver heavy video/audio files directly from your web server.
...And 2 more matches
How do I start to design my website? - Learn web development
meet other musicians.
... meet other musicians.
...we have five goals connected to music, one goal related to personal life (finding your significant other), and the completely unrelated cat photos.
...And 2 more matches
Advanced form styling - Learn web development
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).
... you can see the live result: we've also created a couple of other examples to give you more ideas: styled radio buttons: custom radio button styling.
...play: block; font-family: inherit; font-size: 100%; padding: 0; margin: 0; box-sizing: border-box; width: 100%; padding: 5px; height: 30px; } we also added some uniform shadow and rounded corners to the controls on which it made sense: input[type="text"], input[type="datetime-local"], input[type="color"], select { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } on other controls like range types, progress bars, and meters they just add an ugly box around the control area, so it doesn't make sense.
...And 2 more matches
HTML forms in legacy browsers - Learn web development
there are other resources that can be amazingly helpful: browser vendor documentation mozilla: you're in the right place, just browse mdn microsoft: internet explorer standards support documentation webkit: because there are several different editions of this engine, things are a little trickier.
...when you build something for a modern browser, and you want to be sure it will work, one way or another, on legacy browsers, you are performing graceful degradation.
... <!-- clicking this button sent "<em>do a</em>" instead of "a" in some cases --> <button type="submit" name="iwantto" value="a"> <em>do a</em> </button> choosing one solution or the other is up to you based on your project's constraints.
...And 2 more matches
How to structure a web form - Learn web development
warning: it's strictly forbidden to nest a form inside another form.
...there are other use cases, and in general the <fieldset> element can also be used to section a form.
... there is another way to associate a form control with a label — nest the form control within the <label>, implicitly associating it.
...And 2 more matches
Sending form data - Learn web development
on the other hand, if the form is hosted on a secure page but you specify an insecure http url with the action attribute, all browsers display a security warning to the user each time they try to send data because the data will not be encrypted.
...this can be very important for two reasons: if you need to send a password (or any other sensitive piece of data), never use the get method or you risk displaying it in the url bar, which would be very insecure.
...you might display it, store it into a database, send it by email, or process it in some other way.
...And 2 more matches
CSS basics - Learn web development
otherwise, the styling won't change the appearance of the html.
...(for example, there are many color values in addition to red.) note the other important parts of the syntax: apart from the selector, each ruleset must be wrapped in curly braces.
...most html elements on your page can be thought of as boxes sitting on top of other boxes.
...And 2 more matches
HTML basics - Learn web development
the class attribute allows you to give the element a non-unique identifier that can be used to target it (and any other elements with the same class value) with style information and other things.
... nesting elements you can put elements inside other elements too — this is called nesting.
...the following is incorrect: <p>my cat is <strong>very grumpy.</p></strong> the elements have to open and close correctly so that they are clearly inside or outside one another.
...And 2 more matches
The web and web standards - Learn web development
after that other technologies followed such as css and javascript, and the web started to look more like the web we know today.
... for example, the html living standard describes exactly how html (all the html elements, and their associated apis, and other surrounding technologies) should be implemented.
...the w3c is the best known web standards body, but there are others such as the whatwg (who were responsible for the modernization of the html language), ecma (who publish the standard for ecmascript, which javascript is based on), khronos (who publish technologies for 3d graphics, such as webgl), and others.
...And 2 more matches
Tips for authoring fast-loading HTML pages - Learn web development
reducing page weight through the elimination of unnecessary whitespace and comments, commonly known as minimization, and by moving inline script and css into external files, can improve download performance with minimal need for other changes in the page structure.
...other tools can "compress" javascript by reformatting the source or by obfuscating the source and replacing long identifiers with shorter versions.
... using valid markup has other advantages.
...And 2 more matches
HTML text fundamentals - Learn web development
you just need to bear in mind a few best practices as you create such structures: preferably, you should use a single <h1> per page—this is the top level heading, and all others sit below this in the hierarchy.
... on the other hand, you could make any element look like a top level heading.
... nesting lists it is perfectly ok to nest one list inside another one.
...And 2 more matches
Introduction to HTML - Learn web development
note: if you are working on a computer/tablet/other devices that doesn't let you create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch.
... 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.
...And 2 more matches
Multimedia and Embedding - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... images in html there are other types of multimedia to consider, but it is logical to start with the humble <img> element used to embed a simple image in a webpage.
... from <object> to <iframe> — other embedding technologies at this point we'd like to take somewhat of a sideways step, looking at a couple of elements that allow you to embed a wide variety of content types into your webpages: the <iframe>, <embed> and <object> elements.
...And 2 more matches
HTML table basics - Learn web development
LearnHTMLTablesBasics
tables on the other hand are sized according to their content by default, so extra measures are needed to get table layout styling to effectively work across a variety of devices.
...update the contents of your table to look like so: <td>hi, i'm your first cell.</td> <td>i'm your second cell.</td> <td>i'm your third cell.</td> <td>i'm your fourth cell.</td> as you will see, the cells are not placed underneath each other, rather they are automatically aligned with each other on the same row.
...irst the source code: <table> <tr> <td>&nbsp;</td> <td>knocky</td> <td>flor</td> <td>ella</td> <td>juan</td> </tr> <tr> <td>breed</td> <td>jack russell</td> <td>poodle</td> <td>streetdog</td> <td>cocker spaniel</td> </tr> <tr> <td>age</td> <td>16</td> <td>9</td> <td>10</td> <td>5</td> </tr> <tr> <td>owner</td> <td>mother-in-law</td> <td>me</td> <td>me</td> <td>sister-in-law</td> </tr> <tr> <td>eating habits</td> <td>eats everyone's leftovers</td> <td>nibbles at food</td> <td>hearty eater</td> <td>will eat till he explodes</td> </tr> </table> now the actual rendered table: knocky flor ella juan breed jack russell poodle streetdog co...
...And 2 more matches
Video and Audio APIs - Learn web development
another big issue is that the native controls in most browsers aren't very keyboard-accessible.
...this way, we make sure we can see all the information — one box is not obscuring another.
...ervalrwd); stopmedia(); } else { media.currenttime -= 3; } } function windforward() { if(media.currenttime >= media.duration - 3) { fwd.classlist.remove('active'); clearinterval(intervalfwd); stopmedia(); } else { media.currenttime += 3; } } again, we'll just run through the first one of these functions as they work almost identically, but in reverse to one another.
...And 2 more matches
Test your skills: JSON - Learn web development
json data about some mother cats and their kittens is available in sample.json.
...your task is to fill in the missing parts of the displaycatinfo() function to store: the names of the three mother cats, separated by commas, in the motherinfo variable.
... you'll probably want to use an outer loop to loop through the cats and add their names to the motherinfo variable string, and an inner loop to loop through all the kittens, add up the total of all/male/female kittens, and add those details to the kitteninfo variable string.
...And 2 more matches
Multimedia: video - Learn web development
if not, there are online tools, such as ffmpeg (discussed in section below), that encode, decode, convert, and perform other optimization functions.
... see caniuse.com for current browser support of video and other media types.
... remove audio from muted hero videos for hero-video or other video without audio, removing audio is smart.
...And 2 more matches
Properly configuring server MIME types - Learn web development
some other web browsers, such as microsoft® internet explorer, try to allow for misconfigured web servers and applications by guessing what the correct mime type should be.
...you can serve content other than html from perl, php, asp, or java — just change the mime type accordingly.
... for perl cgi, you should have the line print "content-type: text/html\n\n"; before any other output lines.
...And 2 more matches
Getting started with Ember - Learn web development
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.
... the templating language is used to make build and runtime optimizations that otherwise wouldn't be possible.
...And 2 more matches
Componentizing our React app - Learn web development
we don't only want to eat; we have other things to — well — to do.
...another problem remains though: they're all still checked by default.
...that's a good job for another prop!
...And 2 more matches
Vue conditional rendering: editing existing todos - Learn web development
to do that, we'll use another vue directive: v-if.
... it's important to note that v-else and v-else-if blocks need to be the first sibling of a v-if/v-else-if block, otherwise vue will not recognize them.
... lastly, you can use a v-if + v-else at the root of your component to display only one block or another, since vue will only render one of these blocks at a time.
...And 2 more matches
Rendering a list of Vue components - Learn web development
directives are applied to elements like other attributes.
... key attribute before we do that, there's one other piece of syntax to know about that is used with v-for, the key attribute.
...} ] }; } }; now, add the v-for directive and key attribute to the <li> element in your app.vue template, like so: <ul> <li v-for="item in todoitems" :key="item.id"> <to-do-item label="my todo item" :done="true"></to-do-item> </li> </ul> when you make this change, every javascript expression between the <li> tags will have access to the item value in addition to the other component attributes.
...And 2 more matches
Configuring Build Options
using a mozconfig configuration file the choice of which mozilla application to build and other configuration options can be configured in a mozconfig file.
... there are many options recognized by the configure script which are special-purpose options intended for embedders or other special situations, and should not be used to build the full suite/xul applications.
... ac_add_options --enable-debug enables assertions in c++ and javascript, plus other debug-only code.
...And 2 more matches
Obsolete Build Caveats and Tips
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).
...other versions of visual studio will not work.
...And 2 more matches
SVG Guidelines
on the other hand the size of a raster file of the same image will likely vary tremendously depending on the dimensions of the image since the larger the dimensions the more pixel data the file needs to store.
...on the other hand, if the image is saved as an svg image then all this work needs to be done each time the svg is displayed on someone else's computer.
...metadata can mean many things, including: the typical "created with editor" comments non-standard editor specific tags and attributes (sketch:foo, illustrator:foo, sopodi:foo, …) the xml namespace definition that comes with the latter (xmlns:sketch, xmlns:sopodi, …) other metadata in addition to non-standard editor metadata, standard compliant metadata also exists.
...And 2 more matches
Index
found 172 pages: # page tags and summary 1 firefox firefox, landing, mozilla 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.
... 143 multiple firefox profiles beginner, firefox, guide, intro, profiles, qa a profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox.
... 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.
...And 2 more matches
Firefox
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.
... linux compatibility matrixthe following table lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox.multiple firefox profilesa profile in firefox is the collection of 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.
...And 2 more matches
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
we'll be using this term throughout the current article, and other parts of the documentation.
... there's another event listener added later on in the code that listens for the mozbrowserlocationchange event.
...we do this with the following function, which runs the htmliframeelement.stop() method to stop the page loading if the button is displaying a cross, and the htmliframeelement.reload() method to reload the page otherwise.
...And 2 more matches
Getting Started with Chat
the following are some other options available to you: windows mac linux colloquy ● irssi ● ● ●* xchat ● ○ ● key: ● — binary or executable program available ○ — only available by downloading and compiling source code ●* — binary or executable may be available.
...one of the simplest web-based clients is mibbit, another is irccloud.
...mibbit does not require flash or any other plugins.
...And 2 more matches
How to implement a custom autocomplete search component
the component uses the autocompletesearchparam attribute or searchparam property to allow the developer to define the default directory otherwise only paths beginning with / or ~/ will be autocompleted.
... 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.
... return ''; }, /** * @return {string} the style hint for the result at the given index */ getstyleat: function(index) { if (!this._comments || !this._comments[index]) return null; // not a category label, so no special styling if (index == 0) return 'suggestfirst'; // category label on first line of results return 'suggesthint'; // category label on any other line of results }, /** * gets the image for the result at the given index * * @return {string} the uri to the image to display */ getimageat : function (index) { return ''; }, /** * get the final value that should be completed when the user confirms * the match at the given index.
...And 2 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
other encodings used different prefixes.
...for example, most sample links on the following test pages can be used without any further setting: http://www.nunames.nu/eu-lang-test.htm (domain names with latin 1 accented characters) http://www.nunames.nu/lldemo/default.htm (domain names in other languages) on july 10, 2003 and thereafter, you can access a large number of japanese domain name sites under the .jp top domain with no further setting on netscape 7.1/mozilla 1.4: http://mitsuketa-nihongo.jp race (row-based ascii compatible encoding) almost all idn registration data are expected to change to punycode by the end of 2003.
...japan as mentioned above, but others such as the ones under the .com and .net top domains may take longer.
...And 2 more matches
JavaScript-DOM Prototypes in Mozilla
one of these interfaces is nsidomhtmlimageelement, others are nsidomnshtmlimageelement (netscape extensions to the standard interface), nsidomeventtarget, nsidomeventlistener, nsidom3node, and so on.
...because of this, the following holds true (assuming img1 and img2 are two different image objects in the same document): img1.__proto__ === img2.__proto__ if img1 would come from one document and img2 from another document, then the above would not be true.
... another example would be modifying the pagex property of a mouseevent instance.
...And 2 more matches
Addon
the interface can represent many different kinds of add-ons and as such, some of the methods and properties are considered "required" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons.
...no other installed add-on will have the same id.
...for some add-ons this will change immediately based on the appdisabled and userdisabled properties; for others it will only change after an application restart.
...And 2 more matches
XPCOMUtils.jsm
otherwise, null is returned.
... remarks when you implement an interface that inherits from another one, you should generally list all the base interfaces explicitly, except for nsisupports.
...this lets modules bundled in a package load one another without having to hard-code full paths.
...And 2 more matches
Bootstrapping a new locale
if you are interested in localizing thunderbird 3, seamonkey 2 or other mozilla projects based on gecko 1.9.1 you'll need to follow the instructions on getting the source-code of the comm-central repository.
... 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 ...
...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/extensions/reporter/locales/chrome ab-cd/extensions cp -r mozilla-1.9.x/netwerk/locales/ ab-cd/netwerk cp -r mozilla-1.9.x/other-licenses/branding/firefox/locales/ ab-cd/other-licenses cp -r mozilla-1.9.x/security/manager/locales/ ab-cd/security cp -r mozilla-1.9.x/toolkit/locales/ ab-cd/toolkit getting started change your directory to the new working directory so you are in the ~/[your working directory]/[ab-cd]/ path and can start localizing.
...And 2 more matches
Localizing with Mercurial
the third command will do a clone of mozilla-central, and pull some other hg repositories.
... the other directories are required for seamonkey and thunderbird.
... to update your working copy of comm-central, go to your comm-central directory and run: python client.py checkout this will both get new changesets from comm-central, mozilla-central and the other appropriate locations and apply those changes in your working copy.
...And 2 more matches
Localizing with Mozilla Translator
getting started with mozillatranslator mt uses products as groups of localization files with a common root directory (for instance, you may have a product for thunderbird, other for seamonkey, other for dom, other for toolkit, etc.) you update your repository copy using your favorite repository tool, and then update the product(s) in mt.
...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''.
...besides that, you will need to create one tiny product for other-licenses/branding/firefox.
...And 2 more matches
Refcount tracing and balancing
post-processing step 2: filtering the log once you've picked an object that leaked, you can use tools/rb/filter-log.pl to filter the log file to drop the call stack for other objects; this process reduces the size of the log file and also improves the performance.
...the make-tree.pl script accepts an option --ignore-balanced, which tells it not to bother printing out the children of a node whose balance factor is zero.
... this can help remove some of the clutter from an otherwise noisy tree.
...And 2 more matches
TraceMalloc
the output is a large html file that hyperlinks ancestor and descendent libraries, classes, and functions that call into one another, attributing malloc blame up and down each graph.
...this example is for macos; small modifications are needed for other platforms.
...leaksoup also finds sets of objects that are rooted by a cycle (i.e., a set of reference counted objects that own references to each other in a cycle).
...And 2 more matches
tools/power/rapl
these are machine-wide estimates, so if you want to estimate the power consumption of a single program you should minimize other activity on the machine while measuring.
...otherwise, it will fail with an error message explaining this requirement.
... total w = _pkg_ (cores + _gpu_ + other) + _ram_ w #01 5.17 w = 1.78 ( 0.12 + 0.10 + 1.56) + 3.39 w #02 9.43 w = 5.44 ( 1.44 + 1.20 + 2.80) + 3.98 w #03 14.26 w = 10.21 ( 5.47 + 0.19 + 4.55) + 4.04 w #04 10.02 w = 6.15 ( 2.62 + 0.43 + 3.10) + 3.86 w #05 14.63 w = 10.43 ( 4.41 + 0.81 + 5.22) + 4.19 w #06 11.16 w = 6.90 ( 1.91 + 1.68 + 3.31) + 4.26 w #07 5.40 w = 1.97 ( 0.20 + 0.10 + 1.67) + 3.44 w #08 5.17 w = 1.76 ( 0.07 + 0.08 + 1.60) + 3.41 w #09 5.17 w = 1.76 ( 0.09 + 0.08 + 1.58) +...
...And 2 more matches
L20n Javascript API
ctx.localize(['hello', 'new'], function(l10n) { var node = document.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.classlist.remove('hidden'); }); ctx.registerlocales(defaultlocale: string?, availablelocales: array<string>?) register the default locale of the context instance, as well as all other locales available to the context instance before the language negotiation.
... ctx.registerlocales('en-us', ['ar', 'es-ar', 'es-es', 'en-us', 'fr', 'pl']); defaultlocale is the original language of the context instance and will be used as the last fallback locale if other locales are registered.
...n in one of supported locales; the context instance will try to retrieve a fallback translation from the next locale in the fallback chain, compiler.error, when l20n is unable to evaluate an entity to a string; there are two types of errors in this category: compiler.valueerror, when l20n can still try to use the literal source string of the entity as fallback, and compiler.indexerror otherwise.
...And 2 more matches
NSPR Contributor Guide
abstract: nspr accepts contributions in the form of bugfixes, new features, libraries, platform ports, documentation, test cases and other items from many sources.
...please do not contribute java, c or other language wrappers.
... generally useful platform abstractions you agree to sustain, bug fix may rely on the nspr api may not rely on any other library api new platform ports all nspr api items must be implemented platform specific headers in pr/include/md/_platformname.[h!cfg] platform specific code in pr/src/md/platform/*.c make rules in config/_platform.mk documentation the files for nspr's documentation are maintained using a proprietary word processing system [don't ask].
...And 2 more matches
Optimizing Applications For NSPR
this means that when the application using nspr is dispatched, a thread within that application will run until that thread voluntarily gives up control to another thread within the process.
...at thread switch time, the stack of the current running thread is copied to other storage associated with that thread and the about-to-be-dispatched thread's stack data is copied back onto the windows stack just before the thread is given control.
... this has disastrous implications on the generally accepted programming practice of taking the address of a stack variable and giving that address to another thread.
...And 2 more matches
NSS FAQ
MozillaProjectsNSSFAQ
it provides a complete open-source implementation of the crypto libraries used by mozilla and other companies in the firefox browser, aol instant messenger (aim), server products from red hat, and other products.
... if you want add support for ssl, s/mime, or other internet security standards to your application, you can use network security services (nss) to do so.
...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.
...And 2 more matches
Introduction to Network Security Services
network security services (nss) is a set of libraries designed to support cross-platform development of communications applications that support ssl, s/mime, and other internet security standards.
... these two extra shared libraries are not supplied on any other platforms.
...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.
...And 2 more matches
nss tech note3
certusagesslca ............... an intermediate or root ca cert allowed to issue ssl client or ssl server certs or other intermediate ssl ca certs.
... each of the above seccertusages translates into a required set of cert type and key usage for the certificate itself, and into another set of required cert type and key usage for all the ca certs in the cert chain.
...for other types of keys, it is key_agreement.
...And 2 more matches
NSS tools : certutil
name certutil — manage keys and certificate in both nss databases and other nss tokens synopsis certutil [options] [[arguments]] description the certificate database tool, certutil, is a command-line utility that can create and modify certificate and key databases.
...unless specified otherwise the default token is an internal slot.
...s: + p - valid peer + p - trusted peer (implies p) + c - valid ca + t - trusted ca to issue client certificates (implies c) + c - trusted ca to issue server certificates (ssl only) (implies c) + u - certificate can be used for authentication or signing + w - send warning (use with other attributes to include a warning when the certificate is used in that context) the attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks.
...And 2 more matches
NSS tools : modutil
the jar file uses the nss pkcs #11 jar format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation.
... modutil -list [modulename] -dbdir [sql:]directory listing the modules shows the module name, their status, and other associated security databases for certificates and keys.
...loaded slot: nss internal cryptographic services token: nss generic crypto services slot: nss user private key and certificate services token: nss certificate db ----------------------------------------------------------- passing a specific module name with the -list returns details information about the module itself, like supported cipher mechanisms, version numbers, serial numbers, and other information about the module and the token it is loaded on.
...And 2 more matches
sslintro.html
other apis that may be exposed in the header files are not supported for application use.
...must be called before any other nss functions.
...sets up configuration files and performs other tasks required to run network security services.
...And 2 more matches
NSS Tools ssltap
once this connection arrives, the tool makes another connection to the specified host name and port on the server side.
... syntax to run the ssl debugging tool, type this command in a command shell: ssltap [-vhfsxl] [-p port] hostname:port options the command does not require any options other than hostname:port, but you normally use them to control the connection interception and output.
... -p port change the default rendezvous port (1924) to another port.
...And 2 more matches
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
the jar file uses the nss pkcs #11 jar format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation.
... modutil -list [modulename] -dbdir [sql:]directory listing the modules shows the module name, their status, and other associated security databases for certificates and keys.
...graphic services token: nss generic crypto services slot: nss user private key and certificate services token: nss certificate db ----------------------------------------------------------- passing a specific module name with the -list returns details information about the module itself, like supported cipher mechanisms, version numbers, serial numbers, and other information about the module and the token it is loaded on.
...And 2 more matches
Necko walkthrough
there is an option to receive ondataavailable specifically on a non-main thread, but all other calls happen on the main thread.
... then in necko http code (still on the main thread for now): nshttpchannel::asyncopen nshttpchannel::beginconnect() creates nshttpconnectioninfo object for the channel checks if we're proxying or not fires off the dns prefetch request (dispatched to dns thread pool) some other things nshttpchannel::connect might to a speculativeconnect (pre open tcp socket) nshttpchannel::continueconnect some cache stuff nshttpchannel::setuptransaction creates new nshttptransaction, and inits it with mrequesthead (the request headers) and muploadstream (which was created from the request data in channel setup) gets an nsiasyncinputstream (for the response; corresponds to the nspipeinputstream for the response stream pipe) passes it to nsinputstreampump...
... nspipeinputstream::asyncwait sets the callback to be used later for a response if a target is specified (in this case, the main thread), 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.
...And 2 more matches
Scripting Java
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.
... another useful feature for exploratory programming is the ability to see all the methods and fields defined for an object.
... using the javascript for..in construct, we can print out all these values: js> for (i in f) { print(i) } exists parentfile mkdir tostring wait [44 others] note that not only the methods of the file class are listed, but also the methods inherited from the base class java.lang.object (like wait).
...And 2 more matches
GCIntegration - SpiderMonkey Redirect 1
it's safe for js objects to point to other js objects or to c++ objects.
...many other xpconnect pointers are also traced in this way.
...at the end of the gc, if the pointer refers to an object that is not reachable via some other path, then it will be nulled out or dropped in some way.
...And 2 more matches
JSClass.flags
an object obj that emulates undefined behaves like any other object, except in the following ways: typeof obj === "undefined" obj converts to false when obj is converted to a boolean when used in boolean contexts (if conditions, loop continuation/termination conditions [for/while/do { } while], the condition in a ternary ?: expression, and so on) (obj == undefined) is true, and (obj != undefined) is false (obj == null) is true, an...
...d (obj != null) is false == and != comparisons to values other than null or undefined (including to an object that emulates undefined) are unaffected by this flag.
... constructors or prototypes (such as function.prototype.) objects that can end up with the wrong prototype object, if this flag is not present, include: arguments objects (ecma 262-3 §10.1.8 specifies "the original object prototype"), function objects (ecma 262-3 §13.2 specifies "the original function prototype"), and objects created by many standard constructors (ecma 262-3 §15.4.2.1 and others).
...And 2 more matches
JS_ClearContextThread
transfer a jscontext from one thread to another.
... syntax jsword js_clearcontextthread(jscontext *cx); jsword js_setcontextthread(jscontext *cx); name type description cx jscontext * the context to transfer from one thread to another.
... description an application that creates or uses a jscontext in one thread, then uses or destroys it in another thread, must use js_clearcontextthread and js_setcontextthread to transfer the jscontext safely from one thread to the other.
...And 2 more matches
JS_GetParent
such an object should not be passed to any other jsapi function that could expose it to script code.
...otherwise, the parent is implementation-defined.
...otherwise, if the context is running any scripts or functions, a default parent object is selected based on those.
...And 2 more matches
JS_MakeStringImmutable
description a string's characters can never be changed, but spidermonkey uses two string optimization techniques behind the scenes: a growable string (see js_newgrowablestring ) has a buffer that the javascript engine can reallocate so that concatenating it with another string is much faster.
... a dependent string (see js_newdependentstring) is a substring of another (growable, dependent, or immutable) string.
... in memory it is represented as a pointer to the other string and a pair of integers for the substring's starting point and length, rather than as a separate copy of all the characters.
...And 2 more matches
JS_SetGCCallback
but even if the callback returns true, the garbage collector may determine that gc is not necessary, in which case the other three callbacks are skipped.
...sometimes jsgc_begin happens and the rest of garbage collection does not happen, so the other three callbacks are not called.
...if a thread that is not in an active request calls js_gc while gc is already happening on another thread).
...And 2 more matches
SpiderMonkey 1.8.5
on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
...multithreaded programs are allowed, but each thread must operate on objects in a separate compartment, isolated from the other threads.
... these and other changes are explained in detail below.
...And 2 more matches
imgIContainer
it provides access to frames as thebes surfaces and lets users extract subregions as other imgicontainer objects.
...create and return a new copy of the current frame that you can write to and otherwise inspect the pixels of.
...return value missing description exceptions thrown missing exception missing description native code only!copyframe create and return a new copy of the given frame that you can write to and otherwise inspect the pixels of.
...And 2 more matches
mozIAsyncFavicons
if auri is not null, the other parameters may contain the favicon data.
...set to nsifaviconservice.favicon_load_non_private otherwise acallback optional once we're done setting and/or fetching the favicon, we invoke this callback.
... replacefavicondata() sets the data for a given favicon uri either by replacing existing data in the database or taking the place of otherwise fetched icon data when calling setandfetchfaviconforpage later.
...And 2 more matches
nsIAuthInformation
otherwise, this will be a string such as "basic" or "digest".
... domain astring the initial value should be used to prefill the dialog or be shown in some other way to the user.
... password astring the initial value should be used to prefill the dialog or be shown in some other way to the user.
...And 2 more matches
nsIDOMNSHTMLDocument
return value true if the command was recognized, false otherwise.
... return value returns true if the command is supported and enabled, false otherwise.
... return value for stateful commands, returns true if the command is in an indeterminate state, false otherwise.
...And 2 more matches
nsIEditorSpellCheck
if the current dictionary is no longer available, pick another dictionary.
...boolean checkcurrentword( in wstring suggestedword ); parameters suggestedword missing description return value true if the specified word is misspelled; otherwise false.
... return value true if the word is misspelled; otherwise false.
...And 2 more matches
nsIEffectiveTLDService
depends who you ask - for some people it is, others not.
... ns_error_unexpected or other error returned by nsiidnservice.normalize() when the hostname contains characters disallowed in uris.
...otherwise identical to getbasedomain().
...And 2 more matches
nsIFaviconService
unlike the other get functions, we needn't have heard of the page or its favicon: the default one will be returned in this case.
...this should be determined via privatebrowsingutils.iswindowprivate(somerelatedwindow) if the favicon may expose the user's private browsing data by performing a network request, otherwise favicon_load_non_private may be used.
...those pages will keep the old icon until they have been refreshed by other means.
...And 2 more matches
nsIFocusManager
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() move the focus to another element.
...And 2 more matches
nsIInputStream
a non-blocking input stream, on the other hand, must not block the calling thread of execution.
... note: some nsiinputstream implementations automatically close() when end-of-file is reached; others do not.
... exceptions thrown <other-error> if the stream is closed due to some error condition.
...And 2 more matches
nsIJSID
method overview boolean equals(in nsijsid other); const nsid* getid(); violates the xpcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only.
... methods equals() this method determines if this nsijsid has the same nsid as another nsijsid.
... boolean equals( in nsijsid other ); parameters other the other nsijsid to compare to.
...And 2 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.
... viewflags other flags to be used.
... viewflags other flags to be used.
...And 2 more matches
nsIPromptService
its methods should be used in privileged code instead of dom window.alert, window.confirm, and other similar functions.
...otherwise, the parameter's value is unmodified.
...otherwise, the parameter's value is unmodified.
...And 2 more matches
nsIProtocolProxyService
otherwise, this method returns null indicating that a direct connection should be used.
...otherwise, the consumer may choose to treat the result as type "direct" if desired.
...other string values may be possible, and new types may be defined by a future version of this interface.
...And 2 more matches
nsIAbCard/Thunderbird3
same as home, but with `work' instead of `home' other contact: faxnumber, faxnumbertype pagernumber, pagernumbertype cellularnumber, cellularnumbertype jobtitle, department, company _aimscreenname dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate p...
... the non-variant functions are marked [noscript] since xpconnect uses magic with nsivariant such that the other functions are not needed, although c++ does need them.
... copy() this function will copy all values from one card to another.
...And 2 more matches
Xptcall Porting Status
he is hoping that others will help test the changes using these two compilers on the various platforms where this same code is used.
...currently the code is dependent on the g++ name mangling convention and a few gnu extensions so i'm not sure how useful it will be for the other systems.
... <font color="white">done</font> beos x86 duncan wilcox <duncan@be.com> unix (yet another reuse of the linux 86 code!) duncan says this is all working.
...And 2 more matches
Using the Multiple Accounts API
relevant api calls: nsimsgaccount nsimsgaccountmanager.createaccount() nsimsgaccount nsimsgaccountmanager.getaccount(in string key) nsimsgincomingserver nsimsgaccountmanager.createincomingserver(in string type) nsimsgincomingserver nsimsgaccountmanager.getincomingserver(in string key) smtp servers smtp servers are kept separately from all the other account management stuff.
... appendix a: listing of all properties (when brendan's idldoc comes along, i'll just link to that) all preferences are strings, unless otherwise noted.
...imeout - integer, number of minutes a connection is idle before we drop it preference: mail.server.server.capability - list of capabilities of this server preference: mail.server.server.namespace.public - the server's namespace for public folders preference: mail.server.server.namespace.personal - the server's namespace for personal folders preference: mail.server.server.namespace.other_users - the server's namespace for other user's folders the following are specific to pop: the following are specific to news: preference: mail.server.server.leave_on_server - boolean, should we leave messages on the server after we have downloaded them?
...And 2 more matches
Declaring types
types are declared in terms of other, already defined types.
...these are all primitive types, upon which all other types are eventually based.
...: ctypes.int }, { "tm_hour": ctypes.int }, { "tm_mday": ctypes.int }, { "tm_mon": ctypes.int }, { "tm_year": ctypes.int }, { "tm_wday": ctypes.int }, { "tm_yday": ctypes.int }, { "tm_isdst": ctypes.int } ]); to find other types see here: predefined types - primitive types.
...And 2 more matches
Scripting plugins - Plugins
future revisions to this api might provide a mechanism for proxying calls from one thread to another to aid in using this api from other threads.
...that means that a script from an origin other than the origin of the page that loaded the plugin is not able to access methods and properties on the plugin.
... the same thing applies the other way too; the plugin can reach only javascript objects in the same origin as the page that loaded the plugin.
...And 2 more matches
Plugins
important: plugins are a legacy technology that are a security and performance problem for firefox (and other browser) users.
...new content should not be written using flash or any other plugin technology.
... roadmap plugin roadmap information about the roadmap for adobe flash and other plugin support in firefox.
...And 2 more matches
Debugger-API - Firefox Developer Tools
the debugger interface mozilla’s javascript engine, spidermonkey, provides a debugging interface named debugger which lets javascript code observe and manipulate the execution of other javascript code.
...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.
...given a debugger.script, one can set breakpoints, translate between source positions and bytecode offsets (a deviation from the “source level” design principle), and find other static characteristics of the code.
...And 2 more matches
Dominators - Firefox Developer Tools
these concepts matter in memory analysis, because often an object may itself be small, but may hold references to other much larger objects, and by doing this will prevent the garbage collector from freeing that extra memory.
...each node in the graph represents an object, and each connection between nodes (edge) represents a reference from one object to another.
... 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 no other objects reference them: conversely, this means that objects are kept alive as long as some other reachable object is holding a reference to them.
...And 2 more matches
Migrating from Firebug - Firefox Developer Tools
the devtools' activation on the other hand is tab based.
...when you switch to another tab, though, they're closed.
...the developer tools command line has some functions in common, but also has some other functions and misses others.
...And 2 more matches
about:debugging - Firefox Developer Tools
service workers, shared workers, and other workers there are three sections on this page that deal with service workers, shared workers, and other workers.
... other information about the extension is displayed: location the location of the extension's source code on your local system.
... for other changes, click the reload button.
...And 2 more matches
AudioNode.connect() - Web APIs
WebAPIAudioNodeconnect
the connect() method of the audionode interface lets you connect one of the node's outputs to a target, which may be either another audionode (thereby directing the sound data to the specified node) or an audioparam, so that the node's output data is automatically used to change the value of that parameter over time.
...it is possible to connect an audionode to another audionode, which in turn connects back to the first audionode, creating a cycle.
...otherwise, a notsupportederror exception is thrown.
...And 2 more matches
Blob - Web APIs
WebAPIBlob
using blobs to construct a blob from other non-blob objects and data, use the blob() constructor.
... to create a blob that contains a subset of another blob's data, use the slice() method.
... examples creating a blob the blob() constructor can create blobs from other objects.
...And 2 more matches
Using the CSS Typed Object Model - Web APIs
in other browsers, you'll just see a link.
... csskeywordvalue is a class that defines keywords like inherit, initial, unset, and other strings you don't quote, such as auto and grid.
... there are other types available: an <image> will return a cssimagevalue.
...And 2 more matches
CSS Typed Object Model API - Web APIs
csskeywordvalue serialization the csskeywordvalue interface of the the css typed object model api creates an object to represent css keywords and other identifiers.
... csskeywordvalue.csskeywordvalue() constructor constructor creates a new csskeywordvalue.csskeywordvalue() object which represents css keywords and other identifiers.
... csskeywordvalue an interface which creates an object to represent css keywords and other identifiers.
...And 2 more matches
console - Web APIs
WebAPIConsole
console.group() creates a new inline group, indenting all following output by another level.
... console.groupcollapsed() creates a new inline group, indenting all following output by another level.
... examples outputting text to the console the most frequently-used feature of the console is logging of text and other data.
...And 2 more matches
Constraint validation API - Web APIs
extensions to other interfaces the constraint validation api extends the interfaces for the form-associated elements listed below with a number of new properties and methods (elements that can have a form attribute that indicates their form owner): htmlbuttonelement htmlfieldsetelement htmlinputelement htmlobjectelement htmloutputelement htmlselectelement htmltextareaelement properties validity a rea...
... willvalidate a read-only boolean property that returns true if the element is a candidate for constraint validation; and false otherwise.
...others may be barred from constraint validation depending on specific conditions.
...And 2 more matches
DOMMatrixReadOnly - Web APIs
the identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).
...(in other words, down the first column from top to bottom, then the second column, and so forth.) dommatrixreadonly.tofloat64array() returns a new float64array containing all 16 elements (m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44) which comprise the matrix.
...(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.
...And 2 more matches
DirectoryEntrySync - Web APIs
create: true exclusive: false path doesn't exist and no other error occurs a file is created.
...you cannot create another one with the same path.
... create: true exclusive: false path doesn't exist and no other error occurs a directory is created.
...And 2 more matches
Document - Web APIs
WebAPIDocument
the dom tree includes elements such as <body> and <table>, among many others.
...note that this is currently only implemented by chrome; other browsers still implement them directly on the document interface.
...null if lock is pending, pointer is unlocked, or if the target is in another document.
...And 2 more matches
Element: mousewheel event - Web APIs
if the wheel has rotated away from the user, it's positive, otherwise negative.
...otherwise, i.e., if it's to left, the value is positive.
...this is really different from other browsers except chrome with continuous scroll supported device.
...And 2 more matches
Guide to the Fullscreen API - Web APIs
webkit doesn't do this; instead, it centers the fullscreen element at the same size in a screen that's otherwise black.
... to get the same fullscreen behavior in webkit, you need to add your own "width: 100%; height: 100%;" css rules to the element yourself: #myvideo:-webkit-full-screen { width: 100%; height: 100%; } on the other hand, if you're trying to emulate webkit's behavior on gecko, you need to place the element you want to present inside another element, which you'll make fullscreen instead, and use css rules to adjust the inner element to match the appearance you want.
... note: fullscreen requests need to be called from within an event handler or otherwise they will be denied.
...And 2 more matches
HTMLImageElement.alt - Web APIs
perhaps the most important reason to use the alt tag is to support accessibility, as the alt text may be used by screen readers and other assistive technologies to help differently-abled users make full use of your content.
...otherwise, readers will find it open by default, which is not the intent here.
...in other words, it should be the same text you would use in a textual button to serve the same purpose.
...And 2 more matches
HTMLImageElement.srcset - Web APIs
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 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".
...And 2 more matches
RTCIceCandidatePairStats - Web APIs
this does not take into account the size of the ip overhead, nor any other transport layers such as tcp or udp.
...this does not take into account the size of the ip overhead, nor any other transport layers such as tcp or udp.
... bytesreceieved optional the total number of payload bytes received (that is, the total number of bytes received minus any headers, padding, or other administrative overhead) on this candidate pair so far.
...And 2 more matches
Range - Web APIs
WebAPIRange
range.setstartbefore() sets the start position of a range relative to another node.
... range.setstartafter() sets the start position of a range relative to another node.
... range.setendbefore() sets the end position of a range relative to another node.
...And 2 more matches
SVGSVGElement - Web APIs
if no parent element exists (i.e., <svg> element represents the root of the document tree), if this svg document is embedded as part of another document (e.g., via the html <object> element), then the position and size are unitless values in the coordinate system of the parent document.
...when the browser actually knows the physical size of a "screen unit", this float attribute will express that information; otherwise, user agents will provide a suitable default value (such as .28mm).
... svgsvgelement.usecurrentview the initial view (i.e., before magnification and panning) of the current innermost svg document fragment can be either the "standard" view, i.e., based on attributes on the <svg> element such as viewbox) or on a "custom" view (i.e., a hyperlink into a particular <view> or other element).
...And 2 more matches
Using Service Workers - Web APIs
the below graphic shows a summary of the available service worker events: promises promises are a great mechanism for running async operations, with success dependant on one another.
...if you just passed in the url, and then tried to access the other items in the json separately when the for() loop is being iterated through later on, it wouldn’t work, as the promise wouldn’t resolve at the same time as the iterations are being done (that is a synchronous process.) we actually resolve the promise with an array, as we want to make the loaded image blob available to the resolving function later on in the code, but also the image name, credi...
... let’s look at a few other options we have when defining our magic (see our fetch api documentation for more information about request and response objects.) the response() constructor allows you to create a custom response.
...And 2 more matches
Storage API - Web APIs
the storage api gives sites' code the ability to find out how much space they can use, how much they are already using, and even control whether or not they need to be alerted before the user agent disposes of site data in order to make room for other things.
... site storage—the data stored for a web site which is managed by the storage standard—includes: indexeddb databases cache api data service worker registrations web storage api data managed using window.localstorage history state information saved using history.pushstate() application caches notification data other kinds of site-accessible, site-specific data that may be maintained site storage units the site storage system described by the storage standard and interacted with using the storage api consists of a single site storage unit for each origin.
...this origin, however, has a lower quota than the other two do.
...And 2 more matches
Streams API concepts - Web APIs
the reader plus the other processing code that goes along with it is called a consumer.
...if you want another reader to start reading your stream, you typically need to cancel the first reader before you do anything else (although you can tee streams, see the teeing section below) note that there are two different types of readable stream.
... as well as the conventional readable stream there is a type called a byte stream — this is an extended version of a conventional stream for reading underlying byte sources (otherwise known as byob, or “bring your own buffer”) sources.
...And 2 more matches
Using readable streams - Web APIs
this is done using the readablestream.getreader() method: // fetch the original image fetch('./tortoise.png') // retrieve its body as readablestream .then(response => response.body) .then(body => { const reader = body.getreader(); invoking this method creates a reader and locks it to the stream — no other reader may read this stream until this reader is released, e.g.
... creating your own custom readable stream the simple stream pump example we’ve been studying throughout this article includes a second part — once we’ve read the image from the fetch body in chunks, we then enqueue them into another, custom stream of our own creation.
...beginning generation of data or otherwise getting access to the source.
...And 2 more matches
SubtleCrypto.verify() - Web APIs
return value result is a promise that fulfills with a boolean: true if the signature is valid, false otherwise.
...* otherwise set the "invalid" class.
...* otherwise set the "invalid" class.
...And 2 more matches
WebGL best practices - Web APIs
_viewport_dims: [4096,4096] max_vertex_texture_image_units: 4 max_texture_image_units: 8 max_combined_texture_image_units: 8 max_vertex_attribs: 16 max_varying_vectors: 8 max_vertex_uniform_vectors: 128 max_fragment_uniform_vectors: 64 aliased_point_size_range: [1,100] your desktop may support 16k textures, or maybe 16 texture units in the vertex shader, but most other systems don't, and content that works for you will not work for them!
... getshader/programparameter(), getshader/programinfolog(), other gets on shaders/programs: flush + shader compile + round-trip, if not done after shader compilation is complete.
... another important method for batching is texture atlasing, where multiple images are placed into a single texture, often like a checkerboard.
...And 2 more matches
WebGL model view projection - Web APIs
glprogram = mdn.createwebglprogramfromids(gl, 'vertex-shader', 'fragment-shader'); gl.useprogram(this.webglprogram); // save the attribute and uniform locations this.positionlocation = gl.getattriblocation(this.webglprogram, 'position'); this.colorlocation = gl.getuniformlocation(this.webglprogram, 'color'); // tell webgl to test the depth when drawing, so if a square is behind // another square it won't be drawn gl.enable(gl.depth_test); } webglbox draw now we'll create a method to draw a box on the screen.
...the value of w is used as a divisor for the other components of the coordinate, so that the true values of x, y, and z are computed as x/w, y/w, and z/w (and w is then also w/w, becoming 1).
...so most of the time, you need to transform the model data and other coordinates into clip space.
...And 2 more matches
A simple RTCDataChannel sample - Web APIs
we'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a remote computer for another example.
... note: even though both ends of our connection will be on the same page, we're going to refer to the one that starts the connection as the "local" one, and to the other as the "remote" end.
... set up the ice candidates the next step is to set up each connection with ice candidate listeners; these will be called when there's a new ice candidate to tell the other side about.
...And 2 more matches
Using WebRTC data channels - Web APIs
write your own code to negotiate the data transport and write your own code to signal to the other peer that it needs to connect to the new channel.
... then negotiate the connection out-of-band, using a web server or other means.
...this feature requires that each piece of the message have consecutive sequence numbers, so they have to be transmitted one after another, without any other data interleaved between them.
...And 2 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
dependencies while we will not rely upon any 3d graphics frameworks such as three.js or the like for this example, we do use the glmatrix library for matrix math, which we've used in other examples in the past.
... if we already have an ongoing session, on the other hand, we call its end() method to stop the session.
...otherwise, we create from the orientation changes in mousepitch and mouseyaw a quaternion specifying the inverse of that orientation, so that applying the inverseorientation to the cube will correctly appear to reflect the viewer's movement.
...And 2 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
one will change the tone and the other will change how the pulse modulates the first wave: <label for="hz">hz</label> <input name="hz" id="hz" type="range" min="660" max="1320" value="880" step="1" /> <label for="lfo">lfo</label> <input name="lfo" id="lfo" type="range" min="20" max="40" value="30" step="1" /> as before, we'll vary the parameters when the range input values are changed by the user.
...in floating point audio, 1 is a convenient number to map to "full scale" for mathematical operations on signals, so oscillators, noise generators and other sound sources typically output bipolar signals in the range -1 to 1.
... let's create another async function to set up the sample — we can combine the two async functions in a nice promise pattern to perform further actions when this file is loaded and buffered: async function setupsample() { const filepath = 'dtmf.mp3'; const sample = await getfile(audioctx, filepath); return sample; } note: you can easily modify the above function to take an array of files and loop over...
...And 2 more matches
Basic concepts behind Web Audio API - Web APIs
audio data: what's in a sample when an audio signal is processed, sampling means the conversion of a continuous signal to a discrete signal; or put another way, a continuous sound wave, such as a band playing live, is converted to a sequence of samples (a discrete-time signal) that allow a computer to handle the audio in distinct blocks.
... secondly, signals must be low-pass filtered before sampling, otherwise aliasing occurs.
...all the others (l, r, lfe, sl, and sr) are silent.
...And 2 more matches
Migrating from webkitAudioContext - Web APIs
(audiobuffersourcenode has yet another way of starting output: the notegrainon() method.) the noteon()/notegrainon()/noteoff() methods were the original way to start/stop output in these nodes, and in the newer versions of the specification, the noteon() and notegrainon() methods were consolidated into a single start() method, and the noteoff() method was renamed to the stop() method.
... 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.
... code using the activesourcecount attribute of the audiocontext, like this snippet: var src0 = context.createbuffersource(); var src1 = context.createbuffersource(); // set buffers and other parameters...
...And 2 more matches
Window - Web APIs
WebAPIWindow
window.postmessage() provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first.
... window.setimmediate() executes a function after the browser has finished other heavy tasks window.setresizable() toggles a user's ability to resize a window.
... storage fired when a storage area (localstorage or sessionstorage) has been modified in the context of another document.
...And 2 more matches
XRPose.emulatedPosition - Web APIs
the emulatedposition read-only attribute of the xrpose interface is a boolean value indicating whether or not both the the position component of the pose's transform is directly taken from the xr device, or it's simulated or computed based on other sources.
... syntax let emulated = xrpose.emulatedposition; value a boolean which is true if the pose's position is computed based on estimates or is derived from sources other than direct sensor data.
...any such data is taken from other sources, such as keyboard or mouse inputs or game controllers.
...And 2 more matches
ARIA: article role - Accessibility
it is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page.
... <div role="article"> <h2>heading of the segment</h2> <p>paragraph for the segment.</p> <p>another paragraph.</p> ...
... <article> <h2>heading of the segment</h2> <p>paragraph for the segment.</p> <p>another paragraph.</p> ...
...And 2 more matches
ARIA: dialog role - Accessibility
in other words, the dialog's label acts like a grouping label for the controls inside it (similar to how a <legend> element provides a grouping label for the controls inside a <fieldset> element).
...in addition to the needed control, dialogs can contain any number of focusable elements, even entire forms or other container widgets like tabs.
...otherwise the focus can be dropped to the beginning of the page.
...And 2 more matches
ARIA: listbox role - Accessibility
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.
... ids listed here cannot also be listed in aria-owns attributes of any other elements.
... aria-readonly the user cannot change which options are selected or unselected, but the listbox is otherwise operable.
...And 2 more matches
Accessibility Information for Web Authors - Accessibility
other organizations such as schools are starting to follow these guidelines as well.
... web content accessibility guidelines (wcag) 1.0 another important set of guidelines from the w3c web accessibility initiative (wai).
... dive into accessibility by mark pilgrim an excellent, easy-to-understand resource (available in english and in 9 other languages) on accessible website authoring, which goes into greater depth.
...And 2 more matches
Operable - Accessibility
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.
...live multiplayer games), and any other activity that requires a time limit and would be invalidated if it were turned off.
... 2.2.2 pausing, stopping, hiding (a) for moving/blinking content that starts automatically, lasts longer than 5 seconds, and is shown alongside other content, controls should be provided to pause, stop, or hide it.
...And 2 more matches
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.
... examples the title for the reference article about the <title> element is as follows: <title>&lt;title&gt;: the document title element - html: hypertext markup language</title> another example might look like so: <title>fill in your details to register — mygov services</title> to help the user, you can update the page title value to reflect significant page state changes (such as form validation problems): <title>2 errors — fill in your details to register — mygov services</title> see also <title> embedded content must be labeled make sure that elements that emb...
... <figure> <img src="milkweed.jgp" alt="black and white close-up photo of milkweed flowers"> <figcaption>asclepias verticillata</figcaption> </figure> fieldset elements must be labeled fieldset elements must have a text description, similar to other form elements.
...And 2 more matches
@supports - CSS: Cascading Style Sheets
WebCSS@supports
the rule may be placed at the top level of your code or nested inside any other conditional group at-rule.
...to combine it with other operators, like and and or, the parentheses are required.
...otherwise, the condition is invalid and the whole rule is ignored.
...And 2 more matches
Ordering Flex Items - CSS: Cascading Style Sheets
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.
...h a warning not to use reordering to fix issues in your source: “authors must not use order or the *-reverse values of flex-flow/flex-direction as a substitute for correct source ordering, as that can ruin the accessibility of the document.” note: for some years firefox had a bug whereby it would attempt to follow the visual order and not the source order, making it behave differently to other browsers.
...And 2 more matches
Using CSS gradients - CSS: Cascading Style Sheets
if you leave a location unspecified, the position of that particular color stop will be automatically calculated for you, with the first color stop being at 0% and the last color stop being at 100%, and any other color stops being half way between their adjacent color stops.
... <div class="layered-image"></div> div { width: 300px; height: 150px; } .layered-image { background: linear-gradient(to right, transparent, mistyrose), url("https://mdn.mozillademos.org/files/15525/critters.png"); } stacked gradients you can even stack gradients with other gradients.
... <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.
...And 2 more matches
Privacy and the :visited selector - CSS: Cascading Style Sheets
this was done through window.getcomputedstyle and other techniques.
... 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.
...only the following styles can be applied to visited links: color background-color border-color (and its sub-properties) column-rule-color outline-color the color parts of the fill and stroke attributes in addition, even for the above styles, you won't be able to change the transparency between unvisited and visited links, as you otherwise would be able to using rgba(), hsla(), or the transparent keyword.
...And 2 more matches
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
this is very much like specifying a specific width and height, since once you have one dimension and a ratio, the other dimension is implied, but it's still a useful example.
...in other words, the image will always get stretched to the dimensions you specify, regardless of whether or not the source image has specified its dimensions and/or aspect ratio.
...contain, on the other hand, makes the image as large as possible while not being clipped by the background area.
...And 2 more matches
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
custom properties allow a value to be stored in one place, then referenced in multiple other places.
...for example, --main-text-color is easier to understand than #00ff00, especially if this same color is also used in other contexts.
...like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } note that the selector given to the ruleset defines the scope that the custom property can be used in.
...And 2 more matches
align-content - CSS: Cascading Style Sheets
gn-content: stretch; /* distribute items evenly stretch 'auto'-sized items to fit the container */ /* overflow alignment */ align-content: safe center; align-content: unsafe center; /* global values */ align-content: inherit; align-content: initial; align-content: unset; values start the items are packed flush to each other against the start edge of the alignment container in the cross axis.
... end the items are packed flush to each other against the end edge of the alignment container in the cross axis.
... flex-start the items are packed flush to each other against the edge of the alignment container depending on the flex container's cross-start side.
...And 2 more matches
conic-gradient() - CSS: Cascading Style Sheets
its concrete size will match the size of the element it applies to, or size of the <image> is set to something other than the element size.
...for this reason, conic-gradient() won't work on background-color and other properties that use the <color> data type.
...if the color stops are much lighter on one side than the other, it can look like a cone from above.
...And 2 more matches
cross-fade() - CSS: Cascading Style Sheets
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.
... in the simplest case, two images are faded between each other.
... to do that, only one of the images needs to have a percentage, the other one will be faded accordingly.
...And 2 more matches
filter - CSS: Cascading Style Sheets
WebCSSfilter
if one filter is none, it is replaced with the filter functions list of the other one using the filter function default values, then all filter functions are interpolated according to their specific rules.
... otherwise, discrete interpolation is used.
...the value of radius defines the value of the standard deviation to the gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur.
...And 2 more matches
image-rendering - CSS: Cascading Style Sheets
the property applies to an element itself, to any images set in its other properties, and to its descendants.
... the user agent will scale an image when the page author specifies dimensions other than its natural size.
...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.
...And 2 more matches
min() - CSS: Cascading Style Sheets
WebCSSmin
in other words, the maximum width is 200px.
... the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>).
... it is permitted to nest max() and other min() functions as expression values.
...And 2 more matches
visibility - CSS: Cascading Style Sheets
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.
... 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.
...And 2 more matches
CSS: Cascading Style Sheets
WebCSS
css describes how elements should be rendered on screen, on paper, in speech, or on other media.
... css first steps css (cascading style sheets) is used to style and layout web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
...here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features.
...And 2 more matches
Setting up adaptive streaming media sources - Developer guides
the mpd file tells the browser where the various pieces of media are located, it also includes meta data such as mimetype and codecs and there are other details such as byte-ranges in there too - it is an xml document and in many cases will be generated for you.
... other reasons to use live profile over ondemand for vod content may be: your client or server does not support range requests your server cannot cache range requests efficiently your server cannot prefetch range requests efficiently the sidx* is large and having to load it first slows down startup a little you want to use the original files for both dash and other forms of delivery (such as microsoft smooth streaming) as a transition strategy you can use the same media files for both live transmission and vod at a later s...
...tage *sidx or segmentindexbox is a structure describing a segment by giving its earliest presentation time and other meta-data and can often make up a large portion of the mpd file.
...And 2 more matches
Content categories - Developer guides
main content categories metadata content elements belonging to the metadata content category modify the presentation or the behavior of the rest of the document, set up links to other documents, or convey other out of band information.
... a few other elements belong to this category, but only if a specific condition is fulfilled: <area>, if it is a descendant of a <map> element <link>, if the itemprop attribute is present <meta>, if the itemprop attribute is present <style>, if the scoped attribute is present sectioning content elements belonging to the sectioning content model create a section in the current outline that defines th...
... a few other elements belong to this category, but only if a specific condition is fulfilled: <a>, if it contains only phrasing content <area>, if it is a descendant of a <map> element <del>, if it contains only phrasing content <ins>, if it contains only phrasing content <link>, if the itemprop attribute is present <map>, if it contains only phrasing content <meta>, if the itemprop attribute is pres...
...And 2 more matches
HTML5 - Developer guides
WebGuideHTMLHTML5
webrtc this technology, where rtc stands for real-time communication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application.
...most others have offline resource support at some level.
... webrtc this technology, where rtc stands for real-time communication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application.
...And 2 more matches
Index - Developer guides
WebGuideIndex
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.
... 7 adding captions and subtitles to html5 video html5, media, webvtt, captions, subtitles, track in other articles we looked at how to build a cross browser video player using the htmlmediaelement and window.fullscreen apis, and also at how to style the player.
...this article discusses how to build a buffer/seek bar using timeranges, and other features of the media api.
...And 2 more matches
User input and controls - Developer guides
for devices providing a mouse/touchpad as a pointing method, the pointer lock api helps you in implementing a first person 3d game or other applications requiring full control of the pointing device.
...when screen orientation matters for your application, through the screen orientation api you can read the screen orientation state and perform other actions.
...a pointer can be any point of contact on the screen made by a mouse cursor, pen, touch (including multi-touch), or other pointing input device.
...And 2 more matches
Date and time formats used in HTML - HTML: Hypertext Markup Language
while user interfaces may allow entry of dates using other calendars, the underlying value always uses the gregorian calendar.
... a year has 53 weeks if: the first day of the calendar year (january 1) is a thursday or the first day of the year (january 1) is a wednesday and the year is a leap year all other years have 52 weeks.
...the minute may optionally be followed by another colon and a two-digit number of seconds.
...And 2 more matches
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
unlike other browsers, firefox by default persists the dynamic checked state of an <input> across page loads.
...if the value is not otherwise specified, it is the string on by default.
...let's now look at the other common radio-button-related features and techniques you may need to know about.
...And 2 more matches
Standard metadata names - HTML: Hypertext Markup Language
WebHTMLElementmetaname
origin-when-cross-origin send the full url (stripped of parameters) for same-origin requests, but only send the origin for other cases.
...otherwise, send no referrer.
... standard metadata names defined in other specifications the css color adjustment specification defines the following metadata name: color-scheme: specifies one or more color schemes with which the document is compatible.
...And 2 more matches
Configuring servers for Ogg media - HTTP
html <audio> and <video> elements allow media presentation without the need for the user to install any plug-ins or other software to do so.
...this information may also be useful if you encounter other media types your server isn't already configured to recognize.
...it must return 206: partial content to all byte range requests; otherwise, browsers can't be sure you actually support byte range requests.
...And 2 more matches
HTTP response status codes - HTTP
WebHTTPStatus
it is intended for cases where another process or server handles the request, or for batch processing.
...this is mostly used for mirrors or backups of another resource.
... 303 see other the server sent this response to direct the client to get the requested resource at another uri with a get request.
...And 2 more matches
Equality comparisons and sameness - JavaScript
here 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).
...neither value is implicitly converted to some other value before being compared.
...strict equality treats nan as unequal to every other value -- including itself.
...And 2 more matches
Control flow and error handling - JavaScript
in other words, block statements do not define a scope.
...otherwise, statement_2 is executed.
...g misread as "x == y" if (x = y) { /* statements here */ } if you need to use an assignment in a conditional expression, a common practice is to put additional parentheses around the assignment, like this: if ((x = y)) { /* statements here */ } falsy values the following values evaluate to false (also known as falsy values): false undefined null 0 nan the empty string ("") all other values—including all objects—evaluate to true when passed to a conditional statement.
...And 2 more matches
Regular expressions - JavaScript
use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user input.
... assertions assertions include boundaries, which indicate the beginnings and endings of lines and words, and other patterns indicating in some way that a match is possible (including look-ahead, look-behind, and conditional expressions).
... similarly, if you're writing a regular expression literal and need to match a slash ("/"), you need to escape that (otherwise, it terminates the pattern).
...And 2 more matches
JavaScript technologies overview - JavaScript
one of them is the core language (ecmascript), another is the collection of the web apis, including the dom (document object model).
... 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.
... other things such as dom traversal and dom range.
...And 2 more matches
Object.freeze() - JavaScript
> object.freeze(1) typeerror: 1 is not an object // es5 code > object.freeze(1) 1 // es2015 code an arraybufferview with elements will cause a typeerror, as they are views over memory and will definitely cause other possible issues: > object.freeze(new uint8array(0)) // no elements uint8array [] > object.freeze(new uint8array(1)) // has elements typeerror: cannot freeze array buffer views with elements > object.freeze(new dataview(new arraybuffer(32))) // no elements dataview {} > object.freeze(new float64array(new arraybuffer(64), 63, 0)) // no elements float64array [] > object.freeze(new float64array(...
... obj1 = { internal: {} }; object.freeze(obj1); obj1.internal.a = 'avalue'; obj1.internal.a // 'avalue' to be a constant object, the entire reference graph (direct and indirect references to other objects) must reference only immutable frozen objects.
... the object being frozen is said to be immutable because the entire object state (values and references to other objects) within the whole object is fixed.
...And 2 more matches
Object - JavaScript
otherwise, it will return an object of a type that corresponds to the given value.
...other code cannot delete or change its properties.
... object.seal() prevents other code from deleting properties of an object.
...And 2 more matches
Promise.prototype.then() - JavaScript
returns another pending promise object, the resolution/rejection of the promise returned by then will be subsequent to the resolution/rejection of the promise returned by the handler.
...didn't bother to instantiate and return " + "a promise in the prior then so the sequence may be a bit " + "surprising"); // note that `string` will not have the 'baz' bit of it at this point.
...didn't bother to instantiate and return a promise in the prior then so the sequence may be a bit surprising // foobar // foobarbaz when a value is simply returned from within a then handler, it will effectively return promise.resolve(<value returned by whichever handler was called>).
...And 2 more matches
WeakRef - JavaScript
a weakref object lets you hold a weak reference to another object, without preventing that object from getting garbage-collected.
...any behavior you observe in one engine may be different in another engine, in another version of the same engine, or even in a slightly different situation with the same version of the same engine.
...sources of variability include: one object might be garbage-collected much sooner than another object, even if they become unreachable at the same time, e.g., due to generational collection.
...And 2 more matches
Object initializer - JavaScript
values of object properties can either contain primitive data types or other objects.
... in json the values can only be strings, numbers, arrays, true, false, null, or another (json) object.
...the values of these keys are a string "bar", the number 42, and another object.
...And 2 more matches
delete operator - JavaScript
description unlike what common belief suggests (perhaps due to other programming languages like delete in c++), the delete operator has nothing to do with directly freeing memory.
... if a property with the same name exists on the object's prototype chain, then, after deletion, the object will use the property from the prototype chain (in other words, delete only has an effect on own properties).
... var employee = {}; object.defineproperty(employee, 'name', {configurable: false}); console.log(delete employee.name); // returns false var, let, and const create non-configurable properties that cannot be deleted with the delete operator: var nameother = 'xyz'; // we can access this global property using: object.getownpropertydescriptor(window, 'nameother'); // output: object {value: "xyz", // writable: true, // enumerable: true, // configurable: false} // since "nameother" is added using with the // var keyword, it is marked as "non-configurable" delete nameother; // return false in str...
...And 2 more matches
new operator - JavaScript
description the new keyword does the following things: creates a blank, plain javascript object; links (sets the constructor of) this object to another object; passes the newly created object from step 1 as the this context; returns this if the function doesn't return an object.
...an object can have a property that is itself another object.
... the object (not null, false, 3.1415 or other primitive types) returned by the constructor function becomes the result of the whole new expression.
...And 2 more matches
export - JavaScript
the export statement is used when creating javascript modules to export live bindings to functions, objects, or primitive values from the module so they can be used by other programs with the import statement.
...function* export { name1 as default, … }; // aggregating modules export * from …; // does not set the default export export * as name1 from …; // draft ecmascript® 2o21 export { name1, name2, …, namen } from …; export { import1 as name1, import2 as name2, …, namen } from …; export { default } from …; namen identifier to be exported (so that it can be imported via import in another script).
... but a default export can be imported with any name for example: // file test.js let k; export default k = 12; // some other file import m from './test'; // note that we have the freedom to use import m instead of import k, because k was default export console.log(m); // will log 12 you can also rename named exports to avoid naming conflicts: export { myfunction as function1, myvariable as variable }; re-exporting / aggregating it is also possible to "import/export" from different modules in a par...
...And 2 more matches
Animation performance and frame rate - Web Performance
animation on the web can be done via svg, javascript, including <canvas> and webgl, css animation, <video>, animated gifs and even animated pngs and other image types.
... the 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.
...code based animations, be it css, svg, <canvas>, webgl or other javascript animations, can cause performance issues even if the bandwidth footprint is small.
...And 2 more matches
Optimizing startup performance - Web Performance
this article offers tips and suggestions to help you achieve that goal, both when writing a new app and when porting an app from another platform to the web.
...other than the reasons suggested above, consider the impact of a non-responsive page or user interface.
... on the other hand, however, it can get tricky when you're porting an existing app to the web.
...And 2 more matches
Mixed content - Web security
mixed passive/display content mixed passive/display content is content served over http that is included in an https webpage, but that cannot alter other portions of the webpage.
...hence, in addition to the risks described for mixed display content above, mixed active content is vulnerable to a few other attack vectors.
...if the webpage is public and has no sensitive data about the user, using mixed active content still provides the attacker with the opportunity to redirect the user to other http pages and steal http cookies from those sites.
...And 2 more matches
2015 MDN Fellowship Program - Archive of obsolete content
in 2015, mdn will expand the impact of this content by developing kits of key learning materials, including such elements as code samples, videos and other elements being finalized.
... activities and deliverables act as lead curator for technical curriculum addressing a key web technology, developing code samples, videos, interactive exercises and other components to be determined.
... required skills and experience experienced web developer with expertise in javascript, css, html and/or other key technologies.
... the fellows will meet the stated deliverables of their projects and meet weekly with their mentor, the program lead and their other fellows.
Communicating using "port" - Archive of obsolete content
to enable add-on scripts and content scripts to communicate with each other, each end of the conversation has access to a port object.
... to send messages from one side to the other, use port.emit() to receive messages sent from the other side, use port.on() messages are asynchronous: that is, the sender does not wait for a reply from the recipient but just emits the message and continues processing.
...er.port.on('click', function(html) { worker.port.emit('warning', 'do not click this again'); }); } }); in the add-on above there are two user-defined messages: click is sent from the page-mod to the add-on, when the user clicks an element in the page warning sends a silly string back to the page-mod port.emit() the port.emit() function sends a message from the "main.js", or another add-on module, to a content script, or vice versa.
...t script to the main add-on code: var mymessagepayload = "some data"; self.port.emit("mymessage", mymessagepayload); from the main add-on code (in this case a panel instance) to the content script: var mymessagepayload = "some data"; panel.port.emit("mymessage", mymessagepayload); port.on() the port.on() function registers a function as a listener for a specific named message sent from the other side using port.emit().
Classes and Inheritance - Archive of obsolete content
in other words: circle.prototype.constructor == circle // => true the instanceof operator compares the constructor property of the prototype of the left hand side with that of the right hand side, and returns true if they are equal.
... otherwise, it repeats the comparison for the prototype of the right hand side, and so on, until either it returns true, or the prototype becomes null, in which case it returns false.
... another special property is extends.
...on the other hand, the call to the constructor for shape still has to be made explicitly.
page-worker - Archive of obsolete content
a page worker may be destroyed, after which its memory is freed, and you must create a new instance to load another page.
... include string, regexp, array of (string or regexp) this is useful when your page worker loads a page which will redirect to other pages.
...after you destroy a page worker, its memory is freed and you must create a new instance if you need to load another page.
...this is useful when using pages which redirect to other pages in your page-worker.
tabs - Archive of obsolete content
to convert back the other way, from a xul tab to a high-level tab object, use the modelfor() function, exported by the modelfor module.
... here's an example converting from a high-level tab to a xul tab and then back the other way: var { modelfor } = require("sdk/model/core"); var { viewfor } = require("sdk/view/core"); var tabs = require("sdk/tabs"); var tab_utils = require("sdk/tabs/utils"); function maphighleveltolowlevel(tab) { // get the xul tab that corresponds to this high-level tab var lowleveltab = viewfor(tab); // now we can, for example, access the tab's content directly var browser = tab_utils.getbrowserfortab(lowleveltab); console.log(browser.contentdocument.body.innerhtml); // get the high-level tab back from the xul tab var highleveltab = modelfor(lowleveltab); console.log(highleveltab.url); } tabs.on("ready", maphighleveltolowlevel); note that directly accessing xul objects and web content l...
...this may come from http headers or other sources of mime information, and might be affected by automatic type conversions performed by either the browser or extensions.
... index the index of the tab relative to other tabs in the application window.
core/heritage - Archive of obsolete content
ruff!' }; // subclassing a `dog` function pet(name, breed) { // once again we do our little dance if (!(this instanceof pet)) return new pet(name, breed); dog.call(this, name); this.breed = breed; } // to subclass, you need to make another special dance with special // 'prototype' properties.
... pet.prototype = object.create(dog.prototype); // if you want correct instanceof behavior you need to make a dance with // another special `constructor` property of the `prototype` object.
...as a matter of fact since result is just a plain constructor function with proper prototype chain setup you could sub-class it as any other constructor: function labrador() { // ...
...tring: function tostring() { return this.hex() + '@' + point.prototype.tostring.call(this) } }); var pixel = pixel(11, 23, 'cc3399'); pixel.tostring(); // => #cc3399@11:23 pixel instanceof pixel // => true pixel instanceof point // => true extend module exports extend utility function, that is useful for creating objects that inherit from other objects, without associated classes.
core/promise - Archive of obsolete content
promises consider another approach, instead of continuation via callbacks, a function returns an object that represents a eventual result, either successful or failed.
... this technique is so powerful that it can replace most of the promise utility functions provided by other promise libraries.
... another simple example may be a delay function that returns a promise which is fulfilled with a given value after a given time ms -- kind of promise based alternative to settimeout: function delay(ms, value) { let { promise, resolve } = defer(); settimeout(resolve, ms, value); return promise; } delay(10, 'hello world').then(console.log); // after 10ms => 'helo world' advanced usage if general d...
...in fact some other promise frameworks do that.
Localization - Archive of obsolete content
for example, english has two forms: a singular form for "one", and a plural form for "everything else, including zero": one tomato no tomatoes two tomatoes but russian has different forms for numbers ending in 1 (except 11), numbers ending in 2-4 (except 12-14) and other numbers: один помидор // one tomato два помидора // two tomatoes пять помидоров // five tomatoes the sdk uses the unicode cldr data to describe the different plural forms used by different languages.
...in this scheme a language maps each distinct range of numbers on to one of up to six forms, identified by the following categories: zero, one, two, few, many, and other.
... english has two forms, which can be described by mapping "1" to "one" and "everything else" to "other": one → n is 1; other → everything else russian uses four forms, that can be described as follows: one → n mod 10 is 1 and n mod 100 is not 11; few → n mod 10 in 2..4 and n mod 100 not in 12..14; many → n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14; other → everything else plural rules for all languages can be found in the cldr language plural rules page (although this table is out of date compared to the cldr xml source).
...so in english we could have two plural localizations (note that the "other" category does not take the cldr keyword): # en-us translations tomato_id[one]= %d tomato tomato_id= %d tomatoes in russian we could have four plural localizations: # ru-ru translations tomato_id[one]= %d помидор tomato_id[few]= %d помидора tomato_id[many]= %d помидоров tomato_id= %d помидоры the localization module itself understands the cldr definitions for...
Finding window handles - Archive of obsolete content
another technique is to use the accessibility framework, see for example http://developer.mozilla.org/en/docs..._of_interfaces another way to find a window handle...
... like this hwnd gethwnd(nsibasewindow *window) { nscomptr< nsiwidget > widget; window->getmainwidget(getter_addrefs(widget)); if (widget) return (hwnd) widget->getnativedata(ns_native_window); } yet another way to find a window handle (parent window handle) this method is for people who want to get the top level window hwnd from the window object in javascript.
... comparing to the method above, by using this method, you don't have to compile your component with nsiwidget.h and other bunchs of h files that should not be exposed to outside, and could change every time firefox updates, all you need is nsibasewindow.idl(it's not in gecko_sdk, get this from the latest firefox source, or http://mxr.mozilla.org/mozilla/sourc...basewindow.idl), and use xpidl to compile it to .h file, although that's stll a unfrozen interface, but it should be a lot better.
... gpointer(); var rez_gwgud = gdk_window_get_user_data(browserwindow_madeintogdkwinptr, gptr.address()); console.info('rez_gwgud:', rez_gwgud, /*rez_gwgud.tostring(),*/ uneval(rez_gwgud)); // return is void so cant do .tostring on it var browserwindow_madeintogtkwindowptr = ctypes.cast(gptr, gtkwindow.ptr); // focusing window this way is better, so it maintains proper history in case you or some other app want to focus "most recent window" by timestamp // var rez_gst = gdk_x11_get_server_time(browserwindow_madeintogdkwinptr); // console.info('rez_gst:', rez_gst, uneval(rez_gst)); // return is a number of ms since the computer (xserver) was on // var rez_gwpwt = gtk_window_present_with_time(browserwindow_madeintogtkwindowptr, rez_gst); // console.info('rez_gwaf:', rez_gwpwt, uneval(rez_gwpwt));...
Label and description - Archive of obsolete content
<description>i am your father's brother's nephew's cousin's former roommate.
... <description style="white-space: pre-wrap;">i am your father's brother's nephew's cousin's former roommate.
... <description style="white-space: pre;">i am your father's brother's nephew's cousin's former roommate.
... <description>i am your father's brother's nephew's cousin's former roommate.<html:br/> what's that make us?<html:br/> absolutely nothing!</description> using labels as anchors its possible to make a label look and act like an html <a> tag: <label class="text-link" href="http://whatever.com" value="click here to go to whatever"/> "text-link" is a built-in, predefined class.
Miscellaneous - Archive of obsolete content
this event is mozilla-only; other browsers may support window.onmousewheel.
...r: var common = { _bundle: components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"), getlocalizedmessage: function(msg) { return this._bundle.getstringfromname(msg); } }; alert(common.getlocalizedmessage("invalid.url")) another similar alternative (using both getstringfromname and formatstringfromname), is: var fcbundle = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"); function getstr(msg, args){ //get localised message if (args){ args = array.prototype.slice.cal...
...id: "@mozilla.org/certs-service;2", classid: components.id("{e9d2d37c-bf25-4e37-82a1-16b8fa089939}"), queryinterface: xpcomutils.generateqi([ci.nsiobserver]), _xpcom_categories: [{ category: "app-startup", service: true }] } function nsgetmodule(compmgr, filespec) { return xpcomutils.generatemodule([certsservice]); } you need to delete your existing profile, otherwise the xpcom service is not used.
... another one is to utilize bootstrap.js startup function data argument: function startup(data, reason) { // some code ...
Extension Versioning, Update and Compatibility - Archive of obsolete content
it varies depending on what type of add-on you are providing information for: for an extension or plugin bundle it must be urn:mozilla:extension:<id> for a theme it must be urn:mozilla:theme:<id> for any other type of add-on it must be urn:mozilla:item:<id> note: prior to gecko 2.0 (firefox 4.0), the ordering of the versions within the <rdf:seq> is significant.
...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.
...other tags aren't included in the result but do have their contents displayed, so the following snippet: <span><q>text</q></span> would be rendered exactly the same as: <q>text</q> sample file <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html lang="en-us" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <h2>my extension</h2> <ul> ...
Jetpack Processes - Archive of obsolete content
these processes are relatively lightweight, do not have access to xpcom, and can innately do little other than compute.
...by default, a handle is rooted in the javascript interpreter's garbage collector, meaning that even if a process throws it away, it will not be garbage collected unless the other process explicitly does something to indicate that it is no longer needed.
... if that other process does not do something explicit and simply removes all references to it, the handle remains rooted yet unreachable in both processes and a memory leak is created.
...this is useful for associating handles to the lifetime of a particular window, context menu, or other element, and helping ensure that they do not leak.
Extensions support in SeaMonkey 2 - Archive of obsolete content
differences as compared to other toolkit/-based applications you need to overlay/open different chrome urls as compared to firefox.
...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.
...d = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"; var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); if(appinfo.id == firefox_id) { // running under firefox } else if(appinfo.id == thunderbird_id) { // running under thunderbird } else if(appinfo.id == seamonkey_id) { // running under seamonkey } else { // another app } see using nsixulappinfo for more details.
... in manifest file seamonkey uses different overlays than other applications.
XUL user interfaces - Archive of obsolete content
more specialized features can be built from parts by using xul together with other technologies that you have seen in this tutorial: css style, javascript code, and xbl bindings.
... like other xml-based languages, xul uses css stylesheets.
...it is made up of other elements that are generated by its xbl binding.
...if you had difficulty understanding this page, or if you have other comments about it, please contribute to its discussion page.
List of Mozilla-Based Applications - Archive of obsolete content
e) 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 couchdb document-oriented database uses spidermonkey courtanet benefit (fr) underwriting software for french insurance brokers crosscheck browserless testing framework uses mozilla rhino crowbar server tool ...
...rary english cd-rom lotus notes / sametime groupware the latest version of ibm lotus notes and sametime can embed xul applications lucidor e-book reader lx-office accounting tool looks like it makes at least some use of xul maavis simple ui & communications for accessibility framework designed for elderly people with dementia but other applications mac os x operating system makes use of some mpl files such as libsecurity_asn1 maemo browser browser for maemo internet tablet development name is microb magooclient business process management tool uses mozilla rhino mantra security tool mccoy secure update tool for add-ons xulrunner application med...
...python-hulahop is required python-hulahop a python gtk widget uses embedded xulrunner, providing full access to nsi dom and all other xulrunner interfaces, in a gtk window.
... other places to find mozilla applications include: http://www.mozilla.org/projects/ http://developer.mozilla.org/en/docs/xulrunner_hall_of_fame http://www.mozdev.org http://xulapps.net/ http://dmoz.org/computers/data_formats/markup_languages/xml/applications/xul/applications/ http://blog.mozbox.org/post/2007/06/14/xul-activity-in-france http://www.mozilla.org/projects/security/pki/nss/overview...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
now you can use your plug-ins in any recent version of ie or in any other activex container for that matter.
... build it it is quite simple to build the control locate the pluginhostctrl directory: open pluginhostctrl.dsp build "win32 debug" or another target open some of the test files under pluginhostctrl\tests in internet explorer to verify the control has built and registered correctly.
... a note to developers if you intend to modify this control in any way then you must also change the clsid from {dbb2de32-61f1-4f7f-beb8-a37f5bc24ee2} to something else and any other guids this control relies upon (iid, libids etc).
... this is necessary so that your control may coexist with the generic version and any other versions that other plug-ins vendors may have installed.
Getting Started - Archive of obsolete content
classic.jar locations linux: folder_with_seamonkey/chrome/classic.jar windows: folder_with_seamonkey\chrome\classic.jar for mac os x: folder_with_seamonkey/chrome/classic.jar copy classic.jar to another easily accessible folder -- classic is recommended -- extract the contents of that folder, being sure to maintain the directory structure.
... skin skin simply contains another directory, classic which holds all the good stuff.
...if we also had skins for chatzilla, we would need to add another line resembling the other ones and change it to point to chatzilla.
...css files the css files in these directories tell the browser how to display the buttons and other controls, where to put the images, what border and padding it should put around them, and so on.
Drag and Drop JavaScript Wrapper - Archive of obsolete content
the library also depends on another script library, which you should also include, usually at the top of your xul file.
...if we wanted to handle the other cases also, we can call the other functions, as in the following example: <description value="click and drag this text." ondraggesture="nsdraganddrop.startdrag(event,textobserver)" ondragover="nsdraganddrop.dragover(event,textobserver)" ondragexit="nsdraganddrop.dragexit(event,textobserver)" ondragdrop="nsdraganddrop.drop(event,textobserver)" />...
...this function is necessary so that the wrapper can determine the best flavour to pass to the other functions.
...otherwise, the plain text version will be used instead.
Drag and Drop - Archive of obsolete content
this section describes how to implement objects that can be dragged around and dropped onto other objects.
...for example, dragging files to other directories, or dragging an icon to another window to open the document it refers to.
... note that drag sessions can be created from within mozilla itself or from other applications.
...the is also called after a drop is complete so that an element has a chance to remove any highlighting or other indication.
Java in Firefox Extensions - Archive of obsolete content
mpler hello world version than that below is now available at http://brett-zamir.me/java_demo/ ] for privileges, the basic procedure is: download and include http://simile.mit.edu/repository/jav...nsionutils.jar within your extension (you can also build your own from the source files at http://simile.mit.edu/repository/jav...xtensionutils/ ) build and add references leading to this jar and all other jars in your extension within an array of java.net.url's, pass to java.net.urlclassloader to get a class loader, and finally pass the classloader and array to a function which gives the necessary privileges: // this function will be called to give the necessary privileges to your jar files // however, the policy never comes into play, because // (1) adding permissions doesn't add to the poli...
...jar files (the following assumes your jars are within a // directory called "java" at the root of 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.
...var aclass = java.lang.class.forname("org.mozilla.developer.helloworld", true, cl); var astaticmethod = aclass.getmethod("getgreeting", []); var greeting = astaticmethod.invoke(null, []); alert(greeting); another, perhaps simpler approach is as follows: var myclass = loader.loadclass('com.example.myclass'); // use the same loader from above var myobj = myclass.newinstance(); var binval = myobj.mymethod(arg1, arg2); // pass whatever arguments you need (they'll be auto-converted to java form, taking into account the liveconnect conversion rules) for more complex cases, in which you need to call a specific...
...the following is a somewhat simplified snippet from xquseme: var reflect = java.lang.reflect; // build an array of the class types which are expected by our constructor (in this case, java.io.file and a class from another jar we loaded, com.sleepycat.db.environmentconfig) var paramtypes = reflect.array.newinstance(java.lang.class, 2); // 2nd argument should indicate the number of items in following array paramtypes[0] = java.io.file; var envconfigclass = loader.loadclass('com.sleepycat.db.environmentconfig'); paramtypes[1] = envconfigclass; // get the constructor var constructor = envclass.getconstructor(paramtypes); // now that we have the constructor with the right parameter types, we can build the specific arguments we wish to pass to it...
Modularization techniques - Archive of obsolete content
inheriting from nsisupports allows any interface to be interrogated about other interfaces that its instance may support, and insures that reference counting facilities are always available.
... on the other hand, objects are allowed a certain degree of flexibility in their implementations of addref() and release().
...xpcom uses these typelibraries to allow other languages, such as javascript, to implement and call xpcom objects.
...this technology is built into windows, but not most other platforms.
RDF Datasource How-To - Archive of obsolete content
an "address book" datasource could translate a database file into statements like "spammer128@hotmail.com's real name is 'billy dumple'" and "spammer128@hotmail.com is considered an 'important friend'." statements from one datasource can be combined with statements from another datasource using a composite datasource.
...the first question that you must answer is "should i use an existing vocabulary, or invent my own?" a reasonable answer is, "use an existing vocabulary unless you absolutely must invent your own." this will allow your datasource to be integrated with other datasources with a minimum of effort.
...this vocabulary is a "meta vocabulary" that is used to specify other vocabularies.
...this implementation may cause problems if your data store can be modified "on the fly" by other agents.
Running Tamarin performance tests - Archive of obsolete content
(optional) you may compare the performance of the avmshell to another avmshell.
...to compare a build against another build set the avm2 environment variable to the other avmshell or use the "-s --avm2" options.
...other tests may be specified by selecting ./runtests.py -c [misc,scimark,jsbench].
...to recap the other environment settings: - set the builtinabc environment variable to the path of the /generated/builtin.abc.
Treehydra Manual - Archive of obsolete content
note that the callbacks interact with other treehydra options.
...ext) { let fn = node.decl; if (decl_struct_function(fn)) { // fn has a body print(fn); let cfg = function_decl_cfg(fn); } } gimple reference for a detailed description of gimple see gcc/tree.def and gcc/cp/operators.def see also treehydra.js, gcc_compat.js, gcc_util.js, and gcc_print.js in the treehydra libs directory, which have many ports of gcc macros and other functions for conveniently accessing gimple data in javascript.
...in other words, a mapping from program variables to concrete values.
...for example, if esp reaches a point where two control flow paths merge, and on one side the abstract value of x is 1, and on the other side, the abstract value of x is 2, then the new abstract value of x will be 1 join 2.
URIs and URLs - Archive of obsolete content
familiar examples include an electronic document, an image, a service (e.g., "today's weather report for los angeles"), and a collection of other resources.
...the term "uniform resource locator" (url) refers to the subset of uri that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource.
...another quote from rfc 2396: a uri is always in an "escaped" form, since escaping or unescaping a completed uri might change its semantics.
...otherwise, the reference uri's scheme is inherited from the base uri's scheme component.
Using cross commit - Archive of obsolete content
w there are a couple of common ways to use cross-commit: land something simultaneously on the trunk and mozilla_1_8_branch # modify the files (probably by applying the patch) patch -p0 < ~/caret.patch # commit on trunk and branch at once # make sure to use -m "commit message" when doing so tools/cross-commit -m "fix some sort of security bug" layout/base/nscaret.h land something on two other branches that has already landed on the trunk # update to the first branch you want to land on cvs update -rmozilla_1_8_branch layout/base/nscaret.h # modify the files (probably by applying the patch) patch -p0 < ~/caret.patch # commit on all the branches at once # make sure to use -m "commit message" when doing so tools/cross-commit --moz18 --branch mozilla_1_8_0_branch -m "fix some so...
...otherwise cross-commit will end up waiting forever for you to type a cvs checkin message in an editor that it never shows you!
... --trunk makes cross-commit land the patch on head in addition to any other branches specified.
... --moz18 makes cross-commit land the patch on mozilla_1_8_branch in addition to any other branches specified.
Using Breakpoints in Venkman - Archive of obsolete content
when you set a breakpoint in a debugging application such as venkman, you can take advantage of the suspension to examine variables, objects, and other featues of the execution.
...except for this distinction, breakpoints in venkman work like breakpoints in most other debuggers.
...this advanced feature and other options you can see for the associated script are available from the future breakpoint properties dialog, which you can access by right-clicking a breakpoint and selecting properties.
...if, on the other hand, the script returns a false value, venkman will stop execution at that point.
confirm - Archive of obsolete content
the value is calculated by multiplying the corresponding button position constant with a button title constant for each button, then adding the results and any additional options (see other constants).
..._title_ok: an 'ok' button button_title_cancel: a 'cancel' button button_title_yes: a 'yes' button button_title_no: a 'no' button button_title_save: a 'save' button button_title_dont_save: a 'don't save' button button_title_revert: a 'revert' button button_title_is_string: custom title specified by the corresponding abuttonxtitle parameter other constants button_pos_0_default: specifies button 0 as the default button.
... unless specified otherwise, this is the default.
...other approaches (e.g.
Learn XPI Installer Scripting by Example - Archive of obsolete content
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.
...vel structure parallels the directory structure of the installed browser very closely: as you will see in the installation script, the contents of the archive are installed onto the file system in much the same way that they are stored in the archive itself, though it's possible to rearrange things arbitrarily upon installation--to create new directories, to install files in system folders and other areas.
...this input is defined in line 22, where getfolder() is used to assign a value to the communicatorfolder variable representing the "program" folder on the local system: var communicatorfolder = getfolder("program"); spaceavailable = filegetdiskspaceavailable(dirpath); spacerequired, the other expected input to the verifydiskspace function, is given as 17311 kilobytes on line 19.
...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.
panel.level - Archive of obsolete content
on linux, the default value is top, otherwise, the default value is parent.
... if a panel has one or more text fields, this attribute should not be set, otherwise ime or on-screen keyboard popups will appear incorrectly.
... top the panel is shown in front of all other normal windows, including those of other applications.
... parent the panel is shown just above the window the panel is in, but behind other windows above it.
Building accessible custom components in XUL - Archive of obsolete content
a super-simple spreadsheet download stage-1.zip install stage-1.xpi to build our xul spreadsheet, we'll use three built-in xul controls: a single grid element to contain the other elements and position them in rows and columns.
...some of the description elements are row headers, and others are column headers.
...ns:x2="http://www.w3.org/tr/xhtml2" xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/guiroletaxonomy#" xmlns:waistate="http://www.w3.org/2005/01/wai-rdf/guistatetaxonomy#" onload="install_handlers()" > <script src="accjax.js"/> </code> by adding this javascript code and these css rules, we can tab to the spreadsheet see which cell, row header, or column header has focus click on other cells or headers to change focus within the spreadsheet tab off the spreadsheet by pressing tab once tab back to the spreadsheet and automatically set focus to the previously focused cell or header inspect32 confirms that all of this really works; it's not just visual smoke and mirrors.
...other compound controls such as lists and treeviews support two-phased keyboard navigation.
Dynamically modifying XUL-based user interface - Archive of obsolete content
this article discusses manipulating xul interfaces, using dom and other apis.
...you may also have used other calls, such as element.setattribute(), or, if you wrote an extension, the addeventlistener() method.
...you need to use other dom methods, such as appendchild() to insert the newly created element in the document.
... appendchild() appends the node after all other nodes, while insertbefore() inserts the node before the node referenced by its second parameter.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
false otherwise.
...false otherwise.
...false otherwise.
...false otherwise.
XUL Events - Archive of obsolete content
the event is not sent until the focus is moved to another element.
...the focus can be changed by clicking on another element, by pressing tab to switch to the next element in the tab order sequence, or by pressing 'back tab' to switch focus to the previous element in the tab order.
... attribute: oninput overflow this event is only sent to a box or other layout element with a css overflow property set to a value other than 'visible'.
...this applies to boxes and other layout elements with a css overflow property other than 'visible'.
Moving, Copying and Deleting Files - Archive of obsolete content
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.
...this allows an entire directory and its contents to be copied from one location to another.
...this will be the usual behaviour when copying to a different directory, but you would want to specify a filename when copying a file to another name within the same directory.
... var file = io.newfile("desktop", "myimage.png"); file.copyto(null, "anotherimage.png"); here, a file is copied within the same directory as the supplied destination is null.
MenuModification - Archive of obsolete content
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.
...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.
Attribute Substitution - Archive of obsolete content
this can be done simply by putting two variables next to each other in an attribute value separated by a caret (^).
...one last thing to point out is that since the only characters that can separate a variable are a caret, a space or the end of the attribute, this means that any other character is valid as a variable name.
...it has one attribute, the value attribute, which may use variable substitution like other attributes.
...another possibilty is to rearrange the rdf such that the values, in this example, the descriptions, are specified before the containers.
Building Menus With Templates - Archive of obsolete content
« previousnext » menus may be generated using a template in the same manner as other elements.
... however, unlike with other elements, the content of a menu is only generated once the menu has been opened.
...however, after the menu has been opened, there will be two children, one is the template and the other is the generated menupopup.
...this will involve at least two rules, although you might use other rules if you had other differences to handle.
Filtering - Archive of obsolete content
if this is set, we add a filter, otherwise we remove it.
...this example only adds one triple, but you could add others, or add <member> elements.
...the resulting rdf triples for the first country will be: http://www.daml.org/2001/09/countries/iso#it -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.daml.org/2001/09/countries/country-ont#country http://www.daml.org/2001/09/countries/iso#it -> http://purl.org/dc/elements/1.1/title -> italy the type is just like any other triple in the datasource, so we don't need any special syntax to navigate over it.
...another workaround is to just rebuild the template once the data has been loaded.
Introduction - Archive of obsolete content
some other systems call this databinding.
...several types of datasources are supported by default, rdf, xml and sqlite databases, however, processors may be written to support other types of datasources.
...otherwise, the datasource is loaded as any other url is loaded.
...otherwise, there isn't anything to do until the data is loaded.
Multiple Rule Example - Archive of obsolete content
often this will be because a particular result has a property that others do not.
... for instance, in an earlier example, one of the photos had a description and the other photos did not.
...the first photo will match both rules whereas the other two photos will match only the second rule.
...if you reversed the order of the two rules in the example above, three photos would still be displayed, but the larger rule that displays the image details would be dropped as the other rule has a higher priority.
RDF Modifications - Archive of obsolete content
however, as it is possible to use and/or implement other query types with templates, these additional types may support automatic updating.
...actually, internally, this isn't any different than the other notifications, but it is worth discussing separately.
...once we do add it to the container with another rdf assertion, the process described above is applied again and this time it may match.
...in this case, there are no other statements, so the builder accepts this result as a new match.
Sorting Results - Archive of obsolete content
the tree will change both attributes as necessary automatically when the column headers are clicked or the tree is sorted by other means.
...for rdf datasources, another way to sort by dates is to use the the parsetype="date" construct in the rdf datasource.
...for other elements or content trees, sorting is done by placing the attributes on the root element.
...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 with identical names.
Special Condition Tests - Archive of obsolete content
if this is not the case, you will still need to use other types of conditions to handle this case.
...the iscontainer attribute makes it easier to handle recursive content since you can have one rule for all containers and another rule for all non-containers.
... you don't need to match by type or some other predicate.
...previous example: <button label="houses in my neighbourhood" type="menu" datasources="template-guide-streets.rdf" containment="http://www.xulplanet.com/rdf/address" ref="http://www.xulplanet.com/rdf/myneighbourhood"> the houses do have a value for the 'http://www.xulplanet.com/rdf/address' predicate, so they will also be considered to be containers as well, resulting in another level of menus.
XML Templates - Archive of obsolete content
this substitution occurs for any attribute within the action body, so you can also set other attributes with this technique.
...otherwise the data included inline and the template are the same.
... note the only change is that the addition of the xmlns attribute on the data; this is used to clear the namespace used for the elements in the data, otherwise they become xul elements.
... be aware that when xml data is included inline as in this example, the content may be displayed and may affect the layout of other parts of the window.
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
another tutorial, which walks you through the entire process from the beginning, is also available.
...wrap elements other than <toolbarbutton> in <toolbaritem>.
...the dimensions of the icons in various applications for both modes are summarized in the following table (feel free to add information about other applications): application (theme name) big icon size small icon size firefox 1.0 (winstripe) 24x24 16x16 thunderbird 1.0 (qute) 24x24 16x16 the stylesheet to set the image for your toolbar button, use the following css rules: /* skin/toolbar-button.css */ #myextension-button { list-style-image: url("chrome://myextension/skin/btn_large.pn...
... there is another page on mdc with information about adding buttons to various windows in seamonkey.
Code Samples - Archive of obsolete content
the samples here are designed to work in firefox, thunderbird, sunbird and seamonkey, except where the text says otherwise.
...you can launch an executable file or some other file that your operating system knows how to open.
...otherwise it opens the window: const name = "...internal name of the window..." const uri = "...chrome uri of the window..." var w = components .classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator) .getmostrecentwindow(name) if (w) w.focus() else components .classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interface...
...ressbook.xul" irc chat const name = "irc:chatzilla" const uri = "chrome://chatzilla/content/" calendar const name = "calendarmainwindow" const uri = "chrome://calendar/content/" * at the time of writing, sunbird's passwords window is broken close the current window to close the window containing the button, possibly leaving other windows open: close() exit the application to exit the application, first closing all its windows: components .classes['@mozilla.org/toolkit/app-startup;1'] .getservice(components.interfaces.nsiappstartup) .quit(components.interfaces.nsiappstartup.eattemptquit) ...
Advanced Rules - Archive of obsolete content
rule conditions when a tree, menu or other element with a datasource generates content, the template builder first finds the resource referred to by the ref attribute.
...in fact, the bookmark's title would be another triple in the datasource using the name predicate.
...to do this just add another triple which checks for the additional resource.
...conditions> <action> <treechildren> <treeitem uri="?city"> <treerow> <treecell label="?name"/> <treecell label="?pred"/> </treerow> </treeitem> </treechildren> </action> </rule> </template> </tree> two columns appear in this tree, one which displays the value of the name for each row and the other which displays the value of the prediction.
Content Panels - Archive of obsolete content
« previousnext » in this section, we'll look at how to add panels that can display html pages or other xul files.
...another approach is to use the iframe element, which works much like the html element of the same name.
...this url may point to any kind of file, although it will usually point to an html file or another xul file.
...the browser can also load pages with referers and other flags.
Creating a Window - Archive of obsolete content
the simplest xul file has the following structure: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- other elements go here --> </window> this window will not do anything since it doesn't contain any ui elements.
...you can also import other style sheets using a similar syntax.
... <!-- other elements go here --> replace this comment block with other elements (the buttons, menus and other user interface components) to appear in the window.
...if you are only in the development stage, you can just type the url (whether a chrome:, file: or other url type) into the location bar in a mozilla browser window.
Focus and Selection - Archive of obsolete content
for instance, you might update a total as the user enters values in other fields, or use focus events to validate certain values.
...the command dispatcher has other roles, which will be discussed in a later section on commands.
... finally, the other label which displays the tag name has no control attribute, so clicking it has no effect on the focused element.
...this interface also provides a number of other methods which may be useful.
Introduction to XBL - Archive of obsolete content
the template has two bindings, one called binding1 and the other called binding2.
... one might be attached to a scroll bar and the other to a menu.
...you may use other elements besides the box, even your own custom tags.
...however, to summarize, it causes two buttons to be added automatically inside the box, one an ok button and the other a cancel button.
More Event Handlers - Archive of obsolete content
other arguments can be passed to a listener function, if required.
...ert('button was pressed!'); } function boxpressed(event){ alert('box was pressed!'); event.stoppropagation(); } var button = document.getelementbyid("okbutton"); button.addeventlistener('command',buttonpressed,true); var outerbox = document.getelementbyid("outerbox"); outerbox.addeventlistener('command',boxpressed,true); </script> here, an event listener has been added to the button and another event listener has been added to the box.
...this event is commonly used to initialize fields and perform other tasks that need to be done before the user can use the window.
...there is also an unload event which is called once the window has closed, or in a browser context, when the page is switched to another url.
Property Files - Archive of obsolete content
# this is another comment goodbyemessage=come back soon!
...the element has a number of functions which can be used to get strings from the property file and get other locale information.
...use a chrome url to read a file from the locale: <stringbundleset id="stringbundleset"> <stringbundle id="strings" src="chrome://myplugin/locale/strings.properties"/> </stringbundleset> like other non-displayed elements, you should declare all your stringbundles inside a stringbundleset element so that they are all kept together.
...in case you need to format a string that already contains the percentage character in it (to get something like "50% off" returned), escape the percentage character with another percentage character, like this: my.percentage.string = %s%% off not escaping the percentage character will generate an incorrect string that strips the space character between the percentage character and the next word of the string ("50%off").
Stack Positioning - Archive of obsolete content
they may be any element, including boxes and other stacks.
...stacks have the advantage that when one absolutely positioned element changes its position, the position of the other elements is not affected.
... if you tried to move elements in a regular box, other elements might shuffle their positions around.
...that means that if two buttons overlap, the top button will capture a mouse click where it covers the other one.
Tree View Details - Archive of obsolete content
in addition to the getlevel method, there is a hasnextsibling function which, given a row, should return true if there is another row afterwards at the same level.
...otherwise, we just iterate backwards through the rows looking for one that is a container.
...the various other functions implemented above such as getlevel and iscontainer are used by the tree to determine how to draw the tree.
... complete example there are several other view functions we can implement but they don't need to do anything in this example, so we can create functions that do nothing for those.
Trees and Templates - Archive of obsolete content
using a template with a tree uses very much the same syntax as with other elements.
...only one rule is used, but you may add others if needed.
... like with other templates, the uri attribute on an element indicates where to start generating content.
...you can combine these two elements with other attribute matches for more specific rules.
XUL Questions and Answers - Archive of obsolete content
others, like <listbox>, cannot be so tied, but one can always write a script that updates preferences explicitly, via nsiprefbranch interface.
...change this line var settings = printutils.getprintsettings(); to this var settings = printutils.getprintsettings().clone(); settings.docurl = " "; // suppress url on printout other options you can modify are documented here: http://www.xulplanet.com/references/...tsettings.html how can i send xml/xul document fragment to the server instead of using get or post variables?
... this problem can be solved by capturing the focus events and giving the focus to another xul element or capturing and canceling the keypress events.
... how can i use other fonts on xulrunner applications which are not installed on the current machine?
scrollbox - Archive of obsolete content
this may also be used with any other container element.
...for the most part, the horizontal and vertical scrollbars will independently handle too-tall and too-wide cases, but each scroll bar takes up additional width and so the appearance of one scroll bar can trigger the other one if it's close to the edge anyway.
...instead, figure out some other way to lay things out.
...do this instead: var xpcominterface =scrollbox_element.boxobject.queryinterface( components.interfaces.nsiscrollboxobject); xpcominterface.ensureelementisvisible(child_element_to_make_visible); see the nsiscrollboxobject api for other scroll-related methods.
toolbar - Archive of obsolete content
these can vary from one toolbar to another within a given toolbox, whose iconsize attribute defines the default for all toolbars that don't specify an icon size.
...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.
...otherwise, this option will be ignored for this toolbar and it will always be visible.
tooltip - Archive of obsolete content
if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element.
... anchor the popup may be either anchored to another node or opened freely.
... iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups.
... to have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the boxobject.screenx and boxobject.screeny properties of the element, and use those as the x and y arguments offset by the desired values.
calICalendarViewController - Archive of obsolete content
otherwise, it should be set to a default value, as determined by the application.
... the other values of the calievent (title, summary, alarm, etc) should likewise be set to defaults.
...otherwise, a dialog should be display allowing the user to modify the fields.
...just the time changed), // then do so; otherwise pop up the dialog if (anewstarttime && anewendtime && !anewstarttime.isdate && !anewendtime.isdate) { var instance = aoccurrence.clone(); instance.startdate = anewstarttime; instance.enddate = anewendtime; instance.calendar.modifyitem(instance, aoccurrence, null); } else { modifyeventwithdialog(aoccurrence); }...
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
nperror np_initialize(npnetscapefuncs* nstable, nppluginfuncs* pluginfuncs) { nperror err = nperr_no_error; prbool supportsxembed = pr_false; npntoolkittype toolkit = 0; [ code that copies all of the function tables and does ] [ other standard checks ] /* * make sure that the browser supports functionality we care * about.
...if you return with an error from your initialization function the plugin will not be used which avoids crashes and other problems.
...other toolkits and out of process plugins it should be possible to use this interface to build a plugin that would run out of process as well as using other toolkits like qt to build plugins.
...the author has no specific knowledge of other instances where people are using this architecture, though.
What is RSS - Archive of obsolete content
this tutorial teaches rss 2.0, but makes an effort to point out issues with other versions of rss.
...other than that, they are the same.
...syndication is the process of telling others that you have content for them to consume.
... in other words, when you syndicate, you are telling everyone something like: "hey everyone, i've got articles that i want everyone to come and read.
Vulnerabilities - Archive of obsolete content
another example is a race condition error that allows the attacker to perform a specific action with elevated privileges.
... it may be hard to differentiate software feature misuse vulnerabilities from the other two categories.
...some will be very easy to exploit, while others will only be exploitable under a combination of highly unlikely conditions.
... one vulnerability might provide root-level access to a system, while another vulnerability might only permit read access to an insignificant file.
XForms Custom Controls - Archive of obsolete content
custom data types - existing xforms controls are not able to work properly with your data type advanced xforms controls - you need your controls to be able to do more things than traditional xforms controls can do new host language - you'd like to support xforms in host languages other than xhtml or xul custom presentation the mozilla xforms extension cannot anticipate all of the possible use cases that will evolve in web applications and web pages as xforms matures and the user base grows.
...as mentioned in the spec, the appearance attribute can be used to influence the look and feel of a control even when all other conditions remain constant.
...if you need to have xforms in other kinds of documents like svg, mathml or some other tag language that mozilla supports, then you'll need to implement xforms controls for your desired document format.
...the other is the implementation binding that adds the host-language specific representation of the xforms control.
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
for example: :hover {color: red;} this is equivalent to the css2 rule: *:hover {color: red;} ..which translates as "any element that is being hovered should have its foreground colored red." thus, hovering over paragraphs, tables, headings, and any other element in a document will cause text to become red.
... named anchor problems in addition to the effects described previously, there are two other relatively common effects that authors may not expect.
... one is easily fixed by validation, but the other is a little more subtle.
...consider the effects of the following rule: a:hover {color: red;} in a document with an unclosed named anchor, any text that follows the anchor's open tag will be colored red (unless another css rule intervenes).
Using the Right Markup to Invoke Plugins - Archive of obsolete content
the details are covered in another article.
... sun's java plugin can be invoked by the object element, just like any other plugin.
...you can invoke the java plugin for netscape 7 and other mozilla-based browsers by using the appropriate java mime type.
...the pluginurl attribute is another attribute that can be used, and it can be used to point directly to an xpinstall file for a more streamlined download.
Windows Media in Netscape - Archive of obsolete content
this control is widely used to provide inline media support for web pages that provide sound, video and other media.
...for example: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.4) gecko/20030624 netscape/7.1 (ax; promostring) although geckoactivexobject is currently available only in netscape 7.1 on windows, it may be the case in the future that it will be available in other gecko-based browsers on other operating systems.
...it is important to note that in netscape 7.1, only the classid for windows media player is supported, and no other control can be created.
... is a snippet of cross-browser code that can be used: if (window.activexobject) { req = new activexobject("microsoft.xmlhttp"); } else if (window.xmlhttprequest) { req = new xmlhttprequest(); } // req can be used in a cross-browser way -- the actual objects are similar // caveat emptor: look out for the case of methods and properties -- ie uses // capital letters where gecko uses lowercase other popular uses of microsoft's msxml objects are for in-memory manipulation of xml documents via xslt, perhaps to construct dynamic data for the windows media player.
2D collision detection - Game development
this.color("green"); } else { // no collision this.color("blue"); } }); note: another example without canvas or external libraries.
... circle collision another simple shape for collision detection is between two circles.
...} note: here is another example without canvas or external libraries.
...ee 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.
Bounding volume collision detection with THREE.js - Game development
once instantiated, they have methods available to do intersection tests against other volumes.
... knotbbox.intersectsbox(otherbox); note: this is different from the box3.containsbox method, which checks whether the box3 fully wraps another one.
... knotbsphere.intersectssphere(othersphere); sphere vs.
... // box vs box box3.intersectsbox(otherbox3); // box vs point box3.containspoint(point.position); demos there are two demos you can take a look at on our live demos page.
GLSL Shaders - Game development
fragment shaders compute the renderings of a shape's colors and other attributes.
...this allows the cpu to focus its processing power on other tasks, like executing code.
... note: remember that you don't have to use three.js or any other library to write your shaders — pure webgl (web graphics library) is more than enough.
...three.js and other 3d libraries abstract a lot of things for you — if you wanted to create such an example in raw webgl, you'd have to write a lot of extra code to actually make it work.
Desktop mouse and keyboard controls - Game development
then the pressed key variables are checked and the playerx and playery variables (that we define earlier just after leftpressed and the others) holding the position of the ship are adjusted by a given amount, let's say 5 pixels.
...for cursor keys the natural shooting button would be on the other side of the keyboard, so the player can use the other hand — for example the x key.
... how to play we've implemented the controls, and now we should inform the player about their options to control the game — they wouldn't know about them otherwise.
... to skip the how to play screen, we can listen for any key being pressed and move on: this.input.keyboard.ondowncallback = function() { if(this.statestatus == 'intro') { this.hideintro(); } }; this hides the intro and starts the actual game, without us having to set up another new key control just for this.
Unconventional controls - Game development
but imagine going even further — in this article we will explore various unconventional ways to control your web game, some more unconventional than others.
...how do you know the codes for the other remote keys?
... 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.
... 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.
Tiles and tilemaps overview - Game development
this set of articles covers the basics of creating tile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) besides the performance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a path-finding graph, or handling collisions) or to create a level editor.
... 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).
... if characters or other game sprites are drawn in the middle of the layer stack, this allows for interesting effects such as having characters walking behind trees or buildings.
...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.
Plug-in Development Overview - Gecko Plugin API Reference
for example: str 128 mime type string 1 video/quicktime string 2 mov, moov string 3 audio/aiff string 4 aiff string 5 image/jpeg string 6 jpg several other optional strings may contain useful information about the plug-in.
... plug-ins must support 'str#' 128 but are not required to support any of these others: str#' 127 can contain a list of mime type descriptions corresponding to the types in 'str#' 128 .
... drawing a plug-in instance before drawing itself on the page, the plug-in must provide information about itself, set the window or other target in which it draws, arrange for redrawing, and handle events.
... working with urls the plug-in api provides methods that plug-ins can use to retrieve data from or post data to a url anywhere on the network, provide hyperlinks to other documents, post form data to cgi scripts using http, or upload files to a remote server using ftp.
Search engine - MDN Web Docs Glossary: Definitions of Web-related terms
a search engine conducts the following processes: web crawling: searching web sites by navigating hyperlinks on web pages, both within a site, and from one site to another.
... indexing: associating keywords and other information with specific web pages that have been crawled.
... searching: looking for relevant web pages based on queries consisting of key words and other commands to the search engine.
...other top search engines include yahoo!, bing, baidu, and aol.
Handling different text directions - Learn web development
the writing-mode property lets us switch from one writing mode to another.
... writing modes and block and inline layout we have already discussed block and inline layout, and the fact that some things display as block elements and others as inline elements.
...this is not something you are likely to use in a creative sense — if you simply want to line something up on the right there are other ways to do so — however it is important to understand this as part of the nature of css.
...it will help you in understanding css even if you never use a writing mode other than a horizontal one.
Combinators - Learn web development
previous overview: building blocks next the final selectors we will look at are called combinators, because they combine other selectors in a way that gives them a useful relationship to each other and the location of content in the document.
... adjacent sibling combinator the adjacent sibling selector (+) is used to select something if it is right next to another element at the same level of the hierarchy.
... if you insert some other element such as a <h2> in between the <h1> and the <p>, you will find that the paragraph is no longer matched by the selector and so does not get the background and foreground color applied when the element is adjacent.
...next we will move on to another important part of css — the css box model.
Type, class, and ID selectors - Learn web development
the universal selector the universal selector is indicated by an asterisk (*) and selects everything in the document (or inside the parent element if it is being chained together with another element and a descendant combinator).
...e> , 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 confused however with article:first-child, which will select any <article> element that is the first child of another element.
... this approach reduces the scope of a rule as the rule will only apply to that particular element & class combination; so you would need to add another selector if you decided the rule should apply to other elements too.
... note: as we learned in the lesson on specificity, an id has high specificity and will overrule most other selectors.
Floats - Learn web development
prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to create floated features on webpages, and to use the clear property and other methods of clearing floats.
... floats have commonly been used to create entire web site layouts featuring multiple columns of information floated so they sit alongside one another (the default behavior would be for the columns to sit below one another, in the same order as they appear in the source).
... clearing floats we have seen that the float is removed from normal flow and that other elements will display beside it, therefore if we want to stop the following element from moving up we need to clear it; this is achieved with the clear property.
...apper { background-color: rgb(79,185,227); padding: 10px; color: #fff; } .box { float: left; margin: 15px; width: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } .wrapper::after { content: ""; clear: both; display: block; } using overflow an alternative method is to set the overflow property of the wrapper to a value other than visible.
Normal Flow - Learn web development
if you want to control the size of an inline element in this manner, you need to set it to behave like a block level element with display: block; (or even,display: inline-block; which mixes characteristics from both.) that explains individual elements, but what about how elements interact with one another?
...in english therefore, or any other horizontal, top to bottom writing mode, block-level elements are laid out vertically.
... inline elements behave differently — they don't appear on new lines; instead, they sit on the same line as one another and any adjacent (or wrapped) text content, as long as there is space for them to do so inside the width of the parent block level element.
...because of margin collapsing, we are separated by the width of one of our margins, not both.</p> <p>inline elements <span>like this one</span> and <span>this one</span> sit on the same line as one another, and adjacent text nodes, if there is space on the same line.
Styling text - Learn web development
here we look at text styling fundamentals including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features.
... note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin, codepen or glitch.
... fundamental text and font styling in this article we go through all the basics of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing.
... styling lists lists behave like any other text for the most part, but there are some css properties specific to lists that you need to know about, and some best practices to consider.
Learn to style HTML using CSS - Learn web development
for example, you can use css to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
... css first steps css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
...here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows and other text features.
...now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another.
What text editors are available? - Learn web development
most text editors now support syntax highlighting, but not necessarily the other two features.
...these functionalities are often helpful: search-and-replace, in one or multiple documents, based on regular expressions or other patterns as needed quickly jump to a given line view two parts of a large document separately view html as it will look in the browser select text in multiple places at once view your project's files and directories format your code automatically with code beautifier check spelling auto-indent code based on indentation settings do i want to add extra features to my text editor?
...for text editors, check for two different kinds of support: user-oriented content (faq, manual, online help) discussion with developers and other users (forum, email, irc) use the written documentation when you're learning how to use the editor.
... get in touch with other users if you're troubleshooting while installing or using the editor.
How does the Internet work? - Learn web development
of course a single router can't scale that far, but, if you read carefully, we said that a router is a computer like any other, so what keeps us from connecting two routers together?
...there are other networks out there: your friends, your neighbors, anyone can have their own network of computers.
...an isp is a company that manages some special routers that are all linked together and can also access other isps' routers.
...it is worth noting there are several other services built on top of the internet, such as email and irc.
Common questions - Learn web development
at its most basic, the internet is a massive network of computers communicating with each other.
... every browser features a set of devtools for debugging html, css, and other web code.
... this article shows how to publish your site online with ftp tools — one of the most common ways to get a website online so others can access it from their computers.
... this article provides basic techniques to help you design websites for any kind of user — quick accessibility wins, and other such things.
Web forms — Working with user data - Learn web development
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 own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... other form controls next we take a look at all the non-<input> form controls and associated tools, such as <select>, <textarea>, <meter>, and <progress>.
Dealing with files - Learn web development
when you're building a website, you need to assemble these files into a sensible structure on your local computer, make sure they can talk to one another, and get all your content looking right before you eventually upload them to a server.
... inside this first folder, create another folder to store your first website in.
... file paths to make files talk to one another, you have to provide a file path between them — basically a route, so one file knows where another one is.
... you can combine these as much as you like, for example ../subdirectory/another-subdirectory/my-image.jpg.
Mozilla splash page - Learn web development
in each case (except one — which one is inherently responsive?) we want the browser to serve the 120px wide version when the viewport width is 500px wide or less, or the 400px wide version otherwise.
... an art directed red panda inside the <div> with the class of red-panda, we want to insert a <picture> element that serves the small portrait panda image if the viewport is 600px wide or less, and the large landscape image otherwise.
...glitch is probably better for this example, as it allows you upload assets like images, whereas some of the other tools don't.
... previous overview: multimedia and embedding in this module images in html video and audio content from <object> to <iframe> — other embedding technologies adding vector graphics to the web responsive images mozilla splash page ...
Build your own function - Learn web development
the first line uses a dom api function called document.queryselector() to select the <html> element and store a reference to it in a constant called html, so we can do things to it later 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.
... we then use yet another dom api function called element.setattribute() to set a class attribute on our panel with a value of msgbox.
... 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.
...in the next article we'll wrap up functions by explaining another essential related concept — return values.
JavaScript First Steps - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... 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 high level.
... basic math in javascript — numbers and operators at this point in the course we discuss maths in javascript — how we can combine operators and other features to successfully manipulate numbers to do our bidding.
... useful string methods now we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
Perceived performance - Learn web development
in other words, first download everything you're going to actually show, but only the stuff you are actually using, then download the rest.
... prevent jumping content and other reflows images or other assets causing content to be pushed down or jump to a different location, like the loading of third party advertisements, can make the page feel like it is still loading and is bad for perceived performance.
...if some assets are going to be slower to load than others, with elements loading after other content has already been painted to the screen, plan ahead and leave space in the layout for them so that content doesn't jump or resize, especially after the site has become interactive.
...adding an interesting but unobtrusive 200ms animation to that keyup even can reduce another 200ms of the perceived load.
Ember resources and troubleshooting - Learn web development
previous overview: client-side javascript frameworks next our final ember article provides you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other information.
... further resources ember.js guides tutorial: super rentals ember.js api documentation ember.js discord server — a forum/chat server where you can meet the ember community, ask for help, and help others!
... for framework-specific things, there is the ember-inspector add-on, which allows inspection of: routes & controllers components services promises data (i.e: from a remote api — from ember-data, by default) deprecation information render performance for general javascript debugging, check out our guides on javascript debugging as well as interacting with the browser's other debugging tools.
...while it is technically possible to use jsx, or any other form of dom creation, there has yet to be anything as robust as ember's templating system.
Deployment and next steps - Learn web development
note: there is also an official template for using webpack and also many community-maintained plugins for other bundlers.
... related projects there are other projects related to svelte that are worth checking out: sapper: an application framework powered by svelte that provides server-side rendering (ssr), code splitting, file-based routing and offline support, and more.
... other learning resources there's a complete course about svelte and sapper by rich harris, available at frontend masters.
... we learned about svelte philosophy and what sets it apart from other front-end frameworks.
Dynamic behavior in Svelte: working with variables and props - Learn web development
this is another example in which svelte takes advantage of valid javascript syntax and gives it a new purpose — in this case to to mean "re-run this code whenever any of the referenced values change".
...reactivity in svelte is implemented in a very lightweight and performant way, without using listeners, setters, getters, or any other complex mechanism.
...explore the previous link to see what other modifiers are available.
...and, just like with any other dynamic expression embedded in the markup, whenever any of these dependencies change the dom will be updated accordingly.
Git and GitHub - Learn web development
all developers will use some kind of version control system (vcs), 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.
... 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.
... when working on a project on your own or with others, you'll want to be able to back up the code in a central place, so it is not lost if your computer breaks.
...there are other alternatives such as gitlab that you could try, and you could also try setting your own git server up and using it instead of github.
Embedding API for Accessibility
there are many other pieces, such as preferences to allow the user to change foreground and background colors, and font sizes.
... setboolpref("network.cookie.warnaboutcookies", boolwarn); moz 0.8 fonts setcharpref("font.name.monospace.x-western", newfontname); setcharpref("font.name.serif.x-western", newfontname); setcharpref("font.name.sans-serif.x-western", newfontname); /* for other i18n charsets, change x-western to x-central-euro, x-cyrillic, x-unicode, x-user-def, x-baltic, el, tr, he, ar, th, ja, zh-cn or zh-tw */ setintpref("font.size.fixed.x-western", newfontsize); setintpref("font.size.variable.x-western", newfontsize); /* for other i18n charsets, change the name as explained...
...how we expose this through the user interface is another matter.
...for example, settings per url would allow a user to accept scripts from their known benign web pages, but not others.
Multiprocess on Windows
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.
...if you only register your interfaces in one process, com won't be able to understand the interface in the other process.
... for those interfaces that do contain length_is or size_is annotations, we need to use another api declared in mozilla/mscom/registration.h: registerarraydata().
...on the other hand, some apis in the mscom library require you to use smart pointers that are able to cross apartment boundaries.
Add-ons
among other things, an add-on could: change the appearance or content of particular websites modify the firefox user interface add new features to firefox there are several types of add-ons, but the most common type are extensions.
...other toolsets, such as overlay add-ons, bootstrapped add-ons, and the add-on sdk, are no longer supported.
...you can see the apis currently supported in firefox and other browsers.
... other types of add-ons in addition to extensions, there are a few other add-on types that allow users to customize firefox.
Continuous Integration
the sheriffs' role is to "keep the tree green", or in other words, to keep the code in our respositories in a good state, to the extent that the state is reflected in the output shown on treeherder.
... each taskcluster job is represented by a colored label; green means a job has succeeded, while other colors represent different kinds of problems.
... other performance systems autophone (android) autophone is a test harness which runs a set of performance tests on a variety of real android phones.
... perfherder alerts we track changes to talos and other performance frameworks inside perfherder, and try to automatically alert when there is a sustained change exceeding a certain magnitude (specified per test).
Creating Sandboxed HTTP Connections
since nsistreamlistener does not cover cookies, the current channel being used will need to be stored as a global, since another listener will be used for cookie notifications (covered in the next section).
... for example, this means that if the user was logged into an webmail account, another account on the same domain could be checked without changing the user's cookies.
...if amerge is true, the new value is appened, otherwise the old value is overwritten.
...if amerge is true, the new value is appened, otherwise the old value is overwritten.
Inner and outer windows
then add to that the concept of frames, whereby a document in a window can itself contain other documents, which in turn can contain more documents.
...this may be a window or a tab, or it might be an <iframe> contained within another document.
...in other words, window always returns the outer window.
... nested windows things become slightly more complex when you consider that documents can contain other documents.
Contributing to the Mozilla code base
if getting involved in design, support, translation, testing, or other types of contributions sparks your interest please see community webiste.
... fix your pet peeve if there's something you'd like to fix about firefox, thunderbird, or your other favorite mozilla application, this can be a great place to start.
... ask for help in a comment on the bug, or in #introduction:mozilla.org or #developers:mozilla.org check out https://developer.mozilla.org/docs/developer_guide and its parent document, https://developer.mozilla.org/docs/mozilla our reviewer checklist is very useful, if you have a patch near completion, and seek a favorable review utilize our build tool mach, its linting, static analysis, and other code checking features step 3: get your code reviewed once you fix the bug, you can advance to having your code reviewed.
...the reviewer in those bugs might be another good choice we have a list of modules, which lists peers and owners for the module.
Overview of Mozilla embedding APIs
using this function, one can use nsisupports instances and still easily access other interfaces via nsiinterfacerequestor.
...a content handler may be an existing or new window, a helper application or the unknown content handler - if no other handler can be found for the content-type.
... contract-id: ns_uri_loader_contractid implemented interfaces: nsiuriloader related interfaces: nsiuricontentlistener nsunknowncontenttypehandler the unknowncontenttypehandler service is the last resort of the uriloader when no other content handler can be located.
...the webbrowser provides a simple mechanism for other applications to leverage gecko functionality.
Mozilla Content Localized in Your Language
other regional calendar observed?
...reference material on other languages can be found here.
... what are other widely used currency and symbols used in your country/language for paid apps.
... the sequence of the sentence structure in another language may not translate well, when a sentence is half finished as such.
Localizing with Pontoon
in-context pontoon's in-context translation mode is what puts it above others.
... translation helpers as you can see, suggestions from history, translation memory, machine translation and other locales are also available in the out-of-context translation panel.
... we call all of these translation helpers and here's how each of them will help you as you translate strings: history displays previously suggested translations, including from other users.
... other locales displays matching translations from other locales.
Localization formats
<h1><?php echo ___("getting started")?></h1> function ___($str) { return $array[$str]; } advantage to .lang simple work-flow allowing the web developer to place the file in svn and it can appear on the staging server .lang syntax is like simplified .po, 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 comme...
...nts 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 localizers know and love gettext (.po) gettext is a widely-used localization format that uses .po files.
... wiki blogging, documentation, and other types of mozilla content often surface as wikis.
...so, if a localizer wanted to use one of the many powerful gettext tools, like po-editor, the msgid provides no context for translation or for other localizers to verify translations when qa-ing.
Mozilla Style System
the handling of those computed values is the responsibility of other parts of the code.
...in one half (the backend) are the sources of specified style data, and in the other half (the frontend) is the code that turns the specified values into computed values.
... the barrier between these two halves consists of three abstract interfaces, plus some smaller structures associated with some methods on each: nsistylesheet nsistylesheet represents what one would think of as a style sheet: the in-memory representation of a css file or other source of style data.
...however, they also exist for the other types of rule processors.
Investigating leaks using DMD heap scan mode
dmd heap scan mode is a "tool of last resort" that should only be used when all other avenues have been tried and failed, except possibly ref count logging.
... besides $leakaddr, the other interesting part is the chunk at the bottom.
...clamping is the same kind of analysis that a conservative gc does: if a word-aligned value in a heap block points to somewhere within another heap block, replace that value with the address of the block.
... after that is done, we can finally find out which objects (possibly) point to other objects, using the block_analyzer script: python $srcdir/memory/replace/dmd/block_analyzer.py dmd-$pid.log.gz $leakaddr this will look through every block of memory in the log, and give some basic information about any block of memory that (possibly) contains a pointer to that object.
Emscripten
generated from c/c++ using clang, or from another language) and compiles that into javascript, which can be run on the web.
... 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)!
... 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.
NSPR Poll Method
the nspr library provides a reference implementation of the bottom layer using the sockets api, but you can provide your own implementation of the bottom layer using another network transport api.
... new_flags = fd->methods->poll(fd, pr_poll_write, &out_flags); if you are interested in calling both pr_recv and pr_send on the same file descriptor, make two separate calls to the poll method, one with pr_poll_read as in_flags and the other with pr_poll_write as in_flags, so that you know what events at the network transport layer pr_poll_read and pr_poll_write are mapped to, respectively.
...otherwise ((new_flags & out_flags) is 0), you should do the following.
... if new_flags contains pr_poll_read, you should try pr_recv or pr_send when the underlying network transport is readable if new_flags contains pr_poll_write, you should try pr_recv or pr_send when the underlying network transport is writable important do not use out_flags in any way other than testing if (new_flags & out_flags) is 0.
PR_MkDir
it may be applicable to other platforms in the future.
...read by others.
...write by others.
...search by others.
PR_PushIOLayer
in other words, stack continues to point to the top of the stack after the function returns.
... the intent is that the pointer to the stack remain the stack's identity even if someone (perhaps covertly) has pushed other layers.
... the contents of the caller's object are swapped into another container, including the reference to the object's destructor.
...if the containers are allocated by some method other than pr_createiolayerstub, it may be required that the stack have the layers popped off (in reverse order that they were pushed) before calling pr_close.
Threads
each thread is an execution entity that is scheduled independently from other threads in the same process.
...to synchronize the termination of a thread, you can join it with another thread (see pr_jointhread).
... interrupting and yielding pr_interrupt requests an interrupt of another thread.
... pr_sleep causes a thread to yield to other threads for a specified number of ticks.
NSS Certificate Download Specification
netscape certificate sequence: this is another pkcs#7 object format, and like the signeddata format, it allows multiple certificates to be imported together.
...regardless of which of the supported binary formats is used, the begin and end lines must say certificate, and not any other word (such as key).
... application/x-x509-email-cert the certificate being downloaded is a user certificate belonging to another user for use with s/mime.
...this is intended to allow people or cas to post their e-mail certificates on web pages for download by other users who want to send them encrypted mail.
FIPS Mode - an explanation
some other governments have also adopted many of the fips regulations, so their applicability is somewhat wider than just the us government's personnel.
... 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.
... this makes it difficult to move keys from one device to another, and consequently, all crypto engines and key storage must be in a single device rather than being split up into several devices.
... 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.
NSS 3.12.4 release notes
to be matched between [ and ], these characters must be escaped: \ ] no other characters need be escaped between brackets.
...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.
...exclusions cannot be nested (contain other exclusions).
...od_formatpair - secmod_mknewmodulespec] bug 498509: produce debuggable optimized builds for mozilla on macosx bug 498511: produce debuggable optimized nss builds for mozilla on linux bug 499385: drbg reseed function needs to be tested on post bug 499825: utilrename.h is missing from solaris packages bug 502961: allocator mismatch in pk11mode bug 502965: allocator mismatch in sdrtest bug 502972: another allocator mismatch in sdrtest bug 504398: pkix_pl_aiamgr_gethttpcerts could crash if sec_getregisteredhttpclient fails bug 504405: pkix_pl_crldp_create will fail on alloc success because of a missing !
Overview of NSS
open source crypto libraries proven application security architecture if you want to add support for ssl, s/mime, or other internet security standards to your application, you can use network security services (nss) to implement all your security features.
... nss provides a complete open-source implementation of the crypto libraries used by aol, red hat, google, and other companies in a variety of products, including the following: mozilla products, including firefox, thunderbird, seamonkey, and firefox os.
...rsa standard that governs the format used to store or transport private keys, certificates, and other secret material.
... complete software development kit in addition to libraries and apis, nss provides security tools required for debugging, diagnostics, certificate and key management, cryptography module management, and other development tasks.
Build instructions
(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.
... hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss if you want to build a releases other than the tips of these repositories, then switch to the release tags: cd nspr hg update nspr_4_9_5_rtm cd ../nss hg update nss_3_14_2_rtm cd ..
...otherwise, you get a debug build.
... to build with gcc on platforms other than linux and windows, you need to set two more environment variables: ns_use_gcc=1 no_mdupdate=1 for hp-ux, you must set the environment variable use_pthreads to 1.
NSS environment variables
in other words a connection will be dropped at initial handshake if a server or client do not support safe renegotiation.
... 3.4 nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an error to try to use a pkcs#11 crypto module in a process before it has been initialized in that process, even if the module was initialized in the parent process.
... if set to any other non-empty value, softoken will report an error in both debug and non-debug builds.
... 3.12.8 nsdistmode string on operating systems other than windows, this controls whether copies, absolute symlinks, or relative symlinks of the output files should be published to mozilla/dist.
NSS tools : crlutil
critical/non-critical: is 1 when extension is critical and 0 otherwise.
...should be set to 1 if this extension is critical or 0 otherwise.
...this extension allows users to easily determine when a particular crl supersedes another crl crlnumber non-critical number where: crlnumber: identifies the name of an extension critical: should be set to 0 since this is non-critical extension number: value of long which identifies the sequential number of a crl.
...keycompromise (1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6), removefromcrl (8), privilegewithdrawn (9), aacompromise (10) * add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid.
NSS Tools crlutil
critical/non-critical: is 1 when extension is critical and 0 otherwise.
...should be set to 1 if this extension is critical or 0 otherwise.
...this extension allows users to easily determine when a particular crl supersedes another crl crlnumber non-critical number where: crlnumber: identifies the name of an extension critical: should be set to 0 since this is non-critical extension number: value of long which identifies the sequential number of a crl.
... superseded (4), cessationofoperation (5), certificatehold (6), removefromcrl (8), privilegewithdrawn (9), aacompromise (10) add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid.
NSS Tools modutil
the jar file should also contain any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation.
... -libfile library-file specify a path to the dll or other library file containing the implementation of the pkcs #11 interface module that is being added to the database.
...this name will be used to reference the module from netscape communicator, the security module database tool (modutil), servers, or any other program that uses the netscape security module database.
...this string is a bitwise or of the following constants: user read: 0400 user write: 0200 user execute: 0100 group read: 0040 group write: 0020 group execute: 0010 other read: 0004 other write: 0002 other execute: 0001 some platforms may not understand these permissions.
certutil
unless specified otherwise the default token is an internal slot (specifically, internal slot 2).
... o p - valid peer o p - trusted peer (implies p) o c - valid ca o t - trusted ca to issue client certificates (implies c) o c - trusted ca to issue server certificates (ssl only) (implies c) o u - certificate can be used for authentication or signing o w - send warning (use with other attributes to include a warning when the certificate is used in that context) the attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks.
...the trust arguments for certificates have the format ssl,s/mime,code-signing, so the middle trust settings relate most to email certificates (though the others can be set).
... o https://wiki.mozilla.org/nss_shared_db_howto o https://wiki.mozilla.org/nss_shared_db additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/.
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
critical/non-critical: is 1 when extension is critical and 0 otherwise.
...should be set to 1 if this extension is critical or 0 otherwise.
...this extension allows users to easily determine when a particular crl supersedes another crl crlnumber non-critical number where: crlnumber: identifies the name of an extension critical: should be set to 0 since this is non-critical extension number: value of long which identifies the sequential number of a crl.
...(1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6), removefromcrl (8), privilegewithdrawn (9), aacompromise (10) * add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid.
Functions
(but note that objects of other classes can be callable and can even have typeof obj == "function".) script functions functions written in javascript and compiled to bytecode.
...a nested function is algol-like if it is only ever defined and called, and it isn't accessed in any other way (and it is not a generator-function).
...some of these can even be fused with other operations into combo instructions like jsop_getargprop, jsop_forlocal, and jsop_inclocal.
...otherwise the gvar instructions are as slow as name instructions.
SpiderMonkey Internals: Thread Safety
they can't travel to other jscompartments.
...a single jscontext can run work with code and objects in multiple compartments as long as no other thread is accessing those compartments.
...in other words, gc waits until each other thread is either outside jsapi (in which case we don't care what it's doing) or else in jsapi, but blocked, waiting for gc to finish.
...and obviously you shouldn't block or otherwise dilly-dally while in a request; it prohibits gc.
JS::PersistentRooted
persistentrooted<t>& operator=(const persistentrooted<t>& other) bool operator!=(const t& other) const compares ptr and other.
... bool operator==(const t& other) const description js::persistentrooted<t> declares a variable of type t whose value is always rooted.
... note that you must not use an persistentrooted in an object owned by a js object: whenever one object whose lifetime is decided by the gc refers to another such object, that edge must be traced only if the owning js object is traced.
... in the context of firefox, this is a severe restriction: almost everything in firefox is owned by some js object or another, so using persistentrooted in such objects would introduce leaks.
JS_DeleteProperty2
on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise.
... otherwise obj has a non-permanent own property with the given name or id.
...otherwise, if obj is not configurable, an error is raised.
... otherwise, *succeeded receives true and the property is removed.
JS_InitClass
this structure defines the class for use by other api functions.
... unlike other jsnatives, this function must not call js_this or js_this_object.
...its value is the constructor function if constructor is non-null, and the prototype object otherwise.
...(this is a feature of the c and c++ languages.) otherwise, use memset.
JS_NewObject
otherwise it returns null.
...otherwise, object.prototype is used as the new object's prototype.
...in other words, the context's current scope acts as a default parent.
... otherwise, we use object.prototype, looking up the constructor for object as described above.
JS_ReportErrorNumber
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.
...otherwise, no javascript code is running in cx.
...otherwise, (???
JS_SetProperty
otherwise, [[set]] internal method defined in es2015 (rev 29 9.1.9) is performed.
... otherwise, if the lookup found a read-only property or obj non-extensible, nothing happens, but this is not an error.
... otherwise, if obj has an own property with the given name, then the existing property's value is set as described below.
...if the property has a javascript setter, it is called; otherwise, if it has a javascript getter, then an error is reported; otherwise the property's setter is called, passing the arguments (cx, obj, id, &v).
JS_ValueToString
otherwise the result is a decimal representation of the number, possibly using exponential notation.
... otherwise v is an object.
... otherwise, the resulting object's jsclass.convert callback is called.
... otherwise conversion fails with a typeerror.
SpiderMonkey 1.8.7
on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... these and other changes are explained in detail below.
... js_newobject and js_newobjectwithgivenproto remain the correct apis for creating other objects.
...the primary change in this interface is that it no longer counts operations; embedders are expected find another mechanism (such as a watchdog thread) to trigger regular callbacks, via js_triggeroperationcallback.
Exploitable crashes
any other crash where firefox tries to use memory it does not have access to indicates some kind of memory safety bug.
...the other tool is valgrind.
... other tools apple has a tool called "crashwrangler" that are still being maintained as of 2012.
...to get them go to the mac developer center downloads section -> other downloads -> search for "crashwrangler".
Querying Places
(in other words, the keywords from the first query are anded with all queries.) keywords from subsequent query objects are ignored.
...other sortings will work, however.
...contains uri, title, and other general info.
... containers containers hold lists of other containers and result nodes.
Accessing the Windows Registry Using XPCOM
introduction when implementing windows-specific functionality, it is often useful to access the windows registry for information about the environment or other installed programs.
... support in seamonkey and other non-toolkit applications in older versions of seamonkey and other non-toolkit-based applications, an interface existed called nsiwindowsregistry, containing the same method and named constants as the methods described above for firefox 1.0.
... it can be used as follows: var wss = components.classes["@mozilla.org/winhooks;1"] .getservice(components.interfaces.nsiwindowsregistry); var id = wss.getregistryentry(wss.hklm, "software\\microsoft\\windows\\currentversion", "productid"); backwards compatibility if you need to support firefox 1.0 and other older browser versions, you should check to see which interfaces are available.
... the following skeleton code will allow you to determine which interface to use: if ("@mozilla.org/windows-registry-key;1" in components.classes) { // firefox 1.5 or newer } else if ("@mozilla.org/winhooks;1" in components.classes) { // seamonkey or other older non-toolkit application } else if ("@mozilla.org/browser/shell-service;1" in components.classes) { var wss = components.classes["@mozilla.org/browser/shell-service;1"] .getservice(components.interfaces.nsiwindowsshellservice); if ("getregistryentry" in wss) { // firefox 1.0 } else { // nothing supported } } else { // nothing supported } ...
Aggregating the In-Memory Datasource
that is, you want to reflect the contents of something as an rdf graph (presumably so that it can be aggregated with other information or displayed as styled content).
...getiid()) || aiid.equals(nscomtypeinfo<nsisupports>::getiid())) { *aresult = ns_static_cast(nsiglobalhistory*, this); } else if (aiid.equals(nscomtypeinfo<nsirdfdatasource>::getiid())) { return minner->queryinterface(aiid, aresult); } else { *aresult = nsnull; return ns_nointerface; } ns_addref(ns_static_cast(nsisupports*, aresult)); return ns_ok; } the only other thing that you'll need to be aware of is that you'll need to queryinterface() from nsisupports to nsirdfdatasource before you can actually do anything useful with the datasource from within your object.
... you could also forward other interfaces to the minner that youknow it can support; however, this is extremely risky.
... it's risky because another implementation of the same object mightnot support those interfaces.
Avoiding leaks in JavaScript XPCOM components
the most common strategies for managing heap allocation are the following: malloc and free (or new and delete) the simplest strategy for heap allocation is that the programmer makes one function call to request memory from the heap and another one to return it.
...in this strategy, the object has a member that is the number of other objects that "own" it.
... one might think that the wrappers of native xpcom objects (to allow them to be used from javascript) would just work the other way around.
... (on wrapped objects other that dom nodes, we allow javascript programmers to set properties, but we don't do anything to protect them from garbage collection.
How to build an XPCOM component in JavaScript
defining the interface if you want to use your component in other xpcom components, you must define the interfaces that you want exposed.
...the library provides a simple example of its use in the source code (js/xpconnect/loader/xpcomutils.jsm), but here's another using this example.
...}; var components = [helloworld]; if ("generatensgetfactory" in xpcomutils) var nsgetfactory = xpcomutils.generatensgetfactory(components); // firefox 4.0 and higher else var nsgetmodule = xpcomutils.generatensgetmodule(components); // firefox 3.x note: starting with firefox 4.0 you will need to declare your component in chrome.manifest; classdescription and contractid properties on the other hand are no longer required.
... 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...
Setting up the Gecko SDK
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).
...if you choose some other location, remember to adjust the settings described here (e.g., in the building a microsoft visual cpp project section below) to point to this new location.
...note that mozilla-config.h may be need to be included before other includes in your component's source code.
...if your component will use other parts of the sdk (e.g., necko), you will have to add these include directories to this field as well.
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
on the other hand, we use streams to access files within a zip archive, to store and provide data coming from websites, even to talk to other programs on the same computer through "pipes" (more on that later).
... we even have streams that take input from other streams and transform the data within them to something more useful.
... netutil.jsm provides apis for copying an input stream to an output stream (the asynccopy() method), getting an input stream from another source (the asyncfetch() method), and reading an input stream into a string (the readinputstreamtostring() method).
...these work by taking the input from another stream, and providing a stream interface to access that underlying stream's data.
Components.utils.Sandbox
sandboxname a string value which identifies the sandbox in about:memory (and possibly other places in the future).
... this property is optional, but very useful for tracking memory usage of add-ons and other javascript compartments.
...however, it also occurs during cross-origin access between two content pages, since each page sees a "vanilla" view of the other.
...however, sandboxes are often used when chrome wants to run script as another origin, possibly to interact with the page.
NS ConvertASCIItoUTF16 external
iling defaultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar* a prunichar* b pruint32 length compare print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c equals prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint...
...32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c operator< prbool operator<(const nsastring&) const - source parameters nsastring& other prbool operator<(const prunichar*) const - source parameters prunichar* other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring& other prbool operator<=(const prunichar*) const - source par...
...ameters prunichar* other operator== prbool operator==(const nsastring&) const - source parameters nsastring& other prbool operator==(const prunichar*) const - source parameters prunichar* other operator>= prbool operator>=(const nsastring&) const - source parameters nsastring& other prbool operator>=(const prunichar*) const - source parameters prunichar* other operator> prbool operator>(const nsastring&) const - source parameters nsastring& other prbool operator>(const prunichar*) const - source parameters prunichar* other op...
...erator!= prbool operator!=(const nsastring&) const - source parameters nsastring& other prbool operator!=(const prunichar*) const - source parameters prunichar* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
NS ConvertUTF16toUTF8 external
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
NS ConvertUTF8toUTF16 external
iling defaultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar* a prunichar* b pruint32 length compare print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c equals prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint...
...32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c operator< prbool operator<(const nsastring&) const - source parameters nsastring& other prbool operator<(const prunichar*) const - source parameters prunichar* other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring& other prbool operator<=(const prunichar*) const - source par...
...ameters prunichar* other operator== prbool operator==(const nsastring&) const - source parameters nsastring& other prbool operator==(const prunichar*) const - source parameters prunichar* other operator>= prbool operator>=(const nsastring&) const - source parameters nsastring& other prbool operator>=(const prunichar*) const - source parameters prunichar* other operator> prbool operator>(const nsastring&) const - source parameters nsastring& other prbool operator>(const prunichar*) const - source parameters prunichar* other op...
...erator!= prbool operator!=(const nsastring&) const - source parameters nsastring& other prbool operator!=(const prunichar*) const - source parameters prunichar* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
NS LossyConvertUTF16toASCII external
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
PromiseFlatCString (External)
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
PromiseFlatString (External)
iling defaultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar* a prunichar* b pruint32 length compare print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c equals prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint...
...32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c operator< prbool operator<(const nsastring&) const - source parameters nsastring& other prbool operator<(const prunichar*) const - source parameters prunichar* other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring& other prbool operator<=(const prunichar*) const - source par...
...ameters prunichar* other operator== prbool operator==(const nsastring&) const - source parameters nsastring& other prbool operator==(const prunichar*) const - source parameters prunichar* other operator>= prbool operator>=(const nsastring&) const - source parameters nsastring& other prbool operator>=(const prunichar*) const - source parameters prunichar* other operator> prbool operator>(const nsastring&) const - source parameters nsastring& other prbool operator>(const prunichar*) const - source parameters prunichar* other op...
...erator!= prbool operator!=(const nsastring&) const - source parameters nsastring& other prbool operator!=(const prunichar*) const - source parameters prunichar* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
nsACString (External)
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
nsAutoString (External)
iling defaultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar* a prunichar* b pruint32 length compare print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c equals prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint...
...32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c operator< prbool operator<(const nsastring&) const - source parameters nsastring& other prbool operator<(const prunichar*) const - source parameters prunichar* other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring& other prbool operator<=(const prunichar*) const - source par...
...ameters prunichar* other operator== prbool operator==(const nsastring&) const - source parameters nsastring& other prbool operator==(const prunichar*) const - source parameters prunichar* other operator>= prbool operator>=(const nsastring&) const - source parameters nsastring& other prbool operator>=(const prunichar*) const - source parameters prunichar* other operator> prbool operator>(const nsastring&) const - source parameters nsastring& other prbool operator>(const prunichar*) const - source parameters prunichar* other op...
...erator!= prbool operator!=(const nsastring&) const - source parameters nsastring& other prbool operator!=(const prunichar*) const - source parameters prunichar* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
nsCAutoString (External)
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
nsCStringContainer (External)
g prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char a char b pruint32 length compare(const char*, print32 (*) print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char other print32* c compare(const nsacstring&, print32 (*) print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring other print32* c equals(const char*, print32 (*) prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source ...
... parameters char other print32* c equals(const nsacstring&, print32 (*) prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring other print32* c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring other prbool operator<(const char*) const - source parameters char other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring other prbool operator<=(const char*) const - source parameters char other operator== prbool...
... operator==(const nsacstring&) const - source parameters nsacstring other prbool operator==(const char*) const - source parameters char other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring other prbool operator>=(const char*) const - source parameters char other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring other prbool operator>(const char*) const - source parameters char other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring...
... other prbool operator!=(const char*) const - source parameters char other equalsliteral prbool equalsliteral(const char*) const - source parameters char other find(const nsacstring&, print32 (*) print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
nsCString external
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
nsDependentCString external
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
nsDependentCSubstring external
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
nsDependentString external
iling defaultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar* a prunichar* b pruint32 length compare print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c equals prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint...
...32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c operator< prbool operator<(const nsastring&) const - source parameters nsastring& other prbool operator<(const prunichar*) const - source parameters prunichar* other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring& other prbool operator<=(const prunichar*) const - source par...
...ameters prunichar* other operator== prbool operator==(const nsastring&) const - source parameters nsastring& other prbool operator==(const prunichar*) const - source parameters prunichar* other operator>= prbool operator>=(const nsastring&) const - source parameters nsastring& other prbool operator>=(const prunichar*) const - source parameters prunichar* other operator> prbool operator>(const nsastring&) const - source parameters nsastring& other prbool operator>(const prunichar*) const - source parameters prunichar* other op...
...erator!= prbool operator!=(const nsastring&) const - source parameters nsastring& other prbool operator!=(const prunichar*) const - source parameters prunichar* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
nsDependentSubstring external
aultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar a prunichar b pruint32 length compare(const prunichar*, print32 (*) print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar other print32* c compare(const nsastring&, print32 (*) print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring other print32* c equals(const prunichar*, print32 (*) prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, p...
...ruint32)) const - source parameters prunichar other print32* c equals(const nsastring&, print32 (*) prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring other print32* c operator< prbool operator<(const nsastring&) const - source parameters nsastring other prbool operator<(const prunichar*) const - source parameters prunichar other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring other prbool operator<=(const prunichar*) const - source parameters prunich...
...ar other operator== prbool operator==(const nsastring&) const - source parameters nsastring other prbool operator==(const prunichar*) const - source parameters prunichar other operator>= prbool operator>=(const nsastring&) const - source parameters nsastring other prbool operator>=(const prunichar*) const - source parameters prunichar other operator> prbool operator>(const nsastring&) const - source parameters nsastring other prbool operator>(const prunichar*) const - source parameters prunichar other operator!= prbool opera...
...tor!=(const nsastring&) const - source parameters nsastring other prbool operator!=(const prunichar*) const - source parameters prunichar other equalsliteral prbool equalsliteral(const char*) const - source parameters char aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
nsLiteralCString (External)
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
nsLiteralString (External)
et prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const char*, const char*, pruint32) - source parameters char* a char* b pruint32 length compare print32 compare(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* other print32 (*)(char*, char*, pruint32) c print32 compare(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c equals prbool equals(const char*, print32 (*)(const char*, const char*, pruint32)) const - source parameters ...
... char* other print32 (*)(char*, char*, pruint32) c prbool equals(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source parameters nsacstring& other print32 (*)(char*, char*, pruint32) c operator< prbool operator<(const nsacstring&) const - source parameters nsacstring& other prbool operator<(const char*) const - source parameters char* other operator<= prbool operator<=(const nsacstring&) const - source parameters nsacstring& other prbool operator<=(const char*) const - source parameters char* other operator== prbool operator==...
...(const nsacstring&) const - source parameters nsacstring& other prbool operator==(const char*) const - source parameters char* other operator>= prbool operator>=(const nsacstring&) const - source parameters nsacstring& other prbool operator>=(const char*) const - source parameters char* other operator> prbool operator>(const nsacstring&) const - source parameters nsacstring& other prbool operator>(const char*) const - source parameters char* other operator!= prbool operator!=(const nsacstring&) const - source parameters nsacstring& oth...
...er prbool operator!=(const char*) const - source parameters char* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* other find print32 find(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
nsStringContainer (External)
iling defaultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar* a prunichar* b pruint32 length compare print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c equals prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint...
...32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c operator< prbool operator<(const nsastring&) const - source parameters nsastring& other prbool operator<(const prunichar*) const - source parameters prunichar* other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring& other prbool operator<=(const prunichar*) const - source par...
...ameters prunichar* other operator== prbool operator==(const nsastring&) const - source parameters nsastring& other prbool operator==(const prunichar*) const - source parameters prunichar* other operator>= prbool operator>=(const nsastring&) const - source parameters nsastring& other prbool operator>=(const prunichar*) const - source parameters prunichar* other operator> prbool operator>(const nsastring&) const - source parameters nsastring& other prbool operator>(const prunichar*) const - source parameters prunichar* other op...
...erator!= prbool operator!=(const nsastring&) const - source parameters nsastring& other prbool operator!=(const prunichar*) const - source parameters prunichar* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
nsString external
iling defaultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar* a prunichar* b pruint32 length compare print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c equals prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint...
...32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c operator< prbool operator<(const nsastring&) const - source parameters nsastring& other prbool operator<(const prunichar*) const - source parameters prunichar* other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring& other prbool operator<=(const prunichar*) const - source par...
...ameters prunichar* other operator== prbool operator==(const nsastring&) const - source parameters nsastring& other prbool operator==(const prunichar*) const - source parameters prunichar* other operator>= prbool operator>=(const nsastring&) const - source parameters nsastring& other prbool operator>=(const prunichar*) const - source parameters prunichar* other operator> prbool operator>(const nsastring&) const - source parameters nsastring& other prbool operator>(const prunichar*) const - source parameters prunichar* other op...
...erator!= prbool operator!=(const nsastring&) const - source parameters nsastring& other prbool operator!=(const prunichar*) const - source parameters prunichar* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
nsIBrowserHistory
markpageasfollowedlink() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was moved to another interface in gecko 22.0.
... markpageastyped() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was moved to another interface in gecko 22.0.
... adobatchnotify obsolete since gecko 9.0 if set to true, the beginupdatebatch and endupdatebatch events are sent; otherwise, no notification of changes to the history is provided.
...set to false otherwise.
nsICachingChannel
a cache key retrieved from a particular instance of nsicachingchannel could be set on another instance of nsicachingchannel provided the underlying implementations are compatible and provided the new channel instance was created with the same uri.
...a cache token retrieved from a particular instance of nsicachingchannel could be set on another instance of nsicachingchannel provided the underlying implementations are compatible.
... load_bypass_local_cache_if_busy 1 << 29 this load flag causes the local cache to be skipped if the request would otherwise block waiting to access the cache.
...return value returns true if this channel's data is being loaded from the cache, otherwise returns false.
nsIChannel
load_retargeted_document_uri 17 if the end consumer for this load has been retargeted after discovering its content, this flag will be set: load_replace 18 this flag is set to indicate that this channel is replacing another channel.
... this means that: the stream listener this channel will be notifying was initially passed to the asyncopen() method of some other channel this channel's uri is a better identifier of the resource being accessed than this channel's originaluri.
... this flag can be set, for example, for redirects or for cases when a single channel has multiple parts to it (and thus can follow onstoprequest with another onstartrequest/onstoprequest pair, each pair for a different request).
...like any other nsichannel method it must not be called on any thread other than the xpcom main thread.
nsIClipboardDragDropHooks
otherwise, false to indicates to the operating system that drop is not allowed.
...otherwise, false to show the drag is canceled (does not go to operating system).
...otherwise, false to indicate that the copy/drag is canceled, does not go to operating system.
...otherwise, false to indicate the action was not overridden, do built-in behavior.
nsICookieManager2
presence of a leading dot indicates a domain cookie; otherwise, the cookie is treated as a non-domain cookie.
...'.foo.com', not '.com'), otherwise an exception will be thrown.
...this should consist only of the host portion of the uri and should not contain a leading dot, port number, or other information.
...this should consist only of the host portion of the uri and should not contain a leading dot, port number, or other information.
nsICryptoHash
" must be called before any other method on this interface is called.
..." must be called before any other method on this interface is called.
... computing the hash of a string another common operation is computing the hash value of a string.
... createinstance(components.interfaces.nsiscriptableunicodeconverter); // we use utf-8 here, you can choose other encodings.
nsIDOMEvent
if the event was retargeted for some reason other than an anonymous boundary crossing, this will be set to the target before the retargeting occurs.
...if called from a subclass of event interface only the values specified in the initevent method are modified, all other attributes are left unchanged.
...it is also strongly recommended that third parties adding their own events use their own prefix to avoid confusion and lessen the probability of conflicts with other new events.
...serialize() void serialize( in ipcmessageptr amsg, in boolean aserializeinterfacetype ); parameters amsg aserializeinterfacetype native code only!settarget void settarget( in nsidomeventtarget atarget ); parameters atarget native code only!settrusted void settrusted( in boolean atrusted ); parameters atrusted stopimmediatepropagation() prevents other event listeners from being triggered and, unlike stoppropagation() its effect is immediate.
nsIDOMMouseScrollEvent
ctrlkeyarg true if the control key was down when the event occurred, otherwise false.
... altkeyarg true if the alt key was down when the event occurred, otherwise false.
... shiftkeyarg true if the shift key was down when the event occurred, otherwise false.
... metakeyarg true if the meta key was down when the event occurred, otherwise false.
nsIHTMLEditor
returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br> at the caret.
... void indent( in astring aindent ); parameters aindent insertelementatselection() insert an element, which may have child nodes, at the selection used primarily to insert a new element for various insert element dialogs, but it enforces the html 4.0 dtd "cancontain" rules, so it should be useful for other elements.
... void pastenoformatting( in long aselectiontype ); parameters aselectiontype rebuilddocumentfromsource() rebuild the entire document from source html needed to be able to edit head and other outside-of-body content.
... the selection is set to parent-of-aelement with an offset 1 greater than aelement's offset but it enforces the html 4.0 dtd "cancontain" rules, so it should be useful for other elements.
nsIInstallLocation
return value an nsifile if the package exists otherwise null.
... itemismanagedindependently() determines whether or not an item's resources are managed by the extension system or by some other user or process.
... for example, items linked to by text links are managed by the user, and items linked to from registry install locations are usually managed by other applications or installers.
... return value true if the item's resources are managed independently of the extension system, false otherwise.
nsIJumpListItem
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: to consumers: it's reasonable to expect we'll need support for other types of jump list items (an audio file, an email message, etc.).
... methods equals() compare this item to another.
... compares the type and other properties specific to this item's type: separator - type link - type, uri, title shortcut - type, handler application boolean equals( in nsijumplistitem item ); parameters item another nsijumplistitem to compare to.
... return value true if items are the same, otherwise false ...
nsIMessageSender
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message senders enable clients to send asynchronous messages to a single "other side".
...to send messages to multiple "other sides", you would use nsimessagebroadcaster.
...methods void sendasyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendasyncmessage() send messagename and obj to the "other side" of this message manager.
... for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
nsINavHistoryResultObserver
anode the node to insert into the container; it may be either a leaf or another container.
...this method is called after the item has been removed from the parent, but before any other action is taken (including zeroing out the item's parent reference).
... nodereplaced() called when a node is being replaced with another node at the same location.
...for many other types of views, this will not be applicable.
nsINavHistoryResultViewer
note: most methods in this interface were renamed in gecko 1.9.2, and others have slightly different parameter lists.
... remarks this method is called after the item has been removed from the parent, but before any other action is taken (including zeroing out the item's parent reference).
... nodereplaced() called when a node is being replaced with another node at the same location.
... anode the node to insert into the container; it may be either a leaf or another container.
nsIProtocolHandler
uri_forbids_automatic_document_replacement 1<<5 "automatic" loads that would replace the document (such as a meta refresh, certain types of xlinks, and other non-user-triggered loads) are not allowed if the originating uri has this protocol flag.
... uri_is_local_file 1<<9 uris for this protocol from other origins should only be allowed if those origins should have access to the local file system.
... return value return true if the override is approved; otherwise, return false.
...otherwise, aspec may be resolved relative to abaseuri, depending on the protocol.
nsIStringBundle
you may also use other formatting codes.
...do not try to use any other types.
...you may also use other formatting codes, but can only pass unicode strings in.
...do not try to use any other types.
nsISupportsArray
supports aelement); nsisupports elementat(in unsigned long aindex); violates the xpcom interface guidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean equals([const] in nsisupportsarray other); violates the xpcom interface guidelines long getindexof(in nsisupports apossibleelement); long getindexofstartingat(in nsisupports apossibleelement, in unsigned long astartindex); long getlastindexof(in nsisupports apossibleelement); long indexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines long indexofstartingat([const] in nsisupports apossibleele...
...ment, in unsigned long astartindex); violates the xpcom interface guidelines boolean insertelementat(in nsisupports aelement, in unsigned long aindex); violates the xpcom interface guidelines boolean insertelementsat(in nsisupportsarray aother, in unsigned long aindex); violates the xpcom interface guidelines long lastindexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines boolean moveelement(in long afrom, in long ato); violates the xpcom interface guidelines boolean removeelementat(in unsigned long aindex); violates the xpcom interface guidelines boolean removeelementsat(in unsigned long aindex, in unsigned long acount); violates the xpcom interface guidelines boolean removelastelement([const] in nsisupports aelement); violates the xpcom interfa...
... boolean enumeratebackwards( in nsisupportsarrayenumfunc afunc, in voidptr adata ); parameters afunc adata return value enumerateforwards() [notxpcom, noscript] boolean enumerateforwards( in nsisupportsarrayenumfunc afunc, in voidptr adata ); parameters afunc adata return value violates the xpcom interface guidelines equals() boolean equals( [const] in nsisupportsarray other ); parameters other return value getindexof() long getindexof( in nsisupports apossibleelement ); parameters apossibleelement return value getindexofstartingat() long getindexofstartingat( in nsisupports apossibleelement, in unsigned long astartindex ); parameters apossibleelement astartindex return value getlastindexof() long getlastindexof( in nsisupports apossibleelemen...
..., in unsigned long astartindex ); parameters apossibleelement astartindex return value violates the xpcom interface guidelines insertelementat() boolean insertelementat( in nsisupports aelement, in unsigned long aindex ); parameters aelement aindex return value violates the xpcom interface guidelines insertelementsat() boolean insertelementsat( in nsisupportsarray aother, in unsigned long aindex ); parameters aother aindex return value violates the xpcom interface guidelines lastindexof() long lastindexof( [const] in nsisupports apossibleelement ); parameters apossibleelement return value violates the xpcom interface guidelines moveelement() boolean moveelement( in long afrom, in long ato ); parameters afrom ato return value ...
nsISupports proxies
when one is busy, the other is blocked.
... i believe that other people working on mozilla need similar solutions.
... proxy_async, on the other hand, is a "fire and forget" method call.
...if you have created the object yourself and then created the proxy, please note that you will have at least a refcount of 2 (one for the proxy and one for the created object which you passed into getproxyobject, plus any other refcounts which you may have).
nsIThread
instead, you must only call it from another thread (usually the thread that created it, or the main application thread).
... note: this method must be called from within the thread itself, and not from another thread.
...since other threads may add events to the current thread, it's possible that by the time this method returns, the event queue may no longer be empty, even if a false result is reported.
...this can cause random crashes and other bugs that may be hard to find and fix.
nsIWindowMediator
otherwise this variable is ignored.
...otherwise this value will be null.
... native code only!setzposition a window has been positioned behind another.
...in fact, those methods usually (always?) return a chromewindow object, implementing both of those interfaces and a few others, when called from javascript code.
nsIWindowsRegKey
key hkey this attribute exposes the native hkey and is available to provide c++ consumers with the flexibility of making other windows registry api calls that are not exposed via this interface.
...it is still possible to enumerate values that have other types (that is, getvaluetype() may return a type not defined below).
...return value this method returns true if the key has changed and false otherwise.
...otherwise, only this key is watched.
Troubleshooting XPCOM components registration
registration failure if the module is loading correctly but doesn't register its components, try adding calls to components.utils.reporterror("debug me!"); in nsgetmodule() and other functions to try and find any errors.
... if you are testing a build from your linux distribution (or other vendor-supplied build), look for -dev packages from them.
... do not add any other directories; in particular, do not add your extension's (or xulrunner application's) components directory.
...it may then be necessary for the stub to locate the newer runtime libraries for the other files it loads.
Using nsIDirectoryService
since it was a component and was loaded implicitly by many other components, it was difficult to customize.
... customizing the locations is important if, for example, your application already has a profile directory or other resource directories.
...the location of the components folder and the components registry, among other things, are relative to the /bin directory.
...again, if you do this, do not initialize the profile service - it's either one or the other.
Weak reference
this design, however, is flawed, as it holds the observer in existence longer than would otherwise be necessary.
...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.
... it really feels like the nsiweakreference that you are holding is just another interface on the target object.
... } alternatives this technique is useful, but in situations where you need this, there are two alternatives which you may want to consider: you might hold an owning reference, but arrange to release it out-of-band; this must be before the destructor, which would otherwise never be called.
Autoconfiguration in Thunderbird
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).
...this may be on the same machine as other web servers, but the web server must be configured to the content to any requested domain.
... all config files must be served as content-type: text/xml (or application/xml), otherwise the file will be ignored.
Using Objective-C from js-ctypes
otherwise, the following functions can be used, depending on return type and architecture.
... nsstring literals another objective-c syntax used is the @"..." literal, which creates nsstring instance.
... let objc_msgsend = lib.declare("objc_msgsend", ctypes.default_abi, id, id, sel, "..."); let objc_msgsend_bool = lib.declare("objc_msgsend", ctypes.default_abi, bool, id, sel, "..."); other functions can be declared fluently, using id instead of class as the return type of objc_getclass.
... let objc_getclass = lib.declare("objc_getclass", ctypes.default_abi, id, ctypes.char.ptr); let sel_registername = lib.declare("sel_registername", ctypes.default_abi, sel, ctypes.char.ptr); calling variadic function objc_msgsend is a variadic function, so we should always pass it a cdata instance, other than this first and second argument, to declare each argument type.
Declaring and Using Callbacks
there is no concurrency logic in js-ctypes, so invoking callbacks on other threads will cause things to crash.
... the return type of the javascript callback must match the return type declared, otherwise js-ctypes will throw an error saying "unexpected return type".
... var myfunctypedeclaration = ctypes.functiontype(ctypes.default_abi, ctypes.bool, [ctypes.int, ctypes.voidptr_t]); function myjscallback(cint, cptr) { return true; // as the return of the functiontype was ctypes.bool we must make our javascript callback return bool otherwise js-ctypes will throw error saying unexpected type return } var myccallback = myfunctypedeclaration.ptr(myjscallback); example 2 this callback that returns void and no arguments.
... var myfunctypedeclaration = ctypes.functiontype(ctypes.default_abi, ctypes.void_t, []); function myjscallback() { return undefined; // as the return of the functiontype was ctypes.void_t we must return undefined or dont return at all otherwise js-ctypes will throw an error saying unexpected type } var myccallback = myfunctypedeclaration.ptr(myjscallback); using callbacks since callbacks are function pointers in c, js-ctypes has special handling for function pointer types.
Standard OS Libraries
gtk+ is the framework used under firefox (and other mozilla applications like thunderbird).
... the other framework used in unix systems is qt.
... // placeholder - example soon to come x11 x11 runs primarily on unix® and unix-like operating systems like linux, all of the bsd variants, sun solaris both native 32 and 64 bit support, solaris x86, mac os x (via darwin) as well as other platforms like os/2 and cygwin.
...undrestanding js-ctypes is important as arrays and other features used in jni.jsm will require us to create arrays from the types available to the ctypes.jsm module.
Working with data
this will also work: `ctypes.int.array()(jsarr)` mycarr.addressofelement(0).contents; // outputs: 4 mycarr.addressofelement(1).contents; // outputs: 10 type casting you can type cast data from one type to another by using the ctypes.cast() function: var newobj = ctypes.cast(origobj, newtype); this will return a new object whose data block is shared with the original object, but whose type is newtype.
... example: cast an array this example shows how to cast an array of a certain type to another type.
...javascript, on the other hand, uses the string object to represent strings.
... creating a 64-bit value using join() the join() method offered by the int64 and uint64 objects provides another way to construct 64-bit integers.
Plug-in Development Overview - Plugins
for example: str 128 mime type string 1 video/quicktime string 2 mov, moov string 3 audio/aiff string 4 aiff string 5 image/jpeg string 6 jpg several other optional strings may contain useful information about the plug-in.
... plug-ins must support 'str#' 128 but are not required to support any of these others: str#' 127 can contain a list of mime type descriptions corresponding to the types in 'str#' 128 .
... drawing a plug-in instance before drawing itself on the page, the plug-in must provide information about itself, set the window or other target in which it draws, arrange for redrawing, and handle events.
... working with urls the plug-in api provides methods that plug-ins can use to retrieve data from or post data to a url anywhere on the network, provide hyperlinks to other documents, post form data to cgi scripts using http, or upload files to a remote server using ftp.
URLs - Plugins
wysiwyg placed before another url; displays a page that javascript has updated using document.write.
...this is the way that plug-ins provide hyperlinks to other documents or retrieve data from the network.
... here's an example of getting a url: a plug-in instance draws a button that acts like a link to another web page.
... windows and mac if a file is posted with any protocol other than ftp, the file must be text with unix-style line breaks ('\n' separators only).
Intensive JavaScript - Firefox Developer Tools
there's also a video version of this walkthrough: the demo website looks like this: it has three controls: a radio button group to control how to run the javascript: as a single blocking operation in the main thread, as a series of smaller operations in the main thread using requestanimationframe(), or in another thread using a worker.
... leaving the radio button set to "use blocking call in main thread", make a recording: press the "start animations" button start recording a performance profile press "do pointless computations!" two or three times stop recording the profile exactly what you see will vary from one machine to another, but it will be something like this: the top half of this is the waterfall overview.
...e) { primes.push(candidate); } // schedule the next var testfunction = testcandidate.bind(this, index + 1); window.requestanimationframe(testfunction); } var primes = []; var testfunction = testcandidate.bind(this, 0); window.requestanimationframe(testfunction); } let's test this version out: select the radio button labeled "use requestanimationframe" and capture another profile.
...the main thread and the worker thread can't call each other directly, but communicate using an asynchronous messaging api.
about:debugging (before Firefox 68) - Firefox Developer Tools
there's a better way to handle the other cases: click the "reload" button next to the "debug" button.
... this does what it says: reloading any persistent scripts, such as background scripts parsing the manifest.json file again, so changes to permissions, content_scripts, browser_action or any other keys will take effect.
...it will be disabled for all other add-ons.
... workers the workers page shows your workers, categorised as follows: all registered service workers all registered shared workers other workers, including chrome workers and dedicated workers you can connect the developer tools to each worker, and send push notifications to service workers.
Firefox Developer Tools
accessibility inspector provides a means to access the page's accessibility tree, allowing you to check what's missing or otherwise needs attention.
...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.
... connecting to other browsers connect the developer tools to chrome on android and safari on ios.
... migrating from firebug firebug has come to the end of its lifespan (see firebug lives on in firefox devtools for details of why), and we appreciate that some people will find migrating to another less familiar set of devtools to be challenging.
AudioNode - Web APIs
WebAPIAudioNode
on the other hand, a destination node has no outputs; instead, all its inputs are directly played back on the speakers (or whatever audio output device the audio context uses).
...the exact processing done 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).
... audionode.connect() allows us to connect the output of this node to be input into another node, either as audio data or as the value of an audioparam.
... audionode.disconnect() allows us to disconnect the current node from another one it is already connected to.
Beacon API - Web APIs
there are other techniques used to ensure that data is submitted.
...another technique is to create a no-op loop for several seconds within the unload handler to delay the unload and submit data to a server.
...if the browser successfully queues the request for delivery, the method returns "true" and returns "false" otherwise.
...if the browser successfully queues the request for delivery, the method returns "true" and otherwise returns "false".
Using dynamic styling information - Web APIs
however, this property only returns style attributes that have been set in-line (e.g, <td style="background-color: lightblue"> returns the string "background-color:lightblue", or directly for that element using element.style.propertyname, even though there may be other styles on the element from a stylesheet).
...however, this will not affect any other property declarations for that element's styles, such as padding or margin or font, for example.
...</p> <!-- passes the 'p1' id of another element's style to modify.
... var el = document.getelementbyid('some-element'); el.setattribute('style', 'background-color:darkblue;'); be aware, however, that setattribute removes all other style properties that may already have been defined in the element's style object.
Pixel manipulation with canvas - Web APIs
you can also create a new imagedata object with the same dimensions as the object specified by anotherimagedata.
... var myimagedata = ctx.createimagedata(anotherimagedata); getting the pixel data for a context to obtain an imagedata object containing a copy of the pixel data for a canvas context, you can use the getimagedata() method: var myimagedata = ctx.getimagedata(left, top, width, height); this method returns an imagedata object representing the pixel data for the area of the canvas whose corners are represented by the points (left,top), (left+width, top), (left, top+height), and (left+width, top+height).
...then we copy that one over to another canvas and resize the image to the size we want it to.
... note: be aware that if the canvas contains any pixels that were obtained from another origin without using cors, the canvas is tainted and its contents can no longer be read and saved.
Using channel messaging - Web APIs
the channel messaging api allows two separate scripts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, or two documents via a sharedworker) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
... use cases channel messaging is mainly useful in cases where you've got a social site that embeds capabilities from other sites into its main interface via iframes, such as games, address book, or an audio player with personalized music choices.
...you have to think about whether the origins trust one another, and how the messages are passed.
... message channels on the other hand can provide a secure channel that allows you to pass data between different browsing contexts.
Channel Messaging API - Web APIs
the channel messaging api allows two separate scripts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, two documents via a sharedworker, or two workers) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
...once created, the two ports of the channel can be accessed through the messagechannel.port1 and messagechannel.port2 properties (which both return messageport objects.) the app that created the channel uses port1, and the app at the other end of the port uses port2 — you send a message to port2, and transfer the port over to the other browsing context using window.postmessage along with two arguments (the message to send, and the object to transfer ownership of, in this case the port itself.) when these transferable objects are transferred, they are 'neutered' on the previous context — the one they previously belonged to.
... the other browsing context can listen for the message using messageport.onmessage, and grab the contents of the message using the event's data attribute.
... messageport controls the ports on the message channel, allowing sending of messages from one port and listening out for them arriving at the other.
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
to insert this text into your html page, you need to make this text node a child of some other node element.
...another important note is that the appendchild method will append the child after the last child, just like the word world has been added after the word hello.
... creating new elements with the document object and the createelement(..) method you can create new html elements or any other element you want with createelement.
...the table's border property was set using another dom method, setattribute().
Element.getBoundingClientRect() - Web APIs
properties other than width and height are relative to the top-left of the viewport.
... the amount of scrolling that has been done of the viewport area (or any other scrollable element) is taken into account when computing the bounding rectangle.
...while the in operator and for...in will find returned properties, other apis such as object.keys() will fail.
... rect = elt.getboundingclientrect() // the result in emptyobj is {} emptyobj = object.assign({}, rect) emptyobj = { ...rect } {width, ...emptyobj} = rect domrect properties top, left, right, and bottom are computed using the values of the object's other properties.
Element.requestFullscreen() - Web APIs
note: this method must be called while responding to a user interaction or a device orientation change; otherwise it will fail.
... the element is not permitted to use the "fullscreen" feature, either because of feature policy configuration or other access control features.
... to learn when other code has toggled full-screen mode on and off, you should establish listeners for the fullscreenchange event on the document.
... if, on the other hand, full-screen mode is already in effect, we call document.exitfullscreen() to disable full-screen mode.
EventTarget.removeEventListener() - Web APIs
its value must match for removeeventlistener() to match, but the other values don't.
... now consider this: element.addeventlistener("mousedown", handlemousedown, { passive: true }); here, we specify an options object in which passive is set to true, while the other options are left to the default value of false.
...any of them in which capture or usecapture is true fail; all others succeed.
...ails element.removeeventlistener("mousedown", handlemousedown, { passive: false }); // succeeds element.removeeventlistener("mousedown", handlemousedown, false); // succeeds element.removeeventlistener("mousedown", handlemousedown, true); // fails it's worth noting that some browser releases have been inconsistent on this, and unless you have specific reasons otherwise, it's probably wise to use the same values used for the call to addeventlistener() when calling removeeventlistener().
Fetch API - Web APIs
WebAPIFetch API
concepts and usage fetch provides a generic definition of request and response objects (and other things involved with network requests).
... this will allow them to be used wherever they are needed in the future, whether it’s for service workers, cache api, and other similar things that handle or modify requests and responses, or any kind of use case that might require you to generate your responses programmatically (that is, the use of computer program or personal programming instructions).
...instead, these are more likely to be created as results of other api actions (for example, fetchevent.respondwith() from service workers).
...set-cookie headers from other sites are silently ignored.
File and Directory Entries API support in Firefox - Web APIs
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?
... this has caused a number of popular web sites not to work properly on browsers other than chrome.
... this article describes how the firefox implementation of the file and directory entries api differs from other implementations and/or the specification.
... to ensure your code will work in both chrome and other browsers, you can 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.
File and Directory Entries API - Web APIs
this is implemented by other interfaces which represent files or directories.
...the interfaces below otherwise mirror the ones from the asynchronous api.
...this is implemented by other interfaces which represent files or directories.
... other interfaces localfilesystem gives you access to a sandboxed file system.
HTMLImageElement.height - Web APIs
the height property of the htmlimageelement 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.
... otherwise, the image's height is represented using its natural (intrinsic) height, adjusted for the display density as indicated by naturalheight.
...one is 200px wide and the other is 400px wide.
... html specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 300px.
HTMLImageElement.width - Web APIs
the width property of the htmlimageelement 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.
... otherwise, the image's width is represented using its natural (intrinsic) width, adjusted for the display density as indicated by naturalwidth.
...one is 200px wide and the other is 400px wide.
... html specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 400px.
HTMLInputElement - Web APIs
src string: returns / sets the element's src attribute, which specifies a uri for the location of an image to display on the graphical submit button, if the value of type is image; otherwise it is ignored.
...this attribute applies when the value of the type attribute is text, search, tel, url or email; otherwise it is ignored.
...this attribute applies when the value of the type attribute is text, search, tel, url or email; otherwise it is ignored.
...applies only when type is set to text, search, tel, url, email, or password; otherwise it is ignored.
Checking when a deadline is due - Web APIs
on others you just get a standard text input, which is okay.
... week, 1-7), month (returns a number from 0-11, see below), and year (getfullyear() is needed; getyear() is deprecated, and returns a weird value that is not much use to anyone!) var objectstore = 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.
... 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: alert('incorrect month entered in database.'); } the first thing we do is convert the month names we have stored in the database into a month number that javascript will understand.
...action(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var request = objectstore.get(title); request.onsuccess = function() { // grab the data object returned as the result var data = request.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back into the database var requestupdate = objectstore.put(data); // when this new request succeeds, run the displaydata() function again to update the display requestupdate.onsuccess = function() { displaydata(); } if the checks all match, we then run the createnotification() function to provide a notification to the user.
KeyboardEvent.charCode - Web APIs
if the key pressed generates a character (e.g., 'a'), charcode is set to the code of that character; charcode respects the letter case (in other words, charcode takes into account whether the shift key is held down).
... otherwise, the code of the pressed key is stored in keycode.
...actually with the chinese ime i'm using, entering the ime results in a keypress event with keycode = 229 and no other key events fire until the ime exits (which may happen after multiple characters are inputted).
... i'm not sure if other ime's work this way.
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
note that some other implementations may fire keypress event if supported.
... when key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event is set to the string @ for the u.s keyboard type and " for the uk keyboard type, because of the active modifier shift key.
... as we finally release the shift key, another keyup event is fired for it, and the key attribute value remains shift.
... when key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event is set to be the string @ for the u.s keyboard type and " for the uk keyboard type, because of the active modifier shift key.
LockManager.request() - Web APIs
when an "exclusive" lock for a given name is held, no other lock with the same name can be held.
...when a "shared" lock for a given name is held, other "shared" locks for the same name can be granted, but no "exclusive" locks with that name can be held or granted.
...once the callback is invoked, no other running code on this orign can hold `my_resource` until the callback returns.
... return; } // the lock was granted, and no other running code in this origin is holding // the 'my_res_lock' lock until this returns.
MediaDevices.getDisplayMedia() - Web APIs
possible errors are: aborterror an error or failure that doesn't match any of the other exceptions below occurred.
...another potential cause for this event: the document in whose context getdisplaymedia() was called is not fully active; for example, perhaps it is not the frontmost tab.
... notreadableerror the user selected a screen, window, tab, or other source of screen data, but a hardware or operating system level error or lockout occurred, preventing the sharing of the selected source.
... browsers are encouraged to provide a warning to users about sharing displays or windows that contain browsers, and to keep a close eye on what other content might be getting captured and shown to other users.
MediaRecorder.onerror - Web APIs
in addition to other general errors that might occur, the following errors are specifically possible when using the mediastream recording api; to determine which occurred, check the value of mediarecordererrorevent.error.name.
... invalidstateerror an attempt was made to stop or pause or an inactive recorder, start or resume an active recorder, or otherwise manipulate the mediarecorder while in the wrong state.
... notsupportederror an attempt was made to instantiate a mediarecorder using a mime type that isn't supported on the user's device; one or more of the requested container, codecs, or profiles as well as other information may be invalid.
... unknownerror an non-security related error occurred that cannot otherwise be categorized.
MediaStream - Web APIs
mediastream.active read only a boolean value that returns true if the mediastream is active, or false otherwise.
...the order is not defined, and may not only vary from one browser to another, but also from one call to another.
...the order is not defined, and may not only vary from one browser to another, but also from one call to another.
...the order is not defined, and may not only vary from one browser to another, but also from one call to another.
Microdata DOM API - Web APIs
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.
...getitems( [ types ] ) returns a nodelist of the elements in the document that create items, that are not part of other items, and that are of the types given in the argument, if any are listed.
...in other cases, a new nodelist object must be returned.
...otherwise, an empty htmlpropertiescollection object.
MutationObserverInit - Web APIs
otherwise, a typeerror exception will be thrown.
...all of the other mutationobserverinit properties are then extended to all of the nodes in the subtree instead of applying solely to the target node.
...the default value is true if either of attributefilter or attributeoldvalue is specified, otherwise the default value is false.
...the default value is true if characterdataoldvalue is specified, otherwise the default value is false.
Node.compareDocumentPosition() - Web APIs
the node.comparedocumentposition() method reports the position of the given node relative to another node in any document — not just the given node’s document.
...ue is a bitmask of the following values: name value document_position_disconnected 1 document_position_preceding 2 document_position_following 4 document_position_contains 8 document_position_contained_by 16 document_position_implementation_specific 32 syntax comparemask = node.comparedocumentposition(othernode) parameters othernode the other node with which to compare the first node’s document position.
... return value an integer value whose bits represent the othernode's relationship to the calling node.
...for example, if othernode is located earlier in the document and contains the node on which comparedocumentposition() was called, then both the document_position_contains and document_position_preceding bits would be set, producing a value of 10 (0x0a).
Page Visibility API - Web APIs
when the user minimizes the window or switches to another tab, the api sends a visibilitychange event to let listeners know the state of the page has changed.
... the example, which pauses the video when you switch to another tab and plays again when you return to its tab, was created with the following code: // set the name of the hidden property and the change event for visibility var hidden, visibilitychange; if (typeof document.hidden !== "undefined") { // opera 12.10 and firefox 18 and later support hidden = "hidden"; visibilitychange = "visibilitychange"; } else if (typeof document.mshidden !== "undefined")...
... 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.
...a document may start in the prerender state, but will never switch to this state from any other state, since a document can only prerender once.
PointerEvent.isPrimary - Web APIs
it returns true if the pointer that caused the event to be fired is the primary device and returns false otherwise.
...a pointer representing pen input is considered the primary pen input if its pointerdown event was dispatched when no other active pointers representing pen input existed.
... a pointer representing touch input is considered the primary touch input if its pointerdown event was dispatched when no other active pointers representing touch input existed.
... syntax var isprimary = pointerevent.isprimary; return value isprimary returns true if the pointer for this event is the primary pointer and returns false otherwise.
Using Pointer Events - Web APIs
another difference is that because pointer events are pointer device agnostic, the application accepts coordinate-based inputs from a mouse, a pen, or a fingertip using the same code.
...this may be a finger (or elbow, ear, nose, whatever, but typically a finger), stylus, mouse, or any other method for specifying a single point on the surface.
... example the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus, mouse, or other method of pointing at a location.
... handling canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the pointercancel event is sent, and we call the handlecancel() function below.
RTCConfiguration.bundlePolicy - Web APIs
all other tracks are ignored by the connection.
... if any other value is specified, no configuration is specified when creating the rtcpeerconnection, or if the bundlepolicy property isn't included in the rtcconfiguration object specified when creating the connection, balanced is assumed.
...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.
RTCPeerConnection.addTrack() - Web APIs
the rtcpeerconnection method addtrack() adds a new media track to the set of tracks which will be transmitted to the other peer.
...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.
...otherwise, the first time ontrack is called, a new stream is created and attached to the video element, and then the track is added to the new stream.
RTCPeerConnection.createDataChannel() - Web APIs
protocol optional the name of the sub-protocol being used on the rtcdatachannel, if any; otherwise, the empty string ("").
... negotiated optional by default (false), data channels are negotiated in-band, where one side calls createdatachannel, and the other side listens to the rtcdatachannelevent event using the ondatachannel eventhandler .
... return value a new rtcdatachannel object with the specified label, configured using the options specified by options if that parameter is included; otherwise, the defaults listed above are established.
... resourceinuse an id was specified, but another rtcdatachannel is already using the same value.
RTCPeerConnection.createOffer() - Web APIs
the default behavior is to offer to receive audio only if the local side is sending audio, not otherwise.
...the default behavior is to offer to receive video only if the local side is sending video, not otherwise.
...for example, in the case of music or other non-voice transmission, this can cause loss of important low-volume sounds.
...in this case, a websocket connection is used to send a json message with a type field with the value "video-offer" to the other peer.
RTCPeerConnection.iceConnectionState - Web APIs
"checking" the ice agent has been given one or more remote candidates and is checking pairs of local and remote candidates against one another to try to find a compatible match, but has not yet found a pair which will allow the peer connection to be made.
...it's possible that gathering is still underway, and it's also possible that the ice agent is still checking candidates against one another looking for a better connection to use.
... "completed" the ice agent has finished gathering candidates, has checked all pairs against one another, and has found a connection for all components.
... "failed" the ice candidate has checked all candidates pairs against one another and has failed to find compatible matches for all components of the connection.
RTCRtpTransceiver.currentDirection - Web APIs
value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
... offers to receive rtp data, and does so if the other peer accepts.
... "sendonly" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
... offers to receive rtp data, and will do so if the other peer offers.
RTCRtpTransceiver.direction - Web APIs
value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
... offers to receive rtp data, and does so if the other peer accepts.
... "sendonly" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
... offers to receive rtp data, and will do so if the other peer offers.
RTCRtpTransceiverDirection - Web APIs
value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
... offers to receive rtp data, and does so if the other peer accepts.
... "sendonly" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
... offers to receive rtp data, and will do so if the other peer offers.
ReadableStream - Web APIs
while the stream is locked, no other reader can be acquired until this one is released.
...while the stream is locked, no other reader can be acquired until this one is released.
... readablestream.pipethrough() provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
... examples in the following example, an artificial response is created to stream html fragments fetched from another resource to the browser.
Using the Screen Capture API - Web APIs
see options and constraints, below, for more on both how to specify the type of surface you want as well as other ways to adjust the resulting stream.
... a logical display surface is one which is in part or completely obscured, either by being overlapped by another object to some extent, or by being entirely hidden or offscreen.
...mentbyid("stop"); // options for getdisplaymedia() var displaymediaoptions = { video: { cursor: "always" }, audio: false }; // set 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.
...upon resolution, the promise returns a mediastream, which will stream the contents of the screen, window, or other region selected by the user.
Using server-sent events - Web APIs
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).
... all other field names are ignored.
...the third message contains a data field with the value "another message\nwith two lines".
... : this is a test stream data: some text data: another message data: with two lines named events this example sends named events.
Streams API - Web APIs
extensions to other apis request when a new request object is constructed, you can pass it a readablestream in the body property of its requestinit dictionary.
...the examples are as follows: simple stream pump: this example shows how to consume a readablestream and pass its data to another.
... unpack chunks of a png: this example shows how pipethrough() can be used to transform a readablestream into a stream of other data types by transforming a data of a png file into a stream of png chunks.
... examples from other developers: progress indicators with streams, service workers, & fetch.
Using Touch Events - Web APIs
other fingers may subsequently touch the surface and optionally move across the touch surface.
...another potential factor is time; for example, the time elapsed between the touch's start and the touch's end, or the time lapse between two consecutive taps intended to create a double-tap gesture.
... the directionality of a swipe (for example left to right, right to left, etc.) is another factor to consider.
...if the target area is too small, touching it could result in firing other events for adjacent elements.
Basic scissoring - Web APIs
the reason for this distinction is that fragment color (and other fragment values, such as depth) may be manipulated and changed several times during graphics operations before finally being written to the screen.
...in other cases, the fragments may be discarded altogether (so the pixel value is not updated), or it may interact with the already existing pixel value (such as when doing color blending for non-opaque elements in the scene).
... here we see another example of the distinction between fragments and pixels.
...we enable it here using the enable() method (you will also use enable() to activate many other features of webgl; hence, the use of the scissor_test constant as an argument in this case).
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
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.
... things rtp doesn't do rtp itself doesn't provide every possible feature, which is why other protocols are also used by webrtc.
...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 incoming audio.
... the sdp answer is generated and sent using a method called sendanswer(), which generates the answer using createanswer() then sends the resulting sdp to the other peer over the signaling service.
Using IIR filters - Web APIs
the other type is fir — finite impulse response filter.
...as well as this, if your audio graph needed a highpass and a bandpass filter within it, you could just use one iir filter node in place of the two biquad filter nodes you would otherwise need for this.
... 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: these values are calculated based on the lowpass filter specified in the filter characteristics of the web audio api specification.
Using the Web Audio API - Web APIs
for the most part, you don't need to create an output node, you can just connect your other nodes to baseaudiocontext.destination, which handles the situation for you: track.connect(audiocontext.destination); a good way to visualise these nodes is by drawing an audio graph so you can visualize it.
... adding stereo panning to our app let's add another modification node to practise what we've just learnt.
... more examples there are other examples available to learn more about the web audio api.
... another application developed specifically to demonstrate the web audio api is the violent theremin, a simple web application that allows you to change pitch and volume by moving your mouse pointer.
Window: popstate event - Web APIs
these methods and their corresponding events can be used to add data to the history stack which can be used to reconstruct a dynamically generated page, or to otherwise alter the state of the content being presented while remaining on the same document.
...he moment when the new document state is already fully in place, a zero-delay settimeout() method call should be used to effectively put its inner callback function that does the processing at the end of the browser event loop: window.onpopstate = () => settimeout(dosomething, 0); when popstate is sent when the transition occurs, either due to the user triggering the browser's "back" button or otherwise, the popstate event is near the end of the process to transition to the new location.
...the entry is now said to have "persisted user state." this information the browser might add to the history session entry may include, for instance, the document's scroll position, the values of form inputs, and other such data.
... if new-entry has serialized state information saved with it, that information is deserialized into history.state; otherwise, state is null.
Window.window - Web APIs
WebAPIWindowwindow
otherwise, you'd have to do a manual var window = this; assignment at the top of your script.
... another reason, is that without this property you wouldn't be able to write, for example, "window.open('http://google.com/')".
... yet another reason to use this property, is for libraries which wish to offer oop-versions, and non-oop versions (especially javascript modules).
...another advantage, is that the objects of such a class (even if the class were defined outside of a module) could change their reference to the window at will, they would not be able to do this if they had hard-coded a reference to "window".
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
in other words, when you have an object in 3d space and need to position another object 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.
...in order to use mouse, keyboard, or other input devices to move or otherwise transform objects in the 3d space—or to allow the user to move through the space—you'll need to write some code to read the inputs and move perform the movements.
... this is another good use case for getoffsetreferencespace().
XRReferenceSpace - Web APIs
it expands upon the base class, xrspace, by adding support for several different tracking behaviors as well as to request a new reference space which describes the offset transform between the tracked object and another location in the world.
... events in addition to other events that may be sent to xrspace or eventtarget objects, the following also apply to xrreferencespace objects.
...otherwise, typically, one of the other reference space types will be used more often.
...*/ }); the other situation in which you may need to acquire a new reference space is if you need to move the origin to a new position; this is commonly done, for example, when your project allows the user to move through the environment using input devices such as the keyboard, mouse, touchpad, or game controls that are not connected through the xr device.
XRView - Web APIs
WebAPIXRView
it's possible to have xrview objects which represent overlapping regions as well as entirely disparate regions; in a game, you might have views that can be presented to observe a remote site using a security camera or other device, for example.
... in other words, don't assume there are exactly two views on a given viewer; there can be as few as one (such as when rendering the scene in inline mode, and potentially many (especially if the field of view is very large).
... there might also be views representing observers watching the action, or other viewspoints not direclty associated with a player's eye.
... vec3.cross(vecx, vecy, cubeorientation); vec3.cross(vecy, cubeorientation, vecx); // now compute the transform that teleports the object to the // specified point and save a copy of it to display to the user // later; otherwise we probably wouldn't need to save mousematrix // at all.
XRViewerPose - Web APIs
the viewer may be the virtual representation of the user, or it may represent another device or interface which may serve as the source of a position and orientation that make up a view upon the scene.
... for example, every player in a mmorpg might have an instance of xrviewerpose to provide a way to calculate what they can see; if the game provides a mechanism that tells the player if another player sees them, or that they see another player, this information becomes crucial.
... to render a scene using the xrviewerpose representing the user's head, one would iterate over the views in the views array, rendering them one after another.
... also, when rendering the scene for spectators or other players in a multiplayer game, the transform of the xrviewerpose can be used to determine both placement and facing direction of the other players in the game, so that they can be drawn in the correct place with the correct facing.
XRWebGLLayer() - Web APIs
otherwise, the color buffer will not have an alpha channel.
... antialias optional a boolean value which is true if anti-aliasing is to be used when rendering in the context; otherwise false.
... depth optional a boolean value which, if true, requests that the new layer have a depth buffer; otherwise, no depth layer is allocated.
...otherwise, no stencil buffer is allocated.
XRWebGLLayerInit - Web APIs
otherwise, the color buffer will not have an alpha channel.
... antialias optional a boolean value which is true if anti-aliasing is to be used when rendering in the context; otherwise false.
... depth optional a boolean value which, if true, requests that the new layer have a depth buffer; otherwise, no depth layer is allocated.
...otherwise, no stencil buffer is allocated.
ARIA: img role - Accessibility
these elements could be images, code snippets, text, emojis, or other content that can be combined to deliver information in a visual manner.
... <div role="img" aria-label="description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div> description any set of content that should be consumed as a single image (which could include images, video, audio, code snippets, emojis, or other content) can be identified using role="img".
...this is obvious to fix in the case of images (you can use the alt attribute), but in the case of mixed or other certain types of content it is not so obvious, and role="img" can come into play.
... 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, states, and properties aria-label an accessible name is required.
ARIA: button role - Accessibility
aria-expanded if the button controls a grouping of other elements, the aria-expanded state indicates whether the controlled grouping is currently expanded or collapsed.
...a third mixed state is available for toggle buttons that control other elements, such as other toggle buttons or checkboxes, which do not all share the same value.
...but if another tag is used to create a button, the onclick event only fires when clicked by the mouse cursor, even if role="button" is used.
...in other words, when links are used to behave like buttons, adding role="button" alone is not sufficient.
WAI-ARIA Roles - Accessibility
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.
...a figure is generally 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.aria: form rolethe form landmark role can be used to identify a group of elements on a page that provide equivalent functionality to an html form.aria: grid rolethe grid role is for a widget that contains one or more rows of cells.
...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 used to provide a generic landmark for people to be able to navigate to easily when none of the other landmark roles are appropriate.aria: row rolean element with role="row" is a row of cells within a tabular structure.
Accessibility: What users can do to browse more safely - Accessibility
taking advantage of personalization settings can help prevent exposure to content leading to seizures and / or other physical reactions.
...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.
... grayscale those who have sufferred traumatic brain injury (tbi) may be highly sensitive to color; it can require such a great "investment of cognitive energy" on their part, there's no energy for other daily tasks.
... it may assist users with other disabilities, as well.
Accessibility and Spacial Patterns - Accessibility
these oscillations in the brain are a different kind of response than other kinds of neurological responses believed to cause photosensitive seizures.
... 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.
... the braille dots have to be spatially apart from one another so as to be readable in a "human" way.
... the human touch does distinguish with ease braille dots that are too close or too far apart from one another.
Architecture - Accessibility
sometimes the embedded object is really just another text container with more embedded objects.
... otherwise, use iahyperlink::getstartindex() to find the index in parent.
... otherwise, continue processing with offset = the index at the end of the line.
... otherwise, the offset marks the start of a new line.
Mobile accessibility checklist - Accessibility
colour colour contrast must comply with wcag 2.1 aa level requirements: contrast ratio of 4.5:1 for normal text (less than 18 point or 14 point bold.) contrast ratio of 3:1 for large text (at least 18 point or 14 point bold.) information conveyed via colour must be also available by other means too (underlined text for links, etc.) visibility content hiding techniques such as zero opacity, z-index order and off-screen placement must not be used exclusively to handle visibility.
... everything other than the currently visible screen must be truly invisible (especially relevant for single page apps with multiple cards): use the hidden attribute or visibility or display style properties.
...however, for other custom controls state changes must be provided via aria states such as aria-checked, aria-disabled, aria-selected, aria-expanded, and aria-pressed.
... headings must not break hierarchical structure <h1>top level heading</h1> <h2>secondary heading</h2> <h2>another secondary heading</h2> <h3>low level heading</h3> aria landmark roles should be used to describe an app or document structure, such as banner, complementary, contentinfo, main, navigation, search.
Understandable - Accessibility
success criteria how to conform to the criteria practical resource 3.2.1 on focus (a) when a control or other page feature receives focus, it should not change the context in a way that may confuse or disorientate the user.
...client-side validation is too easy to turn off or otherwise get around, so it can't be relied on alone.
... 3.3.5 context-sensitive help is available (aaa) provide instructions and other appropriate cues in context to aid form completion and submission.
... this really just builds on 3.3.1 and other similar criteria but requires more thorough contextual help information and services, e.g.
@font-face - CSS: Cascading Style Sheets
since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-stretch: 50% 200%; font-style a font-style value.
... since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-style: oblique 20deg 50deg; font-weight a font-weight value.
... since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-weight: 100 400; font-variant a font-variant value.
...otherwise, the font resource specified using the url() function is downloaded and used.
Styling Columns - CSS: Cascading Style Sheets
the anonymous boxes that make up your columns can’t be targeted in any way, meaning it isn’t possible to change a box's background color or have one column larger than the others.
...however, it is now defined in box alignment in order to unify gaps between boxes in other specifications such as css grid layout.
...this means your columns will not run into each other.
... in other layout methods the initial value for column-gap is 0.
CSS Containment - CSS: Cascading Style Sheets
basic example many webpages contain a number of sections which are independent of each other.
... <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 contain property with a value of content applied in the css.
... article { contain: content; } each article is independent of the other articles on the page, and so they have been given contain: content in order to indicate to the browser that this is the case.
... another advantage is that if the containing box is offscreen, the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box.
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
the idea of these prefixes was to allow implementations of the spec to be tested and explored by browser engineers and web developers alike without clashing with other implementations.
... 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.
...you'll see white space added between the items, which is what happens when using display: inine-block as it prefers white space like other inline items.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
here we can see how the first item — which has an explicit width of 150 pixels set as the main size — takes a flex-basis of 150px, whereas the other two items have no width and so are sized according to their content width.
...our bigger item ends up bigger because it started from a bigger size, even though it has the same amount of spare space assigned to it as the others: if what you actually want is three equally-sized items, even if they start out at different sizes, you should use this: flex: 1 1 0; here we are saying that the size of the item for the purposes of our space distribution calculation is 0 — all the space is up for grabs and as all of the items have the same flex-grow factor, they each get an equal amount of space distributed.
...it is the ratio between one item and the others that matters.
... other ways to distribute space if you do not want space added to the items, remember that you can deal with free space between or around items using the alignment properties described in the guide to aligning items in a flex container.
CSS Flow Layout - CSS: Cascading Style Sheets
the flow is essentially a set of things that are all working together and know about each other in your layout.
...block elements display one after the other, as paragraphs do in the writing mode of that document.
... in english therefore, inline elements display one after the other, starting on the left, and block elements start at the top and move down the page.
...the two paragraph elements with a green border are block level, displaying one under the other.
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item two</h2> <div class="body"><p>the content of this listing item goes here.</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li class="wide"> <h2>item three</h2> <div class="body"><p>the content of this listing item goes here.</p> <p>this one has more text than the other items.</p> <p>quite a lot more</p> <p>perhaps we could do something different with it?</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item four</h2> <div class="body"><p>the content of this listing item goes here.</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item five</h2> <d...
... this is all looking fairly complete now, however we sometimes have these cards which contain far more content than the others.
...div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item two</h2> <div class="body"><p>the content of this listing item goes here.</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li class="wide"> <h2>item three</h2> <div class="body"><p>the content of this listing item goes here.</p> <p>this one has more text than the other items.</p> <p>quite a lot more</p> <p>perhaps we could do something different with it?</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item four</h2> <div class="body"><p>the content of this listing item goes here.</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item five</h2> <d...
...that might mean taking inspiration from magazines or other non-web sources.
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
one box uses physical properties and the other logical properties.
... in the example below i have two boxes, one of which is using physical padding properties and the other logical padding properties.
...as with the other demos try changing the direction property to rtl to cause the boxes to display in a right-to-left direction, or changing the writing-mode from horizontal-tb to vertical-rl.
... .box { border-block: 2px solid green; border-inline-width: 4px; border-inline-style: dotted; border-inline-color: rebeccapurple; } note: these two value shorthands shipped in firefox 66, check browser support before using as other browsers may not have implemented them yet.
Overview of CSS Shapes - CSS: Cascading Style Sheets
any other parts are ignored.
...the specification defines four <basic-shape> values, which are: inset() circle() ellipse() polygon() using the value inset() wraps text around a rectangular shape however you are able to add offset values, thus pulling the line boxes of any wrapping content closer to the object than would otherwise happen.
... shapes from the box value shapes can also be created around the box value, therefore you could create your shape on the: border-box padding-box content-box margin-box in the example below you can change the value border-box to any of the other allowed values to see how the shape moves closer or further away from the box.
... note that images used in this way must be cors compatible, otherwise shape-outside will act as if none had been given as the value, and you will get no shape.
Using CSS transitions - CSS: Cascading Style Sheets
some user agents, like those based on gecko, implement this requirement and others, like those based on webkit, are less strict.
...only properties listed here are animated during transitions; changes to all other properties occur instantaneously as usual.
...r-width: 1px; display: block; width: 100px; height: 100px; background-color: #0000ff; transition: width 2s, height 2s, background-color 2s, transform 2s; } .box:hover { background-color: #ffcccc; width: 200px; height: 200px; transform: rotate(180deg); } when property value lists are of different lengths if any property's list of values is shorter than the others, its values are repeated to make them match.
... using transitions to make javascript functionality smooth transitions are a great tool to make things look much smoother without having to do anything to your javascript functionality.
Introducing the CSS Cascade - CSS: Cascading Style Sheets
WebCSSCascade
this means that at-rules containing entities other than declarations, such as a @font-face rule containing descriptors, don't participate in the cascade.
...some browsers use actual style sheets for this purpose, while others simulate them in code, but the end result is the same.
...although some constraints on user-agent stylesheets are set by the html specification, browsers still have a lot of latitude: that means that significant differences exist from one browser to another.
...ormal 2 user normal 3 author normal 4 animations 5 author !important 6 user !important 7 user agent !important 8 transitions in case of equality, the specificity of a value is considered to choose one or the other.
Recipe: Media objects - CSS: Cascading Style Sheets
named by nicole sullivan it refers to a two-column box with an image on one side and descriptive text on the other, e.g.
... another reason to use grid layout is in order that i can use fit-content() for the track sizing of the image.
... an option for the pattern is to flip it to switch the image to the other side — this is done by adding the media-flip class, which defines a flipped grid template causing the layout to be mirrored.
... when we nest one media object inside another we need to place it into the second track in the regular layout, and the first track when flipped.
<color> - CSS: Cascading Style Sheets
the other color keywords should only be used in css and svg.
... 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.
...by definition, red=0deg=360deg, with the other colors spread around the circle, so green=120deg, blue=240deg, etc.
...these values may also be used in other contexts, but are not widely supported by browsers.
display - CSS: Cascading Style Sheets
WebCSSdisplay
otherwise it generates a block container box.
... depending on the value of other properties (such as position, float, or overflow) and whether it is itself participating in a block or inline formatting context, it either establishes a new block formatting context (bfc) for its contents or integrates its contents into its parent formatting context.
...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 areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and writing modes css grid layout and accessibility css grid layout and...
...in both cases the computed value may be a keyword other than the one specified.animation typediscrete formal syntax [ <display-outside> | <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>where <display-outside> = block | inline | run-in<display-inside> = flow | flow-root | table | flex | grid | ruby<display-listitem> = <display-outside>?
image-orientation - CSS: Cascading Style Sheets
it should not be used for any other orientation adjustments; instead, the transform property should be used with the rotate <transform-function>.
...will not apply any additional image rotation; the image is oriented as encoded or as other css property values dictate.
...for any purpose other than correcting an image's orientation due to how it was shot or scanned, use a transform property with the rotate keyword to specify rotation.
... if used in conjunction with other css properties, such as a <transform-function>, any image-orientation rotation is applied before any other transformations.
<length> - CSS: Cascading Style Sheets
WebCSSlength
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.
...this is done by anchoring one of the units to a physical unit, and then defining the others relative to it.
... for low-dpi devices, the unit px represents the physical reference pixel; other units are defined relative to it.
Block formatting context - Developer guides
it's the region in which the layout of block boxes occurs and in which floats interact with other elements.
... block elements where overflow has a value other than visible.
... using overflow: auto setting overflow: auto or set other values than the initial value of overflow: visible created a new bfc containing the float.
... using display: flow-root a newer value of display lets us create a new bfc without any other potentially problematic side-effects.
Media events - Developer guides
other browsers might not fire this event.
... suspend sent when loading of the media is suspended; this may happen either because the download has completed or because it has been paused for any other reason.
... waiting sent when the requested operation (such as playback) is delayed pending the completion of another operation (such as a seek).
... in other words, this example seeks to the 10-second mark in the media, then begins playback as soon as that's finished.
Rich-Text Editing in Mozilla - Developer guides
the most basic keyboard commands such as copy and paste are available, all others need to be implemented by the website.
...most commands affect the document's selection (bold, italics, etc), while others insert new elements (adding a link) or affect an entire line (indenting).
... figure 1 : generated html differences mozilla: <span style="font-weight: bold;">i love geckos.</span> <span style="font-weight: bold; font-style: italic; text-decoration: underline;">dinosaurs are big.</span> internet explorer: <strong>i love geckos.</strong> <strong><em><u>dinosaurs are big.</u></em></strong> another difference between mozilla and ie is how to access the document object of an iframe, which is usually used in conjunction with designmode.
... examples please note: the example files are still being migrated from another site.
Localizations and character encodings - Developer guides
in these locales, legacy content that doesn't declare its encoding is typically encoded using a legacy encoding other than windows-1252.
...it typically needs to be set to something other than windows-1252 for central and eastern european locales, middle eastern locales and east asian locales.
...the setting must be left blank for all locales other than russian, ukrainian and japanese.
...for example, the fallback encoding for japanese is shift_jis, but there are other legacy encodings: iso-2022-jp and euc-jp.
A hybrid approach - Developer guides
luckily, we aren’t technically constrained to using client-side techniques here: another option is to use server-side user-agent detection to show the user the proper content.
...this can make it more time-consuming to develop than other approaches.
...another downside is that because this approach relies on responsive design, it typically works best on a new project or one that has an existing flexible layout, not as a retrofit.
... approaches to mobile web development see the following articles for background and other approaches to developing for mobile platforms.
Separate sites for mobile and desktop - Developer guides
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.
...this factor aside, there is one case where this strategy really shines over other methods.
...another case where you may be forced to use this approach is if you cannot, for whatever reason, modify your existing desktop site, and need to have a 100% separate mobile site.
...approaches to mobile web development see the following articles for background and other approaches to developing for mobile platforms.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
implicit aria role link when href attribute is present, otherwise no corresponding role permitted aria roles no role permitted dom interface htmlareaelement attributes this element's attributes include the global attributes.
...this is a user agent’s default behavior, if no policy is otherwise specified.
... "origin-when-cross-origin" meaning that navigations to other origins will be limited to the scheme, the host and the port, while navigations on the same origin will include the referrer's path.
...the default relationship, if no other is given, is void.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
unlike other browsers, firefox persists the dynamic disabled state of a <button> across page loads.
... firefox, unlike other browsers, persists the dynamic disabled state of a <button> across page loads.
...otherwise they will try to submit form data and to load the (nonexistent) response, possibly destroying the current state of the document.
... understanding success criterion 2.5.5: target size | w3c understanding wcag 2.1 target size and 2.5.5 | adrian roselli quick test: large touch targets - the a11y project proximity large amounts of interactive content — including buttons — placed in close visual proximity to each other should have space separating them.
<dl>: The Description List element - HTML: Hypertext Markup Language
WebHTMLElementdl
</dd> <!-- other terms and descriptions --> </dl> multiple terms, single description <dl> <dt>firefox</dt> <dt>mozilla firefox</dt> <dt>fx</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers.
... </dd> <!-- other terms and descriptions --> </dl> single term, multiple descriptions <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers.
... </dd> <!-- other terms and descriptions --> </dl> multiple terms and descriptions it is also possible to define multiple terms with multiple corresponding descriptions, by combining the examples above.
...because of this, make sure each list item's content is written in such a way that it communicates its relationship to the other list items in the list grouping.
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
WebHTMLElementi
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.
...among the use cases for the <i> element are spans of text representing a different quality or mode of text, such as: alternative voice or mood taxonomic designations (such as the genus and species "homo sapiens") idiomatic terms from another language (such as "et cetera"); these should include the lang attribute to identify the language technical terms transliterations thoughts (such as "she wondered,what is this writer talking about, anyway?") ship or vessel names in western writing systems (such as "they searched the docks for the empress of the galaxy, the ship to which they were assigned.") in earlier versions o...
... be sure the text in question is not actually more appropriately marked up with another element.
... examples this example demonstrates using the <i> element to mark text that is in another language.
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
the element's presentation may vary substantially from one browser and/or platform to another—it might be a simple textual input that automatically validates to ensure that the color information is entered in the proper format, or a platform-standard color picker, or some kind of custom color picker window.
...the value is never in any other form, and is never empty.
...if you have colors that are in any other format (such as css color names or css color functions such as rgb() or rgba()), you'll have to convert them to hexadecimal before setting the value.
... tracking color changes as is the case with other <input> types, there are two events that can be used to detect changes to the color value: input and change.
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...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 because of the number of different ways in which people write dates.
...the first is a native month input, and the other is a pair of <select> elements that allow choosing a month and year independently, for compatibility with browsers that don't yet support <input type="month">.
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
<input> elements of type range let the user specify a numeric value which must be no less than a given value, and no more than another given value.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
... consider this range control: <input type="range" id="volume" min="0" max="11" value="7" step="1"> screenshotlive sample this control is horizontal (at least on most if not all major browers; others might vary).
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
you should also include other explanatory text nearby.
...it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content.
...this may be based upon a parent's spellcheck setting or other factors.
...you must remember to include name attribute on the <input> element, otherwise the text field's value won't be included with the submitted data.
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
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.
... usage notes other elements can be used in tandem with <kbd> to represent more specific scenarios: nesting a <kbd> element within another <kbd> element represents an actual key or other unit of input as a portion of a larger input.
... 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.
...in other words, simplifying this to just <kbd>ctrl</kbd>+<kbd>n</kbd> would be perfectly valid.
<menu> - HTML: Hypertext Markup Language
WebHTMLElementmenu
context : indicates the popup menu state, which represents a group of commands activated through another element.
... an html menu can be used to create context menus (typically activated by right-clicking another element) or toolbars.
... examples context menu html <!-- a <div> element with a context menu --> <div contextmenu="popup-menu"> right-click to see the adjusted context menu </div> <menu type="context" id="popup-menu"> <menuitem>action</menuitem> <menuitem>another action</menuitem> <hr/> <menuitem>separated action</menuitem> </menu> css div { width: 300px; height: 80px; background-color: lightgreen; } result menu button menu buttons haven't been implemented in any known browsers yet.
...--> <button type="menu" menu="popup-menu"> dropdown </button> <menu type="context" id="popup-menu"> <menuitem>action</menuitem> <menuitem>another action</menuitem> <hr/> <menuitem>separated action</menuitem> </menu> result toolbar toolbar menus haven't been implemented in any known browsers yet.
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
the <script> element can also be used with other languages, such as webgl's glsl shader programming language and json.
...it is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial.
... origin-when-cross-origin: the referrer sent to other origins will be limited to the scheme, the host, and the port.
... any other value: the embedded content is treated as a data block which won't be processed by the browser.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
WebHTMLElementu
usage notes along with other pure styling elements, the original html underline (<u>) element was deprecated in html 4; however, <u> was restored in html 5 with a new, semantic, meaning: to mark text as having some form of non-textual annotation applied.
... 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.
... 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.
...another common style can be presented using red dashed underline.
Preloading content with rel="preload" - HTML: Hypertext Markup Language
preload has other advantages too.
...here is a <a href="sintel-short.mp4">link to the video</a> instead.</p> </video> </body> so in this case, browsers that support mp4s will preload and use the mp4, making the video player hopefully smoother/more responsive for users.
... scripting and preloads another nice thing about these preloads is that you can execute them with script.
... 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.
Microformats - HTML: Hypertext Markup Language
summary microformats (sometimes abbreviated μf) are standards used to embed semantics & structured data in html, and provide an api to be used by search engines, aggregators, and other tools.
... u-email email address u-photo a photo of the person or organization u-url home page or other url representing the person or organization u-uid universally unique identifier, preferably canonical 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 cl...
...s": [{ "type": ["h-card"], "properties": { "name": ["mitchell baker"], "url": ["http://blog.lizardwrangler.com/"], "org": [{ "value": "mozilla foundation", "type": ["h-card"], "properties": { "name": ["mozilla foundation"], "url": ["http://mozilla.org/"] } }] } }] } note: the nested h-card has implied 'name' and 'url' properties, just like any other root-class-name-only h-card on an <a href> would.
...file/2d6c9cfed7ac8e849f492b5bc7e6a630/thumb.jpg" ], "url": [ "https://quickthoughts.jgregorymcverry.com/profile/jgmac1106" ] }, "lang": "en", "value": "greg mcverry" } ] }, "lang": "en" } h-feed the h-feed is a stream or feed of h-entry posts, like complete posts on a home page or archive pages, or summaries or other brief lists of posts example h-feed <div class="h-feed"> <h1 class="p-name">microformats blogs</h1> <article class="h-entry"> <h2 class="p-name">microformats are amazing</h2> <p>published by <a class="p-author h-card" href="http://example.com">w.
Choosing between www and non-www URLs - HTTP
so, do i have to choose one or the other for my web site?
...but even so, you can still have the other domain working: http allows two techniques so that it is clear for your users, or search engines, which domain is the canonical one, while still allowing the non-canonical domain to work and provide the expected pages.
... the client issues a request to the canonical domain: http://example.org/whatddup the html5 boilerplate project has an example on how to configure an apache server to redirect one domain to the other.
...it is a matter of choosing which type you want to use as your canonical location, then redirecting the other type to it.
Content Security Policy (CSP) - HTTP
WebHTTPCSP
a csp compatible browser will then only execute scripts loaded in source files received from those allowlisted domains, ignoring all other script (including inline scripts and event-handling html attributes).
...your policy should include a default-src policy directive, which is a fallback for other resource types when they don't have policies of their own (for a complete list, see the description of the default-src directive).
... example 5 a web site administrator of a web mail site wants to allow html in email, as well as images loaded from anywhere, but not javascript or other potentially dangerous content.
...for example, if the signup.html attempted to load css from http://anothercdn.example.com/stylesheet.css, the browser would not include the full path, but only the origin (http://anothercdn.example.com).
HTTP conditional requests - HTTP
this is mandatory for some conditional headers, and the default for the others.
...for example, a page that would differ from another only by a different date in its footer, or different advertising, would be considered identical to the other with weak validation.
...common web sites, like wikis and other cms, have such a need.
...the decision on who wins, is not communicated to the other party.
CSP: default-src - HTTP
the http content-security-policy (csp) default-src directive serves as a fallback for the other csp fetch directives.
...unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
... examples no inheritance with default-src if there are other directives specified, default-src does not influence them.
Firefox user agent string reference - HTTP
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.
...this way, your code will work if/when firefox ships on other phone/tablet operating systems or android is used for laptops.
... other gecko-based browsers these are some sample ua strings from other gecko-based browsers on various platforms.
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.
...since then, other browsers have introduced it, even if their mime sniffing algorithms were less aggressive.
...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.
... header name no syntax x-content-type-options: nosniff directives nosniff blocks a request if the request destination is of type: "style" and the mime type is not text/css, or "script" and the mime type is not a javascript mime type enables cross-origin read blocking (corb) protection for the mime-types: text/html text/plain text/json, application/json or any other type with a json extension: */*+json text/xml, application/xml or any other type with an xml extension: */*+xml (excluding image/svg+xml) specifications specification status comment fetchthe definition of 'x-content-type-options definition' in that specification.
OPTIONS - HTTP
WebHTTPMethodsOPTIONS
the access-control-request-headers header tells the server that when the actual request is sent, it will have the x-pingother and content-type headers.
... options /resources/post-here/ http/1.1 host: bar.example accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip,deflate connection: keep-alive origin: https://foo.example access-control-request-method: post access-control-request-headers: x-pingother, content-type the server now can respond if it will accept a request under these circumstances.
...(this header is similar to the allow response header, but used only for cors.) access-control-allow-headers any script inspecting the response is permitted to read the values of the x-pingother and content-type headers.
... http/1.1 204 no content date: mon, 01 dec 2008 01:15:39 gmt server: apache/2.0.61 (unix) access-control-allow-origin: https://foo.example access-control-allow-methods: post, get, options access-control-allow-headers: x-pingother, content-type access-control-max-age: 86400 vary: accept-encoding, origin keep-alive: timeout=2, max=100 connection: keep-alive specifications specification title rfc 7231, section 4.3.7: options hypertext transfer protocol (http/1.1): semantics and content ...
About JavaScript - JavaScript
objects are created programmatically in javascript, by attaching methods and properties to otherwise empty objects at run time, as opposed to the syntactic class definitions common in compiled languages like c++ and java.
... besides the above implementations, there are other popular javascript engines such as:- google's v8, which is used in the google chrome browser and recent versions of opera browser.
... another common application for javascript is as a (web) server side scripting language.
...and other countries.
Keyed collections - JavaScript
use maps if there is a need to store primitive values as keys because object treats each key as a string whether it's a number value, boolean value or any other primitive value.
...the object references in the keys are held weakly, meaning that they are a target of garbage collection (gc) if there is no other reference to the object anymore.
...also, the set constructor accepts an array to convert in the other direction.
...if there is no other reference to an object stored in the weakset, they can be garbage collected.
Assertions - JavaScript
assertions include boundaries, which indicate the beginnings and endings of lines and words, and other patterns indicating in some way that a match is possible (including look-ahead, look-behind, and conditional expressions).
...this is the position where a word character is not followed or preceded by another word-character, such as between a letter and a space.
...in other words, the length of a matched word boundary is zero.
... other assertions note: the ?
SyntaxError: unterminated string literal - JavaScript
examples multiple lines you can't split a string across multiple lines like this in javascript: var longstring = 'this is a very long string which needs to wrap across multiple lines because otherwise my code is unreadable.'; // syntaxerror: unterminated string literal instead, use the + operator, a backslash, or template literals.
... the + operator variant looks like this: var longstring = 'this is a very long string which needs ' + 'to wrap across multiple lines because ' + 'otherwise my code is unreadable.'; or you can use the backslash character ("\") at the end of each line to indicate that the string will continue on the next line.
... make sure there is no space or any other character after the backslash (except for a line break), or as an indent; otherwise it will not work.
... that form looks like this: var longstring = 'this is a very long string which needs \ to wrap across multiple lines because \ otherwise my code is unreadable.'; another possibility is to use template literals, which are supported in ecmascript 2015 environments: var longstring = `this is a very long string which needs to wrap across multiple lines because otherwise my code is unreadable.`; ...
Array.prototype.every() - JavaScript
otherwise, false.
...otherwise, if callback returns a truthy value for all elements, every returns true.
...otherwise, the value undefined will be used as its this value.
...(it is vacuously true that all elements of the empty set satisfy any given condition.) polyfill every was added to the ecma-262 standard in the 5th edition, and it may not be present in other implementations of the standard.
Function.prototype.apply() - JavaScript
with apply, you can write a method once, and then inherit it in another object, without having to rewrite the method for the new object.
... examples using apply to append an array to another you can use push to append an element to an array.
... const array = ['a', 'b']; const elements = [0, 1, 2]; array.push.apply(array, elements); console.info(array); // ["a", "b", 0, 1, 2] using apply and built-in functions clever usage of apply allows you to use built-in functions for some tasks that would probably have otherwise been written by looping over the array values.
...more perniciously, others will arbitrarily limit the number of arguments actually passed to the applied function.
Intl.Collator() constructor - JavaScript
"accent": only strings that differ in base letters or accents and other diacritic marks compare as unequal.
... "variant": strings that differ in base letters, accents and other diacritic marks, or case compare as unequal.
... other differences may also be taken into consideration.
... examples using collator the following example demonstrates the different potential results for a string occurring before, after, or at the same level as another: console.log(new intl.collator().compare('a', 'c')); // → a negative value console.log(new intl.collator().compare('c', 'a')); // → a positive value console.log(new intl.collator().compare('a', 'a')); // → 0 note that the results shown in the code above can vary between browsers and browser versions.
Intl - JavaScript
the intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions.
... locale identification and negotiation the internationalization constructors as well as several language sensitive methods of other constructors (listed under see also) use a common pattern for identifying locales and determining the one they will actually use: they all accept locales and options arguments, and negotiate the requested locale(s) against the locales they support using an algorithm specified in the options.localematcher property.
... bcp 47 also allows for extensions, each consisting of a single digit or letter (other than "x") and one or more two- to eight-letter or digit tags, all separated by hyphens.
... other bcp 47 extension tags can be found in the unicode cldr project.
JSON - JavaScript
consider this example where json.parse() parses the string as json and eval executes the string as javascript: let code = '"\u2028\u2029"' json.parse(code) // evaluates to "\u2028\u2029" in all engines eval(code) // throws a syntaxerror in old engines other differences include allowing only double-quoted strings and having no provisions for undefined or comments.
...the reviver option allows for interpreting what the replacer has used to stand in for other datatypes.
...by default, all instances of undefined are replaced with null, and other unsupported native data types are censored.
... the replacer option allows for specifying other behavior.
Nullish coalescing operator (??) - JavaScript
the nullish coalescing operator (??) is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand.
...in other words, if you use || to provide some default value to another variable foo, you may encounter unexpected behaviors if you consider some falsy values as usable (eg.
...rightexpr examples using the nullish coalescing operator in this example, we will provide default values but keep values other than null or undefined.
... let count = 0; let text = ""; let qty = count || 42; let message = text || "hi!"; console.log(qty); // 42 and not 0 console.log(message); // "hi!" and not "" the nullish coalescing operator avoids this pitfall by only returning the second operand when the first one evaluates to either null or undefined (but no other falsy values): let mytext = ''; // an empty string (which is also a falsy value) let notfalsytext = mytext || 'hello world'; console.log(notfalsytext); // hello world let preservingfalsy = mytext ??
Operator precedence - JavaScript
operator precedence determines how operators are parsed concerning each other.
... as another example, the unique exponentiation operator has right-associativity, whereas other arithmetic operators have left-associativity.
...exponentiation, on the other hand, is right-associative, so 2 ** 3 ** 2 is the same as 2 ** (3 ** 2).
...along with logical disjunction, other short-circuited operators include logical conjunction ("and"), nullish-coalescing, optional chaining, and the conditional operator.
for...in - JavaScript
in general, it is best not to add, modify, or remove properties from the object during iteration, other than the property currently being visited.
... there is no guarantee whether an added property will be visited, whether a modified property (other than the current one) will be visited before or after it is modified, or whether a deleted property will be visited before it is deleted.
... array indexes are just enumerable properties with integer names and are otherwise identical to general object properties.
... it may be most practically used for debugging purposes, being an easy way to check the properties of an object (by outputting to the console or otherwise).
Statements and declarations - JavaScript
if the condition is false, another statement can be executed.
... others debugger invokes any available debugging functionality.
... export used to export functions to make them available for imports in external modules, and other scripts.
... import used to import functions exported from an external module, another script.
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements, and other related elements that accept width and height attributes.
... note: currently this effect is being limited to actual <img> elements, as applying to other such elements may have undesirable results.
...however, this caused a problem — a number of web sites actually use the width and height attributes incorrectly, setting an aspect ratio of something other than the image’s intrinsic aspect ratio.
... summary so there you have it — eliminating another piece of jank from web layout!
Web media technologies
over the years, the web's ability to present, create, and manage audio, video, and other media has grown at an increasing pace.
... today, there are a large number of apis available, as well as html elements, dom interfaces, and other features that make it possible to not only perform these tasks, but use media in tandem with other technologies to do truly remarkable things.
...<video> can also be used as a way to link media apis with other html and dom technologies, including <canvas> (for frame grabbing and manipulation), for example.
... other topics related topics which may be of interest, since they can be used in tandem with media apis in interesting ways.
Using dns-prefetch - Web Performance
the cross-origin domain is then specified in the href attribute: syntax <link rel="dns-prefetch" href="https://fonts.gstatic.com/" > examples <html> <head> <link rel="dns-prefetch" href="https://fonts.gstatic.com/"> <!-- and all other head elements --> </head> <body> <!-- your page content --> </body> </html> you should place dns-prefetch hints in the <head> element any time your site references resources on cross-origin domains, but there are some things to keep in mind.
... 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.
...for the others, just use <link rel="dns-prefetch"> to save time on the first step — the dns lookup.
...if a non-supporting browser encounters a dns-prefetch hint—or any other resource hint—your site won’t break.
Privacy, permissions, and information security
personally identification can include information like usernames, real names, passwords, phone numbers or addresses (or even portions of them), information about medical history, social security numbers, driver licenses, or any other form of id or id number, credit card information, and so forth.
... security and privacy technology or feature description certificate transparency an open standard for monitoring and auditing certificates, creating a database of public logs that can be used to help identify incorrect or malicious certificates content security policy provides the ability to define the extent to which a document's content can be accessed by other devices over the web; used in particular to prevent or mitigate attacks on the server feature policy lets web developers selectively enable, disable, and modify the behavior of certain features and apis both for a document and for subdocuments loaded in <iframe>s <iframe>'s allow attribute technically part of feature policy, the allow attribute on an <iframe> specifies whi...
... keeping personal data safe managing site permissions bringing it all together <using feature policy with permissions and so forth; how to use them together, how they interact, etc> permission requests in <iframe> elements things can get tricky when your web app uses the <iframe> element to embed content from another site inside your own, especially if the document you load into the frame has its own permission needs to consider.
... while specifications for these technologies either state or recommend tactics for handling situations like this, browsers may offer different solutions to improve security even further or to try new features, or try to reduce complexity for users, among other possible reasons.
Introduction to progressive web apps - Progressive web apps (PWAs)
on the other hand, native apps are better integrated with the operating system and therefore offer a more seamless experience for the users.
...they represent a new philosophy for building web apps, involving some specific patterns, apis, and other features.
... other features such as web app manifest, push notifications, and add to home screen functionality have wide support too.
...however, other major browsers support all these features.
d - SVG: Scalable Vector Graphics
WebSVGAttributed
moveto path commands moveto instructions can be thought of as picking up the drawing instrument, and setting it down somewhere else—in other words, moving the current point (po; {xo, yo}).
...the center of the ellipse used to draw the arc is determined automatically based on the other parameters of the command: rx and ry are the two radii of the ellipse; angle represents a rotation (in degrees) of the ellipse relative to the x-axis; large-arc-flag and sweep-flag allows to chose which arc must be drawn as 4 possible arcs can be drawn out of the other parameters.
...the center of the ellipse used to draw the arc is determined automatically based on the other parameters of the command: rx and ry are the two radii of the ellipse; angle represents a rotation (in degrees) of the ellipse relative to the x-axis; large-arc-flag and sweep-flag allows to chose which arc must be drawn as 4 possible arcs can be drawn out of the other parameters.
... note: the appearance of a shape closed with closepath may be different to that of one closed by drawing a line to the origin, using one of the other commands, because the line ends are joined together (according to the stroke-linejoin setting), rather than just being placed at the same coordinates.
glyph-orientation-vertical - SVG: Scalable Vector Graphics
otherwise, if the angle is not a multiple of 180 degrees, then the current text position is incremented according to the horizontal metrics of the glyph.
...ideographic punctuation and other ideographic characters having alternate horizontal and vertical forms will use the vertical form of the glyph.
... note: text set in this "rotated" manner may contain ligatures or other glyph combining and reordering common to the language and script.
...if another angle is specified, it is rounded to the closest of the permitted values.
Basic shapes - SVG: Scalable Vector Graphics
some of the parameters that determine their position and size are given, but an element reference would probably contain more accurate and complete descriptions along with other properties that won't be covered in here.
...some are slightly redundant in that they can be created by other shapes, but they're all there for your convenience and to keep your svg documents as short and as readable as possible.
...basically any of the other types of shapes, bezier curves, quadratic curves, and many more.
... <path d="m20,230 q40,205 50,230 t90,230" fill="none" stroke="blue" stroke-width="5"/> d a list of points and other information about how to draw the path.
Fills and Strokes - SVG: Scalable Vector Graphics
but for compatibility with other viewers, it's often best to specify the fill/stroke opacity separately.
... stroke in addition to its color properties, there are a few other attributes available to control the way a stroke is drawn on a line.
... note: the svg specification decides strictly between attributes that are properties and other attributes.
... <defs> stands for definitions, and it is here that you can create elements that don't appear in the svg directly, but are used by other elements.
Securing your site - Web security
this article offers an assortment of suggestions, as well as links to other articles providing more useful information.
... http access control the cross-origin resource sharing standard provides a way to specify what content may be loaded from other domains.
... you can use this to prevent your site from being used improperly; in addition, you can use it to establish resources that other sites are expressly permitted to use.
...sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.
Subresource Integrity - Web security
note: for subresource-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin.
... subresource integrity enables you to mitigate some risks of attacks such as this, by ensuring that the files your web application or web document fetches (from a cdn or anywhere) have been delivered without a third-party having injected any additional content into those files — and without any other changes of any kind at all having been made to those files.
... cross-origin resource sharing and subresource integrity for subresource-integrity verification of a resource served from an origin other than the document in which it's embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin.
... note: for subresource-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin.
Web security
robots.txt to be written site maps to be written integrity same-origin policy the same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin.
...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.
...sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.
Compiling a New C/C++ Module to WebAssembly - WebAssembly
emscripten requires a large variety of javascript "glue" code to handle memory allocation, memory leaks, and a host of other problems calling a custom function defined in c if you have a function defined in your c code that you want to call as needed from javascript, you can do this using the emscripten ccall() function, and the emscripten_keepalive declaration (which adds your functions to the exported functions list (see why do functions in my c/c++ source code vanish when i compile to javascript, and/or i get no...
...c in a new directory: #include <stdio.h> #include <emscripten/emscripten.h> int main(int argc, char ** argv) { printf("hello world\n"); } #ifdef __cplusplus extern "c" { #endif void emscripten_keepalive myfunction(int argc, char ** argv) { printf("myfunction called\n"); } #ifdef __cplusplus } #endif by default, emscripten-generated code always just calls the main() function, and other functions are eliminated as dead code.
...due to c versus c++ name mangling rules, this would otherwise break, but here we are setting it so that it treats it as an external c function if you are using c++.
...(note that we need to compile with no_exit_runtime, which is necessary as otherwise when main() exits the runtime would be shut down — necessary for proper c emulation, e.g., atexits are called — and it wouldn't be valid to call compiled code.) emcc -o hello3.html hello3.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html -s no_exit_runtime=1 -s "extra_exported_runtime_methods=['ccall']" if you load the example in your browser again, you'll see the sa...
Using the WebAssembly JavaScript API - WebAssembly
if you have already compiled a module from another language using tools like emscripten, or loaded and run the code yourself, the next step is to learn more about using the other features of the webassembly javascript api.
...as we’ve said elsewhere, webassembly doesn’t aim to replace javascript; the two instead can work together, drawing on each other’s strengths.
... this allows a single web app to use multiple independent libraries — each of which are using webassembly internally — to have separate memories that are fully isolated from each other.
... create another new simple html page (copy our simple template) and call it memory.html.
Window: deviceproximity event - Archive of obsolete content
bubbles no cancelable no interface deviceproximityevent target defaultview (window) default action none event handler property window.ondeviceproximity specification proximity sensor other properties property type description value read only double (float) the measured proximity of the distant device (distance in centimetres).
... min read only double (float) the minimum value in the range the sensor detects (if available, 0 otherwise).
... max read only double (float) the maximum value in the range the sensor detects (if available, 0 otherwise).
Interacting with page scripts - Archive of obsolete content
by default, content scripts loaded by add-ons and scripts loaded by web pages are insulated from each other: content scripts can't interact directly with page scripts or access javascript objects they create page scripts can't interact directly with content scripts or access objects they create.
...ng simple assignment: // content-script.js var contentscriptobject = {"greeting" : "hello from add-on"}; unsafewindow.clonedcontentscriptobject = cloneinto(contentscriptobject, unsafewindow); unsafewindow.assignedcontentscriptobject = contentscriptobject; the "page.html" file adds two buttons and assigns an event listener to each: one listener displays a property of the cloned object, and the other listener displays a property of the assigned object: <html> <head> </head> <body> <input id="works" type="button" value="i will work"/> <input id="fails" type="button" value="i will not work"/> <script> var works = document.getelementbyid("works"); works.addeventlistener("click", function() { alert(clonedcontentscriptobject.greeting); }, false); ...
...ad> </head> <body> <input id="test" type="button" value="click me"/> <script> var test = document.getelementbyid("test"); test.addeventlistener("click", function() { alert(window.greetme("page script")); }, false); </script> </body> </html> exportfunction() works by structured cloning the arguments and return value of the function from one scope to the other.
hotkeys - Archive of obsolete content
it's very easy to use combinations that clash with hotkeys defined for firefox or for other add-ons.
... no matter what you choose, it's likely to annoy some people, and to clash with some other add-on, so consider making the combination you choose user-configurable.
...on macintosh this can only be used in conjunction with another modifier, since alt-letter combinations are reserved for entering special characters in text.
panel - Archive of obsolete content
the add-on consists of six files: main.js: the main add-on code, that creates the button and panel get-text.js: the content script that interacts with the panel content text-entry.html: the panel content itself, specified as html icon-16.png, icon-32.png, and icon-64.png: icons for the button in three different sizes "main.js" is saved in your add-on's lib directory, and the other files go in your add-on's data directory: my-addon/ data/ get-text.js icon-16.png icon-32.png icon-64.png text-entry.html lib/ main.js the "main.js" looks like this: var data = require("sdk/self").data; // construct a panel, loading its content from the "text-entry.html" // file in the "data" directory, and loading the "get-text.js" scri...
... } body { background-color: gray; } </style> </head> <body> <textarea rows="13" cols="33" id="edit-box"></textarea> <script src="get-text.js"></script> </body> </html> styling panel content the panel's default style is different for each operating system: this helps to ensure that the panel's style is consistent with the dialogs displayed by firefox and other applications, but means you need to take care when applying your own styles.
...any other properties will be ignored.
passwords - Archive of obsolete content
realm you can use this as a name for the credential, to distinguish it from any other credentials you've stored.
...otherwise, it is omitted.
...because the other functions don't return a value in case of success their oncomplete options are optional.
simple-prefs - Archive of obsolete content
{ "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.
... simple-prefs in the preferences system preferences defined using simple-prefs are stored in the firefox preferences system alongside all the other preferences.
... example: function onprefchange(prefname) { console.log("the preference " + prefname + " value has changed!"); } require("sdk/simple-prefs").on("somepreference", onprefchange); require("sdk/simple-prefs").on("someotherpreference", onprefchange); // `""` listens to all changes in the extension's branch require("sdk/simple-prefs").on("", onprefchange); parameters prefname : string the name of the preference to watch for changes.
simple-storage - Archive of obsolete content
it's a normal javascript object, and you can treat it as you would any other.
...if you'd like to store other types of values, you'll first have to convert them to strings or another one of these types.
...for example: ss.storage.mylist = [ /* some long array */ ]; ss.on("overquota", function () { while (ss.quotausage > 1) ss.storage.mylist.pop(); }); private browsing if your storage is related to your users' web history, personal information, or other sensitive data, your add-on should respect private browsing.
widget - Archive of obsolete content
you can attach panels to them that open when they're clicked, or you can define a custom click handler to perform some other action, like opening a web page in a tab.
...for example, in the future firefox may allow the user to drag widgets from the add-on bar to other toolbars.
... anything you do to an instance of this object will only be applied to the instance attached to its browser window: widget instances attached to other browser windows will be unaffected.
platform/xpcom - Archive of obsolete content
parameters factory : object returns boolean : true if the factory or service is registered, false otherwise.
... so if a factory is registered with the contract id "@me.org/mycomponent", and another factory is already registered with that contract id, then: components.classes["@me.org/mycomponent"] will return the old factory, while: xpcom.factorybycontract("@me.org/mycomponent") will return the new one.
... if it finds a match, it returns this, otherwise it throws components.results.ns_error_no_interface.
system/xul-app - Archive of obsolete content
returns boolean : true if the host application is name and false otherwise.
... returns boolean : true if the host application is one of the names and false otherwise.
... returns boolean : true if version falls in the given range and false otherwise.
ui/toolbar - Archive of obsolete content
unlike a panel, a toolbar: does not overlap with any web content is persistent, remaining visible until the user chooses to close it is a fixed size, and appears in a fixed location usage creating and destroying toolbars you don't specify toolbar content directly: instead, you create other ui components and supply them to the toolbar constructor.
... hidden state persists even over create/destroy cycles: if a toolbar is created, then hidden, then destroyed, and another toolbar with the same title is then created, the new toolbar will be in the hidden state.
...note that since there is only one toolbar for the whole browser, opening another browser window does not cause this event to be emitted again.
cfx - Archive of obsolete content
you can specify an existing profile using the --profiledir option, and this gives you access to that profile's history, bookmarks, and other add-ons.
...at the updateurl you host a file in the update rdf format: among other things, this includes another url called updatelink which points to the updated xpi itself.
...if "default" is defined in the local.json cfx will use that configuration unless otherwise specified.
Creating Reusable Modules - Archive of obsolete content
you then import and use these modules from other parts of your add-on using the require() statement, in exactly that same way that you import core sdk modules like page-mod or panel.
... once you've done this, you can package the modules and distribute them independently of your add-on, making them available to other add-on developers and effectively extending the sdk itself.
... } return path; } exports.promptforfile = promptforfile; md5.js next, create another file in "lib", called "md5.js".
Modifying Web Pages Based on URL - Archive of obsolete content
// import the page-mod api var pagemod = require("sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: "./my-script.js" }); loading multiple content scripts you can load more than one script, and the scripts can interact directly with each other.
... communicating with the content script your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages.
... to send a message from one side to the other, sender calls port.emit() and receiver listens using port.on().
Modifying the Page Hosted by a Tab - Archive of obsolete content
ed my-script.js: var self = require("sdk/self"); var button = require("sdk/ui/button/action").actionbutton({ id: "style-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscriptfile: self.data.url("my-script.js") }); } }); you can load more than one script, and the scripts can interact directly with each other.
...k/ui/button/action").actionbutton({ id: "load-several", label: "load several scripts", icon: "./icon-16.png", onclick: function () { tabs.activetab.attach({ contentscriptfile: [self.data.url('first.js'), self.data.url('second.js')] }); } }); communicating with the content scripts your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages.
... to send a message from one side to the other, sender calls port.emit() and receiver listens using port.on().
Bootstrapped extensions - Archive of obsolete content
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 requires.
...when the extension's startup() function is called, it must manually inject its user interface and other behavior into the application.
...if the add-on manager is closed or another event takes place such that the "undo" option becomes unavailable, then the hard uninstall takes place and the uninstall function is called.
Inline options - Archive of obsolete content
<setting pref="extensions.throbberrestored.showtxtontoolbar" title="show text on toolbar button" type="bool" oninputchanged="alert('new value is = ' + this.value); this.style.backgroundcolor='red';"> if labels on other toolbar buttons are visible (like by using add-on "classic theme restorer") then show label on throbber toolbar button </setting> note in order for the oninputchanged to execute, the setting must have a pref attribute, otherwise the oninputchanged will not trigger.
...use this notification to remove event listeners, or any other references that might otherwise be leaked.
...you must also specify the optionstype as 2: <em:optionsurl>chrome://myaddon/content/name_of_my_file_to_use_for_inline_opts.xul</em:optionsurl> <em:optionstype>2</em:optionstype> your chrome.manifest file should contain the following, otherwise the path chrome://myaddon/content/name_of_my_file_to_use_for_inline_opts.xul will not exist content myaddon ./ this method allows you to maintain compatibility with previous versions of firefox by adding an override to your chrome.manifest: ...
Interaction between privileged and non-privileged pages - Archive of obsolete content
(to better ensure others do not also implement the same event with a different meaning, one might either attach a namespace to <myextensiondataelement/> and check on the event handler for the correct namespaceuri property, or as per the dom specification, use initevent() with an event name that is itself namespaced (xml name characters only): "it is also strongly recommended that third parties adding their own events u...
...se their own prefix to avoid confusion and lessen the probability of conflicts with other new events.") in the case where your extension's overlay does not interact directly with browser.xul, such as in a sidebar, it might be easier to add the event listener to the top-level document directly as shown below (also see: accessing the elements of the top-level document from a child window).
... another option is to send a return event from the extension to the web page.
Listening to events in Firefox extensions - Archive of obsolete content
if the page contains scripts or other behaviors that fire during loading that you want to continue to execute every time the user navigates to the page, or if you want to know when a user has navigated to a cached page, use the new pageshow event.
...it is set to true if it is not the initial load (in other words, it is set to true when the page is cached).
... if you call javascript functions as part of the pageshow event, you can ensure these functions are called when the page is loaded in browsers other than firefox 1.5 by calling the pageshow event as part of the load event, as shown in the sample later in this article.
Adding windows and dialogs - Archive of obsolete content
others unprivileged javascript can also use the window.prompt function to receive text input from the user.
...there isn't much we need to add from what the xul tutorial explains, so go ahead and read the following sections: input controls numeric controls list controls there are some other aspects to take into account when handling input controls, which we cover in the following sections.
...the groupbox element should be used when enclosed elements share some function which is separate from other elements or groups in the same window.
Getting Started with Firefox Extensions - Archive of obsolete content
this tutorial focuses on extensions for firefox, but the same (or very similar) principles apply to creating extensions for other applications such as thunderbird, seamonkey, and flock.
...you should see another pop-up telling you that you are installing an unverified add-on.
...this is an important point to keep in mind if you're building an extension that manipulates other extensions or themes.
Introduction - Archive of obsolete content
firefox and other mozilla applications can be seen as composed of two different parts: a user interface layer that is distinct for each project, and a common platform on top of which the interface layer is built.
...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, and several other components that provide os-independent file management, accessibility, and localization, among others.
Observer Notifications - Archive of obsolete content
« previousnext » sometimes you need your code to send a message to other parts of your code.
... getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(testobserver, "xulschoolhello-test-topic", false); you should come up with a notification topic that is unique so you know it will not conflict with firefox or other extensions topics.
...also, be careful not to add the same observer to a notification topic more than once, otherwise the same code in the observer will be run several times when a notification is sent.
Session store API - Archive of obsolete content
firefox 3.6 knows how to save session store data when the last browser window closes, even if there are still other windows open.
...in other words, it's now possible for sessions to be restored even without the browser quitting and being relaunched.
... if you want to set permissions or otherwise manipulate a restored tab before the page is loaded into it, you should watch sstabrestoring.
Using Dependent Libraries In Extension Components - Archive of obsolete content
extensions with binary components sometimes need to depend on other shared libraries (for example, libraries provided by a third party).
...nclude "nscore.h" #include "nsmodule.h" #include "prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscomptr.h" static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdependent1.so on linux 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.
...#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.
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.
...for example, you would not want to do something like: .urgent {color: purple;} .urgent {color: yellow;} even though these are technically two distinct class names, browsers other than netscape 6 will treat them as though they are the same thing.
...as of this writing, netscape 6 is the only browser to honor this defined behavior; other browsers treat both class and id names as case-insensitive.
Getting the page URL in NPAPI plugin - Archive of obsolete content
then you can just refuse to do anything, if you don't like the url, or you can compare it with the other url you want to contact.
...npvariant variantvalue; // get the location property from the window object (which is another object).
...tradeoffs: is inherently incompatible with other non-mozilla browsers (i.e.
Index of archived content - Archive of obsolete content
api navigator navigator.moznotification add-ons add-on sdk builder guides content scripts communicating with other scripts communicating using "port" communicating using "postmessage" cross-domain content scripts interacting with page scripts loading content scripts reddit example port self contributor's guide ...
... nt automated testing tips and tricks automatic mozilla configurator enabling quicklaunch for all users how mozilla finds its configuration files how thunderbird and firefox find their configuration files introduction kill the xul.mfl file for good locked config settings other mozilla customization pages protecting mozilla's registry.dat file automatically handle failed asserts in debug builds blackconnect blackwood bonsai bookmark keywords build building transformiix standalone chromeless compiling the npruntime sample plugin in visual studio ...
... xforms range element xforms repeat element xforms secret element xforms select element xforms select1 element xforms submit element xforms switch module xforms textarea element xforms trigger element xforms upload element other resources requests for enhancement rfe to the custom controls rfe to the custom controls interfaces rfe to the xforms api troubleshooting xforms forms using xforms and php xforms api reference xforms config variables xforms custom...
Defining Cross-Browser Tooltips - Archive of obsolete content
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).
... on the other hand, the html 4.01 definition of the title attribute states: title = text cs this attribute offers advisory information about the element for which it is set.
...a quick check of various user agents showed that title attribute contents were displayed as a "tooltip" in: gecko-based browsers (mozilla firefox, netscape 6+, etc.) internet explorer 5.5+/win internet explorer 5.x/mac safari opera 6.x+ of these, only ie/win treated alt text as a "tooltip"; the other browsers did not reproduce this behavior.
Autodial for Windows NT - Archive of obsolete content
microsoft added a windows system service (remote access auto connection) to handle autodial for all other applications.
...also, if any address that starts with www is in the database, then any other address that begins with www is considered to be in the database.
...bug 166134 describes how the aol client installs itself as a dialer, but it doesn't behave like other dialers.
Developing New Mozilla Features - Archive of obsolete content
in other cases, mozilla.org staff may agree with the developers that it does not make sense for them to spend much time assisting with your project.
...we’ll talk to the developers in question, find others to help you, and try to improve your experience with the project.
...finding the focus to digest a massive patch in the midst of multiple other demands will take time, even if you’ve done a perfect job.
Building Firefox with Rust code - Archive of obsolete content
if the e10s crate depends on any other crates, their sources must also be checked into the tree, and e10s's cargo.toml must have path attributes for each of its dependencies, and so on.
... this works even if you use the existing vendored source location, but be aware that other vendor updates could clobber your patch in that case.
... ./mach gtest rust.* look for the rust.callfromcpp test to pass, along with any others.
Repackaging Firefox - Archive of obsolete content
on the other hand, if you create a dex which supports all locales, you can only ship on a few, and later expand your set without any upgrade hassles.
... preferences preferences are one of the two main things you will want to set in your extension (the other is bookmarks).
... mozilla.partner.id=<name> app.partner.<name>=<name> app.distributor=<name> app.distributor.channel=<name> other preferences some settings are commonly set in partner distributions.
Code snippets - Archive of obsolete content
tabs from other computers this snippet shows how to load all tabs from other computers.
....utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); components.utils.import("resource://services-sync/util.js"); let r = new resource(weave.service.storageurl + "meta/global"); let g = r.get(); let envelope = json.parse(g); let payload = json.parse(envelope.payload); payload.engines[engine].syncid = weave.utils.makeguid(); // or any other guid you like.
... payload.engines[engine].version = 0; // or any other version number you like.
Hidden prefs - Archive of obsolete content
see nsabquerystringtoexpression::createbooleanconditionstring() for other operators.
... mail composition "other header" pref ("mail.compose.other.header") the format for this a comma delimited list of mail headers, like "approved,x-no-archive" an example for your prefs.js would be: user_pref("mail.compose.other.header", "approved"); this will cause "approved" to show up in the compose window address picker, under to:, cc:, bcc:, newsgroup:, etc.
...| mail & newsgroups | addressing" "other compose header" pref from mailnews.js: // you can specify a comma delimited list of optional headers // this will show up in the address picker in the compose window // examples: "x-face" or "approved" pref("mail.compose.other.header", "approved,x-no-archive"); ...
Message Summary Database - Archive of obsolete content
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.
... mork - the good, the bad, and the ugly mork has a horrible reputation and we're always asked why we don't just replace it with some other db.
...but, on the other hand, there are very few bugs in the mork code.
Metro browser chrome tests - Archive of obsolete content
the test file can contain other functions which will be ignored unless invoked by test().
...be careful about changing existing helpers as changes may impact tests in other libraries.
...setup(), teardown(), and run() each have individual exception handlers to prevent one method from interfering with the execution of another.
Microsummary topics - Archive of obsolete content
you may also use another form appropriate to your extension.
...otherwise, it is a user-initiated request.
...for example, you might include the following header in your response to prevent firefox from making another microsummary-related request for one hour: cache-control: max-age=3600 note: because of a technical limitation (bug 346820), firefox uses the same cache for both microsummary-related requests and user-initiated requests, so the cache headers you return apply to both.
Nanojit - Archive of obsolete content
then it wraps the lirbufwriter in zero or more other lirwriter objects, all of which implement the same interface as lirbufwriter.
... each lirwriter can perform an optimization or other task on the program as it passes through the system and into the lirbuffer.
...internally to nanojit, another set of filters operates on the lir as it passes from the lirbuffer toward the assembler.
Frequently Asked Questions - Archive of obsolete content
failing to respect the mime types servers send is incorrect and has been a source of security holes in other browsers.
... 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.
...finally, occasional fixes are provided by other mozilla hackers.
Safely loading URIs - Archive of obsolete content
some other schemes are used internally by mozilla modules to communicate with each other.
... differences between the methods the three methods differ from each other in how the source of the uri is identified and in what is known about the uri to be loaded.
... if you're doing anything else (passing a uri string to some other api like window.open or <img src="">, passing a uri object to an api that loads uri objects, etc.) use whichever method best fits the data you can get your hands on.
Supporting per-window private browsing - Archive of obsolete content
firefox 20 introduced per-window private browsing mode, in which private user data is stored and accessed concurrently with public user data from another window.
...in some cases, there is no logical window object to use (such as when data or an action originate from some other source than web content).
...var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); os.addobserver(function (asubject, atopic, adata) { asubject.queryinterface(components.interfaces.nsisupportsprbool); // if another extension has not already canceled entering the private mode if (!asubject.data) { /* you should display some user interface here */ asubject.data = true; // cancel the operation } }, "last-pb-context-exiting", false); forcing a channel into private mode usually, network channels inherit the privacy status of the document that created them, which means that they work correctly ...
Table Layout Regression Tests - Archive of obsolete content
start the layout debugger via mozilla -layoutdebug - p foo where foo is just another profile than your main profile.
... 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 => ignore try to figure out what the other regressions are: are they improving the picture or are they regressions?
... original document information author(s): bernd mielke other contributors: boris zbarsky last updated date: february 5, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Table Layout Strategy - Archive of obsolete content
ol spans #define fix_adj 5 // fixed width + padding due to col spans #define pct 6 // percent width of cell or col #define pct_adj 7 // percent width of cell or col from percent colspan #define min_pro 8 // desired width due to proportional <col>s or cols attribute #define final 9 // width after the table has been balanced, considering all of the others the priority of allocations for columns is as follows: max(min_con, min_adj) max (pct, pct_adj) fix fix_adj max(des_con, des_adj), but use min_pro if present for a fixed width table, the column may get more space if the sum of the col allocations is insufficient column width info columns get their width information from style info <col width="200px"> and from the cells that belong int...
...for instance one cell could have a large min width,the next could have a specified fixed width and another a specified pct width.
...so we specify it (this breaks in some other browsers) <col width="0*"><col><tbody></tbody>foobar <table border width="200px"> <col width="0*"><col> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> this shrink wrapping width has usually the suffix 0proportional effective columns <tbody></tbody>foobarbazzap <table width="200px" border> <tbody> <tr><td>foo</td><td colspan="2" width="120px">bar</td></tr> <tr><td>baz</...
Tamarin build documentation - Archive of obsolete content
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 ...
...nor does any other brand of make.) setup: if you normally work in a cygwin mounted place (eg /home/user/...) then you must cd around to the cygdrive path equivalent (eg /cygdrive/c/cygwin/home/user/).
... linux and unix tamarin is tested on linux but not on other unix flavors.
The new nsString class implementation (1999) - Archive of obsolete content
justification the nsstring class is a wide character string class used throughout all of gecko (and other modules) as the default implementation.
...these should typically not be exposed to objects in other modules.
...i18n issues another concern (mainly of the i18n team) has to do with the use of a 1-byte (ascii) nscstring at all.
Binding Attachment and Detachment - Archive of obsolete content
when bindings attached through style are detached because of a style change, they have no effect on any other bindings attached using the dom.
...in other words, a removal of element.style.mozbinding will remove the same group of bindings that were installed via the original call to element.style.mozbinding = "url(...)".
... binding documents whenever a binding is attached to an element in another document, the binding document is only fetched if no binding from the binding document has been used before in the bound document.
Windows stub installer - Archive of obsolete content
now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/dist/win32_d.obj/install.
... other macro strings listed in makejs.pl can be found by searching for "version", which is one of the macro strings, until you find the line $line =~ s/\$version\$/$inversion/i; other macro strings are grouped in this section.
... original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
the xpinstall engine processes installer packages by reading instructions from their install scripts to extract files and take other install actions.
...users download the stub installers, choose which packages to install, choose the destination directory for the installation, and select from various other options.
... original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
modifiers - Archive of obsolete content
keys will map to other keys on platforms that do not have them.
...on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text.
... access: the access key for activating menus and other elements.
Getting File Information - Archive of obsolete content
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.
...otherwise, an attempt to write to the file will generate an error.
... the default permissions for files when created through an output stream is 0644, which means that the file is readable and writable by the owner of the file and read only for others.
Panels - Archive of obsolete content
note that the panel is not placed in a separate file and is instead placed inside another window.
...for other types of elements, you need to use a different technique as in the following example.
...for more information about this attribute and other possible values that can be used, see positioning popups.
Special per-platform menu considerations - Archive of obsolete content
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.
... menu_mac_hide_others selecting this item will hide all other applications except this one.
... here is an example: <menubar> <menu label="tools"> <menupopup> <menuitem label="spell check"/> <menuitem id="menu_preferences" label="preferences" oncommand="window.opendialog('options.xul', '_new', 'chrome');"/> </menupopup> </menu> </menubar> this menu item will be placed on the application menu on the macintosh but left in the tools menu on other platforms.
Additional Template Attributes - Archive of obsolete content
</template> this template will be shared with any other element that references the id 'phototemplate'.
...if you are using the simple syntax and want to use the container variable in the content, you must use the container attribute since there is no other way to refer to it.
... note also that a rule element is needed here, otherwise the builder will think the container and member attributes are conditions to check.
Bindings - Archive of obsolete content
to do this all we need to do is add the necessary data to the rdf datasource and add another <triple> element to the template's statements.
...let assume though, that we are only going to add a description to one of the photos in the datasource; the other two photos will not have a description.
...the others will be evaluated in a similar way.
Result Generation - Archive of obsolete content
no requirement exists to follow the arrows in the direction they point; you can easily go the other way (though in only one direction within a given series of iterations).
...here is one serialization of rdf/xml for this graph, though there are many others.
...a resource's value is a uri which for your own rdf data you can just make up (though if you plan to use your model with others, it should be unique, preferably a url for a site you own, so as to avoid future conflicts with mixing of other types).
SQLite Templates - Archive of obsolete content
the syntax with the question mark is similar as with the other query types.
...however, this can become unweidly for more complex queries, and would be more error prone if values were not escaped properly to ensure that extraneous quotes, semicolons and other characters didn't appear in the values.
...the resulting query that gets used will be: select name, email from myfriends where gender = 'male' this technique is used as quotes or other special characters are handled automatically.
Template Builder Interface - Archive of obsolete content
otherwise, a content builder will be created.
...this doesn't happen automatically when you add the datasource, which is useful, since you will often want to add or remove other datasources at the same time.
...this syntax is necessary as otherwise you wouldn't be able to specify a value for the datasources attribute, and a template builder would not be attached to the element.
Complete - Archive of obsolete content
when it is finished, it will get a category and links from other pages.
... install.js installation script for seamonkey chrome directory containing the extension code chrome/allcustom.jar the extension jar defaults/preferences directory containing a preferences file inside the jar there are three directories: content xul, javascript and other content that does not depend on the locale or theme locale files for each locale skin files for each theme version checks firefox etc.
...for example, chrome.manifest originally had: content custombutton chrome/ now it has: content allcustom jar:chrome/allcustom.jar!/content/allcustom/ you can see the other changes if you unpack the xpi.
Toolbars - Archive of obsolete content
toolbars, implemented using the xul toolbar element, are containers for toolbar buttons and other user interface objects.
... custom toolbar button another example of how to create a toolbar button, complete with a sample extension you can download and try.
... 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...
Adding Buttons - Archive of obsolete content
you need one or the other or both.
...others will be discussed later.
...the window has been given a horizontal orientation so that the two buttons appear beside each other.
Adding more elements - Archive of obsolete content
first, we will add the capability to search for other information such as the file size and date.
...you will notice that if the window is resized, the textbox grows but the other components do not.
... <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </groupbox> there are other cosmetic problems as well.
Adding Style Sheets - Archive of obsolete content
other times, however, you will want to provide a custom style sheet.
...if the user changes the interface skin, the files in a directory other than default will be applied.
...a style sheet may import styles from another stylesheet using the import directive.
Box Model Details - Archive of obsolete content
the following is an outline of both types of boxes: horizontal boxes lay out their elements next to each other horizontally.
...box flex="3"> <label control="t1" value="search text:"/> <textbox id="t1" style="min-width: 100px;" flex="1"/> </vbox> <vbox style="min-width: 150px;" flex="1" align="start"> <checkbox id="c1" label="ignore case"/> <spacer flex="1" style="max-height: 30px;"/> <button label="find"/> </vbox> </window> here, two vertical boxes are created, one for the textbox and the other for the check box and button.
...the result is that the check box and the find button will be spaced apart from each other by some space of no more than 30 pixels.
Creating a Skin - Archive of obsolete content
the upper left border of the first tab and the upper right border of the second tab are rounded by four pixels and the other corners have a round corner of zero pixels, which is equivalent to no rounding.
... other changes next, we'll make a couple of changes to the buttons along the bottom, again reusing some icons from mozilla to save time.
...for example, having different images for the check boxes in the find files dialog as other windows looks a little odd.
Custom Tree Views - Archive of obsolete content
the following example shows this: <tree id="my-tree" flex="1"> <treecols> <treecol id="namecol" label="name" flex="1"/> <treecol id="datecol" label="date" flex="1"/> </treecols> <treechildren/> </tree> to assign data to be displayed in the tree, the view object needs to be created which is used to indicate the value of each cell, the total number of rows plus other optional information.
...it is called for other rows when the user scrolls through them.
...you can use this to get the cell labels and other information.
Introduction to RDF - Archive of obsolete content
alternatively, data in other formats can be used and code written that will read the file and create rdf data from it.
...rdf can also populate other xul elements as well such as listboxes and menus.
...note that the last visited date has a slightly different namespace than the other three.
Keyboard Shortcuts - Archive of obsolete content
in the example below, the file menu can be selected by pressing alt + f together (or some other key combination for a specific platform).
...it works just like the other modifiers, but won't be the same on every platform.
...another attribute, keycode can be used for non-printable characters.
Localization - Archive of obsolete content
otherwise, errors will occur as it won't be able to find the entities.
...this is because the phrase structure may be different in another locale.
... "is not"> <!entity casesensitive "case sensitive search"> <!entity matchfilename "match entire filename"> <!entity results.filename "filename"> <!entity results.location "location"> <!entity results.size "size"> <!entity bytes.before ""> <!entity bytes.after "bytes"> <!entity button.find "find"> <!entity button.cancel "cancel"> now, to add text for a new language all you need to do is create another dtd file.
More Menu Features - Archive of obsolete content
« previousnext » in this section, we'll look at creating submenus and checked menus creating submenus you can create submenus inside other menus (nested menus) using the existing elements.
...when another item is selected, the previously selected item is unchecked.
...they don't have to be placed next to each other in the menu, although it doesn't make as much sense if they aren't.
Splitters - Archive of obsolete content
set this to open, the default, to have the split panel initially open, or set it to collapsed to have one of the panels shrunk down (collapsed) and the other occupying all of the space.
...if you continue to drag the splitter to the right, the other two panels will shrink.
...the other two panels would have to shrink.
Toolbars - Archive of obsolete content
when more than one toolbar is placed next to each other, they are typically grouped together in something called a 'toolbox'.
...inside it are placed the individual toolbar items, usually buttons, but they can be other elements.
...customizable toolbars firefox or other toolkit applications have customizable toolbars; therefore, many extensions add their toolbar buttons to the toolbar palette, rather than adding them directly to the toolbar.
Updating Commands - Archive of obsolete content
for other commands, you will need to use a couple of additional lines of code.
...the only other thing you need to do is ensure that the enabled status of the paste command, and therefore the button, is updated at the right time, which is described below.
...note that the command updater will receive notifications about all focus events on all elements, even if other event handlers respond to the event.
XULBrowserWindow - Archive of obsolete content
by default, chrome is hidden for about:addons and any other pages in the in content whitelist.
... you can augment the functionality of this method using chaining in order to hide chrome for other locations.
... return value true if chrome should be hidden while displaying the specified location; otherwise false.
XUL Coding Style Guidelines - Archive of obsolete content
while some of the guidelines are recommended practices, the others are mandatory.
...other guidelines mentioned in xhtml 1.1 recommendation.
... <?xml version="1.0" encoding='utf-8'?> <!-- do not localize this file: [reason...] it isn't part of the build; --> when translators see this line, they won't bother to look at the rest of the file.
menu - Archive of obsolete content
ArchiveMozillaXULmenu
otherwise, events are passed to the element only.
...otherwise, the menu will size itself to at least the size of the popup.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
menuitem - Archive of obsolete content
otherwise, events are passed to the element only.
...other menuitems that have the same value for their name attributes are part of the same radio group.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
menupopup - Archive of obsolete content
anchor the popup may be either anchored to another node or opened freely.
... iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups.
... to have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the boxobject.screenx and boxobject.screeny properties of the element, and use those as the x and y arguments offset by the desired values.
radio - Archive of obsolete content
ArchiveMozillaXULradio
other radio buttons in the same group are turned off.
...if the user selects one the buttons, the others in the group are unchecked.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
scale - Archive of obsolete content
ArchiveMozillaXULscale
normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right or top to bottom in the order they appear in the xul code.
...for other elements, they are placed right to left or bottom to top.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
treecol - Archive of obsolete content
it displays the column header and holds the size and other information about the column.
...on firefox 2.x and 3.x, all operating systems other than mac os x already use these styles by default.
...this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect.
where - Archive of obsolete content
ArchiveMozillaXULwhere
if the condition is true, the corresponding action body is generated; otherwise the result is ignored and no content is generated.
...otherwise, the default value is false, to indicate that the value should match with the same case.
...otherwise, the entire value string is compared.
window - Archive of obsolete content
you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets.
... lightweightthemes type: boolean true if the window supports lightweight themes, otherwise false.
...if this code is placed between window tags it messes up all other controls on the window.
Extentsions FAQ - Archive of obsolete content
laceme"); replaceme.parentnode.replacechild(newnode, replaceme); is it possible to place an image in the window that can be moved to anywhere in the window, and always remain on top of everything else?(similiar to using position:absolute and-index:100000 in html) you can almost do this with a stack: <window ...> <stack flex="1"> <image top="40" left="80"/> <vbox> other content here </vbox> </stack> </window> the only restriction is that your image can't overlap the right or bottom of the window.
...there's a bug in bugzilla about stacking other widgets on top of browser/iframe, which hopefully will be fixed for gecko 1.9.
... could someone make an addressbook enhancer extension that has the ability to put pictures on a contact and other features the thunderbird address book lacks.
Atomic RSS - Archive of obsolete content
ArchiveRSSModuleAtom
"getting started" box, if there is no "getting started" article yet written, should be populated with another feature article or tutorial, should one exist.
... otherwise, just comment it out getting started a guided tutorial that will help you get started with atomic rss.
... references atomic rss element list examples none available at this time community none available at this time tools none available at this time other resources tim bray's atom rss article rss, atom, rdf, xml ...
Content - Archive of obsolete content
"getting started" box, if there is no "getting started" article yet written, should be populated with another feature article or tutorial, should one exist.
... otherwise, just comment it out getting started a guided tutorial that will help you get started with the rss content module.
... references rss content module element list examples none available at this time community none available at this time tools none available at this time other resources rss content module spec rss, rdf, xml ...
Confidentiality, Integrity, and Availability - Archive of obsolete content
in other words, only the people who are authorized to do so can gain access to sensitive data.
...if your bank records are posted on a public website, everyone can know your bank account number, balance, etc., and that information can't be erased from their minds, papers, computers, and other places.
...another example of a failure of integrity is when you try to connect to a website and a malicious attacker between you and the website redirects your traffic to a different website.
Security Controls - Archive of obsolete content
protection measures (otherwise known as security controls) tend to fall into two categories.
... another fundamental principle with security controls is using multiple layers of security—defense in depth.
... the motivation for having multiple layers is that if one layer fails or otherwise cannot counteract a certain threat, other layers might prevent the threat from successfully breaching the system.
Digital Signatures - Archive of obsolete content
but encryption and decryption, by themselves, do not address another problem: tampering.
...the keys are related mathematically, but the parameters are chosen so that calculating the private key from the public key is either impossible or prohibitively expensive.the encrypted hash, along with other information, such as the hashing algorithm, is known as a digital signature.
...confirming the identity of the signer, however, also requires some way of confirming that the public key really belongs to a particular person or other entity.
SSL and TLS - Archive of obsolete content
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.
... as pkis using rsa keys and certificates transition to other cryptographic systems like ecc, servers should continue to support rsa.
...there are more possible keys than any other cipher, making aes the strongest cipher supported by ssl.
Theme changes in Firefox 4 - Archive of obsolete content
bookmarks toolbar #personaltoolbar small tab bar #tabstoolbar small add-on bar #addon-bar small custom toolbars some other value small or large depending on user preference.
...inside that, create another new directory chrome.
...most likely you must replace all occurences of classic/1.0 in chrome.manifest and install.rdf with some other name.
Using IO Timeout And Interrupt On NT - Archive of obsolete content
if the thread gets interrupted by another thread's <tt>pr_interrupt()</tt> call, the io function returns with <tt>pr_pending_interrupt_error</tt>.
... io timeout and interrupt however, nspr may wake up the thread in two other situations: if the overlapped io request is not completed before the specified timeout.
... if the thread gets interrupted by another thread's <tt>pr_interrupt()</tt> call.
-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.
... maximum inline flow content can wrap on the side of the exclusion with the largest available space for the given line, and must leave empty the other side of the exclusion.
... remarks the -ms-wrap-flow property makes an element an exclusion element when it has a computed value other than auto.
New in JavaScript 1.8.5 - Archive of obsolete content
bug 492849 object.seal() prevents other code from deleting properties of an object.
...bug 492845 object.freeze() freezes an object: other code can't delete or change any properties.
... other standardization work various non-standard syntaxes for defining getters and setters have been removed; ecmascript 5 defined syntax has not been changed.
JavaPackage - Archive of obsolete content
description in java, a package is a collection of java classes or other java packages.
... although the packages and classes contained in a javapackage are its properties, you cannot use a for...in statement to enumerate them as you can enumerate the properties of other objects.
... properties the properties of a javapackage are the javaclass objects and any other javapackage objects it contains.
forEach - Archive of obsolete content
feel free to alter the text as english is not my mother tongue and i'm more concerned with the code quality that the english grammar ;-s dotnetcarpenter 30 june 2012 <hr> the compatibility section goes to extraordinary lengths in providing a foreach implementation.
...if you wish to make changes, and especially if you wish to revert another user's changes, please either add a comment here, or post to dev-mdc@lists.mozila.org, explaining the change you desire.
... if (value>1){ return false;//we could have some way to break when we return false } }); //woulld print 1 2 --porfirio 11:17, 22-06-2008 another option would be to throw stopiteration and catch it within foreach().
XForms Select1 Element - Archive of obsolete content
loses focus), otherwise it is updated upon item selection xul widget characteristics analogous widgets are <html:select/> and <xul:menulist/> visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e.
... loses focus), otherwise it is updated upon item selection listbox the select1 is represented as listbox (xhtml/xul).
...loses focus), otherwise it is updated upon item selection radio group the select is represented as group of radios (xhtml/xul).
Mozilla XForms User Interface - Archive of obsolete content
the form author can also use the 'appearance' attribute on the form control to give us another clue.
...every form control other than the output element must contain a label element.
...the toggle element is used (as an event handler) to make a case visible and thereby hiding all other case elements contained by the same switch.
XForms - Archive of obsolete content
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.
...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.
... mailing list newsgroup rss feed #xforms channel on irc.mozilla.org w3c forms mailing list other community links...
Window: devicelight event - Archive of obsolete content
bubbles no cancelable no interface sensorcallback target defaultview (window) other properties property type description value read only double (float) the sensor data for ambient light in lux.
... min read only double (float) the minimum value in the range the sensor detects (if available, 0 otherwise).
... max read only double (float) the maximum value in the range the sensor detects (if available, 0 otherwise).
RDF in Fifty Words or Less - Archive of obsolete content
first, rdf is a graph-based model for describing internetresources (like web pages and email messages), and how these resources relate to one another.
...there are tons of others, including email messages, usenet news articles (or entire usenet news groups), and search results from your favorite web crawler, just to name a few.
...or you might want to relate a bookmark to another bookmark, or keep it in multiple "folders" at once.
RDF in Mozilla FAQ - Archive of obsolete content
in either case, the datasource will be loaded using the nsirdfservice's getdatasource() method, so it will be managed similarly to all other datasources loaded this way.
...-- danbri) another possible problem: for remotely-loaded xul and rdf, you might need to adjust mozilla's security restrictions (see belowfor example code).
... please mail danbri, mozilla-rdf or waterson with urls if you are aware of other examples to which we ought to link!
XUL Parser in Python - Archive of obsolete content
this is another hard-coded thing i have to open up.
... some modifications to this script may suggest other uses.
...most of all, please feel free to experiment with the mozilla development platform in this way or in any other way you can imagine.
3D collision detection - Game development
if you have entities that will be rotating, you can either modify the dimensions of the bounding box so it still wraps the object, or opt to use another bounding geometry type, such as spheres (which are invariant to rotation.) the animated gif below shows a graphic example of an aabb that adapts its size to fit the rotating entity.
...aabb checking whether an aabb intersects another aabb is similar to the point test.
... mathematically, this looks like: f(a,b)=(ax-bx)2+(ay-by)2+(az-bz)2<=aradius+bradiusf(a,b) = \sqrt{(a_x - b_x)^2 + (a_y - b_y)^2 + (a_z - b_z)^2} <= a_{radius} + b_{radius} or in javascript: function intersect(sphere, other) { // we are using multiplications because it's faster than calling math.pow var distance = math.sqrt((sphere.x - other.x) * (sphere.x - other.x) + (sphere.y - other.y) * (sphere.y - other.y) + (sphere.z - other.z) * (sphere.z - other.z)); return distance < (sphere.radius + other.radius); } sphere vs.
WebVR — Virtual Reality for the Web - Game development
vr devices with the popularity of oculus rift and a lot of other devices in production coming soon to the market, the future looks bright — we already have sufficient technology to make the vr experience "good enough" for playing games.
... the webvr api the webvr api is the central api for capturing information on vr devices connected to a computer and headset position/orientation/velocity/acceleration information, and converting that into useful data you can use in your games and other applications.
... note: there are of course other apis useful for creating games, for example the gamepad api for control inputs, and the device orientation api for handling display orientation on mobile.
Desktop gamepad controls - Game development
if it is, then the function returns true; false otherwise.
...the d-pad right button have an index of 3 on the wireless xbox 360, but may have a different one on another device.
...this is pure javascript code however too, so can be used in any other project no matter what framework was used.
Implementing controls using the Gamepad API - Game development
there's also a number of other devices with various different button layouts that more or less work across browser implementations.
...ion() {}, disconnect: function() {}, update: function() {}, buttonpressed: function() {}, buttons: [], buttonscache: [], buttonsstatus: [], axesstatus: [] }; the buttons array contains the xbox 360 button layout: buttons: [ 'dpad-up','dpad-down','dpad-left','dpad-right', 'start','back','axis-left','axis-right', 'lb','rb','power','a','b','x','y', ], this can be different for other types of gamepads like the ps3 controller (or a no-name, generic one), so you have to be careful and not just assume the button you're expecting will be the same button you'll actually get.
...you can play the full version of the hungry fridge game directly in your browser, install it from the firefox marketplace or check the source code of the demo along with all the other resources on the gamepad api content kit.
WebRTC data channels - Game development
in the context of a game, this lets players send data to each other, whether text chat or game status information.
... reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent.
... original document information author(s): alan kligman source article: webrtc data channels for great multiplayer other contributors: robert nyman copyright information: alan kligman, 2013 ...
Visual-js game engine - Game development
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 profits or any other kind of loss while using or misusing this software.
Visual typescript game engine - Game development
* default value is 9001 */ private broadcasterport: number = 9001; /** * @description important note for this property: if you * disable (false) you cant use account system or any other * network.
... * in other way keep it 'true'.
...features come with broadcaster: multiplatform video chat works with other hybrid frameworks or custom implementation throw the native mobile application web control (chrome implementation usually tested).
API - MDN Web Docs Glossary: Definitions of Web-related terms
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.
...methods, properties, events, and urls) that a developer can use in their apps for interacting with components of a user's web browser, or other software/hardware on the user's computer, or third party websites and services.
... for example: the getusermedia api can be used to grab audio and video from a user's webcam, which can then be used in any way the developer likes, for example, recording video and audio, broadcasting it to another user in a conference call, or capturing image stills from the video.
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
additionally, messages may be sent without waiting for acknowledgement, with the understanding that if a problem occurs, the recipient will request corrections or otherwise handle the situation.
...and both sides can continue to send and receive messages whenever they wish, instead of having to schedule them around each other.
... when software communicates asynchronously, a program may make a request for information from another piece of software (such as a server), and continue to do other things while waiting for a reply.
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
in other words, the idl attributes, in essence, reflect the content attributes.
...if you pass another type, it is automatically converted to a number as specified by the standard javascript rules for type conversion.
... idl attributes can reflect other types such as unsigned long, urls, booleans, etc.
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
note: if you are familiar with ruby's (or another language) that also has a feature called "symbols", please don’t be misguided.
... for example: let sym = symbol("sym") alert(sym) // typeerror: cannot convert a symbol value to a string that’s a "language guard" against messing up, because strings and symbols are fundamentally different, and should not occasionally convert one into another.
... the method symbol.for(tokenstring) returns a symbol value from the registry, and symbol.keyfor(symbolvalue) returns a token string from the registry; each is the other's inverse, so the following is true: symbol.keyfor(symbol.for("tokenstring")) === "tokenstring" // true learn more general knowledge symbol (programming) on wikipedia javascript data types and data structures symbols in ecmascript 6 symbol in the mdn js reference object.getownpropertysymbols() ...
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
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.
...other encodings exist, like utf-16 or the obsolete ucs-2, but utf-8 is recommended.
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
whitespace is a set of characters which is used to show horizontal or vertical spaces between other characters.
... they are often used to separate tokens in html, css, javascript, and other computer languages.
... in javascript ecmascript® 2015 language specification specifies several unicode codepoints as white space: u+0009 character tabulation <tab>, u+000b line tabulation <vt>, u+000c form feed <ff>, u+0020 space <sp>, u+00a0 no-break space <nbsp>, u+feff zero width no-break space <zwnbsp> and other category “zs” any other unicode “separator, space” code point <usp>.
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
// fix: we test for file extensions as well in case file:// doesn't return content type (as seems to be the case); can some other tool be uesd in ff (or ie) to detect encoding of local file?
... probably just need bom test since other encodings must be specified var patternxml = /\.(svg|xml|xul|rdf|xhtml)$/; if ((contenttype && contenttype.match(/[text|application]\/(.*)\+?xml/)) || (href.indexof('file://') === 0 && href.match(patternxml))) { /* grab the response as text (see below for that routine) and then find encoding within*/ var encname = '([a-za-z][a-za-z0-9._-]*)'; var pattern = new regexp('^<\\?xml\\s+.*encoding\\s*=\\s*([\'"])'+encname+'\\1.*\\?>'); // check document if not?
... ); var a = []; for(var k = 0; k < xpathresult.snapshotlength; k++) { a[k] = xpathresult.snapshotitem(k); } responsenodes = a; } else { // otherwise, the response must be a single well-formed document response responsenodes = [response.documentelement]; // put in array so can be treated the same way as the above } // prepend any node(s) (as xml) then remove xinclude for (j=0; j < responsenodes.length ; j++) { ...
Accessibility - Learn web development
sites should be accessible to keyboard, mouse, and touch screen users, and any other way users access the web, including screen readers and voice assistants like alexa and google home.
... note: if you are working on a computer/tablet/other devices where you don't have the ability to create your own files, you can try out most of the code examples in an online coding program such as jsbin or glitch.
... 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.
Fundamental CSS comprehension - Learn web development
you need to: give the main card container a fixed width/height, solid background color, border, and border-radius (rounded corners!), amongst other things.
...this could affect the values you need, although in this simple example this is not an issue.) other things to think about: you'll get bonus marks if you write your css for maximum readability, with a separate declaration on each line.
... you should include .card at the start of the selector chain in all your rules, so that these rules wouldn't interfere with the styling of any other elements if the business card were to be put on a page with a load of other content.
Overflowing content - Learn web development
otherwise, both overflow-x and overflow-y are set to the same value.
...these boxes may otherwise have no relationship to each other.
...in a legacy application, you may encounter a box where content is overlaying other content on the page.
CSS selectors - Learn web development
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.
... in css, selectors are defined in the css selectors specification; like any other part of css they need to have support in browsers for them to work.
... p::first-line { } combinators the final group of selectors combine other selectors in order to target elements within our documents.
Responsive design - Learn web development
on narrow screens the layout displays the boxes stacked on top of one another: on wider screens they move to two columns: note: you can find the live example and source code for this example on github.
...other mobile browsers (e.g.
... there are other settings you can use with the viewport meta tag, however in general the above line is what you will want to use.
Supporting older browsers - Learn web development
another popular way to find out about how well a feature is supported is the can i use website.
... support doesn't mean "looks the same" a website can’t possibly look the same in all browsers, because some of your users will be viewing the site on a phone and others on a large desktop screen.
... similarly, some of your users will have an old browser version, and others the latest browser.
How do I use GitHub Pages? - Learn web development
you can do that with other people's code too!
... the other thing you need to do before moving on is to initialise your code directory as a git repository.
...then, you need to enter the following commands (pressing enter after each one) to push those changes to github: git add --all git commit -m 'another commit' git push you can replace another commit with a more suitable message to describe what change you just made.
What is a web server? - Learn web development
(for example, html documents, images, css stylesheets, and javascript files) a web server connects to the internet and supports physical data interchange with other devices connected to the web.
...(we'll cover that sort of technology in other articles.) http provides clear rules for how a client and server communicate.
...some application servers cater to specific website categories like blogs, wikis, or ecommerce; others, called cmss (content management systems), are more generic.
What software do I need to build a website? - Learn web development
other formats, like rtf, let you to add formatting, like bold or underline.
...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.
CSS property compatibility table for form controls - Learn web development
property n t note css box model width no[1] no[1] some browsers add extra margins and others stretch the widget.
... height no[1] no[1] some browsers add extra margins and others stretch the widget.
...opera does not support this property at all and other browsers only support it on the <select> element.
Test your skills: Multimedia and embedding - Learn web development
this aim of this skill test is to assess whether you've understood our video and audio content and from object to iframe — other embedding technologies articles.
... multimedia and embedding 2 in this task we want you to mark up a slightly more complex video player, with multiple sources, subtitles, and other features besides.
... go to a sharing site like youtube or google maps, and embed a video or other media item into the page.
Structuring the web with HTML - Learn web development
html is used to specify whether your web content should be recognized as a paragraph, list, heading, link, image, multimedia player, form, or one of many other available elements or even a new element that you define.
... after learning html, you can then move on to learning about more advanced topics such as: css, and how to use it to style html (for example alter your text size and fonts used, add borders and drop shadows, layout your page with multiple columns, add animations and other visual effects.) javascript, and how to use it to add dynamic functionality to web pages (for example find your location and plot it on a map, make ui elements appear/disappear when you toggle a button, save users' data locally on their computers, and much much more.) modules this topic contains the following modules, in a suggested order for working through them.
... multimedia and embedding this module explores how to use html to include multimedia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages.
Choosing the right approach - Learn web development
asynchronous callbacks generally found in old-style apis, involves a function being passed into another function as a parameter, which is then invoked when an asynchronous operation has been completed, so that the callback can in turn do something with the result.
... further information cooperative asynchronous javascript: timeouts and intervals, in particular requestanimationframe() requestanimationframe() reference promises promises are a javascript feature that allows you to run asynchronous operations and wait until it is definitely complete before running another operation based on its result.
... further information graceful asynchronous programming with promises using promises promise reference promise.all() a javascript feature that allows you to wait for multiple promises to complete before then running a further operation based on the results of all the other promises.
Function return values - Learn web development
some functions don't return a significant value, but others do.
... let's return to a familiar example (from a previous article in this series): let mytext = 'the weather is cold'; let newstring = mytext.replace('cold', 'warm'); console.log(newstring); // should print "the weather is warm" // the replace() string function takes a string, // replaces one substring with another, and returns // a new string with the replacement made the replace() function is invoked on the mytext string, and is passed two parameters: the substring to find ('cold').
... some extra function related tips: look at another example of writing error handling into functions.
JavaScript building blocks - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... functions — reusable blocks of code another essential concept in coding is functions.
...some functions don't return a significant value after completion, but others do.
Client-side web APIs - Learn web development
apis are programming features for manipulating different aspects of the browser and operating system the site is running on, or manipulating data from other web sites or services.
...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.
Test your skills: Strings - Learn web development
you already have half of a famous quote inside a variable called quotestart; we would like you to: look up the other half of the quote, and add it to the example inside a variable called quoteend.
... in fixedquote, replace "green eggs and ham" with another food that you really don't like.
... the length of the hypotenuse of a right-angled triangle, given that the two other side lengths are the same as the two values we have.
JavaScript — Dynamic client-side scripting - Learn web development
before attempting to learn javascript, you are strongly advised to get familiar with at least these two technologies first, and perhaps others as well.
... start by working through the following modules: getting started with the web introduction to html introduction to css having previous experience with other programming languages might also help.
... client-side web apis when writing client-side javascript for web sites or applications, you won't go very far before you start to use apis — interfaces for manipulating different aspects of the browser and operating system the site is running on, or even data from other web sites or services.
Accessibility in React - Learn web development
={newname} onchange={handlechange} ref={editfieldref} /> the "edit" button in your view template should read like this: <button type="button" classname="btn" onclick={() => setediting(true)} ref={editbuttonref} > edit <span classname="visually-hidden">{props.name}</span> </button> focusing on our refs with useeffect to use our refs for their intended purpose, we need to import another react hook: useeffect().
...let's see this in action; put the following useeffect() call just above the return statement in the body of todo(), and pass into it a function that logs the words "side effect" to your console: useeffect(() => { console.log("side effect"); }); to illustrate the difference between the main render process and code run inside useeffect(), add another log – put this one below the previous addition: console.log("main render"); now, open the app in your browser.
... we need to refactor our approach so that focus changes only when isediting changes from one value to another.
Focus management with Vue refs - Learn web development
the last bit of functionality to look at is focus management, or put another way, how we can improve our app's keyboard accessibility.
... virtual dom and refs vue, like some other frameworks, uses a virtual dom (vdom) to manage elements.
...this can be confusing to users, especially those using screen readers and other assistive technology.
Vue resources - Learn web development
previous overview: client-side javascript frameworks next now we'll round off our study of vue by giving you a list of resources that you can use to go further in your learning, plus some other useful tips.
... vue school — another paid education platform specializing in vue.
... there are also a handful of other changes, including a change in how apps are initialized in vue.
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.
... accessibility — make the web usable by everyone accessibility is the practice of making web content available to as many people as possible regardless of disability, device, locale, or other differentiating factors.
...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.
Chrome Worker Modules
however, if you have cyclic requirements, some of the modules involved in the cyclic requirements may become visible by the other modules before they are fully evaluated.
... no attempt is made to fully isolate modules from each other.
...in other words, the true isolation unit is the worker itself, not the module.
Accessibility information for UI designers and developers
don't rely on color alone when your interface uses color to distinguish between things, make sure the distinction is also made in other ways.
... see also: understanding sc 1.4.3: contrast the focus indicator users who navigate by keyboard (or other specialised input methods), rely on focus styles to see where they are on the page.
... links vs buttons to keep your interface in line with user expectations, use links for interactions that go somewhere (on the current page or another page) and buttons for interactions that do something (like submit a form or open an overlay).
Links and Resources
wave 3.0 (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 3.0 is another powerful, mature, free online webpage accessibility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines.
... other resources trace center - trace center of the university of wisconsin (research on technology for persons with disabilities).
... dive into accessibility - another great, easy-to-understand resource on accessible website authoring.
Application cache implementation overview
we search another, if available, potentially even in a different offline cache group.
...otherwise, this is “first download”.
...otherwise, the update invokes onerror and 'finishes'.
Browser chrome tests
the test file can contain other functions, they will be ignored unless invoked by test().
...you should attempt to reduce the side effects of the testing code and "clean up" after yourself, to avoid influencing other tests.
...for instance, if you change a preference you want to make sure that the preference is always reset so that it doesn't impact other tests after yours.
Bugzilla
bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-tracking system, a database for recording bugs and enhancement requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects.
... other materials an introduction to bugzilla bugzilla for humans bugzilla quicksearch help page.
... testopia - test case management extension bugzilla.org - the project site wikipedia:bugzilla - general description of bugzilla (not specific to mozilla projects) bmo on wiki.mozilla.org - information about mozilla's customized bugzilla installation, including how to contribute to it tools bugzilla todos lists review and flag requests, patches to check in, unfulfilled requests you made of other people, and assigned bugs.
Chrome registration
each line is parsed individually; if the line is parsable the chrome registry takes the action identified by that line, otherwise the chrome registry ignores that line (and prints a warning message in the runtime error console).
... 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).
... contentaccessible chrome resources can no longer be referenced from within <img>, <script>, or other elements contained in, or added to, content that was loaded from an untrusted source.
Creating a Language Pack
all other files will be taken from x-testing directly.
...there is a target to get those, too, another way to test it to repack the en-us binary.
...all other files will be taken from en-us directly.
Debugging Table Reflow
block reflow another way to debug the reflow process is implemented inside nsblockframe.cpp.
...ol spans #define fix_adj 5 // fixed width + padding due to col spans #define pct 6 // percent width of cell or col #define pct_adj 7 // percent width of cell or col from percent colspan #define min_pro 8 // desired width due to proportional <col>s or cols attribute #define final 9 // width after the table has been balanced, considering all of the others in the last log snippet none of these width's has been set.
... debug_table_reflow_timing needs to be written original document information author(s): bernd mielke other contributors: bernd mielke, josh soref last updated date: november 20, 2005 ...
Old 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 prerequisite).
...other build configuration options can be added to this file, although it's strongly recommended that you only use options that you fully understand.
... for all other changes run the full rebuild: ./mozilla/mach build problems building?
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 prerequisite).
...other build configuration options can be added to this file, although it's strongly recommended that you only use options that you fully understand.
...for example, to just rebuild the lightning calendar extension: ./mach build comm/calendar/lightning for all other changes run the full rebuild: ./mach build problems building?
Commenting IDL for better documentation
if you use any other format for your comments, our tools will ignore them.
... other tips some other helpful writing style tips that will help you make your comments cleaner and easier to read and understand: you don't need to include what a method returns in the description.
... */ const integer cookie_flavor_other = 0; // yumminess constants /** * the cookie is disgusting.
Developer guide
build instructions how to build firefox, thunderbird, seamonkey, or other mozilla applications.
... performance performance guides and utilities to help you make your code perform well (and to play nicely with others).
... searchfox another option for mozilla code searching.
Frame script environment
this means you don't have to worry about global variables you define conflicting with global variables defined by another frame script.
...if you want other principals, you can use a sandbox.
... another use is to interact with the content very early in the page load process, long before domcontentloaded event is fired.
Communicating with frame scripts
all messages share the same namespace, so to avoid conflicts with other code, you'll need to ensure that the names you use are unique.
...all messages share the same namespace, so to avoid conflicts with other code, you'll need to ensure that the names you use are unique.
...age.data.details; // "some more details" } addmessagelistener("my-addon@me.org:message-from-chrome", handlemessagefromchrome); message-manager-disconnect if you're using a message manager to communicate with a script that may be running in a different process, you can listen for the message-manager-disconnect observer notification to know when the message manager has disconnected from the other end of the conversation, so you can stop sending it messages or expecting to receive messages.
Frame script environment
this means you don't have to worry about global variables you define conflicting with global variables defined by another frame script.
...if you want other principals or when interacting with untrusted page scripts, you should use a sandbox.
... another use is to interact with the content very early in the page load process, long before domcontentloaded event is fired.
Performance
n = new myaddonservice(); main.onchange(statechange); function statechange() { services.mm.broadcastasyncmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // framescript.js var maincopy; function onupdate(message) { maincopy = myaddonservice.deserialize(message.data.newconfig); } addmessagelistener("my-addon:update-configuration", onupdate) // maincopy used by other functions the main issue here is that a separate object is kept for each tab.
...", {newconfig: main.serialize()}) } // processmodule.jsm const exported_symbols = ['getmaincopy']; var maincopy; services.cpmm.addmessagelistener("my-addon:update-configuration", function(message) { maincopy = message.data.newconfig; }) funtion getmaincopy() { return maincopy; } // framescript.js components.utils.import("resource://my-addon/processmodule.jsm") // getmaincopy() used by other functions don't register observers (and other callbacks to global services) in a frame script bad: //framescript.js services.obs.addobserver("document-element-inserted", { observe: function(doc, topic, data) { if(doc.ownerglobal.top != content) return; // bail out if this is for another tab decoratedocument(doc); } }) observer notifications get fired for events that ...
... better: content-document-global-created notifications can be substituted with domwindowcreated events other observers and services should be registered in a process script or jsm instead load frame scripts on demand bad: // addon.js services.mm.loadframescript("framescript.js", /*delayed:*/ true) // stuff communicating with the framescript // framescript.js function onlyonceinabluemoon() { // we only need this during a total solar eclipse while goat blood rains from the sky sendasyncmes...
Embedding the editor
it is likely that we'd use xbl to implement this type of widget, as is the plan for other form controls.
...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.
...the <editor> tag is simply a <iframe> on which an editor is created; in all other respects, it behaves like a xul <iframe>.
Gecko Keypress Event
otherwise, gecko can replace the charcode with an ascii character.
...of course, this is not much help to users with other keyboard layouts.
...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).
How to Report a Hung Firefox
the tool also has command-line options to kill processes with other names or by process id.
... another way to trigger a crash in a hung tab is to run the following script in the browser console (opened after selecting the hung tab): let wm = cc["@mozilla.org/appshell/window-mediator;1"].
... components.classes["@mozilla.org/xre/app-info;1"];if (appinfo && appinfo.getservice(components.interfaces.nsixulruntime).processtype != components.interfaces.nsixulruntime.process_type_default) {components.utils.import("resource://gre/modules/ctypes.jsm");var zero = new ctypes.intptr_t(8);var badptr = ctypes.cast(zero, ctypes.pointertype(ctypes.int32_t));var crash = badptr.contents;}', true); } other techniques on os x if you use a nightly build (>= firefox 16), you can use activity monitor's "sample process" feature to generate a sample.
Integrated Authentication
this entails support for the the simple and protected gss-api negotiation mechanism (spnego) internet standard (rfc 2478) to negotiate either kerberos, ntlm, or other authentication protocols supported by the operating system.
...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 preferences are: pref("network.negotiate-auth.trusted-uris", site-list); pref("network.negotiate-auth.delegation-uris", site-list); pref("network.automatic-ntlm-auth.trusted-uris", site-list); where, site-list is a comma-separated list of url prefixes or domains of the form: site-list = "mydomain.com, https://myotherdomain.com" network.negotiate-auth.trusted-uris lists the sites that are permitted to engage in spnego authentication with the browser, and network.negotiate-auth.delegation-uris lists the sites for which the browser may delegate user authorization to the server.
Widget Wrappers
properties all of a wrapper's properties are read-only unless otherwise indicated.
...table, and will toggle all the widgets' nodes' disabled states label for api-provided widgets, the label of the widget tooltiptext for api-provided widgets, the tooltip of the widget showinprivatebrowsing for api-provided widgets, whether the widget is visible in private browsing single wrapper properties all of a wrapper's properties are read-only unless otherwise indicated.
...this will point to the overflow chevron on overflowable toolbars if and only if your widget node is overflowed, to the anchor for the panel menu if your widget is inside the panel menu, and to the node itself in all other cases overflowed boolean indicating whether the node is currently in the overflow panel of the toolbar isgroup false, will be true for the group widget label for api-provided widgets, convenience getter for the label attribute of the dom node tooltiptext for api-provided widgets, convenience getter for the tooltiptext attribute of the dom node ...
Download
onchange function this can be set to a function that is called after other properties change.
... note: this method should be used in place of the cancel() and removepartialdata() methods while shutting down or disposing of the download object, to prevent other callers from interfering with the operation.
... this is required because cancellation and other operations are asynchronous.
FileUtils.jsm
followlinks optional true if links should be followed, false otherwise.
... shouldcreate optional true if the directory hierarchy specified in patharray should be created if it does not exist, false otherwise.
... followlinks optional true if links should be followed, false otherwise location specified.
OS.File.Error
becauseexists true if the operation failed because a file or directory exists, false otherwise.
... becausenosuchfile true if the operation failed because a file or directory does not exist, false otherwise.
... becauseclosed true if the operation failed because a file or directory is closed, false otherwise.
OS.File.Info
e.info| if (info.isdir) { // |somepath| represents a directory } else if (info.issymlink) { // |somepath| represents a symbolic link } else { // |somepath| represents a regular file } }, function onfailure(reason) { if (reason instanceof os.file.error && reason.becausenosuchfile) { // |somepath| does not represent anything } else { // some other error } } ) example: determining the owner of a file let promise = os.file.stat() promise.then( function onsuccess(info) { if ("unixowner" in info) { // info.unixowner holds the owner of the file } else { // information is not available on this platform } } ); evolution of this example bug 802534 will introduce the ability to check whether field unixo...
... 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.
PerfMeasurement.jsm
note: at present, perfmeasurement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems.
... cpu_migrations uint64 the number of times the profiled thread migrated from one cpu core to another.
...otherwise, it returns false.
Deferred
if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing.
... note: calling this method with a pending promise as the avalue argument, and then calling it again with another value before the promise is resolved or rejected, will have no effect the second time, as the associated promise is already resolved to the pending promise value as its resolution.
...if the promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing.
Deferred
if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing.
... note: calling this method with a pending promise as the avalue argument, and then calling it again with another value before the promise is resolved or rejected, will have no effect the second time, as the associated promise is already resolved to the pending promise value as its resolution.
...if the promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing.
Task.jsm
you can use the yield operator inside the generator function to wait on a promise, spawn another task, or propagate a value: let resolutionvalue = yield (promise/generator/iterator/value); if you specify a promise, the yield operator returns its resolution value as soon as the promise is resolved.
...this reduces the syntax overhead of calling task.spawn() explicitly when you want to recurse into other task functions.
... any other unhandled exception that is thrown inside the task is reported by components.utils.reporterror.
Index
found 42 pages: # page tags and summary 1 localization at mozilla landing, localization, mozilla, translation, l10n localization (l10n) is the process of translating software user interfaces from one language to another and adapting it to suit a foreign culture.
... 21 localizing extension descriptions add-ons, extensions, guide, internationalization, localization this article provides details on how to go about localizing the descriptions of mozilla add-ons, as well as for other metadata about your add-on.
...ith regards to the choice of technology used for localization logic: 39 setting up the infrastructure apache, infrastructure, localization, php, svn, unix first, make your project's file type decision (see localization formats for details): 40 what every mozilla translator should know internationalization, localization l10n stands for localization = l + another 10 letters + n 41 writing localizable code internationalization, localization this page tells you about best practices and guidelines when dealing with ui code with respect to localization.
Localization prerequisites
other varieties of "make" will not work.
...let’s try our entry points: $ hg --version mercurial distributed scm (version 1.3.1) copyright (c) 2005-2009 matt mackall <mpm@selenic.com> and others this is free software; see the source for copying conditions.
...don’t bother the version string here, as long as you’re 3.79.1 or better.
Initial setup
compare-locales compare-locales is a python script that helps you check your work without needing to run firefox or another application.
... l10n checks l10n checks is another python script that helps you check your work without running an application.
...unfortunately, other varieties of make won't do.
QA phase
in order to see your work on firefox (or another mozilla application), you'll need to have a built language pack to install on your local instance.
...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.
... if you're using koala, this should be located at /path/to/your/koala.project/locale/3.6/x-testing, otherwise, it should be located at /path/to/your/working_dir/l10n_base/x-testing.
Creating localizable web applications
localize the date format localizing the date format is as easy as localizing any other string.
...otherwise, php will treat $s as a regular variable, instead of parsing the whole %1$s formatting symbol.
...that's because some languages might require changing the word order, and others might require putting the word firefox in the correct grammatical case.
What every Mozilla translator should know
l10n stands for localization = l + another 10 letters + n mailing lists and other resources there are several mailing lists to keep the track of what's going on, which are available as newsgroups, as well, both on news.mozilla.org and google groups: the main l10n list also available as mozilla.dev.l10n, .l10n in short.
... to keep the track of what's going on, it's also a good idea to read the planet mozilla l10n when you have a problem use the above mailing lists the person in charge of the mozilla l10n is axel hecht (l10n at mozilla.com), pike on irc another interesting way of getting help is the irc channel #l10n at irc.mozilla.org useful tools the l10n dashboard pontoon narro translate toolkit koala 0.1 mozillatranslator mercurial the hg is organized into several repositories, sometimes called branches.
...here we can easily have a look into other languages translations.
Using the viewport meta tag to control layout on mobile browsers
many other mobile browsers now support this tag, although it is not part of any web standard.
...otherwise, the relationship between css pixels and device pixels depends on the current zoom level.
...when the screen is more than 500 pixels wide, the browser will expand the viewport (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.
Mozilla Style System Documentation
(the "non-element" style contexts are defined never to match any rules.) these interfaces nsistylesheet and nsistylerule correspond to the css concepts of style sheets and style rules, except they are more general, and are used by other code that needs to add style information to the document.
...the output of css selector matching as defined by the css specification is an ordered list of rules, where the order determines which declarations override other declarations.
... other nsistylesheet implementations problems: some of the html style information is implemented in the content node classes.
JS::PerfMeasurement
note: at present, js::perfmeasurement 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.
... ::page_faults .page_faults total page-fault exceptions fielded by the os ::major_page_faults .major_page_faults page faults that required disk access ::context_switches .context_switches context switches involving the profiled thread ::cpu_migrations .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.
... (at time of writing, linux allows all the above events to be measured, and we don't have back ends for any other operating system.
Scroll-linked effects
as this animation is driven by javascript on the browser's main thread, it can be interrupted by other javascript running in other tabs or other windows.
... other effects in many cases, scroll-linked effects can be reimplemented using css and made to run on the compositor thread.
... any other related issues or ideas.
powermetrics
other things to note.
... other measurements powermetrics can also report measurements of backlight usage, network activity, disk activity, interrupt distribution, device power states, c-state residency, p-state residency, quality of service classes, and thermal pressure.
... total w = _pkg_ (cores + _gpu_ + other) + _ram_ w #01 17.14 w = 14.98 ( 5.50 + 1.19 + 8.29) + 2.16 w 1 sample taken over a period of 30.000 seconds name id cpu ms/s user% deadlines (<2 ms, 2-5 ms) wakeups (intr, pkg idle) gpu ms/s com.google.chrome 500 439.64 585.35 218.62 19.17 google chrome helper 67319 284.
MailNews automated testing
these tests can go beyond the limitations of xpcshell-tests (for example, access c++ code) and other testing options that don't test at the right level.
... 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.
NSPR Error Handling
pr_pending_interrupt_error the operation terminated because another thread has interrupted it with pr_interrupt.
... pr_io_pending_error an i/o operation has been attempted on a file descriptor that is currently busy with another operation.
... pr_not_same_device_error request to rename a file to a file system on another device.
PR_CEnterMonitor
if a match is found, then either the calling thread is already in the monitor (and this is a reentrant call) or another thread is holding the monitor's mutex.
...in the latter case, the calling thread is likely to find the monitor locked by another thread and waits for that thread to exit before continuing.
... note: pr_centermonitor and pr_cexitmonitor must be paired--that is, there must be an exit for every entry--or the object will never become available for any other thread.
PR_Wait
pr_failure means pr_wait encountered a system error (such as an invalid monitor reference) or the thread was interrupted by another thread.
...this has the effect of making the monitor available to other threads.
...the most obvious is that it was notified by another thread.
Building NSS
you can also build nss on the windows subsystem for linux, but the resulting binaries aren't usable by other windows applications.
... get the source nss and nspr use mercurial for source control like other mozilla projects.
... other subdirectories of nss/tests contain scripts that run a subset of the full suite.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
the only other documentation is the javadoc.
...lla/jss/tests/testkeygen.java org/mozilla/jss/tests/sslclientauth.java org/mozilla/jss/tests/listcacerts.java org/mozilla/jss/tests/keystoretest.java org/mozilla/jss/tests/verifycert.java ssl examples: org/mozilla/jss/tests/sslclientauth.java org/mozilla/jss/ssl/sslclient.java org/mozilla/jss/ssl/sslserver.java org/mozilla/jss/ssl/ssltest.java other test code that may prove useful: org/mozilla/jss/asn1/integer.java org/mozilla/jss/asn1/sequence.java org/mozilla/jss/asn1/set.java org/mozilla/jss/pkcs10/certificationrequest.java org/mozilla/jss/pkcs12/pfx.java org/mozilla/jss/pkix/cert/certificate.java org/mozilla/jss/pkix/cmmf/certrepcontent.java org/mozilla/jss/pkix/crmf/certreqmsg.java org...
...many netscape products, including nss, have nt and windows builds that are essentially the same except one difference: one is linked with the nt version of nspr and the other is linked with the windows version of nspr.
NSS 3.55 release notes
nss 3.55 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_55_rtm/src/ other releases are available in nss releases.
...with this function, a given slot can be queried with a der-encoded certificate, providing performance and usability improvements over other mechanisms.
...another potential workaround is to use the gyp-based build.sh script.
Utilities for nss samples
these utility functions are adapted from those found in the sectool library used by the nss security tools and other nss test applications.
...*/ #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> /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications.
...*/ #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.
NSS sources building testing
hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss after the above commands complete, you should have two local directories, named nspr and nss, next to each other.
...other tools are only used for testing purposes.
...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.
PKCS11 Implement
if a token has been removed and then the same or another token is inserted, c_getsessioninfo should return ckr_session_handle_invalid.
... table 1.2 summarizes the pkcs #11 functions (in addition to the other functions described in this document) that nss expects each type of token to support.
...(you can still use your token for other default functions.) nss does not support replacement of default functions.
NSS_Initialize
this is necessary if another piece of code is using the same pkcs#11 modules that nss is accessing without going through nss, for example, the java sunpkcs11 provider.
...this is necessary if another piece of code is using the same pkcs#11 modules that nss is accessing without going through nss, for example, java sunpkcs11 provider.
...this may be necessary in order to ensure continuous operation and proper shutdown sequence if another piece of code is using the same pkcs#11 modules that nss is accessing without going through nss, for example, java sunpkcs11 provider.
NSS functions
other sources of information: the nss_reference documents the functions most commonly used by applications to support ssl.
...later seckey_destroysubjectpublickeyinfo mxr 3.2 and later seckey_getpublickeytype mxr 3.3 and later seckey_publickeystrengthinbits mxr 3.8 and later seckey_signaturelen mxr 3.11.2 and later utility functions the public functions listed here perform initialization tasks and other services.
..._pkcs7setcontent mxr 3.4 and later sec_pkcs7verifydetachedsignature mxr 3.4 and later sec_pkcs7verifysignature mxr 3.2 and later secmime_decryptionallowed mxr 3.4 and later pkcs #12 functions the public functions listed here perform pkcs #12 operations required by some of the nss tools and other applications.
NSS tools : pk12util
-n | --cert-key-len certkeylength specify the desired length of the symmetric key to be used to encrypt the certificates and other meta-data.
...this allows the certificates to be fed to another application that supports .p12 files.
... o https://wiki.mozilla.org/nss_shared_db_howto o https://wiki.mozilla.org/nss_shared_db additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/.
NSS tools : ssltab
-p port change the default rendezvous port (1924) to another port.
...although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
...if you run the tool on a machine other than the ssl server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate.
NSS tools : ssltap
-p port change the default rendezvous port (1924) to another port.
...although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
...if you run the tool on a machine other than the ssl server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate.
ssltyp.html
syntax #include <pk11expt.h> typedef struct pk11slotinfostr pk11slotinfo; secitem a structure that points to other structures.
...otherwise, free both the structure pointed to and the secitem structure itself.
...otherwise, free both the structure pointed to and the secitem structure itself.
NSS_3.12.3_release_notes.html
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.
... nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an error to try to use a pkcs#11 crypto module in a process before it has been initialized in that process, even if the module was initialized in the parent process.
... if set to any other non-empty value, softoken will report an error in both debug and non-debug builds.
NSS Tools certutil
unless specified otherwise the default token is an internal slot (specifically, internal slot 2).
... category position use zero or more of the following attribute codes: p prohibited (explicitly distrusted) p trusted peer c valid ca t trusted ca to issue client certificates (implies c) c trusted ca to issue server certificates (ssl only) (implies c) u certificate can be used for authentication or signing w send warning (use with other attributes to include a warning when the certificate is used in that context) the attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks.
...ficate: modifying a certificate's trust attribute: displaying a list of the options and arguments used by the certificate database tool: examples creating a new certificate database this example creates a new certificate database (cert8.db file) in the specified directory: certutil -n -d certdir you must generate the associated key3.db and secmod.db files by using the key database tool or other tools.
NSS tools : pk12util
-n | --cert-key-len certkeylength specify the desired length of the symmetric key to be used to encrypt the certificates and other meta-data.
...this allows the certificates to be fed to another application that supports .p12 files.
... o https://wiki.mozilla.org/nss_shared_db_howto o https://wiki.mozilla.org/nss_shared_db additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
-p port change the default rendezvous port (1924) to another port.
...although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
... if you run the tool on a machine other than the ssl server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate.
SpiderMonkey compartments
an object in one compartment cannot touch an object in another compartment, except through a cross-compartment wrapper.
...in the old model, javascript objects could be co-located with arbitrary other javascript objects from other origins.
...in the new model most objects touched by a website are tightly packed next to each other in memory, with no cross-origin objects in between.
Exact Stack Rooting
}; rootedobject obj(cx, newobject(cx, &fooclass, nullptr(), nullptr(), &obj)); rootedvalue v(cx, object_to_value(othergcthing)); jsobject::setreservedslot(obj, 0, v); storing a gcpointer on the cheap todo: tracing and heapptr storing a gcpointer on the cstack gcpointers stored on the cstack are special.
... unlike other gcpointers, they are not traced as part of the gc.
... void otherfunction(jscontext *cx) { ...
Statistics API
when logging to a file is used in combination with multi-process firefox (e10s) it is necessary to set security.sandbox.content.level = 0, otherwise the content process will crash.
... 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).
...in between slices, other browser code is allowed to run.
Self-hosted builtins in SpiderMonkey
in contrast to function.prototype.call, this syntax makes it impossible for other code to interfere and gets compiled to bytecode that doesn't have any overhead compared to a normal function invocation.
...this restriction was added because otherwise it's extremely easy to accidentally call methods that have been changed by content, changing the behavior from what was expected.
... all self-hosted functions have direct access to each other and can rely on references being stable, i.e.
JIT Optimization Outcomes
this can occur if one of the expected types of objects to be used in this operation has unknown properties, or if different instances of the object store the property at different locations (for example, some instances have the property assigned in a different order than others).
...this can occur if the operation is polymorphic on different object types and one or more of the object types contain the property at a different slot than the others.
... arraydoubleconversion the type-system indicates that some arrays at this site should be converted to packed arrays of doubles while others should not.
JSAPI Cookbook
note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and jsapi.
... * otherwise, convert the number to floating point (see the next example).
... // javascript throw new error("failed to grow " + varietal + ": too many greenflies."); /* jsapi */ js_reporterror(cx, "failed to grow %s: too many greenflies.", varietal); return false; to internationalize your error messages, and to throw other error types, such as syntaxerror or typeerror, use js_reporterrornumber instead.
JS::CompileOptions
otherwise, this returns null.
...the code declaring the instance guarantees that such option values will outlive the compileoptions itself: objects are otherwise rooted; principals have had their reference counts bumped; strings will not be freed until the compileoptions goes out of scope.
... in this situation, compileoptions only refers to things others own, so it can be lightweight.
JS::Handle
operator const t&() const t operator->() const bool operator!=(const t &other) const compares ptr and other.
... bool operator==(const t &other) const description js::handle<t> is a const reference to a js::rooted&lt;t&gt;.
...first, when several such functions call each other then redundant rooting of multiple copies of the gc thing can be avoided.
JSAutoByteString
you should call this before calling encode* methods or initbytes method if a string is already owned, otherwise the string will never be freed.
...you can call some methods to take ownership of other string.
...*/ } take ownership of other buffer { char *buff = cx->pod_malloc<char>(length + 1); if (!buff) return false; memcpy(buff, other_buff, length + 1) jsautobytestring bytes; bytes.initbytes(buff); /* ...do something with bytes...
JSConvertOp
other types may be passed as hints, but such behavior is deprecated.
...if you do not use the js_convertvalue method, you may omit support for other types.
... (support for the other types may eventually be removed.) the callback returns true to indicate success or false to indicate failure.
JSVAL_TO_GCTHING
otherwise the resulting pointer is undefined.
...this macro is exposed in jsapi.h because other jsapi macros make use of it.
...another possible alternative is to avoid casting altogether by using an api that operates on jsvals rather than raw pointers (for example, js_call_value_tracer rather than js_call_tracer).
JS_CheckAccess
otherwise, if obj's class has a non-null jsclass.checkaccess callback, then it is called to perform the check.
... otherwise, if a runtime-wide check-object-access callback has been installed by calling js_setcheckobjectaccesscallback, then that is called to perform the check.
... otherwise, access is granted.
JS_ConvertValue
otherwise js_convertvalue reports an error.
... js_convertvalue calls other, type-specific conversion routines based on the type argument.
... converting to jstype_object works exactly like js::toobject if v.isnullorundefined() is false, otherwise the result is nullptr.
JS_DefineObject
create an object that is a property of another object.
... this function combines two operations: creating an object and storing it in a property of another object.
... use js_constructobject, js_constructobjectwitharguments, or js_newobject to create a new object without storing it in a property of another object.
JS_DeleteProperty
otherwise obj has a non-permanent own property with the given name or id.
...otherwise, if obj is not configurable, an error is raised.
... otherwise, the property is removed.
JS_ExecuteRegExp
if test is false, js_executeregexp and js_newregexpobjectnostatics store the match result array to *rval if matches, otherwise stores null to *rval.
... if test is true, js_executeregexp and js_newregexpobjectnostatics store the boolean value true to *rval if matches, otherwise stores null to *rval.
... if successful, js_executeregexp and js_newregexpobjectnostatics returns true and stores the result to *rval, otherwise returns false and the value of *rval is undefined see also mxr id search for js_executeregexp mxr id search for js_executeregexpnostatics regexp bug 571355 - added js_executeregexpnostatics function ...
JS_ExecuteScript
otherwise obj is used.
...it needs to contain the other objects that should end up on the scripts's scope chain.
...otherwise it returns false, and the value left in rval is unspecified.
JS_InternString
get an interned string - a jsstring that is protected from gc and automatically shared with other code that needs a jsstring with the same value.
...otherwise a new string is created and added to the table.
...otherwise they report an error and return null.
JS_LeaveLocalRootScopeWithResult
otherwise, the value is stored in an internal per-jscontext slot.
... this slot is rooted, but the value will eventually be overwritten by some other operation, and it is very difficult to figure out exactly when this will happen—or more to the point, guarantee that it won't happen in the time it takes some specific chunk of code to run.
... in any case, all other newborn values protected by the local root scope, aside from rval, become subject to garbage collection.
JS_NewGlobalObject
otherwise it returns null.
...otherwise, callers should pass dontfireonnewglobalhook, which means that they are responsible for invoking js_fireonnewglobalobject upon successfully creating the global.
...but otherwise, callers must take care to fire the hook exactly once before compiling any script in the global's scope (we have assertions in place to enforce this).
JS_ValueToId
otherwise, if e4x support is enabled and v is an object, *idp receives an object jsid.
... otherwise, *idp receives an interned string jsid based on the value of v.
...otherwise it returns false.
JS_ValueToNumber
otherwise v is an object.
... otherwise, the resulting object's tostring method, if any, is called.
... otherwise conversion fails with a typeerror.
SpiderMonkey 38
on some other platforms (sparc, mips), the jit is provided but not supported.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... these and other changes are explained in detail below.
Running Automated JavaScript Tests
all other flags will be passed along to the harness.
... another common use case is to run just one test, or all the tests in just one directory: jstests.py path_to_js_shell test_path_substring [ test_path_substring_2 ...
...for a smoke test or if you are not changing language-level functionality, you may wish to use jstests.py path_to_js_shell --exclude=test262 other options allow you to show the test command lines being run, command output and return codes, run tests named in a given file, exclude tests named in a given file, hide the progress bar, change the timeout, run skipped tests, print output in tinderbox format, run a test in the debugger, or run tests in valgrind.
WebReplayRoadmap
these messages will show up on the timeline and can be seeked to in the same way as other console messages.
... some of these will be easier to support than others.
... still, porting it to other posix systems (linux, android) will be easier than windows, due to the overlap with macos.
Secure Development Guidelines
elated registers (esp, ebp) mark top and bottom of current stack frame status register (eflags) contains various state information instruction pointer (eip) points to register being executed; can’t be modified directly introduction: gaining control (2) eip is modified using call or jump instructions attacks usually rely on obtaining control over the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is required to modify the eip or sensitive memory saved return addr or function pointer get altered introduction: gaining control (3) common issues used to gain control buffer overflows format string bugs integer overflows/underflows writing secure code: input validation...
...d save you without knowing it examples: if it doesn’t have to be negative, store it in an unsigned int if the input doesn’t have to be > 512, cut it off there if the input should only be [a-za-z0-9], enforce it cross site scripting (xss) xss is a type of code injection attack typically occurs in web applications injection of arbitrary data into an html document from another site victim’s browser executes those html instructions could be used to steal user credentials think: webmail, online auction, cms, online banking...
... could overflow fd_set file i/o: file descriptors and handles good solution: dynamically allocate fd_set structs int main(void) { int i, fd; fd_set fdset; for( i = 0; i < 2000; i++) { fd = open("/dev/null", o_rdwr); } fd_set(fd, &fdset); } file i/o: race conditions operating on files can often lead to race conditions since the file system is shared with other processes you check the state of a file at one point in time and immediately after the state might have changed most file name operations suffer from these race conditions, but not when performed on file descriptors file i/o: race conditions consider the following example int main(int argc, char **argv) { char *file = argv[1]; int fd; struct stat statbuf; stat(file, &statb...
Setting up an update server
these are the files that must be changed: toolkit/components/maintenanceservice/moz.build toolkit/mozapps/update/tests/moz.build firefox should otherwise be built normally.
...backup that file to another location and replace it with <obj dir>/dist/bin/maintenanceservice.exe.
...r 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).
Mork
MozillaTechMork
other serializations of mork have also never been used, so the zany mork version 1.4 format has become the only official mork format.
...however, since the meta-row of a row never appears to be used, i will generally use 'meta-row' to refer to the meta-row of a table, unless otherwise qualified.
...if the scope is not specified, then it is the default scope of the table (if it has one) or 'r' otherwise.
The Places database
it contains the date, referrer, and other information specific to that visit.
... it contains a reference to the moz_places table which contains the url and other global statistics.
... delete favicons for those expiring history entries that are not referenced by any other history entry.
Using the Places annotation service
most methods in the service are duplicated with one method labeled as a 'page annotation' taking an nsiuri and the others labeled as an 'item annotation' and taking the id of an item in the places database.
...d, aname); the returned type will be one of the value_type constants in mozistoragevaluearray.idl: after bug 377066 the value_type_* type handling was changed to this: type_int32 = 1 type_double = 2 type_string = 3 type_binary = 4 type_int64 = 5 try { var value = annotationservice.getpageannotation(uri, "my_extension/some_annotation"); } catch(e) { // annotation does not exist } other functions getpageswithannotation(aname, resultcount, results); getitemswithannotation(aname, resultcount, results); retrieves a list of all pages/items with the given annotation.
... copypageannotations(asourceuri, adesturi, aoverwritedest); copyitemannotations(asourceitemid, adestitemid, aoverwritedest); copies all the annotations from one page/item to another.
XPCOM glue
MozillaTechXPCOMGlue
this is because it forces a dependency on the nspr library, which can otherwise be avoided.
...components using internal linkage will have shared-library dependencies against non-frozen symbols in the xpcom libraries, and will not work with any other versions of xpcom other than the one it was compiled against.
... linux and mac: write the linker options exactly as stated (just replacing the /path/to/sdk/), otherwise you get an undefined symbol: ...ns_tabledrivenqi...qitableentry...
Interfacing with the XPCOM cycle collector
if the collector finds a group of objects that all refer back to one another, and establishes that the objects' reference counts are all accounted for by internal pointers within the group, it considers that group cyclical garbage, which it then attempts to free.
...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.
...if your class has tearoffs or is being aggregated by other classes it is important to make the tearoff classes or the outer classes participate in cycle collection too, not doing so could lead to the cycle collector trying to collect the objects too soon.
Components.utils.evalInWindow
syntax var result = components.utils.evalinwindow(script, window); parameters script : string the script to evaluate in the other window.
...if this is just native (for example, a dom node), then the function relies on xraywrappers to wrap the returned content, otherwise the result is structured-cloned.
...example suppose a page script defines a variable: // page-script.js var somelocalvariable = { name: "selection1", node: document.documentelement }; an add-on script or other privileged script can access the variable using evalinwindow(): // add-on-script.js var result = components.utils.evalinwindow("somelocalvariable", contentwindow); console.log(result); // {"name":"selection1","node":{}} the add-on code can modify the variable as well, of course: // add-on-script.js components.utils.evalinwindow("somelocalvariable.newprop = 42", contentwindow); // page-script.js console.log(window.somelocalvariable.newpr...
Language bindings
an xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.
... exposes modules written in the bound language as xpcom objects, thereby enabling all other languages for which xpcom bindings exist to access these modules.
...in order to allow any other language to use the xpcom api, a bridging layer is required.
nsAString (External)
onst char*, prbool, prbool) - source parameters char* aset prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const prunichar*, const prunichar*, pruint32) - source parameters prunichar* a prunichar* b pruint32 length compare print32 compare(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(prunichar*, prunichar*, pruint32) c print32 compare(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c equals prbool equals(const prunichar*, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters prunichar* other print32 (*)(pr...
...unichar*, prunichar*, pruint32) c prbool equals(const nsastring&, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source parameters nsastring& other print32 (*)(prunichar*, prunichar*, pruint32) c operator< prbool operator<(const nsastring&) const - source parameters nsastring& other prbool operator<(const prunichar*) const - source parameters prunichar* other operator<= prbool operator<=(const nsastring&) const - source parameters nsastring& other prbool operator<=(const prunichar*) const - source parameters prunichar* other operator== prbool operator==(const nsastring&) const - source parameters nsastring& other prbool operator==(const prunichar*) const - source parameters prunichar* other operator>= prbool operator>=(const nsas...
...tring&) const - source parameters nsastring& other prbool operator>=(const prunichar*) const - source parameters prunichar* other operator> prbool operator>(const nsastring&) const - source parameters nsastring& other prbool operator>(const prunichar*) const - source parameters prunichar* other operator!= prbool operator!=(const nsastring&) const - source parameters nsastring& other prbool operator!=(const prunichar*) const - source parameters prunichar* other equalsliteral prbool equalsliteral(const char*) const - source parameters char* aasciistring lowercaseequalsliteral prbool lowercaseequalsliteral(const char*) const - source case-insensitive match this string to a lowercase ascii string.
IAccessible2
other-licenses/ia2/accessible2.idlnot scriptable please add a summary to this article.
...the at could cache the uniqueids in addition to other data being cached.
...another use of this value by an at is to identify when a grouping object has changed, for example when moving from a radio button in one group to a radio button in a different group.
IAccessibleHyperlink
other-licenses/ia2/accessiblehyperlink.idlnot scriptable this interface represents hyperlinks.
...this interface could also be applied to other kinds of objects with multiple actions such as "smart tags" which are objects, typically strings, which have multiple actions such as "activate uri", "bookmark uri", end so on.
...[propget] hresult valid( [out] boolean valid ); parameters valid true if the referenced target is still valid and false otherwise.
inIDOMUtils
if you have requested anonymous content, then if the element has an xbl binding then this will be the binding's anonymous nodes, otherwise if the element is itself an anonymous node containing an insertion point then this will be a list combining the element's explicit children from its binding parent's anonymous nodes and any children inserted as a result of the insertion point.
... return value true if the property is inherited, otherwise false.
... return value true if lock exists, false otherwise clearpseudoclasslocks() removes any pseudo-class locks from the element.
jsdIStackFrame
private data for this context, if it is an nsisupports, |null| otherwise.
...|true| if this context should be allowed to run scripts, |false| otherwise.
...setting or getting this attribute on any other context will throw a ns_error_no_interface exception.
mozIThirdPartyUtil
otherwise, find the uri of the channel, determine whether it is foreign with respect to auri, and return.
...(we have already checked that auri is not foreign with respect to the channel uri.) otherwise, return the result of isthirdpartywindow() with arguments of the channel's bottommost window and the channel uri, respectively.
...isthirdpartyuri() determine whether two uris are third party with respect to each other.
nsIAccessNode
accessible/public/nsiaccessnode.idlscriptable an interface used by in-process accessibility clients to get style, window, markup and other information about a dom node.
... note: the meanings of width, height and other size measurements depend on the version of css being used.
... note: the meanings of width, height and other size measurements depend on the version of css being used.
nsIAccessibleRelation
it is also possible that each member has multiple additional targets, for example one for every other member in the group.
... relation_flows_to 0x07 content flows from this object to a target object, that is has content that flows logically to another object in a sequential way, for example text flow.
... relation_flows_from 0x08 content flows to this object from a target object, that is has content that flows logically from another object in a sequential way, for example text flow.
nsICache
if a cache entry is waiting to be validated by another cache descriptor (so no new cache descriptors for that key can be created), opencacheentry() will return ns_error_cache_wait_for_validation in non-blocking mode.
...once the cache entry has been "validated", other descriptors with read access may be opened to the cache entry.
...if you make a request for only write access to a cache entry and another descriptor with write access is currently open, then the existing cache entry will be 'doomed', and you will be given a descriptor (with write access only) to a new cache entry.
nsIClipboard
otherwise it returns false.
...otherwise it returns false.
...otherwise it returns false.
nsIComponentRegistrar
other loaders may have different semantics.
... return value true if a factory is registered for the classid, false otherwise.
... return value true if a factory is registered for the contractid, false otherwise.
nsIContentPrefService
by default, this is the "hostname grouper," which groups uris by full hostname (in otherwords, by site).
... return value the preference's value is returned; this value may be a string, integer, boolean, or any other value.
... return value true if the preference exists; otherwise false.
nsIContentPrefService2
pass an nsiloadcontext to use storage appropriate to the context's useprivatebrowsing attribute: if useprivatebrowsing is true, temporary private-browsing storage is used, and otherwise permanent storage is used.
... removealldomains() removes all non-global preferences -- in other words, all preferences that have a domain.
... removeallglobals() removes all global preferences -- in other words, all preferences that have no domain.
nsIDOMEventGroup
inherits from: nsisupports last changed in gecko 1.7 method overview boolean issameeventgroup(in nsidomeventgroup other); methods issameeventgroup() reports whether or not another event group is the same as this one.
... boolean issameeventgroup( in nsidomeventgroup other ); parameters other instance of nsidomeventgroup object to compare against.
... return value returns true if the two objects are the same, otherwise false.
nsIDOMXULElement
allowevents boolean true if the element's allowevents attribute is the string "true", otherwise false.
... collapsed boolean true if the element's collapsed attribute is the string "true", otherwise false.
... hidden boolean true if the element's hidden attribute is the string "true", otherwise false.
nsIDragService
void enddragsession( in prbool adonedrag ); parameters adonedrag if adonedrag is true, the drag has finished, otherwise the drag has just left the window.
...if the element is in a document, it will be rendered at its displayed size, otherwise, it will be rendered at its real size.
... for other types of elements, the element is rendered into an offscreen buffer in the same manner as it is currently displayed.
nsIEventTarget
implement this interface in order to support receiving events from other threads.
... note: passing this flag to dispatch may have the side-effect of causing other events on the current thread to be processed while waiting for the given event to be processed.
...if events dispatched to this target will be processed on another thread, returns false.
nsIExternalProtocolService
return value true if we have a handler and false otherwise.
... return value the handler, if any; otherwise a default handler.
... return value true if the protocol is exposed, false otherwise.
nsIFrameScriptLoader
otherwise it will only be loaded into frames that exist at the time of the call.
... by default, frame scripts each have their own scope, so they can declare global variables without causing conflicts with any other frame scripts.
... if present and set to true, this flag switches off that behavior, meaning that the script's scope is shared with any other frame scripts in the same frame that have also set the flag.
nsIHttpChannel
gin of the referring uri for cross-origin requests referrer_policy_unsafe_url always send the referrer, even when downgrading from https to http attributes attribute type description allowpipelining boolean this attribute is a hint to the channel to indicate whether or not the underlying http transaction should be allowed to be pipelined with other transactions.
... this attribute is true by default, though other factors may prevent pipelining.
... return value returns true if the server sent the equivalent of a "cache-control: no-cache" response header, otherwise false.
nsIHttpServer
* * @param path * the path on the server (beginning with a "/") which is to be handled by * handler; this path must not include a query string or hash component; it * also should usually be canonicalized, since most browsers will do so * before sending otherwise-matching requests * @param handler * an object which will handle any requests for the given path, or null to * remove any existing handler; if while the server is running the handler * throws an exception while responding to a request, an http 500 response * will be returned * @throws ns_error_invalid_arg * if path does not begin with a "/" */ void register...
... if the handler throws an * exception during server operation, fallback is to the genericized error * handler (the x00 version), then to 500, using a user-defined error * handler if one exists or the server default handler otherwise.
... * * @param path * the absolute path on the server against which requests will be served * from dir (e.g., "/", "/foo/", etc.); must begin and end with a forward * slash * @param dir * the directory to be used to serve all requests for paths underneath path * (except those further overridden by another, deeper path registered with * another directory); if null, any current mapping for the given path is * removed * @throws ns_error_invalid_arg * if dir is non-null and does not exist or is not a directory, or if path * does not begin with and end with a forward slash */ void registerdirectory(in string path, in nsifile dir); /** * associates files with the given ...
nsILocalFile
exceptions thrown ns_error_file_unrecognized_path indicates that relativefilepath incorrectly begins with a path separator character or otherwise contains invalid characters.
... exceptions thrown ns_error_file_unrecognized_path indicates that relativefilepath incorrectly begins with a path separator character or otherwise contains invalid characters.
... initwithfile() initializes this object with another file.
nsILoginManager
it should not be used for any other purpose.
... return value true if the form was successfully filled out; otherwise false.
... return value true if login saving is enabled for the host, otherwise false.
nsIMacDockSupport
method summary void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext astring text to display in a badge on the application's dock icon.
...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.
nsIMemory
otherwise, it returns a pointer to the newly allocated memory segment.
...otherwise false.
...otherwise, it returns a pointer to the newly allocated memory segment.
nsIMicrosummaryGenerator
1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosummarygenerator aother); astring generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded.
...for generators installed via some other mechanism (for example an extension that dynamically creates generators), this uri is a urn in a form of the extension's own choosing, with the only restriction being that the uri be globally unique.
...boolean equals( in nsimicrosummarygenerator aother ); parameters aother the generator to compare against.
nsIMsgFolder
llofflinestores(in nsimsgwindow amsgwindow,in nsisupportsarray aofflinefolderarray); void emptytrash(in nsimsgwindow amsgwindow, in nsiurllistener alistener); void rename(in astring name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); void updatesummarytotals(in boolean force); void summarychanged(); long getnumunread(in boolean deep); long gettotalmessages(in boolean deep); void clearnewmessages(); void clearrequirescleanup(); void setflag(in unsigned long flag); void clearflag(in unsigned long flag); boolean getflag(in unsigned long flag...
...e.g., you might want to associate an identity with a particular newsgroup, or for imap shared folders in the other users namespace, you might want to create a delegated identity.
...listener alistener); rename() change the name of the folder void rename(in astring name, in nsimsgwindow msgwindow); renamesubfolders() void renamesubfolders(in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); generateuniquesubfoldername() astring generateuniquesubfoldername(in astring prefix, in nsimsgfolder otherfolder); updatesummarytotals() void updatesummarytotals(in boolean force); summarychanged() void summarychanged(); getnumunread() get the total number of unread messages in this folder, or in all subfolders.
nsINavBookmarkObserver
other notifications will be sent during the batch change, but the observer is guaranteed that onendupdatebatch() will be called at the completion of changes.
... auri the uri of the item that was added when aitemtype is type_bookmark, null otherwise.
... auri the uri of the added item if it was type_bookmark, null otherwise.
nsIObserver
adata an optional parameter or other auxiliary data further describing the change or action.
...with this implementation, it's safe (and common practice) for an implementation of nsiobserver to remove itself as an observer during the observe callback, or to add or remove other observers.
... be careful, though, because other uses of nsiobserver may not support these operations correctly within observe.
nsIParserUtils
note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved!
...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.
...to preserve <style> elements and style attributes on other elements, use sanitizerallowstyle.
nsISHEntry
id unsigned long an id to help identify this entry from others during subframe navigation.
... pageidentifier unsigned long an integer that should be the same for two entries attached to the same docshell only if the two entries are entries for the same page in the sense that one could go from the state represented by one to the state represented by the other simply by scrolling (so the entries are separated by an anchor traversal or a subframe navigation in some other frame).
...void settitle( in astring atitle ); parameters atitle setuniquedocidentifier() changes this entry's doc identifier to a new value which is unique among those of all other entries.
nsISessionStore
browser/components/sessionstore/nsisessionstore.idlscriptable provides a means for extensions and other code to store data in association with browser sessions, tabs, and windows.
... for javascript running in windows other than the one you want to use in nsisessionstore, you need a nsidomwindow object containing browser.xul.
...this kind of domwindow object can be obtained from other nsidomwindow objects (like the sidebar window object) by applying the 'mainwindow' statement from working_with_windows_in_chrome_code.
nsISocketTransport
this object supports nsibadcertlistener2 and nsisslerrorlistener for ssl connections, and possibly other interfaces.
...this object supports nsisslsocketcontrol, nsitransportsecurityinfo, and possibly other interfaces.
...otherwise false.
nsIStreamConverter
netwerk/streamconv/public/nsistreamconverter.idlscriptable provides an interface to implement when you have code that converts data from one type to another.
...d 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().
... convert() synchronous version: converts a stream of one type, to a stream of another type.
nsISyncMessageSender
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message "senders" have a single "other side" to which messages are sent.
...send messagename and obj to the "other side" of this message manager.
... for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
nsIWebNavigationInfo
other 1 << 15 note: other return types may be added here in the future as they become relevant.
... returned by istypesupported() to indicate that a type is supported via some other means.
...you may specify null to check for compatibility with nsiwebnavigation objects that are in their default state; otherwise, the result is determined based on the configuration of the specified object (that is, how it is configured by using nsiwebbrowsersetup).
nsIXPConnect
return value missing description exceptions thrown missing exception missing description native code only!evalinsandboxobject evaluate script in a sandbox, completely isolated from all other running scripts.
...if this parameter is given then afilenameflags will not be calculated and will be assumed to be 0 unless another value is given.
...it is a good idea to transfer the jsobject to some equally protected place before releasing the holder (i.e., use js_setproperty to make this object a property of some other jsobject).
nsIXULTemplateBuilder
other query processors may use other types for the datasource.
...void removeresult( in nsixultemplateresult aresult ); parameters aresult the result to remove errors throws ns_error_null_pointer if aresult is null replaceresult() inform the template builder that one result should be replaced with another.
... return value returns true if the node has content generated for it; otherwise returns false.
nsIZipReaderCache
readercache); method overview nsizipreader getinnerzip(in nsifile zipfile, in autf8string zipentry); nsizipreader getinnerzip(in nsifile zipfile, in string zipentry); obsolete since gecko 10 nsizipreader getzip(in nsifile zipfile); void init(in unsigned long cachesize); methods getinnerzip() returns a (possibly shared) cached nsizipreader for a zip inside another zip.
...otherwise the previously created nsizipreader is returned.
...the number of outstanding entries can be much greater than this number, this is the count for those otherwise unused entries.
Performance
isolation: multiple transactions do not affect each other.
...for each commit, sqlite does two disk syncs among many other file operations (see the "atomic commit" section of http://www.sqlite.org/php2004/slides-all.html for more information on how this works).
...some operations will benefit, while others will be hurt.
Storage
otherwise, it's strongly recommended that you use asynchronous execution, for performance reasons.
... in c++, the code would look something like this: bool hasmoredata; while (ns_succeeded(statement->executestep(&hasmoredata)) && hasmoredata) { print32 value; rv = statement->getint32(0, &value); ns_ensure_success(rv, rv); } you can obtain other types of data by using the various methods available on mozistoragevaluearray.
...however, no other interface or method is, so do not use them on different threads at the same time!
Address Book examples
this is currently true in the case of ldap, but may be true in other cases as well.
...however, outlook directories are the only other built-in write capable directories.
... the * onsave method is responsible for analyzing the photo of this * type requested by the user, and storing it, as well as the * other fields required by onload/onshow to retrieve and display * the photo again.
customDBHeaders Preference
in addition to the preference outlined in setting up extension development environment, you'll want to add the following preferences: // this allows you to add extra headers while composing messages user_pref("mail.compose.other.header", "x-superfluous,x-other,x-whatever"); // this enables the preservation of custom headers as incoming mail is processed user_pref( "mailnews.customdbheaders", "x-superfluous,x-other"); important: please pay careful attention to the case of the mailnews.customdbheaders preference.
...user_pref( "mailnews.customdbheaders", "x-superfluous x-other"); adding a column the reply-to column tutorial does a good job of explaining how to add a column with an overlay, so i'll just show you my overlay file: <?xml version="1.0" ?> <overlay id="colsuperfluousoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type='application/javascript' src='chrome://superfluous/content/superfluous.js'/> <tree id="thread...
... javascript code once again, other tutorials have demonstrated the general javascript code used to populated columns with data from a message header, so i'm just including my file for reference.
Toolkit version format
this format is used by the extension manager, software update, and other parts of the platform.
... if at some point a version part of one version string is greater than the corresponding version part of another version string, then the first version string is greater than the other one.
... otherwise, the version strings are equal.
Using js-ctypes
otherwise, the system looks for the library in its standard locations.
...it uses the default abi, returns a 16-bit integer (which is a carbon oserr value), and accepts an integer (the alert type), two strings, a pointer to a parameter block, which we aren't using, and another integer, which is used to return the hit item.
... /* import js-ctypes */ var {cu} = require("chrome"); var {ctypes} = cu.import("resource://gre/modules/ctypes.jsm", null); /* open the library */ try { /* linux */ var libc = ctypes.open("libc.so.6"); } catch (e) { /* most other unixes */ libc = ctypes.open("libc.so"); } /* import a function */ var puts = libc.declare("puts", /* function name */ ctypes.default_abi, /* call abi */ ctypes.int, /* return type */ ctypes.char.ptr); /* argument type */ var ret = puts("hello world from js-ctypes!"); libc.close(); ...
CData
in theory, in other words, the following javascript expression should return a copy of the original cdata object: eval(dataobject.tosource()); tostring() returns a string identifying the data.
... here is a method to read "malformed", it attempts to do readstring on it, if it errors then it tries to read it in another way, so this is an alternative to readstringreplacemalformed, it is an attempt at readingmalformed function readaschar8thenaschar16(stringptr, known_len, jschar) { // when reading as jschar it assumes max length of 500 // stringptr is either char or jschar, if you know its jschar for sure, pass 2nd arg as true // if known_len is passed, then assumption is not made, at the known_len ...
...known_len : 500; var ptrasarr = ctypes.cast(stringptr, ctypes.unsigned_char.array(assumption_max_len).ptr).contents; // must cast to unsigned char (not ctypes.jschar, or ctypes.char) as otherwise i dont get foreign characters, as they are got as negative values, and i should read till i find a 0 which is null terminator which will have unsigned_char code of 0 // can test this by reading a string like this: "_scratchpad/entehandle.js at master · noitidart/_scratchpad 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 u...
PKCS #11 Netscape Trust Objects - Network Security Services
trusted delegator: the certificate is trusted as a certificate authority trust root, and confers its trust to other certificates.
... there are two ways to refer to a certificate depending on whether that certificate is self-signed (like a certificate authority) or signed by another trusted certificate.
... ckt_trusted_delegator trusts the certificate as a certificate authority, and delegates trust (for the purpose) to other signed certificates.
Blocking By Domain - Plugins
third-party plugin block list sites on this list may not use plugins when they are loaded into a third-party iframe in another site.
... criteria in order to improve firefox security and performance, there are two major categories of sites mozilla may choose to add to plugin domain blocking: sites commonly embedded in a 3rd-party context web sites which are commonly embedded into other sites using iframes can have a large impact on browser security and also cause many sites to show plugin activation prompts.
... sites in this category may include advertisers, social media sites, and other utilities.
Flash Activation: Browser Comparison - Plugins
fault when flash is inactive yes no no 'application/x-shockwave-flash' in navigator.mimetypes when user enables flash yes yes yes <object> with fallback content triggers ui yes, with exceptions no yes small/hidden flash triggers additional ui yes no no enabling flash automatically reloads the page no yes yes other features related to flash domain blocking plugin power saver peripheral content pause each of the browser vendors has a roadmap about the future of flash and changes to the user experience.
... the firefox flash roadmap includes links to roadmaps and posts from other vendors.
...the user can click the flash object to show activation options: users have the choice to allow flash just for the current session, or to remember their choice: site authoring tips if a flash element is very small, hidden, or covered by other content, users will probably not notice that flash is required and will become confused.
Drawing and Event Handling - Plugins
the browser sets the port's clip region to the region of the plug-in currently visible (not scrolled off the page, obscured by floating palettes, or otherwise hidden).
... however, for the plug-in to draw at any other time, for example, to highlight on a mouse-down event or draw animation at idle time, it must save the current setting of the port, set up its drawing environment as appropriate, draw, and then restore the port to the previous settings.
... windowless plug-ins provide the plug-in writer with some significant design possibilities: you can place a windowless plug-in within a section; other sections can exist both above and below it.
Streams - Plugins
npres_network_err: the stream failed because of problems with the network, disk i/o error, lack of memory, or some other problem.
...this mode consumes more resources than the others.
...*/ err = npn_destroystream(instance, stream, npres_done); your plug-in can create another instance of itself by specifying its own mime type and a new target name in a call to npn_newstream.
Version, UI, and Status Information - Plugins
the user might appreciate seeing the percentage completed of the current operation or the url of a button or other link object when the cursor is over it, all of which the browser shows.
...for this reason, your message is always displayed, but you have no control over how long it stays in the status line before another message replaces it.
...*/ 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.
Plugin Roadmap for Firefox - Plugins
to support the transition away from flash, firefox is working with other browsers to progressively and carefully make flash usage less common.
... schedule june 2016 starting with firefox 47 in june 2016, all plugins other than adobe flash are click-to-activate.
... march 2017 starting with firefox 52 in march 2017, plugins other than adobe flash are no longer supported in firefox.
Debugging service workers - Firefox Developer Tools
debugging your service worker in any case, when the service worker is successfully registered, you'll see information about it displayed in the application > service workers view (along with any other service workers registered on the same domain): this gives you a variety of information about your service worker: the url that the service worker is registered on.
... there are a couple of other useful controls on this view, too.
... finding registered service workers on other domains as mentioned above, the service worker view of the application panel shows all the service workers registered on the current domain.
Dominators view - Firefox Developer Tools
otherwise, you might want to review the article on dominators concepts.
... any other node that's referenced from two different roots (since in this case, neither root dominates it).
...if one were removed, then the documentprototype would still not be garbage-collected, because it's still retained by the other two path.
Tree map view - Firefox Developer Tools
strings other: this includes internal spidermonkey objects.
... other is further subdivided by the object's type.
...you can see that most of the heap is occupied by the strings used for the monsters' names, and the objects used to contain the monsters' other attributes.
Network monitor toolbar - Firefox Developer Tools
the network monitor provides two toolbar areas, one above the main section, and another below.
... a set of tool icons: pause (or resume) recording network log search the log request blocking an array of buttons to filter the network request list by type: by the content type of the response xhr requests websocket upgrades and messages (labeled ws) other requests a checkbox that allows you to disable caching.
... throttling menu, to simulate various connection types a menu of other actions: persist logs: by default, the network monitor is cleared each time you navigate to a new page or reload the current page.
Network request list - Firefox Developer Tools
each timeline is given a horizontal position in its row relative to the other network requests, so you can see the total time taken to load the page.
... other actions you can take with request blocking: to turn all request blocking off or on: toggle the checkbox next to enable request blocking.
... other ways to use the search panel: to clear the search string: click the x icon in the search field.
Paint Flashing Tool - Firefox Developer Tools
the browser also splits its model of the page into layers that it expects will be updated independently of each other.
... layers are painted independently and then composited, so a change in the appearance of one layer does not trigger a repaint in any other layers, and when only the relation of two layers changes (in an animation, for example) no repaints are required at all.
...so when the element is moved, all that's changed is the relation of the two layers to each other, which is handled in composition: neither layer needs a repaint.
Frame rate - Firefox Developer Tools
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 is most obviously applicable to animations: if the frame rate is too low, an animation will have a jerky appearance, while a faster frame rate will be smoother.
... 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.
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.
... however, the performance cost of modifying a css property can vary from one property to another.
... css property cost in the context of the rendering waterfall, some properties are more expensive than others: property type cost examples properties that affect an element's geometry or position trigger a style recalculation, a layout and a repaint.
Web Console remoting - Firefox Developer Tools
this architecture allows you to connect a web console client instance to a server running on b2g, fennec or some other firefox instance.
...when you attach to the global consoleactor you receive all of the network requests, page errors, and the other events from all of the tabs and windows, including chrome errors and network events.
... the getrequestheaders and other packets to get more details about a network event you can use the following packet requests (and replies).
AudioBuffer.copyToChannel() - Web APIs
example var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); var anotherarray = new float32array; // copy channel data from second channel of myarraybuffer.
... myarraybuffer.copyfromchannel(anotherarray,1,0); // copy data from anotherarray to first channel of myarraybuffer.
...myarraybuffer.copytochannel (anotherarray,0,0); specification specification status comment web audio apithe definition of 'copytochannel' in that specification.
AuthenticatorAssertionResponse.authenticatorData - Web APIs
the server will ensure that this hash matches a hash of its own origin in order to prevent phishing or other man-in-the-middle attacks.
... bit 2, user verification (uv) - if set, authenticator verified the actual user, through a biometric, pin, or other authentication method.
... examples var options = { challenge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var authenticatordata = assertionpkcred.response.authenticatordata; // maybe try to convert the authenticatordata to see what's inside // send response and client extensions to the server so that it can // go on with the authenti...
CSSStyleSheet - Web APIs
for example, one rule might be a cssstylerule object containing a style such as: h1, h2 { font-size: 16pt; } another rule might be an at-rule such as @import or @media, and so forth.
... 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.
... stylesheets list getting the owner element/rule given the style sheet object the interface for the owner object getting the cssstylesheet object from the owner <style> and <link> elements in the document yes .ownernode htmllinkelement, htmlstyleelement, or svgstyleelement .sheet css @import rule in other style sheets applied to the document yes .ownerrule cssimportrule .stylesheet <?xml-stylesheet ?> processing instruction in the (non-html) document yes .ownernode processinginstruction .sheet http link header yes n/a n/a n/a user agent (default) style sheets no n/a n/a n/a specifications specification s...
A basic ray-caster - Web APIs
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.
...i'll leave that for another article, probably from another person.
... so there you are, fire up safari 1.3+ or firefox 1.5+ or some other browser that supports the <canvas> element and enjoy!
console.log() - Web APIs
WebAPIConsolelog
another useful difference in chrome exists when sending dom elements to the console.
... there's more information in the chrome console api reference about this and other functions.
...otherwise, many browsers provide a live view that constantly updates as values change.
DOMMatrix - Web APIs
WebAPIDOMMatrix
the identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).
...otherwise, a typeerror exception is thrown.
...otherwise, a typeerror exception is thrown.
DeprecationReportBody - Web APIs
sourcefile a string containing the path to the source file where the deprecated feature was used, if known, or null otherwise.
... linenumber a number representing the line in the source file in which the deprecated feature was used, if known, or null otherwise.
... columnnumber a number representing the column in the source file in which the deprecated feature was used, if known, or null otherwise.
Document.execCommand() - Web APIs
most commands affect the document's selection (bold, italics, etc.), while others insert new elements (adding a link), or affect an entire line (indenting).
...conditions of having this behavior enabled vary from one browser to another, and have evolved over time.
... enableobjectresizing enables or disables the resize handles on images, tables, and absolutely-positioned elements and other resizable objects.
Document.title - Web APIs
WebAPIDocumenttitle
otherwise, it contains the title specified in the markup (see the notes below).
... example <!doctype html> <html> <head> <title>hello world!</title> </head> <body> <script> alert(document.title); // displays "hello world!" document.title = "goodbye world!"; alert(document.title); // displays "goodbye world!" </script> </body> </html> notes this property applies to html, svg, xul, and other documents in gecko.
...for xul it's the value of the title attribute of the <xul:window> or other top-level xul element.
DocumentOrShadowRoot.elementFromPoint() - Web APIs
if the element at the specified point belongs to another document (for example, the document of an <iframe>), that document's parent element is returned (the <iframe> itself).
... if the method is run on another document (like an <iframe>'s subdocument), the coordinates are relative to the document where the method is being called.
... html <p id="para1">some text here</p> <button onclick="changecolor('blue');">blue</button> <button onclick="changecolor('red');">red</button> the html provides the paragraph whose color will be affected, as well as two buttons: one to change the color to blue, and another to change the color to red.
EcdhKeyDeriveParams - Web APIs
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.
... public a cryptokey object representing the public key of the other entity.
Element.animate() - Web APIs
WebAPIElementanimate
this is primarily of use when sequencing animations based on the end time of another animation.
... you can also include a composite operation or iteration composite operation in your options list: composite optional determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation.
...a single keyframe), and the browser will infer the other end of the animation if it is able to.
Element: click event - Web APIs
in other words, detail will be 2 for a double-click, 3 for triple-click, and so forth.
... 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.
... known workarounds for this bug: for ie9 only: set background-color: rgba(0,0,0,0) set opacity: 0 and an explicit background-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.
Element.getElementsByClassName() - Web APIs
otherwise, they're case sensitive.
... var matches = element.getelementsbyclassname('colorbox'); for (var i=0; i<matches.length; i++) { matches[i].classlist.remove('colorbox'); matches.item(i).classlist.add('hueframe'); } instead, use another method, such as: var matches = element.getelementsbyclassname('colorbox'); while (matches.length > 0) { matches.item(0).classlist.add('hueframe'); matches[0].classlist.remove('colorbox'); } this code finds descendant elements with the "colorbox" class, adds the class "hueframe", by calling item(0), then removes "colorbox" (using array notation).
... another element (if any are left) will then become item(0).
Event - Web APIs
WebAPIEvent
there are many types of events, some of which use other interfaces based on the main event interface.
...some other browsers are starting to support it for web compatibility purposes.
... event.stopimmediatepropagation() for this particular event, prevent all other listeners from being called.
Using the Gamepad API - Web APIs
the gamepad api is a way for developers and designers to access and use gamepads and other game controllers.
...once one gamepad has been interacted with, other gamepads that are connected will automatically be visible.
...doing so is often desirable for games or other interactive web pages that need to know the state of a gamepad now vs.
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.
... extensions to other interfaces navigator navigator.getgamepads() an extension to the navigator object that returns an array of gamepad objects, one for each connected gamepad.
msAudioCategory - Web APIs
yes communications for streaming communication audio such as the following: voip real time chat or other type of phone calls should not be used in non-real-time or non-communication scenarios, such as audio and/or video playback, as playback startup latency is affected.
... yes foregroundonlymedia games or other sounds designed only to work in the foreground, but will mute existing background media sounds.
... for the game experience (dancing games, music games) feature films (designed to pause when they go to the background) no gameeffects game sound effects designed to mix with existing audio characters talking all non-music sounds no gamemedia background music played by a game no soundeffects game or other sound effects designed to mix with existing audio: characters talking beeps, dings, brief sounds no other default audio type, and recommended for all audio media that does not need to continue playing in the background.
HTMLElement.hidden - Web APIs
the htmlelement property hidden is a boolean which is true if the element is hidden; otherwise the value is false.
... appropriate use cases for hidden include: content that isn't yet relevant but may be needed later content that was previously needed but is not any longer content that is reused by other parts of the page in a template-like fashion creating an offscreen canvas as a drawing buffer inappropriate use cases include: hiding panels in a tabbed dialog box hiding content in one presentation while intending it to be visible in others elements that are not hidden must not link to elements which are.
... syntax ishidden = htmlelement.hidden; htmlelement.hidden = true | false; value a boolean which is true if the element is hidden from view; otherwise, the value is false.
HTMLFormElement.requestSubmit() - Web APIs
requestsubmit(), on the other hand, acts as if a submit button were clicked.
...otherwise, the form is submitted with no submitter parameter, so it's submitted directly by the form itself.
... if, on the other hand, requestsubmit() isn't available, this code falls back to calling the form's submit() method.
HTMLFormElement - Web APIs
you can also get the form's element by using its name attribute as a key of the form, but using elements is a better approach—it contains only the form's elements, and it cannot be mixed with other attributes of the form.
...this will be the case with any other form properties, such as <input name="action"> or <input name="post">.
... elements that are considered form controls the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
HTMLImageElement.border - Web APIs
the border property or its longhand properties to not only set the thickness of the border but to potentially apply a wide variety of other styling options to it.
... 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.
... for example, if you have the following html: <img src="image.png" border="2"> the following will provide the same appearance using css instead of this obsolete property: <img src="image.png" style="border: 2px;"> you can further provide additional information to change the color and other features of the border: <img src="image.png" style="border: dashed 2px #333388;"> specifications specification status comment html living standardthe definition of 'htmlimageelement.border' in that specification.
HTMLOrForeignElement.dataset - Web APIs
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 to an attribute name, uses the following rules: restriction: before the transformation, a dash must not be immediately followed by an ascii lowercase letter a to z; the prefix data- is added; any ascii uppercase letter a to z is transformed into a dash, followed by its lowercase counterpart; other characters are left unchanged.
... the restriction in the rules above ensures that the two transformations are the inverse one of the other.
HTMLOutputElement - Web APIs
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.
... when the problem is reported, the user agent may focus the element and change the scrolling position of the document or perform some other action that brings the element to the user's attention.
...the value property otherwise behaves like the textcontent property.
HTMLScriptElement - Web APIs
if the script is blocked, its element receives an error event; otherwise, it receives a load event.
...for scripts from other origins, this controls if error information will be exposed.
... htmlscriptelement.text is a domstring that joins and returns the contents of all text nodes inside the <script> element (ignoring other nodes like comments) in tree order.
HTMLSelectElement - Web APIs
these elements also share all of the properties and methods of other html elements via the htmlelement interface.
...when multiple is true, it returns "select-multiple"; otherwise, it returns "select-one".
...returns the value property of the first selected option element if there is one, otherwise the empty string.
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.
... htmlslotelement.assignedelements() returns a sequence of the elements assigned to this slot (and no other nodes).
... if the flatten option is set to true, it also returns the assigned elements of any other slots that are descendants of this slot.
HTMLTableCellElement - Web APIs
this alternate label can be used in other contexts, such as when describing the headers that apply to a data cell.
...permitted values for scope are: col the header cell applies to the following cells in the same column (or columns, if colspan is used as well), until either the end of the column or another <th> in the column establishes a new scope.
... row the header cell applies to the following cells in the same row (or rows, if rowspan is used as well), until either the end of the row or another <th> in the same row establishes a new scope.
Working with the History API - Web APIs
the new url must be of the same origin as the current url; otherwise, pushstate() will throw an exception.
... in a sense, calling pushstate() is similar to setting window.location = "#foo", in that both will also create and activate another history entry associated with the current document.
... in other documents, it creates an element with a null namespace uri.
Browser storage limits and eviction criteria - Web APIs
there are a number of web technologies that store data of one kind or another on the client-side (i.e., on your local disk).
...here's the actual mapping to directories under a user's firefox profile (other browsers may differ slightly): <profile>/storage — the main top-level directory for storages maintained by the quota manager (see below) <profile>/storage/permanent — persistent data storage repository <profile>/storage/temporary — temporary data storage repository <profile>/storage/default — default data storage repository note: after introducing storage api, the "permanent" fo...
... 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.
InterventionReportBody - Web APIs
sourcefile a string containing the path to the source file where the intervention occurred, if known, or null otherwise.
... linenumber a number representing the line in the source file in which the intervention occurred, if known, or null otherwise.
... columnnumber a number representing the column in the source file in which the intervention occurred, if known, or null otherwise.
KeyboardEvent.code - Web APIs
in other words, this property returns a value that isn't altered by keyboard layout or the state of the modifier keys.
...that would allow both smoother and faster movement, but would also allow the player to be moving and steering at the same time.
... transitions or animations could be used to make the ship's movement smoother, too.
KeyboardEvent.initKeyEvent() - Web APIs
this method is based on early drafts of document object model (dom) level 2 events specification and is implemented in gecko-based browsers; other browsers implemented keyboardevent.initkeyboardevent based on early drafts of document object model (dom) level 3 events specification.
... keycodearg is a unsigned long representing the virtual key code value of the key which was depressed, otherwise 0.
... charcodearg is a unsigned long representingthe unicode character associated with the depressed key otherwise 0.
KeyboardEvent.location - Web APIs
the keyboardevent.location read-only property returns an unsigned long representing the location of the key on the keyboard or other input device.
...otherwise, when numlock is unlocked and the keyboard actually has a numeric keypad, gecko always returns dom_key_location_numpad too.
... on the other hand, if the keyboard doesn't have a keypad, such as on a notebook computer, some keys become numpad only when numlock is locked.
KeyboardEvent - Web APIs
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 would indicate a "z") or a dvorak keyboard layout (where the user would expect an "f").
... keyboardevent.location read only returns a number representing the location of the key on the keyboard or other input device.
...this led to the implementation of non-standard initialization methods, the early dom events level 2 version, keyboardevent.initkeyevent() by gecko browsers and the early dom events level 3 version, keyboardevent.initkeyboardevent() by others.
LocalFileSystem - Web APIs
another api, the quota management api, lets you query an origin's current quota usage and allocation using window.webkitpersistentstorage.queryusageandquota().
...this means that your app cannot read, or write the files of another app's files.
... //taking care of the browser-specific prefix window.requestfilesystem = window.requestfilesystem || window.webkitrequestfilesystem; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the error callback // for denial of access and other errors.
MediaCapabilitiesInfo - Web APIs
otherwise, it is false.
... if supported is true, and playback will be smooth, smooth is true, otherwise, is it false.
...if supported is true, and playback will be power efficient, powerefficient is true, otherwise, is it false.
MediaStreamTrack - Web APIs
the mediastreamtrack interface represents a single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well.
... mediastreamtrack.readonly read only returns a boolean value with a value of true if the track is readonly (such a video file source or a camera that settings can't be modified), false otherwise.
... mediastreamtrack.remote read only returns a boolean with a value of true if the track is sourced by a rtcpeerconnection, false otherwise.
MediaTrackConstraints.latency - Web APIs
in most cases, low latency is desirable for performance and user experience purposes, but when power consumption is a concern, or delays are otherwise acceptable, higher latency might be acceptable.
... if this property's value is a number, the user agent will attempt to obtain media whose latency tends to be as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required latency (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackSettings - Web APIs
properties of audio tracks autogaincontrol a boolean which indicates the current value of the autogaincontrol property, which is true if automatic gain control is enabled and is false otherwise.
... echocancellation a boolean indicating the current value of the echocancellation property, specifying true if echo cancellation is enabled, otherwise false.
... noisesuppression a boolean which indicates the current value of the noisesupression property, which is true if noise suppression is enabled and is false otherwise.
Using the Media Capabilities API - Web APIs
these parameters may include the codecs, resolutions, bit rates, frame rates, and other such details.
... support for getting real-time feedback about the playback of media, so your code can make informed decisions about adapting the stream's quality or other settings to manage the user's perceived media performance and quality.
... the mediacapabilities interface the mediacapabilities is available using the mediacapabilities property which is provided by both the navigator object and the workernavigator object; in other words, the media capabilities api is available both on the main thread and from workers.
MessageChannel.port2 - Web APIs
the port2 read-only property of the messagechannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
... syntax channel.port2; value a messageport object representing the second port of the channel, the port attached to the context at the other end of the channel.
... var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addeventlistener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too).
Navigation Timing API - Web APIs
concepts and usage you can use the navigation timing api to gather performance data on the client side, which you can then transmit to a server using xmlhttprequest or other techniques.
... the navigation timing api can be used to gather performance data on the client side to be sent to a server via xhr as well as measure data that was very difficult to measure by other means such as time to unload a previous page, domain look up time, window.onload total time, etc.
... calculate page render time as another example of an interesting piece of data you can obtain using the navigation timing api that you can't otherwise easily get, you can get the amount of time it took to render the page: const rendertime = perfdata.domcomplete - perfdata.domloading; this is obtained by starting with the time at which loading of the dom and its dependencies is complete (domcomplete) and subtracting from it the time ...
Node.textContent - Web APIs
WebAPINodetextContent
syntax let text = somenode.textcontent someothernode.textcontent = string value a string or null description the value of textcontent depends on the situation: if the node is a document or a doctype, textcontent returns null.
... for other node types, textcontent returns the concatenation of the textcontent of every child node, excluding comments and processing instructions.
...it is impossible to insert the nodes again into any other element or into the same element after doing so.
Node - Web APIs
WebAPINode
the dom node interface is an abstract base class upon which many other dom api objects are based, thus letting those object types to be used similarly and often interchangeably.
... node.comparedocumentposition() compares the position of the current node against another node in any other document.
... node.getboxquads() returns a list of the node's css boxes relative to another node.
Notification.requestPermission() - Web APIs
// let's check if the browser supports notifications if (!("notification" in window)) { alert("this browser does not support desktop notification"); } // let's check whether notification permissions have already been granted else if (notification.permission === "granted") { // if it's okay let's create a notification var notification = new notification("hi there!"); } // otherwise, we need to ask the user for permission else if (notification.permission !== "denied") { notification.requestpermission().then(function (permission) { // if the user accepts, let's create a notification if (permission === "granted") { var notification = new notification("hi there!"); } }); } // at last, if the user has denied notifications, and you /...
.../ want to be respectful there is no need to bother them any more.
... } we no longer show a live sample on this page, as chrome and firefox no longer allow notification permissions to be requested from cross-origin <iframe>s, with other browsers to follow.
Notification - Web APIs
// let's check if the browser supports notifications if (!("notification" in window)) { alert("this browser does not support desktop notification"); } // let's check whether notification permissions have already been granted else if (notification.permission === "granted") { // if it's okay let's create a notification var notification = new notification("hi there!"); } // otherwise, we need to ask the user for permission else if (notification.permission !== "denied") { notification.requestpermission().then(function (permission) { // if the user accepts, let's create a notification if (permission === "granted") { var notification = new notification("hi there!"); } }); } // at last, if the user has denied notifications, and you /...
.../ want to be respectful there is no need to bother them any more.
... } we no longer show a live sample on this page, as chrome and firefox no longer allow notification permissions to be requested from cross-origin <iframe>s, with other browsers to follow.
Using the Notifications API - Web APIs
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.
...old versions of chrome didn't remove notifications automatically so you can do so after a settimeout() only for those legacy versions in order to not remove notifications from notification trays on other browsers.
..." + i, {tag: 'somanynotification'}); if (i++ == 9) { window.clearinterval(interval); } }, 200); } // otherwise, we can fallback to a regular modal alert else { alert("hi!"); } }); } // if the user refuses to get notified else { // we can fallback to a regular modal alert alert("hi!"); } }); }); see the live result below: specifications specification status comment notifications api living standard living ...
PaymentRequest.canMakePayment() - Web APIs
for instance, you might call canmakepayment() to determine if the browser will let the user pay using payment request api, and if it won't, you could fall back to another payment method, or offer a list of methods that aren't handled by payment request api (or even provide instructions for paying by mail or by phone).
... if (await supportsapplepay) { // show apple pay logo, for instance return; } // otherwise...
... let's see if we can use basic card const supportsbasiccard = await new paymentrequest( [{ supportedmethods: "basic-card" }], details ).canmakepayment(); if (supportsbasiccard) { // show basic card support return; } // otherwise, make payments using html form element } specifications specification status comment payment request apithe definition of 'canmakepayment()' in that specification.
performance.now() - Web APIs
WebAPIPerformancenow
the precision of the returned value is subject to change if/when the security concerns are alleviated through other means.
... syntax t = performance.now(); example const t0 = performance.now(); dosomething(); const t1 = performance.now(); console.log(`call to dosomething took ${t1 - t0} milliseconds.`); unlike other timing data available to javascript (for example date.now), the timestamps returned by performance.now() are not limited to one-millisecond resolution.
...otherwise, performance.timing.navigationstart + performance.now() will be approximately equal to date.now().
Pinch zoom gestures - Web APIs
this example shows how to detect the pinch/zoom gesture, which uses pointer events to detect whether the user moves two pointers closer or farther apart from each other.
...the pinch in (zoom out) gesture, which moves the two pointers toward each other, changes the target element's background color to lightblue.
... the pinch out (zoom in) gesture, which moves the two pointers away from each other, changes the target element's background color to pink.
ProgressEvent() - Web APIs
in other words, it tells if the progress is measurable or not.
...when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead.
...when downloading a resource using http, this only represent the content itself, not headers and other overhead.
ProgressEvent.initProgressEvent() - Web APIs
in other words, it tells if the progress is measurable or not.
...when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead.
...when downloading a resource using http, this only represent the content itself, not headers and other overhead.
ProgressEvent - Web APIs
in other words, it tells if the progress is measurable or not.
...when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead.
...when downloading a resource using http, this only represent the content itself, not headers and other overhead.
PublicKeyCredentialCreationOptions.extensions - Web APIs
also chrome doesn't plan to support any other extension in future extension identifier type description authnsel array of buffersource authenticator selection.
...if no matching authenticator is available, the credential is still generated with another available authenticator.
...in other words, this may be used server side to check if the current operation is based on the same biometric data that the previous authentication.
RTCConfiguration - Web APIs
a value of relay limits the candidates to those relayed through another server, such as a stun or turn server.
... 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.
...otherwise, both the rtp and rtcp candidates are returned, separately.
RTCIceCandidate.address - Web APIs
address is null by default if not otherwise specified.
... security notes it's important to note here that although webrtc does not require the two peers on an rtcpeerconnection to know one another's true ip addresses, the address property on rtcicecandidate can expose more information about the source of the remote peer than the user expects.
...cconfiguration, like this: var rtcconfig = { iceservers: [ { urls: "turn:myturn.server.ip", username: "username", credential: "password" } ], icetransportpolicy: "relay" } by setting rtcconfiguration.icetransportpolicy to "relay", any host candidates (candidates where the ip address is the peer's own ip address) are left out of the pool of candidates, as are any other candidates which aren't relay candidates.
RTCIceCandidate - Web APIs
relatedaddress read only if the candidate is derived from another candidate, relatedaddress is a domstring containing that host candidate's ip address.
... relatedport read only for a candidate that is derived from another, such as a relay or reflexive candidate, the relatedport is a number indicating the port number of the candidate from which this candidate is derived.
...otherwise, tcptype is null.
RTCPeerConnection.createAnswer() - Web APIs
return value a promise whose fulfillment handler is called with an object conforming to the rtcsessiondescriptioninit dictionary which contains the sdp answer to be delivered to the other peer.
...this code comes from the handler for the message sent to carry an offer to another peer across the signaling channel.
...in this case, a websocket connection is used to send a json message with a type field with the value "video-answer" to the other peer, carrying the answer to the device which sent the offer to connect.
RTCPeerConnection.setLocalDescription() - Web APIs
otherwise, setlocaldescription() creates an answer, which becomes the new local description.
... pc.addeventlistener("negotiationneeded", async (event) => { await pc.setlocaldescription(); signalremotepeer({ description: pc.localdescription }); }); other than error handling, that's about it!
...we can then send the newly-created offer along to the other peer using the signaling server, which here is done by calling a function called signalremotepeer().
RTCPeerConnection.setRemoteDescription() - Web APIs
this is typically called after receiving an offer or answer from another peer over the signaling server.
... operationerror any errors that occur which don't match the others specifeid here are reported as operationerror.
... on the other hand, if we're in the middle of an ongoing negotiation and an offer is passed into setremotedescription(), the ice agent automatically begins an ice rollback in order to return the connection to a stable signaling state, then, once the rollback is completed, sets the remote description to the specified offer.
RTCRtpStreamStats.ssrc - Web APIs
you should not make any assumptions based on the value of ssrc other than that any two objects with the same ssrc value refer to the same source.
...while not part of the standard, exactly, it is a good mechanism that may be used by some browsers; others may use other methods, such as random number generators.
... do not rely upon these values meaning anything other than "these objects are associated with the same source." specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcrtpstreamstats.ssrc' in that specification.
RTCSessionDescription() - Web APIs
this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods 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.
...in other words, this session description describes the agreed-upon configuration, and is being sent to finalize negotiation.
... this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods 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.
RTCStatsReport - Web APIs
candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegatheringstate 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.
...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.
RTCStatsType - Web APIs
candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegatheringstate 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.
...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.
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.
Request.cache - Web APIs
WebAPIRequestcache
otherwise the resource will be downloaded from the server and the cache will be updated.
...otherwise the resource will be downloaded from the server and the cache will be updated.
...new date(date).gettime() : 0 if (dt < (date.now() - 86400000)) { // if older than 24 hours controller.abort() controller = new abortcontroller(); return fetch("some.json", {cache: "reload", mode: "same-origin", signal: controller.signal}) } // other possible conditions if (dt < (date.now() - 300000)) // if it's older than 5 minutes fetch("some.json", {cache: "no-cache", mode: "same-origin"}) // no cancellation or return value.
Request.mode - Web APIs
WebAPIRequestmode
the associated mode, available values of which are: same-origin — if a request is made to another origin with this mode set, the result is simply an error.
... no-cors — prevents the method from being anything other than head, get or post, and the headers from being anything other than simple headers.
... however, for requests created other than by the request.request constructor, no-cors is typically used as the mode; for example, for embedded resources where the request is initiated from markup, unless the crossorigin attribute is present, the request is in most cases made using the no-cors mode — that is, for the <link> or <script> elements (except when used with modules), or <img>, <audio>, <video>, <object>, <embed>, or <ifra...
Resize Observer API - Web APIs
concepts and usage there are a whole raft of use cases for responsive design techniques (and others besides) that respond to changes in an element's size, but previously their implementations have often been hacky and/or brittle.
...the window resize event), then figure out what the new dimensions or other features of the element after a resize using element.getboundingclientrect or window.getcomputedstyle, for example.
... usage is simple, and pretty much the same as other observers, such as performance observer or intersection observer — you create a new resizeobserver object using the resizeobserver() constructor, then use resizeobserver.observe() to make it look for changes to a specific element's size.
Resource Timing API - Web APIs
the interface also includes other properties that provide data about the size of the fetched resource as well as the type of resource that initiated the fetch.
... the properties which are returned as 0 by default when loading a resource from a domain other than the one of the web page itself: redirectstart, redirectend, domainlookupstart, domainlookupend, connectstart, connectend, secureconnectionstart, requeststart, and responsestart.
... other properties the nexthopprotocol property returns the network protocol used to fetch the resource.
Screen Capture API - Web APIs
this stream can then be recorded or shared with others over the network.
... additions to existing dictionaries the screen capture api adds properties to the following dictionaries defined by other specifications.
... feature policy validation user agents that support feature policy (either using http's feature-policy header or the <iframe> attribute allow) can specify a desire to use the screen capture api using the policy control directive display-capture: <iframe allow="display-capture" src="/some-other-document.html"> the default allow list is self, which lets the any content within the document use screen capture.
Selection - Web APIs
WebAPISelection
however, browsers other than gecko did not implement multiple ranges, and the specification also requires the selection to always have a single range.
... note: the selection api methods may only move focus to an editing host, not to other focusable elements (e.g., <a>).
...t() selection.collapsetoend() selection.extend() selection.selectallchildren() selection.addrange() selection.setbaseandextent() and when the range is modified using the following methods: range.setstart() range.setend() range.setstartbefore() range.setstartafter() range.setendbefore() range.setendafter() range.collapse() range.selectnode() range.selectnodecontents() glossary other key terms used in this section.
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
use this method with clients.claim() to ensure that updates to the underlying service worker take effect immediately for both the current client and all other active clients.
... example while self.skipwaiting() can be called at any point during the service worker's execution, it will only have an effect if there's a newly installed service worker that might otherwise remain in the waiting state.
... self.skipwaiting(); // perform any other actions required for your // service worker to install, potentially inside // of event.waituntil(); }); specifications specification status comment service workersthe definition of 'skipwaiting()' in that specification.
SubtleCrypto.encrypt() - Web APIs
the other three encryption algorithms here are all symmetric algorithms, and they're all based on the same underlying cipher, aes (advanced encryption standard).
...gcm does provide built-in authentication, and for this reason it's often recommended over the other two aes modes.
... one major difference between this mode and the others is that gcm is an "authenticated" mode, which means that it includes checks that the ciphertext has not been modified by an attacker.
SubtleCrypto.unwrapKey() - Web APIs
as with subtlecrypto.importkey(), you specify the key's import format and other attributes of the key to import details such as whether it is extractable, and which operations it can be used for.
... once we have the unwrapping key we pass it into unwrapkey() with the wrapped key and other parameters.
... once we have the unwrapping key we pass it into unwrapkey() with the wrapped key and other parameters.
TextRange - Web APIs
WebAPITextRange
although it is well supported by ie, most other browsers no longer support this property.
... textrange.setendpoint() sets the end point of the current range based on the bounds of other textrange.
... however, in other browsers, document does not have a so-called selection attribute - they operate on the selection through the standard selection api, that is, they get the selection object through the window.getselection() method, and use the standard range object to process the text fragment.
Touch events - Web APIs
other fingers may subsequently touch the surface and optionally move across the touch surface.
... note: the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus or other contact method.
... handling canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the touchcancel event is sent, and we call the handlecancel() function below.
WebGL2RenderingContext.copyBufferSubData() - Web APIs
the webgl2renderingcontext.copybuffersubdata() method of the webgl 2 api copies part of the data of a buffer to another buffer.
... gl.copy_read_buffer: buffer for copying from one buffer object to another (provided specifically for copy operations).
... gl.copy_write_buffer: buffer for copying from one buffer object to another (provided specifically for copy operations).
WebGLRenderingContext.bindBuffer() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
...an attempt to bind the buffer to another target will throw an invalid_operation error and the current buffer binding will remain the same.
WebGLRenderingContext.makeXRCompatible() - Web APIs
examples this example demonstrates code logic you might find in a game that starts up using webgl to display menus and other ui, and uses webgl to render gameplay, but has a button on its main menu that offers an option to start the game in webxr mode.
...&& navigator.xr) { try { xrsession = await navigator.xr.requestsession("immersive-vr"); usingxr = true; } catch(err) { xrsession = null; usingxr = false; } } startgame(); } function startgame() { currentscene = "scene1"; loadsceneresources(currentscene); /* and so on */ } this works by having two buttons, one which starts the game normally and the other which starts the game in vr mode.
... if the other button was clicked, we ensure that xrsession is null and clear usingxr to false.
WebGL constants - Web APIs
returns true if it was, false otherwise.
...eep 0x1e00 replace 0x1e01 incr 0x1e02 decr 0x1e03 invert 0x150a incr_wrap 0x8507 decr_wrap 0x8508 textures constants passed to webglrenderingcontext.texparameteri(), webglrenderingcontext.texparameterf(), webglrenderingcontext.bindtexture(), webglrenderingcontext.teximage2d(), and others.
...x85b5 max_vertex_output_components 0x9122 max_fragment_input_components 0x9125 max_server_wait_timeout 0x9111 max_element_index 0x8d6b textures constants passed to webglrenderingcontext.texparameteri(), webglrenderingcontext.texparameterf(), webglrenderingcontext.bindtexture(), webglrenderingcontext.teximage2d(), and others.
Matrix math for the web - Web APIs
using the identity matrix it should return a matrix identical to the original, since a matrix multiplied by the identity matrix is always equal to itself: // sets identityresult to [4,3,2,1] let identityresult = multiplymatrixandpoint(identitymatrix, [4, 3, 2, 1]); returning the same point is not very useful, but there are other types of matrices that can perform helpful operations on points.
... another mind-bender is that matrix multiplication in webgl and css needs to happen in the reverse order that the operations intuitively happen.
...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.
Adding 2D content to a WebGL context - Web APIs
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.
...for more info on projection and other matrixes you might find this article useful.
Using WebGL extensions - Web APIs
note: in webgl, unlike in other gl apis, extensions are only available if explicitly requested.
... ext_: extensions that mirror other opengl es or opengl api extensions.
...for example: var float_texture_ext = gl.getextension('oes_texture_float'); the return value is null if the extension is not supported, or an extension object otherwise.
Improving compatibility using WebRTC adapter.js - Web APIs
there's no need to conditionally use prefixed apis or implement other workarounds.
... 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 specification.
...these are just a couple of examples; there are of course other adjustments made for you by the shim.
WebRTC API - Web APIs
the set of standards that comprise webrtc makes it possible to share data and perform teleconferencing peer-to-peer, without requiring that the user installs plug-ins or any other third-party software.
...adapter.js also handles prefixes and other naming differences to make the entire webrtc development process easier, with more broadly compatible results.
...this event does not bubble (except where otherwise stated) and is not cancelable (except where otherwise stated).
Controlling multiple parameters with ConstantSourceNode - Web APIs
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.
...the other oscillator has a fixed volume.
... finally, we connect all the gain nodes to the audiocontext's destination, so that any sound delivered to the gain nodes will reach the output, whether that output be speakers, headphones, a recording stream, or any other destination type.
Visualizations with Web Audio API - Web APIs
one of the most interesting features of the web audio api is the ability to extract frequency, waveform, and other data from your audio source, which can then be used to create visualizations.
...dow.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); this node is then connected to your audio source at some point between your source and your destination, for example: source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(audioctx.destination); note: you don't need to connect the analyser's output to another node for it to work, as long as the input is connected to the source, either directly or via another node.
... the middle of the right hand side of the canvas, then draw the stroke we've defined: canvasctx.lineto(canvas.width, canvas.height/2); canvasctx.stroke(); }; at the end of this section of code, we invoke the draw() function to start off the whole process: draw(); this gives us a nice waveform display that updates several times a second: creating a frequency bar graph another nice little sound visualization to create is one of those winamp-style frequency bar graphs.
Web Locks API - Web APIs
while held, no other script executing in the same origin can acquire the same lock, which allows a web app running in multiple tabs or workers to coordinate work and the use of resources.
...}); while a lock is held, requests for the same lock from this execution context, or from other tabs/workers, will be queued.
...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.
Using the Web Speech API - Web APIs
this accepts as parameters the string we want to add, plus optionally a weight value that specifies the importance of this grammar in relation of other grammars available in the list (can be from 0 to 1 inclusive.) the added grammar is available in the list as a speechgrammar object instance.
...we also set a few other properties of the recognition instance before we move on: speechrecognition.continuous: controls whether continuous results are captured (true), or just a single result each time recognition is started (false).
...try ' + colorhtml + '.'; document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } receiving and handling results once the speech recognition is started, there are many event handlers that can be used to retrieve results, and other pieces of surrounding information (see the speechrecognition event handlers list.) the most common one you'll probably use is speechrecognition.onresult, which is fired once a successful result is received: recognition.onresult = function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; cons...
Using the Web Storage API - Web APIs
we have also provided an event output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information outputted as a storageevent is fired.
...this won't work on the same page that is making the changes — it is really a way for other pages on the domain using the storage to sync any changes that are made.
... pages on other domains can't access the same storage objects.
Web Workers API - Web APIs
worker()) that runs a named javascript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window.
... in addition to dedicated workers, there are other types of worker: shared workers are workers that can be utilized by multiple scripts running in different windows, iframes, etc., as long as they are in the same domain as the worker.
...they are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server.
Privileged features - Web APIs
mozilla 1.2+ and netscape 7.1 will render the other menu system commands (in ff 1.0 and in ns 7.0x, the command system menu is not identified with the firefox/ns 7.0x icon on the left end of the titlebar: that's probably a bug.
... alwaysraised if on, the new window will always be displayed on top of other browser windows, regardless of whether it is active or not.
... alwaysontop if on, the new window will always be displayed on top of all other windows (browser windows and otherwise), regardless of whether it is active or not.
Window.requestAnimationFrame() - Web APIs
note: your callback routine must itself call requestanimationframe() if you want to animate another frame at the next repaint.
... 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.
...this is a non-zero value, but you may not make any other assumptions about its value.
Window.showModalDialog() - Web APIs
options is an optional string specifying window ornamentation for the dialog, using one or more semicolon delimited values: syntax description center: {on | off | yes | no | 1 | 0 } if on, yes, or 1, the dialog window is centered on the desktop; otherwise it's hidden.
... resizable: {on | off | yes | no | 1 | 0 } if this argument's value is on, yes, or 1, the dialog window can be resized by the user; otherwise its size is fixed.
... scroll: {on | off | yes | no | 1 | 0 } if on, yes, or 1, the dialog window has scroll bars; otherwise its size is fixed.
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
the microtask is a short function which will run after the current task has completed its work and when there is no other code waiting to be run before control of the execution context is returned to the browser's event loop.
... this lets your code run without interfering with any other, potentially higher priority, code that is pending, but before the browser regains control over the execution context, potentially depending on work you need to complete.
... microtasks are especially useful for libraries and frameworks that need to perform final cleanup or other just-before-rendering tasks.
XRBoundedReferenceSpace.boundsGeometry - Web APIs
theoretically, a more advanced system might use sensors or other detection methods to determine the bounds of a dedicated xr room (notice how we carefully don't call it a holodeck?).
...in other words, the bounds are the physical limitations of the available space, shifted so that the reference space's bounds points are all defined relative to the xrboundedreferencespace's effective origiin.
... although some samples render a mesh or other shape to display the bounds to the user, in a real-world application, you shouldn't do this.
XRView.eye - Web APIs
WebAPIXRVieweye
none the xrview describes a monoscopic view, or the view otherwise doesn't represent a particular eye's point-of-view.
...for dynamically-rendered 3d content, you can usually ignore this and simply render each of the viewer's views, one after another.
...otherwise, we don't.
ARIA live regions - Accessibility
for regions which are not important, or would be annoying because of rapid updates or other reasons, silence them with aria-live="off".
...thus, moving down in the list and selecting another planet will not announce updates in the live region.
... here is a screenshot of voiceover on mac announcing the update (via subtitles) to the live region: preferring specialized live region roles in the following well-known predefined cases it is better to use a specific provided "live region role": role description compatibility notes log chat, error, game or other type of log to maximize compatibility, add a redundant aria-live="polite" when using this role.
ARIA: document role - Accessibility
generally placed within an application role or other interactive widget role, the document role is used to indicate a section of a complex composit widget that an assistive technology user should read using its browse or virtual reading mode, if available.
... in contrast to the article role, the document role does not have any relation to other elements with a document role, it merely has a relationship to the containing composit widget.
...other values include the default undefined which means the document is not collapsible.
ARIA: feed role - Accessibility
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 label when navigating by article.
... if a feed is nested within a feed, such as a comments feed within a feed of blog posts, the convention is to tab into the nested feed with the tab key and to provide another key, such as alt + page down, to navigate from an 'outer' article to the first item in that article's nested feed.
...each article should have an aria-labelledby referring to the article title or other child that can serve as a distinguishing label.
ARIA: figure role - Accessibility
a figure is generally 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.
... description any content that should be grouped together and consumed as a figure (which could include images, video, audio, code snippets, or other content) can be identified as a figure using role="figure".
...you should make sure that it is accessible just like any other content.
ARIA: Region role - Accessibility
it is used to provide a generic landmark for people to be able to navigate to easily when none of the other landmark roles are appropriate.
...a region role is a more generic term, and should only be used if the section needing to be identified is not accurately described by one of the other landmark roles, such as banner, main, contentinfo, complementary, or navigation.
... only use the region role if no other relevant content sectioning element or landmark role applies.
ARIA: tab role - Accessibility
the common user experience pattern is a group of visual tabs above, or to the side of, a content area, and selecting a different tab changes the content and makes the selected tab more prominent than the other tabs.
... when working with elements with the tab role, when they are selected or active, they should have their aria-selected attribute set to true, otherwise it should be set to false.
... when a tab is selected or active, its controlled tabpanel should have its aria-expanded and hidden attributes set to true, otherwise they should be set to false.
An overview of accessible web applications and widgets - Accessibility
roles describe widgets that aren't otherwise available in html 4, such as sliders, menu bars, tabs, and dialogs.
...examples include (but are certainly not limited to): aria-checked: indicates the state of a checkbox or radio button aria-disabled: indicates that an element is visible, but not editable or otherwise operable aria-grabbed: indicates the 'grabbed' state of an object in a drag-and-drop operation (for a full list of aria states, consult the aria list of states and properties.) developers should use aria states to indicate the state of ui widget elements and use css attribute selectors to alter the visual appearance based on the state changes (rather than using script to change a class na...
...javascript to update the aria-checked attribute var showtip = function(el) { el.setattribute('aria-hidden', 'false'); } role changes aria allows developers to declare a semantic role for an element that otherwise offers incorrect or no semantics.
Keyboard-navigable JavaScript widgets - Accessibility
with the tabindex global attribute, authors can make other elements focusable, too.
...tabindex="-1") yes no; author must focus the element with focus() in response to arrow or other key presses.
...to do this: bind a key down handler to each element in the group, and when an arrow key is used to move to another element: programmatically apply focus to the new element, update the tabindex of the focused element to "0", and update the tabindex of the previously focused element to "-1".
Color contrast - Accessibility
having good color contrast on your site benefits all your users, but it is particularly beneficial to users with certain types of color blindness and other similar conditions, who experience low contrast, and have trouble differentiating between similar colors.
... this is because they don't see bright and dark areas as readily as those without such conditions, and therefore have trouble seeing edges, borders, and other details.
... "good" <div> has a light purple background, which makes the text easy to read: example1 <div class="good"> good contrast </div> div { font-family: sans-serif; text-align: center; font-size: 2rem; font-weight: bold; width: 250px; padding: 30px; border-radius: 20px; box-shadow: 1px 1px 1px black; } .good { background-color: #fae6fa; } the "bad" <div> on the other hand has a very dark purple background, which makes the text much harder to read: example2 <div class="bad"> bad contrast </div> div { font-family: sans-serif; text-align: center; font-size: 2rem; font-weight: bold; width: 250px; padding: 30px; border-radius: 20px; box-shadow: 1px 1px 1px black; } .bad { background-color: #400064; } solution when choos...
-webkit-mask-composite - CSS: Cascading Style Sheets
the -webkit-mask-composite property specifies the manner in which multiple mask images applied to the same element are composited with one another.
... source-in overlapping pixels in the source mask image and the destination mask image are replaced by the pixels of the source mask image; all other pixels are cleared.
... destination-in overlapping pixels in the source mask image and the destination mask image remain the pixels of the destination mask image; all other pixels are cleared.
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
round as the allowed vertical space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added.
...example: an image with an original height of 260px, repeated three times, might stretch until each repetition is 300px high, and then another image will be added.
... formal definition initial valuerepeatapplies toall elementsinheritednocomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax repeat | no-repeat | space | round examples using a repeating or non-repeating mask image .exampleone { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-y: repeat; } .exampletwo { -webkit-mask-image: url('mask.png'); -webkit-mask-repeat-y: no-repeat; } using multiple mask images you can specify a different <repeat-style> for each mask image, separated by commas: .examplethree { -webkit-mask-image: url('mask1.png'), url('mask2.png'); -webkit-mask-repeat-y: repeat, space; } each image is matched with the corresponding repeat style, from first ...
@media - CSS: Cascading Style Sheets
WebCSS@media
syntax the @media at-rule may be placed at the top level of your code or nested inside any other conditional group at-rule.
... /* at the top level of your code */ @media screen and (min-width: 900px) { article { padding: 1rem 3rem; } } /* nested within another conditional at-rule */ @supports (display: flex) { @media screen and (min-width: 900px) { article { display: flex; } } } for a discussion of media query syntax, please see using media queries.
... makes the syntax more flexible by adding, among other things, the or keyword.
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
using a value of justify-content other than normal or stretch will cause column boxes to display at the column-width specified on the multicol container, and the remaining space distributed according to the value of justify-content.
... column-gap the column-gap property was specified in earlier versions of the multiple-column layout specification, and has now been unified with the gap properties for other layout methods in box alignment.
... while other layout methods treat the initial value of column-gap as 0 multicol treats it as 1em, as in general you would not want to have no gap between columns.
CSS Box Alignment - CSS: Cascading Style Sheets
center start end self-start self-end flex-start for flexbox only flex-end for flexbox only left right other than the physical values of left and right, which relate to physical attributes of the screen, all of the other values are logical values and relate to the writing mode of the content.
...the alignment subjects are baseline aligned against each other by adding padding inside the boxes.
... also, be aware that other things may increase the visual gap displayed, for example using the space distribution keywords or adding margins to items.
Color picker tool - CSS: Cascading Style Sheets
you can also test colors and how they overlap one another by dragging them into the box at the bottom of the tool and moving them over one another.
... adjust their relative z index values to move them forward and behind one another.
... the generated colors you create above can be used anywhere color is used in css and html, unless otherwise noted.
Spanning and Balancing Columns - CSS: Cascading Style Sheets
things to watch out for if the spanning element is inside another element which has margins, padding and a border or a background color, it is possible to end up with the top of the box appearing above the spanner and the rest displaying below, as shown in the next example.
...the image cannot break and so goes into the first column and the other columns fill with equal amounts of text.
... the other value for column-fill is auto.
Basic Concepts of grid layout - CSS: Cascading Style Sheets
control of overlapping content more than one item can be placed into a grid cell or area and, they can partially overlap each other.
... grid is a powerful 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.
...the other items will place themselves into empty spaces on the grid.
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
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.
... once again the default is stretch, other than for items with an intrinsic aspect ratio.
... "a a b" "c d d"; align-content: space-between; justify-content: space-around; } .item1 { grid-area: a; } .item2 { grid-area: b; } .item3 { grid-area: c; } .item4 { grid-area: d; } <div class="wrapper"> <div class="item1">item 1</div> <div class="item2">item 2</div> <div class="item3">item 3</div> <div class="item4">item 4</div> </div> alignment and auto margins another way to align items inside their area, is to use auto margins.
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
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.
... grid and the danger of markup flattening another issue to be aware of in css grid layout and to a lesser extent in css flexbox, is the temptation to flatten markup.
...for more information about this interaction see the guide on the relationship of grid layout to other layout methods and the section on display: contents.
Consistent list indentation - CSS: Cascading Style Sheets
this often leads to frustration, because what works in one browser often doesn't have the same effect in another.
...this list item has no marker (otherwise known as a "bullet") and is not yet part of a list itself.
... gecko, on the other hand, sets a left padding of 40 pixels for the <ul> element, so given the exact same styles as were used to produce figure 5, loading the example into a gecko-based browser gives us figure 6.
Understanding CSS z-index - CSS: Cascading Style Sheets
in the most basic cases, html pages can be considered two-dimensional, because text, images, and other elements are arranged on the page without overlapping.
... in this case, there is a single rendering flow, and all elements are aware of the space taken by others.
...in addition to their horizontal and vertical positions, boxes lie along a "z-axis" and are formatted one on top of the other.
Center an element - CSS: Cascading Style Sheets
in this recipe you will see how to center one box inside another.
... 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.
Shorthand properties - CSS: Cascading Style Sheets
shorthand properties are css properties that let you set the values of multiple other css properties simultaneously.
...the keyword inherit can be applied to a property, but only as a whole, not as a keyword for one value or another.
... unset resets the property to its natural value, which means that if the property is naturally inherited it acts like inherit, otherwise it acts like initial.
Specificity - CSS: Cascading Style Sheets
the !important exception when an important rule is used on a style declaration, this declaration overrides any other declarations.
... how to override !important a) add another css rule with !important, and either give the selector a higher specificity (adding a tag, id or class to the selector), or add a css rule with the same selector at a later point than the existing one.
... tree proximity ignorance the proximity of an element to other elements that are referenced in a given selector has no impact on specificity.
Value definition syntax - CSS: Cascading Style Sheets
a component can be a keyword, some characters considered as a literal, or a value of a given css data type or of another css property.
... juxtaposition placing several keywords, literals or data types, next to one another, only separated by one or several spaces, is called juxtaposition.
... 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.
Viewport concepts - CSS: Cascading Style Sheets
if you query the width or height of the window and document in chrome or firefox, you may get: document.documentelement.clientwidth /* 1200 */ window.innerwidth /* 1200 */ window.outerwidth /* 1200 */ document.documentelement.clientheight /* 800 */ window.innerheight /* 800 */ window.outerheight /* 900 */ there are several dom properties that can help you query viewport size, and other similar lengths: the document element's element.clientwidth is the inner width of a document in css pixels, including padding (but not borders, margins, or vertical scrollbars, if present).
... the visual viewport is the visual portion of a screen not including on-screen keyboards, areas outside of a pinch-zoom area, or other feature that doesn't scale with the dimensions of a page.
...there are other properties, including maximum-scale, minimum-scale, and user-scalable, which control whether users can zoom the page in or out, but the default values are the best for accessibility and user experience, so these can be omitted.
align-items - CSS: Cascading Style Sheets
ent (for positional alignment only) */ align-items: safe center; align-items: unsafe center; /* global values */ align-items: inherit; align-items: initial; align-items: unset; values 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.
... 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.
align-self - CSS: Cascading Style Sheets
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.
... formal definition initial valueautoapplies toflex items, grid items, and absolutely-positioned boxesinheritednocomputed valueauto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent.
...otherwise the specified value.animation typediscrete formal syntax auto | normal | stretch | <baseline-position> | <overflow-position>?
animation - CSS: Cascading Style Sheets
WebCSSanimation
the order within each animation definition is also important for distinguishing animation-name values from other keywords.
... when parsed, keywords that are valid for properties other than animation-name, and whose values were not found earlier in the shorthand, must be accepted for those properties rather than for animation-name.
... furthermore, when serialized, default values of other properties must be output in at least the cases necessary to distinguish an animation-name that could be a value of another property, and may be output in additional cases.
aspect-ratio - CSS: Cascading Style Sheets
the aspect-ratio css property sets a preferred aspect ratio for the box, which will be used in the calculation of auto sizes and some other layout functions.
... syntax aspect-ratio: 1 / 1; /* global values */ aspect-ratio: inherit; aspect-ratio: initial; aspect-ratio: unset; values <auto> replaced elements with an intrinsic aspect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio.
... formal definition initial valueautoapplies toall elements except inline boxes and internal ruby or table boxesinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <ratio> examples mapping width and height to aspect-ratio firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements and other related elements that accept width and height attributes.
border-inline-end - CSS: Cascading Style Sheets
related properties are border-block-start, border-block-end, and border-inline-start, which define the other borders of the element.
...itial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenb...
...itial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenb...
box-shadow - CSS: Cascading Style Sheets
if any pair of input shadows has one inset and the other not inset, the entire shadow list is uninterpolable.
...it also applies to ::first-letter.inheritednocomputed valueany length made absolute; any specified color computed; otherwise as specifiedanimation typea shadow list formal syntax none | <shadow>#where <shadow> = inset?
...had we put in a border-radius of any other value, the corners would have been rounded.
contain - CSS: Cascading Style Sheets
WebCSScontain
definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | strict | content | [ size | layout | style | paint ] examples simple layout the markup below consists of a number of articles, each with content: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> each <article> and <img> is given a border, and the images are floated: img { float: left; border: 3px solid black; } article { border: 1px solid black; } float interference if we were to insert another image at the bottom of the first article, a large portion of the dom tree ...
...may be re-laid out or repainted, and this would also interfere with the layout of the second article: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> <img src="i-just-showed-up.jpg" alt="social"> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; } as you can see, because of the way floats work, the first image ends up inside the area of the second article: fixing with contain if we give each article the contain property with a value of content, when new elements are inserted the browser understands it only needs to recalculate the containing element's subtree, and no...
...t anything outside it: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> <img src="i-just-showed-up.jpg" alt="social"> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; contain: content; } this also means that the first image no longer floats down to the second article, and instead stays inside it's containing element's bounds: specifications specification status comment css containment module level 1the definition of 'contain' in that specification.
content - CSS: Cascading Style Sheets
WebCSScontent
/* keywords that cannot be combined with other values */ content: normal; content: none; /* <image> values */ content: url("http://www.example.com/test.png"); content: linear-gradient(#e66465, #9198e5); /* alt text for generated content, added in the level 3 specification */ content: url("http://www.example.com/test.png") / "this is the alt text"; /* values below can only be applied to generated content using ::before and ::after */ /* <string> value */ content: "prefix"; /* <counter> values */ content: counter(chapter_counter); content: counters(section_counter, "."); /* attr() value linked to the html attribute value */ content: attr(value s...
...otherwise, for uri values, the absolute uri; for attr() values, the resulting string; for other keywords, as specified.animation typediscrete formal syntax normal | none | [ <content-replacement> | <content-list> ] [/ <string> ]?where <content-replacement> = <image><content-list> = [ <string> | contents | <image> | <quote> | <target> | <leader()> ]+where <image> = <url> | <image()> | <image-set()> | ...
... html <h1>5</h1> <p>according to sir tim berners-lee, <q cite="http://www.w3.org/people/berners-lee/faq.html#internet">i was lucky enough to invent the web at the time when the internet already existed - and had for a decade and a half.</q> we must understand that there is nothing fundamentally wrong with building on the contributions of others.
direction - CSS: Cascading Style Sheets
WebCSSdirection
use rtl for languages written from right to left (like hebrew or arabic), and ltr for those written from left to right (like english and most other languages).
... syntax /* keyword values */ direction: ltr; direction: rtl; /* global values */ direction: inherit; direction: initial; direction: unset; values ltr text and other elements go from left to right.
... rtl text and other elements go from right to left.
env() - CSS: Cascading Style Sheets
WebCSSenv
as the spec evolves, it may also be usable in other places such as selectors.
... note: unlike other css properties, user agent-defined property names are case-sensitive.
... this is because the accompanying css is the equivalent of <code>padding: 0 0 0 50px</code>, because, unlike other css properties, user agent property names are case-sensitive.
font-family - CSS: Cascading Style Sheets
it is often convenient to use the shorthand property font to set font-size and other font related properties all at once.
... cursive glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces.
...because typographic traditions vary widely across the world, this generic is provided for typefaces that don't map cleanly into the other generics.
font-size - CSS: Cascading Style Sheets
WebCSSfont-size
ems another way of setting the font size is with em values.
... em and ex units on the font-size property are relative to the parent element's font size (unlike all other properties, where they're relative to the font size on the 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.
grid-row - CSS: Cascading Style Sheets
WebCSSgrid-row
constituent properties this property is a shorthand for the following css properties: grid-row-end grid-row-start syntax /* keyword values */ grid-row: auto; grid-row: auto / auto; /* <custom-ident> values */ grid-row: somegridarea; grid-row: somegridarea / someothergridarea; /* <integer> + <custom-ident> values */ grid-row: somegridarea 4; grid-row: 4 somegridarea / 6; /* span + <integer> + <custom-ident> values */ grid-row: span 3; grid-row: span somegridarea; grid-row: 5 somegridarea span; grid-row: span 3 / 6; grid-row: span somegridarea / span someothergridarea; grid-row: 5 somegridarea span / 2 span; /* global values */ grid-row: inherit; grid-row: i...
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it).
... otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>.
<image> - CSS: Cascading Style Sheets
WebCSSimage
description css can handle the following kinds of images: images with intrinsic dimensions (a natural size), like a jpeg, png, or other raster format.
...(in this case, the intrinsic dimensions will be those of the image largest in area and the aspect ratio most similar to the containing box.) images with no intrinsic dimensions but with an intrinsic aspect ratio between its width and height, like an svg or other vector format.
...ement(#realid) /* a part of the webpage, referenced with the element() function, if "realid" is an existing id on the page */ image(ltr 'arrow.png#xywh=0,0,16,16', red) /* a section 16x16 section of <url>, starting from the top, left of the original image as long as arrow.png is a supported image, otherwise a solid red swatch.
linear-gradient() - CSS: Cascading Style Sheets
if specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the vertical side (top or bottom).
...the other values are translated into an angle.
...for this reason, linear-gradient() won't work on background-color and other properties that use the <color> data type.
margin-inline-end - CSS: Cascading Style Sheets
in other words, it corresponds to the margin-top, margin-right, margin-bottom or margin-left property depending on the values defined for writing-mode, direction, and text-orientation.
...ute length */ margin-inline-end: 1em; /* relative to the text size */ margin-inline-end: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-end: auto; /* global values */ margin-inline-end: inherit; margin-inline-end: initial; margin-inline-end: unset; it relates to margin-block-start, margin-block-end, and margin-inline-start, which define the other margins of the element.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting inline end margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the defini...
mask-size - CSS: Cascading Style Sheets
WebCSSmask-size
the image is automatically centered unless over-ridden by another property such as mask-position.
... if mask-size has one auto component and one non-auto component: if the image has an intrinsic proportion, then render it using the specified dimension and compute the other dimension from the specified dimension and the intrinsic proportion.
...for the other dimension, use the image's corresponding intrinsic dimension if there is one.
mask - CSS: Cascading Style Sheets
WebCSSmask
it is therefore recommended to use the mask shorthand rather than other shorthands or the individual properties to override any mask settings earlier in the cascade.
...ayer image (see the text for background-position)computed valueas each of the properties of the shorthand:mask-image: as specified, but with <url> values made absolutemask-mode: as specifiedmask-repeat: consists of two keywords, one per dimensionmask-position: consists of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentage.mask-clip: as specifiedmask-origin: as specifiedmask-size: as specified, but with relative lengths converted into absolute lengthsmask-composite: as specifiedanimation typeas each of the properties of the shorthand:mask-image: discretemask-mode: discretemask-repeat: discretemask-position: repeatable list of simple list of length, percentage, or calcmask-clip: discretemask-orig...
...e><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <length-percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples masking an image .target { mask: url(#c1) luminance; } .anothertarget { mask: url(resources.svg#c1) 50px 30px/10px 10px repeat-x exclude; } specifications specification status comment css masking module level 1the definition of 'mask' in that specification.
max() - CSS: Cascading Style Sheets
WebCSSmax
the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions.
... it is permitted to nest min() and other max() functions as expression values.
... formal syntax max( <calc-sum># )where <calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*where <calc-product> = <calc-value> [ '*' <calc-value> | '/' <number> ]*where <calc-value> = <number> | <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.
outline-color - CSS: Cascading Style Sheets
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 the page's layout to ensure that it fits without overlapping anything else (unless you explicitly set it to overlap).
... webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial valueinvert, for browsers supporting it, currentcolor for the otherapplies toall elementsinheritednocomputed valuefor the keyword invert, the computed value is invert.
overflow-wrap - CSS: Cascading Style Sheets
the overflow-wrap css property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
... anywhere to prevent overflow, an otherwise unbreakable string of characters — like a long word or url — may be broken at any point if there are no otherwise-acceptable break points in the line.
... break-word the same as the anywhere value, with normally unbreakable words allowed to be broken at arbitrary points if there are no otherwise acceptable break points in the line, but soft wrap opportunities introduced by the word break are not considered when calculating min-content intrinsic sizes.
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
otherwise, both overflow-x and overflow-y are set to the same value.
... specifying a value other than visible (the default) creates a new block formatting context.
... setting one axis to visible (the default) while setting the other to a different value results in visible behaving as auto.
place-self - CSS: Cascading Style Sheets
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.
...inition initial valueas each of the properties of the shorthand:align-self: autojustify-self: autoapplies toblock-level boxes, absolutely-positioned boxes, and grid itemsinheritednocomputed valueas each of the properties of the shorthand:align-self: auto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent.
...otherwise the specified value.justify-self: as specifiedanimation typediscrete formal syntax <'align-self'> <'justify-self'>?
pointer-events - CSS: Cascading Style Sheets
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.
...when a mouse cursor is over the interior (i.e., 'fill') of the element and the fill property is set to a value other than none, or when a mouse cursor is over the perimeter (i.e., 'stroke') of the element and the stroke property is set to a value other than none.
...the mouse cursor is over the interior (i.e., 'fill') of the element and the fill property is set to a value other than none, or when the mouse cursor is over the perimeter (i.e., 'stroke') of the element and the stroke property is set to a value other than none.
<position> - CSS: Cascading Style Sheets
if only a single offset value is specified, it defines the x-coordinate, with the value for the other axis defaulting to center.
... /* 1-value syntax */ keyword /* either the horizontal or vertical position; the other axis defaults to center */ value /* the position on the x-axis; the y-axis defaults to 50% */ /* 2-value syntax */ keyword keyword /* a keyword for each direction (the order is irrelevant) */ keyword value /* a keyword for horizontal position, value for vertical position */ value keyword /* a value for horizontal position, keyword for vertical position */ value value /* a value for each direction (horizontal then vertical) */ /* 4-value syntax */ keyword value keyword value /* each value is an offset from the keyword that preceeds it */ formal syntax [ [ left | center | right ] || [ top | center | bottom ] | [ left | cente...
...this is not allowed in other properties that use <position>.
repeat() - CSS: Cascading Style Sheets
WebCSSrepeat
otherwise, as its minimum track sizing function, and taking grid-gap into account.
...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.
repeating-conic-gradient() - CSS: Cascading Style Sheets
its concrete size will match the size of the element it applies to, or the size the <image> is set to if it's set to something other than the element's size.
...for this reason, repeating-conic-gradient() won't work on background-color and other properties that use the <color> data type.
...while it is possible to create pie charts, checkerboards, and other effects with conic gradients, css images provide no native way to assign alternative text, and therefore the image represented by the conic gradient will not be accessible to screen reader users.
repeating-linear-gradient() - CSS: Cascading Style Sheets
for this reason, repeating-linear-gradient() won't work on background-color and other properties that use the <color> data type.
...if specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the vertical side (top or bottom).
...the other values are translated into an angle.
right - CSS: Cascading Style Sheets
WebCSSright
when both left and right are defined, if not prevented from doing so by other properties, the element will stretch to satisfy both.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the width of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples absolute and relative positioning using right html <div id="relative">relatively positioned</div> <div id="absolute">absolutely positioned</div> css #relative { width: 100px; height: 100px; background-color: #ffc7e4; position: relative; top: 20px; left: 20px; } #absol...
...ute { width: 100px; height: 100px; background-color: #ffd7c2; position: absolute; bottom: 10px; right: 20px; } result declaring both left and right when both left and right are declared, the element will stretch to meet both, unless other constraints prevent it from doing so.
shape-outside - CSS: Cascading Style Sheets
otherwise, the reference box defaults to margin-box.
... in all other cases no interpolation occurs.
... formal definition initial valuenoneapplies tofloatsinheritednocomputed valueas defined for <basic-shape> (with <shape-box> following, if supplied), the <image> with its uri made absolute, otherwise as specified.animation typeyes, as specified for <basic-shape>, otherwise no formal syntax none | <shape-box> | <basic-shape> | <image>where <shape-box> = <box> | margin-box<basic-shape> = <inset()> | <circle()> | <ellipse()> | <polygon()> | <path()><image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <box> = border-box | padding-box | content-box<inset()> = inset( <length-percentage>{1,4} [ round <'border-radius'> ]?
vertical-align - CSS: Cascading Style Sheets
line</td> <td style="vertical-align: top">top</td> <td style="vertical-align: middle">middle</td> <td style="vertical-align: bottom">bottom</td> <td> <p>there is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.</p> <p>there is another theory which states that this has already happened.</p> </td> </tr> </table> table { margin-left: auto; margin-right: auto; width: 80%; } table, th, td { border: 1px solid black; } td { padding: 0.5em; font-family: monospace; } note that vertical-align only applies to inline, inline-block and table-cell elements: you can't use it to vertically align block-level element...
... values for table cells baseline (and sub, super, text-top, text-bottom, <length>, and <percentage>) aligns the baseline of the cell with the baseline of all other cells in the row that are baseline-aligned.
...it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the line-height of the element itselfcomputed valuefor percentage and length values, the absolute length, otherwise the keyword as specifiedanimation typea length formal syntax baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length> examples basic example html <div>an <img src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a default alignment.</div> <div>an <img class="top" src="https://udn.realityrip...
Cross-browser audio basics - Developer guides
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.
... media playing events we also have another set of events that are useful for reacting to the state of the media playback.
... = document.getelementbyid('progress'); progress.addeventlistener('click', function(e) { // calculate the normalized position clicked var clickposition = (e.pagex - this.offsetleft) / this.offsetwidth; var clicktime = clickposition * myaudio.duration; // move the playhead to the correct position myaudio.currenttime = clicktime; }); buffering ok, we're getting there, but there is another piece of useful information we can display: the amount of audio has been buffered or downloaded in advance.
Live streaming web audio and video - Developer guides
this file sits on a server and can be delivered — like most other files — to the browser.
... important: although the <audio> and <video> tags are protocol agnostic, no browser currently supports anything other than http without requiring plugins, although this looks set to change.
... protocols other than http may also be subject to blocking from firewalls or proxy servers.
Challenge solutions - Developer guides
see css color value for a complete list as well as other ways of specifying colors.
... selectors second paragraph blue challenge without changing your html file, add a single rule to your css file that keeps all the initial letters the same color as they are now, but makes all the other text in the second paragraph blue.
... solution change the selector of the new rule to be a tag selector using p: p { color: blue; } the rules for the other colors all have more specific selectors, so they override the blue of the paragraph.
Event developer guide - Developer guides
WebGuideEvents
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.
... there are many other sources of events defined by web browsers for which pages are not yet available in this guide.
...t the coordinate systems at play and how you use them.overview of events and handlersevents and event handling provide a core technique in javascript for reacting to incidents occurring when a browser accesses a web page, including events from preparing a web page for display, from interacting with the content of the web page, relating to the device on which the browser is running, and from many other causes such as media stream playback or animation timing.touch events (mozilla experimental)the experimental touch events api described on this page was available from gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to gecko/firefox 17.
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
in other words, in supporting html5, gecko, webkit, and internet explorer (ie) will behave more consistently with each other.
...with the html5 parser, calls to document.write() in any other context either are ignored or replace the document.
...however, unclosed comments often already break in existing browsers for one reason or another, so it's unlikely that you have this issue in sites that are tested in multiple browsers.
disabled - HTML: Hypertext Markup Language
if declared on an <optgroup>, the select is still interactive (unless otherwise disabled), but none of the items in the option group are selectable.
... firefox will, unlike other browsers, persist the dynamic disabled state of a <button> across page loads.
...additionally, since the elements become immutable, most other attributes, such as pattern, have no effect, until the control is enabled.
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
WebHTMLElementabbr
each <abbr> element you use is independent from all others; providing a title for one does not automatically attach the same expansion text to others with the same content text.
... default styling the purpose of this element is purely for the convenience of the author and all browsers display it inline (display: inline) by default, though its default styling varies from one browser to another: some browsers, like internet explorer, do not style it differently than a <span> element.
... opera, firefox, and some others add a dotted underline to the content of the element.
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
WebHTMLElementb
the html bring attention to element (<b>) is used to draw the reader's attention to the element's contents, which are not otherwise granted special importance.
... usage notes use the <b> for cases like keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced (but not including any special importance).
...the <b> element doesn't convey such special semantic information; use it only when no others fit.
<base>: The Document Base URL element - HTML: Hypertext Markup Language
WebHTMLElementbase
permitted parents a <head> that doesn't contain another <base> element.
... if either of the following attributes are specified, this element must come before other elements with attribute values of urls, such as <link>’s href attribute.
... usage notes multiple <base> elements if multiple <base> elements are used, only the first href and first target are obeyed — all others are ignored.
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
some other characters (such as spaces and some punctuation) are treated as neutral and are assigned directionality based on that of their surrounding characters.
... though the same visual effect can be achieved using the css rule unicode-bidi: isolate on a <span> or another text-formatting element, html authors should not use this approach because it is not semantic and browsers are allowed to ignore css styling.
... implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes like all other html elements, this element supports the global attributes, except that the dir attribute behaves differently than normal: it defaults to auto, meaning its value is never inherited from the parent element.
<dfn>: The Definition element - HTML: Hypertext Markup Language
WebHTMLElementdfn
the element must still have text within it, but that text may be an abbreviation (perhaps using <abbr>) or another form of the term.
... otherwise, the text content of the <dfn> element is the term being defined.
... if the <dfn> element has a title attribute, it must contain the term being defined and no other text.
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...oded (as they are always the same), while the day and year values are dynamically generated depending on the currently selected month and year, and the current year (see the code comments below for detailed explanations of how these functions work.) span { padding-left: 5px; } input:invalid + span::after { content: '✖'; } input:valid + span::after { content: '✓'; } javascript the other part of the code that may be of interest is the feature detection code — to detect whether the browser supports <input type="date">.
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
when the user interacts with the image, the input is handled like any other button input.
...also, if you specify only one dimension, the other is automatically adjusted so that the image maintains its original aspect ratio.
...this, of course, applies to all other attributes as well.
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
you should also include other explanatory text nearby.
...it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content.
... you must remember to set a name for your input, otherwise nothing will be submitted.
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
you should also include other explanatory text nearby.
...it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content.
...while the specific user experience may vary from one browser to another, typically clicking in the edit box presents a drop-down of the suggested email addresses.
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
... 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 other part of the code that may be of interest is the feature detection code.
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
<input type="checkbox" name="peas"> </label> other usage notes: the form control that the label is labeling is called the labeled control of the label element.
...if there are other elements which also match the id value, later in the document, they are not considered.
...no labelable elements other than the labeled control are allowed.
<main> - HTML: Hypertext Markup Language
WebHTMLElementmain
example <!-- other content --> <main> <h1>apples</h1> <p>the apple is the pomaceous fruit of the apple tree.</p> <article> <h2>red delicious</h2> <p>these bright red apples are the most common found in many supermarkets.</p> <p>...
...</p> </article> </main> <!-- other content --> accessibility concerns landmark the <main> element behaves like a main landmark role.
... building websites for safari reader mode and other reading apps.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag.
...the end tag may be omitted if the <p> element is immediately followed by an <address>, <article>, <aside>, <blockquote>, <div>, <dl>, <fieldset>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hr>, <menu>, <nav>, <ol>, <pre>, <section>, <table>, <ul> or another <p> element, or if there is no more content in the parent element and the parent element is not an <a> element.
...screen-readers and other assistive technology provide shortcuts to let their users skip to the next or previous paragraph, letting them skim content like how white space lets visual users skip around.
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
note: according to the html5 specification, the default value for size should be 1; however, in practice, this has been found to break some web sites, and no other browser currently does that, so mozilla has opted to continue to return 0 for the time being with firefox.
... however, these properties don't produce a consistent result across browsers, and it is hard to do things like line different types of form element up with one another in a column.
... implicit aria role combobox with no multiple attribute and no size attribute greater than 1, otherwise listbox permitted aria roles menu with no multiple attribute and no size attribute greater than 1, otherwise no role permitted dom interface htmlselectelement specifications specification status comments html living standardthe definition of '<select>' in that specification.
accesskey - HTML: Hypertext Markup Language
the attribute value must consist of a single printable character (which includes accented and other characters that can be generated by the keyboard).
...ie/edge uses the first one it supports without problems, provided there are no conflicts with other commands.
...what may work for one combination of operating system, assistive technology, and browser may not work with other combinations.
itemscope - HTML: Hypertext Markup Language
a global identifier allows the item to relate to other items found on pages across the web.
...="image" src="https://udn.realityripple.com/samples/60/d063c361c1.jpg" width="50" height="50" /> <p> by <span itemprop="author" itemscope itemtype="http://schema.org/person"> <span itemprop="name">carol smith</span> </span> </p> <p> published: <time datetime="2009-11-05" itemprop="datepublished">november 5, 2009</time> </p> <span itemprop="description">this is my grandmother's apple pie recipe.
... structured data itemscope itemtype recipe itemprop name grandma's holiday apple pie itemprop image https://c1.staticflickr.com/1/30/42759561_8631e2f905_n.jpg itemprop datepublished 2009-11-05 itemprop description this is my grandmother's apple pie recipe.
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
earlier versions of the html standard recommended other variants, but all existing browsers today will use full standards mode for this doctype, even the dated internet explorer 6.
...if you do use another doctype, you may risk choosing one which triggers almost standards mode or quirks mode.
...older versions of the html standard gave additional meaning to the doctype, but no browser has ever used the doctype for anything other than switching between quirks mode and standards mode.
Evolution of HTTP - HTTP
<html> a very simple html page </html> unlike subsequent evolutions, there were no http headers, meaning that only html files could be transmitted, but no other type of documents.
... with the help of the new http headers, the ability to transmit other documents than plain html files has been added (thanks to the content-type header).
... in addition to these large extensions, numerous other headers have been added, sometimes experimentally only.
Compression in HTTP - HTTP
if text can typically have as much as 60% redundancy, this rate can be much higher for some other media like audio and video.
... unlike text, these other media types use lot of space to store their data and the need to optimize storage and regain space was apparent very early.
... to do this, http uses a mechanism similar to the content negotiation for end-to-end compression: the node transmitting the request advertizes its will using the te header and the other node chooses the adequate method, applies it, and indicates its choice with the transfer-encoding header.
Accept-Language - HTTP
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.
...the content of the accept-language is often out of the control of the user (like when traveling and using an internet cafe in a different country); the user may also want to visit a page in another language than the locale of their user interface.
...other variants like the type of orthography ('de-de-1996') are usually not used in the context of this header.
CSP: base-uri - HTTP
syntax one or more sources can be allowed for the base-uri policy: content-security-policy: base-uri <source>; content-security-policy: base-uri <source> <source>; sources while this directive uses the same arguments as other csp directives, some of them don’t make sense for `<base>`, such as the keywords 'unsafe-inline' and 'strict-dynamic' <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number.
...unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
Expect - HTTP
WebHTTPHeadersExpect
the only expectation defined in the specification is expect: 100-continue, to which the server shall respond with: 100 if the information contained in the header is sufficient to cause an immediate success, 417 (expectation failed) if it cannot meet the expectation; or any other 4xx status otherwise.
... 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.
If-Match - HTTP
WebHTTPHeadersIf-Match
for put and other non-safe methods, it will only upload the resource in this case.
... for other methods, and in particular for put, if-match can be used to prevent the lost update problem.
... it can check if the modification of a resource that the user wants to upload will not override another change that has been done since the original resource was fetched.
If-None-Match - HTTP
for other methods, the request will be processed only if the eventually existing resource's etag doesn't match any of the values listed.
... for other methods, and in particular for put, if-none-match used with the * value can be used to save a file not known to exist, guaranteeing that another upload didn't happen before, losing the data of the previous put; this problem is a variation of the lost update problem.
...they are only useful when uploading a resource, usually with put, to check if another resource with the identity has already been uploaded before.
Referrer-Policy - HTTP
origin-when-cross-origin send the origin, path, and query string when performing a same-origin request, but only send the origin of the document for other cases.
... examples policy document navigation to referrer no-referrer https://example.com/page anywhere (no referrer) no-referrer-when-downgrade https://example.com/page https://example.com/otherpage https://example.com/page https://mozilla.org https://example.com/page http://example.org (no referrer) origin https://example.com/page anywhere https://example.com/ origin-when-cross-origin https://example.com/page https://example.com/otherpage https://example.com/page https://mozilla.org https://example.com/ ...
...http://example.com/page https://example.com/ same-origin https://example.com/page https://example.com/otherpage https://example.com/page https://mozilla.org (no referrer) strict-origin https://example.com/page https://mozilla.org https://example.com/ http://example.org (no referrer) http://example.com/page anywhere http://example.com/ strict-origin-when-cross-origin https://example.com/page https://example.com/otherpage https://example.com/page https://mozilla.org https://example.com/ http://example.org (no referrer) unsafe-url https://example.com/page?q=123 anywhere https://example.com/page?q=123 specifying a fallback policy if you want to specify a ...
X-Frame-Options - HTTP
sites can use this to avoid click-jacking attacks, by ensuring that their content is not embedded into other sites.
... header type response header forbidden header name no syntax there are two possible directives for x-frame-options: x-frame-options: deny x-frame-options: sameorigin directives if you specify deny, not only will attempts to load the page in a frame fail when loaded from other sites, attempts to do so will fail when loaded from the same site.
... on the other hand, if you specify sameorigin, you can still use the page in a frame as long as the site including it in a frame is the same as the one serving the page.
HTTP
WebHTTP
it was designed for communication between web browsers and web servers, but it can also be used for other purposes.
...web pages today very commonly load cross-site resources, including css stylesheets, images, scripts, and other resources.
...custom proprietary headers can be added using the x- prefix; others in an iana registry, whose original content was defined in rfc 4229.
Introduction - JavaScript
for example, server-side extensions allow an application to communicate with a database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server.
... javascript and java javascript and java are similar in some ways but fundamentally different in some others.
... prevent code snippets executed in the console from interacting with one-another (e.g., having something created in one console execution being used for a different console execution).
Loops and iteration - JavaScript
you can think of a loop as a computerized version of the game where you tell someone to take x steps in one direction, then y steps in another.
...there are various situations that are more easily served by one type of loop over the others.
...make sure the condition in a loop eventually becomes false—otherwise, the loop will never terminate!
Public class fields - JavaScript
this is useful for caches, fixed-configuration, or any other data you don't need to be replicated across instances.
... class classwithstaticfield { static basestaticfield = 'base static field' static anotherbasestaticfield = this.basestaticfield static basestaticmethod() { return 'base static method output' } } class subclasswithstaticfield extends classwithstaticfield { static substaticfield = super.basestaticmethod() } console.log(classwithstaticfield.anotherbasestaticfield) // expected output: "base static field" console.log(subclasswithstaticfield.substaticfield) // expected output: "base...
... class classwithinstancefield { baseinstancefield = 'base field' anotherbaseinstancefield = this.baseinstancefield baseinstancemethod() { return 'base method output' } } class subclasswithinstancefield extends classwithinstancefield { subinstancefield = super.baseinstancemethod() } const base = new classwithinstancefield() const sub = new subclasswithinstancefield() console.log(base.anotherbaseinstancefield) // expected output: "base field" console.log(sub.sub...
Classes - JavaScript
you first need to declare your class and then access it, otherwise code like the following will throw a referenceerror: const p = new rectangle(); // referenceerror class rectangle {} class expressions a class expression is another way to define a class.
... strict mode the body of a class is executed in strict mode, i.e., code written here is subject to stricter syntax for increased performance, some otherwise silent errors will be thrown, and certain keywords are reserved for future versions of ecmascript.
... sub classing with extends the extends keyword is used in class declarations or class expressions to create a class as a child of another class.
TypeError: invalid arguments - JavaScript
typed array constructors require either a length, another typed array, array-like objects, iterable objects or an arraybuffer object to create a new typed array.
... other constructor arguments will not create a valid typed array.
... var ta = new uint8array("nope"); // typeerror: invalid arguments different ways to create a valid uint8array: // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8array([21, 31]); var y = new uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint8 = new uint8array(iterable); // uint8array[1, 2, 3] ...
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
the javascript exception "right-hand side of 'in' should be an object" occurs when the in operator was used to search in strings, or in numbers, or other primitive types.
...you can't search in strings, or in numbers, or other primitive types.
... examples searching in strings unlike in other programming languages (e.g.
Array.prototype.findIndex() - JavaScript
otherwise, it returns -1, indicating that no element passed the test.
...otherwise, -1.
... edge case alert: unlike other array methods such as array.some(), callback is run even for indexes with unassigned values.
Array.isArray() - JavaScript
return value true if the value is an array; otherwise, false.
... description if the value is an array, true is returned; otherwise, false is.
... polyfill running the following code before any other code will create array.isarray() if it's not natively available.
Array.prototype.some() - JavaScript
otherwise, false.
...otherwise, some() returns false.
...otherwise, the value undefined will be used as its this value.
Array - JavaScript
other methods (e.g., push(), splice(), etc.) also result in updates to an array's length property.
... array.isarray() returns true if the argument is an array, or false otherwise.
... instance methods array.prototype.concat() returns a new array that is this array joined with other array(s) and/or value(s).
FinalizationRegistry - JavaScript
any behavior you observe in one engine may be different in another engine, in another version of the same engine, or even in a slightly different situation with the same version of the same engine.
...sources of variability include: one object might be garbage-collected much sooner than another object, even if they become unreachable at the same time, e.g., due to generational collection.
...cleanup callbacks may be useful for reducing memory usage across the course of a program, but are unlikely to be useful otherwise.
Intl.PluralRules() constructor - JavaScript
the following properties fall into two groups: minimumintegerdigits, minimumfractiondigits, and maximumfractiondigits in one group, minimumsignificantdigits and maximumsignificantdigits in the other.
... var pr = new intl.pluralrules(); pr.select(0); // → 'other' if in us english locale pr.select(1); // → 'one' if in us english locale pr.select(2); // → 'other' if in us english locale using options the results can be customized using the options argument, which has one property called type which you can set to ordinal.
... var pr = new intl.pluralrules('en-us', { type: 'ordinal' }); pr.select(0); // → 'other' pr.select(1); // → 'one' pr.select(2); // → 'two' pr.select(3); // → 'few' pr.select(4); // → 'other' pr.select(42); // → 'two' specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.pluralrules() constructor' in that specification.
Map - JavaScript
nan is considered the same as nan (even though nan !== nan) and all other values are considered equal according to the semantics of the === operator.
...other operations on the data fail: wrongmap.has('bla') // false wrongmap.delete('bla') // false console.log(wrongmap) // map { bla: 'blaa', bla2: 'blaaa2' } the correct usage for storing data in the map is through the set(key, value) method.
...even though every nan is not equal to itself (nan !== nan is true), the following example works because nans are indistinguishable from each other: let mymap = new map() mymap.set(nan, 'not a number') mymap.get(nan) // "not a number" let othernan = number('foo') mymap.get(othernan) // "not a number" iterating map with for..of maps can be iterated using a for..of loop: let mymap = new map() mymap.set(0, 'zero') mymap.set(1, 'one') for (let [key, value] of mymap) { console.log(key + ' = ' + value) } // 0 = zero // 1 = one for (let ...
NaN - JavaScript
in other words, it is a variable in global scope.
..."foo"/3) examples testing against nan nan compares unequal (via ==, !=, ===, and !==) to any other value -- including to another nan value.
... true however, do note the difference between isnan() and number.isnan(): the former will return true if the value is currently nan, or if it is going to be nan after it is coerced to a number, while the latter will return true only if the value is currently nan: isnan('hello world'); // true number.isnan('hello world'); // false additionally, some array methods cannot find nan, while others can.
Object.defineProperty() - JavaScript
e('d'); // true o.propertyisenumerable(symbol.for('e')); // true o.propertyisenumerable(symbol.for('f')); // false var p = { ...o } p.a // 1 p.b // undefined p.c // undefined p.d // 4 p[symbol.for('e')] // 5 p[symbol.for('f')] // undefined configurable attribute the configurable attribute controls at the same time whether the property can be deleted from the object and whether its attributes (other than value and writable) can be changed.
... var o = {}; o.a = 1; // is equivalent to: object.defineproperty(o, 'a', { value: 1, writable: true, configurable: true, enumerable: true }); // on the other hand, object.defineproperty(o, 'a', { value: 1 }); // is equivalent to: object.defineproperty(o, 'a', { value: 1, writable: false, configurable: false, enumerable: false }); custom setters and getters the example below shows how to implement a self-archiving object.
... function myclass() { } var value; object.defineproperty(myclass.prototype, "x", { get() { return value; }, set(x) { value = x; } }); var a = new myclass(); var b = new myclass(); a.x = 1; console.log(b.x); // 1 this can be fixed by storing the value in another property.
Object.prototype.__proto__ - JavaScript
(that is, if the constructor didn't return an other object explicitly, or the fun.prototype has been reassigned since the instance was created.) the __proto__ setter allows the [[prototype]] of an object to be mutated.
...providing any other value will do nothing.
...if some other __proto__ property is found before object.prototype is consulted, that property will hide the one found on object.prototype.
Promise() constructor - JavaScript
therefore, the code within the executor has the opportunity to perform some operation and then reflect the operation's outcome(if the value is not another promise object) as either "fulfilled" or "rejected" by terminating with an invocation of either the resolutionfunc or the rejectionfunc, respectively.
... resolutionfunc(value) // call on fulfilled rejectionfunc(reason) // call on rejected the returned value can be another promise object, in which case the promise gets dynamically inserted into the chain.
...note that if you call resolutionfunc or rejectionfunc and pass another promise object as an argument, you can say that it is "resolved", but still cannot be said to be "settled".
Promise.all() - JavaScript
a pending promise in all other cases.
...it is typically used when there are multiple asynchronous tasks that are dependent on one another to complete successfully, as it does not wait and will reject immediately upon any of the input promises rejecting.
... rejection if any of the passed-in promises reject, promise.all asynchronously rejects with the value of the promise that rejected, whether or not the other promises have resolved.
Promise.any() - JavaScript
a pending promise in all other cases.
...it short-circuits after a promise fulfils, so it does not wait for the other promises to complete once it finds one.
... fulfilment if any of the passed-in promises fulfil, the returned promise asynchronously fulfils with the value of the promise that fulfilled, whether or not the other promises have fulfilled or rejected.
Comparing Reflect and Object methods - JavaScript
returns undefined if it does not exist, and a typeerror if anything other than an object (a primitive) is passed in as the first argument.
...throws a typeerror if the prototype being set was anything other than an object or null, or if the prototype for the object being modified is non-extensible.
...throws a typeerror if the target passed in was not an object, or if the prototype being set was anything other than an object or null.
Reflect.getOwnPropertyDescriptor() - JavaScript
it returns a property descriptor of the given property if it exists on the object, undefined otherwise.
... return value a property descriptor object if the property exists in target object; otherwise, undefined.
... description the reflect.getownpropertydescriptor method returns a property descriptor of the given property if it exists in the target object, undefined otherwise.
RegExp() constructor - JavaScript
as of es5, this can also be another regexp object or literal (for the two regexp constructor notations only).
...in other words, match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole input string.
...use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user input.
RegExp - JavaScript
use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and obtain it from another source, such as user input.
... flags in constructor starting with ecmascript 6, new regexp(/ab+c/, 'i') no longer throws a typeerror ("can't supply flags when constructing one regexp from another") when the first argument is a regexp and the second flags argument is present.
... to match characters from other languages such as cyrillic or hebrew, use \uhhhh, where hhhh is the character's unicode value in hexadecimal.
String.prototype.includes() - JavaScript
the includes() method determines whether one string may be found within another string, returning true or false as appropriate.
...(defaults to 0.) return value true if the search string is found anywhere within the given string; otherwise, false if not.
... description this method lets you determine whether or not a string includes another string.
Symbol.for() - JavaScript
otherwise a new symbol gets created in the global symbol registry with this key.
... return value an existing symbol with the given key if found; otherwise, a new symbol is created and returned.
...l.for('foo'); // create a new global symbol symbol.for('foo'); // retrieve the already created symbol // same global symbol, but not locally symbol.for('bar') === symbol.for('bar'); // true symbol('bar') === symbol('bar'); // false // the key is also used as the description var sym = symbol.for('mario'); sym.tostring(); // "symbol(mario)" to avoid name clashes with your global symbol keys and other (library code) global symbols, it might be a good idea to prefix your symbols: symbol.for('mdn.foo'); symbol.for('mdn.bar'); specifications specification ecmascript (ecma-262)the definition of 'symbol.for' in that specification.
TypedArray.prototype.every() - JavaScript
return value true if the callback function returns a truthy value for every array element; otherwise, false.
...otherwise, if callback returned a true value for all elements, every will return true.
...otherwise, the value undefined will be passed for use as its this value.
TypedArray.prototype.find() - JavaScript
otherwise undefined is returned.
... return value a value in the array if an element passes the test; otherwise, undefined.
...otherwise, find returns undefined.
TypedArray.prototype.findIndex() - JavaScript
otherwise -1 is returned.
... return value an index in the array if an element passes the test; otherwise, -1.
...otherwise, findindex returns -1.
TypedArray.prototype.some() - JavaScript
return value true if the callback function returns a truthy value for any array element; otherwise, false.
...otherwise, some returns false.
...otherwise, the value undefined will be passed for use as its this value.
isNaN() - JavaScript
return value true if the given value is nan; otherwise, false.
... description the necessity of an isnan function unlike all other possible values in javascript, it is not possible to rely on the equality operators (== and ===) to determine whether a value is nan or not, because both nan == nan and nan === nan evaluate to false.
... for example, dividing zero by zero results in a nan — but dividing other numbers by zero does not.
parseInt() - JavaScript
if no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string.
... if the input string begins with any other value, the radix is 10 (decimal).
...t('f', 16) parseint('17', 8) parseint(021, 8) parseint('015', 10) // but `parseint(015, 10)` will return 13 parseint(15.99, 10) parseint('15,123', 10) parseint('fxx123', 16) parseint('1111', 2) parseint('15 * 3', 10) parseint('15e2', 10) parseint('15px', 10) parseint('12', 13) the following examples all return nan: parseint('hello', 8) // not a number at all parseint('546', 2) // digits other than 0 or 1 are invalid for binary radix the following examples all return -15: parseint('-f', 16) parseint('-0f', 16) parseint('-0xf', 16) parseint(-15.1, 10) parseint('-17', 8) parseint('-15', 10) parseint('-1111', 2) parseint('-15e1', 10) parseint('-12', 13) the following examples all return 4.
Standard built-in objects - JavaScript
other objects in the global scope are either created by the user script or provided by the host application.
... eval() uneval() isfinite() isnan() parsefloat() parseint() encodeuri() encodeuricomponent() decodeuri() decodeuricomponent() deprecated escape() unescape() fundamental objects these are the fundamental, basic objects upon which all other objects are based.
... intl intl.collator intl.datetimeformat intl.listformat intl.numberformat intl.pluralrules intl.relativetimeformat intl.locale webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compileerror webassembly.linkerror webassembly.runtimeerror other arguments ...
Less than (<) - JavaScript
the less than operator (<) returns true if the left operand is less than the right operand, and false otherwise.
... otherwise javascript attempts to convert non-numeric types to numeric values: boolean values true and false are converted to 1 and 0 respectively.
... otherwise the values are compared as numeric values.
Spread syntax (...) - JavaScript
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.
...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': 'value1'}; const array = [...obj]; // typeerror: obj is not iterable spread with many values when using spread syntax for function calls, be aware of the possibility of exceeding the javascript engine's argument length limit.
yield* - JavaScript
the yield* expression is used to delegate to another generator or iterable object.
... examples delegating to another generator in following code, values yielded by g1() are returned from next() calls just like those which are yielded by g2().
...eld* g1(); yield 5; } const iterator = g2(); console.log(iterator.next()); // {value: 1, done: false} console.log(iterator.next()); // {value: 2, done: false} console.log(iterator.next()); // {value: 3, done: false} console.log(iterator.next()); // {value: 4, done: false} console.log(iterator.next()); // {value: 5, done: false} console.log(iterator.next()); // {value: undefined, done: true} other iterable objects besides generator objects, yield* can also yield other kinds of iterables (e.g., arrays, strings, or arguments objects).
block - JavaScript
a block statement (or compound statement in other languages) is used to group zero or more statements.
... description the block statement is often called compound statement in other languages.
...in other words, block statements do not introduce a scope.
let - JavaScript
the other difference between var and let is that the latter is initialized to a value only when a parser evaluates it (see below).
...oo = 2; } the temporal dead zone and typeof unlike with simply undeclared variables and variables that hold a value of undefined, using the typeof operator to check for the type of a variable in that variable's temporal dead zone will throw a referenceerror: // prints out 'undefined' console.log(typeof undeclaredvariable); // results in a 'referenceerror' console.log(typeof i); let i = 10; another example of temporal dead zone combined with lexical scoping due to lexical scoping, the identifier foo inside the expression (foo + 55) evaluates to the if block's foo, and not the overlying variable foo with the value of 33.
... console.log(n); // object {a: [1,2,3]} for (let n of n.a) { // referenceerror console.log(n); } } go({a: [1, 2, 3]}); other situations when used inside a block, let limits the variable's scope to that block.
var - JavaScript
duplicate variable declarations using var will not trigger an error, even in strict mode, and the variable will not lose its value, unless another assignment is performed.
...fails silently otherwise.
...fails silently otherwise.
<semantics> - MathML
the <semantics> element acts as a container element associating annotations and must have child elements (it will raise an invalid markup error otherwise).
... the rules of determining the visible child in a <semantics> element are the following: if no rule other rule applies: by default only the first child is rendered, which is supposed to be presentation markup.
... if the first child is a presentation mathml element other than <annotation> or <annotation-xml>, render the first child.
MathML documentation index - MathML
WebMathMLIndex
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.
...in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it.
...the first child is the label whereas all other children are representing row contents and are treated identically to children of <mtr> elements.
Progressive web app structure - Progressive web apps (PWAs)
pwas can be built using any approach you like, but some will work better than the others.
...in addition to the basic shell, you can add other features such as add to home screen or push notifications, safe in the knowledge that the app will still work ok if they are not supported by the user's browser — this is the beauty of progressive enhancement.
...it provides fine-grained control — the stream can be started, chained with another stream, cancelled, checked for errors, and more.
Progressive web apps (PWAs)
pwa can be thought of as similar to ajax or other similar patterns that encompass a set of application attributes, including use of specific web technologies and techniques.
...it describes the name of the app, the start url, icons, and all of the other details necessary to transform the website into an app-like format.
... everything below this point is left over from the old version of this page and will be revamped as other content is overhauled.
begin - SVG: Scalable Vector Graphics
WebSVGAttributebegin
the element's animation start time is defined relative to the begin or active end of another animation.
... a valid syncbase-value consists of an id reference to another animation element followed by a dot and either begin or end to identify whether to synchronize with the beginning or active end of the referenced animation element.
... value <begin-value-list> default value 0s animatable no the definition of <begin-value-list> is the same as for the other animation elements.
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
any value other than none or inherit indicates that the given element will be rendered by the browser.
...this means that any child of an element with display="none" will never be rendered even if the child has a value for display other than none.
... the display attribute only affects the direct rendering of a given element, whereas it does not prevent elements from being referenced by other elements.
dominant-baseline - SVG: Scalable Vector Graphics
others only re-establish the baseline-table font-size.
...otherwise, if the writing-mode is vertical, then the value of the dominant-baseline component is central.
... if the computed baseline-shift value actually shifts the baseline, then the baseline-table font-size component is set to the value of the font-size attribute on the element on which the dominant-baseline attribute occurs, otherwise the baseline-table font-size remains the same as that of the element.
fill-rule - SVG: Scalable Vector Graphics
otherwise, it is inside.
...a shape inside a shape with the path segment moving in the same direction (both squares drawn clockwise, to the "right") --> <path fill-rule="nonzero" stroke="red" d="m110,0 h90 v90 h-90 z m130,20 h50 v50 h-50 z"/> <!-- effect of nonzero fill rule on a shape inside a shape with the path segment moving in the opposite direction (one square drawn clockwise, the other anti-clockwise) --> <path fill-rule="nonzero" stroke="red" d="m210,0 h90 v90 h-90 z m230,20 v50 h50 v-50 z"/> </svg> evenodd the value evenodd determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses.
... on a shape inside a shape with the path segment moving in the same direction (both squares drawn clockwise, to the "right") --> <path fill-rule="evenodd" stroke="red" d="m110,0 h90 v90 h-90 z m130,20 h50 v50 h-50 z"/> <!-- effect of evenodd fill rule on a shape inside a shape with the path segment moving in opposite direction (one square drawn clockwise, the other anti-clockwise) --> <path fill-rule="evenodd" stroke="red" d="m210,0 h90 v90 h-90 z m230,20 v50 h50 v-50 z"/> </svg> browser compatibility the compatibility table on this page is generated from structured data.
in2 - SVG: Scalable Vector Graphics
WebSVGAttributein2
value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes fecomposite for <fecomposite>, in2 defines the second input image to the compositing operation.
... value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes fedisplacementmap for <fedisplacementmap>, in2 defines the second input image, which is used to displace the pixels in the image defined in the in attribute.
... value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes specifications specification status comment filter effects module level 1the definition of 'in2 for <fedisplacementmap>' in that specification.
requiredFeatures - SVG: Scalable Vector Graphics
it determines whether or not all of the named features are supported by the browser; if all of them are supported, the attribute evaluates to true end the element is rendered; otherwise, the attribute evaluates to false and the current element and its children are skipped and thus will not be rendered.
...if requiredfeatures is used in other situations, it represents a simple switch on the given element whether to render the element or not.
...in some cases the feature strings map directly to a set of attributes, properties or elements, in others they represent some functionality of the browser.
Content type - SVG: Scalable Vector Graphics
unless stated otherwise for a particular attribute or property, the range for an <integer> encompasses (at a minimum) -2147483648 to 2147483647.
... svg makes extensive use of iri references, both absolute and relative, to other objects.
... percentage values are always relative to another value (for example, a length).
Clipping and masking - SVG: Scalable Vector Graphics
clipping refers to removing parts of elements defined by other parts.
... masking on the other hand allows soft edges by taking transparency and grey values of the mask into account.
...hence, if you set a stroke opacity on an element, that also has a fill, the fill will shine through on half of the stroke, while on the other half the background will appear: <svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="0" y="0" width="200" height="200" fill="blue" /> <circle cx="100" cy="100" r="50" stroke="yellow" stroke-width="40" stroke-opacity=".5" fill="red" /> </svg> screenshotlive sample you see in this example the red circle on blue ...
Introduction - SVG: Scalable Vector Graphics
not all svg viewers are equal and so there is a good chance that something written for one app will not display exactly the same in another, simply because they support different levels of the svg specification or another specification that you are using along with svg (that is, javascript or css).
...hopefully, along with the tutorial here, mdn can help developers keep up with the differences between gecko and some of the other major implementations.
... before starting you should have a basic understanding of xml or another markup language such as html.
Patterns - SVG: Scalable Vector Graphics
WebSVGTutorialPatterns
<rect x="0" y="0" width="50" height="50" fill="skyblue"/> <rect x="0" y="0" width="25" height="25" fill="url(#gradient2)"/> <circle cx="25" cy="25" r="20" fill="url(#gradient1)" fill-opacity="0.5"/> </pattern> </defs> <rect fill="url(#pattern)" stroke="black" width="200" height="200"/> </svg> screenshotlive sample inside the <pattern> element, you can include any of the other basic shapes you've included before, and each of them can be styled using any of the styles you've learned before, including gradients and opacity.
... here, we've just drawn two rectangle elements inside the pattern (which overlap, and one of which is twice the size of the other and is used to fill in the entire pattern), and one circle.
...all three of the preceding examples are shown below on a rectangle that has been slightly elongated to a height of 300px, but i should note that it's not an exhaustive picture, and there are other options available depending on your application.
SVG fonts - SVG: Scalable Vector Graphics
it was not meant for compatibility with other formats like postscript or otf, but rather as a simple means of embedding glyph information into svg when rendered.
...other tools however like the adobe svg viewer plugin, batik and parts of inkscape support svg font embedding.
...you can use literally any other svg elements in here, even <filter>, <a> or <script>.
Texts - SVG: Scalable Vector Graphics
WebSVGTutorialTexts
the one is the inclusion and display of text in an image, and the other are svg fonts.
... other text-related elements tspan this element is used to mark up sub-portions of a larger text.
... it must be a child of a text element or another tspan element.
SVG Tutorial - SVG: Scalable Vector Graphics
WebSVGTutorial
it is partially implemented in firefox, opera, webkit browsers, internet explorer and other browsers.
...another good introduction to svg is provided by the w3c's svg primer.
... introducing svg from scratch introduction getting started positions basic shapes paths fills and strokes gradients patterns texts basic transformations clipping and masking other content in svg filter effects svg fonts svg image tag tools for svg svg and css the following topics are more advanced and hence should get their own tutorials.
boolean - XPath
otherwise, it evaluates true.
...otherwise, it evaluates to true.
... an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
an instruction, on the other hand, is associated with a template.
...<xsl:apply-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:output><xsl:param><xsl:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:stylesheet><xsl:template><xsl:text><xsl:transform><xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:copy> <xsl:copy-of> <xsl:decimal-format> <xs...
...l:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:stylesheet> (partially supported) <xsl:template> <xsl:text> (partially supported) <xsl:transform> <xsl:value-of> (partially supported) <xsl:variable> <xsl:when> <xsl:with-param> ...
port - Archive of obsolete content
port methods emit() the port.emit() function sends a message from one side to the other.
...e content script to the main add-on code: // content-script.js var mymessagepayload = "some data"; self.port.emit("mymessage", mymessagepayload); from the main add-on code to the content script: // main.js var mymessagepayload = "some data"; worker.port.emit("mymessage", mymessagepayload); on() the port.on() function registers a function as a listener for a particular message sent from the other side using port.emit().
Two Types of Scripts - Archive of obsolete content
in the sdk documentation we call one sort "add-on code" and the other sort "content scripts".
...you use require() to import functionality from another module, and exports to export functionality from your module.
url - Archive of obsolete content
any api in the sdk which has a url parameter will accept url objects, not raw strings, unless otherwise noted.
...an exception is raised if the url can't be converted; otherwise, the native file path is returned as a string.
windows - Archive of obsolete content
to convert back the other way, from a chrome window to a browserwindow object, use the modelfor() function, exported by the modelfor module.
... here's an example converting from a high-level browserwindow to a chrome window, and then back the other way: var { modelfor } = require("sdk/model/core"); var { viewfor } = require("sdk/view/core"); var browserwindows = require("sdk/windows").browserwindows; function converttochromeandback(browserwindow) { // get the chrome window for this browserwindow var chromewindow = viewfor(browserwindow); // now we can use the chrome window api console.log(chromewindow.document.location.href); // -> "chrome://browser/content/browser.xul" // convert back to the high-level window var highlevelwindow = modelfor(chromewindow); // now we can use the sdk's high-level window api console.log(highlevelwindow.title); } browserwindows.on("open", converttochromeandback); note that directly...
content/mod - Archive of obsolete content
returns null otherwise.
...if target is specified modification is removed from that target only, otherwise modification is removed from all the targets it's being attached to.
io/file - Archive of obsolete content
exists(path) returns true if a file exists at the given path and false otherwise.
... returns boolean : true if the file exists and false otherwise.
io/text-streams - Archive of obsolete content
see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this.
...see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this.
system/events - Archive of obsolete content
this object has three attributes: type: the event type name subject: the event subject object data: the event data string strong : boolean default is false, a weak reference, which means it can be garbage collected at any time if there are no other references to it.
... strong : boolean default is false, a weak reference, which means it can be garbage collected at any time if there are no other references to it.
ui/button/toggle - Archive of obsolete content
updating checked you can update a toggle button's checked property in just the same way you update its other properties, but there's one extra thing you need to keep in mind.
...otherwise, it functions as a getter and returns the button's state for the specified object.
util/match-pattern - Archive of obsolete content
for other schemes like file, resource, or data, use a scheme followed by an asterisk, as below.
... returns boolean : true if the url matches the pattern and false otherwise.
cfx to jpm - Archive of obsolete content
with jpm, you must specify the path to "my-addon" explicitly, using a relative path: var my_addon = require("../lib/my-addon"); third-party modules the sdk has always supported third-party modules: developers can write their own modules that extend the sdk's apis or add new apis, and other add-on developers can make use of these modules in the same way that they use the sdk's built-in modules.
...in jpm, we've removed support for some of these fields, and are still working on supporting some others.
jpm-mobile - Archive of obsolete content
after that you can install jpm just as you would any other npm package: npm install jpm-mobile -g depending on your setup, you might need to run this as an administrator: sudo npm install jpm-mobile -g at the command prompt, type: jpm-mobile you should see a screen summarizing the available jpm-mobile commands.
...you can also chat with other sdk users in #jetpack on mozilla's irc network.
Creating Event Targets - Archive of obsolete content
this is especially useful if you want to build your own modules, either to organize your add-on better or to enable other developers to reuse your code.
... we can use this module in the same way we use any other module that emits module-level events, such as tabs.
Getting started (cfx) - Archive of obsolete content
you can distribute xpi files yourself or publish them to https://addons.mozilla.org so other users can download and install them.
... another example using grunt and grunt-shell: module.exports = function(grunt) { 'use strict'; require('matchdep').filterdev('grunt-!(cli)').foreach(grunt.loadnpmtasks); grunt.initconfig({ shell: { xpi: { command: [ 'cd pluginpath', 'cfx xpi', 'wget --post-file=pluginname.xpi http://localhost:8888/ || echo>/dev/null' ].join('&&') } }...
Troubleshooting - Archive of obsolete content
other users often post problems to the project mailing list.
... you can also chat with other sdk users in #jetpack on mozilla's irc network.
Alerts and Notifications - Archive of obsolete content
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 notification box another way of non-modal notification and further interaction with users is using of xul elements notificationbox and notification (implicitly).
... var message = 'another pop-up blocked'; var box = gbrowser.getnotificationbox(); var notification = box.getnotificationwithvalue('popup-blocked'); if (notification) { notification.label = message; } else { var buttons = [{ label: 'button', accesskey: 'b', popup: 'blockedpopupoptions', callback: null }]; let priority = box.priority_warning_medium; box.appendnotification(message, 'popup-blocked', 'chrome://browser/skin/info.png', priority, buttons); } ...
Dialogs and Prompts - Archive of obsolete content
be sure to use ondialog* attributes on dialog element instead of putting oncommand on the button with dlgtype, because button's oncommand is executed only when the button is pressed, and ondialog* handlers are executed for keyboard and other events too.
...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.
Rosetta - Archive of obsolete content
hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it.
...let us call this function createecmasrc() and let us associate it with the c mime types: rosetta_c.js: a c compiler /* c compiler for rosetta */ (function () { if (!window.rosetta) { return; } /* this function takes as argument a plain text (in this case, a code written in c) and returns another plain text written in ecmascript */ function createecmasrc (scsrc) { /* this is just an empty example...
Code snippets - Archive of obsolete content
ed 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 used to define and call xpcom components in javascript running applications code used to run other applications <canvas> related what wg canvas-related code signing a xpi how to sign an xpi with pki delayed execution performing background operations.
...hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it.
Common Pitfalls - Archive of obsolete content
in all other cases, one should call checkloaduriwithprincipal and pass the principal that the uri originates from as the first argument and an nsiuri object representing the uri as the second argument.
... what not to do all other security checks (including calls to checkloaduri and checkloaduristr) are incorrect, because they do not properly capture the originating principal.
Deploying a Plugin as an Extension - Archive of obsolete content
this allows the plugin to be treated like other firefox extensions; it can be upgraded, disabled, or uninstalled using the firefox user interface.
...firefox will load the correct plugins based on the platform, simply because the plugins for other platforms won't load.
Developing add-ons - Archive of obsolete content
this page will help guide you to the information you need in order to create add-ons for firefox, thunderbird, or other software based on the mozilla platform, as well as how to distribute your add-ons.
... performance performance guides and utilities to help you make your add-on perform well (and to play nicely with others).
Extension Packaging - Archive of obsolete content
extensions use a directory structure which can provide chrome, components, and other files to extend the functionality of an xul program.
...otherwise, the extension manager may not function properly with the extension, or the extension itself may not work properly.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
that should produce nslocalfilewin.cpp and other os-specific files.
... 5 - mac os x and other oss seemingly do not internationalize their directory names, but this hasn’t been confirmed.
Chapter 1: Introduction to Extensions - Archive of obsolete content
perhaps the first time you looked at firefox, you may have been surprised to see that it has a much simpler structure than other full-featured browsers, such as opera or safari.
... this is a very brief survey of a few extensions, but there are many other unique extensions available.
Appendix F: Monitoring DOM changes - Archive of obsolete content
dom mutation events were introduced to html several years ago in order to allow web applications to monitor changes to the dom by other scripts.
...minor changes are also required if one wishes to support other browsers, or to run in non-chrome-privileged scopes.
Useful Mozilla Community Sites - Archive of obsolete content
you'll also receive feedback that you wouldn't notice by testing only in one language, which can reveal other bugs in your locale handling.
...there are other free hosting sites such as souceforge and google code that are also very good, but not as specialized as mozdev.
Search Extension Tutorial (Draft) - Archive of obsolete content
changing default search setting from extensions many add-ons, for monetization or other reasons, change several search-related settings at install time.
...other settings violations designed to restrict user choice will result in stronger action, such as blacklisting of the add-ons in question.
Add-ons - Archive of obsolete content
extensions use a directory structure which can provide chrome, components, and other files to extend the functionality of an xul program.
...other items are recommendations.
Creating reusable content with CSS and XBL - Archive of obsolete content
another structural limitation concerns content.
...if you had difficulty understanding this page, or if you have other comments about it, please contribute to its discussion page.
CSS3 - Archive of obsolete content
while some modules are already w3c recommendations, other still are early working drafts.
...it describes how to use another graphical element or image as a luminance or alpha mask.
Creating a dynamic status bar extension - Archive of obsolete content
the refreshinformation() function contains another function, called inforeceived().
...refreshinformation() embeds another function, inforeceived(), which we'll look at separately shortly.
List of Former Mozilla-Based Applications - Archive of obsolete content
applications that switched to another technology name description additional information angelsoft tools for startups, vcs, and angel investors switched from xulrunner-based client to a web application autodesk maya 3d modeling tool switched off of gecko for help browser in version 8.5 blam feed reader switched to webkit in version 1.8.6 boxee media center software switched to webkit in version 1.0 epiphany browser switched from gecko to webkit flock social browsing ...
... other places to find former mozilla-based applications: archived mozilla hall of fame page siftery ...
Using XML Data Islands in Mozilla - Archive of obsolete content
this feature is not based on multi-vendor web standards and is not supported in firefox (or other non-ie browsers).
...here is another possible way, using the <object> tag.
Working with BFCache - Archive of obsolete content
after that, only scripts running on other windows can touch this window; if they modify the dom, the cached dom and window is thrown away.
...note that just because a page went into bfcache doesn't mean it'll ever come out again, like any other cache.
How Mozilla finds its configuration files - Archive of obsolete content
how mozilla finds its configuration files mozilla looks into the binary %userprofile%\application data\mozilla\registry.dat file for its "registry", which contains, amongst other information, a pointer to the directory where the profile is stored (located at common/profiles/profilename/directory.
...all other files in that directory are dynamically created by mozilla on first start.
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
how thunderbird and firefox find their configuration files thunderbird looks into the binary %appdata%\thunderbird\profiles.ini file for its "registry", which contains, amongst other information, a pointer to the directory where the profile is stored (usually located in %appdata%\thunderbird\profiles\profilename).
...all other files in that directory are dynamically created by mozilla on first start.
Creating a Firefox sidebar extension - Archive of obsolete content
other elements can be included, please read the xul tutorials for more information.
...tor> <em:description>example extension for creation and registration of a sidebar.</em:description> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox --> <em:minversion>1.5</em:minversion> <em:maxversion>2.0.0.*</em:maxversion> </description> </em:targetapplication> </description> </rdf> the other manifest file is chrome.manifest, the chrome manifest file.
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
although it is designed to retrieve xml content and parse it into a dom, it can retrieve (but not parse) other kinds of content as well.
...this is because we need to reference it in the updatetinderboxstatus() function as well as the current function, and we can't pass the object from one function to the other because the one doesn't call the other directly.
Finding the file to modify - Archive of obsolete content
the structure layer identifies the widgets (menus, buttons, etc.) and their position in the ui relative to each other, the style layer defines how the widgets look (size, color, style, etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals.
... each window and dialog box in mozilla is defined by a single xul file (in some cases other xul files called overlays contribute portions of another window's structure).
Making a Mozilla installation modifiable - Archive of obsolete content
mozilla's user interface is made up of xul (described below), xbl (a topic for another tutorial), javascript, css, and image files.
...this makes modifying mozilla's ui much easier than for many other applications.
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
xpis have a complex structure designed to separate ui layers from each other.
...n="true" chrome:description="displays tinderbox status for the mozilla codebase."> </rdf:description> <rdf:seq about="urn:mozilla:overlays"> <rdf:li resource="chrome://navigator/content/navigator.xul"/> </rdf:seq> <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://tinderstatus/content/tinderstatusoverlay.xul</rdf:li> </rdf:seq> </rdf:rdf> install.js, on the other hand, goes into the tinderstatus-installer directory: initinstall( "mozilla tinderstatus extension", "/mozdev/tinderstatus", "0.1"); var installdir = getfolder("chrome","tinderstatus"); setpackagefolder(installdir); adddirectory("tinderstatus"); registerchrome( content | delayed_chrome, getfolder(installdir, "content")); var result = performinstall(); if ( result ...
Creating a Mozilla Extension - Archive of obsolete content
see building an extension for an up-to-date tutorial (it focuses on firefox, but is also applicable to other new applications).
... completing this tutorial will give you a basic understanding of how mozilla's user interface (ui) is constructed, how to find the source code for the ui you want to extend, how to make an installation of mozilla modifiable, how to use mozilla's network library to load and parse web pages in javascript, and how to use dynamic overlays to package a mozilla extension for installation by others.
Creating a Microsummary - Archive of obsolete content
in each step of revising the transform sheet and other code in this tutorial, new material added will be shown in boldface so you can follow along more easily.
...otherwise, if the url returns plain text content (or html content that can be converted to plain text), firefox uses the content as the microsummary for the page.
Getting Started - Archive of obsolete content
css files the css files in these directories tell the browser how to display the buttons and other controls, where to put the images, what border and padding it should put around them, etc.
...if we also had skins for chatzilla, we would have to add another line resembling the other ones and change it to point to chatzilla.
In-Depth - Archive of obsolete content
other sites which list mozilla specific css properties 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.
...if you look at the modern skin, you'll notice that it adds the image to the other side of the toolbar.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
another example: (taken from rayh.co.uk) // note, on linux, gtk has to be already initialized for this code to work mozilla moz = mozilla.getinstance(); // now we need to start an xul application, so we get an instance of the xpcom service manager nsiservicemanager servicemanager = moz.getservicemanager(); // now we need to get the @mozilla.org/toolkit/app-startup;1 service: ...
...(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 appstartup.run() enters the main event loop and will stay there until the application exits.
Exception logging in JavaScript - Archive of obsolete content
all other errors are reported when the last javascript frame on the stack returns to a c++ caller without handling the exception.
...in other words, all unhandled javascript exceptions (except those in rules 3 and 4 above) will be logged before control returns to the outermost c++ caller.
Extension Frequently Asked Questions - Archive of obsolete content
they are currently written with mostly firefox in mind, but most if not all should easily translate to seamonkey, thunderbird or any of the other applications.
... please see extensions:other resources and extensions:community.
Block and Line Layout Cheat Sheet - Archive of obsolete content
nslinebox a block consists of lines and other blocks, stacked vertically.
...it is cleared, otherwise.
Simple Storage - Archive of obsolete content
for the most part this object is like any other javascript object, and a jetpack can set whatever properties it wants on it.
... otherwise, don't// modify the menu at all.
Clipboard - Archive of obsolete content
if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
...jetpack.import.future("clipboard");// in text formatjetpack.clipboard.set("hello world");// in other clipboard get(flavor string)returns data to jetpack from the clipboard.
Clipboard Test - Archive of obsolete content
if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
...jetpack.import.future("clipboard");// in text formatjetpack.clipboard.set("hello world");// in other clipboard get(flavor string)returns data to jetpack from the clipboard.
Clipboard - Archive of obsolete content
if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
...jetpack.import.future("clipboard"); // in text format jetpack.clipboard.set("hello world"); // in other clipboard get(flavor string)returns data to jetpack from the clipboard.
Simple Storage - Archive of obsolete content
for the most part this object is like any other javascript object, and a jetpack can set whatever properties it wants on it.
... otherwise, don't // modify the menu at all.
Clipboard - Archive of obsolete content
if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
...jetpack.import.future("clipboard"); // in text format jetpack.clipboard.set("hello world"); // in other clipboard get(flavor string)returns data to jetpack from the clipboard.
Mozilla Application Framework - Archive of obsolete content
xpcom a simple, cross-platform component model with multiple language bindings and idl descriptions so you can plug your custom functionality into the framework and connect it with other components.
... 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.
String Quick Reference - Archive of obsolete content
old way: use nsautostring and assignwithconversion() nsautostring widestring; widestring.assignwithconversion("some string"); callwidefunction(widestring); // use widestring again, but need a const prunichar* callwidewithflatstring(widestring.get()) nsautostring widestring2; widestring2.assignwithconversion("another string"); callwidefunction(widestring2); new way: use ns_literal_string or ns_named_literal_string // pre-declare the variable if you'll use it multiple times ns_named_literal_string(widestring, "some string"); callwidefunction(widestring); // use widestring again, but need a const prunichar* callwidewithflatstring(widestring.get()); // inline the string with ns_literal_string callwidefunctio...
...n(ns_literal_string("another string")); converting literal strings to string objects what: converting from const prunichar*/const char* to the appropriate string type why: avoid making extra copies of strings, just to convert between types!
Supporting private browsing mode - Archive of obsolete content
te-browsing-cancel-vote notification with the subject "exit", and set its data field to true to cancel the operation, like this: var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); os.addobserver(function (asubject, atopic, adata) { asubject.queryinterface(components.interfaces.nsisupportsprbool); // if another extension has not already canceled entering the private mode if (!asubject.data) { if (adata == "exit") { // if we are leaving the private mode /* you should display some user interface here */ asubject.data = true; // cancel the operation } } }, "private-browsing-cancel-vote", false); note: a well-mannered extension should display some sort of user interfac...
...other considerations for extensions in some extensions, it's hard to decide whether the data retained by the extension should be written to disk in private browsing mode or not.
Table Cellmap - Archive of obsolete content
now that union uses the fact all addresses of real tablecellframes are aligned at even boundaries, or in other words they cant have an odd address.
... if the address is odd then it holds some other info (mbits).
Actionscript Acceptance Tests - Archive of obsolete content
this example passes in another .abc file as an argument to the file being run: -- $dir/file.abc another use would be to pass a specific argument to the shell: -dtimeout this file can have multiple lines with different arguments.
... the underscore is necessary otherwise the buildbot system will delete the .abc before starting up a testrun (not an issue when running locally, but makes it easy to differentiate between binary-only abc files and generated abcs.
Running Tamarin acceptance tests - Archive of obsolete content
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.
... to recap the other environment settings: - set the builtinabc environment variable to the path of the generated/builtin.abc.
Tamarin Build System Documentation - Archive of obsolete content
the phases run when slaves are available and the other phases do not wait for completion to start the next build.
... expectedfail or skip expectedfail means the test is run and the assertion is the test fails, if the test passes and is marked expectedfail the test result is unexpectedpass and treated like a failure skip means the test is not run, the test may fail intermittently or harm the system altering the results of other tests ...
Venkman - Archive of obsolete content
learning the javascript debugger venkman written by svend tofte to the javascript programmers who are not familiar with other debugging tools.
... related topics javascript, web development, developing mozilla original document information author(s): robert ginda other contributors: doctor unclear last updated date: july 13, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Writing textual data - Archive of obsolete content
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.
... to instead write a replacement character in such cases, specify the character instead of 0x00: os.init(fos, charset, 0, "?".charcodeat(0)); you can, of course, replace the "?" in that example with any other character.
Event Handlers - Archive of obsolete content
the other possible values are target, which means the handler will only fire if event.originaltarget is the same as the target to which the handler is attached, and capturing, which indicates the handler should fire during the capturing phase of event flow.
... xbl event handlers always fire last, after all other event handlers at the same position in the event flow.
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.
...you can build your own reusable widgets from existing xul, html, svg, and other primitives using xbl.
Unix stub installer - Archive of obsolete content
now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/installer/raw.
... original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
Install script template - Archive of obsolete content
writes registry keys exposing the above secondary install location for other browsers to find.
...les errblock1 = addfile (plid, version, component_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + component_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } } else { logcomment("cancelling current browser install due to lack of space..."); cancellinstall(); } // secondary install block, which sets up plugins and xpt in another location in addition to the current browser errblock2 = createsecondaryinstall(); // performinstall block, in which error conditions from previous blocks are checked.
addDirectory - Archive of obsolete content
in some situations, adddirectory may return other errors.
...to move the files and all other subcomponents to their final location, call the performinstall method after you've successfully added all subcomponents.
addFile - Archive of obsolete content
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.
...to move this and all other files to their final location, call the performinstall method after you've successfully added all files.
execute - Archive of obsolete content
the install object's execute method, on the other hand, deletes the executable from its temporary location once it has finished.
...all other backslashed cases are ignored.
initInstall - Archive of obsolete content
all other parts of the netscape 6 area of the registry are reserved for use by netscape.
...it is an error to call any other install methods before calling initinstall.
setPackageFolder - Archive of obsolete content
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.
...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.
XPJS Components Proposal - Archive of obsolete content
a 'load' or 'import' function will also be provided to let the js code import other .js files where libraries of code might be stored.
...accessing other components/services via xpcom/xpconnect is more akin to 'dynamic' libraries.
allowevents - Archive of obsolete content
otherwise, events are passed to the element only.
...by setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements.
datasources - Archive of obsolete content
for xml datasources, only one source is used, either the url of an xml file or an anchor reference to another element within the same document.
...otherwise, you cannot add one later.
dir - Archive of obsolete content
ArchiveMozillaXULAttributedir
normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right or top to bottom in the order they appear in the xul code.
...for other elements, they are placed right to left or bottom to top.
orient - Archive of obsolete content
horizontal child elements of the element are placed next to each other in a row in the order that they appear in the xul source.
... vertical child elements of the element are placed under each other in a column in the order that they appear in the xul source.
wait-cursor - Archive of obsolete content
usually, you would only use this on the window element or other top-level elements.
... in order to revert to the normal cursor state call the method removeattribute("wait-cursor") when the process effectively has ended otherwise the wait cursor might never disappear.
Working With Directories - Archive of obsolete content
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.
...this method returns true if a file object returned by nsiscriptableio.getfile() refers to a directory, and false otherwise.
International characters in XUL JavaScript - Archive of obsolete content
gecko 1.8, as used in firefox 1.5 and other applications, added support for non-ascii characters in javascript files loaded from xul files.
...otherwise, the character encoding will be the same as the one used by the xul file (which can be specified using an encoding attribute in the <?xml?> tag).
List of commands - Archive of obsolete content
enext cmd_selectlineprevious cmd_charprevious cmd_charnext cmd_selectcharprevious cmd_selectcharnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_wordprevious cmd_wordnext cmd_selectwordprevious cmd_selectwordnext cmd_scrollpageup cmd_scrollpagedown cmd_scrolllineup cmd_scrolllinedown cmd_movepageup cmd_movepagedown cmd_selectpageup cmd_selectpagedown other commands the following list other commands (prefixed by cmd_ or browser:) which have not been categorized here yet (though they are in the alphabetical list below): http://lxr.mozilla.org/seamonkey/sou...baroverlay.xul http://lxr.mozilla.org/seamonkey/sou...t/navigator.js http://lxr.mozilla.org/seamonkey/sou...toroverlay.xul http://lxr.mozilla.org/seamonkey/sou...onaltoolbar.js http://lxr...
..._find cmd_bm_import cmd_bm_managefolder cmd_bm_movebookmark cmd_bm_newbookmark cmd_bm_newfolder cmd_bm_newseparator cmd_bm_open cmd_bm_openinnewtab cmd_bm_openinnewwindow cmd_bm_paste cmd_bm_properties cmd_bm_rename cmd_bm_selectall cmd_bm_setnewbookmarkfolder cmd_bm_setnewsearchfolder cmd_bm_setpersonaltoolbarfolder cmd_bm_sortfolder cmd_bm_sortfolderbyname cmd_close cmd_closeothertabs cmd_closewindow cmd_copy cmd_copyimage cmd_copylink cmd_cut cmd_delete cmd_editpage cmd_findtypelinks cmd_findtypetext cmd_gotoline cmd_handlebackspace cmd_handleshiftbackspace cmd_minimizewindow cmd_neweditor cmd_neweditordraft cmd_neweditortemplate cmd_newnavigator cmd_newnavigatortab cmd_newtabwithtarget cmd_openhelp cmd_paste - paste a selection from the clipboard cm...
insertItem - Archive of obsolete content
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.
openPopup - Archive of obsolete content
anchor the popup may be either anchored to another node or opened freely.
... iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups.
Namespaces - Archive of obsolete content
there's only one other thing to know: "default namespace".
...in other words, a default namespace permits a kind of short-hand to be used for all descendants of an element.
Floating Panels - Archive of obsolete content
on mac, floating panels are invisible when another application is made active, and become visible again when the xul application is made active.
...a label for the titlebar may be set using the label attribute, as in the following example: <panel id="info-panel" noautohide="true" titlebar="normal" label="image properties"> closing a floating panel unlike other panels, a floating panel does not close when clicking outside of it.
PopupKeys - Archive of obsolete content
other keys are ignored by the menu key listener, however, the event does not propagate to the main window.
...the other keys do not apply.
textbox.label - Archive of obsolete content
otherwise it returns the value of the associated label element, if applicable.
... otherwise it returns the placeholder or emptytext property.
Sorting and filtering a custom tree view - Archive of obsolete content
this will not work for other types of trees, for example rdf-backed or ones created with dom methods.
..."ascending" : "descending"); } //prepares an object for easy comparison against another.
Actions - Archive of obsolete content
however, you may use ids on the other parts of the template, such as within the query statements, if you wish to change the statements and rebuild the template.
...you can place other elements outside this to serve as containers for all the results.
Simple Query Syntax - Archive of obsolete content
you can get other predicates in the same way, just by using the predicate uri and prefixing it with 'rdf:'.
...that is, you cannot filter on predicates pointing into the member resource nor can you cannot filter based on predicates pointing out of other resources.
Template and Tree Listeners - Archive of obsolete content
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.
Using Recursive Templates - Archive of obsolete content
e"> <person name="napoleon bonaparte"/> <person name="julius caesar"/> <person name="ferdinand magellan"/> </group> <group name="female"> <person name="cleopatra"/> <person name="laura secord"/> </group> </people> we could display this data in a flat list by using the right query: <query expr="group/person/"> or, we could display one level for the two groups, and use another level for each person.
...you could further expand this process for other levels.
textbox (Toolkit autocomplete) - Archive of obsolete content
if the user types another character, the timer resets.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
Adding Event Handlers - Archive of obsolete content
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.
... responding to events the script will contain code which responds to various events triggered by the user or other situations.
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
event handlers as you might expect, mouse clicks, key presses and other events are passed to each of the elements inside the content.
...three handlers have been added, one for cut, one for copy and the other for paste.
Adding Properties to XBL-defined Elements - Archive of obsolete content
the following decribes what happens in a typical case: there are two elements, one called 'banana' and the other 'orange'.
...if other characters are entered, they are stripped off.
Additional Install Features - Archive of obsolete content
this will occur if a file or directory cannot be found, there is insufficient disk space or for a number of other reasons.
...otherwise, the number will be an error code which indicates the type of error that occured.
Creating a Wizard - Archive of obsolete content
<radiogroup> <caption label="size"/> <radio value="small" label="small"/> <radio value="large" label="large"/> </radiogroup> <radiogroup> <caption label="gender"/> <radio value="male" label="male"/> <radio value="female" label="female"/> </radiogroup> </wizardpage> </wizard> this wizard has two pages, one that has a drop-down menu and the other with a set of radio buttons.
...they work in a similar way to the other functions except that you can use different code for each page.
Creating an Installer - Archive of obsolete content
xpinstall packages mozilla provides a mechanism which can be used to package xul windows, scripts, skins and other files into single file installers.
... the jar file installers typically have the extension .xpi (pronounced zippy) to distinguish them from other archives.
Input Controls - Archive of obsolete content
set it to true to have a radio button selected by default, or leave it out for other radio buttons.
...clicking one will turn off all of the others in the same group.
Install Scripts - Archive of obsolete content
it is important to note that during step two, you only indicate which files should be installed and any other operations you wish to have happen.
...we can call these functions multiple times to install other files.
Manipulating Lists - Archive of obsolete content
these three methods are also available for several other xul elements and work in the same manner.
...in other cases, you may wish to check to ensure that selecteditem is not null before continuing.
Modifying a XUL Interface - Archive of obsolete content
the appendchild() function is used to add an element as a child of another element.
...it's not yet added to the dom, you must use setattribute("checked", "false") instead, because the xbl isn't initiated yet.) example 6 : source view <button label="change" oncommand="this.nextsibling.checked = !this.nextsibling.checked;"/> <checkbox label="check for messages"/> radio buttons may be selected as well using properties, however since only one in a group may be selected at a time, the others must all be unchecked when one is checked.
Modifying the Default Skin - Archive of obsolete content
firefox provides a skin by default, and you may download others.
... you can assign images to a button, checkbox and other elements by using the list-style-image property as in the following: checkbox { list-style-image: url("chrome://findfile/skin/images/check-off.jpg"); } checkbox[checked="true"] { list-style-image: url("chrome://findfile/skin/images/check-on.jpg"); } this code changes the image associated with a checkbox.
More Button Features - Archive of obsolete content
you can change this position by using two other attributes.
...example 1 : source view <button label="help" image="happy.png"/> button with css image another way to specify the image is by using the css list-style-image style property on the button.
Persistent Data - Archive of obsolete content
the information is collected and stored in a rdf file (localstore.rdf) in the same directory as other user preferences.
...you could add additional attributes by adding a space and another attribute name to the persist attribute.
The Chrome URL - Archive of obsolete content
« previousnext » the following section will describe how to refer to xul documents and other chrome files.
...another advantage over other url types is that they automatically handle multiple themes and locales.
XBL Attribute Inheritance - Archive of obsolete content
the syntax <inner attribute>=<outer attribute> is used to map one attribute to another.
... here is another example: xul: <box class="okcancel" oktitle="ok" canceltitle="cancel" image="happy.png"/> css: box.okcancel { -moz-binding: url('chrome://example/skin/example.xml#okcancel'); } xbl: <binding id="okcancel"> <content> <xul:button xbl:inherits="label=oktitle,image"/> <xul:button xbl:inherits="label=canceltitle"/> </content> </binding> the value of the oktitle attribute is mapped to the label attribute of the first button.
Using Visual Studio as your XUL IDE - Archive of obsolete content
you should be able to use the schema in other ide's too.
... the other xsd files will be added automatically.
XUL Template Primer - Bindings - Archive of obsolete content
the subject may refer to any variable that has been computed in the <conditions>, or it may refer to another <binding>'s object variable.[1] in our example, the second <binding>'s subject does this: the value for the ?addr variable is computed by the first <binding> the predicate must name the uri of an rdf property, in this case, nc:address.
...specifically, if a binding depends on a variable in another binding, it must appear after the binding it depends on.
browser - Archive of obsolete content
other urls will need to use the document and history objects to change the displayed document.
... swapdocshells( otherbrowser ) return type: no return value swaps the content, history and current state of this browser with another browser.
columns - Archive of obsolete content
the columns element may be nested inside another columns element.
... other elements placed inside a columns element occupy the full height of the grid and are placed in their corresponding positions between the columns.
menulist - Archive of obsolete content
otherwise, the menu will size itself to at least the size of the popup.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
menuseparator - Archive of obsolete content
otherwise, events are passed to the element only.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
notification - Archive of obsolete content
this may be used to close a set of notifications as a group without affecting other notifications.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
prefpane - Archive of obsolete content
the former is specified using a preferences element while the latter may be specified using other xul elements.
...otherwise the dialog will show erratic behavior and not display correctly.
tabbrowser - Archive of obsolete content
note: starting in firefox 3 (xulrunner/gecko 1.9), this is only used in the main firefox window and cannot be used in other xul windows by third-party applications or extensions.
... showonlythesetabs( atabs ) return type: no return value makes all tabs in the atabs array visible, and all other tabs hidden.
Application Update - Archive of obsolete content
other apps may wish to show this ui, and supply // a whatsnewurl field in their brand.properties that contains a link to a page // which tells users what's new in this new update.
... at the scheduled interval the application checks the update server for update.xml, search for the correct one using the software name, versions, build id's, channels, and other information like locales.
Building XULRunner - Archive of obsolete content
xulrunner is built using basically the same process as firefox or other applications.
...for instance, in firefox 2.0.0.9 you will get : mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.1.9) gecko/20071025 firefox/2.0.0.9 therefore the xulrunner version for this firefox version is : 1.8.1.9 fetching sources from mercurial as with all other mozilla products, one would fetch recent sources from mercurial.
Building XULRunner with Python - Archive of obsolete content
note this is complete and does not require the checkout of any other project specific .mozconfig files as sometimes shown.
...ime with no local client.mk file, execute cd /c/projects cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk cd mozilla make -f client.mk for subsequent updates from cvs followed by a build, use cd /c/projects/mozilla make -f client.mk which will also checkout client.mk itself for build only, without checkouts, use make -f client.mk build and see client.mk for other options.
Getting started with XULRunner - Archive of obsolete content
given that firefox, thunderbird, and multiple other applications are written using the platform, it's a safe bet that it can be used to build a basic application.
... copy this to the /library/frameworks directory, or another location of your choice.
MacFAQ - Archive of obsolete content
ript type="application/javascript" src="chrome://global/content/nsusersettings.js" /> <script><![cdata[ function debug(alogstring) { var mconsoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) mconsoleservice.logstringmessage("myxul: " + alogstring + "\n"); } function checkotherwindows() { var singletonwindowtype = nspreferences.copyunicharpref("toolkit.singletonwindowtype"); var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var win = windowmediator.getmostrecentwindow(singletonwindowtype); if (win) { window.close(); ...
... .queryinterface(components.interfaces.nsicommandline); for (var i = 0; i < cmdline.length; ++i) { debug(cmdline.getargument(i)) } } catch(ex) { debug(window.arguments[0]) // do something with window.arguments[0] //nspreferences.setunicharpref("myxul.cmdlinevalue", window.arguments[0]) } window.addeventlistener("load", checkotherwindows , false); } ]]></script> </window> ...
XULRunner tips - Archive of obsolete content
ome://inspector/content/commandoverlay.xul chrome://inspector/content/viewers/dom/commandoverlay.xul to launch dom inspector in your application, you need to open its main window, with a command like this: window.open("chrome://inspector/content/inspector.xul", "", "chrome"); alternatively, the dom inspector may also be added as an extension: (if you already have inspector installed for another application you can skip to the next step) follow the instructions above through "unzip the package." create a file in the extensions directory of your application with the same name as the dom inspector id (inspector@mozilla.org) containing one line of text -- the exact path to the root directory of dom inspector (where the install.rdf is) like this one: /home/username/.mozilla/firefox/numb...
...you'll probably also want to create menuitems that let you open the js shell and other tools provided by the extension.
XULRunner - Archive of obsolete content
xulrunner also provides libxul, a solution which allows the embedding of mozilla technologies in other projects and products.
... mailing list newsgroup rss feed #xulrunner on irc.mozilla.org other community links...
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
can't view keith olbermann videos a user inability to launch videos, worked fine for others, ended up being a flash version problem.
... firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project?
2006-09-29 - Archive of obsolete content
can't view keith olbermann videos a user inability to launch videos, worked fine for others, ended up being a flash version problem.
... firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project?
2006-11-17 - Archive of obsolete content
configure regeneration back up, but another outage tonight...
...he also warns that there will be another outage which will cause the servers in his office as well as all tinderboxes to go down.
2006-11-03 - Archive of obsolete content
cross-product extension install improvements simon paquet points out how much easier it is to install an extension in firefox than it in any other product.
... a discussion of how to get firefox to be able to install extensions for other products (e.g.
2006-11-17 - Archive of obsolete content
configure regeneration back up, but another outage tonight...
...but there is another outage scheduled so the tinderboxen will be down early.
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.platform - september 30th to october 6th 2006 announcements mike schroepfer is attending a vista compatibility lab with some other people this week.
... other traffic there was no traffic on mozilla.dev.platform this week.
2006-11-10 - Archive of obsolete content
matthew gertner wants to know if anyone has written code to paste images from the clipboard on platforms other than windows?
...neil deakin points out that "downloads and other network operations are always done in another thread so you shouldn't be creating one yourself".
External resources for plugin creation - Archive of obsolete content
supported development environments are xcode, visual studio, gcc (and probably any other modern c++ compiler) browser plugins can be built as npapi (mac/windows), or activex (windows).
... project: qtbrowserplugin project home page description (from the home page): the qtbrowserplugin solution makes it easy to write browser plugins that can be used in mozilla firefox, safari, opera, google chrome, qtwebkit and any other web browser that supports the "netscape plugin api", npapi articles, information, and tutorials npapi has been around a very long time, and there have been many attempts to distill down useful information on creating them: colonelpanic.net building a firefox plugin - part one: discusses the difference between npapi and npruntime and summarizes the basic apis needed to create a plugin building a firefox plugin - part two: discusses the basic lifecycle of a npapi plugin building a firefox plugin - part three: discusses npobjects and how to use them memory manage...
NPN_Status - Archive of obsolete content
if your plug-in has a button or other object that acts as a link when clicked, you can call npn_status() to display a description or url when the user moves the cursor over it.
...your message is always displayed, but you have no control over how long it stays in the status line before another message replaces it.
NPP_Destroy - Archive of obsolete content
**save state or other information to save for reuse by a new instance of this plug-in at the same url.
... use the optional save parameter if you want to save and reuse some state or other information.
NPP_New - Archive of obsolete content
values: np_embed: (1) instance was created by an embed tag and shares the browser window with other content.
...this gives developers a chance to use private attributes to communicate instance-specific options or other information to the plug-in.
NPP_URLNotify - Archive of obsolete content
npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems.
...other possible reason codes are npres_user_break, indicating that the request was halted due to a user action (for example, clicking the stop button), and npres_network_err, indicating that the request could not be completed, perhaps because the url could not be found.
NPStream - Archive of obsolete content
for other streams, notifydata is null.
...this field is used only for http and is null for other types of streams.
Adobe Flash - Archive of obsolete content
in the future, other modules may be blocked as well.
...this shows communication flowing in the other direction -- namely, an action taken within the flash animation affects something in the html page that contains the flash animation.
The First Install Problem - Archive of obsolete content
problem definition the first install problem is the name given to the conditions arising when a plugin or embeddable software installs itself on a system first, before any other gecko-based browser.
...for example, in our case, a prospective invocation might look like: <object classid="@mycompany.com/myapplication,version=5.01" data="myfile.typ" codebase="http://myurl.com/myplugin/myplugin.xpi" type="application/x-myapp"></object> the use of both "type" and "classid" attributes here offers the following user benefit: if there is another mimetype handler for application/x-myapp, only myapplication gets invoked.
Plugins - Archive of obsolete content
important: since firefox 52, all plugin support except flash has been dropped (see plug-in support has been dropped other than flash for more details).
... plugins: the first install problem the first install problem is the name given to the conditions arising when a plugin or embeddable software installs itself on a system first, before any other gecko-based browser.
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
although not necessary, people also often use other rss modules to get at (and read) the comments (since rss does not currently provide facilities for this either).
...and that rss feeds that are aggregations of other rss feeds will not be able to assert this.
.htaccess ( hypertext access ) - Archive of obsolete content
file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other.
... common application url redirects & rewrite: htaccess files are often used to redirect traffic to a web page to another or from traffic to a directory to another even between domains is possible.
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.
... a threat source is the cause of a threat, such as a hostile cyber or physical attack, a human error of omission or commission, a failure of organization-controlled hardware or software, or other failure beyond the control of the organization.
Theme changes in Firefox 3 - Archive of obsolete content
may or may not affect other mac themes that use it.
...the rule that's needed to show and hide the go button and other location bar icons is: #urlbar[pageproxystate="invalid"] > #urlbar-icons > :not(#go-button) , #urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button { visibility: collapse; } images to add add the following images: chrome://global/skin/icons/information-16.png used when presenting information notices.
Scratchpad - Archive of obsolete content
now scratchpad will be available in the toolbox, alongside other tools like the page inspector and the web console.
...this is what you'd use to execute a function or other code that manipulates the content of your page without needing to see the result.
:-moz-system-metric(windows-default-theme) - Archive of obsolete content
example html content <p id="defaultthemes"> this paragraph should have a green background with luna/royale/zune/aero windows themes and red with other themes.
... </p> <p id="nondefaultthemes"> this paragraph should have a green background with windows classic or third-party themes and red with other themes.
::-ms-fill - Archive of obsolete content
(a progress bar is determinate if it has a value attribute set; otherwise it is indeterminate.
...other properties are ignored.
Processing XML with E4X - Archive of obsolete content
it is not possible to directly interpolate variables amidst other literal (or variable) attribute content, however (e.g., bar="a{var1}{var2}").
...s one attribute, type, which can be accessed and updated in a number of ways: alert(languages.@type); // alerts "dynamic" languages.@type = "agile"; alert(languages.@type); // alerts "agile" alert(languages.tostring()); /* alerts: <languages type="agile"><lang>javascript</lang><lang>python</lang></languages> */ note that if one wishes to make comparisons of retrieved attributes with other strings, it is necessary to convert the attribute first, even though the attribute may be converted to a string when used in other contexts (such as insertion into a textbox).
The global XML object - Archive of obsolete content
extending xml.prototype xml.prototype and xmllist.prototype (xmllist.prototype is actually just xml.prototype) cannot be extended in the same conventional way as other constructors such as object.
...ignores whitespace between nodes and leading and trailing whitespace in text nodes, which would otherwise be interpreted as text nodes or as part of those text nodes, respectively.
VBArray - Archive of obsolete content
this can only be done by retrieving the value from an existing activex or other object.
...the third part is the javascript code that goes in the <body> section to run the other two parts.
Microsoft JavaScript extensions - Archive of obsolete content
microsoft browsers (internet explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions to the otherwise standard javascript apis.
... objects activexobject debug enumerator vbarray functions getobject scriptengine scriptenginebuildversion scriptenginemajorversion scriptengineminorversion statements @cc-on @if @set other date.getvardate() error.description error.number error.stacktracelimit ...
New in JavaScript 1.1 - Archive of obsolete content
--> new features in javascript 1.1 new objects array boolean function number new properties number.max_value number.min_value nan number.negative_infinity number.positive_infinity new methods array.prototype.join() array.prototype.reverse() array.prototype.sort() array.prototype.split() new operators typeof void other new features <noscript> liveconnect.
... 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.
ECMAScript 2015 support in Mozilla - Archive of obsolete content
it defines the standard for the javascript implementation in spidermonkey, the engine used in firefox and other mozilla applications.
...rty (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 function (firefox 26) yield (firefox 26) yield* (firefox 27) arguments[@@iterator] (firefox 46) other features binary and octal numeric literals (firefox 25) template strings (firefox 34) object initializer: shorthand property names (firefox 33) object initializer: computed property names (firefox 34) object initializer: shorthand method names (firefox 34) ...
JSException - Archive of obsolete content
constructor summary the netscape.javascript.jsexception class has the following constructors: jsexception deprecated constructors optionally let you specify a detail message and other information.
... backward compatibility javascript 1.1 through 1.3 jsexception had three public constructors which optionally took a string argument, specifying the detail message or other information for the exception.
LiveConnect - Archive of obsolete content
the reimplementation also restores the ability to use try-catch exceptions within javascript, and is free of the increasing number of other bugs introduced by the decline of the original liveconnect (e.g., java.lang.string and arrays not working properly).
... liveconnect exceptions how do java and javascript catch exceptions generated by the other party?
Packages - Archive of obsolete content
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.
... properties classname: the fully qualified name of a java class in a package other than netscape, java, or sun that is available to javascript.
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
xhtml is xml, not html one of the primary misunderstandings about xhtml is that it is just another version of html.
...- 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 (——).
Sharp variables in JavaScript - Archive of obsolete content
#1 = {}; // this doesn't do much since the sharp variable is out of scope immediately after a = #2 = {}; // slightly more useful since we retain a reference to the new object to reference the sharp variable, simply append another sharp (#) to the end of the variable name.
...you can use this to create objects in a single line of code that would otherwise take multiple lines of code.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
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.
...the layout wasn't bad if the fish weren't laid out next to each other, so i moved on.
Writing JavaScript for XHTML - Archive of obsolete content
if (variable < 10 && variable >= 0) action(); ]]> </script> note that the cdata section is only necessary because of the < in the code; otherwise you could have ignored it.
...use dom methods to create all of your elements, attributes and other nodes.
Troubleshooting XForms Forms - Archive of obsolete content
if your binding expression contains a /, look for any containing xf:group, xf:repeat, xf:input or other elements that set the context node.
... conflicts with other plug-ins if you are using the noscript plugin you may notice that your put and/or post requests are being converted to get requests.
RFE to the Custom Controls - Archive of obsolete content
introduction if you have a custom control that you believe will help fulfill the needs of form authors or other custom controls authors, please file it here.
...note: xul is a feature of mozilla only and custom control authors should be aware their controls won't work on other browser platforms.
Requests For Enhancement - Archive of obsolete content
ArchiveWebXFormsRFE
custom controls if you have a custom control that you believe will help fulfill the needs of form authors or other custom controls authors, please file it here.
... xul is a feature of mozilla only and custom control authors should be aware their controls won't work on other browser platforms.
XForms Input Element - Archive of obsolete content
characteristics a text field 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).
...since the introduction of labelposition, the behavior changed as described above to better match other implementations as well as commonly used gui guidelines.
XForms Secret Element - Archive of obsolete content
introduction used for inputting passwords or other sensitive text.
...any other xform control bound to that data will show that data 'as is'.
XForms Switch Module - Archive of obsolete content
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.
...if multiple cases within a switch are marked as selected="true", the first selected case will appear and all others will not be visible.
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
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.
Mozilla's DOCTYPE sniffing - Archive of obsolete content
in other words, the algorithm is the best approximation we can find for determining which pages were written after mozilla became a known important user-agent on the web.
... an xml declaration (pseudo-pi) without a doctype (in other words, ignore the xml declaration and use the doctype).
Examples - Game development
gorescript another retro style first person shooter.
... explosion and chain reaction exploding particles that set off other explosions.
Building up a basic demo with Babylon.js - Game development
as with any other 3d library it provides built-in functions to help you implement common 3d functionality more quickly.
...if you have already worked through our building up a basic demo series with three.js, playcanvas or a-frame (or you are familiar with other 3d libraries) you'll notice that babylon.js works on similar concepts: camera, light and objects.
Building up a basic demo with PlayCanvas - Game development
tanx is a multiplayer tank game where you can drive your tank around, shooting at other players as you go.
... engine vs editor the engine itself can be used as a standard library by including its javascript file directly in your html, so you can start coding right away; in addition the playcanvas toolset comes with an online editor that you can use to drag and drop components onto the scene — a great way to create games and other apps requiring scenes if you're more of a designer than a coder.
Square tilemaps implementation: Scrolling maps - Game development
var startcol = math.floor(this.camera.x / map.tsize); var endcol = startcol + (this.camera.width / map.tsize); var startrow = math.floor(this.camera.y / map.tsize); var endrow = startrow + (this.camera.height / map.tsize); once we have the first tile, we need to calculate how much its rendering (and therefore the rendering of the other tiles) is offset by.
... there's another demo available, that shows how to make the camera follow a character.
Bounce off the walls - Game development
we have another problem however — when the ball hits each wall it sinks into it slightly before changing direction: this is because we're calculating the collision point of the wall and the center of the ball, while we should be doing it for its circumference.
...subtracting the radius from one edge's width and adding it onto the other gives us the impression of the proper collision detection — the ball bounces off the walls as it should do.
Finishing up - Game development
let's first add a variable to store the number of lives in the same place where we declared our other variables: var lives = 3; drawing the life counter looks almost the same as drawing the score counter — add the following function to your code, below the drawscore() function: function drawlives() { ctx.font = "16px arial"; ctx.fillstyle = "#0095dd"; ctx.filltext("lives: "+lives, canvas.width-65, 20); } instead of ending the game immediately, we will decrease the number of live...
...this produces a more efficient, smoother animation loop than the older setinterval() method.
Build the brick field - Game development
rendering the brick image next, let's load the image of the brick — add the following load.image() call just below the others: function preload() { // ...
...info.offset.top; newbrick = game.add.sprite(brickx, bricky, 'brick'); game.physics.enable(newbrick, phaser.physics.arcade); newbrick.body.immovable = true; newbrick.anchor.set(0.5); bricks.add(newbrick); } } } if you reload index.html at this point, you should see the bricks printed on screen, at an even distance from one another.
Buttons - Game development
new variables we will need a variable to store a boolean value representing whether the game is currently being played or not, and another one to represent our button.
... add these lines below your other variable definitions: var playing = false; var startbutton; loading the button spritesheet we can load the button spritesheet the same way we loaded the ball's wobble animation.
Player paddle and controls - Game development
in our case the world is the same as the canvas, but for other types of games, like side-scrollers for example, the world will be bigger, and you can tinker with it to create interesting effects.
...to enable collision detection between the paddle and ball, add the collide() method to the update() function as shown: function update() { game.physics.arcade.collide(ball, paddle); } the first parameter is one of the objects we are interested in — the ball — and the second is the other one, the paddle.
Scaling - Game development
user_scale — allows you to have custom dynamic scaling, calculating the size, scale and ratio on your own; again, this is more of an advanced mode the other two lines of code in the preload() function are responsible for aligning the canvas element horizontally and vertically, so it is always centered on screen regardless of size.
...add the following line below the other three you added earlier: game.stage.backgroundcolor = '#eee'; 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've set up the scaling for our game, let's continue to the third lesson and work out how to load the assets and print them on screen.
ARIA - MDN Web Docs Glossary: Definitions of Web-related terms
aria (accessible rich internet applications) is a w3c specification for adding semantics and other metadata to html to cater to users of assistive technology.
... for example, you could add the attribute role="alert" to a <p> tag to notify a sight-challenged user that the information is important and time-sensitive (which you might otherwise convey through text color).
Block (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
for example, <p> is by default a block-level element, whereas <a> is an inline element — you can put several links next to one another in your html source and they will sit on the same line as one another in the rendered output.
... using the display property you can change whether an element displays inline or as a block (among many other options); blocks are also subject to the effects of positioning schemes and use of the position property.
CSS pixel - MDN Web Docs Glossary: Definitions of Web-related terms
the css pixel—denoted in css with the suffix px—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.
...in other words, if the user is on a phone with a pixel density of 266 dpi, and an element is placed on the screen with a width of 96px, the actual width of the element would be 266 device pixels.
Cross-site scripting - MDN Web Docs Glossary: Definitions of Web-related terms
the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content.
... learn more general knowledge cross-site scripting (xss) cross-site scripting on wikipedia cross-site scripting on owasp another article about cross-site scripting xss attack – exploit & protection ...
Entity - MDN Web Docs Glossary: Definitions of Web-related terms
entities are frequently used to display reserved characters (which would otherwise be interpreted as html code), and invisible characters (like non-breaking spaces).
... you can also use them in place of other characters that are difficult to type with a standard keyboard.
Function - MDN Web Docs Glossary: Definitions of Web-related terms
a function is a code snippet that can be called by other code or by itself, or a variable that refers to the function.
... 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 in this case).
Garbage collection - MDN Web Docs Glossary: Definitions of Web-related terms
garbage collection is a term used in computer programming to describe the process of finding and deleting objects which are no longer being referenced by other objects.
... in other words, garbage collection is the process of removing any objects which are not being used by any other objects.
Gonk - MDN Web Docs Glossary: Definitions of Web-related terms
some other parts of the hal are shared with aosp: gps, camera, and others.
...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.
Hyperlink - MDN Web Docs Glossary: Definitions of Web-related terms
hyperlinks connect webpages or data items to one another.
... 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).
ICE - MDN Web Docs Glossary: Definitions of Web-related terms
ice (interactive connectivity establishment) is a framework used by webrtc (among other technologies) for connecting two peers, regardless of network topology (usually for audio and video chat).
... this protocol lets two peers find and establish a connection with one another even though they may both be using network address translator (nat) to share a global ip address with other devices on their respective local networks.
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
in other words, an idempotent method should not have any side-effects (except for keeping statistics).
...another implication of delete being idempotent is that developers should not implement restful apis with a delete last entry functionality using the delete method.
Media (Audio-visual presentation) - MDN Web Docs Glossary: Definitions of Web-related terms
the term media (more accurately, multimedia) refers to audio, video, or combined audio-visual material such as music, recorded speech, movies, tv shows, or any other form of content that is presented over a period of time.
... more broadly, media may include still images such as photographs or other still images.
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
typically, this is a screen—but it may also be a printer, a speech synthesizer, braille display, or another type of device.
... css offers several features that allow you to tweak your document's styles—or even offer different styles—according to the media type (such as screen or print, to name two) or media capabilities (such as width, resolution, or other values) of the viewer's device.
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
another example [ step-by-step ] the following example will help you go through how javascript deals with primitives.
... javascript // the primitive let foo = 5; // defining a function that should change the primitive value function addtwo(num) { num += 2; } // another function trying to do the same thing function addtwo_v2(foo) { foo += 2; } // calling our first function while passing our primitive as an argument addtwo(foo); // getting the current primitive value console.log(foo); // 5 // trying again with our second function...
Public-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
the transformation performed by one of the keys can only be undone with the other key.
... one key (the private key) is kept secret while the other is made public.
RTP (Real-time Transport Protocol) and SRTP (Secure RTP) - MDN Web Docs Glossary: Definitions of Web-related terms
the real-time transport protocol (rtp) is a network protocol which described how to transmit various media (audio, video) from one endpoint to another in a real-time fashion.
... rtp is rarely used alone; instead, it is used in conjunction with other protocols like rtsp and sdp.
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
request headers, like accept, accept-*, or if-* allow to perform conditional requests; others like cookie, user-agent, or referer precise the context so that the server can tailor the answer.
... accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate, br referer: https://developer.mozilla.org/testpage.html connection: keep-alive upgrade-insecure-requests: 1 if-modified-since: mon, 18 jul 2016 02:36:04 gmt if-none-match: "c561c68d0ba92bbeb8b0fff2a9199f722e3a621a" cache-control: max-age=0 strictly speaking, the content-length header in this example is not a request header like the others, but an entity header: post /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 ...
Scope - MDN Web Docs Glossary: Definitions of Web-related terms
if a variable or other expression is not "in the current scope," then it is unavailable for use.
... a function serves as a closure in javascript, and thus creates a scope, so that (for example) a variable defined exclusively within the function cannot be accessed from outside the function or within other functions.
Screen reader - MDN Web Docs Glossary: Definitions of Web-related terms
desktop/laptop screen reader users navigate websites with a keyboard or other non-pointing device.
... navigation without voiceover, you can navigate through interactive elements using the tab key and the arrow keys: next interactive element: tab previous interactive element: shift + tab next radio button in a same named-group: right or down arrow previous radio button in a same named-group: left or up arrow navigating through the content of a page is done with the tab key and a series of other keys along with control + option keys next heading: control + option + h next list: control + option + x next graphic: control + option + g next table: control + option + t down an html hierarchical order control + option + right arrow previous heading: shift + control + option + h previous list: shift + control + option + x previous graphic: shift + control + option + g previous table...
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
transport layer security (tls), formerly known as secure sockets layer (ssl), is a protocol used by applications to communicate securely across a network, preventing tampering with and eavesdropping on email, web browsing, messaging, and other protocols.
...it is possible for both the client and server to mutually authenticate each other, if both parties provide their own individual digital certificates.
Type coercion - MDN Web Docs Glossary: Definitions of Web-related terms
type coercion is the automatic or implicit conversion of values from one data type to another (such as strings to numbers).
... type conversion is similar to type coercion because they both convert values from one data type to another with one key difference — type coercion is implicit whereas type conversion can be either implicit or explicit.
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
wcag uses three levels of conformance: priority 1: web developers must satisfy these requirements, otherwise it will be impossible for one or more groups to access the web content.
... priority 2: web developers should satisfy these requirements, otherwise some groups will find it difficult to access the web content.
WebIDL - MDN Web Docs Glossary: Definitions of Web-related terms
webidl is the interface description language used to describe the data types, interfaces, methods, properties, and other components which make up a web application programming interface (api).
... webidl is used in nearly every api specification for the web, and due to its standard format and syntax, the programmers who create web browsers can more easily ensure that their browsers are compatible with one another, regardless of how they choose to write the code to implement the api.
XLink - MDN Web Docs Glossary: Definitions of Web-related terms
xlink is a w3c standard which is used to describe links between xml and xml or other documents.
... xlink is used in svg, mathml, and other important standards.
Application Context - MDN Web Docs Glossary: Definitions of Web-related terms
otherwise, when the application context is created, the user agent must immediately navigate to the start url with replacement enabled.
... please note that the start url is not necessarily the value of the start_url member: the user or user agent could have changed it when the application was added to home-screen or otherwise bookmarked.
LTR (Left To Right) - MDN Web Docs Glossary: Definitions of Web-related terms
most western languages, as well as many others around the world, are written ltr.
... the opposite of ltr, rtl (right to left) is used in other common languages, including arabic (ar) and hebrew (he).
RTL (Right to Left) - MDN Web Docs Glossary: Definitions of Web-related terms
arabic (ar) is another common language written rtl.
... the opposite of rtl, ltr (left to right) is used in other languages, including english (en, en-us, en-gb, etc.), spanish (es), and french (fr).
A cool-looking box - Learn web development
objective: to test comprehension of the css box model and other box-related features such as borders and backgrounds.
...the other two should be inset box shadows — a semi-transparent white shadow near the top left and a semi-transparent black shadow near the bottom right — to add to the nice raised 3d look of the box.
Creating fancy letterheaded paper - Learn web development
objective: to test comprehension of css box model, and other box-related features such as implementing backgrounds.
... add another background declaration that just adds the top image to the top of the letter, as a fallback for browsers that don't support the previous declaration.
Attribute selectors - Learn web development
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.
... 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.
Test your skills: The Box Model - Learn web development
the box model one with the two boxes below, one is using the standard box model, the other the alternate box model.
...what can you add to your css to cause the size of the margin, padding, and border to be respected by the other lines, while still keeping the element inline?
Test your skills: sizing - Learn web development
task two this task has a box, which contains another box.
...one image is smaller than the box, the other is larger and breaking out of the box.
Test your skills: Flexbox - Learn web development
try updating the live code below to recreate the finished example: additional questions: can you now make the first item twice the size of the other items?
... flex layout three there are two elements in the html below, a div with a class of .parent which contains another div with a class of .child.
Multiple-column layout - Learn web development
there is no way to make one column bigger than other columns, or to change the background or text color of a single column.
... summary you now know how to use the basic features of multiple-column layout, another tool at your disposal when choosing a layout method for the designs you are building.
How CSS works - Learn web development
the nodes are defined by their relationship to other dom nodes.
...all of the other css have been applied however; only the invalid line is ignored.
CSS first steps - Learn web development
css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
... note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
create fancy boxes - Learn web development
they are stacked on top of each other like layers.
...i want to be fancy.</div> okay, let's have fun with backgrounds: .fancy { padding : 1em; width: 100%; height: 200px; box-sizing: border-box; /* at the bottom of our background stack, let's have a misty grey solid color */ background-color: #e4e4d9; /* we stack linear gradients on top of each other to create our color strip effect.
Typesetting a community school homepage - Learn web development
project brief you have been provided with some raw html for the homepage of an imaginary community college, plus some css that styles the page into a three column layout and provides some other rudimentary styling.
... give your headings and other element types appropriate font-sizes defined using a suitable relative unit.
What is a Domain Name? - Learn web development
you can renew your right, and your renewal has priority over other people's applications.
... on the other hand, let's see if i could register afunkydomainname.org: $ whois afunkydomainname.org not found as you can see, the domain does not exist in the whois database (at the time of writing), so we could ask to register it.
How do you set up a local testing server? - Learn web development
in contrast, if you view one of our examples hosted on github (or an example on some other remote server), the web address will start with http:// or https://, to show that the file has been received via http.
... note: if you already have something running on port 8000, you can choose another port by running the server command followed by an alternative port number, e.g.
Getting started with the Web - Learn web development
you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there.
...when you're building a website, you need to assemble these files into a sensible structure and make sure they can talk to one another.
Add a hitmap on top of an image - Learn web development
an image map, on the other hand, contains several active regions (called "hotspots") that each link to a different resource.
...(a default <area> occupies the entire image, minus any other hotspots you’ve defined.) the shape you choose determines the coordinate information you’ll need to provide in coords.
Define terms with HTML - Learn web development
note that <dfn> tags go around the word to be defined, not the definition (the definition consists of the entire paragraph): <p><dfn>firefox</dfn> is the web browser created by the mozilla foundation.</p> another use for bold is to emphasize content.
...in other words, there's an implicit relationship between the <dfn> element and its container.
Structuring a page of content - Learn web development
you need to add a suitable wrapper for: the header the navigation menu the main content the welcome text the image sidebar the footer you should also: apply the provided css to the page by adding another <link> element just below the existing one provided at the start.
... hints and tips use the w3c nu html checker to catch unintended mistakes in your html, css, and svg — mistakes you might have otherwise missed — so that you can fix them.
Adding vector graphics to the Web - Learn web development
so embedding an svg document with an <iframe> is done just like we studied in from <object> to <iframe> — other embedding technologies.
...you can also go to the svg element reference, find out more details about other toys you can use in svg, and try those out too.
Responsive images - Learn web development
previous overview: multimedia and embedding next in this article, we'll learn about the concept of responsive images — images that work well on devices with widely differing screen sizes, resolutions, and other such features — and look at what tools html provides to help implement them.
... in all cases, you must provide an <img> element, with src and alt, right before </picture>, otherwise no images will appear.
Asynchronous JavaScript - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch.
...you should understand these concepts before working through the other articles in the module.
Silly story generator - Learn web development
will generate another random silly story if you press the button again (and again...) the following screenshot shows an example of what the finished program should output: to give you more of an idea, have a look at the finished example (no peeking at the source code!) steps to complete the following sections describe what you need to do.
... inside the first if block, add another string replacement method call to replace the name 'bob' found in the newstory string with the name variable.
Test your skills: Math - Learn web development
add the first two variables together and store the result in another variable.
... subtract the fourth variable from the third and store the result in another variable.
Adding features to our bouncing balls demo - Learn web development
you might want to add another circle to the app later on that can be controlled by another player, or have several computer-controlled evil circles.
...again, you can mostly just copy the ball.prototype.update definition, but there are a few changes you should make: get rid of the last two lines — we don't want to automatically update the evil circle's position on every frame, because we will be moving it in some other way, as you'll see below.
Introducing JavaScript objects - Learn web development
note: if you are working on a computer/tablet/other devices where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... 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.
Multimedia: Images - Learn web development
other formats improve on jpeg's capabilities in regards to compression, but are not available on every browser: webp — created by google and nowadays supported by all major browsers except safari.
...these also allow you to add in an animated webp for all other modern browsers.
What is web performance? - Learn web development
this tends to be affected by latency, how big your files are, how many files there are, and other factors besides.
...any other assets can continue to load in the background while the user gets on with primary tasks, and sometimes we only load assets when they are actually needed (this is called lazy loading).
The business case for web performance - Learn web development
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.
... setting converstion rate, time on site, and/or net promotion scores as kpis give financial and other business goal value to the web performance efforts, and get help boost buy in, with metrics to prove the efforts worth.
Web performance - Learn web development
these perceptions are impacted by actual page load time, idling, responsiveness to user interaction, and the smoothness of scrolling and other animations.
... css performance features css may be a less important optimization focus for improved performance, but there are some css features that impact performance more than others.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
the todo/todos plural problem the above is fine, but we have another small issue to contend with.
... note that this is the block form of if in ember; you could also use the the inline form: {{if this.todos.todocountisone "todo" "todos"}} completing todos as with the other components, we need a class to access the service.
Ember app structure and componentization - Learn web development
testing is outside the scope of this tutorial, although generally testing should be implemented as you develop, rather than after, otherwise it tends to be forgotten about.
... before we start adding any component code, let’s create the scaffolding for the other components.
Starting our Svelte Todo list app - Learn web development
objective: to learn how to create a svelte component, render it inside another component, pass data into it using props, and save its state.
... if (warning.code === 'a11y-missing-attribute') return; // let rollup handle all other warnings normally handler(warning); } }), ...
Tools and testing - Learn web development
in most cases there are other tools available, old ones will go out of fashion, and new ones will no doubt appear.
... git and github all developers will use some kind of version control system (vcs), 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.
Accessibility Features in Firefox
you can furthermore control javascript capabilities to remove scrollbars, toolbars or system buttons like minimize, close and maximize by editing the about:config related properties or by editing accordingly the user.js file as explained in this "disable other javascript window features" document.
... here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this information): adblock plus removes ads (and other objects, like banners) from web pages greasemonkey lets you add bits of javascript ("user scripts") to any web page to change its behavior.
Accessibility and Mozilla
accessibility is the idea that software (among other things) should be designed to be usable and, as much as possible, convenient to use for people with disabilities.
...since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night.information for governments and other organizations evaluating mozillainformation for usersfirefox 2 now has help topics (from the menubar: ?
Adding phishing protection data providers
browser.safebrowsing.provider.idnum.keyurl an url that returns a private key to be used for encrypting of other requests.
... browser.safebrowsing.provider.idnum.reportgenericurl not currently used; intended for use in reporting other issues with the phishing protection service.
Benchmarking
another option that is on by default in non-release builds is the preference javascript.options.asyncstack, which provides better debugging information to developers.
... timer precision firefox reduces the precision of the performance apis and other clock and timer apis accessible to web content.
Creating a spell check dictionary add-on
ml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>locale-code@dictionaries.addons.mozilla.org</em:id> <em:version>version number</em:version> <em:type>64</em:type> <em:unpack>true</em:unpack> <em:name>name</em:name> <!-- other install.rdf metadata such as em:localized, em:description, em:creator, em:developer, em:translator, em:contributor or em:homepageurl --> <!-- firefox --> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>18.0a1</em:minversion> <em:maxversion>46.0</em:maxversion> </description> ...
...cription> </rdf> there are some rules about how you should adapt the install.rdf file: if you are creating a new dictionary add-on, we recommend that the em:id consists of your locale code followed by @dictionaries.addons.mozilla.org, but if there is more than one dictionary for your language (for example the german "old spelling" versus "new spelling" dictionaries), you may need to choose another id, that follows the rules of em:id.
Debugging Frame Reflow
other reflow reasons are: incremental reflow resize reflow style change reflow dirty reflow the available width is 9180 twips.
...other reflow debug options gecko_display_reflow_flag_pixel_errors setting this option via set gecko_display_reflow_flag_pixel_errors = 1 enables a verification for each coordinate value that the coordinates are aligned at pixel boundaries.
HTTP logging
other bugs may require all the logs to be uploaded--ask the developer if you're not sure.
... 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.
Simple SeaMonkey build
run these commands to install the other build tools: sudo port sync sudo port install mercurial libidl autoconf213 yasm problems?
...# on windows, be sure to use mozmake instead of make, otherwise parallel building will break.
Creating Custom Events That Can Pass Data
for example, if you want firefox to perform an action whenever something happens (i.e., something other than the standard mouse/keyboard events) and, depending on the data passed along with this event, you want firefox to react differently.
...however, here you want to put the other part of the name (e.g.
Reviewer Checklist
following these best practices will lead to a smoother, more rapid process of review and acceptance.
... [fennec: if your custom view does animations, it's better to clean up runnables in ondetachfromwindow().] ensure all file handles and other closeable resources are closed appropriately.
Cross Process Object Wrappers
this makes the cpow call much safer than it would otherwise be.
...all other uses of cpows are called "unsafe cpow usage".
Limitations of chrome scripts
this is one of a pair of articles: the other one lists limitations of frame scripts.
... also note that unlike other shims, this shim is always active.
Frame script loading and lifetime
there is currently no way to unload them when loaded, other than closing the tab they were loaded into.
...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.
Tracking Protection
sometimes users won’t notice at all, if the page grid works such that other page elements slide in to fill holes left by blocked elements.
... most obviously, it means that when tracking protection is enabled: content served from third-party trackers will not be visible to users your site won't be able to use third-party advertising or analytics services that engage in tracking more subtly, if other parts of your site depend on trackers being loaded, then these parts will also be broken when tracking protection is enabled.
Firefox UI considerations for web developers
otherwise, bitmapped icons which are at least 96 pixels wide are considered.
...otherwise, the smallest image larger than 96 pixels wide is selected.
MozBeforePaint
gecko 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.
... this allows multiple animations to remain in sync with one another within the context of a given window.
Chrome-only Events reference
this page lists events that are only available in gecko chrome code (and sometimes in other privileged circumstances, eg.
... 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
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.
Embedding Tips
this is recommended if you intend anything other than the uri or document your browser is looking at.
...for example, if you wanted to check the server response headers, you might check onstatechange for state_start | state_is_request flags, and from the nsirequest argument qi fornsihttpchanne and call methods on that to determine response codes and other information from the server.
Roll your own browser: An embedding how-to
other initialization must be done to start up event queues and load some string bundles.
...ns_initembedding() must be called from the main thread of your application, otherwise it won't work.
Gecko SDK
in addition to the below versions, you can find other versions (including beta) here: xulrunner releases (files include "sdk" in the name).
...wnload mac x86_64 download n/a n/a n/a n/a mac i386 download download download download n/a mac ppc n/a download download download download linux x86_64 download n/a n/a n/a n/a linux i686 download download download download download the sdk is not officially released for other platforms; if you need it, you will probably need to build it yourself.
How Mozilla determines MIME Types
the first few bytes of the file) is searched for embedded nulls; if none are found, text/plain will be used, otherwise application/octet-stream.
...note that the extension here comes from the content-disposition header if present, and from the url itself otherwise.
How to get a stacktrace with WinDbg
(to get a stacktrace for thunderbird or some other product, substitute the product name where ever you see firefox in this instructions.) requirements to get such a stacktrace you need to install the following software: debugging tools for windows microsoft distributes the debugging tools for windows for free, those include windbg which you will need here.
... .logopen /t c:\temp\firefox-debug.log .childdbg 1 .tlist sxn gp lm if you see firefox.exe listed in the output from .tlist more than once, then you are already running the application and need to close the running instance first before you start debugging, otherwise you won't get useful results.
Extending a Protocol
to dom/base/navigator.h, let's add the following method and member, along with the other members.
... so, essentially, the stuff to add in bold: // find this: namespace mozilla { namespace dom { // add: class echochild; // make this private: echochild* getechochild(errorresult& arv); // other stuff already in the file...
Implementing QueryInterface
calling an inherited queryinterface sometimes you are just adding one or two new interfaces to an implementation that already supports many other interfaces.
...in other cases macros may help some people but often cloud the issues for others.
Implementing Download Resuming
this document describes how an embedder or other gecko/necko-using application can implement download resuming.
...otherwise, call resumeat with the desired start position, and the previously stored entity id.
JavaScript Tips
var uniquename = { _privatemember: 3, publicmember: "a string", init: function() { this.dosomething(this.anothermember); }, dosomething: function(aparam) { alert(aparam); } }; xpconnect don't use object methods and properties more than you have to.
... xul also maps other useful properties and methods using xbl bindings; these vary from element to element.
Add-on Repository
a new search will immediately fail if the addonrepository is already handling another search request.
... issearching boolean true if a search is currently in progress; otherwise false.
AsyncShutdown.jsm
if condition is not a function but another value v, it behaves as if it were a function returning v.
... return value returns true if a blocker has been removed, or false otherwise.
DeferredTask.jsm
with deferredtask, the task is delayed by a few milliseconds and, should a new change to the data occur during this period, only the final version of the data is actually written; a further grace delay is added to take into account other changes.
... bool ispending(); return value returns true if pending, false otherwise.
Interfacing with the Add-on Repository
the most common cause of failure (other than the search url preference being incorrect) is if there is already a pending request, since only one request can be in progress at a time.
...otherwise, the addoninstall object's install() method is called to install the add-on.
Following the Android Toasts Tutorial from a JNI Perspective
when declaring methods, the signatures of the types go right next to each other without any spacing.
... let sig = { context: 'landroid/content/context;', charsequence; 'ljava/lang/charsequence;', int: 'i', toast: 'landroid/widget/toast;', void: 'v', }; get java environment before we go on to declare the other important features, we need to load our environment variable.
Log.jsm
error other runtime errors or unexpected conditions.
... warn use of deprecated apis, poor use of api, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong".
PopupNotifications.jsm
nevershow notifications with this parameter set to true will be removed when they would have otherwise been dismissed (i.e.
... removeondismissal notifications with this parameter set to true will be removed when they would have otherwise been dismissed (that is, any time the popup is closed due to user interaction).
SourceMap.jsm
chunk: a string snippet of generated js code, another instance of sourcenode, or an array where each member is one of those things.
... chunk: a string snippet of generated js code, another instance of sourcenode, or an array where each member is one of those things.
Application Translation with Mercurial
this can be done in a text editor or word processor or any other tool in which you can attach different kind of states to the individual texts to translate.
...other localizers will likely have done changes to the translation, either adding new texts, removing obsolete ones or improving the current texts.
L10n Checks
the file names will be shown in a hierarchical form, so in the example above, your files are browser.dtd in ab-cd/browser/chrome/browser and migration.dtd in another directory level deeper.
...pl browser/locales/l10n.ini ../l10n/ de output mode you can change the look and feel of the output by setting the -o parameter to 0 (tree; default), 1 (full tree) or 2 (full relative paths), e.g.: check-l10n-completeness -o 2 browser/locales/l10n.ini ../l10n/ de en-us in the locale directory in the source mode you can tell l10n checks to look for the en-us locale in the directory containing all other locales instead of the directory containing the source by setting the -l parameter (useful for e.g.
Localizing extension descriptions
this article provides details on how to go about localizing the descriptions of mozilla add-ons, as well as for other metadata about your add-on.
... localizing in gecko 1.9 gecko 1.9 includes a new, more robust method for localizing add-on descriptions and other metadata.
Translation phase
add-ons l10n for add-ons is handled by at least two other organizations/services called babelzilla and adofex.
...do you prefer unicode text editors to any other applications on earth?
Localization technical reviews
here is some of the criteria we use to perform technical reviews: revision attachment contains only relevant files we run into exports that contain .xpi langpacks and other random files.
...once they are fixed, push your fix to your repo, attach it to the corresponding bug using the same mercurial revision number as before, and then request another review.
Extras
other renderers are expected to ignore attributes that they don't understand while the behavior of undefined elements is well, undefined.
...> <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> </p> css content math.cue *[title] { color: blue; } mixing with other markups html content <math display="block"> <mrow> <mi>a</mi> <mo>=</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext> <img width="16" height="16" src="https://udn.realityripple.com/samples/3f/9341cbddc0.png" alt="mozilla-16" /> </mtext> </mtd> </mtr> <mtr> <mtd> <mtext><input value="type" size="4"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </m...
Fonts for Mozilla 2.0's MathML engine
on android, firefox os and other platforms where the instructions above do not work: install the mathml-fonts add-on.
...for other characters, mozilla has font-specific support.
MathML3Testsuite
this exception also holds for obsolete features (such as macro, mode etc) or for other undefined behaviors (attribute href for example).
...ocks symbols variants entitynames numericrefs utf8 general clipboard genattribs math presentation css dynamicexpressions generallayout scriptsandlimits tablesandmatrices tokenelements topics accents bidi elementarymathexamples embellishedop largeop linebreak nesting stretchychars whitespace torturetests errorhandling original document information author(s): frédéric wang other contributors: last updated date: may 26, 2010 copyright information: portions of this content are © 2010 by individual mozilla.org contributors; content available under a creative commons license | details.
MathML In Action
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".
... addeventlistener("click", zoomtoggle, false); } window.addeventlistener("load", load, false); consider an interesting markup like this { u t + f ( u ) x = 0 u ( 0 , x ) = { u - if x < 0 u + if x > 0 or other complex markups like these ell ^ y ( z ; z , τ ) := ∫ y ( ∏ l ( y l 2 π i ) θ ( y l 2 π i - z ) θ ′ ( 0 ) θ ( - z ) θ ( y l 2 π i ) ) × ( ∏ k θ ( e k 2 π i - ( α k + 1 ) z ) θ ( - z ) θ ( e k 2 π i - z ) θ ( - ( α k + 1 ) z ) ) π ( n ) = ∑ m = 2 n ⌊ ( ∑ k = 1 m - 1 ⌊ ( m / k ...
Mozilla MathML Status
other elements element [- attribute] notes mglyph not implemented.
... original document information author(s): frédéric wang other contributors: copyright information: portions of this content are © 2010 by individual mozilla.org contributors; content available under a creative commons license | details.
MathML Demo: <mtable> - tables and matrices
this would be pretty hard to obtain otherwise.
...here 'a' and 'b' can be other combinations of possibly irregular boxes.
Mozilla MathML Project
the mozilla mathml project is mozilla's project to build and enhance mathml support within firefox and other mozilla-based applications.
...sidje other contributors: frédéric wang last updated date: april 4, 2010 copyright information: portions of this content are © 1999–2010 by individual mozilla.org contributors; content available under a creative commons license | details.
Mozilla Development Tools
earlier releases and other products use the cvs version control system.
...it lets developers and others edit pages on the mozilla.org web site without having to use cvs.
Activity Monitor, Battery Status Menu and top
activity monitor can be useful for cursory measurements, but for more precise and detailed measurements other tools such as powermetrics are better.
... systemstats is a program that runs continuously and periodically measures, among other things, cpu usage and idle wakeups for each running process.
BloatView
if it isn't, you should use the other tools to fix it.
... to do so, the xpcom_mem_log_classes environment variable should be set to the name of the class from the bloatview table: xpcom_mem_log_classes=myclass mach mochitest [options] multiple class names can be specified by setting xpcom_mem_log_classes to a comma-separated list of names: xpcom_mem_log_classes=myclass,myotherclass,deliberatelyleakedclass mach mochitest [options] test harness scripts typically accept a --setenv option for specifying environment variables, which may be more convenient in some cases: mach mochitest --setenv=xpcom_mem_log_classes=myclass [options] for getting allocation stacks in automation, you can add the appropriate --setenv options to the test configurations for the platforms you'r...
Intel Power Gadget
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.
...the api is otherwise unlikely to be of interest to mozilla developers.
TimerFirings logging
2088737280[7f606bf68140]: [30710] fn timer (one_shot 16 ms): [from dladdr] #0: ???[/home/njn/moz/mi1/o64/dist/bin/libxul.so +0x2144f94] 2088737280[7f606bf68140]: [30710] fn timer (one_shot 16 ms): [from dladdr] #0: mozilla::refreshdrivertimer::timertick(nsitimer*, void*) (/home/njn/moz/mi1/o64/layout/b third, on other platforms dladdr is not implemented or doesn't work well, and the output will look like the followin.
... if an unannotated timer function appears frequently it is worth explicitly annotating it so that it will be usefully identified on other platforms.
Performance
it also lets you do other memory-related operations like trigger gc and cc, dump gc & cc logs, and dump dmd reports.
...that log can then be replayed against firefox's default memory allocator independently or through another replace-malloc library, allowing the testing of other allocators under the exact same workload.
Phishing: a short definition
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.
... another solution is to strengthen logins with pictures, or colored words, often chosen when signing up for a service.
browser.urlbar.formatting.enabled
the preference browser.urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.
... type:boolean default value: true exists by default: yes application support:firefox 6.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-05-03 bugs: bug 451833 values true (default) the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.
Productization guide
another example: when the user clicks on a mailto: link, we suggest a couple of possible handlers chosen from the applications installed on their computer.
...the second purpose (demonstrate certain features of the product) is equally important: by providing these default services, we demonstrate particular features of the product, the ones which otherwise wouldn’t be as discoverable.
McCoy
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 data or move it from one machine to another you need to take a copy of the profile folder.
NSPR's Position On Abrupt Thread Termination
threads run within the confines of a process (or similar abstractions in other environments).
...but what percentage of c programs actually bother?
Anonymous 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.
...use one or the other; don't mix and match.
Dynamic Library Linking
it also provides a method by which to condition symbols of statically linked code so that to other clients it appears as though they are dynamically loaded.
...you can then call pr_findsymbol on lib to look up other symbols defined in the main program.
PRFileType
syntax #include <prio.h> typedef enum prfiletype{ pr_file_file = 1, pr_file_directory = 2, pr_file_other = 3 } prfiletype; enumerators the enumeration has the following enumerators: pr_file_file the information in the structure describes a file.
... pr_file_other the information in the structure describes some other kind of file system object.
PR_GetRandomNoise
produces a random value for use as a seed value for another random number generator.
... pr_getrandomnoise is intended to provide a "seed" value for a another random number generator that may be suitable for cryptographic operations.
PR_NormalizeTime
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.
... to convert from one time zone to another.
PR_Open
it is ignored by any other platform but it may apply to other platforms in the future.
... pr_irwxg 0070 read, write, execute/search by group pr_irgrp 0040 read permission, group pr_iwgrp 0020 write permission, group pr_ixgrp 0010 execute/search permission, group pr_irwxo 0007 read, write, execute/search by others pr_iroth 0004 read permission, others pr_iwoth 0002 write permission, others pr_ixoth 0001 execute/search permission, others returns the function returns one of the following values: if the file is successfully opened, a pointer to a dynamically allocated prfiledesc for the newly opened file.
PR_SetErrorText
otherwise the text is assumed to be the length specified and to possibly include null characters (as might occur in a multilingual string).
...the new value is copied into storage allocated and owned by nspr and remains there until the next call to pr_seterror or another call to pr_seterrortext.
PR_WaitCondVar
after a call to pr_waitcondvar, the lock is released and the thread is blocked in a "waiting on condition" state until another thread notifies the condition or a caller-specified amount of time expires.
... any value other than pr_interval_no_timeout or pr_interval_no_wait for the timeout parameter will cause the thread to be rescheduled due to either explicit notification or the expiration of the specified interval.
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?
...you can start with: the current primary nss documentation page from which we link to other documentation.
JSS Provider Notes
messagedigest operations take place by default on the internal crypto token, another internal software token in jss/nss.
...in this case, the key should be wrapped (encrypted with another key), and then the encrypted key might be extractable from the token.
Mozilla-JSS JCA Provider notes
messagedigest operations take place by default on the internal crypto token, another internal software token in jss/nss.
...in this case, the key should be wrapped (encrypted with another key), and then the encrypted key might be extractable from the token.
NSS 3.12.9 release notes
ent j-pake in freebl bug 607058: crash [@ nss_cms_decoder_work_data] bug 613394: november/december 2010 batch of nss root ca changes bug 610843: need way to recover softoken in child after fork() bug 617492: add pk11_keygenwithtemplate function to pk11wrap (for firefox sync) bug 610162: sha-512 and sha-384 hashes are incorrect for inputs of 512mb or larger when running under windows and other 32-bit platforms (fx 3.6.12 and 4.0b6) bug 518551: vfychain crashes in pkits tests.
... bug 596798: win_rand.c (among others) uses unsafe _snwprintf bug 597622: do not use the sec_error_bad_info_access_location error code for bad crl distribution point urls bug 619268: memory leaks in cert_changecerttrust and cert_savesmimeprofile bug 585518: addtrust qualified ca root serial wrong in certdata.txt trust entry bug 337433: need cert_findcertbynicknameoremailaddrbyusage bug 592939: expired cas in certdata.txt documentation <for a="" class="new " documentation="" href="/en/index.html...
NSS_3.12_release_notes.html
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 nss 3.12 3 new shared library are shipped with nss 3.12: nssutil sqlite nssdbm 1 new include file is shipped with nss3.12: utilrename.h new functions in the nss shared library: cert_checknamespace (see cert.h) cert_encodecertpoliciesextension (see cert.h) cert_encodeinfoaccessextension (see cert.h) cert_encodeinhibitanyextension (see cert.h) cert_encodeno...
...bug 337088: coverity 405, pk11_paramtoalgid() in mozilla/security/nss/lib/pk11wrap/pk11mech.c bug 339907: oaep_xor_with_h1 allocates and leaks sha1cx bug 341122: coverity 633 sftk_destroyslotdata uses slot->slotlock then checks it for null bug 351140: coverity 995, potential crash in ecgroup_fromnameandhex bug 362278: lib/util includes header files from other nss directories bug 228190: remove unnecessary nss_enable_ecc defines from manifest.mn bug 412906: remove sha.c and sha.h from lib/freebl bug 353543: valgrind uninitialized memory read in nsspkiobjectcollection_addinstances bug 377548: nss qa test program certutil's default dsa prime is only 512 bits bug 333405: item cleanup is unused deadcode in secitem_allocitem loser bug 288730: compiler warni...
NSS 3.15 release notes
in secpkcs7.h sec_pkcs7verifydetachedsignatureattime - verifies a pkcs#7 signature at a specific time other than the present time.
... bug 554369: fixed correctness of cert_cacheocspresponsefromsidechannel and other ocsp caching behaviour.
NSS 3.17.2 release notes
this is a patch release to fix a regression and other bugs.
...this fixes a regression introduced in nss 3.16.2 that prevented nss from importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
NSS 3.24 release notes
new functions in ssl.h ssl_configservercert - configures an ssl/tls socket with a certificate, private key, and other information.
... notable changes in nss 3.24 additions, deprecations, and other changes in nss 3.24 are listed below.
NSS 3.35 release notes
if nss is initialized, in read-write mode with a database directory provided, it uses database files to store certificates, key, trust, and other information.
... this makes it clearer, that options can have values other than 0 or 1.
NSS Sample Code Sample_1_Hashing
this is an example program that demonstrates how to compute the hash of a file and save it to another file.
... */ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_destroy(hashcontext); return secsuccess; } /* * this sample computes the hash of a file and saves it * to another file.
Hashing - sample 1
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.
... */ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_destroy(hashcontext); return secsuccess; } /* * this sample computes the hash of a file and saves it * to another file.
sample1
a program to compute the hash of a file and save it to another file.
... */ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_destroy(hashcontext); return secsuccess; } /* * this sample computes the hash of a file and saves it to another file.
nss tech note2
for example, to log the softoken, use: nss_debug_pkcs11_module="nss internal pkcs #11 module" note: in the command prompt on windows, do not quote the name of the target module, otherwise the quotes are considered part of the name.
...otherwise, the output will be written to stdout.
nss tech note6
on the 32-bit solaris sparc architecture, there are 3 freebl libraries : libfreebl_32int64_3.so for ultrasparc t1 cpus, with a corresponding libfreebl_32int64_3.chk libfreebl_32fpu_3.so for other ultrasparc cpus, with a corresponding libfreebl_32fpu_3.chk libfreebl_32int_3.so for sparc v8 cpus, with a corresponding libfreebl_32int_3.chk on the 64-bit solaris sparc architecture, there are 2 freebl libraries : libfreebl_64int_3.so for ultrasparc t1 cpus, with a corresponding libfreebl_64int_3.chk libfreebl_64fpu_3.so for other ultrasparc cpus, with a corresponding libfreebl_64fpu_3.chk o...
...n the 32-bit hp-ux pa-risc architecture, there are 2 freebl libraries : libfreebl_32fpu_3.sl for cpus that do multiply operations faster in floating point, with a corresponding libfreebl_32fpu_3.chk libfreebl_32int_3.sl for other pa-risc cpus, with a corresponding libfreebl_32int_3.chk on the 64-bit hp-ux pa-risc architecture, there is only one freebl library, called libfreebl3.sl, with a corresponding libfreebl3.chk applications should always use nss binaries that are the output of the regular nss build process.
nss tech note8
a sid (or sslsessionid struct) contains all the info needed to restart the ssl session at a later time on another socket.
...as originally designed, before calling the cache function, the caller was responsible to fill in the session creation time (which might not be the same as the time of insertion into the cache) and the session expiration time, among other things.
NSS Tools sslstrength
for example, ciphers=bfi will turn on these cipher preferences and turn off all others.
... other for references, here is a table of well-known ssl port numbers: https 443 imaps 993 nntps 563 ...
Notes on TLS - SSL 3.0 Intolerant Servers
there might be servers other than those listed above which exhibit this problem.
...there will be other network clients which implement tls/ssl 3.0 specification correctly and have a problem with your site.
NSS PKCS11 Functions
once the the module has been successfully loaded, other nss calls will use it in the normal course of searching.
...otherwise, pr_false.
troubleshoot.html
the current workaround is to use some other shell in place of shmsdos, such as sh.exe, which should be distributed with the cygnus toolkit you installed to build nss.
... cd c:/programs/cygnus/bin (or wherever your gnu tools are installed) cp shmsdos.exe shmsdos.bak (backup shmsdos) cp sh.exe shmsdos.exe (substitute alternative shell) making this change will probably break other builds you are making on the same machine.
sslcrt.html
the only character that needs to be escaped in this is ], all others are not special.
... [a-z] matches any character between a and z [^az] matches any character except a or z ~ followed by another shell expression removes any pattern matching the shell expression from the match list (foo|bar) matches either the substring foo or the substring bar.
NSS Tools sslstrength
for example, ciphers=bfi will turn on these cipher preferences and turn off all others.
... other for references, here is a table of well-known ssl port numbers: https 443 imaps 993 nntps 563 ...
Network Security Services
applications built with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards.
... tools, testing, and other technical details build instructions for nss describe how to check out and build nss releases.
Necko Architecture
architecture after a few iterations of our original design, the current necko architecture looks something like this: urls necko's primary responsibility is moving data from one location, to another location.
...because a uri has no self knowledge about what "protocol" it represents, another component is responsible for deciding which channel implementation will be responsible for "loading" the uri.
Multithreading in Necko
in the future, necko may be made thread safe to support changes to gecko that would put some other processing work on background threads (eg.
...once at the limit of its buffers, it yields the thread to another pending file transport object.
Proxies in Necko
otherwise, the proxy info is discarded.
...however, socks is transparent to upper-level protocols, and can transport any other tcp- or udp-based protocol.
Installing Pork
to tell mcpp which gcc installation to integrate itself with, place the selected gcc bin dir as the first element of your path: path=/bindir/of/my/gcc:$path if you want to use a gcc that has binaries named something other than "gcc" and "g++", or you use "ccache" for you main gcc installation and want mcpp to override a separate installation, you need to pass the options "cc=gccxxx cxx=g++xxx" to "./configure".
...c++ files from other projects can be preprocessed with gcc -e -wp,-w0,-k.
Rhino license
* * - 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.
...the copyright owner or * contributors be liable for any direct, indirect, incidental, special, * exemplary, or consequential damages (including, but not limited to, * procurement of substitute goods or services; loss of use, data, or * profits; or business interruption) however caused and on any theory of * liability, whether in contract, strict liability, or tort (including * negligence or otherwise) arising in any way out of the use of this * software, even if advised of the possibility of such damage.
The JavaScript Runtime
the behavior of the javascript engine is undefined if a value of any type other than the ones described above is introduced into javascript.
... if the services provided by defineclass are insufficient, try other methods of scriptableobject and functionobject, such as defineproperty and definefunctionproperties.
Rhino scopes and contexts
you can create a scope using one context and then evaluate a script using that scope and another context (either by exiting the current context and entering another, or by executing on a different thread).
...in addition if a script alters some of the standard objects, the library may not work properly for other scripts.
Creating JavaScript jstest reftests
if tests for the new feature proposal do not yet exist in test262 (they might!), contributing to test262 will allow all other javascript implementors to use your tests as well.
...for example, reportcompare sometimes considers numbers to be the same if they are "close enough" to each other, even if the == operator would return false.
Creating JavaScript tests
jit-test new jit-test files should be put in js/src/jit-test/tests/basic or one of the other appropriate subdirectories of jit-test/tests.
... checking in completed tests tests are usually reviewed and pushed just like any other code change.
Getting SpiderMonkey source code
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 the cvs server first.
How to embed the JavaScript engine
# if you're using version other than spidermonkey 31, please change -lmozjs-xx to your version.
... make sure the build computer has the prerequisites for building spidermonkey: linux, windows, mac os x, others.
JS::Rooted
t &operator=(const rooted &value) void set(t value) bool operator!=(const t &other) const compares ptr and other.
... bool operator==(const t &other) const description js::rooted<t> declares a local variable of type t whose value is always rooted.
JSExtendedClass
if non-null, an object of this class may serve as a wrapper for another object.
...(this is a feature of the c and c++ languages.) otherwise, use memset.
JSExtendedClass.wrappedObject
this article covers features introduced in spidermonkey 1.8 callback for objects that wrap other objects.
... a wrapper object that wraps an array is considered an array for the purpose of array.prototype.concat and array.concat (which treat array arguments differently from other arguments, per ecma 262-3 §15.4.4.4).
JSObject
an object inherits properties, including methods, from its prototype (which is another object).
...an object's parent is another object, usually either the global object or an object that represents an activation record.
JSObjectOps.dropProperty
while the property is locked, the caller may access it using other jsobjectops callbacks.
... it may not otherwise call into the jsapi in ways that might trigger other property accesses.
JSResolveOp
the callback must set *resolvedp to true and return true if the property is resolved, or set *resolvedp to false and return true if the object has no lazy property with the given id; or return false to indicate any other error.
... obsolete since jsapi 36 the callback must return true if the property is resolved, or if the object has no lazy property with the given id; or false to indicate any other error.
JSRuntime
the jsruntime is the universe in which javascript objects live; they can't travel to other jsruntimes.
... earlier versions allowed using js_clearcontextthread and other functions to move a jscontext from one thread to another.
JSVAL_TO_INT
if v is any other type of value, the result is unspecified.
...the jsval encoding of the integer 4, for instance, is not ((jsval) 4) but some other pattern of bits.
JS_AlreadyHasOwnProperty
by design, this search may not find a property that other property lookup functions, such as js_lookupproperty, would find.
...*foundp is set to true only if lookupproperty reports that the property was found on obj itself and not on some other object (even the corresponding outer object, if any).
JS_CallFunction
otherwise it returns false, and rval is undefined.
...passing any other jsfunction pointer can lead to a crash or worse.
JS_ConstructObject
otherwise, the first argc elements of this array must be populated with valid jsval values.
...otherwise it returns null.
JS_DecompileScript
otherwise, it returns the original source code of the script.
...otherwise, it returns a string containing "[no source]".
JS_DeleteElement2
on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise.
...otherwise it returns false and the value of *succeeded is undefined.
JS_EncodeCharacters
otherwise each character is simply truncated to 8 bits.
...otherwise it reports an error and returns js_false.
JS_ErrorFromException
other contexts in the same runtime can have their own error reporting functions.
...otherwise, it returns nullptr.
JS_ExecuteScriptVersion
otherwise obj is used.
...otherwise it returns false, and the value left in *rval is unspecified.
JS_ForgetLocalRoot
in case a native hook allocates many objects or other gc-things, but the native protects some of those gc-things by storing them as property values in an object that is itself protected, the hook can call js_forgetlocalroot to free the local root automatically pushed for the now-protected gc-thing.
...calling it successively on other than the most recently allocated gc-thing will tend to average the time inefficiency, and may risk o(n2) growth rate, but in any event, you shouldn't allocate too many local roots if you can root as you go (build a tree of objects from the top down, forgetting each latest-allocated gc-thing immediately upon linking it to its parent).
JS_GetFunctionObject
in other cases, the object returned by js_getfunctionobject is not necessarily safe to call and should not be exposed to script.
... however, for other functions, and particularly for javascript closures, many jsobjects may share the same jsfunction.
JS_GetProperty
otherwise the property is found on a native object.
...otherwise *vp is set to the property's stored value, or undefined if the property does not have a stored value, and then the property's getter is called with the arguments (cx, obj, id, vp).
JS_GetScopeChain
otherwise, if cx has a global object, js_getscopechain returns that.
... otherwise, an error is reported and js_getscopechain returns null.
JS_Init
once this method has succeeded, it is safe to call js_newruntime and other jsapi methods.
... this method must be called before any other jsapi method is used on any thread.
JS_InstanceOf
js_instanceof returns true if obj is of the given class and false otherwise.
...otherwise, it returns false; it also reports a typeerror containing the function's name.
JS_IsExtensible
receives true if extensible, false otherwise.
...if successful, js_isextensible stores [[extensible]] property to *extensible and returns true, otherwise returns false and the value of *extensible is undefined.
JS_LookupProperty
otherwise, flags must be the logical or of one or more of the following bits: jsresolve_qualified behave as though the property name appeared to the right of a dot, as in alert(obj.name).
...do not automatically infer and enable other flags by looking at the currently executing bytecode.
JS_NewContext
otherwise it returns null.
... no other thread may use it or destroy it.
JS_NewDouble
if it is, js_newdouble creates a bad jsdouble that might behave as desired in some cases but not others.
...otherwise it returns null.
JS_NewDoubleValue
if it is, js_newdoublevalue creates a bad jsval that might behave as desired in some cases but not others.
...otherwise it returns js_false and the value left in *rval is unspecified.
JS_NewFunction
flags unsigned pass jsfun_constructor to make a native that can be called as a constructor, otherwise 0.
...otherwise it reports an out-of-memory error and returns null.
JS_NewNumberValue
otherwise, a new floating-point jsval is created.
...otherwise it returns js_false and the value left in *rval is unspecified.
JS_NewRuntime
call js_newruntime before making any other api calls except js_init.
...otherwise it returns null.
JS_NewStringCopyN
they are copied into the new string like any other character.
...otherwise they return null.
JS_SetInterruptCallback
otherwise the engine may call the interrupt callback again, reentering it.
... to schedule the gc and for other activities the engine internally triggers interrupt callbacks.
JS_SetOperationCallback
otherwise the engine may call the operation callback again, reentering it.
... to schedule the gc and for other activities the engine internally triggers operation callbacks.
JS_SetParent
each object may have at most one parent, which is another object.
...otherwise, it reports an error or sets an exception and returns js_false.
JS_SetPropertyAttributes
jsprop_exported property can be imported by other objects.
...otherwise, it sets foundp to js_true, and attempts to set the attributes as specified.
JS_SetRegExpInput
the jsreg_multiline is set to multiline parameter, and other flags are all reset.
... on successful, js_setregexpinput returns true, otherwise returns false.
JS_SuspendRequest
since then, a jsruntime is tied to the thread that created it; it may not be accessed by any other thread.
...this allows the runtime to perform garbage collection if needed and allows other threads to access objects that the calling thread had locked.
JS_TracerInit
callback jstracecallback a callback, described below, which the tracing apis will call each time a pointer is found from one gc thing to another.
... description js_tracechildren and other tracing apis call the tracer callback for each traceable thing directly referenced by a particular object or runtime structure.
JS_ValueToFunction
this conversion is dangerous and almost entirely useless, because the resulting jsfunction is not a real function object and therefore cannot be safely passed to any other jsapi function.
... otherwise, v is an object.
JS_ValueToObject
otherwise it returns false and the value left in *objp is unspecified.
... otherwise v is an object, and the result depends on the object.
JS_YieldRequest
momentarily suspend the current jsapi request, allowing garbage collection to run if another thread has requested it.
... jsapi 1.7 and earlier js_yieldrequest did not cause cx to relinquish objects it created to other threads that are blocked waiting for them.
Parser API
if the parser produced no information about the node's source location, the field is null; otherwise it is an object consisting of a start position (the position of the first character of the parsed source region) and an end position (the position of the first character after the parsed source region): interface sourcelocation { source: string | null; start: position; end: position; } each position object consists of a line number (1-indexed) and a column number (0-indexed): ...
... if the generator flag is true, the function is a generator function, i.e., contains a yield expression in its body (other than in a nested function).
Profiling SpiderMonkey
make -c my-obj-dir/js/src other ways to profile for linux, there are global jprof functions available.
...we're working to add support for other profilers, such as oprofile, intel vtune, and callgrind.
SpiderMonkey 1.8
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.
SavedFrame
asynccause if this stack frame is the asyncparent of other stack frames, then this is a string representing the type of asynchronous call by which this frame invoked its children.
...in all other cases, this is null.
TPS History Lists
there are two types of history asset lists, one used for adding/modiyfing/verifying history, and the other for deleting history.
... the history list used for operations other than delete has the following properties: uri: required.
Thread Sanitizer
unlike other tools, it understands compiler-builtin atomics and synchronization and therefore provides very accurate results with no real false positives.
...m_root/build/bin/clang++" \ cflags="-fsanitize=thread -fpic -pie" \ cxxflags="-fsanitize=thread -fpic -pie" \ ldflags="-fsanitize=thread -fpic -pie" \ ../configure --disable-debug --enable-optimize="-o2 -gline-tables-only" --enable-llvm-hacks --disable-jemalloc make -j 8 fi using llvm symbolizer for faster/better traces by default, tsan traces are symbolized because otherwise, the runtime suppression list wouldn't work.
compare-locales
compare-locales is a python script that helps localizers to check their work without running firefox or another application.
...the file names will be shown in a hierarchical form, so in the example above, your files are browser.dtd in ab-cd/browser/chrome/browser and migration.dtd in another directory level deeper.
Security and the jar protocol
prior to this change, specifying the jar: protocol caused firefox to assume that the file being retrieved is a jar file, regardless of its mime type (in other words, its mime type was assumed to be application/zip, regardless of what it actually was).
...any other file type results in an "unsafe file type" error.
Signing Mozilla apps for Mac OS X
note that you cannot specify an identifier requirement if you do this, or otherwise you need to sign the outer application again with the identifier requirement.
...the folder will fail to validate if any of these cases occur (there may be other cases not listed here): if any files that were included in the signature have been removed or modified if any files have been added to a folder that should have all files signed the coderesources file this file is located in your application's bundle at contents/_codesignature/coderesources.
Task graph
these tasks include build and test tasks, along with lots of other kinds of tasks to build docker images, build toolchains, perform analyses, check syntax, and so on.
... these tasks are arranged in a "task graph", with some tasks (e.g., tests) depending on others (builds).
Gecko object attributes
other possible values are "polite", "assertive", and "rude", which is a suggestion for the policy when interrupting the user for changes to this region.
... text-align specifies how lines of text are aligned with each other (see css text-align property).
Places Expiration
common expiration runs on a timer, every 3 minutes and uses a simple adaptive algorithm: if the last step was unable to expire enough entries the next one will expire more entries, otherwise if the previous step completed the cleanup the next step will be delayed.
... apart this periodic expiration, there are other steps on idle, on shutdown on clear history.
Retrieving part of the bookmarks tree
otherwise, it will continue to get observer notifications and update itself, slowing down the whole browser.
...rootnode.containeropen = false; if you encounter a node with a type of result_type_folder or another type of container, you can open these folders and descend into the hierarchy.
XML Extras
not as just another document format.
... other test cases for each of the implemented components listed above exist in extensions/xmlextras/tests/.
XPCOM changes in Gecko 2.0
that's because it's among the earliest notifications that occurs after the profile folder (and therefore preferences and other services) is available.
...if, on the other hand, all you're doing with content is accessing dom methods and properties, you've never needed to be using xpcnativewrappers=no in the first place, and should simply remove it from your manifest.
Preface
though you can create xpcom components in javascript and other languages, and though you might be able to follow along as a c programmer, the component implementation code is written in c++, and much of the discussion of how to make your codeinto an xpcom component starts from c++.
... link references to other sections and to figures and tables are links to those sections.
Resources
« previous this last section of the book provides a list of resources referred to in the tutorial and other links that may be useful to the gecko developer.
... weblock resources weblock installer and information the sdk download linux: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-i686-pc-linux-gnu-1.4a.tar.gz windows: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-win32-1.4a.zip other mozilla downloads gecko resources internal string guide external string guide the gecko networking library ("necko") the netscape portable runtime environment embedding mozilla current module owners xpinstall xul xpcom resources the 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 ma...
Making cross-thread calls using runnables
however, it may be useful for c++ code in the mozilla platform to run tasks on another thread.
...each runnable represents a task which can then be dispatched to another thread for execution.
Components.Constructor
another important benefit is that it precomputes some of the computation it does, so using a function returned from components.constructor() to create xpcom objects is faster than creating the object from base principles, as demonstrated below.
...@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // assumes binaryinputstream was initialized previously var bis = new binaryinputstream(someinputstream); components.constructor() is purely syntactic sugar (albeit speedy and pretty syntactic sugar) for actions that can be accomplished using other common methods.
Components.utils.exportFunction
this does not have to be the global window object: it could be any other object in the target window, or an object created by the caller.
... user; } contentwindow.foo = components.utils.exportfunction(greetme, contentwindow); either way, code running in the content window's scope can now call the function: // page-script.js var greeting = foo("alice"); console.log(greeting); // "hello alice" export to an existing local object instead of attaching the function to the target's global window object, the caller can attach it to any other object in the target context.
Components.utils.getWeakReference
you might have to check other aspects of the object (like node.parentnode() on a dom node) to verify the object is truly what you want.
... var arr = []; arr.push(cu.getweakreference(window)); //now lets say this code runs in another block: for (var i=0; i<arr.length; i++) { if (arr[i].get() == window) { //found the window break; } } ...
Community
if you know of useful mailing lists, newsgroups, forums, or other communities related to pyxpcom, please link to them here.
... #pyxpcom on irc.mozilla.org chat with other pyxpcom developers on mozilla's irc network.
XPConnect wrappers
there is one case where an xpcwrappednative wraps another wrapper object.
... this case is where a js object was passed in via some idl-declared interface, creating an xpcwrappedjs, and is now being returned to javascript via some other interface.
nsIRegistry
nsiregistry on mxr other documentation: libreg source, reg.h in particular okay!
...i don't know how to get the other keys' names automatically, but i do know how to look up the directory for a particular profile.
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.
IAccessibleApplication
other-licenses/ia2/accessibleapplication.idlnot scriptable this interface gives access to the application's name and version information.
... 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface provides the at with the information it needs to differentiate this application from other applications, from other versions of this application, or from other versions of this application running on different versions of an accessibility bridge or accessibility toolkit.
IAccessibleComponent
other-licenses/ia2/accessiblecomponent.idlnot scriptable this interface is implemented by any object that can be rendered on the screen.
...in other words all coordinates are measured in pixels.
IAccessibleHypertext
other-licenses/ia2/accessiblehypertext.idlnot scriptable this interface exposes information about hypertext in a document.
... 1.0 66 introduced gecko 1.9 inherits from: iaccessibletext last changed in gecko 1.9 (firefox 3) the iaccessiblehypertext interface is the main interface to expose hyperlinks in a document, typically a text document, that are used to reference other documents.
IAccessibleTableCell
other-licenses/ia2/accessibletablecell.idlnot scriptable this interface gives access to the cells of a two-dimensional table.
...[propget] hresult isselected( [out] boolean isselected ); parameters isselected returns true if the specified cell is selected and false otherwise.
nsIAccessibleEvent
this can be used to get the dom window, the dom document and the window handler, among other things.
... event_hypertext_changed 0x0057 0x0053 focus has changed from one hypertext object to another, or focus moved from a non-hypertext object to a hypertext object, or focus moved from a hypertext object to a non-hypertext object.
nsIAccessibleHyperText
accessible/public/nsiaccessiblehypertext.idlscriptable this interface is the main interface to expose hyperlinks in a document, typically a text document, that are used to reference other documents.
... return value the index of the link if it's presented on the given character index, otherwise -1.
nsIAccessibleTable
unselectcolumn() unselect the given column, leaving other selected columns selected (if any).
... unselectrow() unselect the given row, leaving other selected rows selected (if any).
nsIAccessibleText
it represents the current input position and will therefore typically be queried by at more often than other positions.
...it represents the current input position and will therefore typically be queried by at more often than other positions.
nsIApplicationCache
henamespace getmatchingnamespace(in acstring key); unsigned long gettypes(in acstring key); void initashandle(in acstring groupid, in acstring clientid); void markentry(in acstring key, in unsigned long typebits); void unmarkentry(in acstring key, in unsigned long typebits); attributes attribute type description active boolean true if the cache is the active cache for this group, otherwise false.
...other caches from this cache group will be deactivated.
nsIAsyncInputStream
in other words, this method may be called when the stream already has data to read.
...otherwise, the event will be dispatched when the stream becomes readable or closed.
nsIAsyncOutputStream
in other words, this method may be called when the stream already has room for more data.
...otherwise, the event will be dispatched when the stream becomes writable or closed.
nsIAuthModule
the other methods cannot be called unless this method succeeds.
...confidential if set to true, it will encrypt the data, otherwise data will just be integrity protected (checksummed).
nsICacheSession
if blockingmode is set to false, it will return ns_error_cache_wait_for_validation rather than block when another descriptor has been given write access but hasn't validated the entry yet.
...until the client calls markvalid on its descriptor, other attempts to open the same cache entry will block.
nsICacheVisitor
return value returns true to start visiting all entries for this device, otherwise returns false to advance to the next device.
... return value returns true to visit the next entry on the current device, or if the end of the device has been reached, advance to the next device, otherwise returns false to advance to the next device.
nsICommandLine
this may be the original command line of this instance or a command line provided remotely by another instance of the application.
... return value true if the flag was found, otherwise false.
nsIConsoleService
note: to guard against stack overflows from listeners which could log messages (this could be done inadvertently through listeners implemented in javascript), we do not call any listeners when another error is already being logged.
... logging a message with additional information to include other information an nsiconsolemessage object must be used.
nsIContentPrefCallback2
this will be called exactly once for each method invocation, and afterward no other callback methods will be called.
...it is not called for other methods.
nsIController
return value return true if the specified command is currently available to be used; otherwise, it should return false.
... return value true if the specified command is supported; otherwise false.
nsICookie
isdomain boolean true if the cookie is a domain cookie, false otherwise.
... issecure boolean true if the cookie was transmitted over ssl, false otherwise.
nsIDNSRecord
hasmore() this method checks if there is another address in the record.
...return value true if there is another address in the record.
nsIDOMChromeWindow
); 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.
...on other systems, this method doesn't have any reaction currently.
nsIDOMProgressEvent
this doesn't include headers and other overhead, but only the content itself.
...otherwise, specify false.
nsIDOMStorageEventObsolete
canbubblearg true if the event is allowed to bubble, otherwise false.
... cancelablearg true if the event can be canceled, otherwise false.
nsIEventListenerService
usecapture true if to listen the event in capture phase, otherwise, false.
... usecapture true if listening the events in capture phase, otherwise, false.
nsIExternalHelperAppService
return value true if data from urls with the specified extension and encoding should be decoded prior to saving the file or delivering it to a helper application; otherwise false.
... aforcesave true to always save this content to disk, regardless of nsimimeinfo and other such influences.
nsIFeedEntry
mediacontent nsiarray an array of all the enclosures or other media that might be displayed inline in the entry.
... parent nsifeedcontainer a reference to the entry's parent, which is either a feed (nsifeed or another entry.
nsIFeedProgressListener
in other words, by the time this method is called, it is most likely that most or all of the feed-level metadata has been processed and is available in the received nsifeedresult object.
... handlestartfeed() called as soon as a reasonable start to a feed is detected; this lets your code know that the feed does appear to be an actual feed rather than some other sort of document.
nsIFilePicker
the filter appended first will be used to display the nsifilepicker dialog, the user may then select another from the list.
...if you would like to use another you must append it separately before the others you want to go into the drop down list.
nsIFileProtocolHandler
otherwise identical to geturlspecfromfile(), but is usually more efficient.
...otherwise identical to geturlspecfromfile(), but is usually more efficient.
nsIFrameLoaderOwner
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner.
...void swapframeloaders( in nsiframeloaderowner aotherowner ); parameters aotherowner the other frame loader owner with which to swap frame loaders.
nsIGeolocationProvider
return value true if the device is ready and has a position available to return; otherwise false.
...this is called before any other method and may be called multiple times.
nsIGlobalHistory2
embedders should consider filtering out these schemes and others, for example mailbox:, for the main nsiuri and the referrer.
... aredirect whether the uri was redirected to another location; this is true for the original uri which is redirected.
nsIGlobalHistory3
otherwise, nsiglobalhistory2.adduri() should be called with redirect=true.
...the other params to this function are the same as those for nsichanneleventsink.onchannelredirect().
nsIHttpChannelInternal
httpupgrade() allows for the use of http to bootstrap another protocol via the rfc 2616 upgrade request header in conjunction with a 101 level response.
...setcookie() helper method to set a cookie with a consumer-provided cookie header, but using the channel's other information (uri's, prompters, date headers and so on.).
nsIIDNService
isascii on return, this is set to true if the result is ascii or ace encoded; otherwise it's false.
... return value returns true if the specified string is ace encoded; otherwise, returns false.
nsILoginInfo
equals() tests to determine whether this login is exactly equal to another nsilogininfo object.
... matches() tests to determine whether this login is loosely equivalent to another nsilogininfo object.
nsIMessageBroadcaster
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message "broadcasters" don't have a single "other side" that they send messages to, but rather a set of subordinate message managers.
... for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
nsIMicrosummary
1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosummaryobserver observer); boolean equals(in nsimicrosummary aother); void removeobserver(in nsimicrosummaryobserver observer); void update(); attributes attribute type description content astring the content of the microsummary.
...boolean equals( in nsimicrosummary aother ); parameters aother the microsummary to compare against.
nsIMsgIdentity
signaturedate long escapedvcard astring dofcc boolean fccfolder astring fccfolderpickermode astring fccreplyfollowsparent boolean draftsfolderpickermode astring tmplfolderpickermode astring bccself boolean note: don't call bccself, bccothers, and bcclist directly, they are only used for migration and backward compatability.
... 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.
nsIMsgIncomingServer
otherwise, copies and folders prefs should point to local folders.
...otherwise, return true.
nsINavHistoryService
return value returns true if this uri would be added to the history, otherwise returns false.
...this will probably not be commonly used other than for backup/restore type operations.
nsIOutputStream
a non-blocking output stream, on the other hand, must not block the calling thread of execution.
...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.
nsIParentalControlsService
return value true if the block was successfully overridden, otherwise false.
... return value true if the block was successfully overridden, otherwise false.
nsIPermissionManager
consumers should choose this string to be unique, with respect to other consumers.
...consumers should choose this string to be unique, with respect to other consumers.
nsIPlacesView
for example, the representation of selection differs between trees, menus, and other such lists.
...views do this, and other things, by implementing the nsiplacesview interface.
nsIPrintingPrompt
if an embedder implemented service returns any error code (other than ns_error_abort) printing will terminate.
... to fly your own dialog you may: implement this service to display at least the print dialog and a print progress dialog or you may implement just one of the dialogs and pass back ns_error_not_implemented for any of the others.
nsIPushService
otherwise, it's an instance of `nsipushsubscription`.
...otherwise, your code may try to handle messages meant for other subscriptions.
nsIRequest
inhibit_persistent_caching 1 << 8 this flag prevents caching on disk (or other persistent media), which may be needed to preserve privacy.
...users should normally pass ns_binding_aborted, although other errors may also be passed.
nsISound
note that nsisound instances may play the sounds using another thread; however, this is not controlled by the caller.
...other methods will call init if they need to.
nsIStandardURL
if null, then provide abaseuri implements this interface, the origin charset of abaseuri will be assumed, otherwise defaulting to utf-8 (that is, no charset transformation from aspec).
...otherwise, aspec will be resolved relative to abaseuri.
nsITaskbarPreviewController
return value true if you want a frame drawn around the preview, otherwise false.
... return value true if you want a frame drawn around the thumbnail, otherwise false.
nsITaskbarWindowPreview
note that even while the preview is hidden, its thumbnails and/or previews may still be requested by other parts of the operating system through the nsitaskbarwindowpreview's controller.
... note: this interface will never invoke the controller's nsitaskbarpreviewcontroller.onclose() or nsitaskbarpreviewcontroller.onactivate() methods, since handling them may conflict with other internal gecko state management.
nsITelemetry
that is governed by user preference and other mechanisms.
...that is governed by user preference and other mechanisms.
nsITransferable
widget/nsitransferable.idlscriptable a container for typed data that can be transferred from one place or owner to another, possibly involving format conversion.
... return value true if the data is large; otherwise, the result is false.
nsITreeBoxObject
this must be followed by calling endupdatebatch(), otherwise the tree will get out of sync.
... void clearstyleandimagecaches(); other references tree widget changes (applies to gecko 1.8.0 and later) xul tutorial:tree box sorting and filtering a custom tree view xul tutorial:tree view details nsitreeview ...
nsIUpdate
this object also contains information about the update that the front end and other application services can use to learn more about what is going on.
...ideally, this page is not the release notes but some other page that summarizes the differences between this update and the previous, which also links to the release notes.
nsIWebBrowserPersist
the object that the embbedder supplies may also implement nsiinterfacerequestor and be prepared to return nsiauthprompt or other interfaces that may be required to download data.
...see below for other flags which might likely do what you want.
nsIWebPageDescriptor
docshell/base/nsiwebpagedescriptor.idlscriptable this interface allows content being displayed in one window to be loaded into another window without refetching it from the network.
...note that if the descriptor is that of the source of another page, this keeps the source view, but uses the current syntax highlighting preference.
nsIXULTemplateResult
in other contexts, such as a database query, a result would represent a particular record.
...other values may be used for application specific purposes.
nsIXULWindow
or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities.
...or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities.
nsMsgFolderFlagType
got new msgs const nsmsgfolderflagtype gotnew = 0x00020000; /// this folder is an imap server const nsmsgfolderflagtype imapserver = 0x00040000; /// this folder is an imap personal folder const nsmsgfolderflagtype imappersonal = 0x00080000; /// this folder is an imap public folder const nsmsgfolderflagtype imappublic = 0x00100000; /// this folder is another user's imap folder.
... const nsmsgfolderflagtype imapotheruser = 0x00200000; /// whether this is the template folder const nsmsgfolderflagtype templates = 0x00400000; /// this folder is one of your personal folders that is shared with other users const nsmsgfolderflagtype personalshared = 0x00800000; /// this folder is an imap \\noselect folder const nsmsgfolderflagtype imapnoselect = 0x01000000; /// this folder created offline const nsmsgfolderflagtype createdoffline = 0x02000000; /// this imap folder cannot have children :-( const nsmsgfolderflagtype imapnoinferiors = 0x04000000; /// this folder configured for offline use const nsmsgfolderflagtype offline = 0x08000000; /// this folder has offline eve...
nsMsgSearchAttrib
/** otherheader must always be last attribute since * we can have an arbitrary # of these.
... */ const nsmsgsearchattribvalue otherheader = 52; // must be last attribute const nsmsgsearchattribvalue knummsgsearchattributes = 100; }; ...
nsPIPromptService
embedding/components/windowwatcher/public/nspipromptservice.idlscriptable this interface is for the dialog implementers, not for other developers.
...otherwise, it's a normal edit field.
NS_CStringAppendData
otherwise, adata need not be null-terminated.
...otherwise, it returns an error code.
NS_CStringCopy
« xpcom api reference summary the ns_cstringcopy function copies the value from one nsacstring instance to another.
...otherwise, it returns an error code.
NS_CStringInsertData
otherwise, adata need not be null terminated.
...otherwise, it returns an error code.
NS_CStringSetData
otherwise, adata need not be null-terminated.
...otherwise, it returns an error code.
NS_CStringSetDataRange
otherwise, adata need not be null terminated.
...otherwise, it returns an error code.
NS_StringAppendData
otherwise, adata need not be null terminated.
...otherwise, it returns an error code.
NS_StringCopy
removed by bug 1332639 « xpcom api reference summary the ns_stringcopy function copies the value from one nsastring instance to another.
...otherwise, it returns an error code.
NS_StringInsertData
otherwise, adata need not be null terminated.
...otherwise, it returns an error code.
NS_StringSetData
otherwise, adata need not be null terminated.
...otherwise, it returns an error code.
NS_StringSetDataRange
otherwise, adata need not be null terminated.
...otherwise, it returns an error code.
XPCOM string functions
ny memory allocated by a nscstringcontainer instance.ns_cstringcontainerinitthe ns_cstringcontainerinit function initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcontainerinit2the ns_cstringcontainerinit2 function initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcopythe ns_cstringcopy function copies the value from one nsacstring instance to another.
...this is a low-level api.ns_stringcopythe ns_stringcopy function copies the value from one nsastring instance to another.
Setting HTTP request headers
trapping other requests is done with notifications, which are a lot like events or signals found in other languages and frameworks.
...and yes, converting objects from one kind to another is very ugly, and lacks (what is usually called) syntactic sugar.
Frequently Asked Questions
for example, the assertion occurs when you convert the pointer to the object to a raw pointer to that interface, then assign the raw pointer to another nscomptr for that interface.
... ns_precondition "you can't dereference a null nscomptr with operator->()" ns_precondition "you can't dereference a null nscomptr with operator*()" other issues printf("%x\n", mynscomptr); can cause the program to crash on sigill (illegal instruction), and not on the line with the printf, which can make it tricky to figure out.
XPCOM ownership guidelines
or put another way: the ownership graph for any system should be acyclic.
...all the nodes in the tree point to each other with non-owning pointers.
wrappedJSObject
we defined in our component implementation, we get: > comp.hello(); typeerror on line 1: comp.hello is not a function this happens because, as we mentioned earlier, comp is not the helloworld js object itself, but an xpconnect wrapper around it: > dump(comp); [xpconnect wrapped nsisupports] the idea of these wrappers is to make the javascript-implemented xpcom components look just like any other xpcom component to the user.
... calling queryinterface on the wrapper works, because it is defined in the nsisupports interface, and the wrapper knows the underlying object implements nsisupports: > comp.queryinterface(components.interfaces.nsihelloworld); [xpconnect wrapped (nsisupports, nsihelloworld)] as you can see, the queryinterface call also made the wrapper know about the other interface our component supports.
xptcall FAQ
it may also be used by other subsystems in the future.
... the growing list: porting status where can i find other resources?
Creating a gloda message query
however, many attributes are dynamically contributed by built-in logic (fundattr.js and explattr.js) as well as other extensions.
...you should not need to use this unless you are dealing with other old-school code or you need to manipulate the state of a message.
Filelink Providers
other providers however may require the user to fill in additional details in order to connect to the service.
...other services may require the user to fill in a server string or port number.
MailNews fakeserver
the other two components are specific to the protocol type and found under similar files in the same directory (e.g., smtpd.js).
...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.
MailNews Filters
if one of the actions is a move, or a stop filter execution action, we move on to the next header; otherwise, we move on to the next filter.
...for each new header, we evaluate the filter criteria and apply the actions synchronously, including moving a message to an other local folder, and advance to the next header.
Building a Thunderbird extension 5: XUL
if you have trouble with one zip manager (like 7zip) try another (like winrar).
...xul overlays are a way of attaching other ui widgets to a xul document at run time.
Using tab-modal prompts
prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), prompts (that is, alerts and other modal prompts) were window modal.
...an alert!"]; prompt.alert.apply(null, promptargs); nsiprompt will automatically fall back to window-modal prompts when necessary (such as in situations in which tab-modal prompts aren't supported, or for prompts displayed outside the context of a tab).le to use other forms of the prompts of nsipromptservice interface see the example code.
Using the Mozilla symbol server
the debugger will not be able to show you the content of all variables and the execution path can seem strange because of inlining, tail calls, and other compiler optimizations.
...if you want to reload symbols, you can try: nosharedlibrary sharedlibrary lib on older gdb and mac os x there is a python script to download symbols from the mozilla symbol server for gdb, shark and other software that uses symbols.
Virtualenv
it is recommended that you use virtualenv for installing anything other than system software that you are working on.
...bin/activate once the virtualenv is activated, the virtualenv's python (and other executables) will be on your path and you will have a new environment variable, virtual_env, that points to the path of the virtualenv, as well as a deactivate function for deactivating the virtualenv.
Int64
note: it's important to note that the 64-bit integer objects created by int64 are not int64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the int64 object.
...this may be specified as an integer (if the value can be represented as a 32-bit value), another 64-bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number.
PointerType
for other function, pointer, and array types, this should be a valid c type expression.
... return value true if the pointer's value is null, otherwise false.
UInt64
note: it's important to note that the 64-bit integer objects created by uint64 are not uint64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the uint64 object.
...this may be specified as an integer (if the value can be represented as a 32-bit value), another 64-bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number.
DOM Inspector FAQ - Firefox Developer Tools
these can include chrome documents, but it's not suggested that you inspect xul documents by directly inspecting them via url, since some behavior may rely on the document being contained in another xul document, or the converse, where it won't behave correctly because it doesn't expect to be loaded as a framed document.
... there is currently no way to inspect dynamically-applied rules for other pseudo-classes or any pseudo-elements from the dom inspector ui.
Inspecting web app manifests - Firefox Developer Tools
loying a manifest to get a manifest deployed successfully, you need to include a <link> element in the <head> of your document that points to your .webmanifest file: <link rel="manifest" href="/manifest.webmanifest"> the .webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json).
... it also loads all the icon files into the view, so you can see the relative size of them all, and any other information associated with them.
Inspecting web sockets - Firefox Developer Tools
accessing the inspector when you are inspecting a web app that utilizes a web socket connection, the web socket requests are listed in the list of requests in the network monitor along with all other requests.
...this filter can be combined with the others, to display, for example, only messages for control frames sent by the browser.
Network request details - Firefox Developer Tools
a script called by another script).
...(see referrer-policy for a description of possible values) blocking: if the request is to a site that is associated with a known tracker, an icon and a message are shown; otherwise, this field is not shown.
Edit Shape Paths in CSS - Firefox Developer Tools
to deactivate the shape path editor click on the icon again, or select another element or a different editor.
...to understand the margin box, and other boxes used by css shapes see our guide to shapes from box values.
Edit fonts - Firefox Developer Tools
in firefox 61 and 62, this area is labeled "other fonts in page" and doesn't include the fonts mentioned in the "fonts used" section.
... they are used by a descendant of the inspected element, for example, when it is a container for other elements which have text content with fonts applied.
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
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.
...m content size of a flex item when there is no more free space in the flex container final size - the size of the flex item after all sizing constraints imposed on it have been applied (based on the values of flex-grow, flex-shrink and flex-basis) at the top of the section is a drop-down list of all the items in the selected flexbox container: you can use this drop-down to select any of the other flex items in the flex container.
Examine and edit CSS - Firefox Developer Tools
overridden declarations if a css declaration is overridden by some other css rule with a greater weight, then the declaration is shown with a line through it.
... editing keyboard shortcuts you can use the arrow and page up/down keys (along with others) to increase/decrease numeric rules while editing: the up arrow increments values by 1 — for example, "1px" changes to "2px".
Examine and edit HTML - Firefox Developer Tools
the shadow root is signified by a node named #shadow-root — you can click its expansion arrow to see the full contents of the shadow dom, and then manipulate the contained nodes in a similar way to other part of the page's dom (although with a limited featureset — you can't, for example, drag and drop or delete shadow dom nodes).
...you can then edit the new node's content and styling just as you would any other node in the document.
Call Tree - Firefox Developer Tools
samples is the number of samples that were taken when we were executing this particular function, including its children (the other functions called by this particular function).
...it can shoulder the blame for another 252 samples, or almost another 10% of the total cost.
Flame Chart - Firefox Developer Tools
the ones colored plain green are presumably the other sort functions.
... even at a glance, we can see that the bubble sort blocks are much wider (of a longer duration) than the others.
Remote Debugging - Firefox Developer Tools
you can use the firefox developer tools on your desktop to debug web sites and web apps running in other browsers or runtimes.
... the other browser might be on the same device as the tools themselves or on a different device, such as a phone connected over usb.
Responsive Design Mode - Firefox Developer Tools
the most obvious factor here is screen size, but there are other factors as well, including the pixel density of the display and whether it supports touch.
... reloading on these changes can be helpful because certain page behaviors would otherwise not be applied.
Shader Editor - Firefox Developer Tools
here's another screencast, showing how you can use the shader editor for complex applications (in this case, the unreal engine demo): opening the shader editor the shader editor is disabled by default.
...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.
Style Editor - Firefox Developer Tools
then you can just start entering css into the new editor and watch as the new styles are applied in real time just like changes to the other sheets.
...other preprocessors are actively working on adding support, or considering it.
Web Console Helpers - Firefox Developer Tools
otherwise, json.stringify will be called on the argument, and the result will be copied to the clipboard.
... --file boolean when present, the screenshot will be saved to a file, even if other options (e.g.
Split console - Firefox Developer Tools
you can use the console alongside other tools.
... while you're in another tool in the toolbox, just press esc or select the "show split console" command in the toolbar menu.
The JavaScript input interpreter - Firefox Developer Tools
otherwise, json.stringify will be called on the argument, and the result will be copied to the clipboard.
... --file boolean when present, the screenshot will be saved to a file, even if other options (e.g.
AbstractRange - Web APIs
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.
...each element's contents are linked below it in the tree, potentially spawning a series of branches below as elements include other elements and text nodes.
Attr - Web APIs
WebAPIAttr
in html dom, "id" is the only id attribute, but xml documents could define others.
... whether or not an attribute is unique is often determined by a dtd or other schema description.
AudioBuffer.copyFromChannel() - Web APIs
example this example creates a new audio buffer, then copies the samples from another channel into it.
... var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); var anotherarray = new float32array(length); myarraybuffer.copyfromchannel(anotherarray, 1, 0); specification specification status comment web audio apithe definition of 'copyfromchannel' in that specification.
AudioContext - Web APIs
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.
AudioListener.forwardX - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.forwardY - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.forwardZ - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.positionX - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.positionY - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.positionZ - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.setOrientation() - Web APIs
the two vectors must be separated by an angle of 90° — in linear analysis terms, they must be perpendicular to each other.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.upX - Web APIs
WebAPIAudioListenerupX
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.upY - Web APIs
WebAPIAudioListenerupY
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.upZ - Web APIs
WebAPIAudioListenerupZ
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioNode.channelInterpretation - Web APIs
all the others (l, r, lfe, sl, and sr) are silent.
... output.l = input.l + 0.7071 * input.c output.r = input.r + 0.7071 * input.c output.sl = input.sl output.sr = input.sr other, non-standard layouts non-standard channel layouts are handled as if channelinterpretation is set to discrete.
AudioParam.setTargetAtTime() - Web APIs
the decay rate as defined by the timeconstant parameter is exponential; therefore the value will never reach target completely, but after each timestep of length timeconstant, the value will have approached target by another 1-e-1≈63.2%1 - e^{-1} \approx 63.2%.
... choosing a good timeconstant as mentioned above, the value changes exponentially, with each timeconstant bringing you another 63.2% toward the target value.
AudioParam - Web APIs
in other words, the same value applies to every frame in the audio as it's processed by the node.
... audioparam.cancelandholdattime() cancels all scheduled future changes to the audioparam but holds its value at a given time until further changes are made using other methods.
AudioTrack.label - Web APIs
WebAPIAudioTracklabel
the read-only audiotrack property label returns a string specifying the audio track's human-readable label, if one is available; otherwise, it returns an empty string.
...otherwise, an empty string ("") is returned.
AudioWorkletNode - Web APIs
the audioworkletnode interface of the web audio api represents a base class for a user-defined audionode, which can be connected to an audio routing graph along with other nodes.
...the other end is available under the port property of the processor.
AudioWorkletNodeOptions - Web APIs
otherwise, if outputchannelcount is provided and if the values of numberofinputs and numberofoutputs are both 1, the audio worklet node's channel count is set to the value of outputchannelcount.
... otherwise, the channel count of each channel in the set of output channels is set to match the corresponding value in the outputchannelcount array.
AudioWorkletProcessor.process - Web APIs
in other words, every time a new block of audio is ready for your processor to manipulate, your process() function is invoked to do so.
... return value a boolean value indicating whether or not to force the audioworkletnode to remain active even if the user agent's internal logic would otherwise decide that it's safe to shut down the node.
AudioWorkletProcessor - Web APIs
the other end is available under the port property of the node.
... connect the node to the other nodes.
AuthenticatorAssertionResponse.userHandle - Web APIs
such an identifier can be used by the relying party's server to link the user account with its corresponding credentials and other data.
...username, e-mail, phone number, etc.) examples var options = { challenge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var userhandle = assertionpkcred.response.userhandle; // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.error(err); }); specifications ...
BaseAudioContext.createBuffer() - Web APIs
note: createbuffer() used to be able to take compressed data and give back decoded samples, but this ability was removed from the spec, because all the decoding was done on the main thread, therefore createbuffer() was blocking other code execution.
... exceptions notsupportederror one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range).
Using the Beacon API - Web APIs
if the browser successfully queues the request for delivery, the method returns true and returns false otherwise.
... 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.navigator.sendbeacon(url, data); postmessage(status ?
BiquadFilterNode() - Web APIs
the meaning of the other options depends on the value of this one.
...viewed another way, this is the frequency with maximal group delay.
Bluetooth.referringDevice - Web APIs
the bluetooth.referringdevice attribute of the bluetooth interface returns a bluetoothdevice if the current document was opened in response to an instruction sent by this device and null otherwise.
... syntax bluetooth.referringdevice value a bluetoothdevice, if the document was opened in response to an instruction sent by this device and null otherwise.
CSSNumericValue - Web APIs
otherwise, false.
... cssnumericvalue.to converts value into another one with the specified unit.
Using the CSS Painting API - Web APIs
employ the css paint() function like we would any other <image> type, using the same string identifier we used in the paintworklet's registerpaint() function.
...another way to think about it is that arguments are set to control what you are actually drawing, whereas properties are set to control styling.
Cache.delete() - Web APIs
WebAPICachedelete
in other words, if the url matches you will get a match regardless of whether the response object has a vary header.
... return value a promise that resolves to true if the cache entry is deleted, or false otherwise.
Cache - Web APIs
WebAPICache
console.log(' found response in cache:', response); return response; } // otherwise, if there is no entry in the cache for event.request, response will be // undefined, and we need to fetch() the resource.
... // it is something to keep in mind if you're attempting to cache other resources from a cross-origin // domain that doesn't support cors, though!
CanvasRenderingContext2D.arcTo() - Web APIs
examples how arcto works one way to think about arcto() is to imagine two straight segments: one from the starting point to a first control point, and another from there to a second control point.
...in other words, the arc is tangential to both segments.
CanvasRenderingContext2D.drawWindow() - Web APIs
drawwindow_do_not_flush 0x02 do not flush pending layout notifications that could otherwise be batched up.
... it is usually a bad idea to use any background other than pure white "rgb(255,255,255)" or transparent, as this is what all browsers do, and many websites expect that transparent parts of their interface will be drawn on white background.
CanvasRenderingContext2D.isPointInPath() - Web APIs
return value boolean a boolean, which is true if the specified point is contained in the current or specified path, otherwise false.
...if yes, the circle becomes green, otherwise it is red.
CanvasRenderingContext2D.isPointInStroke() - Web APIs
return value boolean a boolean, which is true if the point is inside the area contained by the stroking of a path, otherwise false.
...if yes, the ellipse's stroke becomes green, otherwise it is red.
Basic animations - Web APIs
the requestanimationframe method provides a smoother and more efficient way for animating by calling the animation frame when the system is ready to paint the frame.
...ent.dispatchevent(e) }; var o, s, h = innerheight, w = innerwidth, fw = 60, fa = []; window.onkeydown = function (t) { var e = t.key; (e.search("arrow") > -1 || "1" == e) && (d = t.key), "i" != e && "i" != e || (console.log("inc"), fw -= 10), "d" != e && "d" != e || (console.log("dec"), fw += 10) }, init(); output other examples a basic ray-caster a good example of how to do animations using keyboard controls.
Basic usage of canvas - Web APIs
other contexts may provide different types of rendering; for example, webgl uses a 3d context based on opengl es.
...this function, or one like it, could also be called using window.settimeout(), window.setinterval(), or any other event handler, as long as the page has been loaded first.
Compositing and clipping - Web APIs
« previousnext » in all of our previous examples, shapes were always drawn one on top of the other.
...in other words, no clipping occurs.
Canvas API - Web APIs
among other things, it can be used for animation, game graphics, data visualization, photo manipulation, and real-time video processing.
... easeljs is an open-source canvas library that makes creating games, generative art, and other highly graphical experiences easy.
Clients.openWindow() - Web APIs
return value a promise that resolves to a windowclient object if the url is from the same origin as the service worker or a null value otherwise.
...(windowclient.focus(), true) : false); // otherwise, open a new tab to the applicable url and focus it.
ConstrainBoolean - Web APIs
if possible, this value will be used, but the user agent will use 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.
CustomEvent - Web APIs
some other browsers are starting to support it for web compatibility purposes.
... event.stopimmediatepropagation() for this particular event, prevent all other listeners from being called.
DOMMatrixReadOnly.scale() - Web APIs
if this value is anything other than 1, the resulting matrix will be 3d.
...if this value is anything other than 0, the resulting matrix will be 3d.
DOMTokenList.contains() - Web APIs
the contains() method of the domtokenlist interface returns a boolean — true if the underlying list contains the given token, otherwise false.
... return value a boolean, which is true if the calling list contains token, otherwise false.
DataTransfer.dropEffect - Web APIs
on setting, if the new value is one of the values listed below, then the property's current value will be set to the new value and other values will be ignored.
... assigning any other value to dropeffect has no effect and the old value is retained.
DataTransfer.effectAllowed - Web APIs
assigning a value to effectallowed in events other than dragstart has no effect.
... assigning any other value to effectallowed has no effect and the old value is retained.
DataTransfer.mozUserCancelled - Web APIs
if the user canceled the event, the property returns true and returns false otherwise.
... syntax datatransfer.mozusercancelled; return value a boolean representing true if the user canceled the drag event and returns false otherwise.
DataTransfer.setDragImage() - Web APIs
the image will typically be an <image> element but it can also be a <canvas> or any other visible element.
... if element is an img element, then set the drag data store bitmap to the element's image (at its intrinsic size); otherwise, set the drag data store bitmap to an image generated from the given element (the exact mechanism for doing so is not currently specified).
Document.adoptNode() - Web APIs
document.adoptnode() transfers a node from another document into the method's document.
... syntax const importednode = document.adoptnode(externalnode); parameters externalnode the node from another document to be adopted.
Document.cookie - Web APIs
WebAPIDocumentcookie
it also signals that the domain attribute must not be present, which prevents the cookie from being sent to other domains.
... the reason for the syntax of the document.cookie accessor property is due to the client-server nature of cookies, which differs from other client-client storage methods (like, for instance, localstorage): the server tells the client to store a cookie http/1.0 200 ok content-type: text/html set-cookie: cookie_name1=cookie_value1 set-cookie: cookie_name2=cookie_value2; expires=sun, 16 jul 3567 06:23:41 gmt [content of the page here] the client sends back to the server its cookies previously stored get /sample_page.html http/1.1 h...
Document.enableStyleSheetsForSet() - Web APIs
enables the style sheets matching the specified name in the current style sheet set, and disables all other style sheets (except those without a title, which are always enabled).
...all style sheets with a title that match this name will be enabled, while all others that have a title will be disabled.
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
returns an xpathresult based on an xpath expression and other given parameters.
... while using document.evaluate() works in ff2, in ff3 one must use somexmldoc.evaluate() if evaluating against something other than the current document.
Document.fullscreen - Web APIs
syntax var isfullscreen = document.fullscreen; value a boolean value which is true if the document is currently displaying an element in full-screen mode; otherwise, the value is false.
... function isdocumentinfullscreenmode() { return document.fullscreen; } this next example, on the other hand, uses the current fullscreenelement property to determine the same thing: function isdocumentinfullscreenmode() { return document.fullscreenelement !== null; } if fullscreenelement isn't null, this returns true, indicating that full-screen mode is in effect.
Document: fullscreenchange event - Web APIs
to find out whether the element is entering or exiting full-screen mode, check the value of documentorshadowroot.fullscreenelement: if this value is null then the element is exiting full-screen mode, otherwise it is entering full-screen mode.
... if (document.fullscreenelement) { console.log(`element: ${document.fullscreenelement.id} entered full-screen mode.`); } else { console.log('leaving full-screen mode.'); } }); see element: fullscreenchange event for another example.
Document.getElementById() - Web APIs
unlike some other element-lookup methods such as document.queryselector() and document.queryselectorall(), getelementbyid() is only available as a method of the global document object, and not available as a method on all element objects in the dom.
...the id attribute is defined to be of id type in the common cases of xhtml, xul, and other.
Document.popupNode - Web APIs
for other types of popups, the value is not changed.
... in these other cases, for example when calling the popup's showpopup method, you may wish to set the popupnode property directly beforehand.
Document.requestStorageAccess() - Web APIs
grant the document access to cookies and other site storage and store that fact for the purposes of future calls to document.hasstorageaccess() and requeststorageaccess().
... if the user clicks “don’t allow”, the storage access request is rejected and the requesting origin can re-request once it receives another user interaction.
Events and the DOM - Web APIs
the event interface itself is described, as well as the interfaces for event registration on nodes in the dom, and event listeners, and several longer examples that show how the various event interfaces relate to one another.
... eventtarget.addeventlistener // assuming mybutton is a button element mybutton.addeventlistener('click', greet, false) function greet(event){ // print and have a look at the event object // always print arguments in case of overlooking any other arguments console.log('greet:', arguments) alert('hello world') } this is the method you should use in modern web pages.
Examples of web and XML development using the DOM - Web APIs
if dom core methods document.createelement and node.appendchild are used to create rows and cells, ie requires that they are appended to a tbody element, whereas other browsers will allow appending to a table element (the rows will be added to the last tbody element).
... there are a number of other convenience methods belonging to the table interface that can be used for creating and modifying tables.
Using the W3C DOM Level 1 Core - Web APIs
the w3c's dom level 1 core is an api for manipulating the dom trees of html and xml documents (among other tree-like types of documents).
...also see our other dom documentation.
EffectTiming.duration - Web APIs
this value must not be negative; otherwise, it can have any value (including positive infinity).
... exceptions typeerror the specified value is either a string other than "auto", a number less than zero, nan, or some other type of object entirely.
EffectTiming.easing - Web APIs
ease-out another decelerated rate of change, going from fast to slow.
... frames(<integer>) specifies a frames timing function, which breaks the animation down into a number of equal time intervals but also displays the start (0%) and end (100%) states for an equal amount of time to the other intervals.
Element: DOMMouseScroll event - Web APIs
bubbles yes cancelable yes interface mousescrollevent if you want to prevent the default action of mouse wheel events, it's not enough to handle only this event on gecko because if scroll amount by a native mouse wheel event is less than 1 line (or less than 1 page when the system setting is by page scroll), other mouse wheel events may be fired without this event.
...any other value represents the number of lines to scroll, with the direction indicated by the value's sign.
Element: auxclick event - Web APIs
the auxclick event is fired at an element when a non-primary pointing device button (any mouse button other than the primary—usually leftmost—button) has been pressed and released both within the same element.
... when listening for auxclick events originating on elements that do not support input or navigation, you will often want to explicitly prevent other default actions mapped to the down action of the middle mouse button.
Element.getClientRects() - Web APIs
when called on svg elements other than an outer-<svg>, the "viewport" that the resulting rectangles are relative to is the viewport that the element's outer-<svg> establishes (and to be clear, the rectangles are also transformed by the outer-<svg>'s viewbox transform, if any).
... 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.
ElementCSSInlineStyle.style - Web APIs
for adding specific styles to an element without altering other style values, it is preferred to use the individual properties of style (as in elt.style.color = '...') as using elt.style.csstext = '...' or elt.setattribute('style', '...') sets the complete inline style for the element by overriding the existing inline styles.
... examples // set multiple styles in a single statement elt.style.csstext = "color: blue; border: 1px solid black"; // or elt.setattribute("style", "color:red; border: 1px solid blue;"); // set specific style while leaving other inline style values untouched elt.style.color = "blue"; getting style information the style property is not useful for completely learning about the styles applied on the element, since it represents only the css declarations set in the element's inline style attribute, not those that come from style rules elsewhere, such as style rules in the <head> section, or external style sheets.
Comparison of Event Targets - Web APIs
event.explicitoriginaltarget event.webidl if the event was retargeted for some reason other than an anonymous boundary crossing, this will be set to the target before the retargeting occurs.
... .non-standard { background-color: #902d37; } </style> </head> <body> <table> <thead> <tr> <td class="standard">original target dispatching the event <small>event.target</small></td> <td class="standard">target who's event listener is being processed <small>event.currenttarget</small></td> <td class="standard">identify other element (if any) involved in the event <small>event.relatedtarget</small></td> <td class="non-standard">if there was a retargetting of the event for some reason <small> event.explicitoriginaltarget</small> contains the target before retargetting (never contains anonymous targets)</td> <td class="non-standard">if there was a retargetting of the event for some reason <small>...
Event.returnValue - Web APIs
WebAPIEventreturnValue
syntax event.returnvalue = bool; var bool = event.returnvalue; value a boolean value which is true if the event has not been canceled; otherwise, if the event has been canceled or the default has been prevented, the value is false.
... usage notes returnvalue was introduced into the dom by internet explorer 6, and due to that browser's ubiquity became so commonly used that other browsers eventually implemented it as well.
EventSource - Web APIs
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.
...) { console.log(e.data) }) /* similarly, this will listen for events * with the field `event: update` */ sse.addeventlistener("update", function(e) { console.log(e.data) }) /* the event "message" is a special case, as it * will capture events without an event field * as well as events that have the specific type * `event: message` it will not trigger on any * other event type.
EventTarget - Web APIs
element, document, and window are the most common event targets, but other objects can be event targets, too.
... for example xmlhttprequest, audionode, audiocontext, and others.
FetchEvent.preloadResponse - Web APIs
the preloadresponse read-only property of the fetchevent interface returns a promise that resolves to the navigation preload response if navigation preload was triggered or undefined otherwise.
... syntax var expectedresponse = fetchevent.preloadresponse; value a promise that resolves to a response or otherwise to undefined.
FetchEvent.respondWith() - Web APIs
otherwise, a network error is returned to fetch.
... examples this fetch event tries to return a response from the cache api, falling back to the network otherwise.
FileEntrySync - Web APIs
invalid_state_err the file is no longer valid for some reason other than it having been deleted.
... invalid_state_err the file is no longer valid for some reason other than it having been deleted.
FileError - Web APIs
WebAPIFileError
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).
... other unspecified security error code or situations.
FileException - Web APIs
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).
... other unspecified security error code or situations.
FileSystemDirectoryEntry.removeRecursively() - Web APIs
fileerror.not_readable_err the directory is not accessible; perhaps it's in use by another application or is locked at the operating system level.
... other security concerns as raised by the user agent or the operating system.
FileSystemEntry - Web APIs
instead, you will receive an object based on this interface through other apis.
... isdirectory read only a boolean which is true if the entry represents a directory; otherwise, it's false.
Geolocation API - Web APIs
geolocationcoordinates represents the coordinates of a user's position; a geolocationcoordinates instance contains latitude, longitude, and other important related information.
...returns a geolocation object instance, from which all other functionality can be accessed.
GlobalEventHandlers.ontransitionend - Web APIs
another is if the display attribute is set to none.
...this could also be used to trigger animations or other effects, to allow chaining of reactions.
GlobalEventHandlers.onwheel - Web APIs
the wheel event fires when the user rotates the mouse (or other pointing device) wheel.
... examples this example shows how to scale an element using the mouse (or other pointing device) wheel.
HTMLCanvasElement.toDataURL() - Web APIs
other arguments are ignored.
... 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.
HTMLElement - Web APIs
some elements directly implement this interface, while others implement it via an interface that inherits it.
... pointerout fired when a pointer is moved out of the hit test boundaries of an element (among other reasons).
HTMLImageElement.complete - Web APIs
syntax let doneloading = htmlimageelement.complete; value a boolean value which is true if the image has completely loaded; otherwise, the value is false.
... 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.
HTMLImageElement.currentSrc - Web APIs
one is 200px wide and the other is 400px wide.
... the sizes attribute is provided to indicate that the image should be drawn at 50% of the document width if the viewport is under 400px wide; otherwise, the image is drawn at 90% width of the document.
HTMLImageElement.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.
HTMLImageElement.x - Web APIs
in other words: it has either of those values set explicitly on it, or it has inherited it from a containing element, or by being located within a column described by either <col> or <colgroup>.
... note: the x property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>.
HTMLImageElement.y - Web APIs
in other words: it has either of those values set explicitly on it, or it has inherited it from a containing element, or by being located within a column described by either <col> or <colgroup>.
... note: the y property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>.
HTMLMediaElement.captureStream() - Web APIs
return value a mediastream object which can be used as a source for audio and/or video data by other media processing code, or as a source for webrtc.
...the stream can then be used for other purposes—like a source for streaming over webrtc, to allow sharing prerecorded videos with another person during a video call.
HTMLMediaElement.srcObject - Web APIs
note: as of march 2020, only safari supports setting objects other than mediastream.
... until other browsers catch up, for mediasource, blob and file, consider falling back to creating a url with url.createobjecturl() and assign it to htmlmediaelement.src.
HTMLObjectElement - Web APIs
htmlobjectelement.contentdocument read only returns a document representing the active document of the object element's nested browsing context, if any; otherwise null.
... htmlobjectelement.contentwindow read only returns a windowproxy representing the window proxy of the object element's nested browsing context, if any; otherwise null.
HTMLSlotElement.assignedElements() - Web APIs
the assignedelements() property of the htmlslotelement interface returns a sequence of the elements assigned to this slot (and no other nodes).
... if the flatten option is set to true, it also returns the assigned elements of any other slots that are descendants of this slot.
History.pushState() - Web APIs
WebAPIHistorypushState
the new url must be of the same origin as the current url; otherwise, pushstate() will throw an exception.
... description in a sense, calling pushstate() is similar to setting window.location = "#foo", in that both will also create and activate another history entry associated with the current document.
IDBCursor.advance() - Web APIs
WebAPIIDBCursoradvance
here we use cursor.advance(2) to jump 2 places forward each time, meaning that only every other result will be displayed.
...saction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.advance(2); } else { console.log('every other entry displayed.'); } }; }; specifications specification status comment indexed database api 2.0the definition of 'advance()' in that specification.
IDBDatabase.onversionchange - Web APIs
the onversionchange event handler of the idbdatabase interface handles the versionchange event, fired when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested elsewhere (most probably in another window/tab on the same computer).
... unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; db.onversionchange = function(event) { note.innerhtml += '<li>a database change has occurred; you should refresh this browser window, or close it down and use the other open version of this application, wherever it exists.</li>'; }; }; specifications specification status comment indexed database api 2.0the definition of 'onversionchange' in that specification.
IDBDatabase.transaction() - Web APIs
if you need to open the object store in readwrite mode to change data, you would use the following: var transaction = db.transaction('my-store-name', "readwrite"); as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other indexeddb-supporting browsers.
... details optional dictionary of other settings, supported only by chrome: return value an idbtransaction object.
IDBIndex - Web APIs
WebAPIIDBIndex
an index is a kind of object store for looking up records in another object store, called the referenced object store.
...an index lets you look up records in an object store using properties of the values in the object stores records other than the primary key the index is a persistent key-value storage where the value part of its records is the key part of a record in the referenced object store.
IDBObjectStore.put() - Web APIs
example the following example requests a given record title; when that request is successful the onsuccess function gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request with put().
...st'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title const objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = () => { // grab the data object returned as the result const data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back into the database const updatetitlerequest = objectstore.put(data); // log the transaction that originated this request console.log("the transaction that originated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the displaydata() function again to update the display updatetitlerequest.onsuccess = () => { ...
IDBRequest.error - Web APIs
WebAPIIDBRequesterror
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.
...action(['todolist'], "readwrite").objectstore('todolist'); // get the do-do list with the specified title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.l...
IDBRequest.readyState - Web APIs
example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request.
...t'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request console.log("the readystate of this request is " + updatetitlerequest.readystate); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); ...
IDBRequest.source - Web APIs
WebAPIIDBRequestsource
example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request.
...st'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as its title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request console.log("the source of this request is " + updatetitlerequest.source); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specif...
IDBRequest.transaction - Web APIs
example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request.
...t'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // log the transaction that originated this request console.log("the transaction that originated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = f...
IDBTransaction - Web APIs
an actual failure to write to disk, or other os/hardware failure).
...transactions of this mode cannot run concurrently with other transactions.
IdleDeadline.timeRemaining() - Web APIs
for example, if the callback finishes a task and has another one to begin, it can call timeremaining() to see if there's enough time to complete the next task.
... if there isn't, the callback can just return immediately, or look for other work to do with the remaining time.
ImageCapture - Web APIs
the imagecapture interface of the mediastream image capture api provides methods to enable the capture of images or photos from a camera or other photographic device.
...since imagecapture requires some place to capture an image from, the example below starts with a device's media device (in other words a camera).
KeyboardEvent.getModifierState() - Web APIs
the keyboardevent.getmodifierstate() method returns the current state of the specified modifier key: true if the modifier is active (that is the modifier key is pressed or locked), otherwise, false.
... windows logo key) not supported "scrolllock" during led for scroll lock turned on during led for scroll lock turned on, but typically this isn't supported by platform not supported while scrolllock is locked "shift" ⇧ shift key pressed "super" not supported "symbol" not supported "symbollock" not supported on the other platforms, "alt", "control" and "shift" may be supported.
KeyframeEffectOptions - Web APIs
properties composite optional determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation.
...this is primarily of use when sequencing animations based on the end time of another animation.
Long Tasks API - Web APIs
tasks that block the main thread for 50 ms or more cause, among other issues: delayed "time to interactive".
... expensive reflows and other re-renders.
MediaDeviceInfo - Web APIs
it is un-guessable by other applications and unique to the origin of the calling application.
...the set of device labels could otherwise be used as part of a fingerprinting mechanism to identify a user.
MediaDevices.ondevicechange - Web APIs
t-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } h2 { margin-bottom: 4px; } .left { float:left; width: 48%; margin-right: 2% } .right { float:right; width: 48%; margin-left: 2% } .devicelist { border: 1px solid black; list-style-type: none; margin-top: 2px; padding: 6px; } javascript content other code below is other code which, while needed to make this example work, isn'tt related directly to ondevicechange, so we won't go into any detail.
...the second is in the event handler for devicechange: navigator.mediadevices.ondevicechange = function(event) { updatedevicelist(); } with this code in place, each time the user plugs in a camera, microphone, or other media device, or turns one on or off, we call updatedevicelist() to redraw the list of connected devices.
MediaRecorderErrorEvent() - Web APIs
the other fields may or may not be present.
... some user agents add to the error object other properties that provide information such as stack dumps, the name of the javascript file and the line number where the error occurred, and other debugging aids, but you should not rely on this information in a production environment.
MediaSessionActionDetails - Web APIs
this property is not present for other action types.
...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.
active - Web APIs
the active read-only property of the mediastream interface returns a boolean value which is true if the stream is currently active; otherwise, it returns false.
... syntax var isactive = mediastream.active; value a boolean value which is true if the stream is currently active; otherwise, the value is false.
Using the MediaStream Recording API - Web APIs
instead, the problem was solved by making the third container's height equal to 100% of the parent height, minus the heights and padding of the other two: .sound-clips { box-shadow: inset 0 3px 4px rgba(0,0,0,0.7); background-color: rgba(0,0,0,0.1); height: calc(100% - 240px - 0.7rem); overflow: scroll; } note: calc() has good support across modern browsers too, even going back to internet explorer 9.
...first of all, we style the <label> how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: 5; cursor: pointer; } then we hide the actual checkbox, because we don't want it cluttering up our ui: input[type=checkbox] { position: absolute; top: -100px; } next, we style the information screen (wrapped...
MediaTrackConstraints.aspectRatio - Web APIs
if this value is a number, the user agent will attempt to obtain media whose aspect ratio is as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required aspect ratio (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackConstraints.channelCount - Web APIs
syntax var constraintsobject = { channelcount: constraint }; constraintsobject.channelcount = constraint; value if this value is a number, the user agent will attempt to obtain media whose channel count is as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required channel count (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackConstraints.frameRate - Web APIs
if this value is a number, the user agent will attempt to obtain media whose frame rate is as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required frame rate (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackConstraints.height - Web APIs
syntax var constraintsobject = { height: constraint }; constraintsobject.height = constraint; value if this value is a number, the user agent will attempt to obtain media whose height is as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required height (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackConstraints.sampleRate - Web APIs
syntax var constraintsobject = { samplerate: constraint }; constraintsobject.samplerate = constraint; value if this value is a number, the user agent will attempt to obtain media whose sample rate is as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required sample rate (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackConstraints.sampleSize - Web APIs
syntax var constraintsobject = { samplesize: constraint }; constraintsobject.samplesize = constraint; value if this value is a number, the user agent will attempt to obtain media whose sample size (in bits per linear sample) is as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required sample size (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackControls.volume - Web APIs
if this value is a number, the user agent will attempt to obtain media whose volume is as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required volume (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackConstraints.width - Web APIs
syntax var constraintsobject = { width: constraint }; constraintsobject.width = constraint; value if this value is a number, the user agent will attempt to obtain media whose width is as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required width (if exact is specified or both min and max are provided and have the same value) or to a best-possible value.
MediaTrackConstraints - Web APIs
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 resolution.
...these may include backing buffers for windows to allow capture of window contents that are hidden by other windows in front of them, or buffers containing larger documents that need to be scrolled through to see the entire contents in their windows.
MediaTrackSettings.sampleSize - Web APIs
the most commonly used sample size for many years now is 16 bits per sample, which was used for cd audio among others.
... other common sample sizes are 8 (for reduced bandwidth requirements) and 24 (for high-resolution professional audio).
Media Source API - Web APIs
while there are other protocols available (such as http live streaming (hls)), dash has the most platform support.
... extensions to other interfaces url.createobjecturl() creates an object url pointing to a mediasource object that can then be specified as the src value of an html media element to play a media stream.
MerchantValidationEvent.complete() - Web APIs
exceptions this exception may be passed into the rejection handler for the promise: invalidstateerror the event did not come directly from the user agent, but was instead dispatched by other code.
... another payment request is currently being processed, the current payment request is not currently being displayed to the user, or payment information is currently being updated.
MessagePort.postMessage() - Web APIs
the postmessage() method of the messageport interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
... var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addeventlistener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too).
MessagePort - Web APIs
the messageport interface of the channel messaging api represents one of the two ports of a messagechannel, allowing messages to be sent from one port and listening out for them arriving at the other.
... methods inherits methods from its parent, eventtarget postmessage() sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
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.
...truststatus msisboxed msplaytodisabled msplaytopreferredsourceuri msplaytoprimary msplaytosource msrealtime mssetmediaprotectionmanager mssetvideorectangle msstereo3dpackingmode msstereo3drendermode onmsvideoformatchanged onmsvideoframestepcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msisstatichtml navigator.mslaunchuri() mslaunchuricallback element.msmatchesselector() msprotocols msputpropertyenabled mswriteprofilermark ...
MouseEvent.button - Web APIs
WebAPIMouseEventbutton
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.
MutationObserverInit.subtree - Web APIs
subtree can be used in concert with the other options to extend monitoring of attributes, text content, and child lists to the entire subtree rooted at the target node.
...changing this value to true causes the entire subtree rooted at the specified target node to be monitored for the changes indicated by the other options.
Navigator.mediaSession - Web APIs
the read-only navigator property mediasession returns a mediasession object that can be used to share with the browser metadata and other information about the current playback state of media being handled by a document.
... in addition, the mediasession interface provides the setactionhandler() method, which lets you receive events when the user engages device controls such as either onscreen or physical play, pause, seek, and other similar controls.
NavigatorID.userAgent - Web APIs
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.
...each of these pieces of info comes from other navigator properties which are also settable by the user.
Navigator.onLine - Web APIs
in chrome and safari, if the browser is not able to connect to a local area network (lan) or a router, it is offline; all other conditions return true.
...until firefox 41, all other conditions return a true value; testing actual behavior on nightly 68 on windows shows that it only looks for lan connection like chrome and safari giving false positives.
Notification.permission - Web APIs
t's check if the browser supports notifications if (!("notification" in window)) { console.log("this browser does not support desktop notification"); } // let's check whether notification permissions have alredy been granted else if (notification.permission === "granted") { // if it's okay let's create a notification var notification = new notification("hi there!"); } // otherwise, we need to ask the user for permission else if (notification.permission !== 'denied' || notification.permission === "default") { notification.requestpermission(function (permission) { // if the user accepts, let's create a notification if (permission === "granted") { var notification = new notification("hi there!"); } }); } // at last, if the user has...
... denied notifications, and you // want to be respectful there is no need to bother them any more.
OffscreenCanvas - Web APIs
a single offscreencanvas may transfer frames into an arbitrary number of other imagebitmaprenderingcontext objects.
... // commit rendering to the second canvas var bitmaptwo = offscreen.transfertoimagebitmap(); two.transferfromimagebitmap(bitmaptwo); asynchronous display of frames produced by an offscreencanvas another way to use the offscreencanvas api, is to call transfercontroltooffscreen() on a <canvas> element, either on a worker or the main thread, which will return an offscreencanvas object from an htmlcanvaselement object from the main thread.
PannerNode.coneInnerAngle - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
... and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orie...
PannerNode.coneOuterAngle - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
... and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orie...
PannerNode.coneOuterGain - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
... and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orie...
PannerNode.orientationX - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
... and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orie...
PannerNode.orientationY - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
... and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orie...
PannerNode.orientationZ - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
... and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orie...
ParentNode.replaceChildren() - Web APIs
n> </select> </div> <div class="buttons"> <button id="to-yes">transfer to "yes" --&gt;</button> <button id="to-no">&lt;-- transfer to "no"</button> </div> <div> <label for="yes">yes please!</label> <select id="yes" multiple size="10"> </select> </div> </main> it would make sense to use some simple css to lay out the two select lists in a line alongside one another, with the control buttons in between them: main { display: flex; } div { margin-right: 20px; } label, button { display: block; } .buttons { display: flex; flex-flow: column; justify-content: center; } select { width: 200px; } what we want to do is transfer any selected options in the "no" list over to the "yes" list when the "yes" button is pressed, and transfer any selected o...
... to do this, we give each of the buttons a click event handler, which collects together the selected options you want to transfer in one constant, and the existing options in the list you are transferring to in another constant.
Path2D() - Web APIs
WebAPIPath2DPath2D
the path2d() constructor returns a newly instantiated path2d object, optionally with another path as an argument (creates a copy), or optionally with a string consisting of svg path data.
... syntax new path2d(); new path2d(path); new path2d(d); parameters path optional when invoked with another path2d object, a copy of the path argument is created.
Path2D.addPath() - Web APIs
WebAPIPath2DaddPath
the path2d.addpath() method of the canvas 2d api adds one path2d object to another path2d object.
... examples adding a path to an existing path this example adds one path to another.
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.
...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 street these, combined with additional values for other properties of the paymentaddress, would represent the full address, which is: mozilla metal box factory suite 441, 4th floor 30 great guildford street london se1 0hs united kingdom specifications specification status comment payment request apithe definition of 'paymentaddress.addressline' in that specification.
PaymentRequest.show() - Web APIs
once one paymentrequest's show() method has been called, any other call to show() will by rejected with an aborterror until the returned promise has been concluded, either by being fulfilled with a paymentresponse indicating the results of the payment request, or by being rejected with an error.
...other reasons a securityerror may be thrown are at the discretion of the user agent, and may include situations such as too many calls to show() being made in a short time or show() being called while payment requests are blocked by parental controls.
PaymentResponse.retry() - Web APIs
error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment form.
... typically you will use this by calling show(), then entering a loop or recursive function that checks the paymentresponse for errors or other reasons to retry the payment request.
PaymentResponse.shippingOption - Web APIs
}).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingoption, resolve, reject) { var selectedshippingoption; var othershippingoption; if (shippingoption === 'standard') { selectedshippingoption = details.shippingoptions[0]; othershippingoption = details.shippingoptions[1]; details.total.amount.value = '55.00'; } else if (shippingoption === 'express') { selectedshippingoption = details.shippingoptions[1]; othershippingoption = details.shippingoptions[0]; details.total.amount.value = '67...
....00'; } else { reject('unknown shipping option \'' + shippingoption + '\''); return; } selectedshippingoption.selected = true; othershippingoption.selected = false; details.displayitems.splice(2, 1, selectedshippingoption); resolve(details); } specifications specification status comment payment request api candidate recommendation initial definition.
Using the Payment Request API - Web APIs
other useful payment request methods there are some other useful payment request methods worth knowing about.
...te immediate success: paymentresponse.complete('success') .then(function() { // for demo purposes: intropanel.style.display = 'none'; successpanel.style.display = 'block'; }); }).catch(function(error) { if (error.code == domexception.not_supported_err) { window.location.href = 'https://bobpay.xyz/#download'; } else { // other kinds of errors; cancelled or failed payment.
PerformanceNavigationTiming.type - Web APIs
the value must be one of the following: navigate navigation started by clicking a link, entering the url in the browser's address bar, form submission, or initializing through a script operation other than reload and back_forward as listed below.
...og("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'type' in that specification.
PublicKeyCredentialRequestOptions.extensions - Web APIs
also chrome doesn't plan to support any other extension in future extension identifier type description appid usvstring fido appid.
...in other words, this may be used server side to check if the current operation is based on the same biometric data that the previous authentication.
Push API - Web APIs
WebAPIPush API
the endpoint url therefore needs to be kept secret, or other applications might be able to send push messages to your application.
... note: as of gecko 44, the allowed quota of push messages per application is not incremented when a new notification fires, when another is still visible, for a period of three seconds.
RTCDataChannel.send() - Web APIs
typeerror the specified data is too large for the other peer to receive.
... since there are multiple techniques for breaking up large data into smaller pieces for transfer, it's possible to encounter scenarios in which the other peer does not support the same ones.
RTCDataChannelEvent - Web APIs
the channel property provides the rtcdatachannel representing the connection to the other peer.
... pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } see a simple rtcdatachannel sample for another, more complete, example of how to use data channels.
RTCIceCandidate.usernameFragment - Web APIs
another example: it might take a user-defined string and append three 8-bit random bytes to the end.
...otherwise, after checking every receiver, it adds the new candidate to the connection.
RTCIceCandidatePairStats.circuitBreakerTriggerCount - Web APIs
the rtcicecandidatepairstats property circuitbreakertriggercount indicates the number of times the circuit-breaker has been triggered to indicate a connection timeout or other unexpected connection abort on this specific connection configuration.
... a circuit breaker trigger is fired each time the connection times out or otherwise needs to be halted automatically.
RTCIceCandidatePairStats.priority - Web APIs
syntax pairpriority = rtcicecandidatepairstats.priority; value an integer value indicating the priority of this pair of candidates as compared to other pairs on the same peer connection.
... the higher this value, the better the webrtc layer thinks this pair of candidates is compared to the others, and the more likely a pair is to be selelcted for use.
RTCIceCandidateStats.networkType - Web APIs
the string indicates the type of network connection that the described candidate would use to communicate with the other peer.
...for example, if the networktype is wifi but the user is connected using a cellular hotspot, the connection will be bottlenecked by the underlying cellular network (and any other networks between the two peers).
RTCPeerConnection.addIceCandidate() - Web APIs
// this example assumes that the other peer is using a signaling channel as follows: // // pc.onicecandidate = event => { // if (event.candidate) { // signalingchannel.send(json.stringify({ice: event.candidate})); // "ice" is arbitrary // } else { // // all ice candidates have been sent // } // } signalingchannel.onmessage = receivedstring => { const message = json.parse(receivedstring); if (message.ice) { // a ...
...typical value of ice here might look something like this: // // {candidate: "candidate:0 1 udp 2122154243 192.168.1.9 53421 typ host", sdpmid: "0", ...} // // pass the whole thing to addicecandidate: pc.addicecandidate(message.ice).catch(e => { console.log("failure during addicecandidate(): " + e.name); }); } else { // handle other things you might be signaling, like sdp } } the last candidate to be signaled this way by the remote peer will be a special candidate denoting end-of-candidates.
RTCPeerConnection: negotiationneeded event - Web APIs
iption(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer with the other peer.
... the other peer should recognize this message and follow up by creating its own rtcpeerconnection, setting the remote description with setremotedescription(), and then creating an answer to send back to the offering peer.
RTCPeerConnection.setConfiguration() - Web APIs
urn:asia.myturnserver.net", username: "allie@oopcode.com", credential: "topsecretpassword" }] }; mypeerconnection.setconfiguration(restartconfig); mypeerconnection.createoffer({"icerestart": true}).then(function(offer) { return mypeerconnection.setlocaldescription(offer); }) .then(function() { // send the offer to the other peer using the signaling server }) .catch(reporterror); first, a new rtcconfiguration is created, restartconfig, specifying the new ice server and its credentials.
...from there, we handle the process as usual, by setting the local description to the returned offer and then sending that offer to the other peer.
RTCPeerConnectionIceErrorEvent - Web APIs
constructor rtcpeerconnectioniceerrorevent() creates and returns a new rtcpeerconnectioniceerrorevent object, with its type and other properties initialized as specified in the parameters.
... methods rtcpeerconnectioniceerrorevent has no methods other than any provided by the parent interface, event.
RTCRtpSender.setParameters() - Web APIs
in other words, setparameters() updates the configuration of the rtp transmission as well as the encoding configuration for a specific media track on the webrtc connection.
... operationerror any error condition which occurs that isn't covered by one of the other error codes results in an operationerror.
RTCRtpTransceiver - Web APIs
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.
...an rtcrtptransceiver is associated with an m-line if its mid is non-null; otherwise it's considered disassociated.
ReadableStream.getReader() - Web APIs
while the stream is locked, no other reader can be acquired until this one is released.
...each chunk is read sequentially and output to the ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
ReadableStreamDefaultController.error() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultcontroller, or the stream is not readable for some other reason.
... examples the a readable stream with an underlying push source and backpressure support example in the spec provides a good example of using readablestreamdefaultcontroller.desiredsize to manually detect when the stream is full and apply backpressure, and also of using error() to manually trigger a stream error if another part of the system it relies on fails.
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader.
...each chunk is read sequentially and output to the ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
Reporting API - Web APIs
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.
... available report types the spec defines the following report types: deprecation report indicates that a webapi or other browser feature being used in the website is expected to stop working in a future release.
Request.credentials - Web APIs
the credentials read-only property of the request interface indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.
... syntax var mycred = request.credentials; value a requestcredentials dictionary value indicating whether the user agent should send cookies from the other domain in the case of cross-origin requests.
Using the Resource Timing API - Web APIs
the interface also includes other properties that provide data about the size of the fetched resource as well as the type of resource that initiated the fetch.
... the properties which are returned as 0 by default when loading a resource from a domain other than the one of the web page itself: redirectstart, redirectend, domainlookupstart, domainlookupend, connectstart, connectend, secureconnectionstart, requeststart, and responsestart.
SVGAngle - Web APIs
WebAPISVGAngle
unless otherwise described, an svgangle object is not associated with any element.
... exceptions: a domexception with code not_supported_err is raised if unittype is svg_angletype_unknown or not a valid unit type constant (one of the other svg_angletype_* constants defined on this interface).
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.
Sensor APIs - Web APIs
consequently, feature detection is more complicated for sensors than it is for other apis.
... sensorsecure context the base class for all the other sensor interfaces.
ShadowRoot - Web APIs
note that this is currently only implemented by chrome; other browsers still implement them on the document interface.
...note that this is currently only implemented by chrome; other browsers still implement them on the document interface.
SpeechSynthesis.speak() - Web APIs
the speak() method of the speechsynthesis interface adds an utterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken.
...when a form containing the text we want to speak is submitted, we (amongst other things) create a new utterance containing this text, then speak it by passing it into speak() as a parameter.
SpeechSynthesis - Web APIs
the speechsynthesis interface of the web speech api is the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides.
... speechsynthesis.speak() adds an utterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken.
Using writable streams - Web APIs
inside this block we use writablestreamdefaultwriter.ready to check whether the writer is ready to have another chunk written to it.
...this is useful when another part of an app goes wrong, and you want to propagate the error to the stream so that the whole system fails cleanly, rather than risking garbage being silently written to the stream (or something similarly bad).
SubmitEvent.submitter - Web APIs
the read-only submitter property found on the submitevent interface specifies the submit button or other element that was invoked to cause the form to be submitted.
...while this is often an <input> element whose type or a <button> whose type is submit, it could be some other element which has initiated a submission process.
SubmitEvent - Web APIs
constructor submitevent() creates and returns a new submitevent object whose type and other options are configured as specified.
... submitter read only an htmlelement object which identifies the button or other element which was invoked to trigger the form being submitted.
SubtleCrypto.wrapKey() - Web APIs
wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
... one advantage of using aes-kw over another aes mode such as aes-gcm is that aes-kw does not require an initialization vector.
SubtleCrypto - Web APIs
you can import keys from other systems, and support for standard formats like pkcs #8 and json web key helps you do this.
... 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".
TextEncoder.prototype.encodeInto() - Web APIs
otherwise, first allocate for rounduptobucketsize(s.length) and convert.
...for example, if your wasm allocator is known to use power-of-two buckets, rounduptobucketsize() should return the argument if it is a power-of-two or the next power-of-two otherwise.
TouchEvent.targetTouches - Web APIs
in following code snippet, the function compares the length of the touches list to the the length of the targettouches list and returns true if the lengths are the same and returns false otherwise.
... function touches_in_target(ev) { // return true if all of the touches are within the target element; // otherwise return false.
USBEndpoint - Web APIs
data sent through a bulk endpoint is guaranteed to be delivered or generate an error but may be preempted by other data traffic.
...for example, a usb serial device must provide bulk input and output endpoints but their endpoint numbers will depend on what other interfaces the device provides.
ValidityState - Web APIs
if true, the element matches the :valid css pseudo-class; the :invalid css pseudo-class otherwise.
... valuemissing read only a boolean that is true if the element has a required attribute, but no value, or false otherwise.
VideoTrack.label - Web APIs
WebAPIVideoTracklabel
the read-only videotrack property label returns a string specifying the video track's human-readable label, if one is available; otherwise, it returns an empty string.
...otherwise, an empty string ("") is returned.
VideoTrackList.selectedIndex - Web APIs
the read-only videotracklist property selectedindex returns the index of the currently selected track, if any, or -1 otherwise.
... syntax var index = videotracklist.selectedindex; value a number indicating the index of the currently selected track, if any, or -1 otherwise.
WebGL2RenderingContext.getBufferSubData() - Web APIs
gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
WebGLRenderingContext.bufferData() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
WebGLRenderingContext.bufferSubData() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
others are assigned by the webgl layer when you create the attributes.
...once that's been done, other methods can be used to access the attribute, including vertexattribpointer(), vertexattrib*(), and getvertexattrib().
WebGLRenderingContext.getBufferParameter() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
WebGLRenderingContext.getUniformLocation() - Web APIs
once you have the uniform's location, you can access the uniform itself using one of the other uniform access methods, passing in the uniform location as one of the inputs: getuniform() returns the value of the uniform at the given location.
...with this value in hand, you can call other webgl methods to access the value of the uniform variable.
WebGLRenderingContext - Web APIs
webglrenderingcontext.iscontextlost() returns true if the context is lost, otherwise returns false.
...this is also done in other graphics {̣{glossary("api")}}, such as the canvas 2d rendering context.
Clearing with colors - Web APIs
all other methods are for setting and querying webgl state variables (such as the clear color).
...otherwise, initialize // the drawing buffer (the viewport) and clear the context // with a solid color.
Lighting in WebGL - Web APIs
in other words, if you want lighting you have to calculate it yourself.
...this is light that's coming from so far away that every photon is moving parallel to every other photon.
Using textures in WebGL - Web APIs
on the other hand if the texture is a power of 2 in both dimensions then webgl can do higher quality filtering, it can use mipmap, and it can set the wrapping mode to repeat or mirrored_repeat.
...in order for your content to load a texture from another domain, cors approval needs to be be obtained.
Introduction to WebRTC protocols - Web APIs
this obviously comes with some overhead so it is only used if there are no other alternatives.
...so that both peers can understand each other once the data is transferring.
The WebSocket API (WebSockets) - Web APIs
it consists of a c wrapper around websockets and webrtc that abstracts away cross-browser differences, facilitating the creation of multi-user networking functionality for games and other apps.
... signalr: signalr will use websockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same.
WebXR performance guide - Web APIs
while an individual vector or matrix doesn't occupy an inordinate amount of memory, the sheer number of vectors and matrices and other structures that are used to build each frame of a 3d scene means the memory management becomes a problem eventually if you keep allocating and de-allocating memory objects.
... you're now protected from several possible coding mistakes, and your entire animation will be smoother and more performant as well.
WebXR permissions and security - Web APIs
among other things, you need to confirm access to device features such as the microphone and/or camera, get permission to use immersive vr mode (if applicable), and so forth.
...otherwise, an appropriate exception is thrown, such as securityerror if the document doesn't have permission to enter immersive mode.
Web Animations API Concepts - Web APIs
this means we can use it to create and manipulate css-like animations that go from one pre-defined state to another, or we can use variables, loops, and callbacks to create interactive animations that adapt and react to changing inputs.
...in the future we may see timeline objects that correspond to the length of the page, perhaps a scrolltimeline, or other things entirely.
Web Audio API best practices - Web APIs
although it doesn't harness the full gamut of filters and other effects the web audio api comes with, you can do most of what you'd want to do.
... user control if your website or application contains sound, you should allow the user control over it, otherwise again, it will become annoying.
Example and tutorial: Simple synth keyboard - Web APIs
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.
...if any other waveform type is selected in the wave picker, we simply set the oscillator's type to the value of the picker; that value will be one of sine, square, triangle, and sawtooth.
Web audio spatialization basics - Web APIs
as if its extensive variety of sound processing (and other) options wasn't enough, the web audio api also includes facilities to allow 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.
...we rolled our own in this article to give you an idea of how it works, but you'll save a lot of time by taking advantage of work others have done before you.
Functions and classes available to Web Workers - Web APIs
workers run in another global context, dedicatedworkerglobalscope, different from the current window.
... basic implementation (yes) appcodename, product, taintenabled(): 28 (28) online: 29 (29) navigatorlanguage: (yes) appname, appversion, online, platform, useragent: 10.0 other: no support (yes) (yes) xmlhttprequest creates and returns a new xmlhttprequest object; this mimics the behavior of the standard xmlhttprequest() constructor.
The structured clone algorithm - Web APIs
it is used internally to transfer data between workers via postmessage(), storing objects with indexeddb, or copying objects for other apis.
... blob file filelist arraybuffer arraybufferview including other typed arrays.
Window.getSelection() - Web APIs
where display: none is set) firefox will return null, whereas other browsers will return a selection object with selection.type set to none.
...this can make the object appear to be a string when used with other functions when it is really an object with properties and methods.
Window: message event - Web APIs
the message event is fired on a window object when the window receives a message, for example from a call to window.postmessage() from another browsing context.
... bubbles no cancelable no interface messageevent event handler property onmessage examples suppose a script sends a message to a different browsing context, such as another <iframe>, using code like this: const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const windowmessagebutton = document.queryselector('#window-message'); windowmessagebutton.addeventlistener('click', () => { targetframe.postmessage('hello there', targetorigin); }); the receiver can listen for the message using addeventlistener() with code like this: window.addeventlistener('message', (event) => { console.log(`received message: ${event.data}`); }); alternatively the listener could use the onmessage event handler property: ...
Window.openDialog() - Web APIs
WebAPIWindowopenDialog
(another example).
...the variables specified in the javascript code which gets loaded from the dialog), it is not possible to pass return values back past the close operation using globals (or any other constructs).
Window.opener - Web APIs
WebAPIWindowopener
in other words, if window a opens window b, b.opener returns a.
...if this window was not opened by being linked to or created by another, returns null.
Window.requestFileSystem() - Web APIs
the returned filesystem is then available for use with the other file system apis.
... even compared to the rest of the file and directory entries api, requestfilesystem() is especially non-standard; only chrome implements it, and all other browser makers have decided that they will not implement it.
window.requestIdleCallback() - Web APIs
you can call requestidlecallback() within an idle callback function to schedule another callback to take place no sooner than the next pass through the event loop.
... a timeout option is strongly recommended for required work, as otherwise it's possible multiple seconds will elapse before the callback is fired.
WindowEventHandlers.onstorage - Web APIs
the storage event fires when a storage area has been changed in the context of another document.
... example this example logs the value for a storage key whenever it changes in another document.
WindowOrWorkerGlobalScope.btoa() - Web APIs
you can use this method to encode data which may otherwise cause communication problems, transmit it, then use the atob() method to decode the data again.
...every ascii character fits into the first byte of one of these units, but many other characters don't.
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.queuemicrotask() enqueues a microtask—a short function to be executed after execution of the javascript code completes and control isn't being returned to a javascript caller, but before handling callbacks and other tasks.
... this lets your code run without interfering with other, possibly higher priority, code, but before the browser runtime regains control, potentially depending upon the work you need to complete.
WritableStreamDefaultWriter - Web APIs
the writablestreamdefaultwriter interface of the the streams api is the object returned by writablestream.getwriter() and once created locks the writer to the writablestream ensuring that no other streams can write to the underlying sink.
...if the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
HTML in XMLHttpRequest - Web APIs
this throws an error in the browsers that implement the feature and works on others.
...otherwise, the file is decoded as utf-8.
Using XMLHttpRequest in IE6 - Web APIs
however, in ie7 and other browsers xmlhttprequest is a native javascript object.
... in all modern browsers, you can create a new xmlhttprequest object using the following code: var request = new xmlhttprequest() however, if you need to also support internet explorer 6 and older, you need to extend your code like this: if (window.xmlhttprequest) { //firefox, opera, ie7, and other browsers will use the native object var request = new xmlhttprequest(); } else { //ie 5 and 6 will use the activex control var request = new activexobject("microsoft.xmlhttp"); } see also using xmlhttprequest ...
XRFrame.getPose() - Web APIs
WebAPIXRFramegetPose
the xrframe method getpose() returns the relative position and orientation—the pose—of one xrspace to that of another space.
... with this, you can observe the motion of objects relative to each other and to fixed locations throughout the scene.
XRInputSource.targetRayMode - Web APIs
screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input device.
... the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks.
XRInputSource - Web APIs
if the device includes a trigger or other squeezable input, such as a hand gesture device that recognizes when the user squeezes their fist, that action is called a primary squeeze action.
... if the device has a button or other pressable input control, it is a primary input source, and this button is a primary action.
XRPermissionDescriptor.mode - Web APIs
important: the immersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation.
... let xrpermissiondesc = { name: "xr", mode: "immersive-vr" }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor.mode' in that specification.
XRPermissionDescriptor.optionalFeatures - Web APIs
otherwise, typically, one of the other reference space types will be used more often.
...e notes examples let xrpermissiondesc = { name: "xr", mode: "immersive-vr", optionalfeatures: [ "bounded-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor.optionalfeatures' in that specification.
XRPermissionDescriptor.requiredFeatures - Web APIs
otherwise, typically, one of the other reference space types will be used more often.
... let xrpermissiondesc = { name: "xr", mode: "immersive-ar", requiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor.requiredfeatures' in that specification.
XRPermissionDescriptor - Web APIs
and for any other returned state—which is almost certainly denied, which is the only other option as of this article's writing—we do nothing, since we can't use webxr.
... let xrpermissiondesc = { name: "xr", mode: "immersive-vr", requiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor' in that specification.
XRReferenceSpace: reset event - Web APIs
for a bounded-floor reference space, the coordinate system can be reset if the user exits the boundaries of the reference space and enters a new one (such as by crossing from one level to another in a game, where each level is its own map with its own coordinate system).
... the 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.
XRRigidTransform() - Web APIs
among other things, xrrigidtransform is used when providing a transform to translate between coordinate systems across spaces.
...after creating an xrrigidtransform from the viewer's initial position and orientation, we pass the new transform into getoffsetreferencespace() to create another reference space, now offset so that its origin is located at the same place in space as the coordinates given by viewerposition, with the orientation also revised in the same fashion.
XRRigidTransform.inverse - Web APIs
the read-only inverse property of the xrrigidtransform interface returns another xrrigidtransform object which is the inverse of its owning transform.
...in other words, its position and orientation both return to their prior configurations.
XRSession.updateRenderState() - Web APIs
the default value is otherwise π * 0.5 (half of the value of pi).
... the baselayer specified in newstate was created by an xrsession other than the one on which updaterenderstate() was called.
XRSystem: isSessionSupported() - Web APIs
otherwise, the promise resolves with false.
... return value a promise that resolves to true if the specified session mode is supported; otherwise the promise resolves to false.
XRTargetRayMode - Web APIs
screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input device.
... the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks.
XRWebGLLayer.antialias - Web APIs
otherwise, this property's value is false.
...otherwise, this property is false.
XRWebGLLayer.framebuffer - Web APIs
otherwise, this property's value is null.
... opaque framebuffers are considered incomplete and are not available for rendering other than while executing the requestanimationframe() callback.
XRWebGLLayer.ignoreDepthValues - Web APIs
otherwise, if this is true, the depth buffer's values are being used to assist in placing objects in the scene.
... since the xr compositor uses the depth buffer by default, this value is false unless explicitly set otherwise when creating the xrwebgllayer using its constructor, xrwebgllayer().
XRWebGLLayer - Web APIs
although xrwebgllayer is currently the only type of framebuffer layer supported by webgl, it's entirely possible that future updates to the webxr specification may allow for other layer types and corresponding image sources.
...in current webxr implementations, there will never be more than two entries in this list: one describing the position and viewing angle of the left eye and another doing the same for the right.
ARIA Screen Reader Implementors Guide - Accessibility
it is probably desirable to have at least a tiny timeout before presenting atomic region changes, in order to avoid presenting the region twice for two changes that occur quickly one after the other.
... ideas for settings and heuristics allow for a different voice (in text-to-speech) or other varying presentational characteristics to set live changes apart.
Using the alertdialog role - Accessibility
additionally, alert dialogs can have other interactive controls such as text fields, tabs or checkboxes.
...in other words, when a dialog's information and controls require the user's immediate attention alertdialog should be used instead of dialog.
ARIA: timer role - Accessibility
set in response to keyboard or other application events that change focus or point of interaction.
...all aspects of interaction, including returning to the regular web content on other parts of the page, must be handled.
ARIA: contentinfo role - Accessibility
examples <body> <!-- other page content --> <div role="contentinfo"> <h2>mdn web docs</h2> <ul> <li><a href="#">web technologies</a></li> <li><a href="#">learn web development</a></li> <li><a href="#">about mdn</a></li> <li><a href="#">feedback</a></li> </ul> <p>© 2005-2018 mozilla and individual contributors.
...use other content sectioning elements instead.
ARIA: grid role - Accessibility
uses fall into two categories: presenting tabular information (data grids) and grouping other widgets (layout grids).
... states and properties aria-level indicates the hierarchical level of the grid within other structures.
ARIA: row role - Accessibility
if the interaction provides for the selection state of individual cells, if left to right and top to botton navigation is provided, or if the user interface allows the rearranging of cell order or otherwise changing individual cell order such as through drag and drop, use grid or treegrid instead.
... if the element with the aria-expanded attribute controls the expansion of another grouping container that is not 'owned by' the element, the author should reference the container by using the aria-controls attribute.
ARIA: switch role - Accessibility
text in these elements remains visible to the user agent and may be read or otherwise delivered to the user, unless it's expressly hidden using display: none or aria-hidden="true".
... there are varying opinions on how assistive technologies should handle this role; the above is a suggested practice and may differ from other sources.
ARIA: table role - Accessibility
all other semantic table elements, such as <tbody>, <thead>, <tr>, <th>, and <td> need to be added via associated roles, such as rowgroup, row, columnheader, and cell.
...if the interaction provides for the selection state of individual cells, if left to right and top to bottom navigation is provided, or if the user interface allows the rearranging of cell order or otherwise changing individual cell order such as through drag and drop, use grid or treegrid instead.
Web applications and ARIA FAQ - Accessibility
another alternative is to use the html5 doctype, which includes built-in support for aria.
... other helpful testing tools and techniques for aria-enabled applications and widgets: yahoo!'s aria bookmarklets fluid project's simple accessibility evaluation techniques where do aria discussions happen?
Basic form hints - Accessibility
<button aria-describedby="descriptionrevert">revert</button> <div id="descriptionrevert">reverting will undo any changes that have been made since the last save.</div> note: the aria-describedby attribute is used for other purposes, in addition to form controls.
...uired="false"/> </div> <div> <label for="email">* e-mail:</label> <input type="text" value="email" id="email" aria-required="true"/> </div> </form> the script that validates the form entry would look something like this: var validate = function () { var emailelement = document.getelementbyid(emailfieldid); var valid = emailvalid(formdata.email); // returns true if valid, false otherwise emailelement.setattribute("aria-invalid", !valid); setelementbordercolour(emailelement, valid); // sets the border to red if second arg is false }; providing helpful error messages read how to use aria alerts to enhance forms.
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
“days” could easily be “months” or “years”, and in many ordinary dialogs, there is no way to find this out other than navigating around with screen reviewing commands.
...this technique works in firefox; however, it doesn't currently work in many other browsers, including ie.
ARIA - Accessibility
it supplements html so that interactions and widgets commonly used in applications can be passed to assistive technologies when there is not otherwise a mechanism.
... support like any other web technology, there are varying degrees of support for aria.
Community - Accessibility
this document provides links to mailing lists, newsgroups, forums, and other communities related to accessbility.
... if you know of other useful resources, please link to them here.
Robust - Accessibility
success criteria how to conform to the criteria practical resource 4.1.1 parsing (a) content should be well-formed so it can be parsed successfully by browsers and other user agents such as screenreaders.
...when scripting custom components, you will need to use wai-aria roles and other features to make sure your controls will be interpreted and are able to be used as intended, e.g.
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.
... other documentation understanding the web content accessibility guidelines this set of articles provides quick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the w3c web content accessibility guidelines 2.0 (wcag 2.0 or just wcag, for the purposes of this writing).
-webkit-border-before - CSS: Cascading Style Sheets
it relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element.
...itial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritedyespercentagesas each of the properties of the shorthand:-webkit-border-before-width: logical-width of containing blockcomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if bor...
-webkit-mask-position-x - CSS: Cascading Style Sheets
/ -webkit-mask-position-x: 50px; -webkit-mask-position-x: -1cm; /* multiple values values */ -webkit-mask-position-x: 50px, 25%, -3em; /* global values */ -webkit-mask-position-x: inherit; -webkit-mask-position-x: initial; -webkit-mask-position-x: unset; initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete syntax values <length-percentage> a length indicating the position of the left edge of the image relative to the box's left padding edge.
... formal definition initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax [ <length-percentage> | left | center | right ]#where <length-percentage> = <length> | <percentage> examples horizontally positioning a mask image .exampleone { -webkit-mask-image: url(mask.png); -webkit-mask-position-x: right; } .exampletwo { -webkit-mask-image: url(mask.png); -webkit-mask-position-x: 25%; } specifications not...
-webkit-mask-position-y - CSS: Cascading Style Sheets
/ -webkit-mask-position-y: 50px; -webkit-mask-position-y: -1cm; /* multiple values values */ -webkit-mask-position-y: 50px, 25%, -3em; /* global values */ -webkit-mask-position-y: inherit; -webkit-mask-position-y: initial; -webkit-mask-position-y: unset; initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete syntax values <length-percentage> a length indicating the position of the top side of the image relative to the box's top padding edge.
... formal definition initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete formal syntax [ <length-percentage> | top | center | bottom ]#where <length-percentage> = <length> | <percentage> examples vertically positioning a mask image .exampleone { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: bottom; } .exampletwo { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: 25%; } specifications not ...
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added.
...example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added.
:-moz-focusring - CSS: Cascading Style Sheets
the :-moz-focusring css pseudo-class is a mozilla extension that is similar to the :focus pseudo-class, but it only matches an element if it's currently focused and a focus ring or other indicator should be drawn around it.
...whether the user agent has focus ring drawing enabled can depend on operating system settings and other factors, so the precise behavior of this pseudo-class will vary from platform to platform.
::-webkit-scrollbar - CSS: Cascading Style Sheets
::-webkit-scrollbar is only available in blink- and webkit-based browsers (e.g., chrome, edge, opera, safari, all browsers on ios, and others).
... examples .visible-scrollbar, .invisible-scrollbar, .mostly-customized-scrollbar { display: block; width: 10em; overflow: auto; height: 2em; } .invisible-scrollbar::-webkit-scrollbar { display: none; } /* demonstrate a "mostly customized" scrollbar * (won't be visible otherwise if width/height is specified) */ .mostly-customized-scrollbar::-webkit-scrollbar { width: 5px; height: 8px; background-color: #aaa; /* or add it to the track */ } /* add a thumb */ .mostly-customized-scrollbar::-webkit-scrollbar-thumb { background: #000; } <div class="visible-scrollbar"> etiam sagittis sem sed lacus laoreet, eu fermentum eros auctor.
::first-letter (:first-letter) - CSS: Cascading Style Sheets
the ::first-letter css pseudo-element applies styles to the first letter of the first line of a block-level element, but only when not preceded by other content (such as images or inline tables).
...punctuation includes any unicode character defined in the open (ps), close (pe), initial quote (pi), final quote (pf), and other punctuation (po) classes.
:active - CSS: Cascading Style Sheets
WebCSS:active
other common targets of this pseudo-class include elements that contain an activated element, and form elements that are being activated through their associated <label>.
...to style links appropriately, put the :active rule after all other link-related rules, as defined by the lvha-order: :link — :visited — :hover — :active.
:first - CSS: Cascading Style Sheets
WebCSS:first
all other properties will be ignored.
...the words on the first page should be somewhere around the center, while other pages will have their contents at the default position.
:host-context() - CSS: Cascading Style Sheets
in other words, this allows a custom element, or anything within that custom element's shadow dom, to apply different styles based on its position within the outer dom or classes/attributes applied to ancestor elements.
... another typical use would be to allow inner elements to react to classes or attributes on any anscestor elements - for example, applying a different text color when a .dark-theme class is applied to <body>.
:scope - CSS: Cascading Style Sheets
WebCSS:scope
<style scoped> made it possible to explicitly set up element scopes, but ongoing discussions about the design of this feature as well as lack of other implementations resulted in the decision to remove it.
...<style scoped> made it possible to explicitly set up element scopes, but ongoing discussions about the design of this feature as well as lack of other implementations resulted in the decision to remove it.
:valid - CSS: Cascading Style Sheets
WebCSS:valid
the :valid css pseudo-class represents any <input> or other <form> element whose contents validate successfully.
...the email input on the other hand is valid when empty, as it is not required, but invalid when it contains something that is not a proper email address.
:visited - CSS: Cascading Style Sheets
WebCSS:visited
syntax :visited examples properties that would otherwise have no color or be transparent cannot be modified with :visited.
...thus, if you want to modify the other properties, you'll need to give them a base value outside the :visited selector.
speak-as - CSS: Cascading Style Sheets
for all other cases, specifying auto has the same effect as specifying speak-as: numbers.
... <counter-style-name> the name of another counter style, specified as a <custom-ident>.
system - CSS: Cascading Style Sheets
extends allows authors to use the algorithm of another counter style, but alter its other aspects.
...l <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> css @counter-style upper-roman { system: additive; range: 1 3999; additive-symbols: 1000 m, 900 cm, 500 d, 400 cd, 100 c, 90 xc, 50 l, 40 xl, 10 x, 9 ix, 5 v, 4 iv, 1 i; } ul { list-style: upper-roman; } result extends example this example will use the algorithm, symbols, and other properties of the lower-alpha counter style, but will remove the period ('.') after the counter representation, and enclose the characters in paranthesis; like (a), (b), etc.
@import - CSS: Cascading Style Sheets
WebCSS@import
the @import css at-rule is used to import style rules from other style sheets.
... description imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules.
@namespace - CSS: Cascading Style Sheets
any @namespace rules must follow all @charset and @import rules, and precede all other at-rules and style declarations in a style sheet.
...in other words, attributes do not inherit the namespace of the element they're on.
max-height - CSS: Cascading Style Sheets
syntax /* keyword value */ max-height: auto; /* <length> values */ max-height: 400px; max-height: 50em; max-height: 20cm; /* <percentage> value */ max-height: 75%; values auto the used value is calculated from the other css descriptors' values.
... formal definition related at-rule@viewportinitial valueautopercentagesrefer to the height of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport max height in pixels @viewport { max-height: 600px; } specifications specification status comment css device adaptationthe definition of '"max-height" descriptor' in that specification.
max-width - CSS: Cascading Style Sheets
syntax /* keyword value */ max-width: auto; /* <length> values */ max-width: 600px; max-width: 80em; max-width: 15cm; /* <percentage> value */ max-width: 75%; values auto the used value is calculated from the other css descriptors' values.
... formal definition related at-rule@viewportinitial valueautopercentagesrefer to the width of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport max width in pixels @viewport { max-width: 600px; } specifications specification status comment css device adaptationthe definition of '"max-width" descriptor' in that specification.
min-height - CSS: Cascading Style Sheets
syntax /* keyword value */ min-height: auto; /* <length> values */ min-height: 120px; min-height: 20em; min-height: 10cm; /* <percentage> value */ min-height: 25%; values auto the used value is calculated from the other css descriptors' values.
... formal definition related at-rule@viewportinitial valueautopercentagesrefer to the height of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport min height in pixels @viewport { min-height: 200px; } specifications specification status comment css device adaptationthe definition of '"min-height" descriptor' in that specification.
min-width - CSS: Cascading Style Sheets
syntax /* keyword value */ min-width: auto; /* <length> values */ min-width: 320px; min-width: 40em; min-width: 5cm; /* <percentage> value */ min-width: 25%; values auto the used value is calculated from the other css descriptors' values.
... formal definition related at-rule@viewportinitial valueautopercentagesrefer to the width of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport min width in pixels @viewport { min-width: 200px; } specifications specification status comment css device adaptationthe definition of '"min-width" descriptor' in that specification.
Coordinate systems - CSS: Cascading Style Sheets
in other words, scrolling the document will change the client coordinates of a given position within the document.
...that means that a given point in an element within the document will keep the same coordinates in the page model unless the element moves (either directly by changing its position or indirectly by adding or resizing other content).
CSS Animations tips and tricks - CSS: Cascading Style Sheets
this has the effect of removing any other classes currently applied to the box, including the "changing" class that handles animation.
... in other words, we're removing the animation effect from the box.
CSS Animations - CSS: Cascading Style Sheets
the behavior of these keyframe animations can be controlled by specifying their timing function, duration, their number of repetitions, and other attributes.
...this article describes each relevant css property and at-rule and explains how they interact with each other.
Box alignment in grid layout - CSS: Cascading Style Sheets
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 allows them to be used for other layout methods where a gap between items makes sense.
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
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.
...the third item has more content than the others yet is set to visibility: collapse and therefore the flex container is retaining a strut of the height required to display this item.
Flow Layout and Overflow - CSS: Cascading Style Sheets
controlling overflow there are other values that control how overflow content behaves.
... as we have already learned, using any of these values, other than the default of visible, will create a new block formatting context.
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
logical properties and values once you are working in writing modes other than horizontal-tb many of the properties and values that are mapped to the physical dimensions of the screen seem strange.
... the css logical properties and values specification includes logical versions of the properties that control margins, padding and borders as well as other mappings for things that we have typically used physical directions to specify.
In Flow and Out of Flow - CSS: Cascading Style Sheets
out of flow essentially means that the other elements on your page no longer know that element exists so will not respond to it.
...whether that involves clearing floats, or ensuring that an element with position: absolute does not sit on top of some other content.
CSS Fonts - CSS: Cascading Style Sheets
WebCSSCSS Fonts
ont-face font-family font-feature-settings font-style font-variant font-weight font-stretch src unicode-range @font-feature-values guides fundamental text and font styling in this beginner's learning article we go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing.
...these include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others.
Layout using named grid lines - CSS: Cascading Style Sheets
to address another line use the name, plus the number for that line.
... .wrapper { grid-template-columns: repeat(4, [col1-start] 1fr [col2-start] 3fr); } if your repeating syntax puts two lines next to each other then they will be merged, and create the same result as giving a line multiple names in a non-repeating track definition.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
.box1 { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 4; } as you position some items, other items on the grid will continue to be laid out using the auto-placement rules.
... also, remember that items on the grid can overlap each other when you place them explicitly like this.
Subgrid - CSS: Cascading Style Sheets
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.
... using subgrids other than needing to take care of items that do not fit in your subgrid, a subgrid acts very similarly to any nested grid; the only difference is that the track sizing of the subgrid is set on the parent grid.
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
when working with a site in a writing mode other than a horizontal, top to bottom one, or when using writing modes for creative reasons, being able to relate to the flow of the content makes a lot of sense.
... the block dimension is the other dimension, and the direction in which blocks — such as paragraphs — display one after the other.
CSS Miscellaneous - CSS: Cascading Style Sheets
these pages contain css properties that are highly experimental or don't fit in any other categories.
... specifications these properties are mostly unrelated to each other.
Stacking context example 1 - CSS: Cascading Style Sheets
if div #2 is assigned a positive (non-zero and non-auto) z-index value, it is rendered above all the other divs.
... then if div #4 is also assigned a positive z-index greater than div #2's z-index, it is rendered above all the other divs including div #2.
Basic Shapes - CSS: Cascading Style Sheets
.shape { shape-outside: circle(50%) border-box; } what is worth noting is that the margin-box will clip the shape, therefore shapes created in reference to other shapes which extend past the margin box will have the shape clipped to the margin box.
... another useful resource is clippy - a tool for creating shapes for clip-path, as the values for basic shapes are the same as those used for clip-path.
CSS Transitions - CSS: Cascading Style Sheets
the behavior of these transitions can be controlled by specifying their timing function, duration, and other attributes.
...this article describes each relevant css property and explains how they interact with each other.
Comments - CSS: Cascading Style Sheets
WebCSSComments
there is no other way to specify comments in external style sheets.
...in other words, the first instance of */ that follows an instance of /* closes the comment.
Layout and the containing block - CSS: Cascading Style Sheets
if the position property is absolute, the containing block is formed by the edge of the padding box of the nearest ancestor element that has a position value other than static (fixed, absolute, relative, or sticky).
... if the position property is absolute or fixed, the containing block may also be formed by the edge of the padding box of the nearest ancestor element that has the following: a transform or perspective value other than none a will-change value of transform or perspective a filter value other than none or a will-change value of filter (only works on firefox).
Inline formatting context - CSS: Cascading Style Sheets
inline boxes are laid out one after the other, in the direction sentences run in the writing mode in use: in a horizontal writing mode, boxes are laid out horizontally, starting on the left.
...this box will be large enough to contain all of the inline boxes in that line; when there is no more room in the inline direction another line will be created.
Card - CSS: Cascading Style Sheets
note: the various elements in separate cards do not align with each other, as each card is an independent grid.
... 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.
CSS Layout cookbook - CSS: Cascading Style Sheets
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.
... css grid, flexbox split navigation a navigation pattern where some links are visually separated from the others.
Layout mode - CSS: Cascading Style Sheets
positioned layout, designed for positioning elements without much interaction with other elements.
...most of them apply to one or two of them and have no effect if they are set on an element participating in another layout mode.
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
ansition-propertytransition-timing-functiontranslatetranslate()translate3d()translatex()translatey()translatez()turnuunicode-bidiunicode-range (@font-face)unset<url>url()user-zoom (@viewport)v:validvar()vertical-alignvh@viewportviewport-fit (@viewport)visibility:visitedvmaxvminvwwwhite-spacewidowswidthwidth (@viewport)will-changeword-breakword-spacingword-wrapwriting-modexxzz-indexzoom (@viewport)others--* selectors the following are the various selectors, which allow styles to be conditional based on various features of elements within the dom.
... basic selectors basic selectors are fundamental selectors; these are the most basic selectors that are frequently combined to create other, more complex selectors.
Replaced elements - CSS: Cascading Style Sheets
the only other impact css can have on a replaced element is that there are properties which support controlling the positioning of the element's content within its box.
...however, other form controls, including other types of <input> elements, are explicitly listed as non-replaced elements (the spec describes their default platform-specific rendering with the term "widgets").
CSS Tutorials - CSS: Cascading Style Sheets
WebCSSTutorials
some are aimed at complete beginners, while others present complex features to be used by more experienced users.
... css gradients gradients are images that transition smoothly from one color to another.
animation-direction - CSS: Cascading Style Sheets
in other words, each time the animation cycles, the animation will reset to the beginning state and start over again.
...in other words, each time the animation cycles, the animation will reset to the end state and start over again.
attr() - CSS: Cascading Style Sheets
WebCSSattr
note: the attr() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse.
... candidate recommendation added two optional parameters; can be used on all properties; may return values other than <string>.
background-attachment - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples simple example html <p> there were doors all round the hall, but they were all locked; and when alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again.
... html <p> there were doors all round the hall, but they were all locked; and when alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again.
background-repeat - CSS: Cascading Style Sheets
round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room (space left >= half of the image width) for another one to be added.
...example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added.
background-size - CSS: Cascading Style Sheets
the other dimension is computed using the specified dimension and the intrinsic proportions.
... if the image has only one intrinsic dimension but has no intrinsic proportions, it's rendered using the specified dimension and the other dimension of the background positioning area.
<basic-shape> - CSS: Cascading Style Sheets
interpolation of basic shapes when animating between one <basic-shape> and another, the rules below are applied.
... in all other cases no interpolation occurs.
<blend-mode> - CSS: Cascading Style Sheets
a black layer has no effect, while a white layer inverts the other layer's color.
... as with difference, a black layer has no effect, while a white layer inverts the other layer's color.
block-size - CSS: Cascading Style Sheets
alues */ block-size: 300px; block-size: 25em; /* <percentage> values */ block-size: 75%; /* keyword values */ block-size: max-content; block-size: min-content; block-size: fit-content(20em); block-size: auto; /* global values */ block-size: inherit; block-size: initial; block-size: unset; if the writing mode is vertically oriented, the value of block-size relates to the width of the element; otherwise, it relates to the height of the element.
... a related property is inline-size, which defines the other dimension of the element.
border-block-start - CSS: Cascading Style Sheets
related properties are border-block-end, border-inline-start, and border-inline-end, which define the other borders of the element.
...itial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenb...
border-bottom-width - CSS: Cascading Style Sheets
full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support see also the other border-width-related css properties: border-left-width, border-right-width, border-top-width, and border-width.
... the other border-bottom-related css properties: border, border-bottom, border-bottom-style, and border-bottom-color.
border-inline-start - CSS: Cascading Style Sheets
related properties are border-block-start, border-block-end, and border-inline-end, which define the other borders of the element.
...itial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenb...
border-left-style - CSS: Cascading Style Sheets
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 properties: border-left, border-left-color, and border-left-width.
border-right-style - CSS: Cascading Style Sheets
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 properties: border-right, border-right-color, and border-right-width.
border-style - CSS: Cascading Style Sheets
in the case of table cell and border collapsing, the none value has the lowest priority: if any other conflicting border is set, it will be displayed.
...in the case of table cell and border collapsing, the hidden value has the highest priority: if any other conflicting border is set, it won't be displayed.
bottom - CSS: Cascading Style Sheets
WebCSSbottom
in all other situations, if height is constrained in any way or position is set to relative, the top property takes precedence and the bottom property is ignored.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the height of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples absolute and fixed positioning this example demonstrates the difference in behavior of the bottom property, when position is absolute versus fixed.
box-sizing - CSS: Cascading Style Sheets
on the other hand, when using position: relative or position: absolute, use of box-sizing: content-box allows the positioning values to be relative to the content, and independent of changes to border and padding sizes, which is sometimes desirable.
... formal definition initial valuecontent-boxapplies toall elements that accept width or heightinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box examples box sizes with content-box and border-box this example shows how different box-sizing values alter the rendered size of two otherwise identical elements.
caret-color - CSS: Cascading Style Sheets
on the other hand, the mouse cursor image shown when hovering over text where the cursor property is auto, or when hovering over an element where the cursor property is text or vertical-text, though it sometimes looks like a caret, is not a caret (it’s a cursor).
...this is generally currentcolor, but the user agent may choose a different color to ensure good visibility and contrast with the surrounding content, taking into account the value of currentcolor, the background, shadows, and other factors.
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
note: a computed value other than none results in the creation of a new stacking context the same way that css opacity does for values other than 1.
... formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to reference box when specified, otherwise border-boxcomputed valueas specified, but with <url> values made absoluteanimation typeyes, as specified for <basic-shape>, otherwise no formal syntax <clip-source> | [ <basic-shape> | <geometry-box> ] | nonewhere <clip-source> = <url><basic-shape> = <inset()> | <circle()> | <ellipse()> | <polygon()> | <path()><geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <inset()> = inset( <length-percentage>{1,4} [ round <'border-radius'> ]?
color - CSS: Cascading Style Sheets
WebCSScolor
currentcolor may be used as an indirect value on other properties and is the default for other color properties, such as border-color.
... webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial valuevaries from one browser to anotherapplies toall elements.
counter() - CSS: Cascading Style Sheets
WebCSScounter
note: the counter() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse.
... <counter-style> a counter style name or symbols() function, where a counter style name is a numeric, alphabetic, or symbolic simple predefined counter style, a complex longhand east asian or ethiopic predefined counter style, or other predefined counter style.
counters() - CSS: Cascading Style Sheets
WebCSScounters
note: the counters() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse.
... <counter-style> a counter style name or symbols() function, where a counter style name is a numeric, alphabetic, or symbolic simple predefined counter style, a complex longhand east asian or ethiopic predefined counter style, or other predefined counter style.
<custom-ident> - CSS: Cascading Style Sheets
on the other hand, as there are several ways to escape a character, toto\?
...moreover, the first character must not be a decimal digit, nor a hyphen (-) followed by a decimal digit or another hyphen.
<display-inside> - CSS: Cascading Style Sheets
otherwise it generates a block container box.
... depending on the value of other properties (such as position, float, or overflow) and whether it is itself participating in a block or inline formatting context, it either establishes a new block formatting context (bfc) for its contents or integrates its contents into its parent formatting context.
flex-basis - CSS: Cascading Style Sheets
it sets the size of the content box unless otherwise set with box-sizing.
... note: in case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority.
flex-grow - CSS: Cascading Style Sheets
WebCSSflex-grow
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.
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.
...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 class="box" style="background-color:red;">a</div> <div class="box" style="background-color:lightblue;">b</div> <div class="box" style="background-color:yellow;">c</div> <div class="box1" style="background-color:brown;">d</div> <div class="box1" style="background-color:lightgreen;">e</div> </div> css #content { display: flex; width: 500px; } #content...
float - CSS: Cascading Style Sheets
WebCSSfloat
block inline-block block inline-table table table-row block table-row-group block table-column block table-column-group block table-cell block table-caption block table-header-group block table-footer-group block inline-flex flex inline-grid grid other unchanged note: if you're referring to this property from javascript as a member of the htmlelement.style object, modern browsers support float, but in older browsers you have to spell it as cssfloat, with internet explorer versions 8 and older using stylefloat.
...it is shifted to the left, or right, until it touches the edge of its containing box, or another floated element.
font-variant-alternates - CSS: Cascading Style Sheets
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.
... ornaments() this function enables ornaments, like fleurons and other dingbat glyphs.
font-variation-settings - CSS: Cascading Style Sheets
description this property is a low-level mechanism designed to set variable font features where no other way to enable or access those features exist.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea transform formal syntax normal | [ <string> <number> ]# examples you can find a number of other variable fonts examples at our variable fonts guide, v-fonts.com, and axis-praxis.org.
grid-column-end - CSS: Cascading Style Sheets
note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly specified before it).
... otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>.
grid-column-start - CSS: Cascading Style Sheets
note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it).
... otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>.
grid-column - CSS: Cascading Style Sheets
note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it).
... otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>.
grid-row-end - CSS: Cascading Style Sheets
note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly specified before it).
... otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>.
grid-row-start - CSS: Cascading Style Sheets
note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it).
... otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>.
grid - CSS: Cascading Style Sheets
WebCSSgrid
all other grid sub-properties are reset to their initial values.
... all other grid sub-properties are reset to their initial values.
inline-size - CSS: Cascading Style Sheets
ine-size: 300px; inline-size: 25em; /* <percentage> values */ inline-size: 75%; /* keyword values */ inline-size: max-content; inline-size: min-content; inline-size: fit-content(20em); inline-size: auto; /* global values */ inline-size: inherit; inline-size: initial; inline-size: unset; if the writing mode is vertically oriented, the value of inline-size relates to the height of the element; otherwise, it relates to the width of the element.
... a related property is block-size, which defines the other dimension of the element.
<integer> - CSS: Cascading Style Sheets
WebCSSinteger
opera 12.1 supports values up to 215-1, ie up to 220-1, and other browsers even higher.
... during the css3 values cycle there was a lot of discussion about setting a minimum range to support: the latest decision, in april 2012 during the lc phase, was [-227-1; 227-1], but other values like 224-1 and 230-1 were also proposed.
list-style-type - CSS: Cascading Style Sheets
e.g., 壱萬壱阡壱百壱拾壱 the kanjis are designed so that they can't be modified to look like another correct one japanese-informal japanese informal numbering kannada -moz-kannada example katakana e.g.
... non-standard extensions a few more predefined types are provided by mozilla (firefox), blink (chrome and opera) and webkit (safari) to support list types in other languages.
margin-block-end - CSS: Cascading Style Sheets
it relates to margin-block-start, margin-inline-start, and margin-inline-end, which define the other margins of the element.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting block end margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-block-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition...
margin-block-start - CSS: Cascading Style Sheets
it relates to margin-block-end, margin-inline-start, and margin-inline-end, which define the other margins of the element.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting block start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-block-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the defi...
margin-inline-start - CSS: Cascading Style Sheets
values */ margin-inline-start: 10px; /* an absolute length */ margin-inline-start: 1em; /* relative to the text size */ margin-inline-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-start: auto; /* global values */ margin-inline-start: inherit; it relates to margin-block-start, margin-block-end, and margin-inline-end, which define the other margins of the element.
...formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting inline start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the de...
margin-inline - CSS: Cascading Style Sheets
formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typediscrete formal syntax <'margin-left'>{1,2} examples setting inline start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-inline: 20px 40px; background-color: #c8c800; } result specifications spec...
... initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typediscrete ...
mask-repeat - CSS: Cascading Style Sheets
round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added.
...example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added.
max-inline-size - CSS: Cascading Style Sheets
if the writing mode is vertically oriented, the value of max-inline-size relates to the maximal height of the element, otherwise it relates to the maximal width of the element.
... it relates to max-block-size, which defines the other dimension of the element.
min-block-size - CSS: Cascading Style Sheets
x; min-block-size: 5em; /* <percentage> values */ min-block-size: 10%; /* keyword values */ min-block-size: max-content; min-block-size: min-content; min-block-size: fit-content(20em); /* global values */ min-block-size: inherit; min-block-size: initial; min-block-size: unset; if the writing mode is vertically oriented, the value of min-block-size relates to the minimum width of the element; otherwise, it relates to the minimum height of the element.
... a related property is min-inline-size, which defines the other dimension of the element.
min-inline-size - CSS: Cascading Style Sheets
ine-size: 5em; /* <percentage> values */ min-inline-size: 10%; /* keyword values */ min-inline-size: max-content; min-inline-size: min-content; min-inline-size: fit-content(20em); /* global values */ min-inline-size: inherit; min-inline-size: initial; min-inline-size: unset; if the writing mode is vertically oriented, the value of min-inline-size relates to the minimum height of the element; otherwise, it relates to the minimum width of the element.
... a related property is min-block-size, which defines the other dimension of the element.
offset-anchor - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totransformable elementsinheritednopercentagesrelativetowidthandheightcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea position formal syntax auto | <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
...the other two cause the <div>'s top-right and bottom-left points to move along the path, respectively.
opacity - CSS: Cascading Style Sheets
WebCSSopacity
thus, the element and its children all have the same opacity relative to the element's background, even if they have different opacities relative to one another.
... using opacity with a value other than 1 places the element in a new stacking context.
radial-gradient() - CSS: Cascading Style Sheets
note: early implementations of this function included other keywords (cover and contain) as synonyms of the standard farthest-corner and closest-side, respectively.
...for this reason, radial-gradient() won't work on background-color and other properties that use the <color> data type.
repeating-radial-gradient() - CSS: Cascading Style Sheets
for this reason, repeating-radial-gradient() won't work on background-color and other properties that use the <color> data type.
... note: early implementations of this function included other keywords (cover and contain) as synonyms of the standard farthest-corner and closest-side, respectively.
text-emphasis-position - CSS: Cascading Style Sheets
in chinese, on the other hand, the preferred position is under right.
...in html, this can be done with the following style rule: ruby { text-emphasis: none; } preferring emphasis marks over ruby some other editors prefer to hide ruby when they conflict with emphasis marks.
text-emphasis - CSS: Cascading Style Sheets
this is the default shape in horizontal writing modes when no other shape is given.
...this is the default shape in vertical writing modes when no other shape is given.
text-size-adjust - CSS: Cascading Style Sheets
other browsers will ignore this property.
... formal definition initial valueauto for smartphone browsers supporting inflation, none in other cases (and then not modifiable).applies toall elementsinheritedyespercentagesyes, refer to the corresponding size of the text fontcomputed valueas specifiedanimation typediscrete formal syntax none | auto | <percentage> examples basic disabling usage as hinted at above, on a properly designed responsive site the text-size-adjust behavior is not needed, so developers can elect to turn it off ...
text-transform - CSS: Cascading Style Sheets
other characters remain unchanged (they retain their original case as written in the element's text).
...this resulted in differences between browsers in the way the first letter was calculated (firefox considered - and _ as letters, but other browsers did not.
top - CSS: Cascading Style Sheets
WebCSStop
in all other situations, if height is constrained in any way or position is set to relative, the top property takes precedence and the bottom property is ignored.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the height of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples body { background: beige; } div { position: absolute; top: 10%; right: 40%; bottom: 20%; left: 15%; background: gold; border: 1px solid blue; } <div>the size of this content is determined by the position of its edges.</div> specifications specification ...
transform-origin - CSS: Cascading Style Sheets
the other value must be a <length>, a <percentage>, or one of the keywords top, center, and bottom.
...words are convenience shorthands and match the following <percentage> values: keyword value left 0% center 50% right 100% top 0% bottom 100% formal definition initial value50% 50% 0applies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valuefor <length> the absolute value, otherwise a percentageanimation typesimple list of length, percentage, or calc formal syntax [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> = <length> | <percentage> examples code sample transform: none; ...
unicode-bidi - CSS: Cascading Style Sheets
for block container elements this creates an override for inline-level descendants not within another block container element.
...efinition initial valuenormalapplies toall elements, though some values have no effect on non-inline elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | embed | isolate | bidi-override | isolate-override | plaintext examples css .bible-quote { direction: rtl; unicode-bidi: embed; } html <div class="bible-quote"> a line of text </div> <div> another line of text </div> result specifications specification status comment css writing modes module level 3the definition of 'unicode-bidi' in that specification.
url() - CSS: Cascading Style Sheets
WebCSSurl()
the url() function can be passed as a parameter of another css functions, like the attr() function.
...s.png); src: url('fantasticfont.woff'); offset-path: url(#path); mask-image: url("masks.svg#mask1"); /* properties with fallbacks */ cursor: url(pointer.cur), pointer; /* associated short-hand properties */ background: url('https://mdn.mozillademos.org/files/16761/star.gif') bottom right repeat-x blue; border-image: url("/media/diamonds.png") 30 fill / 30px / 30px space; /* as a parameter in another css function */ background-image: cross-fade(20% url(first.png), url(second.png)); mask-image: image(url(mask.png), skyblue, linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* as part of a non-shorthand multiple value */ content: url(star.svg) url(star.svg) url(star.svg) url(star.svg) url(star.svg); /* at-rules */ @document url("https://www.example.com/") { ...
word-break - CSS: Cascading Style Sheets
the word-break css property sets whether line breaks appear wherever the text would otherwise overflow its content box.
... note: in contrast to word-break: break-word and overflow-wrap: break-word (see overflow-wrap), word-break: break-all will create a break at the exact place where text would otherwise overflow its container (even if putting an entire word on its own line would negate the need for a break).
regexp:replace() - EXSLT
WebEXSLTregexpreplace
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.
...otherwise only the first occurrence is replaced.
Sets (set) - EXSLT
WebEXSLTset
in other words, it returns a node-set whose nodes are in one node-set but not in the other.set:distinct()set:distinct() returns a subset of the nodes in the specified node-set, returning only nodes with unique string values.set:has-same-node()set:has-same-node() determines whether two node-sets have any nodes in common.set:intersection()set:intersection() returns the intersection of two node-sets.
... in other words, it returns a node-set containing all the nodes that exits in both nodeset1 and nodeset2.set:leading()set:leading() returns the nodes in one node-set that come before the first node in the other node-set.set:trailing()set:trailing() returns the nodes in one node-set that come after the first node in the other node-set.
Audio and video manipulation - Developer guides
use this web audio node type an audio track from an html <audio> or <video> element mediaelementaudiosourcenode a plain raw audio data buffer in memory audiobuffersourcenode an oscillator generating a sine wave or other computed waveform oscillatornode an audio track from webrtc (such as the microphone input you can get using getusermedia().
... examples various web audio api (and other) examples three.js video cube example convolution effects in real-time ...
DOM onevent handlers - Developer guides
when an event occurs that applies to an element, each of its event handlers is called to allow them to handle the event, one after another.
... non-element objects event handlers can also be set with properties on non-element objects that generate events, like window, document, xmlhttprequest, and others.
Mobile Web Development - Developer guides
WebGuideMobile
if you do need to use these features, check whether other browsers implement their own versions of these features, and target them too.
... for example, if you set a gradient as a background for some text using a vendor-prefixed property like -webkit-linear-gradient, it's best to include the other vendor-prefixed versions of the linear-gradient() property.
The Web Open Font Format (WOFF) - Developer guides
WebGuideWOFF
woff (the web open font format) is a web font format developed by mozilla in concert with type supply, letterror, and other organizations.
... both proprietary and free software browser vendors like the woff format, so it has the potential of becoming a truly universal, interoperable font format for the web, unlike other current font formats.
HTML attribute: step - HTML: Hypertext Markup Language
WebHTMLAttributesstep
the value can must be a positive number - integer or float -- or the special value any, which means no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...indicate any required and optional input, data formats, and other relevant information.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
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.
<acronym> - HTML: Hypertext Markup Language
WebHTMLElementacronym
example <p>the <acronym title="world wide web">www</acronym> is only a component of the internet.</p> default styling though the purpose of this tag is purely for the convenience of the author, its default styling varies from one browser to another: some browsers, like internet explorer, do not style it differently than a <span> element.
... opera, firefox, chrome, and some others add a dotted underline to the content of the element.
<basefont> - HTML: Hypertext Markup Language
WebHTMLElementbasefont
the obsolete html base font element (<basefont>) sets a default font face, size, and color for the other elements which are descended from its parent element.
... attributes like all other html elements, this element supports the global attributes.
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
WebHTMLElementdatalist
the html <datalist> element contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls.
... implicit aria role listbox permitted aria roles no role permitted dom interface htmldatalistelement attributes this element has no other attributes than the global attributes, common to all elements.
<dd>: The Description Details element - HTML: Hypertext Markup Language
WebHTMLElementdd
the end tag may be omitted if the <dd> element is immediately followed by another <dd> element or a <dt> element, or if there is no more content in the parent element.
... previous sibling <dt> or another <dd> element.
<dt>: The Description Term element - HTML: Hypertext Markup Language
WebHTMLElementdt
the subsequent <dd> (description details) element provides the definition or other related text associated with the term specified using <dt>.
...the end tag may be omitted if this element is immediately followed by another <dt> or a <dd> element, or if there is no more content in the parent element.
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
use the <i> element to mark text that is in an alternate tone or mood, which covers many common situations for italics such as scientific names or words in other languages.
...another example for <i> could be: "the word the is an article".
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
if the <fieldset> is styled with an inline-level display value, it will behave as inline-block, otherwise it will behave as block.
...otherwise, it establishes a block formatting context.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
WebHTMLElementfigure
implicit aria role figure permitted aria roles with no figcaption descendant: any, otherwise no permitted roles dom interface htmlelement attributes this element only includes the global attributes.
... usage notes usually a <figure> is an image, illustration, diagram, code snippet, etc., that is referenced in the main flow of a document, but that can be moved to another part of the document or to an appendix without affecting the main flow.
<frame> - HTML: Hypertext Markup Language
WebHTMLElementframe
<frame> is an html element which defines a particular area in which another html document can be displayed.
... attributes like all other html elements, this element supports the global attributes.
<header> - HTML: Hypertext Markup Language
WebHTMLElementheader
it may contain some heading elements but also a logo, a search form, an author name, and other elements.
...note that a <header> element must not be a descendant of an <address>, <footer> or another <header> element.
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
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>.
...there are a variety of ways an <hgroup> might be shown in a rendered outline; for example: an <hgroup> might be shown in a rendered outline in with a colon character and space (“: ”) or other such punctuation after the primary heading and before the first secondary heading (and with the same or similar punctuation before any other secondary headings an <hgroup> might be shown in a rendered outline in with the primary heading followed by parentheses around the secondary heading(s) consider the following html document: <!doctype html> <title>html standard</title> <body> <hgroup id...
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
the other files can be identified using the input's htmlinputelement.files property.
...javascript can access the other files through the input's files property.
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
normally, the name attribute functions on hidden inputs just like on any other input.
...the basic idea is that if a user is filling in a sensitive form, such as a form on their banking website to transfer some money to another account, the secret they would be provided with would prove that they are who they say they are, and that they are using the correct form to submit the transfer request.
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
buttons do not have a true value otherwise.
...in order to avoid conflicts with the user agent's own keyboard shortcuts, different modifier keys are used for access keys than for other shortcuts on the host computer.
<mark>: The Mark Text element - HTML: Hypertext Markup Language
WebHTMLElementmark
otherwise, <mark> indicates a portion of the document's content which is likely to be relevant to the user's current activity.
...estroyed, <mark class="match">imperial</mark> troops have driven the rebel forces from their hidden base and pursued them across the galaxy.</p> <p>evading the dreaded <mark class="match">imperial</mark> starfleet, a group of freedom fighters led by luke skywalker has established a new secret base on the remote ice world of hoth.</p> to help distinguish the use of <mark> for search results from other potential usage, this example applies the custom class "match" to each match.
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
the html <meta> element represents metadata that cannot be represented by other html meta-related elements, like <base>, <link>, <script>, <style> or <title>.
... the number of seconds until the page should redirect to another - only if the content attribute contains a positive integer followed by the string ';url=', and a valid url.
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
WebHTMLElementnoframes
attributes like all other html elements, this element supports the global attributes.
... it has no other attributes available.
<option>: The HTML Option element - HTML: Hypertext Markup Language
WebHTMLElementoption
as such, <option> can represent menu items in popups and other lists of items in an html document.
...the end tag is optional if this element is immediately followed by another <option> element or an <optgroup>, or if the parent element has no more content.
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
if <plaintext> is the first element on the page (other than any non-displayed elements, like <head>), do not use html at all.
... attributes this element has no other attributes than the global attributes common to all elements.
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
WebHTMLElementrb
tag omission the end tag can be omitted if the element is immediately followed by an <rt>, <rtc>, or <rp> element or another <rb> element, or if there is no more content in the parent element.
...the annotation on the other hand is delimited by two <rt> elements.
<spacer> - HTML: Hypertext Markup Language
WebHTMLElementspacer
attributes like all other html elements, this element supports the global attributes.
... example <span>just a text node</span> <spacer type="horizontal" size="10"></spacer> <span>just another text node</span> <spacer type="block" width="10" height="10"></spacer> specification not part of any specification.
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
this attribute is optional and defaults to text/css if it is not specified; values other than the empty string or text/css are not used.
...it is critical to provide a nonce that cannot be guessed as bypassing a resource’s policy is otherwise trivial.
<sub>: The Subscript element - HTML: Hypertext Markup Language
WebHTMLElementsub
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").
... 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 specification status comment html living standardthe definition of '<sub> and <sup>' in that specification.
<tbody>: The Table Body element - HTML: Hypertext Markup Language
WebHTMLElementtbody
when a table is presented in a screen context (such as a window) which is not large enough to display the entire table, the user agent may let the user scroll the contents of the <thead>, <tbody>, <tfoot>, and <caption> blocks separately from one another for the same parent table.
...they use a darker background-color, a larger font size, and a thicker, darker bottom border than the other cell borders.
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
usage notes related elements other elements that are used in contexts in which <var> is commonly used include: <code>: the html code element <kbd>: the html keyboard input element <samp>: the html sample output element if you encounter code that is mistakenly using <var> for style purposes rather than semantic purposes, you should either use a <span> with appropriate css or, an appropriate semantic element among the followi...
...in this example, variable names are rendered using bold courier if it's available, otherwise it falls back to the default monospace font.
autocapitalize - HTML: Hypertext Markup Language
the attribute must take one of the following values: off or none: no autocapitalization is applied (all letters default to lowercase) on or sentences: the first letter 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.
inputmode - HTML: Hypertext Markup Language
for instance, the return/submit key may be labeled "search", along with possible other optimizations.
...typically includes the @ character as well as other optimizations.
tabindex - HTML: Hypertext Markup Language
if multiple elements share the same positive tabindex value, their order relative to each other follows their position in the document source.
...these elements have built-in roles and states that communicate status to the accessibility that would otherwise have to be managed by aria.
Inline elements - HTML: Hypertext Markup Language
conceptual differences in brief, here are the basic conceptual differences between inline and block-level elements: content model generally, inline elements may contain only data and other inline elements.
...block elements, on the other hand, typically cause a line break to occur (although, as usual, this can be changed using css).
Microdata - HTML: Hypertext Markup Language
vocabularies google and other major search engines support the schema.org vocabulary for structured data.
...for others, a vocabulary will need to be designed.
HTTP authentication - HTTP
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.
...iana maintains a list of authentication schemes, but there are other schemes offered by host services, such as amazon aws.
Data URLs - HTTP
otherwise, you can specify base64 to embed base64-encoded binary data.
...to mitigate such issues, top-level navigation to data:// urls has been blocked in firefox 59+ (release version, nightly/beta from 58), and we hope to see other browsers follow suit soon.
Accept-Encoding - HTTP
as long as the identity value, meaning no encoding, is not explicitly forbidden, by an identity;q=0 or a *;q=0 without another explicitly set value for identity, the server must never send back a 406 not acceptable error.
... two others content encoding, bzip and bzip2, are sometimes used, though not standard.
Access-Control-Expose-Headers - HTTP
by default, only the 7 cors-safelisted response headers are exposed: cache-control content-language content-length content-type expires last-modified pragma if you want clients to be able to access other headers, you have to list them using the access-control-expose-headers header.
...access-control-expose-headers: * directives <header-name> a list of exposed headers consisting of zero or more header names other than the cors-safelisted request headers that the resource might use and can be exposed.
Cache-Control - HTTP
although other directives may be set, this alone is the only directive you need in preventing cached responses on modern browsers.
... other no-transform an intermediate cache or proxy cannot edit the response body, content-encoding, content-range, or content-type.
Content-Location - HTTP
the server could also consider other content negotiation headers, such as accept-language.
... indicating the url of a transaction's result say you have a <form> for sending money to another user of a site.
CSP: connect-src - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: form-action - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: img-src - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: navigate-to - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: prefetch-src - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: script-src-attr - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: script-src-elem - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: script-src - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: style-src-attr - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: style-src-elem - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: style-src - HTTP
unlike other values below, single quotes shouldn't be used.
...it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
Content-Security-Policy-Report-Only - HTTP
the csp report-uri directive should be used with this header, otherwise this header will be an expensive no-op machine.
...for example, when the signup.html would attempt to load css from http://anothercdn.example.com/stylesheet.css, the browser would not include the full path but only the origin (http://anothercdn.example.com).
Content-Security-Policy - HTTP
connect-src restricts the urls which can be loaded using script interfaces default-src serves as a fallback for the other fetch directives.
... other directives block-all-mixed-content prevents loading any assets using http when the page is loaded using https.
Cross-Origin-Embedder-Policy - HTTP
require-corp a document can only load resources from the same origin, or resources explicitly marked as loadable from another origin.
...an test against the crossoriginisolated property available to window and worker contexts: if (crossoriginisolated) { // post sharedarraybuffer } else { // do something else } avoiding coep blockage with cors if you enable coep using require-corp and have a cross origin resource that needs to be loaded, it needs to support cors and you need to explicitly mark the resource as loadable from another origin to avoid blockage from coep.
ETag - HTTP
WebHTTPHeadersETag
additionally, etags help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions").
... caching of unchanged resources another typical use of the etag header is to cache resources that are unchanged.
Large-Allocation - HTTP
the document with the large-allocation header was loaded in a window which was opened by window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set.
... the document with the large-allocation header has opened another window with window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set.
Public-Key-Pins-Report-Only - HTTP
some browsers might allow other hashing algorithms than sha-256 in the future.
...this directive should be used with this header, otherwise this header will be a no-op.
Want-Digest - HTTP
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.
...ojrjn3owduoywxbf7kbu9dbpe= 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=1 response: http/1.1 400 bad request want-digest: sha-256, sha-512 specifications specification title draft-ietf-httpbis-digest-headers-latest resource digests for http this header was originally defined in rfc 3230, but the definition of...
X-Forwarded-For - HTTP
x-forwarded-for is also an email-header indicating that an email-message was forwarded from another account.
... 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.
Link prefetching FAQ - HTTP
if you are using another application which uses the network, link prefetching in mozilla may compete for bandwidth with the other application.
...other protocols (such as ftp) do not provide rich enough support for client side caching.
HTTP Messages - HTTP
WebHTTPMessages
they provide http messages through config files (for proxies or servers), apis (for browsers), or other interfaces.
... headers http headers for responses follow the same structure as any other header: a case-insensitive string followed by a colon (':') and a value whose structure depends upon the type of the header.
PATCH - HTTP
WebHTTPMethodsPATCH
patch (like put) may have side-effects on other resources.
... 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.
Protocol upgrade mechanism - HTTP
this means that a typical request that includes upgrade would look something like: get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 other headers may be required depending on the requested protocol; for example, websocket upgrades allow additional headers to configure details about the websocket connection as well as to offer a degree of security in opening the connection.
...other than the upgrade and connection headers, the rest are generally optional or handled for you by the browser and server when they're talking to each other.
Proxy servers and tunneling - HTTP
forward proxies can also be anonymous proxies and allow users to hide their ip address while browsing the web or using other internet services.
...this can be useful if a proxy is used to provide client anonymity, but in other cases information from the original request is lost.
A typical HTTP session - HTTP
WebHTTPSession
other ports can also be used, like 8000 or 8080.
...an absolute url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server information about what type of data is appropriate (e.g., what language, what mime types), or other data altering its behavior (e.g., not sending an answer if it is already cached).
Meta programming - JavaScript
if the target object is not extensible, then the result list must contain all the keys of the own properties of target and no other values.
...eflect.apply(math.floor, undefined, [1.75]) // 1 reflect.apply(string.fromcharcode, undefined, [104, 101, 108, 108, 111]) // "hello" reflect.apply(regexp.prototype.exec, /ab/, ['confabulation']).index // 4 reflect.apply(''.charat, 'ponies', [3]) // "i" checking if property definition has been successful with object.defineproperty, which returns an object if successful, or throws a typeerror otherwise, you would use a try...catch block to catch any error that occurred while defining a property.
Unicode property escapes - JavaScript
for instance, english and spanish are written using the latin script while arabic and russian are written with other scripts (respectively arabic and cyrillic).
...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).
constructor - JavaScript
} description a constructor enables you to provide any custom initialization that must be done before any other methods can be called on an instantiated object.
... this.name = 'square'; } get area() { return this.height * this.width; } set area(value) { this.height = value**0.5; this.width = value**0.5; } } another example here the prototype of square class is changed—but the constructor of its base class polygon is still called when a new instance of a square is created.
static - JavaScript
calling static methods from another static method in order to call a static method within another static method of the same class, you can use the this keyword.
... class staticmethodcall { static staticmethod() { return 'static method has been called'; } static anotherstaticmethod() { return this.staticmethod() + ' from another static method'; } } staticmethodcall.staticmethod(); // 'static method has been called' staticmethodcall.anotherstaticmethod(); // 'static method has been called from another static method' calling static methods from a class constructor and other methods static methods are not directly accessible using the this keyword from non-static methods.
TypeError: X.prototype.y called on incompatible type - JavaScript
this issue can also happen when providing a function that is stored as a property of an object as an argument to another function.
... in this case, the object that stores the function won't be the this target of that function when it is called by the other function.
TypeError: cyclic object value - JavaScript
examples circular references in a circular structure like the following var circularreference = {otherdata: 123}; circularreference.myself = circularreference; json.stringify() will fail json.stringify(circularreference); // typeerror: cyclic object value to serialize circular references you can use a library that supports them (e.g.
... loss) a cyclic reference by using the replacer parameter of json.stringify(): const getcircularreplacer = () => { const seen = new weakset(); return (key, value) => { if (typeof value === "object" && value !== null) { if (seen.has(value)) { return; } seen.add(value); } return value; }; }; json.stringify(circularreference, getcircularreplacer()); // {"otherdata":123} ...
SyntaxError: missing ; before statement - JavaScript
however, oftentimes, this error is only a consequence of another error, like not escaping strings properly, or using var wrongly.
... var obj = {}; var obj.foo = 'hi'; // syntaxerror missing ; before statement var array = []; var array[0] = 'there'; // syntaxerror missing ; before statement instead, omit the var keyword: var obj = {}; obj.foo = 'hi'; var array = []; array[0] = 'there'; bad keywords if you come from another programming language, it is also common to use keywords that don't mean the same or have no meaning at all in javascript: def print(info){ console.log(info); }; // syntaxerror missing ; before statement instead, use function instead of def: function print(info){ console.log(info); }; ...
Arrow function expressions - JavaScript
var f = () => { 'use strict'; return this; }; f() === window; // or the global object all other strict mode rules apply normally.
...another example involving object.defineproperty(): 'use strict'; var obj = { a: 10 }; object.defineproperty(obj, 'b', { get: () => { console.log(this.a, typeof this.a, this); // undefined 'undefined' window {...} (or the global object) return this.a + 10; // represents global object 'window', therefore 'this.a' returns 'undefined' } }); use of the new operator arrow functions cannot b...
Default parameters - JavaScript
other falsy values in the second call in this example, even if the first argument is set explicitly to undefined (though not null or other falsy values), the value of the num argument is still the default.
... function test(num = 1) { console.log(typeof num) } test() // 'number' (num is set to 1) test(undefined) // 'number' (num is set to 1 too) // test with other falsy values: test('') // 'string' (num is set to '') test(null) // 'object' (num is set to null) evaluated at call time the default argument is evaluated at call time.
arguments.callee - JavaScript
1 : arguments.callee(n - 1) * n; }); however, this was actually a really bad solution as this (in conjunction with other arguments, callee, and caller issues) make inlining and tail recursion impossible in the general case (you can achieve it in select cases through tracing, etc., but even the best code is suboptimal due to checks that would not otherwise be necessary.) the other major issue is that the recursive call will get a different this value, e.g.: var global = this; var sillyfunction = function(recursed)...
...1 : factorial(n - 1)*n; }); this has numerous benefits: the function can be called like any other from inside your code it does not create a variable in the outer scope (except for ie 8 and below) it has better performance than accessing the arguments object another feature that was deprecated was arguments.callee.caller, or more specifically function.caller.
Array.prototype.filter() - JavaScript
return true to keep the element, false otherwise.
...otherwise, the value undefined will be used as its this value.
Array.prototype.find() - JavaScript
otherwise, undefined is returned.
...otherwise, find returns undefined.
Array.prototype.lastIndexOf() - JavaScript
polyfill lastindexof was added to the ecma-262 standard in the 5th edition; as such it may not be present in other implementations of the standard.
... var numbers = [2, 5, 9, 2]; numbers.lastindexof(2); // 3 numbers.lastindexof(7); // -1 numbers.lastindexof(2, 3); // 3 numbers.lastindexof(2, 2); // 0 numbers.lastindexof(2, -2); // 0 numbers.lastindexof(2, -1); // 3 finding all the occurrences of an element the following example uses lastindexof to find all the indices of an element in a given array, using push to add them to another array as they are found.
Array.prototype.slice() - JavaScript
changes to the string, number, or boolean in one array do not affect the other array.
... if a new element is added to either array, the other array is not affected.
Array.prototype.sort() - JavaScript
if comparefunction(a, b) returns 0, leave a and b unchanged with respect to each other, but sorted with respect to all different elements.
...strings with accented characters (e, é, è, a, ä, etc.), strings from languages other than english, use string.localecompare.
ArrayBuffer - JavaScript
it is an array of bytes, often referred to in other languages as a "byte array".you cannot directly manipulate the contents of an arraybuffer; instead, you create one of the typed array objects or a dataview object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
...returns false otherwise.
Date() constructor - JavaScript
any missing fields are given the lowest possible value (1 for day and 0 for every other component).
...all other values are the actual year.
Date.prototype.getTime() - JavaScript
for example, a client browser in one timezone, gettime() will be the same as a client browser in any other timezone.
... you can use this method to help assign a date and time to another date object.
Date.prototype.toLocaleString() - JavaScript
most notably, the ie and edge browsers insert bidirectional control characters around dates, so the output text will flow properly when concatenated with other text.
... for this reason, you cannot expect to be able to compare the results of tolocalestring() to a static value: "1/1/2019, 01:00:00" === new date("2019-01-01t01:00:00z").tolocalestring("en-us"); // true in firefox and others // false in ie and edge note: see also this stackoverflow thread for more details and examples.
Error - JavaScript
error types besides the generic error constructor, there are seven other core error constructors in javascript.
...otherwise, old versions of babel and other transpilers will not correctly handle the following code without additional configuration.
Function.prototype.bind() - JavaScript
// yes, it does work with `new (funca.bind(thisarg, args))` if (!function.prototype.bind) (function(){ var arrayprototypeslice = array.prototype.slice; function.prototype.bind = function(otherthis) { if (typeof this !== 'function') { // closest thing possible to the ecmascript 5 // internal iscallable function throw new typeerror('function.prototype.bind - what is trying to be bound is not callable'); } var baseargs= arrayprototypeslice.call(arguments, 1), baseargslength = baseargs.length, ftobind = this, fnop = function() {}, ...
...this : otherthis, baseargs ); }; if (this.prototype) { // function.prototype doesn't have a prototype property fnop.prototype = this.prototype; } fbound.prototype = new fnop(); return fbound; }; })(); some of the many differences (there may well be others, as this list does not seriously attempt to be exhaustive) between this algorithm and the specified algorithm are: the partial implementation relies on array.prototype.slice(), array.prototype.concat(), function.prototype.call() and function.proto...
Function.prototype.call() - JavaScript
with call(), you can write a method once and then inherit it in another object, without having to rewrite the method for the new object.
... two other functions, food and toy, invoke product, passing this, name, and price.
Infinity - JavaScript
in other words, it is a variable in global scope.
...the value infinity (positive infinity) is greater than any other number.
Intl.Collator.prototype.compare() - JavaScript
syntax collator.compare(string1, string2) parameters string1 string2 the strings to compare against each other.
... description the compare getter function returns a number indicating how string1 and string2 compare to each other according to the sort order of this collator object: a negative value if string1 comes before string2; a positive value if string1 comes after string2; 0 if they are considered equal.
Intl.DateTimeFormat.prototype.format() - JavaScript
most notably, the ie and edge browsers insert bidirectional control characters around dates, so the output text will flow properly when concatenated with other text.
... for this reason you cannot expect to be able to compare the results of format() to a static value: let d = new date("2019-01-01t00:00:00.000000z"); let formatteddate = intl.datetimeformat(undefined, { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' }).format(d); "1.1.2019, 01:00:00" === formatteddate; // true in firefox and others // false in ie and edge note: see also this stackoverflow thread for more details and examples.
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
pluralcategories an array of plural categories used by the given locale, seleced from the list "zero", "one", "two", "few", "many" and "other".
... examples using the resolvedoptions method var de = new intl.pluralrules('de-de'); var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.maximumfractiondigits; // 3 usedoptions.minimumfractiondigits; // 0 usedoptions.minimumintegerdigits; // 1 usedoptions.pluralcategories; // array [ "one", "other" ] usedoptions.type; // "cardinal" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.pluralrules.prototype.resolvedoptions' in that specification.
JSON.parse() - JavaScript
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.stringify() - JavaScript
all the other object instances (including map, set, weakmap, and weakset) will have only their enumerable properties serialized.
... if you return any other object, the object is recursively stringified, calling the replacer function on each property.
Math.sign() - JavaScript
otherwise, nan is returned.
...-1 : 0 ) // if x is negative, then negative one // || // if x is 0, -0, or nan, or not a number, // +x // then the result will be x, (or) if x is // // not a number, then x converts to number }; } in the above polyfill, no extra type-coercing is needed to make (x > 0) or (x < 0) numbers because subtracting them from each other forces a type conversion from booleans to numbers.
Number.isNaN() - JavaScript
return value true if the given value is nan and its type is number; otherwise, false.
...this situation is unlike all other possible value comparisons in javascript.
Number.isSafeInteger() - JavaScript
a safe integer is an integer that can be exactly represented as an ieee-754 double precision number, and whose ieee-754 representation cannot be the result of rounding any other integer to fit the ieee-754 representation.
... for example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any ieee-754 rounding mode.
Number - JavaScript
values of other types can be converted to numbers using the number() function.
... description when used as a function, number(value) converts a string or other value to the number type.
Object.prototype.__defineSetter__() - JavaScript
examples non-standard and deprecated way var o = {}; o.__definesetter__('value', function(val) { this.anothervalue = val; }); o.value = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 standard-compliant ways // using the set operator var o = { set value(val) { this.anothervalue = val; } }; o.value = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 // using object.defineproperty var o = {}; object.defineproperty(o, 'value', { set: function(val) { th...
...is.anothervalue = val; } }); o.value = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 specifications specification ecmascript (ecma-262)the definition of 'object.prototype.__definesetter__()' in that specification.
Object.prototype.isPrototypeOf() - JavaScript
the isprototypeof() method checks if an object exists in another object's prototype chain.
... description the isprototypeof() method allows you to check whether or not an object exists within another object's prototype chain.
Object.setPrototypeOf() - JavaScript
the object.setprototypeof() method sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or null.
...otherwise, this method changes the [[prototype]] of obj to the new value.
Promise.allSettled() - JavaScript
it is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise.
... in comparison, the promise returned by promise.all() may be more appropriate if the tasks are dependent on each other / if you'd like to immediately reject upon any of them rejecting.
Promise.prototype.catch() - JavaScript
the promise returned by catch() is rejected if onrejected throws an error or returns a promise which is itself rejected; otherwise, it is resolved.
...this is considered good practice in contrast to throwing strings; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information like stack traces.
Promise.resolve() - JavaScript
has a "then" method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the value.
... examples using the static promise.resolve method promise.resolve('success').then(function(value) { console.log(value); // "success" }, function(value) { // not called }); resolving an array var p = promise.resolve([1,2,3]); p.then(function(v) { console.log(v[0]); // 1 }); resolving another promise var original = promise.resolve(33); var cast = promise.resolve(original); cast.then(function(value) { console.log('value: ' + value); }); console.log('original === cast ?
Proxy() constructor - JavaScript
it can be any sort of object, including a native array, a function, or even another proxy.
...we define a handler that returns a different value for proxied, and lets any other accesses through to the target.
Proxy - JavaScript
the proxy object enables you to create a proxy for another object, which can intercept and redefine fundamental operations for that object.
...the very simple trap in handler2 above redefines all property accessors: console.log(proxy2.message1); // world console.log(proxy2.message2); // world with the help of the reflect class we can give some accessors the original behavior and redefine others: const target = { message1: "hello", message2: "everyone" }; const handler3 = { get: function (target, prop, receiver) { if (prop === "message2") { return "world"; } return reflect.get(...arguments); }, }; const proxy3 = new proxy(target, handler3); console.log(proxy3.message1); // hello console.log(proxy3.message2); // world constructor proxy() creates a new p...
RegExp.prototype.dotAll - JavaScript
property attributes of regexp.prototype.dotall writable no enumerable no configurable yes description the value of dotall is a boolean and true if the "s" flag was used; otherwise, false.
... the "s" flag indicates that the dot special character (".") should additionally match the following line terminator ("newline") characters in a string, which it would not match otherwise: u+000a line feed (lf) ("\n") u+000d carriage return (cr) ("\r") u+2028 line separator u+2029 paragraph separator this effectively means the dot will match any character on the unicode basic multilingual plane (bmp).
Set.prototype.forEach() - JavaScript
this is to make it consistent with other foreach() methods for map and array.
... otherwise, the value undefined will be passed for use as its this value.
SharedArrayBuffer - JavaScript
description allocating and sharing memory to share memory using sharedarraybuffer objects from one agent in the cluster to another (an agent is either the web page’s main program or one of its web workers), postmessage and structured cloning is used.
...however, the shared data block referenced by the two sharedarraybuffer objects is the same data block, and a side effect to the block in one agent will eventually become visible in the other agent.
String.prototype.endsWith() - JavaScript
return value true if the given characters are found at the end of the string; otherwise, false.
... description this method lets you determine whether or not a string ends with another string.
String.prototype.indexOf() - JavaScript
on the other hand, 'hello world'.indexof('o', 11) (and with any fromindex value greater than 11) will return -1, as the search is started at position 11, a position after the end of the string.
...therefore, when checking if a specific string exists within another string, the correct way to check would be: 'blue whale'.indexof('blue') !== -1 // true 'blue whale'.indexof('bloe') !== -1 // false ~('blue whale'.indexof('bloe')) // 0, which is falsy examples using indexof() the following example uses indexof() to locate values in the string "brave new world".
String.prototype.localeCompare() - JavaScript
some browsers may return -2 or 2, or even some other negative or positive value.
... examples using localecompare() // the letter "a" is before "c" yielding a negative value 'a'.localecompare('c'); // -2 or -1 (or some other negative value) // alphabetically the word "check" comes after "against" 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.
String.prototype.match() - JavaScript
other methods if you need to know if a string matches a regular expression regexp, use regexp.test().
...infinity contains -infinity and +infinity in javascript.", str2 = "my grandfather is 65 years old and my grandmother is 63 years old.", str3 = "the contract was declared null and void."; str1.match("number"); // "number" is a string.
String.prototype.matchAll() - JavaScript
the regexp object must have the /g flag, otherwise a typeerror will be thrown.
... const regexp = regexp('[a-c]','g'); regexp.lastindex = 1; const str = 'abc'; array.from(str.matchall(regexp), m => `${regexp.lastindex} ${m[0]}`); // array [ "1 b", "1 c" ] better access to capturing groups (than string.prototype.match()) another compelling reason for matchall is the improved access to capture groups.
String.prototype.startsWith() - JavaScript
return value true if the given characters are found at the beginning of the string; otherwise, false.
... description this method lets you determine whether or not a string begins with another string.
String.prototype.trim() - JavaScript
polyfill running the following code before any other code will create trim() if it's not natively available.
... if (!string.prototype.trim) { string.prototype.trim = function () { return this.replace(/^[\s\ufeff\xa0]+|[\s\ufeff\xa0]+$/g, ''); }; } examples using trim() the following example displays the lowercase string 'foo': var orig = ' foo '; console.log(orig.trim()); // 'foo' // another example of .trim() removing whitespace from just one side.
Symbol - JavaScript
a symbol value may be used as an identifier for object properties; this is the data type's primary purpose, although other use-cases exist, such as enabling opaque data types, or serving as an implementation-supported unique identifier in general.
...otherwise a new symbol gets created in the global symbol registry with key.
TypedArray.prototype.filter() - JavaScript
return true to keep the element, false otherwise.
... otherwise, the value undefined will be passed for use as its this value.
WeakMap - JavaScript
these references prevent the keys from being garbage collected, even if there are no other references to the object.
... by contrast, native weakmaps hold "weak" references to key objects, which means that they do not prevent garbage collection in case there would be no other reference to the key object.
WebAssembly - JavaScript
unlike most other global objects, webassembly is not a constructor (it is not a function object).
... you can compare it to math, which is also a namespace object for mathematical constants and functions, or to intl which is the namespace object for internationalization constructors and other language-sensitive functions.
isFinite() - JavaScript
return value false if the argument is positive or negative infinity or nan or undefined; otherwise, true.
...if the argument is nan, positive infinity, or negative infinity, this method returns false; otherwise, it returns true.
undefined - JavaScript
while it is possible to use it as an identifier (variable name) in any scope other than the global scope (because undefined is not a reserved word), doing so is a very bad idea that will make your code difficult to maintain and debug.
... // x has not been declared before if (typeof x === 'undefined') { // evaluates to true without errors // these statements execute } if (x === undefined) { // throws a referenceerror } however, there is another alternative.
Comma operator (,) - JavaScript
var a, b, c; a = b = 3, c = 4; // returns 4 in console console.log(a); // 3 (left-most) var x, y, z; x = (y = 5, z = 6); // returns 6 in console console.log(x); // 6 (right-most) processing and then returning another example that one could make with comma operator is processing before returning.
... as stated, only the last element will be returned but all others are going to be evaluated as well.
Destructuring assignment - JavaScript
the current design is useful if you want to be able to call the function without supplying any parameters, the other can be useful when you want to ensure an object is passed to the function.
...itle: 'javascript-umgebung' } ], url: '/docs/tools/scratchpad' }; let { title: englishtitle, // rename translations: [ { title: localetitle, // rename }, ], } = metadata; console.log(englishtitle); // "scratchpad" console.log(localetitle); // "javascript-umgebung" for of iteration and destructuring const people = [ { name: 'mike smith', family: { mother: 'jane smith', father: 'harry smith', sister: 'samantha smith' }, age: 35 }, { name: 'tom jones', family: { mother: 'norah jones', father: 'richard jones', brother: 'howard jones' }, age: 25 } ]; for (const {name: n, family: {father: f}} of people) { console.log('name: ' + n + ', father: ' + f); } // "name: mike smith, father: harry ...
Equality (==) - JavaScript
if one operand is null and the other is undefined, return true.
... if one of the operands is an object and the other is a number or a string, try to convert the object to a primitive using the object's valueof() and tostring() methods.
Exponentiation (**) - JavaScript
in most languages, such as php, python, and others that have an exponentiation operator (**), the exponentiation operator is defined to have a higher precedence than unary operators, such as unary + and unary -, but there are a few exceptions.
... -2 ** 2; // 4 in bash, -4 in other languages.
Logical NOT (!) - JavaScript
when used with non-boolean values, it returns false if its single operand can be converted to true; otherwise, returns true.
... syntax !expr description returns false if its single operand can be converted to true; otherwise, returns true.
Logical OR assignment (||=) - JavaScript
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.
...if an empty string is returned (a falsy value), ||= must be used, otherwise you want to use the ??= operator (for null or undefined return values).
Property accessors - JavaScript
any other value, including a number, is coerced to a string.
...put another way, this does not necessarily refer to the object containing a method.
Unsigned right shift (>>>) - JavaScript
unlike the other bitwise operators, zero-fill right shift returns an unsigned 32-bit integer.
...unlike the other bitwise operators, zero-fill right shift returns an unsigned 32-bit integer.
Expressions and operators - JavaScript
yield* delegate to another generator function or iterable object.
... instanceof the instanceof operator determines whether an object is an instance of another object.
function* - JavaScript
when the iterator's next() method is called, the generator function's body is executed until the first yield expression, which specifies the value to be returned from the iterator or, with yield*, delegates to another generator function.
... example with yield* function* anothergenerator(i) { yield i + 1; yield i + 2; yield i + 3; } function* generator(i) { yield i; yield* anothergenerator(i); yield i + 10; } var gen = generator(10); console.log(gen.next().value); // 10 console.log(gen.next().value); // 11 console.log(gen.next().value); // 12 console.log(gen.next().value); // 13 console.log(gen.next().value); // 20 passing arguments into generators func...
import - JavaScript
the static import statement is used to import read only live bindings which are exported by another module.
... import { reallyreallylongmoduleexportname as shortname, anotherlongmodulename as short } from '/modules/my-module.js'; import a module for its side effects only import an entire module for side effects only, without importing anything.
switch - JavaScript
(if multiple cases match the provided value, the first case that matches is selected, even if the cases are not equal to each other.) if no matching case clause is found, the program looks for the optional default clause, and if found, transfers control to that clause, executing the associated statements.
...javascript will drop you back to the default if it can't find a match: var foo = 5; switch (foo) { case 2: console.log(2); break; // it encounters this break so will not continue into 'default:' default: console.log('default') // fall-through case 1: console.log('1'); } it also works when you put default before all other cases.
with - JavaScript
otherwise a referenceerror is thrown.
... contra: code using with may not be forward compatible, especially when used with something other than a plain object.
Transitioning to strict mode - JavaScript
in strict mode, the arguments object is created and initialized with the same values than the named arguments, but changes to either the arguments object or the named arguments aren't reflected in one another.
...not using eval if you don't really need it may be another pragmatic solution.
Trailing commas - JavaScript
parameter definitions the following function definition pairs are legal and equivalent to each other.
... function f(p) {} function f(p,) {} (p) => {}; (p,) => {}; the trailing comma also works with method definitions for classes or objects: class c { one(a,) {} two(a, b,) {} } var obj = { one(a,) {}, two(a, b,) {}, }; function calls the following function invocation pairs are legal and equivalent to each other.
JavaScript typed arrays - JavaScript
web apis using typed arrays these are some examples of apis that make use of typed arrays; there are others, and more are being added all the time.
... in other words, the two arrays are indeed simply viewed on the same data buffer, treating it as different formats.
Web app manifests
pwa manifests include its name, author, icon(s), version, description, and list of all the necessary resources (among other things).
...browsers generally support manifests with other appropriate extensions like .json (content-type: application/json).
<mo> - MathML
WebMathMLElementmo
form specifies the role of the operator in an enclosed expression, which affects spacing and other default properties.
... the default value is true if stretchy is set to true and otherwise false.
Digital video concepts - Web media technologies
without the other two components, the luma of each pixel in the frame produces a greyscale representation of the image.
...in other words, we're taking color information from every other row of pixels in the source image and applying them to the greyscale image represented by the luma.
Media type and format guide: image, audio, and video content - Web media technologies
WebMediaFormats
some are audio-specific, while others may be used for either audio or combined audiovisual content such as movies.
... other topics media capabilities api the media capabilities api lets you discover the encoding and decoding capabilities of the device your app or site is running on.
Using images in HTML - Web media technologies
WebMediaimages
other topics related topics that may be of interest.
... learn html: responsive images in this article, we'll learn about the concept of responsive images — images that work well on devices with widely differing screen sizes, resolutions, and other such features — and look at what tools html provides to help implement them.
CSS and JavaScript animation performance - Web Performance
css animations, on the other hand, allow developers to make animations between a set of starting property values and a final set rather than between two states.
... note: in nightly/developer edition, you should see that omta is enabled by default, so you might have to do the tests the other way around (test with it enabled first, then disable to test without omta.) summary browsers are able to optimize rendering flows.
Navigation and resource timings - Web Performance
in other words, if a secure connection was used, secureconnectionstart will be truthy, and the time between secureconnectionstart and requeststart will greater than 0.
... resource timing whereas navigation timing is for measuring the performance of the main page, generally the html file via which all the other assets are requested, resource timing measures timing for individual resources, the assets called in by the main page, and any assets that those resources request.
Performance budgets - Web Performance
it's a tradeoff between user experience, against other performance indicators (e.g.
...however, based on the specific goals and content of your site, you might choose to focus on other metrics.
Installing and uninstalling web apps - Progressive web apps (PWAs)
web application installation is a feature available in modern browsers that allows users to choose to easily and conveniently “install” a web application on their device so they can access it in the same way they would any other installed app.
...some parts of the pwa ecosystem are supported, while others are not.
How to make PWAs installable - Progressive web apps (PWAs)
this makes the web app easier to access; additionally, you can specify that the app be launched in fullscreen or standalone mode, thus removing the default browser user interface that would otherwise be present, creating an even more seamless and native-like feel.
... now the user can launch and use the web app just like any other application on their device.
Progressive loading - Progressive web apps (PWAs)
it is faster to load all that information as one file rather than many small ones, but if the user doesn't need everything at the very beginning, we could load only what's crucial and then manage other resources when needed.
... conclusion less files to load initially, smaller files split into modules, use of placeholders, and loading more content on demand — this will help achieve faster initial load times, which brings benefits to the app creator and offers a smoother experience to the user.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
if not, we use another fetch request to fetch it from the network, then store the response in the cache so it will be available there next time it is requested.
... other use cases serving files from cache is not the only feature service worker offers.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
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.
...the app's service worker will receive data from the push server, which can then be shown using the notifications system, or another mechanism if desired.
Web technology reference
some introduce content into the page directly, others provide information about document text and may include other tags as sub-elements.
... introduction to css | getting started with css | learn css | common css questions | reference javascript — dynamic client-side scripting the javascript programming language is used to add interactivity and other dynamic features to web sites.
additive - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value replace | sum default value replace animatable no sum specifies that the animation will add to the underlying value of the attribute and other lower priority animations.
... replace specifies that the animation will override the underlying value of the attribute and other lower priority animations.
end - SVG: Scalable Vector Graphics
WebSVGAttributeend
the element's animation end time is defined relative to the begin or active end of another animation.
... a valid syncbase-value consists of an id reference to another animation element followed by a dot and either begin or end to identify whether to synchronize with the beginning or active end of the referenced animation element.
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
otherwise, if the value of this attribute is not a multiple of 180 degrees, then the current text position is incremented according to the vertical metrics of the glyph.
...if another angle is specified, it is rounded to the closest of the permitted values.
preserveAspectRatio - SVG: Scalable Vector Graphics
meet or slice reference the meet or slice reference is optional and, if provided, must be one of the following keywords: meet (the default) - scale the graphic such that: aspect ratio is preserved the entire viewbox is visible within the viewport the viewbox is scaled up as much as possible, while still meeting the other criteria in this case, if the aspect ratio of the graphic does not match the viewport, some of the viewport will extend beyond the bounds of the viewbox (i.e., the area into which the viewbox will draw will be smaller than the viewport).
... slice - scale the graphic such that: aspect ratio is preserved the entire viewport is covered by the viewbox the viewbox is scaled down as much as possible, while still meeting the other criteria in this case, if the aspect ratio of the viewbox does not match the viewport, some of the viewbox will extend beyond the bounds of the viewport (i.e., the area into which the viewbox will draw is larger than the viewport).
requiredExtensions - SVG: Scalable Vector Graphics
if all of the given extensions are supported, then the attribute evaluates to true; otherwise, the current element and its children are skipped and thus will not be rendered.
...if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not.
systemLanguage - SVG: Scalable Vector Graphics
if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not.
...otherwise it evaluates to "false".
xlink:show - SVG: Scalable Vector Graphics
only one element is using this attribute: <a> usage notes value new | replace | embed | other | none default value replace animatable no new this value specifies that the referenced resource is opened in a new window or tab.
... other this value indicates that other markup present in the link, i.e.
<cursor> - SVG: Scalable Vector Graphics
WebSVGElementcursor
if the transparency mask can be determined, the mask defines the shape of the cursor; otherwise, the cursor is an opaque rectangle.
... typically, the other pixel information (e.g., the r, g and b channels) defines the colors for those parts of the cursor which are not masked out.
<feComposite> - SVG: Scalable Vector Graphics
the second set does not wipe out the background, with the result that the background sometimes shines through and is other cases is blended into itself (i.e., "double-counting").</desc> <filter id="overflood" filterunits="objectboundingbox" x="-5%" y="-5%" width="110%" height="110%"> <feflood flood-color="#ffffff" flood-opacity="1" result="flood"/> <fecomposite in="sourcegraphic" in2="backgroundimage" operator="over" result="comp"/> <femerge> <femergenode in="flood"/> <femergenode in="...
...eticflood)" /> <use xlink:href="#red50" filter="url(#arithmeticflood)" /> <text x="-25" y="275">arithmetic</text> </g> </g> <g transform="translate(0,325)" enable-background="new"> <desc>render the examples using the filters that do not obliterate the background, thus sometimes causing the background to continue to appear in some cases, and in other cases the background image blends into itself ("double-counting").</desc> <text x="15" y="75">opacity 1.0</text> <text x="15" y="115" font-size="27">(without feflood)</text> <text x="15" y="200">opacity 0.5</text> <text x="15" y="240" font-size="27">(without feflood)</text> <use xlink:href="#bluetriangles"/> <g transform="translate(275,25)"> <...
<image> - SVG: Scalable Vector Graphics
WebSVGElementimage
it can display raster image files or other svg files.
... the only image formats svg software must support are jpeg, png, and other svg files.
<linearGradient> - SVG: Scalable Vector Graphics
value type: <transform-list> ; default value: identity transform; animatable: yes href this attribute defines a reference to another <lineargradient> element that will be used as a template.
... value type: <length> ; default value: 100%; animatable: yes xlink:href an <iri> reference to another <lineargradient> element that will be used as a template.
<radialGradient> - SVG: Scalable Vector Graphics
value type: <transform-list> ; default value: identity transform; animatable: yes href this attribute defines a reference to another <lineargradient> element that will be used as a template.
... value type: pad|reflect|repeat ; default value: pad; animatable: yes xlink:href an <iri> reference to another <lineargradient> element that will be used as a template.
SVG In HTML Introduction - SVG: Scalable Vector Graphics
(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...
... related links another svg in html example: a swarm of motes working example that works in both mozilla and in internet explorer with adobe's svg viewer installed.
SVG: Scalable Vector Graphics
WebSVG
as such, it's a text-based, open web standard for describing images that can be rendered cleanly at any size and are designed specifically to work well with other web standards including css, dom, javascript, and smil.
... 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 svg art gallery animation and interactions like html, svg has a document model (dom) and events, and is acce...
Certificate Transparency - Web security
the label of the root node therefore depends on all other nodes in the tree.
... apple requires a varying number of scts in order for safari and other servers to trust server certificates.
Referer header: privacy and security concerns - Web security
you should use post rather than get wherever possible, to avoid passing sensitive data to other locations via urls.
...you should enlist the help of a web security expert to write these requirements, and consider both user needs and welfare, as well as other issues like policy and regulation enforced by legislation such as the eu general data protection regulation (gdpr).
How to turn off form autocompletion - Web security
since users do not have to remember passwords that the browser stores for them, they are able to choose stronger passwords than they would otherwise.
... preventing autofilling with autocomplete="new-password" if you are defining a user management page where a user can specify a new password for another person, and therefore you want to prevent autofilling of password fields, you can use autocomplete="new-password".
Using custom elements - Web Components
customized built-in elements now let's have a look at another customized built in element example — expanding-list (see it live also).
...classes custom element polyfills may patch native constructors such as htmlelement and others, and return a different instance from the one just created.
Using shadow DOM - Web Components
an important aspect of web components is encapsulation — being able to keep the markup structure, style, and behavior hidden and separate from other code on the page so that different parts do not clash, and the code can be kept nice and clean.
...all you see in the dom is the <video> element, but it contains a series of buttons and other controls inside its shadow dom.
Web Components
in this way, you can keep an element's features private, so they can be scripted and styled without the fear of collision with other parts of the document.
... tutorials using custom elements a guide showing how to use the features of custom elements to create simple web components, as well as looking into lifecycle callbacks and some other more advanced features.
Introduction to using XPath in JavaScript - XPath
using xpath functions to reference elements with a default namespace another approach to match default elements in a non-null namespace (and one which works well for dynamic xpath expressions where the namespaces might not be known), involves referring to a particular element using a form such as [namespace-uri()='http://www.w3.org/1999/xhtml' and name()='p' and @id='_myid'].
... other contributors: james thompson.
XPath
xpath is mainly used in xslt, but can also be used as a much more powerful way of navigating through the dom of any xml-like language document using xpathexpression, such as html and svg, instead of relying on the document.getelementbyid() or parentnode.queryselectorall() methods, the node.childnodes properties, and other dom core features.
... note: support for xpath varies widely; it's supported reasonably well in firefox (although there are no plans to improve support further), while other browsers implement it to a lesser extent, if at all.
<xsl:choose> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementchoose
syntax <xsl:choose> <xsl:when test="[whatever to test1]"></xsl:when> <xsl:when test="[whatever to test2]"></xsl:when> <xsl:otherwise></xsl:otherwise> [optional] </xsl:choose> required attributes none.
...it contains one or more <xsl:when> elements, and, optionally, a final <xsl:otherwise> element.
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementif
in this it is similar to an if statement in other languages.
... to achieve the functionality of an if-then-else statement, however, use the <xsl:choose> element with one <xsl:when> and one <xsl:otherwise> children.
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementimport
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:import> element is a top-level element that serves to import the contents of one stylesheet into another stylesheet.
... type top-level, must appear before any other child of <xsl:stylesheet> or <xsl:transform> in the importing stylesheet.
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
default-collation specifies the default collation used by all xpath expressions appearing in attributes or text value templates that have the element as an ancestor, unless overridden by another default-collation attribute on an inner element.
...this is most often used when the stylesheet is embedded in another xml document.
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
if that 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.
...this is handy because appending a fragment to another node transparently appends all the children of that fragment, and the fragment itself is not merged.
XSLT: Extensible Stylesheet Language Transformations
WebXSLT
then, the new document may be serialized (output) by the processor in standard xml syntax or in another format, such as html or plain text.
... xslt tutorial this w3schools tutorial teaches the reader how to use xslt to transform xml documents into other formats, like xhtml.
Compiling from Rust to WebAssembly - WebAssembly
wasm-pack uses wasm-bindgen, another tool, to provide a bridge between the types of javascript and rust.
... making our package availabe to npm let's use `npm link` to make this package available to other javascript packages installed $ cd pkg $ npm link we now have an npm package, written in rust, but compiled to webassembly.
Window: userproximity event - Archive of obsolete content
other properties property type description near read only boolean the current user proximity state.
Loading Content Scripts - Archive of obsolete content
contentscriptfile: data.url("my-content-script.js") both contentscript and contentscriptfile accept an array of strings, so you can load multiple scripts, which can also interact directly with each other in the content process: // "data" is supplied by the "self" module var data = require("sdk/self").data; ...
Contributor's Guide - Archive of obsolete content
this article discusses two common techniques: one using prefixes, the other closures.
Testing the Add-on SDK - Archive of obsolete content
the majority of the tests run here are module unit tests, but there are various other tests included here as well.
Working with Events - Archive of obsolete content
in this case one end of the conversation emits the events, and the other end listens to them.
XUL Migration Guide - Archive of obsolete content
but the sdk makes a distinction between: add-on scripts, which can use the sdk apis, but are not able to interact with web pages content scripts, which can access web pages, but do not have access to the sdk's apis content scripts and add-on scripts communicate by sending each other json messages: in fact, the ability to communicate with the add-on scripts is the only extra privilege a content script is granted over a normal remote web page script.
addon-page - Archive of obsolete content
after this, the page loaded from "data/index.html" will not contain navigational elements: var addontab = require("sdk/addon-page"); var data = require("sdk/self").data; require("sdk/tabs").open(data.url("index.html")); this only affects the page at "data/index.html": all other pages are displayed normally.
page-mod - Archive of obsolete content
the pagemod constructor takes a number of other options to control its behavior: contentstyle lists stylesheets to attach, supplied as strings.
self - Archive of obsolete content
while not generally of use to add-on code directly, it can be used by internal api code to index local storage and other resources that are associated with a particular add-on.
ui - Archive of obsolete content
it's otherwise identical to the action button.
High-Level APIs - Archive of obsolete content
unless the documentation explicitly says otherwise, all these modules are "stable": we'll avoid making incompatible changes to them.
content/content - Archive of obsolete content
re-exports three objects from three other modules: loader, worker, and symbiont.
core/namespace - Archive of obsolete content
delete sandboxes(this).sandbox; }; exports.widget = widget; in addition access to the namespace can be shared with other code by just handing them a namespace accessor function.
dev/panel - Archive of obsolete content
in the add-on side: require the sdk/messaging module create a messagechannel keep one messageport in the add-on side for receiving messages from the panel document pass the other messageport to the panel document in the ports argument to postmessage // main.js // require the sdk modules const { panel } = require("dev/panel"); const { tool } = require("dev/toolbox"); const { class } = require("sdk/core/heritage"); const { messagechannel } = require("sdk/messaging"); const channel = new messagechannel(); const addonside = channel.port1; const panelside = channel.port2; ...
event/target - Archive of obsolete content
all other properties of options will be ignored.
frame/hidden-frame - Archive of obsolete content
usage the module exports a constructor function, hiddenframe, and two other functions, add and remove.
frame/utils - Archive of obsolete content
for more details and other possible values see documentation on mdn uri string uri of the document to be loaded into the new frame.
places/bookmarks - Archive of obsolete content
the module does not automatically sync up a bookmark instance with ongoing changes to that item in the database from the same add-on, other add-ons, or the user.
stylesheet/utils - Archive of obsolete content
returns boolean : true if the type given is valid, otherwise false.
system/runtime - Archive of obsolete content
globals properties insafemode this value is true if firefox was started in safe mode, otherwise false.
tabs/utils - Archive of obsolete content
returns boolean : true if the tab is open, otherwise false.
ui/button/action - Archive of obsolete content
otherwise, it functions as a getter and returns the button's state for the specified object.
util/collection - Archive of obsolete content
otherwise a new empty array will be used, and no one but the collection will have access to it.
util/object - Archive of obsolete content
etpacks // "are yes" b.foo // 50 b.bar // 6 b.location // "sf" // merge also translates property descriptors var c = { "type": "addon" }; var d = {}; object.defineproperty(d, "name", { value: "jetpacks", configurable: false }); merge(c, d); var props = object.getownpropertydescriptor(c, "name"); console.log(props.configurable); // true parameters source : object the object that other properties are merged into.
util/uuid - Archive of obsolete content
otherwise a new nsid will be generated and returned.
window/utils - Archive of obsolete content
this means that its "load" event has been fired and all content is loaded, including the whole dom document, images, and any other sub-resources.
Low-Level APIs - Archive of obsolete content
content/content re-exports three objects from three other modules: loader, worker, and symbiont.
jpmignore - Archive of obsolete content
for example: .* * !/data/** !/lib/** !/locale/** !/node_modules/** !/package.json !/icon.png !/icon64.png !/copying !/bootstrap.js !/install.rdf this would include all editor backup files and similar in the whitelisted subdirectories, to avoid that you can append another blacklist after the whitelist.
Tools - Archive of obsolete content
package.json the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons.
Adding a Button to the Toolbar - Archive of obsolete content
you can change the icon, and the other state attributes, either globally, for a specific window, or for a specific tab.
Implementing the widget - Archive of obsolete content
inside the data subdirectory create another subdirectory widget.
Chrome Authority - Archive of obsolete content
manifest generation the manifest is a list, included in the generated xpi, which specifies which modules have requested require() access to which other modules.
Display a Popup - Archive of obsolete content
margin: 10px; } body { background-color: gray; } </style> </head> <body> <textarea rows="13" cols="33" id="edit-box"></textarea> </body> </html> finally, save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png try it out: "index.js" is saved in the top level, and the other five files go in your add-on's data directory: my-addon/ data/ get-text.js icon-16.png icon-32.png icon-64.png text-entry.html index.js run the add-on, click the button, and you should see the panel.
Getting Started (jpm) - Archive of obsolete content
you can distribute xpi files yourself or publish them to https://addons.mozilla.org so other users can download and install them.
Listen for Page Load - Archive of obsolete content
you can listen for a number of other tab events, including open, close, and activate.
Developing for Firefox Mobile - Archive of obsolete content
however, because there's a lot of other debug output in the shell, it's not easy to follow.
Tutorials - Archive of obsolete content
create reusable packages containing your modules, so other add-on developers can use them too.
Bookmarks - Archive of obsolete content
you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute.
Canvas code snippets - Archive of obsolete content
this can be very useful to compare for example if a user has painted over another area as explained in this blog post.
Customizing the download progress bar - Archive of obsolete content
the other two images are for the filled in progress bar on windows and mac respectively.
Embedding SVG - Archive of obsolete content
svg is an xml based makeup language and can be embedded into other markup languages, like xhtml and xul.
IsDefaultNamespace - Archive of obsolete content
the following is a snippet to get isdefaultnamespace() supported across other browsers.
JS XPCOM - Archive of obsolete content
another difference is that queryinterface returns an object, where as instanceof returns a boolean.
Progress Listeners - Archive of obsolete content
using the following code, you will get notified when user navigates to another page (by clicking a link, using the back/forward button, by typing an address in the location bar, etc.) and also when user switches tabs.
QuerySelector - Archive of obsolete content
along the lines of other frameworks such as jquery or prototype, shortening the "queryselector" name can be convenient: function $ (selector, el) { if (!el) {el = document;} return el.queryselector(selector); } function $$ (selector, el) { if (!el) {el = document;} return el.queryselectorall(selector); // note: the returned object is a nodelist.
Running applications - Archive of obsolete content
this page describes how to run other programs from your chrome javascript code, using mozilla xpcom interfaces.
Sidebar - Archive of obsolete content
for this snippet to work, you have to declare mainwindow as in the previous code block then write: mainwindow.document.getelementbyid("sidebar-splitter").hidden = true; be aware that if you change the splitter's hidden attribute, you need to reset it to a safe value when your sidebar is closed, or replaced by another sidebar.
JavaScript timers - Archive of obsolete content
setimmediate() calls a function immediately after the browser has completed other operations, such as events and display updates.
Toolbar - Archive of obsolete content
these elements have special behaviors when placed next to eachother, and will break if separated by another element.
Tree - Archive of obsolete content
= tree.view.getcelltext(row.value, col.value); alert(celltext); } getting the selected indices of a multiselect tree var start = {}, end = {}, numranges = tree.view.selection.getrangecount(), selectedindices = []; for (var t = 0; t < numranges; t++){ tree.view.selection.getrangeat(t, start, end); for (var v = start.value; v <= end.value; v++) selectedindices.push(v); } other resources xul: tree documentation xul tutorial: tree selection ...
Communication between HTML and your extension - Archive of obsolete content
the onreadystatechange was set to another little javascript function that would update a specific element on the html page with the result.
Custom about: URLs - Archive of obsolete content
it is imported to queryinterface the components.manager otherwise this will not work.
Default Preferences - Archive of obsolete content
one with user supplied prefs, another with default prefs.
Downloading JSON and JavaScript in extensions - Archive of obsolete content
a common practice found in many extensions is using xmlhttprequest (or some other mechanism) to download javascript or json (they are different) from a remote website.
Extension Theming Guidelines - Archive of obsolete content
if you are not then you run a risk of conflicting with content that other extensions add to the window.
Hiding browser chrome - Archive of obsolete content
note: don't simply replace the hidechromeforlocation() method; this will likely hurt the functionality of firefox itself as well as other extensions.
Installing Extensions and Themes From Web Pages - Archive of obsolete content
tostring() the tostring() property should return the xpi url, for compatibility with firefox browsers older than version 1.0, and other applications such as seamonkey.
Multiple item extension packaging - Archive of obsolete content
no other files besides the install.rdf install manifest and the files with a jar and xpi file extension will be extracted or utilized.
Overlay extensions - Archive of obsolete content
xul school xul school is a comprehensive add-on development tutorial, focusing on firefox extension development but mostly applicable to other gecko-based applications.
Performance best practices in extensions - Archive of obsolete content
see common causes of memory leaks in extensions for ways to avoid zombie compartments and other kinds of leaks.
Signing an extension - Archive of obsolete content
the following instructions also apply to a theme and other xpi files.
Supporting search suggestions in search plugins - Archive of obsolete content
(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+js...
Promises - Archive of obsolete content
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.
Updating addons broken by private browsing changes - Archive of obsolete content
passing {private: true} will cause a private window to open, otherwise the window will always be non-private.
progress - Archive of obsolete content
this doesn't include headers and other overhead, but only the content itself.
Localizing an extension - Archive of obsolete content
adding more localizations to add another localization for a new language, all you need to do is add another line to the chrome manifest referencing the new locale.
cert_override.txt - Archive of obsolete content
this file is used by firefox, thunderbird, and other xul-based applications.
No Proxy For configuration - Archive of obsolete content
g sub-domains domain suffix "mozilla.org" does not block domains that end in the same string (amozilla.org) sub-domains domain suffix, starting with a dot ".mozilla.org" does not block the main domain (mozilla.org) a hostname (without domain) hostname-only (see problems below) "localhost" also blocks any possible domains that start with the entry ("www.otherdomain.localhost") a hostname (with domain) domain name "www.mozilla.org" does not block hostnames or domains that end in the same string (other-www.mozilla.org) an ip address ip address "1.2.3.4" does not block hostnames that resolve to the ip address ("127.0.0.1" does not block "localhost") a network network w/ cidr block "10.0.0.0/8" does no...
Source Navigator - Archive of obsolete content
but on the other hand mxr can only allow you to type in the name for it to generate a long list of occurances.
Using content preferences - Archive of obsolete content
this permits code running within chrome (in other words: extensions and the browser itself, not web sites) to locally save preferences on a per-site basis.
Misc top level - Archive of obsolete content
in other words, any html file on your local disk can read any other file on your local disk.
Enabling quicklaunch for all users - Archive of obsolete content
enabling quicklaunch for all users unlike all other settings, quicklaunch is stored in the windows registry.
Protecting Mozilla's registry.dat file - Archive of obsolete content
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 .
Automatic Mozilla Configurator - Archive of obsolete content
configuration files automatic mozilla configurator:how thunderbird and firefox find their configuration files automatic mozilla configurator:protecting mozilla's registry.dat file automatic mozilla configurator:enabling quicklaunch for all users automatic mozilla configurator:kill the xul.mfl file for good automatic mozilla configurator:locked config settings automatic mozilla configurator:other mozilla customization pages online configurator tools: registry.dat mozilla.cfg (locked preferences) ...
Bookmark Keywords - Archive of obsolete content
in figure 2, we can see the bookmark has been filed into a folder called "widgets." you can create a folder with another name, or not put your keymarks into a folder at all.
Structure of an installable bundle - Archive of obsolete content
note that other files and directories (e.g.
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
otherwise you'll delete files later.
Enabling the behavior - updating the status periodically - Archive of obsolete content
put the javascript code into a file called tinderstatus.js in the same directory as navigator.xul and reference it in navigator.xul where other javascript scripts are referenced: ...
Creating a hybrid CD - Archive of obsolete content
it is used as the creator type for readme and other text files because it can handle unix and windows linebreaks, but teachtext cannot.
Links - Archive of obsolete content
some other skin related resources: learning css zvon.org the world wide web consortium ...
Creating a Skin for Mozilla - Archive of obsolete content
organizing images adding an image to the right of a toolbar jar file installer utility (provided by neil marshall) frequently asked questions links original document information author: neil marshall other contributors (suggestions/corrections): brent marshall, cdn (http://themes.mozdev.org), jp martin, boris zbarsky, asa dotzler, wesayso, david james, dan mauch last updated date: jan 5th, 2003 copyright information: copyright 2002-2003 neil marshall, permission given to devmo to migrate into the wiki april 2005 via email.
DTrace - Archive of obsolete content
dtrace has been largely supplanted by the gecko profiler and other tools, so this documentation has been archived.
Installing Dehydra - Archive of obsolete content
o /dev/null for example, in the tests directory created by the installation procedure, i can run a dehydra script 'a.js' on a mozilla file like this: g++ -quiet -fplugin=../gcc_dehydra.so \ -fplugin-arg=a.js -fshort-wchar -fpreprocessed \ /home/dmandelin/builds/dehydra-gcc/browser/app/nsbrowserapp.ii -o /dev/null the -fshort-wchar is required for running against firefox, but not necessarily for other codebases.
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.
Download Manager improvements in Firefox 3 - Archive of obsolete content
other download manager documentation download manager preferences this article lists preferences used by the download manager as well as their default values.
Drag and Drop Example - Archive of obsolete content
it will contain three buttons, one to create new buttons, one to create check boxes and the other to create textboxes.
Editor Embedding Guide - Archive of obsolete content
the above strings should be considered examples of base functionality and in no way imply that this command won't handle other fonts.
Documentation for BiDi Mozilla - Archive of obsolete content
other bidi functionality clipboard: based on bidi options in preferences, the text mode of the clipboard may be "logical", "visual" or "as source".
JSS build instructions for OSX 10.6 - Archive of obsolete content
nspr_4_8_7_rtm nspr cvs co -r nss_3_12_9_with_ckbi_1_82_rtm nss cvs co -r jss_4_3_2_rtm jss build nss for 32 and 64: cd mozilla/security/nss make nss_build_all cc="gcc -arch i386" ccc="g++ -arch i386" make nss_build_all use_64=1 build jss for 32 and 64: cd ../jss make cc="gcc -arch i386" ccc="g++ -arch i386" make use_64=1 on osx, java.library.path doesnt seem to have /usr/lib or other paths.
Help Viewer - Archive of obsolete content
help viewer project page articles & tutorials creating a help content pack task-oriented, as opposed to spec-type stuff like the link below will be other resources content pack specification a technical description of it, meant primarily to solidify the idea of exactly what constitutes a content pack ...
Isp Data - Archive of obsolete content
introduction these files allow for adding to the new account wizard a new option, and help with, among other things, deployment of custom thunderbird.
CRMF Request object - Archive of obsolete content
warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
generateCRMFRequest() - Archive of obsolete content
warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
importUserCertificates - Archive of obsolete content
warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
popChallengeResponse - Archive of obsolete content
warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
Twitter - Archive of obsolete content
in other words, define a data property that is itself an object whose properties correspond to the parameters of the twitter method.
Libraries - Archive of obsolete content
namespace: jetpack.lib jetpack provides libraries for interacting with web and other services not part of the jetpack core.
First run - Archive of obsolete content
otherwise, the value is assumed to be html, and it becomes the body of your first-run page.
Enabling Experimental Jetpack Features - Archive of obsolete content
jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration).
Enabling - Archive of obsolete content
jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration).
First Run - Archive of obsolete content
otherwise, the value is assumed to be html, and it becomes the body of your first-run page.
Settings - Archive of obsolete content
settings are private to each jetpack and are not accessible by other jetpacks.
Settings - Archive of obsolete content
settings are private to each jetpack and are not accessible by other jetpacks.
Enabling Experimental Jetpack Features - Archive of obsolete content
ArchiveMozillaJetpackdocsMetaFuture
jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration).
jspage - Archive of obsolete content
eof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); }break;case"hash":b=new hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var browser=$merge({engine:{name:"unknown",version:0},platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].tolowercase()},features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.queryselector)},plugins:{},engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getelementsbyclassname)?950:925)); },trident:function(){return(!window.activexobject)?false:((window.xmlhttprequest)?((document.queryselectorall)?6:5):4);},webkit:function(){r...
Microsummary XML grammar reference - Archive of obsolete content
it must not contain any other elements, and it does not have any attributes.
Overview of how downloads work - Archive of obsolete content
one way is to encounter a file with an unknown content type, the other is to choose "save link target as" from the context menu of a link.
Plug-n-Hack Get Involved - Archive of obsolete content
while this project has been started by the mozilla security team and has been validated with firefox and owasp zap, this is an open project and we welcome involvement from anyone, especially people working on other browsers and security tools.
Plugin Architecture - Archive of obsolete content
sequence of events in content a content node for a plugin dom element gets created in bindtotree (usually) or another function, it calls loadobject loadobject either notices directly that it is dealing with a plugin, or it starts a network request and notices this in onstartrequest when it realizes that, it tries to create a frame, if anotify is true and no frame exists yet if a frame exists now, it is asked to instantiate the plugin that was the normal case.
Porting NSPR to Unix Platforms - Archive of obsolete content
on other platforms, you may need to do extra work to deal with their idiosyncrasies.
Build - Archive of obsolete content
this variable is called mozconfig export mozconfig=$pwd/.mozconfig #this should point to mozilla/prism/.mozconfig go back to the mozilla/ directory and do another build, this time, prism will get built cd ../ make -f client.mk build congratulations, you have just built prism.
BundleLibrary - Archive of obsolete content
mail: ymail.webapp (note that this fakes a firefox user agent string while running, which may affect other running web applications.) ...
Bundles - Archive of obsolete content
any other files in the .webapp file will be ignored.
Configuration - Archive of obsolete content
remember that other people can create different webapps using the same uri and this webapp is only your particular instance or mashup.
Extensions - Archive of obsolete content
extensions typically overlay the host application's ui to add toolbar buttons, menus and other features.
FAQ - Archive of obsolete content
ArchiveMozillaPrismFAQ
prism is the codename for the project, and if the functionality provided by prism becomes a product or is integrated into other products (like firefox), then it won't necessarily continue to be called by this codename.
Scripting - Archive of obsolete content
it means that the script has a higher level of privilege than scripts in the web content and has access to the file system, clipboard and other parts of the native os.
Styling - Archive of obsolete content
the folder names must match the following: windows - winnt mac os x - darwin linux - linux the folder names are pulled from mozilla and are the same as those used in other mozilla projects, such as extension and xul applications.
Prism - Archive of obsolete content
it doesn’t have the menus, toolbars and other accoutrements of a traditional web browser.
Proxy UI - Archive of obsolete content
for example, firefox 3: [ ] no proxy [ ] auto-detect proxy settings for this network [ ] manual proxy configuration: [ ] automatic proxy configuration url: behavior default value: "no proxy" is selected all other "type" radio buttons are enabled, but not selected.
PyDOM - Archive of obsolete content
content loaded from anywhere other than a chrome:// url can not host python.
Rsyncing the CVS Repository - Archive of obsolete content
this is useful for faster diffs or for attempting to import it into another version control system.
Running Windows Debug Builds Downloaded From Tinderbox - Archive of obsolete content
no other packages are necessary.
Same origin policy for XBL - Archive of obsolete content
the same origin policy used for xbl documents is different from the policy used for other content.
open - Archive of obsolete content
other methods, such as remove may not be used when the file is open.
Merging TraceMonkey Repo - Archive of obsolete content
otherwise, you can run hg parents filename to find the changesets which may have contributed to the conflict.
Abc Assembler Tests - Archive of obsolete content
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.
Tamarin Acceptance Test Template - Archive of obsolete content
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.
Actionscript Performance Tests - Archive of obsolete content
to compare two vms against each other export avm2=<path to 2nd vm> or use --avm2=<path to 2nd vm>.
Tamarin mercurial commit hook - Archive of obsolete content
[n]: note that the prompt gives you the options to abort the commit (no), allow the tab (or other violation) on that particular line, or allow the violation for all lines in that file.
The life of an HTML HTTP request - Archive of obsolete content
startlayout is called quite early in the parsing process, for html it's called in nshtmlcontentsink::openbody() (among other places).
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
0 : 1; } this is a completely correct (albeit trivial) program that will run predictably on all nspr platforms other than win-16.
[Deprecated] The Mozilla build VM - Archive of obsolete content
other links of interest may include: developer guide (documentation about developing on and for mozilla projects).
Venkman Internals - Archive of obsolete content
from here, you can set and clear breakpoints by line number (instead of by program counter), locate a scriptwrapper for a given line number, and do a few other useful things.
Video presentations - Archive of obsolete content
(as quicktime; 105 mb and 34 mb) other videos (might be obsolete) mozilla video presentations (2001-2002) seamonkey brownbag training series (2000) ...
Mozilla Web Developer Community - Archive of obsolete content
mozilla developer news feed actually, there are no other feeds available for developer.mozilla.org.
When To Use ifdefs - Archive of obsolete content
the mozilla codebase is used for many different projects and products, including firefox, thunderbird, xulrunner, and many others.
Example Sticky Notes - Archive of obsolete content
the others are only needed if you plan to handle xul (xml user interface language) or/and svg (scalable vector graphics) in your bindings; xlink in xml also may come useful sometimes.
XBL 1.0 Reference - Archive of obsolete content
extensible binding language is a xml-based markup language to implement reusable components (bindings) that can be bound to elements in other documents.
Mac stub installer - Archive of obsolete content
original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
Trigger Scripts and Install Scripts - Archive of obsolete content
trigger scripts and install scripts trigger scripts are simple installations that can be initiated from event handlers and other javascript code on a web page.
modDateChanged - Archive of obsolete content
err3 = file.moddatechanged(filesource2, err1); logcomment("file.moddatechanged should return 'true' = " + err2); // the reason it expects true is we're comparing // the return 'time stamp' value for // file1.txt with another file, file2.txt, with a different // 'time stamp' value.
move - Archive of obsolete content
move moves a file from one location to another.
windowsShortcut - Archive of obsolete content
can be either .ico, .dll, .exe, or any other binary file that contains icons.
Methods - Archive of obsolete content
moddatechanged specifies whether the last modification on a file is older than a specified date move moves a file from one location to another.
compareTo - Archive of obsolete content
otherwise, it returns a positive number.
toString - Archive of obsolete content
to get the version number out of an installversion object in order to compare it with other versions, you can call tostring() and get back the version as a string in the format "maj.min.rev.bld." example var vi = new installversion(); vi.init("999.888.777.666"); //random string vistring = vi.tostring(); ...
getFolder - Archive of obsolete content
the value of foldername must be one of the following (info is based on mozilla 1.7 stable branch, might also work in other versions): "chrome" "components" "current user" "defaults" "file:///" "os drive" "plugins" "preferences" "profile" "program" "temporary" "mac apple menu" "mac control panel" "mac desktop" "mac documents" ...
patch - Archive of obsolete content
typically, absolute pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll.
performInstall - Archive of obsolete content
in some situations the method may return other errors.
registerChrome - Archive of obsolete content
in some situations the method may return other errors.
writeString - Archive of obsolete content
returns true if successfully scheduled, otherwise, false.
setRootKey - Archive of obsolete content
if you want to access keys in another portion, you must use this method to change the root key.
valueExists - Archive of obsolete content
returns boolean value: true if the key exists and the user has read access to it, otherwise false.
WinReg Object - Archive of obsolete content
to manipulate other values, use the getvalue and setvalue methods.
XPInstall API reference - Archive of obsolete content
tring winreg no properties methods createkey deletekey deletevalue enumkeys enumvaluenames getvalue getvaluenumber getvaluestring iskeywritable keyexists setrootkey setvalue setvaluenumber setvaluestring valueexists winregvalue constructor other information return codes see complete list examples trigger scripts and install scripts code samples file.macalias file.windowsshortcut install.adddirectory install.addfile installtrigger.installchrome installtrigger.startsoftwareupdate windows install ...
XPInstall - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- properties --> </description> </rdf> cross-platform install (xpinstall) is a technology used by mozilla application suite, mozilla firefox, mozilla thunderbird and other xul-based applications for installing extensions.
Mozilla E4X - Archive of obsolete content
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.
XTech 2005 Presentations - Archive of obsolete content
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.
Flexgroup - Archive of obsolete content
the same process occurs when decreasing the size, except in the other direction.
searchbutton - Archive of obsolete content
otherwise, the command event is fired whenever the user modifies the value.
accesskey - Archive of obsolete content
otherwise, if the label has two or more characters which are same as its accesskey, the first of those characters in the label will be underlined.
allownegativeassertions - Archive of obsolete content
when multiple datasources are used, one may override an assertion from another.
coalesceduplicatearcs - Archive of obsolete content
when multiple datasources are used, one may override an assertion from another.
flex - Archive of obsolete content
ArchiveMozillaXULAttributeflex
the actual value is not relevant unless there are other flexible elements within the same container.
group - Archive of obsolete content
if the user selects one the buttons, the others in the group are unchecked.
iconsize - Archive of obsolete content
these can vary from one toolbar to another within a given toolbox, whose iconsize attribute defines the default for all toolbars that don't specify an icon size.
id - Archive of obsolete content
ArchiveMozillaXULAttributeid
you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets.
ignorecase - Archive of obsolete content
otherwise, the default value is false, to indicate that the value should match with the same case.
label - Archive of obsolete content
label value="whaw" id="the-big-label" command="the-big-button"/> <button id="the-big-button" label="click me" oncommand="alert(document.getelementbyid('the-big-label').value)"/> <label id="mylabel" value="my label"/> <button label="click me" oncommand="document.getelementbyid('mylabel').setattribute('value','value changed');" /> <checkbox label="my checkbox" id="mycheckbox"/> <button label="another click" oncommand="document.getelementbyid('mycheckbox').setattribute('label','still not checked');"/> <button label="show label of checkbox" oncommand="alert( document.getelementbyid('mycheckbox').getattribute('label') )"/> ...
lightweightthemes - Archive of obsolete content
« xul reference home lightweightthemes type: boolean true if the window supports lightweight themes, otherwise false.
menuitem.type - Archive of obsolete content
other menuitems that have the same value for their name attributes are part of the same radio group.
mousethrough - Archive of obsolete content
the mousethrough attribute is typically used in conjunction with a stack to allow elements to be stacked above other elements yet allow mouse events to be sent to lower elements.
multiple - Archive of obsolete content
otherwise, the entire value string is compared.
noautohide - Archive of obsolete content
if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element.
panel.noautohide - Archive of obsolete content
« xul reference home noautohide type: boolean if false, the default value, the panel will be hidden when the user clicks outside the panel or switches focus to another application.
panel.type - Archive of obsolete content
otherwise leave this attribute out.
persistence - Archive of obsolete content
this may be used to close a set of notifications as a group without affecting other notifications.
right - Archive of obsolete content
in other words, the right edge of the element is placed 80 pixels to the right of where the right edge of the stack was prior to the element being added.
rows - Archive of obsolete content
ArchiveMozillaXULAttributerows
if the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows.
searchSessions - Archive of obsolete content
the following values are possible, although custom components may be installed which add others.
sizetopopup - Archive of obsolete content
otherwise, the menu will size itself to at least the size of the popup.
textbox.onblur - Archive of obsolete content
as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the script code only runs in the context of the <textbox> element, matching the behavior of all other event handlers.
textbox.onchange - Archive of obsolete content
the event is not sent until the focus is moved to another element.
textbox.onfocus - Archive of obsolete content
as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the script code only runs in the context of the <textbox> element, matching the behavior of all other event handlers.
timeout - Archive of obsolete content
if the user types another character, the timer resets.
treecol.type - Archive of obsolete content
this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect.
value - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
var - Archive of obsolete content
ArchiveMozillaXULAttributevar
« xul reference home var type: string for the xul assign attribute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name".
Deprecated and defunct markup - Archive of obsolete content
elements <actions> (listed here by mistake or was it a container tag?) typo for <action> --neil 03 march 2011 <autorepeatbutton> (action occurs repeatedly on mouse hover--used to construct other elements; used in <arrowscrollbox> and large drop-down menus) so, not deprecated?
Uploading and Downloading Files - Archive of obsolete content
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.
IO - Archive of obsolete content
ArchiveMozillaXULFileGuideIO
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.
TOC - Archive of obsolete content
ArchiveMozillaXULFileGuideTOC
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.
swapDocShells - Archive of obsolete content
« xul reference home swapdocshells( otherbrowser ) return type: no return value swaps the content, history and current state of this browser with another browser.
addItemToSelection - Archive of obsolete content
« xul reference home additemtoselection( item ) return type: no return value selects the given item, without deselecting any other items that are already selected.
appendNotification - Archive of obsolete content
if another notification is already present with a higher priority, the new notification will be added behind it.
blur - Archive of obsolete content
ArchiveMozillaXULMethodblur
the focus is not automatically placed on any other element.
openWindow - Archive of obsolete content
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.
removeItemFromSelection - Archive of obsolete content
« xul reference home removeitemfromselection( item ) return type: no return value deselects the specified item without deselecting other items.
selectItemRange - Archive of obsolete content
all other items are deselected.
showOnlyTheseTabs - Archive of obsolete content
« xul reference home showonlythesetabs( atabs ) return type: no return value makes all tabs in the atabs array visible, and all other tabs hidden.
showPopup - Archive of obsolete content
to have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the boxobject.screenx and boxobject.screeny properties of the element, and use those as the x and y arguments offset by the desired values.
stopEditing - Archive of obsolete content
otherwise the cell label is reverted to the value it had prior to editing.
syncSessions - Archive of obsolete content
« xul reference home syncsessions( autocompleteelement ) obsolete since gecko 26 return type: void copy the sessions from another autocomplete element.
timedSelect - Archive of obsolete content
all other items are deselected.
toggleItemSelection - Archive of obsolete content
other items in the list box that are selected are not affected, and retain their selected state.
MenuButtons - Archive of obsolete content
the effect is a button that performs one command with a menu for other commands.
Tooltips - Archive of obsolete content
however, it is possible to use another tooltip element that looks differently, or which supports other elements besides a single text label.
clickSelectsAll - Archive of obsolete content
« xul reference clickselectsall type: boolean if set to true, the contents of the textbox are selected when focused; otherwise, the cursor is left unchanged.
contextMenu - Archive of obsolete content
note that the value of this property does not reflect the value of the context attribute, which is otherwise identical to the contextmenu attribute.
selstyle - Archive of obsolete content
otherwise, the entire row will be highlighted.
uri - Archive of obsolete content
ArchiveMozillaXULPropertyuri
then, the other rules are evaluated for a match.
view - Archive of obsolete content
ArchiveMozillaXULPropertyview
functions available in the view allow one to retrieve the data within the cells, and determine which rows are nested within others.
alert-icon - Archive of obsolete content
this and the other icon classes may be used by image elements or other elements which can have an image.
chromeclass-toolbar - Archive of obsolete content
otherwise, this option will be ignored for this toolbar and it will always be visible.
Simple Example - Archive of obsolete content
(?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = 'palace from above') the process continues in a similar manner for the other two results.
Using Multiple Queries to Generate More Results - Archive of obsolete content
to do this, we create one query to generate one set of results and a second query to generate another set of results.
Things I've tried to do with XUL - Archive of obsolete content
so, as soon as you add a label or some other element inside, there will be a different amount of "empty space" to allocate in different boxes.
Tree Widget Changes - Archive of obsolete content
currently, only checkbox columns support editing, although the content-based tree handles the nsitreeview.setcellvalue() and nsitreeview.setcelltext() functions to change the tree content with a script for other types of cells.
Adding Labels and Images - Archive of obsolete content
the description element is intended for other descriptive text such as informative text at the top of a dialog box.
Creating Dialogs - Archive of obsolete content
amongst other useful attributes are buttonlabelaccept - label to appear on the accept button egsave buttonaccesskeyaccept - access key to use for the accept button egs defaultbutton - button is activated when the enter key is pressed note: the label attributes are required by remote sites and are probably missing in the above examples due to bug 224996.
Groupboxes - Archive of obsolete content
you can put any element you want inside it, and apart from its special handling of radio buttons, it works like any other box.
List Controls - Archive of obsolete content
the other choices will appear in a pop-up window.
More Tree Features - Archive of obsolete content
there are two other things you need to do to make sure the hierarchy works properly.
More Wizards - Archive of obsolete content
another useful property of the wizard is currentpage, which holds a reference to the currently displayed wizardpage.
Open and Save Dialogs - Archive of obsolete content
you can also use modegetfolder and modesave for the other two modes.
Popup Menus - Archive of obsolete content
note that the tooltip element is still placed inside a popupset element like other popup types.
Scrolling Menus - Archive of obsolete content
« previousnext » this section will describe scrolling menus and how to use the mechanism with other elements.
Simple Menu Bars - Archive of obsolete content
the menu bar can optionally be placed inside a toolbox and the menu would work just like any other toolbar.
Tree Selection - Archive of obsolete content
otherwise, the user may select multiple rows, which will not necessarily be contiguous.
XBL Inheritance - Archive of obsolete content
any binding can be extended with another.
XPCOM Examples - Archive of obsolete content
you can also get this component through the rdf service, which is another service that manages rdf datasources.
Using nsIXULAppInfo - Archive of obsolete content
d = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"; var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); if(appinfo.id == firefox_id) { // running under firefox } else if(appinfo.id == thunderbird_id) { // running under thunderbird } else if(appinfo.id == seamonkey_id) { // running under seamonkey } else { // another app } note: you could also use nsixulappinfo.name, which is a human-readable name for the application, such as "firefox", "thunderbird" or "seamonkey", but who knows, maybe they'll rename it again!
XUL Accesskey FAQ and Policies - Archive of obsolete content
next, try the first letter of another word in the prompt.
XUL Changes for Firefox 1.5 - Archive of obsolete content
for other changes you should be aware of, see adapting xul applications for firefox 1.5.
XUL FAQ - Archive of obsolete content
other faqs you may be interested in: extension faq, ...
XUL Reference - Archive of obsolete content
ure --- menus and popups --- toolbars toolbar toolbarbutton toolbargrippy toolbaritem toolbarpallete toolbarseperator toolbarspring tabs and grouping tab tabbox tabpanel tabpanels tabs controls --- text and images label caption image lists --- trees --- layout --- templates --- scripting --- helper elements other xul lists dialog overlay page window wizard wizardpage preference preferences prefpane prefwindow browser tabbrowser editor iframe titlebar resizer statusbar statusbarpanel dialogheader notification notificationbox menubar menu menuitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarsepara...
XUL controls - Archive of obsolete content
description reference <groupbox> a groupbox displays a labelled box around other user interface controls.
assign - Archive of obsolete content
var type: string for the xul assign attribute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name".
command - Archive of obsolete content
like a broadcaster, commands forward attributes to other elements.
content - Archive of obsolete content
then, the other rules are evaluated for a match.
description - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
dialogheader - Archive of obsolete content
attributes crop, description, title examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <dialogheader title="my dialog" description="example dialog"/> <!-- other widgets --> </dialog> attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
dropmarker - Archive of obsolete content
a dropmarker is not intended to be used as a separate element, but as part of another element.
editor - Archive of obsolete content
rty of the loaded html document: <script language="javascript"> function initeditor(){ // this function is called to set up the editor var editor = document.getelementbyid("myeditor"); editor.contentdocument.designmode = 'on'; } </script> <editor id="myeditor" editortype="html" src="about:blank" flex="1" type="content-primary"/> once editable, the document can have special formatting and other html pieces added to it using the document.execcommand method: var editor = document.getelementbyid("myeditor"); // toggle bold for the current selection editor.contentdocument.execcommand("bold", false, null); see the midas overview for more command strings.
image - Archive of obsolete content
ArchiveMozillaXULimage
this and the other icon classes may be used by image elements or other elements which can have an image.
listcol - Archive of obsolete content
you can make some columns flexible and other columns non-flexible.
listitem - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
member - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used within a rule's conditions element to match elements that are containers or are contained within another element.
notificationbox - Archive of obsolete content
if another notification is already present with a higher priority, the new notification will be added behind it.
radiogroup - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
richlistitem - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
rows - Archive of obsolete content
ArchiveMozillaXULrows
the rows element may be nested inside another rows element.
spinbuttons - Archive of obsolete content
spin buttons are not used as separate elements, but are used in combination with other elements to create a control that can be increased and decreased.
stack - Archive of obsolete content
ArchiveMozillaXULstack
« xul reference home [ examples | attributes | properties | methods | related ] an element that renders its children on top of each other.
stringbundle - Archive of obsolete content
for example, the following defines two properties: message.displayerror=an error occured trying to display this message message.namealreadyused=the name %s is already being used by another account.
tabbox - Archive of obsolete content
attributes eventnode, handlectrlpageupdown, handlectrltab properties accessibletype, eventnode, handlectrlpageupdown, handlectrltab, selectedindex, selectedpanel, selectedtab, tabs, tabpanels examples <tabbox id="mytablist" selectedindex="2"> <tabs> <tab label="a first tab"/> <tab label="second tab"/> <tab label="another tab"/> <tab label="last tab"/> </tabs> <tabpanels> <tabpanel><!-- tabpanel first elements go here --></tabpanel> <tabpanel><!-- tabpanel second elements go here --></tabpanel> <tabpanel><button label="click me"/></tabpanel> <tabpanel><!-- tabpanel fourth elements go here --></tabpanel> </tabpanels> </tabbox> attributes eventnode type: one of the values below ...
tabpanel - Archive of obsolete content
this element is optional and you may just use any other container in place of it.
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
nb: you can add some other elements to tabs such as button, but they will receive an index.
textnode - Archive of obsolete content
this is useful if you want to use the html element or other elements that have text content inside them instead of in attributes.
treecell - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
XUL - Archive of obsolete content
xul applications are applications using xul and other components of the platform).
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
save the application archive to your desktop or another convenient place.
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
save the application archive to your desktop or another convenient place.
XULRunner 1.9.1 Release Notes - Archive of obsolete content
save the application archive to your desktop or another convenient place.
XULRunner 1.9.2 Release Notes - Archive of obsolete content
save the application archive to your desktop or another convenient place.
XULRunner 1.9 Release Notes - Archive of obsolete content
save the application archive to your desktop or another convenient place.
XULRunner 2.0 Release Notes - Archive of obsolete content
save the application archive to your desktop or another convenient place.
Deploying XULRunner - Archive of obsolete content
other executables and libraries the core changes to xul and gecko that require this new file layout were implemented in gecko 34, except that the xulrunner application was not updated to know about the change, so it will report an error: "unable to load xpcom." xulrunner was fixed in gecko 39.
XULRunner FAQ - Archive of obsolete content
how does xulrunner compare to other runtimes like java or .net (or python or ...)?
XULRunner Hall of Fame - Archive of obsolete content
python-hulahop is required python-hulahop from the olpc sugarlabs a python gtk widget with xulrunner embedded, providing full access to nsi dom and all other xulrunner interfaces, in a gtk window.
Opening a Link in the Default Browser - Archive of obsolete content
extps.loaduri(uritoopen, null); by default, the external protocol service will warn the user about opening the link in another application.
Windows and menus in XULRunner - Archive of obsolete content
the xul file may also contain other top-level declarations for css and dtd, which i will discuss in a moment.
toolkit.singletonWindowType - Archive of obsolete content
if such a window is found, it will be re-used, otherwise a new window will be opened.
Mozprocess - Archive of obsolete content
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.
Mozprofile - Archive of obsolete content
see https://github.com/mozilla/mozbase/b...permissions.py resources other mozilla programs offer additional and overlapping functionality for profiles.
reftest opportunities files - Archive of obsolete content
in other cases, the design of the reference page may take more subtlety.
Mozilla.dev.apps.firefox-2006-10-06 - Archive of obsolete content
places in firefox 3 discussion regarding places (a new system for storing bookmarks, histroy and other page info) in firefox 3.
2006-10-06 - Archive of obsolete content
other links of interest: roadmap for accessible rich internet applications (wai-aria roadmap) roles for accessible rich internet applications (wai-aria roles) states and properties module for accessible rich internet applications (wai-aria states and properties) making ajax work with screen readers meetings accessibility hackfest 2006 - october 10-12 in cambridge, ma (more details) participants in...
2006-11-10 - Archive of obsolete content
ideas include: adding standardized shortcuts clc-4-tts and/or other screenreader integration screenreader integration via an accessibility api discussion on the use of the <tab> key.
2006-11-22 - Archive of obsolete content
summary: mozilla.dev.accessibility - nov 17-nov 22, 2006 announcements mozilla osk project grant aaron leventhal (on behalf of michael curran) mentiond that there is now an nvda email list you can join if you wish to keep up to date with the latest changes, or if you wish to discuss new features or talk with other nvda users.
2006-10-06 - Archive of obsolete content
places in firefox 3 discussion regarding places (a new system for storing bookmarks, histroy and other page info) in firefox 3.
2006-10-20 - Archive of obsolete content
ie7 rss reader better - say reviewers a discussion revolving around the quality of rss readers in ie7, firefox and other assorted browsers.
2006-11-10 - Archive of obsolete content
favicon as microsummary/feed/other stuff indicator suggestion about making the favicon create a bookmark for the page with a microsummary.
2006-12-01 - Archive of obsolete content
devs say this is the way its supposed to be, others say its a bug!
2006-11-17 - Archive of obsolete content
this user want to add a filter to his tb, so that it could color the mail that is for a particular recepient, however, the regular expression that he uses doesn't work and want suggestion from others.
2006-10-13 - Archive of obsolete content
some testing and validation has been done, but they would like other people to look at the installations and complete the setup before they switch over.
2006-11-03 - Archive of obsolete content
dale has discovered that there are other people who are experiencing the same issues as he is.
2006-11-10 - Archive of obsolete content
november 9th: jonathan watt responded to his posting stating that he must have the wrong line endings in his mozconfig or some other script fill that he is probably using to run.
2006-10-06 - Archive of obsolete content
test resumt will be found here another lightning localization update with some bad news difference has been located between sunbird_0_3_branch (for sunbird 0.3) and mozilla_1_8_branch.
2006-11-10 - Archive of obsolete content
discussions help about firefox 3 a discussion on how to syncronise mozilla_1_8_branch with the trunk, which tag should be used to check-in files on trunk, and when files will be pulled from trunk to create another branch (mozilla_1_9_branch?) for firefox 3.
2006-11-3 - Archive of obsolete content
localization of amo and some other pages of mozilla.com suggestion on localizing popular add-ons as well as web pages at mozilla.com.
2006-11-10 - Archive of obsolete content
other important notes are contained in the link above firefox and thunderbird 1.5.0.8 were released firefox and thunderbird 1.5.0.8 were released on november 7, 2006 blocker nomination and code freeze for 1.5.0.9/2.0.0.1 blocker nomination is due on november 10.
2006-11-24 - Archive of obsolete content
others gave input on this as well meetings because of the firefox summit last week there is no project status meeting this week november 22 gecko 1.9/gran paradiso status meeting: (agenda) ...
2006-12-01 - Archive of obsolete content
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).
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.platform - october 7th to october 13th 2006 announcements no announcments this week other traffic javascript package system for 1.9/ff3 on sun, oct 8 2006 robert sayre inquires about the javascript package system for 1.9 for firefox 3, robert would like to know if there is any chance we'll get this?
2006-11-03 - Archive of obsolete content
discussions none meetings community test day - on friday, november 3, 2006 another community test day focusing on security and stability release, and you can help by verifying bugs, and by running the litmus test cases under the ffts or the bfts.
2006-10-06 - Archive of obsolete content
other this is for allowing protocol handlers to define a custom security model (see bug 120373).
2006-11-24 - Archive of obsolete content
yet more people disgruntled by ev proposal mozilla, opera and co only tout open standards as it suits them in addition eddy nigg posted an alternative proposal for the use of extended validation certificates ev certificates / another proposal meetings none during this week.
2006-12- 08 - Archive of obsolete content
david baron is planning to make an additional change to the computesize api onthe reflow branch to resolve a number of float-related bugs (359135,360093), and some others.
2006-10-13 - Archive of obsolete content
test importing and exporting sunbird calendars to/from other calendar applications.
Monitoring plugins - Archive of obsolete content
ntime notifications: function pluginobserver() { this.registered = false; this.register(); //takes care of registering this class with observer services as an observer for plugin runtime notifications } pluginwatcherobserver.prototype = { observe: function(subject, topic, data) { if (topic == "experimental-notify-plugin-call") //in case your class is registered to listen to other topics //this gets executed each time a runtime notification arrives // --your code goes here-- } }, //takes care of registering the observer services for the "experimental-notify-plugin-call" topic register: function() { if (this.registered == false) { //this check prevents double registration -- something you want to avoid!!
Browser-side plug-in API - Archive of obsolete content
warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results.
NPAnyCallbackStruct - Archive of obsolete content
at the time the plug-in is called, the browser has already opened the file and written postscript for other parts of the page.
NPFullPrint - Archive of obsolete content
false: display print dialogs so user can choose printer, other options.
NPN_Enumerate - Archive of obsolete content
returns true if the names of the properties and methods were successfully retrieved, otherwise false.
NPN_Evaluate - Archive of obsolete content
returns true if the script was evaluated successfully, otherwise false.
NPN_GetProperty - Archive of obsolete content
returns true if the value was retrieved successfully, otherwise false.
NPN_HasMethod - Archive of obsolete content
returns true if the method exists on the specified object, otherwise false.
NPN_HasProperty - Archive of obsolete content
returns true if the property exists on the specified object, otherwise false.
NPN_IdentifierIsString - Archive of obsolete content
returns true if the identifier is a string identifier, or false otherwise.
NPN_Invoke - Archive of obsolete content
returns true if the method was successfully invoked, otherwise false.
NPN_InvokeDefault - Archive of obsolete content
returns true if the default method was successfully invoked, otherwise false.
NPN_MemFree - Archive of obsolete content
npn_memfree does not free memory allocated by any other means.
NPN NewStream - Archive of obsolete content
a plug-in can create another instance of itself by specifying its own mime type and a new target name in a call to npn_newstream.
NPN_PostURL - Archive of obsolete content
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).
NPN_ReloadPlugins - Archive of obsolete content
if true, all pages are reloaded once the plugins are reloaded; otherwise, they aren't.
NPN_RemoveProperty - Archive of obsolete content
returns true if the property was removed successfully, otherwise false.
NPN_SetProperty - Archive of obsolete content
returns true if the value was set successfully, otherwise false.
NPN_Write - Archive of obsolete content
this number depends on the size of the browser's memory buffers, the number of active streams, and other factors.
NPP_DestroyStream - Archive of obsolete content
npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems.
NPP_NewStream - Archive of obsolete content
note: in any mode other than np_seek, the application should call npp_destroystream once all data in the stream has been written to the plug-in.
NPP_Print - Archive of obsolete content
an embedded plug-in shares printing with the browser; the plug-in prints the part of the page it occupies, and the browser handles everything else, including displaying print dialog boxes, getting the printer device context, and any other tasks involved in printing, as well as printing the rest of the page.
NPPrintCallbackStruct - Archive of obsolete content
at the time the plug-in is called, the browser has already opened the file and written postscript for other parts of the page.
NPSavedData - Archive of obsolete content
this information can be returned to another instance of the same plug-in if the user returns to the web page that contains it.
NPVariant - Archive of obsolete content
e mapping of javascript values to npvariants is as follows: javascript type npvarianttype undefined npvarianttype_void null npvarianttype_null boolean npvarianttype_bool number npvarianttype_int32 or npvarianttype_double string npvarianttype_string all other types npvarianttype_object functions npn_releasevariantvalue() npn_getstringidentifier() npn_getstringidentifiers() npn_getintidentifier() npn_identifierisstring() npn_utf8fromidentifier() npn_intfromidentifier() macros plugin developers are not expected to directly manipulate or access the members of the npvariant instance, instead, the function npn_releasevar...
NPWindow - Archive of obsolete content
clipping to the cliprect prevents the plug-in from overwriting the status bar, scroll bars, and other page elements when partially scrolled off the screen.
NP_Port - Archive of obsolete content
since the port is shared between the plug-in and other plug-ins and the browser, the plug-in should always do the following: draw only within the area designated by the npwindow.
Getting Started - Archive of obsolete content
in other words, code like this doesn't bother you: this is some markup with <b>bold</b> tags.
Slash - Archive of obsolete content
ArchiveRSSModuleSlash
references rss slash module element list examples none available at this time community none available at this time tools none available at this time other resources rss slash module slash slashdot rss, rdf, xml ...
Well-Formed Web - Archive of obsolete content
references rss well-formed web module element list examples none available at this time community none available at this time tools none available at this time other resources well-formed web spec rss, rdf, xml ...
SAX - Archive of obsolete content
sax was the first widely adopted api for xml in java, and later implemented in several other programming language environments.
Security - Archive of obsolete content
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.
Table Reflow Internals - Archive of obsolete content
a text run) user defined - currently only used for fixed positioned frames kinds of reflows incremental reflow (continued) reflower not allowed to change available size of reflowee reflow commands get coalesced to streamline processing style change a target changed stylistic if there is a target, otherwise every frame may need to respond parent of target usually turns it into an incremental reflow with a style changed command type table frames nstableouter frame ↙ ↘ nstable frame nstablecaption frame ↙ ↘ ↓ nstablecol groupframe nstablerow groupframe nsblockframe ↓ ↓ nstablecol frame nstable...
Tamarin Tracing Build Documentation - Archive of obsolete content
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 ...
The Basics of Web Services - Archive of obsolete content
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.
Create Your Own Firefox Background Theme - Archive of obsolete content
firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window.
Creating a Skin for Firefox - Archive of obsolete content
contents getting started original document information author(s): neil marshall and tucker lee other contributors: brent marshall, cdn (http://themes.mozdev.org), jp martin, boris zbarsky, asa dotzler, wesayso, david james, dan mauch, anders conbere, tim regula (http://www.igraphics.nn.cx) copyright information: copyright 2002-2003 neil marshall, permission given to mdc to migrate into the wiki april 2005 via email.
Making sure your theme works with RTL locales - Archive of obsolete content
the force rtl extension enables you to switch the interface of firefox from ltr to rtl and the other way around dynamically by toggling a menu item.
Developing cross-browser and cross-platform pages - Archive of obsolete content
another major problem with this approach is that the browser identity can be "spoofed" because, in many modern browsers, the navigator.appversion and navigator.useragent string properties are user configurable strings.
Using Web Standards in your Web Pages - Archive of obsolete content
the other sections address dom and dhtml coding practices which are at odds with the w3c web standards and suggest replacements.
-moz-stack-sizing - Archive of obsolete content
this lets you ignore certain children, but not others.
-ms-content-zooming - Archive of obsolete content
initial valuezoom for the top level element, none for all other elementsapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none the initial value of all elements except the top-level element.
-ms-filter - Archive of obsolete content
warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other.
-ms-scroll-limit-x-max - Archive of obsolete content
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.
-ms-scroll-limit-x-min - Archive of obsolete content
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.
-ms-scroll-limit-y-max - Archive of obsolete content
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.
-ms-scroll-limit-y-min - Archive of obsolete content
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.
-ms-scroll-limit - Archive of obsolete content
the specified behavior of the -ms-scroll-limit property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors.
-ms-touch-select - Archive of obsolete content
most other applications should use the -ms-user-select property instead.
-ms-wrap-margin - Archive of obsolete content
the -ms-wrap-margin css property is a microsoft extension that specifies a margin that offsets the inner wrap shape from other shapes.
-ms-wrap-through - Archive of obsolete content
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.
-moz-windows-compositor - Archive of obsolete content
otherwise it's 0.
::-ms-browse - Archive of obsolete content
other properties are ignored.
::-ms-check - Archive of obsolete content
other properties are ignored.
::-ms-clear - Archive of obsolete content
other properties are ignored.
::-ms-expand - Archive of obsolete content
other properties are ignored.
::-ms-fill-lower - Archive of obsolete content
other properties are ignored.
::-ms-fill-upper - Archive of obsolete content
other properties are ignored.
::-ms-reveal - Archive of obsolete content
other properties are ignored.
::-ms-thumb - Archive of obsolete content
other properties are ignored.
::-ms-ticks-after - Archive of obsolete content
other properties are ignored.
::-ms-ticks-before - Archive of obsolete content
other properties are ignored.
::-ms-tooltip - Archive of obsolete content
other properties are ignored.
::-ms-track - Archive of obsolete content
other properties are ignored.
::-ms-value - Archive of obsolete content
other properties are ignored.
-moz-os-version - Archive of obsolete content
this can be useful for adapting application skins and other chrome code depending on the user's operating system version.
-moz-scrollbar-end-backward - Archive of obsolete content
otherwise it's 0.
-moz-scrollbar-end-forward - Archive of obsolete content
otherwise it's 0.
-moz-scrollbar-start-backward - Archive of obsolete content
otherwise it's 0.
-moz-scrollbar-start-forward - Archive of obsolete content
otherwise it's 0.
-moz-scrollbar-thumb-proportional - Archive of obsolete content
otherwise it's 0.
-moz-touch-enabled - Archive of obsolete content
otherwise it's 0.
-moz-windows-accent-color-in-titlebar - Archive of obsolete content
otherwise it's 0.
-moz-windows-classic - Archive of obsolete content
otherwise it's 0.
-moz-windows-default-theme - Archive of obsolete content
otherwise it's 0.
-moz-windows-glass - Archive of obsolete content
syntax <integer> if the user is using windows glass theme, this is 1; otherwise it's 0.
-moz-windows-theme - Archive of obsolete content
the -moz-windows-theme gecko-only css media feature is useful for customizing application skins and other chrome code to work well with the user's windows theme.
azimuth - Archive of obsolete content
ArchiveWebCSSazimuth
also used as a modifier for other positional keyword values, as above.
display-inside - Archive of obsolete content
otherwise, this value computes to block.
display-outside - Archive of obsolete content
other formatting contexts, such as flex formatting contexts, may also work with block-level elements.
CSS - Archive of obsolete content
ArchiveWebCSS
ct css property is a microsoft extension that toggles the gripper visual elements that enable touch text selection.-ms-wrap-flowthe -ms-wrap-flow css property is a microsoft extension that specifies how exclusions impact inline content within block-level elements.-ms-wrap-marginthe -ms-wrap-margin css property is a microsoft extension that specifies a margin that offsets the inner wrap shape from other shapes.-ms-wrap-throughthe -ms-wrap-through css property is a microsoft extension that specifies how content should wrap around an exclusion element.:-moz-full-screen-ancestorthe :-moz-full-screen-ancestor css pseudo-class is a mozilla extension that represents all ancestors of the full-screen element, except containing frames in parent documents, which are the full-screen element in their own do...
Displaying notifications (deprecated) - Archive of obsolete content
onclose this event is fired when the notification is closed (whether by being clicked or by some other means).
E4X for templating - Archive of obsolete content
number.positive_infinity; min = 1; } if (h.length === 1) { for (k in arr) { if (it < min) { ++it; continue; } if (it > max) { break; } ret+=h(arr[k], it, lev); // need to get it or lev via arguments[] since our length detection implies no explicit additional params; otherwise define with more than one param (see below) ++it; } } else { for (k in arr) { if (it < min) { ++it; continue; } if (it > max) { break; } ret+=h(k, arr[k], it, lev); ++it; } } return ret; } the following real case example it...
Introduction - Archive of obsolete content
the most basic is appendchild var element1 = <foo/>; var element2 = <bar/>; element1.appendchild(element2); which produces exactly the xml document you'd expect <foo> <bar/> </foo> javascript variables the true power of e4x only begins to come to light, however, when the xml document can interact closely with other javascript.
Iterator - Archive of obsolete content
iterator instance returns [property_name, property_value] array for each iteration if keyonly is falsy, otherwise, if keyonly is truthy, it returns property_name for each iteration.
ArrayBuffer.transfer() - Archive of obsolete content
this is not the exact equivalent of this api because browsers that natively support it are be able to internally use the c++ function realloc() which extends the length of the memory and only copies it to a new location as-needed as opposed to the following pollyfill which always copies the whole thing to a new space of memory, but this function transfers data from one arraybuffer to another arraybuffer.
Array comprehensions - Archive of obsolete content
array comprehension was previously proposed to be standardized in ecmascript 2016, it provide a useful shortcut for constructing a new array based on the contents of another.
Date.prototype.toLocaleFormat() - Archive of obsolete content
however, ordering of the day and month and other localization tasks are not handled automatically since you have control over the order in which they occur.
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
ion (firefox 52) asyncfunction (firefox 52) await (firefox 52) trailing commas in function parameter lists (firefox 52) ecmascript 2018 spread in object literals and rest parameters (firefox 55) for await...of (firefox 57) global_objects/sharedarraybuffer (firefox 57, with flags) global_objects/promise/finally (firefox 58) global_objects/regexp/dotall (not yet implemented; in other browsers) regexp lookbehind assertions (not yet implemented; in other browsers) regexp unicode property escapes (not yet implemented; in other browsers) regexp named capture groups (not yet implemented; in other browsers) ecmascript 2019 array.flat() (firefox 62) array.flatmap() (firefox 62) object.fromentries() (firefox 63) string.trimstart() and string.trimend() (firefox 61) optiona...
Expression closures - Archive of obsolete content
there is no added benefit to writing code in this manner, other than having it be syntactically shorter.
Generator comprehensions - Archive of obsolete content
an array comprehension would create a full array in memory containing the doubled values: var doubles = [for (i in it) i * 2]; a generator comprehension on the other hand would create a new iterator which would create doubled values on demand as they were needed: var it2 = (for (i in it) i * 2); console.log(it2.next()); // the first value from it, doubled console.log(it2.next()); // the second value from it, doubled when a generator comprehension is used as the argument to a function, the parentheses used for the function call means that the outer parenthe...
ActiveXObject - Archive of obsolete content
in the following example, you access properties and methods of the new object using the object variable excelsheet and other excel objects, including the application object and the activesheet.cells collection.
Date.getVarDate() - Archive of obsolete content
remarks the getvardate() method is used when javascript code interacts with com objects, activex objects, or other objects that accept and return date values in vt_date format.
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
this function may be called when an asynchronous operation is aborted, when a join operation is used, or in other scenarios.
Enumerator.atEnd - Archive of obsolete content
otherwise, it returns false.
Error.stackTraceLimit - Archive of obsolete content
otherwise, touint32 is used to convert the value.
VBArray.dimensions - Archive of obsolete content
the third part is the javascript code that goes in the <body> section to run the other two parts.
VBArray.getItem - Archive of obsolete content
the third part is the javascript code that goes in the <body> section to run the other two parts.
VBArray.lbound - Archive of obsolete content
the third part is the javascript code that goes in the <body> section to run the other two parts.
VBArray.toArray - Archive of obsolete content
the third part is the javascript code that goes in the <body> section to run the other two parts.
VBArray.ubound - Archive of obsolete content
the third part is the javascript code that goes in the <body> section to run the other two parts.
@cc_on - Archive of obsolete content
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.
@if - Archive of obsolete content
this is because the capabilities of the compilers can be determined by using other methods.
New in JavaScript 1.2 - Archive of obsolete content
array.prototype.concat() array.prototype.slice() string.prototype.charcodeat() string.prototype.concat() string.fromcharcode() string.prototype.match() string.prototype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new statements labeled statements switch do...while import export other new features regular expressions signed scripts changed functionality in javascript 1.2 you can now nest functions within functions.
New in JavaScript 1.3 - Archive of obsolete content
.getutcdate() date.prototype.getutchours() date.prototype.getutcminutes() date.prototype.getutcseconds() date.prototype.getutcmilliseconds() date.prototype.toutcstring() date.prototype.setutcfullyear() date.prototype.setutcmonth() date.prototype.setutcdate() date.prototype.setutchours() date.prototype.setutcminutes() date.prototype.setutcseconds() date.prototype.setutcmilliseconds() other new features strict equality operators unicode support a javascript console was introduced.
New in JavaScript 1.8 - Archive of obsolete content
</script> another way (not recommended) to do this is to use the deprecated <script> language attribute and define it as "javascript1.8".
Object.prototype.unwatch() - Archive of obsolete content
description the javascript debugger has functionality similar to that provided by this method, as well as other debugging options.
Object.prototype.watch() - Archive of obsolete content
the javascript debugger has functionality similar to that provided by this method, as well as other debugging options.
Archived JavaScript Reference - Archive of obsolete content
to make the function a legacy generator, the function body should contain at least one yield expression.microsoft javascript extensionsmicrosoft browsers (internet explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions to the otherwise standard javascript apis.new in javascriptthis chapter contains information about javascript's version history and implementation status for mozilla/spidermonkey-based javascript applications, such as firefox.number.tointeger()the number.tointeger() method used to evaluate the passed value and convert it to an integer, but its implementation has been removed.object.getnotifier()the object.get...
JavaObject - Archive of obsolete content
the javaobject also inherits methods from java.lang.object and any other superclass.
MSX Emulator (jsMSX) - Archive of obsolete content
since javascript currently is mostly an interpreted language in web browsers, it is at least an order of magnitude slower than other languages such as c and java.
Old Proxy API - Archive of obsolete content
in other words: fundamental traps are required, derived traps are optional.
Server-Side JavaScript - Archive of obsolete content
server-side javascript is another way in which, as this article quotes eich, "mozilla wants to 'get people thinking about javascript as a more general-purpose language' and show them that 'it really is a platform for writing full applications.'" many vendors today are embedding mozilla rhino or mozilla spidermonkey into web server environments.
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.
Implementation Status - Archive of obsolete content
7.4 expression categories supported 7.4.2 model binding expressions and computed expressions supported 7.4.3 expressions in actions and submissions partial 7.4.4 ui expressions partial scenarios exist where controls contained inside other controls inside a repeat won't be bound correctly 333638; 7.4.5 ui binding in other xml vocabularies unsupported not a compliance requirement for an xforms processor 7.4.6 binding examples supported 7.5 xforms core function library supported 7.6.1...
Mozilla XForms Specials - Archive of obsolete content
for security reasons, it is not per default possible for an xforms to submit data to another domain.
XForms Label Element - Archive of obsolete content
every form control other than the output and choices elements must contain a label element.
XForms Output Element - Archive of obsolete content
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).
XForms Repeat Element - Archive of obsolete content
since html:table doesn't (and probably never will) allow xforms:repeat elements as children, another syntax is needed.
XForms Select Element - Archive of obsolete content
loses focus), otherwise it is updated upon item selection check group the select is represented as group of checkboxes (xhtml/xul).
Using XForms and PHP - Archive of obsolete content
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.
Archived open Web documentation - Archive of obsolete content
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.
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.
Correctly Using Titles With External Stylesheets - Archive of obsolete content
a preferred stylesheet, on the other hand, is one that has a value of stylesheet supplied for the rel attribute, and any value at all for the title attribute.
Web Standards - Archive of obsolete content
mailing list newsgroup rss feed the web standards project webdev feedhouse other community links...
XQuery - Archive of obsolete content
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.
Community - Extensions
if you know of useful mailing lists, newsgroups, forums, or other communities related to extension development, please link to them here.
Using the DOM File API in chrome code - Extensions
other such keys as the "profd" key are available, check the known locations.
Explaining basic 3D theory - Game development
during output merging some processing is also applied to ignore information that is not needed — for example the parameters of objects that are outside of the screen or behind other objects, and thus not visible, are not calculated.
Building up a basic demo with A-Frame - Game development
add the <a-animation> element seen below to the <a-box> element as a child, as shown: <a-box color="#0095dd" rotation="20 40 0" position="0 1 0"> <a-animation attribute="rotation" from="20 0 0" to="20 360 0" direction="alternate" dur="4000" repeat="indefinite" easing="ease"> </a-animation> </a-box> as with any other entities, you can define key properties for the animation.
Building up a basic demo with PlayCanvas editor - Game development
adding other shapes involves a very similar process to adding the box.
Building up a basic demo with the PlayCanvas engine - Game development
if you have already worked through our building up a basic demo with three.js article (or you are familiar with other 3d libraries) you'll notice that playcanvas works on similar concepts: camera, light and objects.
Mobile touch controls - Game development
removing the second finger, for example, won't affect the other two, and setting it back again will use the first available property, so pointer2 will be used again.
Implementing game control mechanisms - Game development
captain rogers was created using the phaser framework, the most popular tool for 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.
asm.js - Game development
it is a very small, strict subset of javascript that only allows things like `while`, `if`, numbers, top-level named functions, and other simple constructs.
Tools for game development - Game development
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.
Build the brick field - Game development
var brickrowcount = 3; var brickcolumncount = 5; var brickwidth = 75; var brickheight = 20; var brickpadding = 10; var brickoffsettop = 30; var brickoffsetleft = 30; here we've defined the number of rows and columns of bricks , their width and height, the padding between the bricks so they won't touch each other and a top and left offset so they won't start being drawn right from the edge of the canvas.
Create the Canvas and draw on it - Game development
this is because, just as with css, color can be specified as a hexadecimal value, a color keyword, the rgba() function, or any of the other available color methods.
Game over - Game development
it's fun to watch the ball bouncing off the walls and be able to move the paddle around, but other than that the game does nothing and doesn't have any progression or end goal.
Mouse controls - Game development
add the following line in the same place as the other event listeners, just below the keyup event: document.addeventlistener("mousemove", mousemovehandler, false); anchoring the paddle movement to the mouse movement we can update the paddle position based on the pointer coordinates — the following handler function will do exactly that.
Paddle and keyboard controls - Game development
add the following variables near the top of your code, beside your other variables: var paddleheight = 10; var paddlewidth = 75; var paddlex = (canvas.width-paddlewidth) / 2; here we're defining the height and width of the paddle and its starting point on the x axis for use in calculations further on down the code.
Load the assets and print them on screen - Game development
now, to show it on the screen we will use another phaser method called add.sprite(); add the following new code line inside the create() function as shown: function create() { ball = game.add.sprite(50, 50, 'ball'); } this will add the ball to the game and render it on the screen.
Randomizing gameplay - Game development
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.
Game development
generated from c/c++ using clang, or from another language) and compiles that into asm.js, which can be run on the web.
Character sets supported by Gecko - Gecko Redirect 1
for other encodings, including gbk, this is the lower-case name from the encoding standard.
502 - MDN Web Docs Glossary: Definitions of Web-related terms
a server can act as a gateway or proxy (go-between) between a client (like your web browser) and another, upstream server.
Algorithm - MDN Web Docs Glossary: Definitions of Web-related terms
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.
BigInt - MDN Web Docs Glossary: Definitions of Web-related terms
in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums.
Block - MDN Web Docs Glossary: Definitions of Web-related terms
for example, <p> is by default a block-level element, whereas <a> is an inline element — you can put several links next to one another in your html source and they will sit on the same line as one another in the rendered output.
Bootstrap - MDN Web Docs Glossary: Definitions of Web-related terms
you don't need to worry about compatibility with other browsers either, as bootstrap is compatible with all modern browsers and newer versions of internet explorer.
Bézier curve - MDN Web Docs Glossary: Definitions of Web-related terms
to draw the curve, two imaginary lines are drawn, one from p0 to p1 and the other from p1 to p2.
CSS - MDN Web Docs Glossary: Definitions of Web-related terms
css usually styles html elements, but can be also used with other markup languages like svg or xml.
CSS Object Model (CSSOM) - MDN Web Docs Glossary: Definitions of Web-related terms
the css object model (cssom) is a map of all css selectors and relevant properties for each selector in the form of a tree, with a root node, sibling, descendant, child, and other relationship.
Callback function - MDN Web Docs Glossary: Definitions of Web-related terms
a callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.
Canonical order - MDN Web Docs Glossary: Definitions of Web-related terms
other values may appear in any order.
Card sorting - MDN Web Docs Glossary: Definitions of Web-related terms
card sorting is a simple technique used in information architecture whereby people involved in the design of a website (or other type of product) are invited to write down the content / services / features they feel the product should contain, and then organize those features into categories or groupings.
Class - MDN Web Docs Glossary: Definitions of Web-related terms
class is a template definition of an object's properties and methods, the "blueprint" from which other more specific instances of the object are drawn.
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.
Conditional - MDN Web Docs Glossary: Definitions of Web-related terms
otherwise, another instruction is executed.
Constant - MDN Web Docs Glossary: Definitions of Web-related terms
with variables, on the other hand, the programmer can assign a new value to a variable name already in use.
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
looking back at the code in the if and else sections, the lines promptuser and submitform could also be calls to other functions in the script.
DTMF (Dual-Tone Multi-Frequency signaling) - MDN Web Docs Glossary: Definitions of Web-related terms
computers may make use of dtmf when dialing a modem, or when sending commands to a menu system for teleconferencing or other purposes.
Deserialization - MDN Web Docs Glossary: Definitions of Web-related terms
that has been transferred over a network, or stored in a data store) is translated into a readable object or other data structure.
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
the attack master, also known as the botmaster, identifies and infects other vulnerable systems with malware.
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
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.
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
a dynamic programming language is a programming language in which operations otherwise done at compile-time can be done at run-time.
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.
Flex - MDN Web Docs Glossary: Definitions of Web-related terms
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 ...
Flexbox - MDN Web Docs Glossary: Definitions of Web-related terms
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 ...
Fuzz testing - MDN Web Docs Glossary: Definitions of Web-related terms
fuzzing is a technique for testing software using automated tools to provide invalid or unexpected input to a program or function in a program, then checking the results to see if the program crashes or otherwise acts inappropriately.
Gecko - MDN Web Docs Glossary: Definitions of Web-related terms
this means that gecko includes, among other things, a networking stack, graphics stack, layout engine, a javascript virtual machine, and porting layers.
Global scope - MDN Web Docs Glossary: Definitions of Web-related terms
in a programming environment, the global scope is the scope that contains, and is visible in, all other scopes.
Global variable - MDN Web Docs Glossary: Definitions of Web-related terms
a global variable is a variable that is declared in the global scope in other words, a variable that is visible from all other scopes.
Graceful degradation - MDN Web Docs Glossary: Definitions of Web-related terms
in reality both approaches are valid and can often complement one another.
Grid Areas - MDN Web Docs Glossary: Definitions of Web-related terms
this creates two grid areas, one covering four grid cells, the other two.
Grid Axis - MDN Web Docs Glossary: Definitions of Web-related terms
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.
HSTS - MDN Web Docs Glossary: Definitions of Web-related terms
in other words, it tells the browser that changing the protocol from http to https in a url works (and is more secure) and asks the browser to do it for every request.
HTML5 - MDN Web Docs Glossary: Definitions of Web-related terms
among other features, html5 includes new elements and javascript apis to enhance storage, multimedia, and hardware access.
High-level programming language - MDN Web Docs Glossary: Definitions of Web-related terms
it is designed to be easily understood by humans and for this reason they must be translated by another software.
Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms
hoisting works well with other data types and variables.
Hotlink - MDN Web Docs Glossary: Definitions of Web-related terms
a hotlink (also known as an inline link) is an object (typically an image) directly linked to from another site.
Hypertext - MDN Web Docs Glossary: Definitions of Web-related terms
hypertext is text that contains links to other texts, as opposed to a single linear flow like in a novel.
I18N - MDN Web Docs Glossary: Definitions of Web-related terms
(the w3c definition) among other things, i18n requires support for multiple character sets (usually via unicode) units of measure (currency, °c/°f, km/miles, etc.) time and date formats keyboard layouts text directions learn more general knowledge i18n on wikipedia technical reference i18n on w3c i18n on gala-global.org learn about it i18n material on i18nguy.com ...
IANA - MDN Web Docs Glossary: Definitions of Web-related terms
iana (internet assigned numbers authority) is a subsidiary of icann charged with recording and/or assigning domain names, ip addresses, and other names and numbers used by internet protocols.
IMAP - MDN Web Docs Glossary: Definitions of Web-related terms
clients accessing a mailbox can receive information about state changes made from other clients.
IPv6 - MDN Web Docs Glossary: Definitions of Web-related terms
slowly ipv6 is replacing ipv4, among other reasons because ipv6 allows for many different ip addresses.
ITU - MDN Web Docs Glossary: Definitions of Web-related terms
in the internet age, the itu's role of establishing standards for video and audio data formats used for streaming, teleconferencing, and other purposes.
Immutable - MDN Web Docs Glossary: Definitions of Web-related terms
an object can be immutable for various reasons, for example: to improve performance (no planning for the object's future changes) to reduce memory use (make object references instead of cloning the whole object) thread-safety (multiple threads can reference the same object without interfering with one other) learn more general knowledge immutable on wikipedia ...
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
json can represent numbers, booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects).
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
and other countries, the two programming languages are significantly different in their syntax, semantics, and use cases.
Locale - MDN Web Docs Glossary: Definitions of Web-related terms
among other things, locales represent paper format, currency, date format, and numbers according to the protocols in the given region.
Long task - MDN Web Docs Glossary: Definitions of Web-related terms
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.
Lossless compression - MDN Web Docs Glossary: Definitions of Web-related terms
examples of lossless compression include gzip, brotli, webp, and png, lossy compression, on the other hand, uses inexact approximations by discarding some data from the original file, making it an irreversible compression method.
mime - MDN Web Docs Glossary: Definitions of Web-related terms
mime "multipurpose internet mail extensions" is a standard to describe documents in other forms beside ascii text, e.g.
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
some other design patterns are based on mvc, such as mvvm (model-view-viewmodel), mvp (model-view-presenter), and mvw (model-view-whatever).
MathML - MDN Web Docs Glossary: Definitions of Web-related terms
mathml has other applications also including scientific content and voice synthesis.
Media - MDN Web Docs Glossary: Definitions of Web-related terms
media (audio-visual presentation) the term media (more accurately, multimedia) refers to audio, video, or combined audio-visual material such as music, recorded speech, movies, tv shows, or any other form of content that is presented over a period of time.
MitM - MDN Web Docs Glossary: Definitions of Web-related terms
comparing this to physical mail: if you're writing letters to each other, the mailman can intercept each letter you mail.
Mixin - MDN Web Docs Glossary: Definitions of Web-related terms
a mixin is a class or interface in which some or all of its methods and/or properties are unimplemented, requiring that another class or interface provide the missing implementations.
Native - MDN Web Docs Glossary: Definitions of Web-related terms
on the other hand, a web app that runs inside a browser is not native — it is run in the web browser, which sits on top of the native environment, not the native environment itself.
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
learn more https://www.w3.org/tr/csp/#directives-navigation other kinds of directives: fetch directive document directive reporting directive block-all-mixed-content upgrade-insecure-requests require-sri-for trusted-types content-security-policy ...
Node - MDN Web Docs Glossary: Definitions of Web-related terms
another use of the word is when talking about node.js ...
Number - MDN Web Docs Glossary: Definitions of Web-related terms
in other programming languages different numeric types exist; for example, integers, floats, doubles, or bignums.
Packet - MDN Web Docs Glossary: Definitions of Web-related terms
priority this field indicates which packet should have higher priority over the others.
Parser - MDN Web Docs Glossary: Definitions of Web-related terms
more generally, it's a piece of software that parses text and transforms its content to another representation.
Perceived performance - MDN Web Docs Glossary: Definitions of Web-related terms
other features, such as good ux design, including animations, and lazy loading, can make your site appear more responsive, even if the download and response times remain the same.
Placeholder names - MDN Web Docs Glossary: Definitions of Web-related terms
placeholder names are commonly used in cryptography to indicate the participants in a conversation, without resorting to terminology such as "party a," "eavesdropper," and "malicious attacker." the most commonly used names are: alice and bob, two parties who want to send messages to each other, occasionally joined by carol, a third participant eve, a passive attacker who is eavesdropping on alice and bob's conversation mallory, an active attacker ("man-in-the-middle") who is able to modify their conversation and replay old messages ...
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
other times, polyfills are used to address issues where browsers implement the same features in different ways.
Progressive Enhancement - MDN Web Docs Glossary: Definitions of Web-related terms
in reality both approaches are valid and can often complement one another.
Progressive web apps - MDN Web Docs Glossary: Definitions of Web-related terms
this involves taking standard web sites/apps that enjoy all the best parts of the web — such as discoverability via search engines, being linkable via urls, and working across multiple form factors — and supercharging them with modern apis (such as service workers and push) and features that confer other benefits more commonly attributed to native apps.
Prototype-based programming - MDN Web Docs Glossary: Definitions of Web-related terms
prototype-based programming is a style of object-oriented programming in which classes are not explicitly defined, but rather derived by adding properties and methods to an instance of another class or, less frequently, adding them to an empty object.
Python - MDN Web Docs Glossary: Definitions of Web-related terms
it was created by guido van rossum as a successor to another language (called abc) between 1985 and 1990, and is currently used on a large array of domains like web development, desktop applications, data science, devops, and automation/productivity.
Reference - MDN Web Docs Glossary: Definitions of Web-related terms
in computing, a reference is a value that indirectly accesses data to retrieve a variable or a record in a computer's memory or other storage device.
Regular expression - MDN Web Docs Glossary: Definitions of Web-related terms
on the web, javascript provides another regex implementation through the regexp object.
Robots.txt - MDN Web Docs Glossary: Definitions of Web-related terms
for example, the site admin can forbid crawlers to visit a certain folder (and all the files therein contained) or to crawl a specific file, usually to prevent those files being indexed by other search engines.
SCTP - MDN Web Docs Glossary: Definitions of Web-related terms
sctp (stream control transmission protocol) is an ietf standard for a transport protocol which enables the reliable, in-order transmission of messages while offering congestion control, multi-homing, and other features to improve reliability and stability of the connection.
SEO - MDN Web Docs Glossary: Definitions of Web-related terms
popularity you get most traffic when other established sites link to your site.
SIMD - MDN Web Docs Glossary: Definitions of Web-related terms
simd allows one same operation to be performed on multiple data points resulting in data level parallelism and thus performance gains — for example, for 3d graphics and video processing, physics simulations or cryptography, and other domains.
SLD - MDN Web Docs Glossary: Definitions of Web-related terms
as another example, in developer.mozilla.org, the developer subdomain is used to specify that the subdomain contains the developer section of the mozilla website.
Same-origin policy - MDN Web Docs Glossary: Definitions of Web-related terms
the same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin.
Scroll container - MDN Web Docs Glossary: Definitions of Web-related terms
the scroll container allows the user to scroll through parts of the overflow region that would otherwise be clipped and hidden from view.
Second-level Domain - MDN Web Docs Glossary: Definitions of Web-related terms
as another example, in developer.mozilla.org, the developer subdomain is used to specify that the subdomain contains the developer section of the mozilla website.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
on the other hand, you could make any element look like a top level heading.
Shadow tree - MDN Web Docs Glossary: Definitions of Web-related terms
this provides a way to encapsulate implementation details, which is especially useful for custom elements and other advanced design paradigms.
Stacking context - MDN Web Docs Glossary: Definitions of Web-related terms
stacking context refers to how elements on a webpage appear to sit on top of other elements, just as you can arrange index cards on your desk to lie side-by-side or overlap each other.
Static method - MDN Web Docs Glossary: Definitions of Web-related terms
examples in the notifications api, the notification.requestpermission() method is called on the actual notification constructor itself — it is a static method: let promise = notification.requestpermission(); the notification.close() method on the other hand, is an instance method — it is called on an specific notification object instance to close the system notification it represents: let mynotification = new notification('this is my notification'); mynotification.close(); ...
Static typing - MDN Web Docs Glossary: Definitions of Web-related terms
in most of these languages, types must be expressly indicated by the programmer; in other cases (such as ocaml), type inference allows the programmer to not indicate their variable types.
Style origin - MDN Web Docs Glossary: Definitions of Web-related terms
if no other styles are applied to content, the user agent origin's styles are used while rendering elements.
Symmetric-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
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.
Synchronous - MDN Web Docs Glossary: Definitions of Web-related terms
a human example is the telephone — during a telephone call you tend to respond to another person immediately.
Syntax - MDN Web Docs Glossary: Definitions of Web-related terms
code must have correct syntax in order to compile correctly, otherwise a syntax error occurs.
Synthetic monitoring - MDN Web Docs Glossary: Definitions of Web-related terms
combined with other tools, such as network throttling, can provide excellent insight into potential problem areas.
TCP handshake - MDN Web Docs Glossary: Definitions of Web-related terms
the three message mechanism is designed so that two computers that want to pass information back and forth to each other can negotiate the parameters of the connection before transmitting data such as http browser requests.
Thread - MDN Web Docs Glossary: Definitions of Web-related terms
however, modern javascript offers ways to create additional threads, each executing independently while possibly communicating between one another.
Three js - MDN Web Docs Glossary: Definitions of Web-related terms
three.js is a javascript-based webgl engine that can run gpu-powered games and other graphics-powered apps straight from the browser.
Type - MDN Web Docs Glossary: Definitions of Web-related terms
for example, a value of type number can be multiplied by another number, but not by a string - even if that string contains only a number, such as the string "2".
Type conversion - MDN Web Docs Glossary: Definitions of Web-related terms
type conversion (or typecasting) means transfer of data from one data type to another.
URL - MDN Web Docs Glossary: Definitions of Web-related terms
urls can also be used for file transfer (ftp) , emails (smtp), and other applications.
UTF-8 - MDN Web Docs Glossary: Definitions of Web-related terms
all other characters use two to four bytes.
Vendor Prefix - MDN Web Docs Glossary: Definitions of Web-related terms
this has made it more difficult for browser vendors to ensure compatibility and to work on new features; it's also been harmful to smaller browsers who wind up forced to add other browsers' prefixes in order to load popular web sites.
Visual Viewport - MDN Web Docs Glossary: Definitions of Web-related terms
the visual viewport is the visual portion of a screen excluding on-screen keyboards, areas outside of a pinch-zoom area, or any other on-screen artifact that doesn't scale with the dimensions of a page.
Web server - MDN Web Docs Glossary: Definitions of Web-related terms
a server, on the other hand, is a piece of hardware that lives in a room full of computers, commonly known as a data center.
Web standards - MDN Web Docs Glossary: Definitions of Web-related terms
this non-exhaustive list gives you an idea of which standards websites and network systems must conform to: ietf (internet engineering task force): internet standards (std), which among other things govern set-up and use of uris, http, and mime w3c: specifications for markup language (e.g., html), style definitions (i.e., css), dom, accessibility iana (internet assigned numbers authority): name and number registries ecma intl.: scripting standards, most prominently for javascript iso (international organization for standardization): standards governing a diverse array of aspects, ...
Wrapper - MDN Web Docs Glossary: Definitions of Web-related terms
in programming languages such as javascript, a wrapper is a function that is intended to call one or more other functions, sometimes purely for convenience, and sometimes adapting them to do a slightly different task in the process.
XML - MDN Web Docs Glossary: Definitions of Web-related terms
in this way xml acts like a meta-language—that is, it can be used to define other languages, such as rss.
XSLT - MDN Web Docs Glossary: Definitions of Web-related terms
extensible stylesheet language transformations (xslt) is a declarative language used to convert xml documents into other xml documents, html, pdf, plain text, and so on.
buffer - MDN Web Docs Glossary: Definitions of Web-related terms
a buffer is a storage in physical memory used to temporarily store data while it is being transferred from one place to another.
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
(for example, firefox does not support it per https://bugzilla.mozilla.org/show_bug.cgi?id=109553.) other methods, like put or delete are not cacheable and their result cannot be cached.
Percent-encoding - MDN Web Docs Glossary: Definitions of Web-related terms
other characters don't need to be encoded, though they could.
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
in other words, a method is safe if it leads to a read-only operation.
Speculative parsing - MDN Web Docs Glossary: Definitions of Web-related terms
note that writing balanced tags may cause other tags to be inferred in a way that makes the write unbalanced.
Strict mode - MDN Web Docs Glossary: Definitions of Web-related terms
strict mode for an entire script is invoked by including the statement "use strict"; before any other statements.
User agent - MDN Web Docs Glossary: Definitions of Web-related terms
besides a browser, a user agent could be a bot scraping webpages, a download manager, or another app accessing the web.
MDN Web Docs Glossary: Definitions of Web-related terms
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-direction glsl interface library memory management routers self-executing anonymous function ...
About Scriptable Interfaces - Interfaces
no other scripts languages are supported by xpconnect.
Assessment: Accessibility troubleshooting - Learn web development
other considerations?
Pseudo-classes and pseudo-elements - Learn web development
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.
Test your skills: Selectors - Learn web development
stripe every other row in the table by selecting these rows and giving them a background color of #333 and foreground of white.
Sizing items in CSS - Learn web development
in the case of a box inside another container, if you give the child box a percentage width it will be a percentage of the width of the parent container.
Test your skills: backgrounds and borders - Learn web development
backgrounds and borders 2 in this task we want you to add background images, a border, and some other styling to a decorative box: give the box a 5px lightblue border, and round the top left corner 20px and the bottom right corner 40px the heading uses the star.png image as a background image, with a single centered star on the left and a repeating pattern of stars on the right.
Test your skills: Media Queries and Responsive Design - Learn web development
everything you need to know to complete this task was covered in the guide to media queries, and the other layout lessons in this section.
Using CSS generated content - Learn web development
html a text where i need to <span class="ref">something</span> css .ref::before { font-weight: bold; color: navy; content: "reference "; } output the character set of a stylesheet is utf-8 by default, but it can also be specified in the link, in the stylesheet itself, or in other ways.
Web fonts - Learn web development
you have to pay for them, and/or follow other license conditions such as crediting the font creator in the code (or on your site).
How do you make sure your website works properly? - Learn web development
open the console (tools ➤ web developer ➤ web console) and reload the page: in this example, we learn (quite clearly) what the error is, and we can go fix it (we will cover javascript in another series of articles).
What do common web layouts contain? - Learn web development
in other articles we'll discuss how to design responsive sites (sites that change depending on the screen size) and sites whose layouts vary between pages.
What are browser developer tools? - Learn web development
on other browser, open the developer tools and then click the console tab.
What is accessibility? - Learn web development
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.
Example 3 - Learn web development
tlist) { if (select.classlist.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.query...
Example 4 - Learn web development
tlist) { if (select.classlist.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, op...
Example 5 - Learn web development
tlist) { if (select.classlist.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[index...
Sending forms through JavaScript - Learn web development
avoiding a full page load can provide a smoother experience by avoiding network lag, and possible visual issues like flickering.
Test your skills: Advanced styling - Learn web development
another thing that commonly denotes a search box is a magnifying glass icon.
Installing basic software - Learn web development
windows: firefox, chrome, opera, internet explorer, microsoft edge, brave (windows 10 comes with edge by default; if you have windows 7 or above, you can install internet explorer 11; otherwise, you should install an alternative browser).
Use JavaScript within a webpage - Learn web development
if you already know something about javascript or if you have a background with other programming languages, we suggest you jump directly into our javascript guide.
Using data attributes - Learn web development
data-* attributes allow us to store extra information on standard, semantic html elements without other hacks such as non-standard attributes, extra properties on dom, or node.setuserdata().
Use HTML to solve common problems - Learn web development
LearnHTMLHowto
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.
Assessment: Structuring planet data - Learn web development
one way of associating headers with their rows/columns is a lot easier than the other way.
HTML Tables - Learn web development
LearnHTMLTables
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Image gallery - Learn web development
it sets the width of any images inside the thumb-bar <div> (so-called "thumbnail" images) to 20%, and floats them to the left so they sit next to one another on a line.
Test your skills: Conditionals - Learn web development
to finish off, you should then add another test that checks whether season contains the string "winter", and again assigns an appropriate string to response.
Test your skills: Functions - Learn web development
you'll want to clear the canvas before drawing, so that when the code is updated in the case of the live version, you don't get lots of rectangles drawn on top of one another.
Test your skills: Arrays - Learn web development
arrays 2 now let's move on to another task.
Measuring performance - Learn web development
webpagetest.org is another example of a tool that automatically tests your site and returns useful metrics.
JavaScript performance - Learn web development
requiring a library for other features may improve developer experience, but is all that javascript required?
The "why" of web performance - Learn web development
conclusion web performance is important for accessibility and also for other website metrics that serve the goals of an organization or business.
Learning area release notes - Learn web development
you can see these on: html text fundamentals creating hyperlinks advanced text formatting images in html video and audio content from object to iframe — other embedding technologies ...
Server-side website programming first steps - Learn web development
prerequisites before starting this module, you don't need to have any knowledge of server-side website programming, or indeed any other type of programming.
Server-side website programming - Learn web development
ting started with server-side programming is usually easier than client-side development, because dynamic websites tend to perform a lot of very similar operations (retrieving data from a database and displaying it in a page, validating user-entered data and saving it in a database, checking user permissions and logging users in, etc.), and are constructed using web frameworks that make these and other common web server operations easy.
React interactivity: Editing, filtering, conditional rendering - Learn web development
add the edittask() function inside your app component, in the same place as the other functions: function edittask(id, newname) { const editedtasklist = tasks.map(task => { // if this task has the same id as the edited task if (id === task.id) { // return {...task, name: newname} } return task; }); settasks(editedtasklist); } pass edittask into our <todo /> components as a prop in the same way we did with deletetask: const tasklist = tasks.map(ta...
React resources - Learn web development
they're still the only way to handle certain other, more edge-case features, and they’re very common in legacy react projects.
Adding a new todo form: Vue events, methods, and models - Learn web development
this is done by including the data you want to pass as another parameter in the $emit() method: this.$emit("todo-added", this.label).
Styling Vue components with CSS - Learn web development
there are a few other global css styles which we can add as well.
Cross browser testing - Learn web development
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.
Web APIs: Mozilla-specific documents
this includes notes about any firefox-only features, or about any experiments or other deviations from the specification that may exist in mozilla code.
omni.ja (formerly omni.jar)
omni.ja is also incompatible with zip files in the other direction; editing extracted files won't affect firefox, and repacking edited files may break firefox if you do not use the right options when packing the extracted files.
CSUN Firefox Materials
here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this information): adblock plus removes ads (and other objects, like banners) from web pages greasemonkey lets you add bits of javascript ("user scripts") to any web page to change its behavior.
Information for External Developers Dealing with Accessibility
other useful resources links for those who wish to learn more about web accessibility or open source accessibility.
Information for users
features include assistive technology support on windows (like window-eyes, jaws, etc.), firefox keyboard support, available accessibility extensions like fire vox and other extensions.
Mozilla Plugin Accessibility
in other cases, vendors need to find or be convinced of the business justification so that resources are applied to the problem.
ZoomText
our main focus is on the browser itself, so you you only need to install mailnews or address book if curious about the other apps.
Index
other add-ons must specify the location of their update manifests.
Lightweight themes
firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window.
Obsolete
creating a skin for firefox uuid contents.rdf install.rdf theme changes in firefox 2 theme changes in firefox 3 theme changes in firefox 3.5 theme changes in firefox 4 building a theme common theme issues and their solutions making sure your theme works with rtl locales creating a skin for seamonkey 2 dom inspector inspectorwidget force rtl yet another theme tutorial ...
Adding a new word to the en-US dictionary
the script only works if you have the environment variable editor set to the executable of an editor program; if you don't have it set, you can do editor=vim sh edit-dictionary to edit using vim (or you can substitute some other editor), or you can just do sh edit-dictionary if you have an editor already specified.
Testopia
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.
Building Mozilla
in this article, we list documents that will guide you in building firefox or other projects based upon mozilla code.
Building SpiderMonkey with UBSan
this enables all the cheap undefined behavior checks other than: alignment, which hits known bugs in spidermonkey, and is more implementation-defined (slow on x86 / crash on arm) than undefined behavior float-cast-overflow, which hits known bugs in spidermonkey, and isn't exploited by today's compilers float-divide-by-zero, which jesse doesn't think is actually undefined behavior (aside from the question of whether cpu overflow flags are set) vp...
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.
Creating JavaScript callbacks in components
javascript functions as callbacks another common use of the pattern is found in addeventlistener / removeeventlistener.
Debugging update problems
checking update requests if you're debugging the application update feature in firefox or other mozilla applications, you may need to see what requests are occurring.
Makefile - variables
l10nbasedir moz_chrome_multilocale a list of locale names to process moz_chrome_file_format both, file, jar, omni, symlink packager_no_libs hack to allow one makefile to include another without pulling in libs:: target definitions.
Simple Instantbird build
you can pick any other location, such as a new directory c:\instantbird-src.
Simple Sunbird build
run these commands to install the other build tools: sudo port sync sudo port install mercurial libidl autoconf213 problems?
pymake
on other operating systems (linux, os x, etc), pymake itself only requires python 2.6 or higher (but not python 3).
ESLint
ensure there is a .eslintrc.js file that extends one of: "plugin:mozilla/browser-test" "plugin:mozilla/chrome-test" "plugin:mozilla/mochitest-test" "plugin:mozilla/xpcshell-test" see other test directories for how to do this.
Gecko Logging
some other mostly-useless information on logging can be found on the nspr logging page.
Interface development guide
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.
Limitations of frame scripts
this is one of a pair of articles: the other one lists limitations of chrome scripts.
Process scripts
however, a problem with frame scripts is that they can be loaded multiple times in the content process, in multiple scopes that are insulated from each other.
Blocked: All storage access requests
the permission can be changed or removed by: going to preferences > content blocking in the custom content blocking section, selecting a value other than all cookies for the cookies item if the resource that is being blocked doesn't need authentication, you can fix the warning message by adding a crossorigin="anonymous" attribute to your element.
Firefox Operational Information Database: SQLite
in the manager, select the database you want to explore in the '(select profile database)' pulldown, click 'go', select one of the tables listed in the left column and see the current contents of the database in the 'browse & search' tab.) some databases are used by the browser itself, others are used by applications that you have installed or used; for example: content-prefs.sqlite cookies.sqlite download.sqlite formhistory.sqlite persmissions.sqlite places.sqlite search.sqlite signons.sqlite webappstore.sqlite ...
HTMLIFrameElement.clearMatch()
examples the following function is taken from our browser api demo, and (amongst other things) clears the search results when the search bar is hidden, if an existing search is active.
mozbrowsererror
nd filenotfound dnsnotfound connectionfailure netinterrupt nettimeout cspblocked phishingblocked malwareblocked unwantedblocked offline malformeduri redirectloop unknownsockettype netreset notcached isprinting deniedportaccess proxyresolvefailure proxyconnectfailure contentencodingfailure remotexul unsafecontenttype corruptedcontenterror certerror other example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsererror", function( event ) { console.log("an error occurred:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychang...
mozbrowserloadend
this can be used when the embedder wants to stop spinning a loading indicator, or update the ui in some other way to indicate loading is complete.
mozbrowserloadstart
this can be used when the embedder wants to start spinning a loading indicator, or update the ui in some other way to indicate loading has started.
HTMLIFrameElement.purgeHistory()
it only deletes history, not cookies or other stored information.
Chrome-only API reference
MozillaGeckoChromeAPI
this page lists apis that only run in gecko chrome code (and sometimes in other privileged circumstances).
CSS -moz-bool-pref() @supports function
syntax -moz-bool-pref( <string> ) parameters <string> the preference name returns evaluates to true if the preference is enabled, false otherwise.
Chrome-only CSS reference
MozillaGeckoChromeCSS
this page lists css properties that are only available in gecko chrome code (and sometimes in other privileged circumstances, eg.
Gecko's "Almost Standards" Mode
ughly this: inline boxes that have no non-whitespace text as a child and have no border, padding, or margin: do not influence the size of the line box (that is, their line-height is ignored) do not get a height (e.g., for their background) larger than that of their descendants, even if their font size is larger (if they have no descendants, they are zero-height positioned at their baseline) other than this one difference, "almost standards" and "standards" modes are exactly the same in terms of layout and other behaviors.
Geckoview-Junit Tests
before running tests, install the androidtest apk on your device; otherwise, 'mach geckoview-junit' will offer to install it.
How to get a process dump with Windows Task Manager
(to get a process dump for thunderbird or some other product, substitute the product name where ever you see firefox in these instructions.) caution the memory dump that will be created through this process is a complete snapshot of the state of firefox when you create the file, so it contains urls of active tabs, history information, and possibly even passwords depending on what you are doing when the snapshot is taken.
IPDL Best Practices
reference counting protocol actors is tricky here is the easiest way to get it right the first time (lessons 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.
IPDL Type Serialization
other types need to have serializers written for them explicitly.
JavaScript libraries from Mozilla projects
in addition to firefox and other applications, mozilla developers have created a number of useful javascript libraries you can use in your projects.
InstallListener
void oninstallfailed( in addoninstall install ) parameters install the addoninstall representing the install onexternalinstall() called when an add-on is installed through some system other than an addoninstall.
Dict.jsm
return value true if the specified key is in the dictionary, otherwise false.
Http.jsm
another example of how this can be used can be found here.
JNI.jsm
the most common use for this module is in add-ons and other works on firefox for android (fennec).
Examples
always wrap that function in a try catch and make that catch return promise.reject(ex) otherwise it will not trigger the rejection function of the promise.then.
Promise.jsm
this is the only state that may transition to one of the other two states.
Sqlite.jsm
other than that, they behave identically.
WebRequest.jsm
it also documents two data structures that vary from one event to another: the opt_extrainfospec argument to addlistener() the properties of the argument passed to the listener.
Localizing XLIFF files for iOS
keep in mind the following sets of characters that need to remain untranslated: $(some_text_here) is a variable format, %1$@ is another variable format.
Localizing extension metadata on addons.mozilla.org
step 4 allows you to translate any of the above fields into any other language amo supports.
Release phase
otherwise, in order to be able to make any changes to the localization files, you will need to clone the repository on your local machine and work in the local clone.
SVN for Localizers
in each of those locale directories are other directories with files to be localized in .lang format.
Localization sign-off reviews
once they are fixed, push your fix to your repo, attach it to the corresponding bug using the same mercurial revision number as before, and then request another review.
Uplifting a localization from Central to Aurora
the folks on #l10n won't be able to make language decisions for you, but there will be folks around to explain why you're seeing a merge conflict, and if you're looking for a fix on one branch, on the other, or on both.
Creating localizable web content
per-locale customizations check if there are alternative links for localized pages (e.g., links to mdn, addons.mozilla.org, or other external resources, are there translated equivalents we can use).
Localization at Mozilla
localization (l10n) is the process of translating software user interfaces from one language to another and adapting it to suit a foreign culture.
Mozilla Framework Based on Templates (MFBT)
util.h implements various other bits of useful functionality.
MathML Screenshots
this page also shows how mathml can be used in combination with other web features such as background images at a desired opacity.
Updates
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 Port Blocking
"access to the port number given has been disabled for security reasons." "establishing a connection to an unsafe or otherwise banned port was prohibited" "0x804b0013 (ns_error_port_access_not_allowed)" if your product or web site uses a port which is blocked by mozilla's default port blocking rules, you can either change the port of your service to a unblocked value (recommended if possible) or ask your mozilla users to enable the port.
Mozilla projects on GitHub
debugger.html the debugger.html, a modern universal js debugger for firefox devtools, node, and every other js environment.
GC and CC logs
to get cycle collector logs on try server, set moz_cc_log_directory to moz_upload_dir, then set the other variables appropriately to generate cc logs.
Leak Gauge
nspr_log_modules=domleak:5,documentleak:5,nsdocshellleak:5,nodeinfomanagerleak:5 nspr_log_file=nspr.log # or any other filename of your choice this will overwrite any existing file called nspr.log.
Measuring performance using the PerfMeasurement.jsm code module
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.
Memory Profiler
another common approach is to plot the allocations or the memory usages along the timeline.
Reporting a Performance Problem
for example you might have one addon that slows down page load and another one that slows down tab switch.
accessibility.tabfocus
other you can add these values to combine their functionality.
Preference reference
xt menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background.browser.urlbar.formatting.enabledthe preference browser.urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.browser.urlbar.trimurlsthe preference browser.urlbar.trimurls controls whether the protocol http and the trailing slash behind domain name (if the open page is exactly the domain name) are hidden.dom.event.clipboardevents.enableddom.event.clipboardevents.enabled lets websites get notifications if the user copies, pastes, or cuts something from a web page, and it lets them know which pa...
Preferences
a brief guide to mozilla preferences an introductory guide to where preferences are stored and other useful information about the core preference system.
A guide to searching crash reports
but there are many other interesting ways to group searches.
MailNews
see mailnews automated testing for a description of the other testing mechanisms.
Midas editor module security preferences
this functionality is completely removed since 2013-12-14 18:23 pst, see: bugs 38966 and 913734 note: if you've reached this page from a message box in firefox or another mozilla product, try using keyboard shortcuts for the cut, copy, and paste commands: copy: ctrl+c or ctrl+insert (command+c on mac) paste: ctrl+v or shift+insert (command+v on mac) cut: ctrl+x or shift+delete (command+x on mac) the information on the rest of this page is for web developers and advanced users.
About NSPR
such timers are normally used to specify timeouts on i/o, waiting on condition variables and other rudimentary thread scheduling.
Creating a Cookie Log
run firefox by typing "./firefox-bin" and pressing return (note that firefox will launch behind windows for other applications).
Process Forking in NSPR
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.
Cached Monitors
this arrangement allows a cached monitor to be associated with another object without preallocating a monitor for all objects.
Condition Variables
other threads may notify the condition variable when changes occur.
Locks
in addition to prlock, nspr provides another mutex type, prmonitor, which is reentrant and can have only one associated condition variable.
Monitors
when the entry count for a thread reaches zero, the thread releases the monitor's lock, and other threads that were blocked while trying to enter the monitor will be rescheduled.
NSPR LOG FILE
description use this environment variable to specify a log file other than the default.
NSPR LOG MODULES
(other tests?) ...
NSPR Types
other chapters describe more specialized types when describing the functions that use them.
Network Addresses
by using these functions with other network address functions, clients can support either version 4 or version 6 of the internet protocol transparently.
PLHashAllocOps
a pair of functions is used to allocate and tree the table, and another pair of functions is used to allocate and free the table entries.
PLHashEntry
warning: there are other fields in the plhashentry structure besides key and value.
PRBool
otherwise, use prbool for variables and parameter types.
PRFileDesc
otherwise, you use functions such as pr_open and pr_newtcpsocket to obtain a file descriptor, which you should treat as an opaque structure.
PRFileInfo
description the prfileinfo structure provides information about a file, a directory, or some other kind of file system object, as specified by the type field.
PRFileInfo64
description the prfileinfo64 structure provides information about a file, a directory, or some other kind of file system object, as specified by the type field.
PRFilePrivate
each layer has its own definition of prfileprivate, which is hidden from other layers as well as from the users of the layer.
PRHostEnt
note winsock.h defines h_addrtype and h_length as a 16-bit field, whereas other platforms treat it as a 32-bit field.
PRStaticLinkTable
a static link table entry can be created by a client of the runtime so that other clients can access static or dynamic libraries transparently.
PRThreadScope
global threads are scheduled by the host os and compete with all other threads on the host os for resources.
PRThreadState
if a thread is created as a joinable thread, it continues to exist after returning from its root function until another thread joins it.
PRTimeParameters
this is most commonly 1 hour, but may also be 30 minutes or some other amount.
PR_ASSERT
when the result is zero (false) the application terminates; otherwise the application continues.
PR_CALLBACK
syntax #include <prtypes.h>type pr_callbackimplementation description functions that are implemented in an application (or shared library) that are intended to be called from another shared library (such as nspr) must be declared with the pr_callback attribute.
PR_CLIST_IS_EMPTY
description pr_clist_is_empty returns a non-zero value if the specified list is an empty list, otherwise returns zero.
PR_CallOnce
while the first thread executes this function, other threads attempting the same initialization will be blocked until it has been completed.
PR_Close
on successful return, pr_close frees the dynamic memory and other resources identified by the fd parameter.
PR_ConnectContinue
- other errors: the nonblocking connect has failed with this error code.
PR_CreateThread
you can then use pr_jointhread to synchronize the termination of another thread.
PR_EXTERN
the macro includes the proper specifications to declare the target extern and set up other required linkages.
PR_EnterMonitor
attempts to acquire the lock for a monitor that is held by some other thread will result in the caller blocking.
PR_GetConnectStatus
if pr_geterror returns pr_in_progress_error, the nonblocking connection is still in progress and has not completed yet.other errors indicate that the connection has failed.
PR_GetErrorTextLength
otherwise, the value returned is sufficient to contain the error text currently available.
PR_GetHostByAddr
that is, given a valid network address (of type prnetaddr), pr_gethostbyaddr discovers the address' primary name, any aliases, and any other network addresses for the same host.
PR_GetOpenFileInfo
description pr_getopenfileinfo obtains the file type (normal file, directory, or other), file size (as a 32-bit integer), and the file creation and modification times of the open file represented by the file descriptor.
PR_GetOpenFileInfo64
it obtains the file type (normal file, directory, or other), file size (as a 64-bit integer), and the creation and modification times of the open file represented by the file descriptor.
PR_GetSpecialFD
otherwise, pr_getspecialfd returns null and sets the error to pr_invalid_argument_error.
PR_INSERT_AFTER
inserts an element after another element in a circular list.
PR_INSERT_BEFORE
inserts an element before another element in a circular list.
PR_Initialize
this allows main to be treated like any other function, signaling its completion by returning and allowing the runtime to coordinate the completion of the other threads of the runtime.
PR_Interrupt
otherwise, pr_failure.
PR_JoinThread
one of the calling threads operates successfully, and the others terminate with the error pr_failure.
PR_LOG_TEST
possible values are: pr_log_none = 0 pr_log_always = 1 pr_log_error = 2 pr_log_warning = 3 pr_log_debug = 4 pr_log_notice = pr_log_debug pr_log_warn = pr_log_warning pr_log_min = pr_log_debug pr_log_max = pr_log_debug returns pr_true when logging is enabled for the given module and level, otherwise pr_false.
PR_NewTCPSocket
after a connection is established, the client and server may send and receive data between each other.
PR_OpenTCPSocket
after a connection is established, the client and server may send and receive data between each other.
PR_PopIOLayer
in other words, stack continues to point to the top of the stack after the function returns.
PR_STATIC_ASSERT
when the result is zero (false) program compilation will fail with a compiler error; otherwise compilation completes successfully.
PR_SetConcurrency
in such cases, all the threads being supported by the virtual processor will block, but those assigned to another virtual processor will be unaffected.
PR_SetLogFile
otherwise, pr_false.
PR_SetThreadPriority
description modifying the priority of a thread other than the calling thread is risky.
PR_Sleep
all other values of ticks cause pr_sleep to block the calling thread for the specified interval.
PR_StringToNetAddr
otherwise, use of anything other than ipv4 dotted notation results in an error.
PR_dtoa
all others treated as mode 2.
Process Management and Interprocess Communication
nspr provides routines to create a new process and to wait for the termination of another process.
Random Number Generator
random number generator function pr_getrandomnoise - produces a random value for use as a seed value for another random number generator.
Running NSPR tests
known issues other issues with the nspr test suite are: some of the test programs test the accuracy of the timeout of nspr functions.
NSPR
the api is used in the mozilla clients, many of red hat's and oracle's server applications, and other software offerings.
NSS Code Coverage
if file was tested, link points to annotated source file (in tcov directory), otherwise to original source file (cvs directory).
4.3.1 Release Notes
some tokens require that a key be marked for an operation before the key can be used to perform that operation; other tokens don't care.
NSS Key Log Format
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.
NSS 3.12.5 release_notes
see the following struct in nss.h for details: nssinitparametersstr other new functions in secmod.h: secmod_getskipfirstflag secmod_getdefaultmoddbflag in prlink.h nss_securememcmp port_loadlibraryfromorigin modified functions sgn_update (see cryptohi.h) the parameter "input" of this function is changed from unsigned char * to const unsigned char *.
NSS 3.14.2 release notes
support for other platforms, such as windows, will follow in a future nss release.
NSS 3.14 release notes
because the test coverage and interoperability testing is not yet at the same level as other nss code, this feature should be considered "experimental" and may contain bugs.
NSS 3.16.2.2 release notes
this fixes a regression introduced in nss 3.16.2 that prevented nss from importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
NSS 3.16.2 release notes
the certutil commands supports generic certificate extensions, by loading binary data from files, which have been prepared using external tools, or which have been extracted and dumped to file from other existing certificates: --dump-ext-val oid --extgeneric oid:critical-flag:filename[,oid:critical-flag:filename]...
NSS 3.16.4 release notes
the inclusion of the intermediate certificate is a temporary measure to allow those sites to function, by allowing them to find a trust path to another 2048-bit root ca certificate.
NSS 3.16.6 release notes
this fixes a regression introduced in nss 3.16.2 that prevented nss from importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
NSS 3.18 release notes
a pkcs#11 library that contains root ca certificates can be loaded by tstclnt, which may either be the nssckbi library provided by nss (-b) or another compatible library (-r).
NSS 3.22 release notes
pseudorandom functions based on hashes other than sha-1 are now supported with pbkdf (bug 554827).
NSS 3.28.1 release notes
bugs fixed in nss 3.28.1 bug 1296697 - december 2016 batch of root ca changes bug 1322496 - internal error assert when the other side closes connection before reading eoed compatibility nss 3.28.1 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.28.3 release notes
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.
NSS 3.29.1 release notes
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.
NSS 3.30 release notes
applications that need to distinguish them from other other root cas, may use the exported function pk11_hasattributeset.
NSS 3.34 release notes
prbool resumed is pr_true when the session is resumed, and pr_false otherwise.
NSS 3.36.7 release notes
nss 3.36.7 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_36_7_rtm/src/ other releases are available in nss releases.
NSS 3.36.8 release notes
nss 3.36.8 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_36_8_rtm/src/ other releases are available in nss releases.
NSS 3.37.3 release notes
bugs fixed in nss 3.37.3 bug 1459739 - fix build on armv6/armv7 and other platforms.
NSS 3.41.1 release notes
nss 3.41.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_41_1_rtm/src/ other releases are available in nss releases.
NSS 3.42.1 release notes
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.
NSS 3.42 release notes
nss 3.42 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_42_rtm/src/ other releases are available in nss releases.
NSS 3.43 release notes
nss 3.43 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_43_rtm/src/ other releases are available in nss releases.
NSS 3.44.1 release notes
nss 3.44.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_44_1_rtm/src/ other releases are available in nss releases.
NSS 3.44.2 release notes
nss 3.44.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_2_rtm/src/ other releases are available in nss releases.
NSS 3.44.3 release notes
nss 3.44.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_44_3_rtm/src/ other releases are available in nss releases.
NSS 3.44.4 release notes
nss 3.44.4 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_4_rtm/src/ other releases are available in nss releases.
NSS 3.44 release notes
nss 3.44 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_rtm/src/ other releases are available in nss releases.
NSS 3.45 release notes
nss 3.45 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_45_rtm/src/ other releases are available in nss releases.
NSS 3.46.1 release notes
nss 3.46.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_46_1_rtm/src/ other releases are available in nss releases.
NSS 3.46 release notes
nss 3.46 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_46_rtm/src/ other releases are available in nss releases.
NSS 3.47.1 release notes
nss 3.47.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_47_1_rtm/src/ other releases are available in nss releases.
NSS 3.47 release notes
nss 3.47 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_47_rtm/src/ other releases are available in nss releases.
NSS 3.48.1 release notes
nss 3.48.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_48_1_rtm/src/ other releases are available in nss releases.
NSS 3.48 release notes
nss 3.48 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_48_rtm/src/ other releases are available in nss releases.
NSS 3.49.1 release notes
nss 3.49.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_49_1_rtm/src/ other releases are available in nss releases.
NSS 3.49.2 release notes
nss 3.49.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_49_2_rtm/src/ other releases are available in nss releases.
NSS 3.49 release notes
nss 3.49 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_49_rtm/src/ other releases are available in nss releases.
NSS 3.50 release notes
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.
NSS 3.51.1 release notes
nss 3.51.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_51_1_rtm/src/ other releases are available in nss releases.
NSS 3.51 release notes
nss 3.51 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_51_rtm/src/ other releases are available in nss releases.
NSS 3.52.1 release notes
nss 3.52.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_52_1_rtm/src/ other releases are available in nss releases.
NSS 3.52 release notes
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.
NSS 3.53.1 release notes
nss 3.53.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_53_1_rtm/src/ other releases are available in nss releases.
NSS 3.53 release notes
nss 3.53 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_53_rtm/src/ other releases are available in nss releases.
NSS 3.54 release notes
nss 3.54 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_54_rtm/src/ other releases are available in nss releases.
NSS 3.56 release notes
nss 3.56 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_56_rtm/src/ other releases are available in nss releases.
NSS Developer Tutorial
private headers,which may be included by files in other directories, are in the private_exports variable.
NSS Sample Code Utilities_1
der encoding from a file extract the password from a text file get the module password print as ascii or hexadecimal sample code #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include <prprf.h> #include "util.h" /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications.
EncDecMAC using token object - sample 3
encdecmac using token object example: <h2 id="nss_sample_code_3_hashing.">nss sample code 3: enc/dec/mac using token object id.</h2> <p class="summary">computes the hash of a file and saves it to another file, illustrates the use of nss message apis.</p> <pre class="brush: cpp"> /* this source code form is subject to the terms of the mozilla public * license, v.
nss tech note1
in all other cases, only the first template structure passed to the decoder will be considered, even if additonal templates are passed in an array.
nss tech note4
the oid data structure contains an array of identifier bytes (each byte is a "level" in a hierarchical namespace), a text description, and some other things.
PKCS 12 functions
the public functions listed here perform pkcs #12 operations required by some of the nss tools and other applications.
Installation guide
if you install the libraries in a directory other than /usr/lib, you usually need to set the ld_library_path environment variable.
Sample manual installation
for example, <obj-dir> for a debug build of nss on the x86 platform with a linux kernel version 2.6 with glibc would be: linux2.6_x86_glibc_pth_dbg.obj from these directories, you can copy the files to any system (or other) directory.
FC_GetSessionInfo
otherwise, it fills in the ck_session_info structure with the following information: state: the state of the session, i.e., no role is assumed, the user role is assumed, or the crypto officer role is assumed flags: bit flags that define the type of session ckf_rw_session (0x00000002): true if the session is read/write; false if the session is read-only.
FC_GetSlotList
syntax ck_rv fc_getslotlist( ck_bbool tokenpresent, ck_slot_id_ptr pslotlist, ck_ulong_ptr pulcount ); parameters tokenpresent [in] if true only slots with a token present are included in the list, otherwise all slots are included.
NSPR functions
the ssl library in nss implements the ssl protocol as an nspr i/o layer, which sits on top of another nspr i/o layer that represents tcp.
NSS tools : vfychain
additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/.
NSS tools : vfyserv
name vfyserv — tbd synopsis vfyserv description the vfyserv tool verifies a certificate chain options additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/.
gtstd.html
other kinds of pkcs #11 modules include the netscape fortezza module, used by the government, and the litronic pkcs #11 module for smart card readers.
pkfnc.html
otherwise, pr_false.
SSL functions
other sources of information: the nss_reference documents the functions most commonly used by applications to support ssl.
TLS Cipher Suite Discovery
an implementation that claimed to offer all defined cipher suites would only be able to make that claim for a short time until another new cipher suite was defined.
Utility functions
the public functions listed here perform initialization tasks and other services.
NSS tools : signver
MozillaProjectsNSStoolssignver
o setting up the shared nss database https://wiki.mozilla.org/nss_shared_db_howto o engineering and technical information about the shared nss database https://wiki.mozilla.org/nss_shared_db additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/.
NSS tools : vfychain
additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/.
Necko
this api is used in many mozilla-based client applications (including firefox) and can be used for writing other networking clients.
Personal Security Manager (PSM)
these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions.
Pork Tool Development
notes the #static channel on irc.mozilla.org is for discussion of pork, dehydra, and other static analysis tools.
Pork Tools
in this case all of the callsites are modified to: a) getter_addrefs case: getter(getter_addrefs(foo)) -> foo = getter() b) all other cases: getter(&foo) -> foo = getter().get() ...
Pork
pork has been tested mostly on linux, but in theory it should be possible to make it work on other systems.
Rhino Debugger
otherwise control will return to the debugger at the next line in the current function.
Tutorial: Embedding Rhino
result could be a string, javascript object, or other values.
Rhino FAQ
however, a java-based browser may use rhino with scripts from a page in the same manner that any other java program would.
Small Footprint
removing org.mozilla.javascript.javaadapter will disable this functionality, but rhino will otherwise run correctly.
Rhino history
compilation is faster and when scripts are no longer in use they can be collected like any other java object.
Rhino JavaScript compiler
the resulting java class files can then be loaded and executed at another time, providing a convenient method for transferring javascript, and for avoiding translation cost.
Rhino optimization
another benefit of the interpreted mode is that the interpreter performs tail-call elimination of recursive functions.
Performance Hints
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!).
Rhino shell
otherwise it is converted to string denoting the last argument and options objects assumed to be empty.
Shumway
the whats and whys of shumway shumway is a renderer for adobe flash built entirely in web standards (javascript, webgl, and others).
Rebranding SpiderMonkey (1.8.5)
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 use your library.
INT_FITS_IN_JSVAL
otherwise, int_fits_in_jsval returns false.
JS::Add*Root
otherwise they report an out of memory error and return false.
JS::AutoVectorRooter
bool appendall(const autovectorrooter<t> &other) appends all elements of other to the array.
JS::CallArgs
js::value computethis(jscontext *cx) const returns the this value if this is an object, otherwise calls js_computethis and returns it.
JS::Compile
otherwise, it returns false and the value left in script is undefined.
JS::CompileFunction
otherwise, it returns false and the value left in fun is undefined.
JS::CreateError
if successful, js::createerror stores the created error object to *rval and returns true, otherwise returns false and the value of *rval is undefined.
JS::CurrentGlobalOrNull
in other words, it returns the global object on the current scope chain.
JS::Evaluate
otherwise it returns false and the value left in *rval is undefined.
JS::GetFirstArgumentAsTypeHint
otherwise, return false with a typeerror pending.
JS::GetSelfHostedFunction
otherwise, it reports an out-of-memory error and returns null.
JS::ToPrimitive
do not pass any other type.
JS::ToString
otherwise, it converts the value to string.
JS::Value
debug builds will assert correct jsapi use in many other instances as well.
JSDeletePropertyOp
otherwise the callback must return true, and the property operation proceeds.
JSErrorReport
jsreport_strict_mode_error this condition is an error in strict mode code, a warning if js_has_strict_option(cx), and otherwise should not be reported at all.
JSFinalizeOp
for other ways to interact with garbage collection (e.g.
JSFunction
for other function objects - that is, functions created by running javascript code containing function declarations or function-expressions-the relationship between the jsfunction * and the jsobject * is not well-defined.
JSHasInstanceOp
return false on error or exception, true on success with true in *bp if v is an instance of obj, false in *bp otherwise.
JSNative
otherwise it should either report an error (using e.g.
JSNewEnumerateOp
all other property inspection, including object.keys(obj), goes through [[ownkeys]].
JSObjectOp
jsobjectop is the type of several jsapi callbacks that map an object to another object, or null if an error or exception occurred.
JSObjectOps.enumerate
otherwise, it invokes the jsclass.enumerate hook as an old-style jsenumerateop to give the object an opportunity to define any remaining lazy properties.
JSObjectOps.lookupProperty
note: a successful return with non-null *propp means the implementation may have locked *objp and added a reference count associated with *propp, so callers should not risk deadlock by nesting or interleaving other lookups or any obj-bearing ops before dropping *propp.
JSObjectOps.setProto
description these hooks must check for cycles without deadlocking, and otherwise take special steps.
JSObjectPrincipalsFinder
another example: when the function constructor is called, the javascript engine calls the object principals finder callback to obtain principals for the local scope object, to check that the caller has access to that object.
JSPrincipalsTranscoder
otherwise xdr->mode == jsxdr_encode, and *principalsp points to the jsprincipals object to be serialized.
JSPropertyDescriptor
in other words, the above code is equivalent to the following code.
JSPropertyOp
otherwise the callback must return true, and the property operation proceeds.
JSTraceOp
jstraceop implementation can assume that no other threads mutates object state.
JSVAL_IS_PRIMITIVE
otherwise it is false, and v is an object.
JSVAL_LOCK
otherwise, it evaluates to false.
JSVAL_TO_BOOLEAN
otherwise the behavior is undefined.
JSVAL_TO_STRING
(the difference is that the latter will convert an object, array, number, or other value to a string in a type-safe way, creating a new string if needed.) to convert the return type of this macro (jsstring *) to a char pointer, use js_getstringbytes.
JSVAL_UNLOCK
otherwise, it evaluates to false.
JS_AddArgumentFormatter
otherwise it returns js_false.
JS_Add*Root
otherwise they report an out of memory error and return js_false.
JS_AliasElement
once you create an alias, you can reassign it to other elements as needed.
JS_AliasProperty
once you create an alias, you can reassign it to other properties as needed.
JS_BeginRequest
if one thread needs garbage collection, it blocks until each other thread makes a jsapi call.
JS_BufferIsCompilableUnit
otherwise return true.
JS_ClearNewbornRoots
description the last gc thing of each type (object, string, double, external string types) created on a given context is kept alive until another thing of the same type is created, using a newborn root in the context.
JS_ClearRegExpStatics
on successful, js_clearregexpstatics returns true, otherwise returns false.
JS_CompileScript
otherwise, they report an error, stores null to *script, and return false.
JS_CompileUTF8File
otherwise it returns null.
JS_ConcatStrings
the result could be the same as one of the input strings, if the other string is zero length.
JS_ContextIterator
otherwise *iterp must point to an existing context in rt, and js_contextiterator modifies it to point to the next context in the list, if any, and null otherwise.
JS_ConvertArguments
this conversion is dangerous and almost entirely useless, because the resulting jsfunction is not a real function object and therefore cannot be safely passed to any other jsapi function.
JS_ConvertArgumentsVA
otherwise it returns false.
JS_DecompileFunction
otherwise, it returns null.
JS_DecompileFunctionBody
otherwise, it returns null.
JS_DefaultValue
do not pass any other type.
JS_DefineConstDoubles
otherwise it returns false.
JS_DefineElement
otherwise it returns false.
JS_DefineProperties
otherwise it returns false.
JS_DeleteElement
otherwise it returns false.
JS_DestroyRuntime
call js_destroyruntime after completing all other js api calls.
JS_DumpHeap
other users // should sort alphabetically, for consistency.
JS_EncodeString
otherwise the high byte is simply dropped from each char16_t.
JS_EnterCrossCompartmentCall
otherwise it returns null.
JS_EnterLocalRootScope
for example: jsbool my_getproperty(jscontext *cx, jsobject *obj, jsval id, jsval *vp) { 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.
JS_EvaluateScript
otherwise it returns js_false and the value left in *rval is undefined.
JS_EvaluateScriptForPrincipals
otherwise it returns js_false, and the value left in *rval is undefined.
JS_ExecuteScriptPart
otherwise it returns js_false, and the value left in *rval is undefined.
JS_FileEscapedString
if successful, js_fileescapedstring returns true, otherwise false.
JS_FreezeObject
this means that other code cannot delete, add or change any properties on the object.
JS_GC
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.
JS_GetClassObject
if successful, js_getclassobject stores the class constructor to *objp and returns true, otherwise returns false and the value of *objp is undefined.
JS_GetClassPrototype
if successful, js_getclassprototype stores the class prototype object to *objp and returns true, otherwise returns false and the value of *objp is undefined.
JS_GetConstructor
otherwise, it reports an error and returns null.
JS_GetElement
on success, *vp receives the current value of the element, if it exists, and undefined otherwise.
JS_GetErrorPrototype
other contexts in the same runtime can have their own error reporting functions.
JS_GetFunctionArity
otherwise fun is implemented in javascript, and the result is the number of identifiers in its formal parameter list (see ecma 262-3 §13).
JS_GetGCParameter
jsgc_allocation_threshold_factor_avoid_interrupt is used when a gc is already in progress for other zones and we may wish to avoid interrupting it.
JS_GetGlobalForScopeChain
in other words, it returns the global object on the current scope chain.
JS_GetInstancePrivate
otherwise it returns null.
JS_GetLatin1InternedStringChars
if successful, js_getlatin1stringcharsandlength and js_gettwobytestringcharsandlength return a pointer to the string, otherwise return null.
JS_GetLatin1StringCharsAndLength
if successful, js_getlatin1stringcharsandlength and js_gettwobytestringcharsandlength return a pointer to the string, and store the length to *length, otherwise return null.
JS_GetNaNValue
nan is not equal to any other value.
JS_GetPendingException
otherwise, it returns false, and the value left in *vp is undefined.
JS_GetPropertyAttributes
if obj does not have the specified property, or if it inherits it from some other object (on its prototype chain, for example), then *foundp is set to js_false.
JS_GetPrototype
otherwise, it stores a pointer to the prototype or null to *protop and returns true.
JS_GetRegExpFlags
if successful, js_getregexpflags returns the flags, otherwise returns false.
JS_GetRegExpSource
if successful, js_getregexpsource returns a pointer to the source string, otherwise returns null.
JS_GetStringBytes
otherwise the high byte is simply dropped from each jschar.
JS_GetStringCharAt
on successful, js_getstringcharat returns true and stores the character code into *res, otherwise returns false.
JS_GetStringCharsAndLength
description js_getstringcharsandlength gets the characters and the length of the string, str if successful, js_getstringcharsandlength returns a pointer to the string, and store the length to *length, otherwise returns null see also bug 1037869 ...
JS_GetTypeName
the following table lists jstypes and the string literals reported by js_gettypename: type literal jstype_void "undefined" jstype_object "object" jstype_function "function" jstype_string "string" jstype_number "number" jstype_boolean "boolean" any other value null see also js_convertvalue js_typeofvalue js_valuetoboolean js_valuetofunction js_valuetoint32 js_valuetonumber js_valuetoobject js_valuetostring bug 1037718 ...
JS_HasElement
on success, it stores true to *foundp, false otherwise.
JS_HasInstance
otherwise js_hasinstance returns false.
JS_IdToProtoKey
otherwise it returns jsproto_null.
JS_IdToValue
otherwise it returns false.
JS_IsArrayObject
otherwise returns false on failure.
JS_IsConstructing
otherwise it returns js_false.
JS_IsConstructor
otherwise it returns false.
JS_IsExceptionPending
otherwise, it returns false this can be used from jsnative functions which call js code to determine if the called js code threw an exception or not.
JS_IsExternalString
description js_isexternalstring returns true if the string is an external string; otherwise it's false.
JS_IsGlobalObject
description js_isglobalobject returns true if obj is a global object, false otherwise.
JS_IsIdentifier
on successful, js_isidentifier stores the test result to *isidentifier and returns true, otherwise returns false and the value of *isidentifier is undefined.
JS_IsNativeFunction
otherwise it returns false.
JS_IsRunning
otherwise it returns false.
JS_IsStopIteration
description js_isstopiteration returns true if v is stopiteration, otherwise false.
JS_LooselyEqual
if the comparison attempt was successful, the method returns js_true and stores the result in *equal; otherwise it returns js_false.
JS_NewArrayObject
otherwise it reports an error as though by calling js_reportoutofmemory and returns null.
JS_NewCompartmentAndGlobalObject
otherwise it returns null.
JS_NewDependentString
otherwise it returns null.
JS_NewObjectForConstructor
the prototype is the prototype of the constructor if it is an object, otherwise null.
JS_NewPlainObject
otherwise it returns nullptr.
JS_NewScriptObject
otherwise it returns null.
JS_NumberValue
otherwise, a new floating-point js::value is created.
JS_ObjectIsFunction
js_objectisfunction returns true if obj is a function and false otherwise.
JS_ObjectIsRegExp
otherwise it returns false.
JS_RemoveExternalStringFinalizer
otherwise, string data will be leaked by the gc, for want of a finalizer to call.
JS_ReportOutOfMemory
call js_reportallocationoverflow if an operation fails because it tries to use more memory (or more of some other resource) than the application is designed to handle.
JS_ResolveStandardClass
false otherwise.
JS_ScheduleGC
otherwise, no additional gcs take place.
JS_SetArrayLength
otherwise it returns false.
JS_SetBranchCallback
another use is to call js_maybegc periodically.
JS_SetContextCallback
for future compatibility the callback must do nothing and return true if any other value is passed.
JS_SetErrorReporter
like all other spidermonkey callbacks, the error reporter callback must not throw a c++ exception.
JS_SetPrivate
if your class's private data contains any jsvals or other references to javascript objects, implement the jsclass.mark callback to ensure they are not prematurely reclaimed by the garbage collector.
JS_SetPrototype
otherwise it returns false.
JS_SetThreadStackLimit
in a js_threadsafe build, after passing a jscontext from one thread to another, call js_setthreadstacklimit(cx, 0) after calling js_setcontextthread.
JS_StrictlyEqual
if the comparison attempt was successful, the method returns true and stores the result in *equal; otherwise it returns false.
JS_StringEqualsAscii
on successful, js_stringequalsascii stores the comparison result into *match and returns true, otherwise returns false.
JS_StringToVersion
sion_1_1 obsolete since jsapi 24 "1.2" jsversion_1_2 obsolete since jsapi 24 "1.3" jsversion_1_3 obsolete since jsapi 24 "1.4" jsversion_1_4 obsolete since jsapi 24 "ecmav3" jsversion_ecma_3 "1.5" jsversion_1_5 obsolete since jsapi 24 "1.6" jsversion_1_6 "1.7" jsversion_1_7 "1.8" jsversion_1_8 other jsversion_unknown see also mxr id search for js_stringtoversion jsversion js_getversion js_setversionforcompartment js_versiontostring bug 824312 ...
JS_ValueToInt32
otherwise, the floating-point number is rounded to the nearest integer value.
JS_VersionToString
e jsapi 24 jsversion_1_3 "1.3" obsolete since jsapi 24 jsversion_1_4 "1.4" obsolete since jsapi 24 jsversion_ecma_3 "ecmav3" jsversion_1_5 "1.5" obsolete since jsapi 24 jsversion_1_6 "1.6" jsversion_1_7 "1.7" jsversion_1_8 "1.8" jsversion_ecma_5 "ecmav5" jsversion_default "default" other null see also mxr id search for js_stringtoversion jsversion js_getversion js_setversionforcompartment js_stringtoversion bug 824312 ...
JS_malloc
that is, it is safe to allocate memory in one context and free it in another, as long as both contexts are in the same runtime.
Property attributes
obsolete since jsapi 39 this flag has an additional special meaning when used with js_defineproperty, js_fs, and other apis that define properties: it means that the name parameter is actually an integer unsafely cast to a pointer type, not a string.
SpiderMonkey 45
on several other platforms (sparc, mips), the jit is provided but not supported.
Setting up CDT to work on SpiderMonkey
under "behavior", make sure that "enable parallel build" is deactivated, as cdt’s indexer will freak out otherwise.
TPS Bookmark Lists
for example: var bookmarks_after_second_modify = { "menu": [ { uri: "http://www.getfirefox.com/", title: "get firefox" } ], "menu/foldera": [ { uri: "http://mozilla.com", title: "mozilla" }, ] }; this describes two bookmarks, one in the "menu" folder, and the other in the "folder1" subfolder of "menu".
Mozinfo
throughout mozmill and other mozilla python code, checking the underlying platform is done in many different ways.
Using RAII classes in Mozilla
however, there are some variations for special cases: first, if the constructor (otherwise) takes no arguments, then you have to use the moz_guard_object_notifier_only_param macro instead.
Gecko events
event_hypertext_changed focus has changed from one hypertext object to another, or focus moved from a non-hypertext object to a hypertext object, or focus moved from a hypertext object to a non-hypertext object.
Implementation Details
please refer to pages below for interesting at api: msaa ia2 at-spi differences with other applications this section provides information about implementation differences between gecko based applications and other applications.
XForms Accessibility
every form control other than the output element must contain a label element.
XUL Accessibility
aggregating the text from element subtree if the child node is hidden then it's ignored excepting the case when the element used as label is hidden itself if the child node is text node then its rendered value is appended if the child node is element then if it implements nsidomxullabeledcontrolelement then the value of label property is appended otherwise if it's a label element then then value attribute is appended otherwise append tooltiptext attribute append the accessible value searching specific element in neighbour of the element search inside the element subtree go up through parents (max level is 5) and search inside theirs subtrees if the element is anonymous then search in whole anonymous subtree, here the attribute anonid is ...
Accessibility API Implementation Details
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.
Embedded Dialog API
other sets of dialogs and alerts, implemented in other components,can be overridden in exactly the same fashion.
Feed content access API
nsifeedelementbase a base class subclassed by several of the other feed-related interfaces.
Frecency algorithm
points for each sampled visit = (bonus / 100.0) * weight final frecency score for visited uri = ceiling(total visit count * sum of points for sampled visits / number of sampled visits) example this is an example of a frecency calculation for a uri that is bookmarked and has been visited twice recently (once yesterday, and once last week by clicking a link), and two other times more than 90 days ago: 0 default score +140 100 * (140/100.0) - first bucket weight and bookmarked bonus +84 70 * (120/100.0) - second bucket weight and followed-link bonus +14 10 * (140/100.0) - fifth bucket weight and bookmarked bonus +14 10 * (140/100.0) - fifth bucket weight and bookmarked bonus -- 252 ...
Manipulating bookmarks using Places
you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute.
Using the Places favicon service
otherwise, nsifaviconservice.setandloadfaviconforpage() will use the default expiration time.
Using the Places history service
otherwise, the link is colored as unvisited.
FUEL
the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/fuel/application;1"].getservice(components.interfaces.fueliapplication); ...
SMILE
the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/smile/application;1"].getservice(components.interfaces.smileiapplication); ...
STEEL
the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/steel/application;1"].getservice(components.interfaces.steeliapplication); other resources steel development plan.
extIApplication
the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/fuel/application;1"].getservice(components.interfaces.fueliapplication); see also fuel (firefox), steel (thunderbird) and smile (seamonkey) ...
extIPreferenceBranch
there are no other types supported by the preference subsystem.
extISessionStorage
boolean has(in astring aname) parameters aname the name of an item return value true if an item exists with the given name, false otherwise.
Bundling multiple binary components
on the other hand, this approach is much more simple than the dynamic loading approach.
Creating a Python XPCOM component
pay special attention to types here - python and javascript are both loosely-typed, so it's fairly easy to pass information from one to the other.
Creating XPCOM components
entpolicy interface receiving notifications implementing the nsicontentpolicy uniform resource locators checking the white list creating nsiuri objects building the weblock ui user interface package list client code overview xul the xul document the locking ui site adding ui weblock.xul overlaying new user interface into mozilla weblockoverlay.xul other resources weblock.css image resources packaging weblock component installation overview archiving resources the weblock installation script the weblock trigger script distributing your component appendix a - setting up the gecko sdk downloading and setting the sdk building a microsoft visual cpp project creating a new project adding the gecko sdk to the project sett...
XPCOM guide
MozillaTechXPCOMGuide
however, it may be useful for c++ code in the mozilla platform to run tasks on another thread.mozilla internal string guidemost of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers.
How to build a binary XPCOM component using Visual Studio
d = "@starkravingfinkle.org/specialthing;1"; var obj = components.classes[cid].createinstance(); obj = obj.queryinterface(components.interfaces.ispecialthing); } catch (err) { alert(err); return; } var res = obj.add(3, 4); alert('3+4 = ' + res); var name = obj.name; alert('name = ' + name); obj.name = 'new name'; name = obj.name; alert('name = ' + name); } other resources creating xpcom components - mozilla how to build an xpcom component in javascript - mozilla an introduction to xpcom - ibm xpcom project page - mozilla ...
How To Pass an XPCOM Object to a New Window
getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/debug.xul", "debug history", "chrome,centerscreen,resizable", myobject); note in this example that myobject is passed to the openwindow() method; you can pass any xpcom object (or any other value, for that matter) in this way.
Components.Exception
syntax var exception = [ new ] components.exception([ message [, result [, stack [, data ] ] ] ]); parameters message a string which can be displayed in the error console when your exception is thrown or in other developer-facing locations, defaulting to 'exception' result the nsresult value of the exception, which defaults to components.results.ns_error_failure stack an xpcom stack to be set on the exception (defaulting to the current stack chain) data any additional data you might want to store, defaulting to null example throw components.exception("i am throwing an exception from a javascri...
Components.ID
syntax var interfaceid = [ new ] components.id(iid); parameters iid a string of the format '{00000000-0000-0000-0000-000000000000}' giving the interface id of the interface description components.id creates interface ids for use in implementing methods like queryinterface, getinterfaces, and other methods that take interface ids as parameters.
Components.classes
note also that it is possible that a given add-on component with a given contractid will be present on one machine but not have been installed on another machine.
Components.interfaces
each object represents one of the xpcom interfaces -- that some component or another might or might not implement.
Components.interfacesByID
each object represents one of the xpcom interfaces -- that some component or another might or might not implement.
Components.utils.cloneInto
"hello from add-on"}; contentwindow.addonscriptobject = cloneinto(addonscriptobject, contentwindow); scripts running in the page can now access the object: // page script button.addeventlistener("click", function() { console.log(window.addonscriptobject.greeting); // "hello from add-on" }, false); of course, you don't have to assign the clone to the window itself: you can assign it to some other object in the target scope: contentwindow.foo.addonscriptobject = cloneinto(addonscriptobject, contentwindow); you can also pass it into a function defined in the page script.
Components.utils.forceGC
another instance where it can be useful to force garbage collection is before cleaning out dead reference from a hash of weak javascript references.
Components.utils.getGlobalForObject
var global = components.utils.getglobalforobject(obj); parameters obj an object whose corresponding global object is to be retrieved; non-optional, must be object-valued example var obj = {}; function foo() { } var global = this; var g1 = components.utils.getglobalforobject(foo); var g2 = components.utils.getglobalforobject(obj); // g1 === global, g2 === global, g1 === g2 // in a script in another window var global2 = this; function bar() { } var obj2 = {}; // then, assuming bar refers to the function defined in that other window: var o1 = components.utils.getglobalforobject(bar); var o2 = components.utils.getglobalforobject(obj2); // o1 === global2, o2 === global2 ...
Components.utils.import
additional resources components.utils bug 238324 the documentation in xpccomponents.idl the tests in js/xpconnect/tests/unit/ importing sdk/commonjs modules into other code ...
Components.utils.isXrayWrapper
returns true if the object is an xray: false otherwise.
Components.utils.unload
you should not unload modules that are part of the application (anything under resource://gre/ or resource:/// or resource://app/) as these may be in use by other extensions and the application.
Components.utils.unwaiveXrays
for example, if privileged code accesses a dom object belonging to web content, it will by default see it using xray vision, meaning that among other things expando properties added to the object by content are not visible.
PyXPCOM
other resources pythonext - extension that provides pyxpcom samples - demo applications using pyxpcom community python-xpcom bindings mailing list (activestate) #pyxpcom on irc.mozilla.org source code the pyxpcom code is available here: http://hg.mozilla.org/pyxpcom/ to build pyxpcom, see building pyxpcom.
Using components
mponents.interfaces; if we want to get a hold of a component, we then do something like: var rc = cc["@mozilla.org/registry;1"]; var rs = rc.getservice(ci.nsiregistry); see also: xpcshell -- how to get a command line interface to javascript more info as was already stated, it is common to start addon scripts like: var cc = components.classes; var ci = components.interfaces; there is also another way to start, which is exactly equivalent to the above.
HOWTO
async network requests problem you want to make network requests or do other asynchronous work in xpcshell.
XPCShell Reference
if that file is found, it is executed before any other js files specified.
XPCshell Test Manifest Expressions
system on which the test is being run toolkit - the graphics toolkit used by this build one of: 'windows', 'cocoa', 'gtk2', 'android' processor - the cpu which the code is compiled for one of: 'x86', 'x86_64', 'arm' bits - the pointer size of the cpu architecture, in bits one of 32, 64, possibly unknown debug - set to true if this build is a debug build, false otherwise crashreporter - set to true if this build has crash reporting code enabled, false otherwise.
nsDirectoryService
cebycontractid("@mozilla.org/file/directory_service;1", ns_get_iid(nsiproperties), getter_addrefs(directory)); if (ns_failed(rv)) return rv; rv = directory->get(ns_os_temp_dir, ns_get_iid(nsifile), aresult); return rv; } note that ns_os_temp_dir is defined in nsdirectoryservicedefs.h along with a number of other directory service keys.
NS_GetComponentManager
otherwise, it returns an error code.
NS_GetComponentRegistrar
otherwise, it returns an error code.
NS_GetMemoryManager
otherwise, it returns an error code.
NS_GetServiceManager
otherwise, it returns an error code.
NS_InitXPCOM2
otherwise, it returns an error code.
NS_InitXPCOM3
otherwise, it returns an error code.
NS_NewLocalFile
otherwise, it returns an error code.
NS_NewNativeLocalFile
otherwise, it returns an error code.
NS_ShutdownXPCOM
otherwise, it returns an error code.
NS_ConvertASCIItoUTF16
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
NS_ConvertUTF16toUTF8
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(c...
NS_ConvertUTF8toUTF16
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
NS_LossyConvertUTF16toASCII
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(c...
Append
otherwise, adata need not be null terminated.
Assign
otherwise, adata need not be null terminated.
Insert
otherwise, adata need not be null terminated.
Replace
otherwise, adata need not be null terminated.
Append
otherwise, adata need not be null terminated.
Assign
otherwise, adata need not be null terminated.
Insert
otherwise, adata need not be null terminated.
Replace
otherwise, adata need not be null terminated.
nsAdoptingCString
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(c...
nsAdoptingString
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
nsAutoString
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
nsCAutoString
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget ch...
nsCString
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(c...
nsCStringEncoding
reverse conversion is done by truncating every other byte.
nsDependentCString
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(c...
nsDependentString
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
nsEmbedCString
otherwise, adata need not be null terminated.
nsEmbedString
otherwise, adata need not be null terminated.
nsFixedCString
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(c...
nsFixedString
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
Clone
otherwise, it returns a pointer to the newly allocated buffer.
HeapMinimize
otherwise, it returns an error code.
Realloc
otherwise, it returns a pointer to the newly allocated buffer.
nsPromiseFlatCString
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(c...
nsPromiseFlatString
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
nsString
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
nsXPIDLCString
replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void replacechar(const char*, char) - source parameters char* aset char anewchar replacesubstring void replacesubstring(const nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(c...
nsXPIDLString
replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar anewchar void replacechar(const char*, prunichar) - source parameters char* aset prunichar anewchar replacesubstring void replacesubstring(const nsstring&, const nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunicha...
IAccessibleEditableText
other-licenses/ia2/accessibleeditabletext.idlnot scriptable this interface provides clipboard capability to text objects.
IAccessibleImage
other-licenses/ia2/accessibleimage.idlnot scriptable this interface represents images and icons.
IAccessibleRelation
other-licenses/ia2/accessiblerelation.idlnot scriptable this interface gives access to an object's set of relations.
IAccessibleValue
other-licenses/ia2/accessiblevalue.idlnot scriptable this interface gives access to a single numerical value.
imgIDecoder
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.
imgILoader
return value true if a decoder is available, false otherwise.
imgIRequest
otherwise returns the same request.
mozIJSSubScriptLoader
to get this service, use: var mozijssubscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); note: see components.utils.import for another way to import javascript code.
mozIRepresentativeColorCallback
void oncomplete( in boolean success, [optional] in unsigned long color ); parameters success true if analysis was successful, false otherwise.
mozISpellCheckingEngine
if the dictionary was set to "no dictionary" (that is, by specifying an empty string), the observer may select another dictionary before returning.
mozIStorageService
note: you should only access the profile database from the main thread since other callers may also be using it.
mozIStorageStatement
boolean step() return value true if there are more rows left in the results, otherwise false.
mozIStorageStatementWrapper
return value returns true if the stepping the wrapped statement was successful, otherwise returns false.
mozIStorageValueArray
return value returns true if the column specified by aindex is null, or false otherwise.
mozIVisitStatusCallback
avisitedstatus true if the specified uri has been visited; otherwise false.
nsIAbCard
copy() this function will copy all values from one card to another.
nsIAboutModule
otherwise, only chrome will be able to link to it.
nsIAccessible
relations many accessibles are linked with each other, for example, if one accessible gives the accessible name for another accessible (for example, html:label and html control) then these accessibles are related, please refer to relations documentation for more information.
nsIAccessibleDocument
otherwise, it will return the first cached accessible in the parent chain.
nsIAccessibleHyperLink
in all other cases, true is returned.
nsIAccessibleSelectable
otherwise, returns true.
nsIAccessibleTextChangeEvent
return value true if text was inserted, otherwise false.
nsIAlertsService
the text must not be too long, otherwise it might be truncated to a platform-specific length.
nsIAppShellService
enterlastwindowclosingsurvivalarea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) during application startup (and at other times!) we may temporarily encounter a situation where all application windows will be closed but we do not want to take this as a signal to quit the application.
nsIApplicationCacheChannel
loadedfromapplicationcache prbool true if the resource was loaded from the application cache, otherwise false.
nsIApplicationCacheService
note: this method should propagate the entry to other application caches with the same opportunistic namespace; however, this is not currently implemented.
nsIApplicationUpdateService
obsolete since gecko 1.9.1.7pre isdownloading boolean true if a download is in progress, otherwise false.
nsIArray
null is a valid result for this method, but exceptions are thrown in other circumstances.
nsIAsyncStreamCopier
netwerk/base/public/nsiasyncstreamcopier.idlscriptable this interface is used to copy the contents of one stream to another.
nsIAuthPrompt2
level_pw_encrypted 1 password will be sent encrypted, but the connection is otherwise insecure.
nsIAuthPromptCallback
usercancel if false, this prompt was cancelled by calling the the cancel method on the nsicancelable; otherwise, it was cancelled by the user.
nsIAutoCompleteInput
disableautocomplete boolean true if auto-complete is currently disabled; otherwise false.
nsIBadCertListener2
this object usually supports nsisslsocketcontrol, nsitransportsecurityinfo, nsiidentityinfo, nsisslstatusprovider, nsiclientauthuserdecision and possibly other interfaces.
nsIBidiKeyboard
some other part of the code is going to be on gtk+ later, and we will use gtk+ api instead.
nsIBlocklistPrompt
these are javascript objects with properties: name - the plugin or extension name version - the version of the extension or plugin icon - the plugin or extension icon disable - can be used by the nsiblocklistprompt to allows users to decide whether a soft-blocked add-on should be disabled blocked - true if the item is hard-blocked, false otherwise item - the nsiplugintag or addon object acount optional the number of addons.
nsIBlocklistService
return value true if the item is blocklisted, otherwise false.
nsICacheEntryInfo
return value returns true if the cache entry is stream based, otherwise returns false.
nsICacheMetaDataVisitor
return value returns true if the provided key/value finds a cache entry, otherwise returns false.
nsICacheService
entries created by a cache session are invisible to other cache sessions, unless the cache sessions are equivalent.
nsIChromeFrameMessageManager
aallowdelayedload if true, the script will be loaded when the remote frame becomes available; otherwise, the script will only be loaded if the frame is already available.
nsIChromeRegistry
return value true if xpcnativewrappers are enabled for the specified uri; otherwise false.
nsICommandLineRunner
all other errors thrown by handlers will be silently ignored.
nsICompositionStringSynthesizer
in other words, commits composition string.
nsIContainerBoxObject
the browser.xml, editor.xml and general.xml bindings use this property to gain access to other properties such as webnavigation, contentdocument and contentwindow.
nsIContentViewer
return value true if the document will allow unloading; otherwise false.
nsIConverterOutputStream
must be called before any other method on this interface, or you will crash.
nsICookiePermission
this may result in other uris being blocked as well, such as uris that share the same host name.
nsICryptoHMAC
note: this method must be called before any other method on this interface is called.
nsICycleCollectorListener
if begin() returns an error none of the other functions will be called.
nsIDBChangeListener
others use the onhdrflagschanged() method.
nsIDOMOfflineResourceList
return value true if the resource is in the list, otherwise false.
nsIDOMWindow
this is useful for connecting event listeners to this window as well as every other window nested in that window root.
nsIDOMWindow2
this is useful for connecting event listeners to this window as well as every other window nested in that window root.
nsIDOMXPathEvaluator
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.
nsIDebug
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.
nsIDebug2
this often correlates to whether other code (for example, firefox, xulrunner) was compiled with debug defined.
getFile
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_current_process_dir "curprocd" ns_xpcom_current_process_dir "xcurprocd" can be overriden by passing a "bin directory" to ns_initxpcom2().
nsIDirectoryServiceProvider
alert(currdir); see also nsdirectoryservice nsidirectoryservice additionally, see section 16.5.2 of the rapid application development with mozilla book for instructions on how to get the current working directory and the process binary directory, among other things.
nsIDirectoryServiceProvider2
use an xpcom return code of ns_success_aggregate_result if this result should be aggregated with other "lower" providers.
nsIDownloadHistory
there is a separate interface specifically for downloads in case embedders choose to track downloads differently from other types of history.
nsIDownloadManagerUI
d gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getattention(); void show([optional] in nsiinterfacerequestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type description visible boolean true if the download manager ui is visible; otherwise false.
nsIDownloadProgressListener
rather, only fill in the code for the ones you need, and leave the others blank as shown.
nsIDownloader
if null, the downloader will select a location and the resulting file will be deleted (or otherwise made invalid) when the downloader object is destroyed.
nsIDragSession
return value true if the specified flavor matches any of the native data on the clipboard, otherwise false.
nsIDroppedLinkHandler
aname the link title if it exists, or an empty string otherwise.
nsIEditor
true if the current selection anchor is editable; otherwise false.
nsIEventListenerInfo
otherwise null.
nsIFeedElementBase
toolkit/components/feeds/public/nsifeedelementbase.idlscriptable this interface is a base interface from which several of the other feed access interfaces derive.
nsIFeedProcessor
you must not call any of the other parsing methods on the nsifeedprocessor interface during an asynchronous parse.
nsIFeedTextConstruct
various other feed-related interfaces, such as nsifeed, nsifeedentry, and nsifeedcontainer have attributes that return objects implementing nsifeedtextconstruct.
nsIFileURL
the url scheme need not be file:, since other local protocols may map urls to files (e.g., resource:).
nsIFileView
currently no other file stats are implemented.
nsIHttpActivityDistributor
this is primarily useful for debuggers and other traffic monitoring tasks.
nsIHttpActivityObserver
n gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void observeactivity(in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata); attributes attribute type description isactive boolean true when the interface is active and should observe http activity, otherwise false.
nsIIOService
return value true if the port is allowed, false otherwise.
nsIIdleService
in other words, even if the user is working in other applications, the idle service will still consider the user to be active.
nsIJSON
writebom specify true if you wish to write a byte-order mark (bom) into the stream, otherwise specify false.
nsILivemarkService
return value true if the given folder is a livemark folder, otherwise it returns false.
Using nsILoginManager
the hostname, username and password attributes are mandatory, while the other fields are set based on whether the login is for a web page form or an http/ftp authentication site login.
nsILoginManagerCrypto
can throw if the user cancels entry of their master password, or if the ciphertext value can not be successfully decrypted (for example, if it was encrypted with some other key).
nsILoginManagerPrompter
must be called before using other interfaces.
nsILoginManagerStorage
return value return true if login saving is enabled for the specified host; otherwise, return false.
nsIMemoryReporter
kind_other 2 an allocation that does not fit into another kind category.
nsIMenuBoxObject
openedwithkey boolean true if the menubar was opened using the keyboard; otherwise false.
nsIMessageListener
sync true if the message was sent using sendsyncmessage, false otherwise.
nsIMessageWakeupService
content/base/public/nsimessagewakeupservice.idlscriptable implements the message manager wakeup service; this lets other components be woken up when specific message manager messages arrive.
nsIMessenger
if they want a list suitable for display, they should pass in an ahistory pointer, and they'll get returned an array with strings containing something like subject and sender of the message - other possible info is the folder containing the message, and the preview text, if available.
nsIMicrosummaryService
otherwise, it'll asynchronously download the necessary information (the generator and/or page) before refreshing the microsummary.
nsIMsgCompFields
(bug 249530) newsgroups astring newshost char * newsposturl char * organization astring otherrandomheaders astring no longer exists - see https://groups.google.com/forum/#!topic/mozilla.dev.apps.thunderbird/s4ofmm8_b28 priority char * receiptheadertype print32 references char * replyto astring securityinfo nsisupports subject astring templatename astring te...
nsIMsgCustomColumnHandler
false otherwise.
nsIMsgDBHdr
all other flags are cleared.
nsIMsgDatabase
otherwise, we'll just delete them from the db.
nsIMsgFilterCustomAction
otherwise, be careful * that the action does correct notifications to maintain counts, and correct * manipulations of both imap and local non-database storage of message * metadata.
nsIMsgSearchSession
ignored unless attrib = attribotherheader.
nsINavHistoryQuery
otherwise, it will return anything whose host name ends in domain.
nsINavHistoryQueryResultNode
otherwise, this is set to -1.
nsINavHistoryResultTreeViewer
this is only valid when a tree is attached, the result will be 0 otherwise.
nsINetworkLinkService
for example, the link is down during dhcp configuration (unless there is another usable interface already configured).
nsIObserverService
otherwise an error will be returned.
Component; nsIPrefBranch
note: you must call removeobserver method on the same nsiprefbranch instance on which you called addobserver method in order to remove aobserver; otherwise, the observer will not be removed.
nsIPrefBranch2
note: you must call removeobserver method on the same nsiprefbranch2 instance on which you called addobserver() method in order to remove aobserver; otherwise, the observer will not be removed.
nsIPrefService
when using a get method a user set value will be returned if one exists, otherwise a default value will be returned.
nsIProcess
isrunning boolean true if the process is running, otherwise false.
nsIProcessScriptLoader
otherwise it will only be loaded into child processes that exist at the time of the call.
nsIProfile
useexistingdir if true, an existing directory may be used; otherwise, the profile directory will be unique.
nsIProfileLock
localdirectory nsilocalfile a directory corresponding to the main profile directory, which exists for the purpose of storing data on the local filesystem, including cache files or other data files that may not represent critical user data.
nsIProgressEventSink
note: this interface is actually not specific to channels and may be used with other implementations of nsirequest.
nsIScriptableUnescapeHTML
isxml set this to true if the fragment is an xml string; otherwise set it to false.
nsIScriptableUnicodeConverter
if the other apis you are reading data from or writing data to don't require you to use this legacy representation, you should use textdecoder and textencoder (available to chrome javascript via components.utils.importglobalproperties) instead of this api.
nsISearchEngine
return value returns true if the engine spec has a url with the given responsetype, false otherwise.
nsIServerSocket
otherwise, it will accept connections from any interface.
nsISessionStartup
return value true if the session should be restored, otherwise false.
nsISocketProvider
methods native code only!addtosocket this function is called to allow the socket provider to layer a prfiledesc (a file descriptor) on top of another prfiledesc.
nsIStreamListener
in other words, the sum of all previous count parameters.
nsITaskbarTabPreview
move() relocates the preview relative to another tab preview from the same window.
nsITextInputProcessorCallback
otherwise, false.
nsIThreadInternal
the observer will be released on the thread corresponding to this thread object after all other events have been processed during a call to shutdown.
nsIThreadPool
instead, you should call it from another thread (typically the one that created the thread pool).
nsITraceableChannel
1.0 66 introduced gecko 1.9.0.4 inherits from: nsisupports last changed in gecko 1.9.0.4 the typical way to use this interface is as follows: register for the "http-on-examine-response" notification to track all http responses; skip redirects (responsestatus = 3xx on nsihttpchannel), since otherwise you may end up with two listeners registered for a channel; qi the channel passed as the "subject" to your observer to nsitraceablechannel, and replace the default nsistreamlistener (that passes the data to the original requester - e.g.
nsIURIFixup
createfixupuri() converts the specified string into a uri, first attempting to correct any errors in the syntax or other vagaries.
nsIUTF8StringEnumerator
return value true if there are remaining strings in the enumerator, otherwise false.
nsIUpdateItem
internal code uses other constants in nsextensionmanager.js.in.
nsIUpdatePatch
false if another update is selected.
nsIVariant
return value if the conversion succeeds, ns_ok is returned, otherwise ns_error_cannot_convert_data is returned.
nsIWebBrowser
otherwise, the implementation should not refcount this interface; it should assume that a non null value is always valid.
nsIWebBrowserChrome3
otherwise returns originaltarget.
nsIWebContentHandlerRegistrar
otherwise ns_error_dom_syntax_err will be thrown.
nsIWebNavigation
for http and ftp urls and possibly others, characters above u+007f will be converted to utf-8 and then url- escaped per the rules of rfc 2396.
nsIWebProgress
these flags indicate the other events to observe, corresponding to the other four methods defined on nsiwebprogresslistener.
nsIWifiAccessPoint
note: this string consists of the bytes as received from the network and may contain nulls and other unprintable characters; if you need to display the ssid, use the ssid attribute instead.
nsIWinAppHelper
returns true only if all the following conditions are all true at once: the operating system is at least windows vista user account control is enabled the user is an administrator the application is not already running with elevated permissions otherwise it returns false.
nsIWinTaskbar
ids should be unique to the application and window to insure conflicts with other pinned applications do no arise.
nsIXSLTProcessor
returns null otherwise.
nsIZipEntry
isdirectory boolean true if the name of the entry ends with '/' and false otherwise.
NS_IF_ADDREF
only use this macro if the pointer might be null; use ns_addref otherwise.
NS_IF_RELEASE
this macro should only be used when the pointer might be null; otherwise, use ns_release.
XPCOM Interface Reference by grouping
this is the root element and may contain some functions defined in other groups.
NS_CStringContainerInit
otherwise, it returns an error code.
NS_CStringContainerInit2
otherwise, it returns an error code.
NS_CStringCutData
otherwise, it returns an error code.
NS_CStringGetMutableData
the returned pointer remains valid until the string object is passed to some other string function.
NS_CStringToUTF16
otherwise, it returns an error code.
NS_StringContainerInit
otherwise, it returns an error code.
NS_StringCutData
otherwise, it returns an error code.
NS_UTF16ToCString
otherwise, it returns an error code.
XPCOM reference
the contents herein are oriented primarily toward extension developers and people embedding xpcom in other projects.
Using nsCOMPtr
you'll have to turn to the xpcom newsgroup or another experienced nscomptr user, or find the answer by experimentation.
Using nsIClassInfo
nsiclassinfo is good for other things too, but they're dark xpcom magic.
XPCOM ABI
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.
nsCOMPtr versus RefPtr
for other cases, there is do_queryobject, which is essentially a more powerful form of do_queryinterface.
XPIDL Syntax
MozillaTechXPIDLSyntax
text inside raw code fragments are not otherwise parsed by xpidl directly.
Xray vision
because this code is being loaded from arbitrary web pages, it is regarded as untrusted and potentially hostile, both to other websites and to the user.
Mozilla technologies
not as just another document format.
Cached compose window FAQ
close the other compose window.
DB Views (message lists)
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.
Events
others are internal to gecko or other parts of mozilla application code.
Mail composition back end
this can be nsnull if you want to do the delivery operation "blind" sendmessagefile the sendmessagefile method will let the caller send a message that has been created by another process (note: createandsendmessage can accomplish this task).
Mail event system
nsimsgmailsession also contains a number of other methods that are completely unrealted to folder notification.
Mailnews and Mail code review requirements
unit tests must be included in patches and reviewed just like any other code.
Main Windows
as such, i've always thought it would be nice to have a list of what xul, js, or other files are that are here, what they do, and where they overlay at different points within the client.
Message Interfaces
nsimsgdbview nsimsgdbview - the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other xpcom based mail cients.
The libmime module
typedef struct foobarclass foobarclass; typedef struct foobar foobar; class declaration theis structure defines the callback routines and other per-class data of the class defined in this module.
Building a Thunderbird extension 3: install manifest
it should, however, be a unique value so that it does not conflict with other extensions.
Creating a Custom Column
to attach our column we add another treecol tag ("colreplyto") with the settings that we would like to use.
FAQ
(duplicate content has been removed from this page.) other resources can be found on the thunderbird extension development portal page.
Access Thunderbird Window Areas
var foldertree = getfoldertree(); var searchinput = getsearchinput(); var messagepane = getmessagepane(); var messagepaneframe = getmessagepaneframe(); var mailtoolbox = getmailtoolbox(); var currentmsgfolder = getloadedmsgfolder(); see the msgmail3panewindow.js for other helper methods ...
Use SQLite
ervice, adbfile) { var dbconnection = adbservice.opendatabase(adbfile); this._dbcreatetables(dbconnection); return dbconnection; }, _dbcreatetables: function(adbconnection) { for(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...
Folders and message lists
otherwise, use one of the methods described below.
Thunderbird
these pages document thunderbird and the mailnews backend which is also used in other projects such as seamonkey and postbox.
Using COM from js-ctypes
let atext = 'hello firefox!'; let aflags = spf_default; primative_hr = spvoice.speak(spvoiceptr, atext, aflags, 0); checkhresult(primative_hr, "cocreateinstance"); } catch (ex) { console.error('ex occured:', ex); } finally { if (spvoice) { spvoice.release(spvoiceptr); } couninitialize(); } } main(); lib.close(); other examples shgetpropertystoreforwindow - this examples shows that coinit is not needed, some winapi functions return the interface.
Type conversion
ct.v = { x: 10 }; // throws error mystruct.v = { x: 10, y: 20, z: 30 }; // throws error mystruct.v = { x: 10, z: 10 }; // throws error target type source converted value any struct types js object (only if the object has properties for all fields and no other properties) implicitly convert each enumerable property to corresponding field explicit convert in js-ctypes, data could be converted explicitly, when passing to cdata constructor: ctypes.int32_t("123"); // string "123" is parsed as 10-base string explicit convert tries implicit convert first, and if it fails, the following rules are applied: boolean type target type s...
Working with ArrayBuffers
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 because per pixel there is r, g, b, a numbers /** method a **/ for (var nindex = 0; nindex < casted.length; nindex = nindex + 4) { // casted.length is same as...
ABI
other all other operating systems use ctypes.default_abi as their calling convention for all function declarations.
ArrayType
for other function, pointer, and array types, this should be a valid c type expression.
CType
for other function, pointer, and array types, this should be a valid c type expression.
FunctionType
for other function, pointer, and array types, this should be a valid c type expression.
Library
alternative syntax another use for ctypes.declare is to get non-function/non-methods from libraries.
StructType
for other function, pointer, and array types, this should be a valid c type expression.
ctypes
types.unsigned_char}, {'breserved3': ctypes.unsigned_char}, {'breserved4': ctypes.unsigned_char}, {'breserved5': ctypes.unsigned_char}, {'breserved6': ctypes.unsigned_char}, {'dwdata': ctypes.uintptr_t}, {'istring': ctypes.intptr_t} ]); } else { throw new error("wut?!"); } console.log(struct_tbbutton.size); // 20 on 32-bit, 32 on 64-bit if i'm not mistaken there is another way to do this, we can use arraytype, but example for this i don't know at this time.
js-ctypes reference
other features error-handling js-ctypes supports both errno (on all platforms) and getlasterror (on windows platforms).
js-ctypes
other work made possible by js-ctypes is jni, this is elaborated on in the jni.jsm section and not the js-ctypes section due to the jsm abstracting away all of the js-ctypes.
Browser Side Plug-in API - Plugins
warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results.
Constants - Plugins
npres_network_err 1 stream failed due to problems with network, disk i/o, lack of memory, or other problems.
Memory - Plugins
npn_memfree does not free memory allocated by other means.
Gecko Plugin API Reference - Plugins
warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results.
Color vision simulation - Firefox Developer Tools
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.
Browser Console - Firefox Developer Tools
if you also want to use the other web developer tools in the regular web toolbox with add-on or browser code, consider using the browser toolbox.
Break on DOM mutation - Firefox Developer Tools
the panel on the right shows that execution is "paused on dom mutation" and you, as with any other breakpoint, you can see the call stack and view any watch expressions you may have set up.
Debug eval sources - Firefox Developer Tools
this source is then listed in the source list pane, and can be opened and debugged like any other source.
Set a breakpoint - Firefox Developer Tools
other context menu options worth mentioning are: disable breakpoint: turn it off, but don't remove it completely.
Use a source map - Firefox Developer Tools
the compiled source contains a comment like this, that points to a source map: //# sourcemappingurl=main.js.map in the debugger's source list pane, the original coffeescript source now appears as "main.coffee", and we can debug it just like any other source.
UI Tour - Firefox Developer Tools
ignore files outside this directory causes all files other than those within the selected directory to be skipped by the debugger.
Tutorial: Set a breakpoint - Firefox Developer Tools
save the following text to an html file: <div onclick="report('the best div');">click me!</div> <div onclick="report('another great div');">or me!</div> <script> function report(what) { console.log('clicked: ' + what); } </script> visit the html file in your browser, and open the browser content toolbox by opening the firefox menu, choosing “web developer”, and then “browser content toolbox”.
JSON viewer - Firefox Developer Tools
to enable this feature in other release channels, set the devtools.jsonview.enabled preference to true.
All keyboard shortcuts - Firefox Developer Tools
unlike the other toolbox-hosted tools, this shortcut does not also close the web console.
Memory - Firefox Developer Tools
the dominators view shows the "retained size" of objects: that is, the size of objects plus the size of other objects that they keep alive through references.
Page inspector 3-pane mode - Firefox Developer Tools
the other css related features — such as computed styles view, animations view, and fonts view — in tabs on the right hand side, as usual.
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
clicking the icon toggles the display of a grid overlay on the page, which appears over the element, laid out like a grid to show the position of its grid lines and tracks: the overlay is still shown when you select other elements, so you can edit related css properties and see how the grid is affected.
Select an element - Firefox Developer Tools
this lets you see the rules for the element in the css pane, but conveniently select another element in the page.
Page Inspector - Firefox Developer Tools
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.
UI Tour - Firefox Developer Tools
correlating events because these elements are synchronized, you can correlate events in one element with events in another.
Waterfall - Firefox Developer Tools
the markers, and their colors, are the same in the waterfall tool as in the waterfall overview, making is easy to correlate from one to the other.
Taking screenshots - Firefox Developer Tools
--file boolean when present, the screenshot will be saved to a file, even if other options (e.g.
Tips - Firefox Developer Tools
click on the filter icon () next to an overridden property to find which other property overrides it.
Validators - Firefox Developer Tools
applications and services devedge web tune-up wizard this interface to w3c services guides beginning-to-intermediate web authors through the process of updating content to support netscape 7.x, mozilla and other browsers that support w3c standards.
Web Audio Editor - Firefox Developer Tools
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 node inspector on the right hand side.
Web Console - Firefox Developer Tools
split console use the console alongside other tools.
AesGcmParams - Web APIs
put another way: never reuse an iv with the same key.
AnalyserNode.smoothingTimeConstant - Web APIs
it's basically an average between the current buffer and the last buffer the analysernode processed, and results in a much smoother set of value changes over time.
AnalyserNode - Web APIs
analysernode.smoothingtimeconstant is a double value representing the averaging constant with the last analysis frame — basically, it makes the transition between values over time smoother.
Animation() - Web APIs
although in the future other effects such as sequenceeffects or groupeffects might be possible, the only kind of effect currently available is keyframeeffect.
Animation.oncancel - Web APIs
the cancel event can be triggered manually with animation.cancel() when the animation enters the "idle" play state from another state, such as when the animation is removed from an element before it finishes playing creating a new animation that is initially idle does not trigger a cancel event on the new animation.
Animation.pending - Web APIs
WebAPIAnimationpending
syntax var pending = animation.pending; value true if the animation is pending, false otherwise.
Animation.persist() - Web APIs
WebAPIAnimationpersist
the persist() method of the web animations api's animation interface explicitly persists an animation, when it would otherwise be removed due to the browser's automatically removing filling animations behavior.
Animation.playbackRate - Web APIs
cake.addeventlistener("mousedown", growalice, false); cake.addeventlistener("touchstart", growalice, false); in another example, the red queen's race game, alice and the red queen are constantly slowing down: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.playbackrate *= .9; } }, 3000); but clicking or tapping on them causes them to speed up by multiplying their playbackrate: var gofaster = function() { red...
Animation - Web APIs
WebAPIAnimation
animation.persist() explicitly persists an animation, when it would otherwise be removed due to the browser's automatically removing filling animations behavior.
AnimationTimeline - Web APIs
anywhere you see animationtimeline, you should use documenttimeline or any other timeline type instead.
AudioBuffer() - Web APIs
exceptions notsupportederror one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range).
AudioBufferSourceNode.loop - Web APIs
syntax var loopingenabled = audiobuffersourcenode.loop; audiobuffersourcenode.loop = true | false; value a boolean which is true if looping is enabled; otherwise, the value is false.
AudioBufferSourceNode.playbackRate - Web APIs
when set to another value, the audiobuffersourcenode resamples the audio before sending it to the output.
AudioBufferSourceNode - Web APIs
indeed, you can use these nodes in a "fire and forget" manner: create the node, call start() to begin playing the sound, and don't even bother to hold a reference to it.
AudioContext.close() - Web APIs
this function does not automatically release all audiocontext-created objects, unless other references have been released as well; however, it will forcibly release any system audio resources that might prevent additional audiocontexts from being created and used, suspend the progression of audio time in the audio context, and stop processing audio data.
AudioContext.createMediaStreamDestination() - Web APIs
the createmediastreamdestination() method of the audiocontext interface is used to create a new mediastreamaudiodestinationnode object associated with a webrtc mediastream representing an audio stream, which may be stored in a local file or sent to another computer.
AudioListener.dopplerFactor - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.setPosition() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioListener.speedOfSound - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
AudioNode.disconnect() - Web APIs
if this value is an audionode, a single node is disconnected from, with any other, optional, parameters (output and/or input) further limiting which inputs and/or outputs should be disconnected.
AudioParam.cancelAndHoldAtTime() - Web APIs
the cancelandholdattime() property of the audioparam interface cancels all scheduled future changes to the audioparam but holds its value at a given time until further changes are made using other methods.
AudioScheduledSourceNode - Web APIs
unless stated otherwise, nodes based upon audioscheduledsourcenode output silence when not playing (that is, before start() is called and after stop() is called).
AudioTrack.language - Web APIs
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.
AudioTrack - Web APIs
this first example gets the first audio track on the media: var firsttrack = tracks[0]; the next example scans through all of the media's audio tracks, enabling any that are in the user's preferred language (taken from a variable userlanguage) and disabling any others.
AudioTrackList.getTrackById() - Web APIs
example this example suggests a hypothetical game in which movies are used as cut-scenes or other key set pieces within the game.
AudioWorklet - Web APIs
the worklet's code is run in the audioworkletglobalscope global execution context, using a separate web audio thread which is shared by the worklet and other audio nodes.
AudioWorkletGlobalScope - Web APIs
as the global execution context is shared across the current baseaudiocontext, it's possible to define any other variables and perform any actions allowed in worklets — apart from defining audioworkletprocessor-derived classes.
AudioWorkletNode.port - Web APIs
note: the port at the other end of the channel is available under the port property of the processor.
AudioWorkletProcessor.port - Web APIs
note: the port at the other end of the channel is available under the port property of the node.
AuthenticatorAssertionResponse.signature - Web APIs
examples var options = { challenge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var signature = assertionpkcred.response.signature; // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.error(err); }); specifications ...
AuthenticatorAttestationResponse.attestationObject - Web APIs
the webauthn specification defines a number of formats; however, formats may also be defined in other specifications and registered in an iana registry.
BaseAudioContext.createPanner() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
BaseAudioContext.createPeriodicWave() - Web APIs
the real and imag arrays have to have the same length, otherwise an error is thrown.
BaseAudioContext.createWaveShaper() - Web APIs
their s-shape, for instance, helps create a smoother sounding result.
BasicCardRequest - Web APIs
}); } catch (e) { // catch any other errors.
BasicCardResponse - Web APIs
}); } catch (e) { // catch any other errors.
BatteryManager.charging - Web APIs
otherwise, the value is false.
BeforeUnloadEvent - Web APIs
window.addeventlistener("beforeunload", function (e) { var confirmationmessage = "\o/"; (e || window.event).returnvalue = confirmationmessage; // gecko + ie return confirmationmessage; /* safari, chrome, and other * webkit-derived browsers */ }); specifications specification status comment html living standardthe definition of 'beforeunloadevent' in that specification.
Blob.stream() - Web APIs
WebAPIBlobstream
call the returned stream's pipethrough() method to pipe the stream through a transformstream or any other readable and writable pair.
Bluetooth.getAvailability() - Web APIs
for a returns a boolean which is true if the deveice has a bluetooth adapter and false otherwise (unless user configured user agent not to expose a real value).
BluetoothRemoteGATTCharacteristic.readValue() - Web APIs
otherwise it throws an error.
BluetoothRemoteGATTCharacteristic - Web APIs
otherwise it throws an error.
readValue() - Web APIs
otherwise it throws an error.
BluetoothRemoteGATTDescriptor - Web APIs
otherwise it throws an error.
Body.arrayBuffer() - Web APIs
WebAPIBodyarrayBuffer
ecodeaudiodata(buffer, function(decodeddata) { source.buffer = decodeddata; source.connect(audioctx.destination); }); }); }; // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } reading files the response() constructor accepts files and blobs, so it may be used to read a file into other formats.
BroadcastChannel.close() - Web APIs
this is a necessary step to perform as there is no other way for a browser to know that this channel is not needed anymore.
Broadcast Channel API - Web APIs
it can be used to detect user actions in other tabs within a same origin, like when the user logs in or out.
CSS.supports() - Web APIs
WebAPICSSsupports
return value true if the browser supports the rule, otherwise false.
CSSGroupingRule - Web APIs
an object implementing the cssgroupingrule interface represents any css at-rule that contains other rules nested within it.
CSSKeywordValue.CSSKeywordValue() - Web APIs
the csskeywordvalue constructor creates a new csskeywordvalue object which represents css keywords and other identifiers.
CSSKeywordValue - Web APIs
the csskeywordvalue interface of the the css typed object model api creates an object to represent css keywords and other identifiers.
CSSNumericValue.equals() - Web APIs
let cssmathsum = new cssmathsum(css.px(1), css.px(2)); let matchingcssmathsum = new cssmathsum(css.px(1), css.px(2)); // prints true console.log(cssmathsum.equals(matchingcssmathsum)); let othercssmathsum = cssmathsum(css.px(2), css.px(1)); // prints false console.log(cssmathsum.equals(othercssmathsum)); // also prints false console.log(css.cm("1").equal(css.in("0.393701"))); specifications specification status comment css typed om level 1the definition of 'equals' in that specification.
CSSNumericValue.to() - Web APIs
the to() method of the cssnumericvalue interface converts a numberic value from one unit to another.
CSSPrimitiveValue - Web APIs
(for example, a pixel value cannot be converted to a centimeter value.) percentage values can't be converted since they are relative to the parent value (or another property value).
CSSPseudoElement.element - Web APIs
the element read-only property of the csspseudoelement interface returns a reference to the originating element of the pseudo-element, in other words its parent element.
CSSRule.cssText - Web APIs
WebAPICSSRulecssText
in other words, attempting to set it does absolutely nothing, and doesn't even omit a warning or error.
CSSRule - Web APIs
WebAPICSSRule
cssrule.parentrule read only returns the containing rule, otherwise null.
CSS Font Loading API - Web APIs
fontfacesource a mixin providing all of the fonts used in font-related operations, unless defined otherwise.
CSS Object Model (CSSOM) - Web APIs
cssnamespacerule csspagerule cssrule cssrulelist cssstyledeclaration cssstylesheet cssstylerule csssupportsrule cssvariablesmap cssviewportrule elementcssinlinestyle fontface fontfaceset fontfacesetloadevent geometryutils getstyleutils linkstyle medialist mediaquerylist mediaquerylistevent mediaquerylistlistener screen stylesheet stylesheetlist transitionevent several other interfaces are also extended by the cssom-related specifications: document, window, element, htmlelement, htmlimageelement, range, mouseevent, and svgelement.
Using the CSS properties and values API - Web APIs
with an unregisterd property, the browser likewise doesn't know what the value may be until it's calculated, and because of that, it can't set up a transition from one value to another.
Cache.keys() - Web APIs
WebAPICachekeys
in other words, if the url matches you will get a match regardless of whether the response object has a vary header.
Cache.match() - Web APIs
WebAPICachematch
if there are any other fetch handlers registered, they will get a chance to call event.respondwith().
CacheStorage.delete() - Web APIs
return value a promise that resolves to true if the cache object is found and deleted, and false otherwise.
CacheStorage.match() - Web APIs
in other words, if the url matches you will get a match regardless of whether the response object has a vary header or not.
CacheStorage - Web APIs
the interface: provides a master directory of all the named caches that can be accessed by a serviceworker or other type of worker or window scope (you’re not limited to only using it with service workers, even though the service workers spec defines it).
CanvasImageSource - Web APIs
canvasimagesource provides a mechanism for other interfaces to be used as image sources for some methods of the canvasdrawimage and canvasfillstrokestyles interfaces.
CanvasRenderingContext2D.fillRect() - Web APIs
this is often useful for creating a background, on top of which other things may then be drawn.
CanvasRenderingContext2D.filter - Web APIs
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.
CanvasRenderingContext2D.getImageData() - Web APIs
securityerror the canvas contains or may contain pixels which were loaded from an origin other than the one from which the document itself was loaded.
CanvasRenderingContext2D.globalAlpha - Web APIs
vas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.globalalpha = 0.5; ctx.fillstyle = 'blue'; ctx.fillrect(10, 10, 100, 100); ctx.fillstyle = 'red'; ctx.fillrect(50, 50, 100, 100); result overlaying transparent shapes this example illustrates the effect of overlaying multiple transparent shapes on top of each other.
CanvasRenderingContext2D.imageSmoothingEnabled - Web APIs
this property is useful for games and other apps that use pixel art.
CanvasRenderingContext2D.lineTo() - Web APIs
like other methods that modify the current path, this method does not directly render anything.
CanvasRenderingContext2D.rect() - Web APIs
like other methods that modify the current path, this method does not directly render anything.
CanvasRenderingContext2D.stroke() - Web APIs
strokes are aligned to the center of a path; in other words, half of the stroke is drawn on the inner side, and half on the outer side.
CanvasRenderingContext2D.strokeRect() - Web APIs
the canvasrenderingcontext2d.strokerect() method of the canvas 2d api draws a rectangle that is stroked (outlined) according to the current strokestyle and other context settings.
CanvasRenderingContext2D.textBaseline - Web APIs
(used by tibetan and other indic scripts.) "middle" the text baseline is the middle of the em square.
CanvasRenderingContext2D - Web APIs
it is used for drawing shapes, text, images, and other objects.
Compositing example - Web APIs
pure black or white does not result in pure black or white.', 'subtracts the bottom layer from the top layer or the other way round to always get a positive value.', 'like difference, but with lower contrast.', 'preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.', 'preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.', 'preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.', 'preserves the hue and ch...
Drawing text - Web APIs
function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); var text = ctx.measuretext('foo'); // textmetrics object text.width; // 16; } gecko-specific notes in gecko (the rendering engine of firefox, firefox os and other mozilla based applications), some prefixed apis were implemented in earlier versions to draw text on a canvas.
Finale - Web APIs
WebAPICanvas APITutorialFinale
other web apis these apis might be useful when working further with canvas and graphics: webgl advanced api for rendering complex graphics, including 3d.
Hit regions and accessibility - Web APIs
the hit region api allows you to define an area of your canvas and provides another possibility to expose interactive content on a canvas to accessibility tools.
Optimizing canvas - Web APIs
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.
Transformations - Web APIs
saving and restoring state before we look at the transformation methods, let's look at two other methods which are indispensable once you start generating ever more complex drawings.
CharacterData - Web APIs
this is an abstract interface, meaning there aren't any object of type characterdata: it is implemented by other interfaces, like text, comment, or processinginstruction which aren't abstract.
ChildNode.after() - Web APIs
WebAPIChildNodeafter
argitem : document.createtextnode(string(argitem))); }); this.parentnode.insertbefore(docfrag, this.nextsibling); } }); }); })([element.prototype, characterdata.prototype, documenttype.prototype]); another polyfill // from: https://github.com/fabiovergani/js-polyfill_element.prototype.after/blob/master/after.js (function(x){ var o=x.prototype,p='after'; if(!o[p]){ o[p]=function(){ var e, m=arguments, l=m.length, i=0, t=this, p=t.parentnode, n=node, s=string, d=document; if(p!==null){ while(i<l){ e=m[i]; if(e instanceof n){ t=t.nextsibling; ...
Clients.matchAll() - Web APIs
WebAPIClientsmatchAll
otherwise, it returns only the service worker clients controlled by the current service worker.
Clipboard.read() - Web APIs
WebAPIClipboardread
otherwise, an image element referred to using the variable imgelem has its source replaced with the clipboard's contents.
Clipboard - Web APIs
WebAPIClipboard
for example, firefox does not yet support the "clipboard-read" and "clipboard-write" permissions, so access to the methods that access and change the contents of the clipboard are restricted in other ways.
Console.dir() - Web APIs
WebAPIConsoledir
in other words, console.dir() is the way to see all the properties of a specified javascript object in console by which the developer can easily get the properties of the object.
Console.table() - Web APIs
WebAPIConsoletable
// an object whose properties are objects var family = {}; family.mother = new person("jane", "smith"); family.father = new person("john", "smith"); family.daughter = new person("emily", "smith"); console.table(family); restricting the columns displayed by default, console.table() lists all elements in each row.
Console.timeEnd() - Web APIs
WebAPIConsoletimeEnd
examples console.time("answer time"); alert("click to continue"); console.timelog("answer time"); alert("do a bunch of other stuff..."); console.timeend("answer time"); the output from the example above shows the time taken by the user to dismiss the first alert box, followed by the time it took for the user to dismiss the second alert: notice that the timer's name is displayed when the timer value is logged using timelog() and again when it's stopped.
Console.timeLog() - Web APIs
WebAPIConsoletimeLog
examples console.time("answer time"); alert("click to continue"); console.timelog("answer time"); alert("do a bunch of other stuff..."); console.timeend("answer time"); the output from the example above shows the time taken by the user to dismiss the first alert box, followed by the time it took for the user to dismiss the second alert: notice that the timer's name is displayed when the timer value is logged using timelog() and again when it's stopped.
Console.timeStamp() - Web APIs
WebAPIConsoletimeStamp
this lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events.
ConstantSourceNode - Web APIs
in addition, it can be used like a constructible audioparam by automating the value of its offset or by connecting another node to it; see controlling multiple parameters with constantsourcenode.
ConstrainDouble - Web APIs
additionally, you can specify the property's value as a simple floating-point value, in which case the user agent does its best to match the value once all other more stringent constraints are met.
ConstrainULong - Web APIs
in addition, you can specify the value as a simple long integer value, in which case the user agent does its best to match the value once all other more stringent constraints are met.
ContentIndexEvent() - Web APIs
the contentindexevent() constructor creates a new contentindexevent object whose type and other options are configured as specified.
ContentIndexEvent - Web APIs
constructor contentindexevent() creates and returns a new contentindexevent object whose type and other options are configured as specified.
ConvolverNode - Web APIs
let reverb = await createreverb(); // someotheraudionode -> reverb -> destination someotheraudionode.connect(reverb); reverb.connect(audioctx.destination); specifications specification status comment web audio apithe definition of 'convolvernode' in that specification.
CrashReportBody - Web APIs
if you want to receive other kinds of reports, but not crash reports, make sure to use a different name for the endpoint group that you choose for those reports.
Crypto.getRandomValues() - Web APIs
user agents are instead urged to provide the best entropy they can when generating random numbers, using a well-defined, efficient pseudorandom number generator built into the user agent itself, but seeded with values taken from an external source of pseudorandom numbers, such as a platform-specific random number function, the unix /dev/urandom device, or other source of random or pseudorandom data.
CustomElementRegistry.define() - Web APIs
exceptions exception description notsupportederror the customelementregistry already contains an entry with the same name or the same constructor (or is otherwise already defined), or extends is specified and it is a valid custom element name, or extends is specified but the element it is trying to extend is an unknown element.
CustomEvent() - Web APIs
return value a new customevent object of the specified type, with any other properties configured according to the customeventinit dictionary (if one was provided).
DOMError - Web APIs
WebAPIDOMError
urlmismatcherror the given url does not match another url.
DOMException - Web APIs
(legacy code value: 20 and legacy constant name: abort_err) urlmismatcherror the given url does not match another url.
DOMHighResTimeStamp - Web APIs
in all other cases, the time origin is undefined.
DOMMatrixReadOnly.translate() - Web APIs
if this is anything other than 0, the resulting matrix will be 3d.
DOMPoint - Web APIs
WebAPIDOMPoint
in general, a positive x component represents a position to the right of the origin, a positive y component is downward from the origin, and a positive z component extends outward from the screen (in other words, toward the user).
DOMPointReadOnly - Web APIs
first, you can use its constructor, passing in the values of the parameters for each dimension and, optionally, the perspective: /* 2d */ const point = new dompointreadonly(50, 50); /* 3d */ const point = new dompointreadonly(50, 50, 25); /* 3d with perspective */ const point = new dompointreadonly(100, 100, 100, 1.0); the other option is to use the static dompointreadonly.frompoint() method: const point = dompointreadonly.frompoint({x: 100, y: 100, z: 50; w: 1.0}); constructor dompointreadonly() creates a new dompointreadonly object given the values of its coordinates and perspective.
DOMTokenList - Web APIs
domtokenlist.contains(token) returns true if the list contains the given token, otherwise false.
DOMUserData - Web APIs
note that although it can be an object, in mozilla, it may be returned as a string or other type, if it was set as such a type (e.g., node.setuserdata() and node.getuserdata()).
DataTransfer.getData() - Web APIs
html content <div id="div1" ondrop="drop(event)" ondragover="allowdrop(event)"> <span id="drag" draggable="true" ondragstart="drag(event)">drag me to the other box</span> </div> <div id="div2" ondrop="drop(event)" ondragover="allowdrop(event)"></div> css content #div1, #div2 { width:100px; height:50px; padding:10px; border:1px solid #aaaaaa; } javascript content function allowdrop(allowdropevent) { allowdropevent.target.style.color = 'blue'; allowdropevent.preventdefault(); } function drag(dragevent) { dragevent.datatr...
DataTransfer.mozCursor - Web APIs
note: if any value other than default is set, auto is assumed.
DataTransfer - Web APIs
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.
DataTransferItem.getAsFile() - Web APIs
return value file if the drag data item is a file, a file object is returned; otherwise null is returned.
DataTransferItemList.DataTransferItem() - Web APIs
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>...
DataTransferItemList.add() - Web APIs
; 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>...
DataTransferItemList.clear() - Web APIs
; } #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>...
DataTransferItemList.length - Web APIs
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>...
DataTransferItemList.remove() - Web APIs
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>...
DedicatedWorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
Device Memory API - Web APIs
traditionally, developrs had to use heruistics and either benchmark the device or infer the device capabilities based on other factors like device manufacturer or user agent strings.
DisplayMediaStreamConstraints.video - Web APIs
these may include backing buffers for windows to allow capture of window contents that are hidden by other windows in front of them, or buffers containing larger documents that need to be scrolled through to see the entire contents in their windows.
Document.alinkColor - Web APIs
another alternative is document.body.alink, although this is deprecated in html 4.01 in favor of the css alternative.
Document.all - Web APIs
WebAPIDocumentall
in other words, it returns all of the document's elements, accessible by order (like an array) and by id (like a regular object).
Document: animationcancel event - Web APIs
in other words, any time it stops running without sending an animationend event.
Document: animationiteration event - Web APIs
the animationiteration event is fired when an iteration of a css animation ends, and another one begins.
Document.bgColor - Web APIs
WebAPIDocumentbgColor
another alternative is document.body.bgcolor, although this is also deprecated in html 4.01 in favor of the css alternative.
Document.contentType - Web APIs
this may come from http headers or other sources of mime information, and might be affected by automatic type conversions performed by either the browser or extensions.
Document.createEvent() - Web APIs
elem.addeventlistener('build', function (e) { // e.target matches elem }, false); // target can be any element or other eventtarget.
Document.createExpression() - Web APIs
firefox 3 note prior to firefox 3, you could call this method on documents other than the one you planned to run the xpath against.
Document.createNodeIterator() - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
Document.createProcessingInstruction() - Web APIs
exceptions dom_invalid_character throws if either of the following are true: the processing instruction target is invalid — it should be a valid xml name that doesn't contain "xml", "xml", or any case combination of the two, other than standardized ones such as <?xml-stylesheet ?>.
Document.createTreeWalker() - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
Document.documentURIObject - Web APIs
for web content this property doesn't have any special meaning and can be used just like any other custom property.
Document.fgColor - Web APIs
WebAPIDocumentfgColor
another alternative is document.body.text, although this is deprecated in html 4.01 in favor of the css alternative above.
Document.getElementsByTagNameNS() - Web APIs
/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 through all its children, identifying all @xmlns instances, etc.) would be necessary to find all tags with the desired local name and namespace, but xpath is much faster.
Document.implementation - Web APIs
if available, other domimplementation methods provide services for controlling things outside of a single document.
Document.importNode() - Web APIs
the document object's importnode() method creates a copy of a node or documentfragment from another document, to be inserted into the current document later.
Document: keypress event - Web APIs
interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key.
Document.linkColor - Web APIs
another alternative is document.body.link, although this is deprecated in html 4.01.
Document.location - Web APIs
WebAPIDocumentlocation
the document.location read-only property returns a location object, which contains information about the url of the document and provides methods for changing that url and loading another url.
Document.mozSyntheticDocument - Web APIs
syntax var issynthetic = document.mozsyntheticdocument; on return, issynthetic is true if the document is a synthetic one; otherwise it's false.
Document.onfullscreenchange - Web APIs
otherwise, the specified element is about to take over the screen.
Document.open() - Web APIs
WebAPIDocumentopen
this is no longer the case.document non-spec'ed parameters to document.open gecko-specific notes starting with gecko 1.9, this method is subject to the same same-origin policy as other properties, and does not work if doing so would change the document's origin.
Document.querySelector() - Web APIs
as the backslash is also an escape character in javascript, if you are entering a literal string, you must escape it twice (once for the javascript string, and another time for queryselector()): <div id="foo\bar"></div> <div id="foo:bar"></div> <script> console.log('#foo\bar'); // "#fooar" (\b is the backspace control character) document.queryselector('#foo\bar'); // does not match anything console.log('#foo\\bar'); // "#foo\bar" console.log('#foo\\\\bar'); // "#foo\\bar" document.queryselector('#foo\\\\bar'...
Document.querySelectorAll() - Web APIs
otherwise, you can simply use standard array notation to access the contents of the list.
Document.rootElement - Web APIs
document.rootelement returns the element that is the root element of the document if it is an <svg> element, otherwise null.
Document.scrollingElement - Web APIs
when in quirks mode, the scrollingelement attribute returns the html body element if it exists and is not potentially scrollable, otherwise it returns null.
Document.selectedStyleSheetSet - Web APIs
example console.log('current style sheet set: ' + document.selectedstylesheetset); document.selectedstylesheetset = 'some other style sheet'; ...
Document.visibilityState - Web APIs
the document may start in this state, but will never transition to it from another value.
Document.vlinkColor - Web APIs
another alternative is document.body.vlink, although this is deprecated in html 4.01 in favor of the css alternative.
Document: wheel event - Web APIs
examples scaling an element via the wheel this example shows how to scale an element using the mouse (or other pointing device) wheel.
DocumentOrShadowRoot.activeElement - Web APIs
other times the focused element might be a <select> element (menu) or an <input> element, of type "button", "checkbox", or "radio".
DocumentOrShadowRoot.getSelection() - Web APIs
this can make the object appear to be a string when used with other functions when it is really an object with properties and methods.
DocumentOrShadowRoot.pointerLockElement - Web APIs
it is null if lock is pending, pointer is unlocked, or the target is in another document.
DocumentOrShadowRoot - Web APIs
it returns null if lock is pending, the pointer is unlocked, or if the target is in another document.
How to create a DOM tree - Web APIs
another application is that, since xul is xml, the ui of your application can be dynamically manipulated, downloaded, uploaded, saved, loaded, converted, or transformed quite easily.
Locating DOM elements using selectors - Web APIs
this is different from other dom querying methods that return live node lists.
Document Object Model (DOM) - Web APIs
transformlist animated type svganimatedangle svganimatedboolean svganimatedenumeration svganimatedinteger svganimatedlength svganimatedlengthlist svganimatednumber svganimatednumberlist svganimatedpathdata svganimatedpoints svganimatedpreserveaspectratio svganimatedrect svganimatedstring svganimatedtransformlist smil-related interfaces elementtimecontrol timeevent other svg interfaces getsvgdocument shadowanimation svgcolorprofilerule svgcssrule svgdocument svgexception svgexternalresourcesrequired svgfittoviewbox svglangspace svglocatable svgrenderingintent svgstylable svgtests svgtransformable svgunittypes svguseelementshadowroot svgurireference svgviewspec svgzoomandpan svgzoomevent specifications spec...
DragEvent - Web APIs
WebAPIDragEvent
the user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another dom element).
EXT_disjoint_timer_query - Web APIs
in webgl 2, other queries (such as occlusion queries and primitive queries) are possible using webglquery objects.
EffectTiming.endDelay - Web APIs
this is useful for sequencing animations based on the end time of another animation; note, however, that many of the sequence effectst that will benefit most from this property have not been defined in the specification yet.
EffectTiming - Web APIs
this is primarily of use when sequencing animations based on the end time of another animation.
Element.accessKey - Web APIs
WebAPIElementaccessKey
to work around this, browsers implement accesskey behavior if the keys are pressed with other "qualifying" keys (such as alt + accesskey).
Element.classList - Web APIs
WebAPIElementclassList
examples const div = document.createelement('div'); div.classname = 'foo'; // our starting state: <div class="foo"></div> console.log(div.outerhtml); // use the classlist api to remove and add classes div.classlist.remove("foo"); div.classlist.add("anotherclass"); // <div class="anotherclass"></div> console.log(div.outerhtml); // if visible is set remove it, otherwise add it div.classlist.toggle("visible"); // add/remove visible, depending on test conditional, i less than 10 div.classlist.toggle("visible", i < 10 ); console.log(div.classlist.contains("foo")); // add or remove multiple classes div.classlist.add("foo", "bar", "baz"); div.classli...
Element.clientHeight - Web APIs
the element.clientheight read-only property is zero for elements with no css or inline layout boxes; otherwise, it's the inner height of an element in pixels.
Element.clientWidth - Web APIs
the element.clientwidth property is zero for inline elements and elements with no css; otherwise, it's the inner width of an element in pixels.
Element.computedStyleMap() - Web APIs
in other browsers you'll just see a link.
Element: error event - Web APIs
bubbles no cancelable no interface event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise.
Element: fullscreenchange event - Web APIs
on the other hand, if document.fullscreenelement is null, full-screen mode has been canceled.
Element.getAttribute() - Web APIs
the old dom 3 core specification, on the other hand, says that the correct return value in this case is actually the empty string, and some dom implementations implement this behavior.
Element.id - Web APIs
WebAPIElementid
another common case is to use an element's id as a selector when styling the document with css.
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
for all other elements, the element's contents are replaced with the nodes in the new documentfragment.
Element: keypress event - Web APIs
interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key after focussing the <input> element.
Element.matches() - Web APIs
WebAPIElementmatches
the matches() method checks to see if the element would be selected by the provided selectorstring -- in other words -- checks if the element "is" the selector.
Element.name - Web APIs
WebAPIElementname
note: the name property doesn't exist for other elements; unlike tagname and nodename, it is not a property of the node, element or htmlelement interfaces.
Element.querySelector() - Web APIs
the entire hierarchy of elements is considered when matching, including those outside the set of elements including baseelement and its descendants; in other words, selectors is first applied to the whole document, not the baseelement, to generate an initial list of potential elements.
Element.querySelectorAll() - Web APIs
otherwise, you can simply use standard array notation to access the contents of the list.
Element.scrollIntoView() - Web APIs
example var element = document.getelementbyid("box"); element.scrollintoview(); element.scrollintoview(false); element.scrollintoview({block: "end"}); element.scrollintoview({behavior: "smooth", block: "end", inline: "nearest"}); notes the element may not be scrolled completely to the top or bottom depending on the layout of other elements.
Element.scrollWidth - Web APIs
hidden; white-space: nowrap; text-overflow: ellipsis; } #adiv { width: 100px; } button { margin-bottom: 2em; } </style> </head> <body> <div id="adiv"> foobar-foobar-foobar-foobar </div> <button id="abutton"> check for overflow </button> <div id="anotherdiv"> foobar-foobar-foobar-foobar </div> <button id="anotherbutton"> check for overflow </button> </body> <script> var buttonone = document.getelementbyid('abutton'), buttontwo = document.getelementbyid('anotherbutton'), divone = document.getelementbyid('adiv'), divtwo = document.getelementbyid('anotherdiv'); //check to determine if an overflow is h...
Element: select event - Web APIs
bubbles yes cancelable no interface uievent if generated from a user interface, event otherwise event handler property onselect the event is not available for all elements in all languages.
Element.setAttribute() - Web APIs
if the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.
Element.setAttributeNode() - Web APIs
example this example copies the align attribute from one element to another.
Element.setAttributeNodeNS() - Web APIs
note that if you try to set without cloning the node, mozilla gives an ns_error_dom_inuse_attribute_err "attribute already in use" error, as the dom requires cloning for attr to be reused (unlike other nodes which can be moved).
Element.setCapture() - Web APIs
"position: " + e.clientx + ", " + e.clienty; } </script> </head> <body onload="init()"> <p>this is an example of how to use mouse capture on elements in gecko 2.0.</p> <p><a id="mybutton" href="#">test me</a></p> <div id="output">no events yet</div> </body> </html> view live examples notes the element may not be scrolled completely to the top or bottom, depending on the layout of other elements.
Element.setPointerCapture() - Web APIs
this has the effect of suppressing these events on all other elements.
Element.tagName - Web APIs
WebAPIElementtagName
example html <span id="born">when i was born...</span> javascript var span = document.getelementbyid("born"); console.log(span.tagname); in xhtml (or any other xml format), the original case will be maintained, so "span" would be output in case the original tag name was created lowercase.
Element.toggleAttribute() - Web APIs
return value true if attribute name is eventually present, and false otherwise.
Element: wheel event - Web APIs
examples scaling an element via the wheel this example shows how to scale an element using the mouse (or other pointing device) wheel.
Element - Web APIs
WebAPIElement
mouse events auxclick fired when a non-primary pointing device button (e.g., any mouse button other than the left button) has been pressed and released on an element.
ElementTraversal - Web APIs
the elementtraversal interface used to define methods that allowed access from one node to another in the document tree.
Event.cancelable - Web APIs
WebAPIEventcancelable
custom events created by other javascript code control if they can be canceled when they are created.
Event.composed - Web APIs
WebAPIEventcomposed
most other types of events are not composed, and so will return false.
Event.explicitOriginalTarget - Web APIs
(mozilla-specific) if the event was retargeted for some reason other than an anonymous boundary crossing, this will be set to the target before the retargeting occurs.
Event.msConvertURL() - Web APIs
the msconverturl method instructs the html paste operation on how to modify the src attribute that corresponds to each file in the clipboarddata.files collection, allowing otherwise inaccessible files to be converted to blob or data uris.
Event.stopImmediatePropagation() - Web APIs
the stopimmediatepropagation() method of the event interface prevents other listeners of the same event from being called.
EventTarget.dispatchEvent() - Web APIs
otherwise it returns true.
ExtendableEvent.waitUntil() - Web APIs
this gives the service worker time to update database schemas and delete outdated caches, so other events can rely on a completely upgraded state.
ExtendableEvent - Web APIs
it is not available when it is a window, or the scope of another kind of worker.
ExtendableMessageEvent - Web APIs
the extendablemessageevent interface of the service worker api represents the event object of a message event fired on a service worker (when a message is received on the serviceworkerglobalscope from another context) — extends the lifetime of such events.
FetchEvent.isReload - Web APIs
the isreload read-only property of the fetchevent interface returns true if the event was dispatched by the user attempting to reload the page, and false otherwise.
FetchEvent.replacesClientId - Web APIs
it can be an empty string when navigating from about:blank to another page, as about:blank's client will be reused, rather than be replaced.
FetchEvent.request - Web APIs
this property is non-nullable (since version 46, in the case of firefox.) if a request is not provided by some other means, the constructor init object must contain a request (see fetchevent.fetchevent().) syntax var recentrequest = fetchevent.request; value a request object.
Fetch basic concepts - Web APIs
because the main components of http are abstracted as javascript objects, it is easy for other apis to make use of such functionality.
Cross-global fetch usage - Web APIs
this article explains an edge case that occurs with fetch (and potentially other apis exhibiting the same kind of resource retrieval behavior).
FileSystemEntry.isDirectory - Web APIs
there are other types of file descriptors on many operating systems.
FileSystemEntry.isFile - Web APIs
there are other types of file descriptors on many operating systems.
FileSystemEntry.remove() - Web APIs
fileerror.security_err the entry couldn't be removed due to permissions or other access constraints, or because there are too many calls being made on file resources.
FileSystemEntrySync - Web APIs
various browsers implement pieces of the file and directory entries api (otherwise known as the file system api) but you should try to avoid using it.
FileHandle API - Web APIs
this is not a problem because to access the file, a lockedfile object is required and operations on such object are performed in isolation, meaning that once a lockedfile is active, all operations of this lockedfile are guaranteed to happen sequentially on the underlying file without being interleaved with operations from other lockedfile.
FocusEvent() - Web APIs
when the event has both a source and a destination, the relatedtarget value must be set to the other target.
Using FormData Objects - Web APIs
console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr let request = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }); note: the formdata event and formdataevent object are available in chrome from version 77 (and other equivalent chromiums), and firefox 72 (first available behind the dom.formdata.event.enabled pref in firefox 71).
FullscreenOptions.navigationUI - Web APIs
"show" the browser will present page navigation controls and possibly other user interface; the dimensions of the element (and the perceived size of the screen) will be clamped to leave room for this user interface.
Gamepad.hand - Web APIs
WebAPIGamepadhand
empty string ("") — this value is returned if the other values are not applicable, e.g.
Gamepad - Web APIs
WebAPIGamepad
the gamepad interface of the gamepad api defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.
GamepadButton - Web APIs
the gamepadbutton interface defines an individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device.
Using the Geolocation API - Web APIs
hence many geolocation success callbacks look fairly simple: function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; // do something with your latitude and longitude } you can however get a number of other bits of information from a geolocationcoordinates object, including altitude, speed, what direction the device is facing, and an accuracy measure of the altitude, longitude, and latitude data.
GlobalEventHandlers.onanimationcancel - Web APIs
all we do here is log information to the console, but you might find other use cases, such as starting a new animation or effect, or terminating some dependent operation.
GlobalEventHandlers.onanimationiteration - Web APIs
much of this code is the same as in other examples of animation events, so it may look familiar.
GlobalEventHandlers.onload - Web APIs
there are also dom events like domcontentloaded and domframecontentloaded (which can be handled using eventtarget.addeventlistener()) which are fired after the dom for the page has been constructed, but do not wait for other resources to finish loading.
GlobalEventHandlers.ontransitioncancel - Web APIs
this could also be used to trigger animations or other effects, to allow chaining of reactions.
HTMLAnchorElement.relList - Web APIs
the property itself is read-only, meaning you can't substitute the domtokenlist with another one, but its contents can still be changed.
HTMLAreaElement.relList - Web APIs
the property itself is read-only, meaning you can't substitute the domtokenlist by another one, but the content of the returned list can be changed.
Audio() - Web APIs
usage notes you can also use other element-creation methods, such as the document object's createelement() method, to construct a new htmlaudioelement.
HTMLCanvasElement.captureStream() - Web APIs
send it to another computer using an rtcpeerconnection // pc is an rtcpeerconnection created elsewhere pc.addstream(stream); specifications specification status comment media capture from dom elementsthe definition of 'htmlcanvaselement.capturestream()' in that specification.
HTMLCanvasElement.height - Web APIs
this is one of the two properties, the other being htmlcanvaselement.width, that controls the size of the canvas.
HTMLCanvasElement.mozGetAsFile() - Web APIs
for other options, see our image file type and format guide.
HTMLCanvasElement.toBlob() - Web APIs
other arguments are ignored.
HTMLCanvasElement.width - Web APIs
this is one of the two properties, the other being htmlcanvaselement.height, that controls the size of the canvas.
HTMLDialogElement.showModal() - Web APIs
the showmodal() method of the htmldialogelement interface displays the dialog as a modal, over the top of any other dialogs that might be present.
HTMLDialogElement - Web APIs
htmldialogelement.showmodal() displays the dialog as a modal, over the top of any other dialogs that might be present.
accessKeyLabel - Web APIs
the htmlelement.accesskeylabel read-only property returns a string that represents the element's assigned access key (if any); otherwise it returns an empty string.
HTMLElement: animationcancel event - Web APIs
in other words, any time it stops running without sending an animationend event.
HTMLElement: animationiteration event - Web APIs
the animationiteration event is fired when an iteration of a css animation ends, and another one begins.
HTMLElement.isContentEditable - Web APIs
the htmlelement.iscontenteditable read-only property returns a boolean that is true if the contents of the element are editable; otherwise it returns false.
HTMLElement.lang - Web APIs
WebAPIHTMLElementlang
example // this snippet compares the base language and // redirects to another url based on language if (document.documentelement.lang === "en") { window.location.href = "some_document.html.en"; } else if (document.documentelement.lang === "ru") { window.location.href = "some_document.html.ru"; } specification specification status comment document object model (dom) level 2 html specificationthe definition of 'lang' in that specification.
HTMLElement.offsetHeight - Web APIs
floated elements extending below other linear content are ignored.
HTMLFormElement.elements - Web APIs
the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
HTMLFormElement.length - Web APIs
the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
HTMLFormElement.reset() - Web APIs
it does not reset other attributes in the input, such as disabled.
HTMLIFrameElement.referrerPolicy - Web APIs
origin-when-cross-origin send a full url when performing a same-origin request, but only send the origin of the document for other cases.
HTMLImageElement.isMap - Web APIs
syntax htmlimageelement.ismap = true|false; let ismap = htmlimageelement.ismap; value a boolean value which is true if the image is being used for a server-side image map; otherwise, the value is false.
HTMLImageElement.loading - Web APIs
in other words, these images aren't loaded immediately when processing the <img> element, but are still loaded as part of the initial page load.
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.
HTMLImageElement.naturalHeight - Web APIs
example this example simply displays both the natural, density-adjusted size of an image as well as its rendered size as altered by the page's css and other factors.
HTMLImageElement.naturalWidth - Web APIs
example this example simply displays both the natural, density-adjusted size of an image as well as its rendered size as altered by the page's css and other factors.
HTMLImageElement.src - Web APIs
additionally, if you use src along with both sizes (or the corresponding sizes content attribute) and srcset in order to choose an image based on the viewport size, the src attribute is only used as a fallback for browsers that don't support sizes and srcset; otherwise, it's not used at all.
HTMLImageElement.useMap - Web APIs
in other words, this string should be the value of the appropriate <map>'s name attribute with a pound or hash symbol prepended to it.
HTMLImageElement - Web APIs
htmlimageelement.naturalwidth read only an integer value representing the intrinsic width of the image in css pixels, if it is available; otherwise, it will show 0.
HTMLInputElement.mozGetFileNameArray() - Web APIs
note: this method is gecko-specific and is not available in other browsers.
HTMLInputElement.mozSetFileNameArray() - Web APIs
note: this method is gecko-specific and is not available in other browsers.
HTMLInputElement.stepDown() - Web APIs
any other value is a multiplier of the step attribute value, which in this case is 5.
HTMLInputElement.stepUp() - Web APIs
any other value is a multiplier of the step attribute value, which in this case is 5.
HTMLLabelElement - Web APIs
in other words, this is just a shortcut for htmllabelelement.control.form.
HTMLLegendElement - Web APIs
otherwise, it returns null.
HTMLLinkElement.relList - Web APIs
the property itself is read-only, meaning you can substitute the domtokenlist by another one, but the content of the returned list can be changed.
HTMLMapElement - Web APIs
htmlmapelement.name is a domstring representing the <map> element for referencing it other context.
HTMLMediaElement.currentSrc - Web APIs
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.
HTMLMediaElement.currentTime - Web APIs
example var video = document.createelement('video'); console.log(video.currenttime); usage notes reduced time precision to offer protection against timing attacks and fingerprinting, browsers may round or otherwise adjust the value returned by currenttime.
HTMLMediaElement.play() - Web APIs
other exceptions may be reported, depending on browser implementation details, media player implementation, and so forth.
HTMLMediaElement.readyState - Web APIs
have_future_data 3 data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).
HTMLObjectElement.contentDocument - Web APIs
the contentdocument read-only property of the htmlobjectelement interface returns a document representing the active document of the object element's nested browsing context, if any; otherwise null.
HTMLObjectElement.contentWindow - Web APIs
the contentwindow read-only property of the htmlobjectelement interface returns a windowproxy representing the window proxy of the object element's nested browsing context, if any; otherwise null.
HTMLOptionElement - Web APIs
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.
HTMLOptionsCollection - Web APIs
mozilla allows this, while other implementations could potentially throw a domexception.
HTMLScriptElement.referrerPolicy - Web APIs
origin-when-cross-origin send a full url when performing a same-origin request, but only send the origin of the document for other cases.
HTMLSelectElement.selectedOptions - Web APIs
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.
HTMLSlotElement.assignedNodes() - Web APIs
the assignednodes() property of the htmlslotelement interface 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.
HTMLTrackElement - Web APIs
htmltrackelement.default a boolean reflecting the default attribute, indicating that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate.
HTMLVideoElement.videoHeight - Web APIs
any other factors required by the media format.
HTMLVideoElement.videoWidth - Web APIs
any other factors required by the media format.
HTMLVideoElement - Web APIs
the list of supported media formats varies from one browser to the other.
File drag and drop - Web APIs
in the following drop handler, if the browser supports datatransferitemlist interface, the getasfile() method is used to access each file; otherwise the datatransfer interface's files property is used to access each file.
Dragging and Dropping Multiple Items - Web APIs
you may wish to do both in case another listener has already cancelled the event.
Headers() - Web APIs
WebAPIHeadersHeaders
in the following snippet we create a new headers object, adding some headers by passing the constructor an init object as an argument: var httpheaders = { 'content-type' : 'image/jpeg', 'accept-charset' : 'utf-8', 'x-my-custom-header' : 'zeke are cool' }; var myheaders = new headers(httpheaders); you can now create another headers object, passing it the first headers object as its init object: var secondheadersobj = new headers(myheaders); secondheadersobj.get('content-type'); // would return 'image/jpeg' — it inherits it from the first headers object specifications specification status comment fetchthe definition of 'headers()' in that specification.
Headers - Web APIs
WebAPIHeaders
in any other failure case they fail silently.
History.replaceState() - Web APIs
the new url must be of the same origin as the current url; otherwise replacestate throws an exception.
Ajax navigation example - Web APIs
202: "accepted", 203: "non-authoritative information", 204: "no content", 205: "reset content", 206: "partial content", 207: "multi-status", 208: "already reported", 226: "im used", 300: "multiple choices", 301: "moved permanently", 302: "found", 303: "see other", 304: "not modified", 305: "use proxy", 306: "reserved", 307: "temporary redirect", 308: "permanent redirect", 400: "bad request", 401: "unauthorized", 402: "payment required", 403: "forbidden", 404: "not found", 405: "method not allowed", 406: "not acce...
History API - Web APIs
another use for the go() method is to refresh the current page by either passing 0, or by invoking it without an argument: // the following statements // both have the effect of // refreshing the page window.history.go(0) window.history.go() you can determine the number of pages in the history stack by looking at the value of the length property: let numberofentries = window.history.length interfac...
IDBCursorSync - Web APIs
returns false if the cursor has reached the end of its range; otherwise returns true.
IDBDatabaseException - Web APIs
unknown_err 1 the operation failed for reasons unrelated to the database itself, and it is not covered by any other error code--for example, a failure due to disk io errors.
databases - Web APIs
other error specification does not describe all possible errors.
IDBFactory.deleteDatabase() - Web APIs
when deletedatabase() is called, any other open connections to this particular database will get a versionchange event.
IDBFactorySync - Web APIs
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.
IDBIndex.locale - Web APIs
WebAPIIDBIndexlocale
the locale read-only property 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".
IDBObjectStore.add() - Web APIs
in other words, the success event is only triggered when the transaction has been successfully queued.
IDBRequest.onerror - Web APIs
t'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.l...
IDBRequest.onsuccess - Web APIs
t'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the definition of 'ons...
IDBRequest.result - Web APIs
WebAPIIDBRequestresult
t'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the definition of 'res...
IDBTransaction: abort event - Web APIs
event handler property onabort this can happen for any of the following reasons: bad requests, (for example, trying to add the same key twice, or put the same index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded.
IDBTransaction.mode - Web APIs
transactions of this mode cannot run concurrently with other transactions.
IDBTransaction.oncomplete - Web APIs
as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other indexeddb-supporting browsers.
IDBTransactionSync - Web APIs
recoverable_err if this transaction's scope is dynamic, and the browser cannot commit all of the changes due to another transaction.
IIRFilterNode() - Web APIs
unlike other nodes in the web audio api, the options passed into the iir filter upon creation are not optional.
IIRFilterNode - Web APIs
you may also find this interface useful if you don't need automation, or for other reasons.
IndexedDB API - Web APIs
storage limits and eviction criteria there are a number of web technologies that store data of one kind or another on the client side (i.e.
InputEvent.inputType - Web APIs
try inserting line breaks, or deleting text in different ways, or pasting different content in.</p> <hr> <ul> <li>a sample</li> <li>bulleted</li> <li>list.</li> </ul> <p>another paragraph.</p> </div> javascript const log = document.getelementbyid('log'); const editable = document.queryselector('div[contenteditable]'); editable.addeventlistener('input', loginputtype); function loginputtype(event) { log.textcontent = `input type: ${event.inputtype}`; } result try editing the text inside the <div> and see what happens.
compareVersion - Web APIs
otherwise, this method returns a positive number.
enabled - Web APIs
method of installtrigger object syntax boolean enabled (); parameters none returns true if software installation is enabled for this client machine; otherwise, false.
getVersion - Web APIs
otherwise, it returns an installversion object representing the version of the component.
IntersectionObserver.root - Web APIs
the intersection of this bounding rectangle, offset by any margins specified in the options passed to the intersectionobserver() constructor, the target element's bounds, minus the bounds of every element or other object which overlaps the target element, is considered to be the visible area of the target element.
IntersectionObserverEntry.rootBounds - Web APIs
otherwise, it's the bounds of the root element.
IntersectionObserverEntry - Web APIs
instances of intersectionobserverentry are delivered to an intersectionobserver callback in its entries parameter; otherwise, these objects can only be obtained by calling intersectionobserver.takerecords().
Keyboard.lock() - Web APIs
WebAPIKeyboardlock
assuming a standard us qwerty layout, registering "keyw" ensures that "w", shift+"w", control+"w", control+shift+"w", and all other key modifier combinations with "w" are sent to the app.
Keyboard API - Web APIs
assuming a standard united states qwerty layout, registering keyw ensures that "w", shift+"w", control+"w", control+shift+"w", and all other key modifier combinations with "w" are sent to the app.
KeyframeEffect.KeyframeEffect() - Web APIs
this is primarily of use when sequencing animations based on the end time of another animation.
KeyframeEffect.iterationComposite - Web APIs
the iterationcomposite property of a keyframeeffect resolves how the animation's property value changes accumulate or override each other upon each of the animation's iterations.
KeyframeEffect.setKeyframes() - Web APIs
a single keyframe), and the browser will infer the other end of the animation if it is able to.
KeyframeEffect - Web APIs
keyframeeffect.composite gets and sets the composite operation property for resolving the property value changes between this and other keyframe effects.
LargestContentfulPaint - Web APIs
// https://bugs.webkit.org/show_bug.cgi?id=209216 try { let lcp; const po = new performanceobserver((entrylist) => { const entries = entrylist.getentries(); const lastentry = entries[entries.length - 1]; // update `lcp` to the latest value, using `rendertime` if it's available, // otherwise using `loadtime`.
LocalFileSystemSync - Web APIs
example //taking care of the browser-specific prefix window.requestfilesystemsync = window.requestfilesystemsync || window.webkitrequestfilesystemsync; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the error callback // for denial of access and other errors.
LocalMediaStream - Web APIs
all other functionality is found in mediastream.
Locks.name - Web APIs
WebAPILockname
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.
Lock - Web APIs
WebAPILock
navigator.locks.request("net_db_sync", show_lock_properties); navigator.locks.request("another_lock", {mode: "shared"}, 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 specification status comment web locks apithe definition of 'lock' in that specification.
MSCandidateWindowShow - Web APIs
ment.getelementbyid("mysearchbox").msgetinputcontext(); context.addeventlistener("mscandidatewindowshow", candidatewindowshowhandler); function candidatewindowshowhandler(e) { var imerect = context.getcandidatewindowclientrect(); var suggestionrect = document.getelementbyid("mysuggestionlist").getboundingclientrect(); // check if the two rects intersect, and position them away from each other.
MediaCapabilities.decodingInfo() - Web APIs
ediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the decodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, the media decoding configuration is not a valid value for the media decoding type, or any other error in the media configuration passed to the method, including omitting values required in the media decoding configuration.
MediaCapabilities.encodingInfo() - Web APIs
return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the encodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements.
MediaDeviceInfo.deviceId - Web APIs
it is un-guessable by other applications, and unique to the origin of the calling application.
MediaDeviceInfo.groupId - Web APIs
this version of the example puts the passed-in device at the top of the result list, then adds any other members of the group that are found: const getdevicegroup = maindevinfo => { let devlist = [maindevinfo]; navigator.mediadevices.enumeratedevices() .then(devices => { devices.foreach(device => { if ((device.groupid === maindevinfo.groupid) && (device.deviceid !== maindevinfo.deviceid)) { devlist.push(device); } }); }); return devlist; }; ...
MediaError - Web APIs
this text and its format is not defined by the specification and will vary from one user agent to another.
MediaPositionState.duration - Web APIs
for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
MediaPositionState.playbackRate - Web APIs
for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
MediaPositionState.position - Web APIs
for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
MediaQueryList.matches - Web APIs
syntax var matches = <varm>mediaquerylist.matches; value a boolean which is true if the document currently matches the media query list; otherwise, it's false.
MediaQueryList - Web APIs
you can find other examples on the individual property and method pages.
MediaRecorder() - Web APIs
if this is specified along with one or the other of the above properties, this will be used for the one that isn't specified.
MediaRecorder.mimeType - Web APIs
}) .catch(function(error) { console.log(error.message); }); changing line 14 to the following causes mediarecorder to try to use avc constrained baseline profile level 4 for video and aac-lc (low complexity) for audio, which is good for mobile and other possible resource-constrained situations.
MediaRecorder.ondataavailable - Web APIs
you can use timeslice alongside mediarecorder.stop() and mediarecorder.requestdata() to produce multiple same-length blobs plus other shorter blobs as well.
MediaRecorder.start() - Web APIs
all other errors are reported through error events sent to the mediarecorder object.
MediaSession.setActionHandler() - Web APIs
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.
Media Session action types - Web APIs
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.
MediaSessionActionDetails.action - Web APIs
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.
MediaSource.addSourceBuffer() - Web APIs
notsupportederror the specified mimetype isn't supported by the user agent, or is not compatible with the mime types of other sourcebuffer objects that are already included in the media source's sourcebuffers list.
MediaSource.endOfStream() - Web APIs
for example, you might have a function that handles media chunk requests, separate from other network requests.
MediaStream() - Web APIs
otherwise, the stream has no tracks.
MediaStream.getTrackById() - Web APIs
otherwise, the returned value is null.
MediaStream.getVideoTracks() - Web APIs
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.
MediaStreamAudioDestinationNode.stream - Web APIs
you can use this property to get a stream out of the audio graph and feed it into another construct, such as a media recorder.
MediaStreamAudioDestinationNode - Web APIs
you can use this property to get a stream out of the audio graph and feed it into another construct, such as a media recorder.
MediaStreamAudioSourceNode() - Web APIs
note: another way to create a mediastreamaudiosourcenode is to call theaudiocontext.createmediastreamsource() method, specifying the stream from which you want to obtain audio.
MediaStreamTrack.enabled - Web APIs
when enabled, a track's data is output from the source to the destination; otherwise, empty frames are output.
MediaStreamTrackAudioSourceNode() - Web APIs
another way to create a mediastreamtrackaudiosourcenode is to call theaudiocontext.createmediastreamtracksource() method, specifying the mediastreamtrack from which you want to obtain audio.
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.
MediaTrackConstraints.autoGainControl - Web APIs
automatic gain control is typically a feature provided by microphones, although it can be provided by other input sources as well.
MediaTrackConstraints.noiseSuppression - Web APIs
noise suppression is typically provided by microphones, although it can be provided by other input sources as well.
MediaTrackSettings.autoGainControl - Web APIs
this feature is typically used on microphones, although it can be provided by other input sources as well.
MediaTrackSettings.deviceId - Web APIs
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.
MediaTrackSettings.noiseSuppression - Web APIs
this feature is typically used on microphones, although it is technically possible it could be provided by other input sources as well.
MediaTrackSupportedConstraints.frameRate - Web APIs
"not supported" with code to provide alternative methods for presenting the audiovisual information you want to share with the user or otherwise work with.
Media Session API - Web APIs
mediasessionactiondetails provides information needed in order to perform the action which has been requested, including the type of action to perform and any other information needed, such as seek distances or times.
Transcoding assets for Media Source Extensions - Web APIs
currently, mp4 containers with h.264 video and aac audio codecs have support across all modern browsers, while others don't.
MessageChannel() - Web APIs
var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addeventlistener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too).
MessageChannel.port1 - Web APIs
var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addeventlistener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } specifications specification status comment html living standardthe definition of '...
MessageEvent.ports - Web APIs
otherwise called implicitly by onmessage setter.
MessageEvent - Web APIs
otherwise called implicitly by onmessage setter.
MessagePort: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessag...
MessagePort: messageerror event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessageerror examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }...
MessagePort.onmessage - Web APIs
var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addeventlistener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too).
MessagePort.start() - Web APIs
WebAPIMessagePortstart
example in the following code block, you can see a handlemessage handler function, run when a message is sent back to this document using onmessage: channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } another option would be to do this using eventtarget.addeventlistener, however, when this method is used, you need to explicitly call start() to begin the flow of messages to this document: channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; textinput.value = ''; } channel.port1.start(); specifications specification sta...
Metadata.modificationTime - Web APIs
the read-only modificationtime property of the metadata interface is a date object which specifies the date and time the file system entry (or the data referenced by the entry) was last modified.a file system entry is considered to have been modified if the metadata or the contents of the referenced file (or directory, or whatever other kind of file system entry might exist on the platform in use) has changed.
Metadata.size - Web APIs
WebAPIMetadatasize
the read-only size property of the metadata interface specifies the size, in bytes, of the referenced file or other file system object on disk.
MouseEvent() - Web APIs
in some implementations, passing anything other than a number for the screen and client fields will throw a typeerror.
MouseEvent.buttons - Web APIs
the mouseevent.buttons read-only property indicates which buttons are pressed on the mouse (or other input device) when a mouse event is triggered.
MouseEvent.getModifierState() - Web APIs
the mouseevent.getmodifierstate() method returns the current state of the specified modifier key: true if the modifier is active (i.e., the modifier key is pressed or locked), otherwise, false.
MouseEvent.initMouseEvent() - Web APIs
in other cases, pass null.
MouseEvent.movementX - Web APIs
in other words, the value of the property is computed like this: currentevent.movementx = currentevent.screenx - previousevent.screenx.
MouseEvent.movementY - Web APIs
in other words, the value of the property is computed like this: currentevent.movementy = currentevent.screeny - previousevent.screeny.
MouseEvent.screenX - Web APIs
<p>move your mouse to see its position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result routing an event when you trap events on the window, document, or other roomy elements, you can get the coordinates of that event (e.g., a click) and route it properly, as the following example demonstrates: function checkclickmap(e) { if (e.screenx < 50) doredbutton(); if (50 <= e.screenx && e.screenx < 100) doyellowbutton(); if (e.screenx >= 100) doredbutton(); } specifications specification status comment css object model (cssom) ...
msFirstPaint - Web APIs
put another way, msfirstpaint utilizes the browser to measure when the first content completes being painted in the window.
msPlayToPrimary - Web APIs
syntax ptr = object.msplaytoprimary; value boolean value set to true indicates that the device is the primary dlna playto device, otherwise false.
msPlayToSource - Web 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.
MutationEvent - Web APIs
domelementnamechanged and domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well.
MutationObserver.observe() - Web APIs
in other words, until you've been notified that nodes are being split off from your monitored subtree, you'll get notifications of changes to that split-off subtree and its nodes.
MutationObserverInit.attributes - Web APIs
you can expand the capabilities of attribute mutation monitoring using other options: attributefilter lets you specify specific attribute names to monitor instead of monitoring all attributes.
MutationObserverInit.characterData - Web APIs
you can expand the capabilities of attribute mutation monitoring using other options: characterdataoldvalue lets you specify whether or not you want the previous value of changed text nodes to be provided using the mutationrecord's oldvalue property.
NDEFRecord.id - Web APIs
WebAPINDEFRecordid
web nfc does not sign the nfc content, thus record consumer should not make any assumptions about integrity or authenticity of the identifier or any other part of the records.
NDEFRecord.recordType - Web APIs
local type name represents a local type name, frequently used to specify ndef record embedded within another record.
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.
Navigator.doNotTrack - Web APIs
example console.log(navigator.donottrack); // prints "1" if dnt is enabled; "0" if the user opted-in for tracking; otherwise this is "unspecified" specifications specification status comment tracking preference expression (dnt)the definition of 'navigator.donottrack' in that specification.
Navigator.getUserMedia() - Web APIs
if permission is denied, no compatible input devices exist, or any other error condition occurs, the error callback is executed with a mediastreamerror object describing what went wrong.
Navigator.msLaunchUri() - Web APIs
usage notes if a default protocol handler is available on the system that matches the uri, the successcallback is invoked, otherwise, the nohandlercallback is called.
Navigator.registerContentHandler() - Web APIs
for security reasons, it's not possible for an extension or web site to register content handlers targeting other sites.
Navigator.registerProtocolHandler() - Web APIs
otherwise, the scheme must be one of the following: bitcoin geo im irc ircs magnet mailto mms news nntp openpgp4fpr sip sms smsto ssh tel urn webcal wtai xmpp example if your site is burgers.example.com, you can register a protocol handler for it to handle web+burger: links, like so: navigator.registerprotocolhandler("web+burger", "https://b...
Navigator.sendBeacon() - Web APIs
otherwise, it returns false.
Navigator - Web APIs
WebAPINavigator
navigator.cookieenabled read only returns false if setting a cookie will be ignored and true otherwise.
NavigatorID.appVersion - Web APIs
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.
NavigatorID - Web APIs
there is no object of type navigatorid, but other interfaces, like navigator or workernavigator, implement it.
NavigatorLanguage - Web APIs
there is no object of type navigatorlanguage, but other interfaces, like navigator or workernavigator, implement it.
Online and offline events - Web APIs
2.5em 0.5em 0.5em; font: 1em sans-serif; } .online { background: green; } .offline { background: red; } and the corresponding htmlxxx when mochitests for this are created, point to those instead and update this example -nickolay <div id="status"></div> <div id="log"></div> <p>this is a test</p> here's the live result notes if the api isn't implemented in the browser, you can use other signals to detect if you are offline including using service workers and responses from xmlhttprequest.
NavigatorOnLine - Web APIs
there is no object of type navigatoronline, but other interfaces, like navigator or workernavigator, implement it.
NetworkInformation.onchange - Web APIs
} // register for event changes: navigator.connection.onchange = changehandler; // another way: navigator.connection.addeventlistener('change', changehandler); specifications specification status comment network information apithe definition of 'onchange' in that specification.
NetworkInformation.type - Web APIs
syntax var type = netinfo.type return value an enumerated value that is one of the following values: "bluetooth" "cellular" "ethernet" "none" "wifi" "wimax" "other" "unknown" specifications specification status comment network information apithe definition of 'type' in that specification.
NetworkInformation - Web APIs
it will be one of the following values: bluetooth cellular ethernet none wifi wimax other unknown event handlers networkinformation.onchange the event that's fired when connection information changes and the change is fired on this object.
Network Information API - Web APIs
a real-world use case would likely use a switch statement or some other method to check all of the possible values of networkinformation.type.
Node.appendChild() - Web APIs
WebAPINodeappendChild
if the given child is a reference to an existing node in the document, appendchild() moves it from its current position to the new position (there is no requirement to remove the node from its parent node before appending it to some other node).
Node.cloneNode() - Web APIs
WebAPINodecloneNode
the newclone has no parent and is not part of the document, until it is added to another node that is part of the document (using node.appendchild() or a similar method).
Node.contains() - Web APIs
WebAPINodecontains
syntax node.contains( othernode ) example this function checks to see if an element is in the page's body.
Node.firstChild - Web APIs
WebAPINodefirstChild
another #text node is inserted between the closing </span> and </p>tags.
Node.hasChildNodes() - Web APIs
syntax bool = node.haschildnodes(); return value a boolean that is true if the node has child nodes, and false otherwise.
Node.isEqualNode() - Web APIs
WebAPINodeisEqualNode
syntax var isequalnode = node.isequalnode(othernode); othernode: the node to compare equality with.
Node.isSameNode() - Web APIs
WebAPINodeisSameNode
syntax const issamenode = node.issamenode(othernode) parameters othernode the node to test against.
Node.localName - Web APIs
WebAPINodelocalName
for nodes of any type other than element_node and attribute_node localname is always null.
Node.namespaceURI - Web APIs
WebAPINodenamespaceURI
for nodes of any node.nodetype other than element_node and attribute_node the value of namespaceuri is always null.
Node.nextSibling - Web APIs
WebAPINodenextSibling
element.nextelementsibling may be used to obtain the next element skipping any whitespace nodes, other between-element text, or comments.
Node.nodeName - Web APIs
WebAPINodenodeName
on the notation name processinginstruction the value of processinginstruction.target text "#text" example given the following markup: <div id="d1">hello world</div> <input type="text" id="t"> and the following script: var div1 = document.getelementbyid("d1"); var text_field = document.getelementbyid("t"); text_field.value = div1.nodename; in xhtml (or any other xml format), text_field's value would read "div".
Node.nodeType - Web APIs
WebAPINodenodeType
it distinguishes different kind of nodes from each other, such as elements, text and comments.
Node.removeChild() - Web APIs
WebAPINoderemoveChild
in the second syntax form, however, there is no oldchild reference kept, so assuming your code has not kept any other reference to the node elsewhere, it will immediately become unusable and irretrievable, and will usually be automatically deleted from memory after a short time.
NodeFilter.acceptNode() - Web APIs
e to use as root document.getelementbyid('someid'), // only consider nodes that are text nodes (nodetype 3) nodefilter.show_text, // object containing the function to use for the acceptnode method // of the nodefilter { acceptnode: function(node) { // logic to determine whether to accept, reject or skip node // in this case, only accept nodes that have content // other than whitespace if ( !
NodeFilter - Web APIs
e to use as root document.getelementbyid('someid'), // only consider nodes that are text nodes (nodetype 3) nodefilter.show_text, // object containing the function to use for the acceptnode method // of the nodefilter { acceptnode: function(node) { // logic to determine whether to accept, reject or skip node // in this case, only accept nodes that have content // other than whitespace if ( !
NodeIterator.detach() - Web APIs
once this method had been called, calls to other methods on nodeiterator would raise the invalid_state_err exception.
NodeIterator.whatToShow - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
NodeIterator - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
NodeList.item() - Web APIs
WebAPINodeListitem
this is usually obtained from another dom property or method, such as childnodes.
NodeList - Web APIs
WebAPINodeList
for example, node.childnodes is live: const parent = document.getelementbyid('parent'); let child_nodes = parent.childnodes; console.log(child_nodes.length); // let's assume "2" 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.
NonDocumentTypeChildNode.previousElementSibling - Web APIs
syntax prevnode = elementnodereference.previouselementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <li>this is a list item</li> <li>this is another list item</li> <div id="div-03">here is div-03</div> <script> let el = document.getelementbyid('div-03').previouselementsibling; document.write('<p>siblings of div-03</p><ol>'); while (el) { document.write('<li>' + el.nodename + '</li>'); el = el.previouselementsibling; } document.write('</ol>'); </script> this example outputs the following into the page when it loads: sibli...
Notification.tag - Web APIs
WebAPINotificationtag
one notification can then be programmatically replaced with another to avoid the users' screen being filled up with a huge number of similar notifications.
NotificationEvent.action - Web APIs
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.
NotificationEvent - Web APIs
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.
OfflineAudioContext.startRendering() - Web APIs
at this point we create another audio context, create an audiobuffersourcenode inside it, and set its buffer to be equal to the promise audiobuffer.
OfflineAudioContext.suspend() - Web APIs
invalidstateerror if the quantized frame number is one of the following: a negative number is less than or equal to the current time is greater than or equal to the total render duration is scheduled by another suspend for the same time specifications specification status comment web audio apithe definition of 'suspend()' in that specification.
OfflineAudioContext - Web APIs
at this point we create another audio context, create an audiobuffersourcenode inside it, and set its buffer to be equal to the promise audiobuffer.
OffscreenCanvas.convertToBlob() - Web APIs
other arguments are ignored.
OffscreenCanvas.convertToBlob() - Web APIs
other arguments are ignored.
OffscreenCanvas.convertToBlob() - Web APIs
other arguments are ignored.
PannerNode.distanceModel - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
PannerNode.maxDistance - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
PannerNode.panningModel - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
PannerNode.setOrientation() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
PannerNode.setPosition() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
PannerNode.setVelocity() - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
PannerNode - Web APIs
// set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientatio...
PaymentAddress.recipient - Web APIs
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.
PaymentAddress - Web APIs
properties paymentaddress.addressline read only an array of domstring objects providing each line of the address not included among the other properties.
PaymentDetailsUpdate - Web APIs
this lets you have flexibility for how to handle things like tax, discounts, and other adjustments to the total price charged.
PaymentItem - Web APIs
this might be an item or service being purchased or a tax or other charge.
PaymentRequest.PaymentRequest() - Web APIs
}); } catch (e) { // catch any other errors.
PaymentRequest: paymentmethodchange event - Web APIs
for example, if the user switches from one credit card to another on their apple pay account, a paymentmethodchange event is fired to let you know about the change.
PaymentRequest.shippingOption - Web APIs
in each calls to updatedetails() are made, one using a promise, and the other with a plain js object.
PaymentRequestUpdateEvent.updateWith() - Web APIs
this lets you have flexibility for how to handle things like tax, discounts, and other adjustments to the total price charged.
PaymentValidationErrors - Web APIs
error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment form.
Payment processing concepts - Web APIs
by then delivering this data (or a promise which resolves to the loaded data) to the payment handler by passing it into complete(), the payment handler can use the retrieved data and whatever algorithm and other data to support in order to verify that the merchant can use the payment handler.
Payment Request API - Web APIs
basic card payment working draft defines basiccardrequest and basiccardresponse, among other things needed for handling credit card payment payment method identifiers candidate recommendation defines payment method identifiers and how they are validated, and, where applicable, minted and formally registered with the w3c.
Performance - Web APIs
if you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa.
PerformanceNavigation.type - Web APIs
255 type_reserved any other way.
PerformanceNavigation - Web APIs
type_reserved (255) any other way.
PerformanceNavigationTiming.domComplete - Web APIs
og("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcomplete' in that specification.
PerformanceNavigationTiming.domContentLoadedEventEnd - Web APIs
"dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcontentloadedeventend' in that specification.
PerformanceNavigationTiming.domContentLoadedEventStart - Web APIs
og("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcontentloadedeventstart' in that specification.
PerformanceNavigationTiming.domInteractive - Web APIs
"dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'dominteractive' in that specification.
PerformanceNavigationTiming.loadEventEnd - Web APIs
"dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'loadeventend' in that specification.
PerformanceNavigationTiming.loadEventStart - Web APIs
og("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'loadeventstart' in that specification.
PerformanceNavigationTiming.redirectCount - Web APIs
og("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'redirectcount' in that specification.
PerformanceNavigationTiming.unloadEventEnd - Web APIs
og("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'unloadeventend' in that specification.
PerformanceNavigationTiming.unloadEventStart - Web APIs
og("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'unloadeventstart' in that specification.
PerformanceNavigationTiming - Web APIs
if there was no redirect, or if the redirect was from another origin, and that origin does not permit it's timing information to be exposed to the current origin then the value will be 0.
PerformanceObserver.observe() - Web APIs
examples this example creates and configures two performanceobservers; one watches for "mark" and "frame" events, and the other watches for "measure" events.
PerformanceResourceTiming.connectEnd - Web APIs
the timestamp value includes the time interval to establish the transport connection, as well as other time intervals such as ssl handshake and socks authentication.
PerformanceResourceTiming.nextHopProtocol - Web APIs
otherwise, this property returns the alpn protocol id of the first hop to the proxy.
PerformanceResourceTiming.redirectEnd - Web APIs
when fetching a resource, if there are multiple http redirects, and any of the redirects have an origin that is different from the current document, and the timing allow check algorithm passes for each redirected resource, this property returns the time immediately after receiving the last byte of the response of the last redirect; otherwise, zero is returned.
PerformanceResourceTiming.redirectStart - Web APIs
if there are http redirects when fetching the resource and if any of the redirects are not from the same origin as the current document, but the timing allow check algorithm passes for each redirected resource, this property returns the starting time of the fetch that initiates the redirect; otherwise, zero is returned.
PerformanceResourceTiming - Web APIs
additionally, the interface extends performanceentry with other properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch.
PerformanceTiming - Web APIs
some correspond to dom events; others describe the time at which internal browser operations of interest took place.
Using the Performance API - Web APIs
other web performance guides (listed in the see also section) describe how to use additional methods and properties of the performance interface.
Performance Timeline - Web APIs
this interface has the following four properties, and these properties are extended (with additional constraints) by other interfaces (such as performancemark): name the name of the performance entry when the metric was created.
Using the Permissions API - Web APIs
most of the code is simple and unremarkable — below we'll just be walking through the permissions api-related code, so check the code yourself if you want to study any of the other parts.
PointerEvent.pointerId - Web APIs
the identifier is unique, being different from the identifiers of all other active pointer events.
PointerEvent.pointerType - Web APIs
if the browser supports pointer device types other than those listed above, the value should be vendor-prefixed to avoid conflicting names for different types of devices.
PointerEvent.pressure - Web APIs
for hardware that does not support pressure, such as a mouse, the value is 0.5 when the pointer is active buttons state and 0 otherwise.
PositionOptions.enableHighAccuracy - Web APIs
on the other hand, if false (the default value), the device can take the liberty to save resources by responding more quickly and/or using less power.
PositionOptions - Web APIs
on the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power.
ProcessingInstruction - Web APIs
the processinginstruction interface represents a processing instruction; that is, a node which embeds an instruction targeting a specific application but that can be ignored by any other applications which don't recognize the instruction.
ProgressEvent.loaded - Web APIs
when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead.
ProgressEvent.total - Web APIs
when downloading a resource using http, this only represent the content itself, not headers and other overhead.
PromiseRejectionEvent - Web APIs
221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">promiserejectionevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor promiserejectionevent() creates a promiserejectionevent event, given the type of event (unhandledrejection or rejectionhandled) and other details.
Proximity Events - Web APIs
example window.addeventlistener('userproximity', function(event) { if (event.near) { // let's power off the screen navigator.mozpower.screenenabled = false; } else { // otherwise, let's power on the screen navigator.mozpower.screenenabled = true; } }); specifications specification status comment proximity sensorthe definition of 'proximity events' in that specification.
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
examples publickeycredential.isuserverifyingplatformauthenticatoravailable() .then(function(available){ if(available){ // we can proceed with the creation of a publickeycredential // with this authenticator } else { // use another kind of authenticator or a classical login/password // workflow } }).catch(function(err){ // something went wrong console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'isuserverifyingplatformauthenticatoravailable' in that specification.
PublicKeyCredential - Web APIs
other interfaces that inherit from credential are passwordcredential and federatedcredential.
PublicKeyCredentialCreationOptions.challenge - Web APIs
this value (among other client data) will be signed by the authenticator, using its private key, and must be sent back for verification to the server as part of authenticatorattestationresponse.attestationobject.
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
examples var publickey = { excludecredentials: [ { type: "public-key", // the id for john.doe@example.com id : new uint8array(26) /* this actually is given by the server */ }, { type: "public-key", // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ], challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.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({ ...
PublicKeyCredentialCreationOptions - Web APIs
// exclude already existing credentials for the user excludecredentials: [ { type: "public-key", // the id for john.doe@example.com id : new uint8array(26) /* this actually is given by the server */ }, { type: "public-key", // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ] } }; // create the new credential with the options above navigator.credentials.create(createcredentialoptions) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; var clientextensionsoutputs = newcredentialinfo.getclientextensionsresults(); // send the response to the relying party server // it will verify ...
PublicKeyCredentialRequestOptions.challenge - Web APIs
this value (among other client data) will be signed by the authenticator's private key and produce authenticatorassertionresponse.signature which should be sent back to the server as part of the response.
PushSubscription.endpoint - Web APIs
for this reason, it is a good idea to keep your endpoint a secret, so others do not hijack it and abuse the push functionality.
PushSubscription.expirationTime - Web APIs
the expirationtime read-only property of the pushsubscription interface returns a domhighrestimestamp of the subscription expiration time associated with the push subscription, if there is one, or null otherwise.
PushSubscription - Web APIs
pushsubscription.expirationtime read only a domhighrestimestamp of the subscription expiration time associated with the push subscription, if there is one, or null otherwise.
Web Push API Notifications best practices - Web APIs
for example, safari 12.1 now requires—and other browsers either already do, or are planning[1] to do so—that the user interact with the page in some way before the page can request permission to perform push notifications.
RTCConfiguration.certificates - Web APIs
some browsers may simply choose the first listed certificate and ignore the rest of the list; others may take a different approach.
RTCDTMFSender.toneBuffer - Web APIs
all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exception.
RTCDTMFSender - Web APIs
the primary purpose for webrtc's dtmf support is to allow webrtc-based communication clients to be connected to a public-switched telephone network (pstn) or other legacy telephone service, including extant voice over ip (voip) services.
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exception.
RTCDataChannel: bufferedamountlow event - Web APIs
in other words, we'll try to keep at least 64kb of data in the buffer, reading 64kb at a time from the source.
RTCDataChannel: error event - Web APIs
other error types similarly output appropriate information.
RTCDataChannel.onmessage - Web APIs
this event is sent to the channel when a message is received from the other peer.
RTCDataChannel.ordered - Web APIs
syntax var ordered = adatachannel.ordered; a boolean value which is true if in-order delivery is guaranteed and is otherwise false.
RTCDataChannel.protocol - Web APIs
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.
RTCDataChannel - Web APIs
this event is sent to the channel when a message is received from the other peer.onopen the rtcdatachannel.onopen property is an eventhandler which specifies a function to be called when the open event is fired; this is a simple event which is sent when the data channel's underlying data transport—the link over which the rtcdatachannel's messages flow—is established or re-established.methodsalso inherits methods from: eventtargetclose()the rtcdatachannel.close() met...
RTCDtlsTransport - Web APIs
whether bundling is used depends on what the other endpoint is able to negotiate.
RTCError - Web APIs
WebAPIRTCError
any other error is treated as terminal, causing a terminatemyconnection() function to be called.
RTCErrorEvent.error - Web APIs
any other error is treated as terminal, causing a terminatemyconnection() function to be called.
RTCErrorEvent - Web APIs
description there are other data types used for error events in webrtc, as needed for errors with special information sharing requirements.
RTCIceCandidate.candidate - Web APIs
most of the other properties of rtcicecandidate are actually extracted from this string.
RTCIceCandidateInit.usernameFragment - Web APIs
another example: it might take a user-defined string and append three 8-bit random bytes to the end.
RTCIceCandidatePairStats.consentRequestsSent - Web APIs
syntax consentrequestssent = rtcicecandidatepairstats.consentrequestssent; value an integer indicating the number of consent requests this peer has sent to the other peer over the connection described by the pair of candidates referenced by this rtcicecandidatepairstats object.
RTCIceCandidatePairStats.selected - Web APIs
in any other browser, you can determine the selected candidate pair by looking for a stats object of type transport, which is an rtctransportstats object.
RTCIceCandidateStats.address - Web APIs
otherwise, the address is presumed to be a fully-qualified domain name, which is resolved first using an aaaa record (assuming ipv6 is available), then using an a record (if no result is found or the device onlu supports ipv4).
RTCIceCandidateStats.priority - Web APIs
determining priority the ice specification describes how user agents and other software using webrtc should calculate the priority.
RTCIceCandidateStats.relayProtocol - Web APIs
the ice protocl being used by the candidate otherwise can be obtained from the protocol property.
RTCIceCandidateStats - Web APIs
case "cellular": case "wimax": case "unknown": default: return false; } } if (rtcstats && rtcstats.type === "local-candidate") { if (!isusablenetworktype(rtcstats)) { abortconnection(); return; } } this code calls a function called abortconnection() if the rtcstats object represents information about a local candidate is which would be using a network connection other than ethernet or a vpn.
RTCIceServer.credential - Web APIs
this is typically a password, key, or other secret.
RTCIceServers.urls - Web APIs
WebAPIRTCIceServerurls
the other is a stun server.
RTCIceTransport: gatheringstatechange event - Web APIs
here, the addeventlistener() method is called to add a listener for gatheringstatechange events: pc.getsenders().foreach(sender => { sender.transport.icetransport.addeventlistener("gatheringstatechange", ev => { let transport = ev.target; if (transport.gatheringstate === "complete") { /* this transport has finished gathering candidates, but others may still be working on it */ } }, false); likewise, you can use the ongatheringstatechange event handler property: pc.getsenders().foreach(sender => { sender.transport.icetransport.ongatheringstatechange = ev => { let transport = ev.target; if (transport.gatheringstate === "complete") { /* this transport has finished gathering candidates, but others may still be wo...
RTCIceTransport: selectedcandidatepairchange event - Web APIs
the pair of candidates is in turn described by an rtcicecandidatepair object which contains one rtcicecandidate representing the local end of the connection, and another representing the remote end of the connection.
RTCIceTransport - Web APIs
the value of state can be used to determine whether the ice agent has made an initial connection using a viable candidate pair ("connected"), made its final selection of candidate pairs ("completed"), or in an error state ("failed"), among other states.
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.
RTCInboundRtpStreamStats.packetsDuplicated - Web APIs
usage notes duplicate packets are detected when a packet has the same rtp sequence number as another packet that has previously been processed.
RTCInboundRtpStreamStats.pliCount - Web APIs
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.
RTCInboundRtpStreamStats - Web APIs
the timestamp property, on the other hand, indicates the time at which the statistics object was generated.
RTCNetworkType - Web APIs
for example, if the networktype is wifi but the user is connected using a cellular hotspot, the connection will be bottlenecked by the underlying cellular network (and any other networks between the two peers).
RTCOfferAnswerOptions.voiceActivityDetection - Web APIs
the default value, true, indicates that the user agent should monitor the audio coming from the microphone or other audio source and automatically cease transmitting data or mute when the user isn't speaking into the microphone, a value of false indicates that the audio should continue to be transmitted regardless of whether or not speech is detected.
RTCOfferOptions.iceRestart - Web APIs
otherwise, we call back to the older technique: we manually create a new offer with icerestart set to true, then that offer is set as the new local description for the connection.
RTCOutboundRtpStreamStats - Web APIs
the timestamp property, on the other hand, indicates the time at which the rtcoutboundrtpstreamstats object was generated.
RTCPeerConnection() - Web APIs
return value a newly-created rtcpeerconnection object, configured as described by configuration, if specified; otherwise, configured to appropriate basic defaults.
RTCPeerConnection.addStream() - Web APIs
if you are relying on the chrome behavior, note that other browsers do not have it.
RTCPeerConnection: addstream event - Web APIs
if it does, a track event listener is set up; otherwise, an addstream event listener is set up.
RTCPeerConnection.canTrickleIceCandidates - Web APIs
ice trickling is the process of continuing to send candidates after the initial offer or answer has already been sent to the other peer.
RTCPeerConnection.connectionState - Web APIs
"disconnected" at least one of the ice transports for the connection is in the "disconnected" state and none of the other transports are in the state "failed", "connecting", or "checking".
RTCPeerConnection.getStats() - Web APIs
the contents of the report depend on the selector as well as other details of the connection.
RTCPeerConnection.getStreamById() - Web APIs
example var stream = pc.getstreambyid(mytrackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not natively available.
RTCPeerConnection: icecandidate event - Web APIs
as you see in the code in the previous section, every candidate is sent to the other peer, including any that might have an empty candidate string.
RTCPeerConnection.localDescription - Web APIs
syntax var sessiondescription = peerconnection.localdescription; on a more fundamental level, the returned value is the value of rtcpeerconnection.pendinglocaldescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentlocaldescription is returned.
RTCPeerConnection.onicecandidate - Web APIs
this happens whenever the local ice agent needs to deliver a message to the other peer through the signaling server.
RTCPeerConnection.pendingLocalDescription - Web APIs
otherwise, this returns null.
RTCPeerConnection.pendingRemoteDescription - Web APIs
otherwise, this returns null.
RTCPeerConnection.remoteDescription - Web APIs
syntax var sessiondescription = peerconnection.remotedescription; on a more fundamental level, the returned value is the value of rtcpeerconnection.pendingremotedescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentremotedescription is returned.
RTCPeerConnection.signalingState - Web APIs
the read-only signalingstate property on the rtcpeerconnection interface returns one of the string values specified by the rtcsignalingstate enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer.
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.
RTCRtpCapabilities - Web APIs
that means that, for instance, if there are two entries for the h.264 codec (as identified by the mimetype being "video/h264"), there are other values in the capabilities objects indicating how they're different in some way.
RTCRtpContributingSource.audioLevel - Web APIs
audiolevel will be the level value defined in [rfc6465] if the rfc 6465 header extension is present, and otherwise null.
RTCRtpEncodingParameters.maxBitrate - Web APIs
other parameters may further reduce the bandwidth used by the track; for example, maxframerate will, if set low enough, constrain the bandwidth as well.
RTCRtpEncodingParameters - Web APIs
other parameters may further constrain the bit rate, such as the value of maxframerate or transport or physical network limitations.
RTCRtpReceiver.getCapabilities() static function - Web APIs
nothing is loaded, fetched, or otherwise prepared.
RTCRtpSendParameters.encodings - Web APIs
other parameters may further constrain the bit rate, such as the value of maxframerate or transport or physical network limitations.
RTCRtpSender.getCapabilities() static function - Web APIs
nothing is loaded, fetched, or otherwise prepared.
RTCRtpSender - Web APIs
rtcrtpsender.replacetrack() attempts to replace the track currently being sent by the rtcrtpsender with another track, without performing renegotiation.
RTCRtpStreamStats.pliCount - Web APIs
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.
RTCSessionDescription - Web APIs
in other words, this session description describes the agreed-upon configuration, and is being sent to finalize negotiation.
RTCStatsIceCandidatePairState - Web APIs
frozen no check has been performed yet for this candidate pair, and performing the check is blocked until another check is successful.
RTCTrackEvent.receiver - Web APIs
syntax var rtpreceiver = trackevent.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.
RTCTrackEvent.transceiver - Web APIs
syntax var rtptransceiver = trackevent.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.
RTCTrackEventInit.receiver - Web APIs
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.
RTCTrackEventInit.transceiver - Web APIs
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.
Range.cloneRange() - Web APIs
WebAPIRangecloneRange
the returned clone is copied by value, not reference, so a change in either range does not affect the other.
Range.compareBoundaryPoints() - Web APIs
the range.compareboundarypoints() method compares the boundary points of the range with those of another range.
Range.comparePoint() - Web APIs
for other node types, offset is the number of child nodes between the start of the reference node.
Range.endOffset - Web APIs
WebAPIRangeendOffset
for other node types, the endoffset is the number of child nodes between the start of the endcontainer and the boundary point of the range.
Range.setEnd() - Web APIs
WebAPIRangesetEnd
for other node types, endoffset is the number of child nodes between the start of the endnode.
Range.setEndAfter() - Web APIs
WebAPIRangesetEndAfter
the range.setendafter() method sets the end position of a range relative to another node.
Range.setEndBefore() - Web APIs
the range.setendbefore() method sets the end position of a range relative to another node.
Range.setStart() - Web APIs
WebAPIRangesetStart
for other node types, startoffset is the number of child nodes between the start of the startnode.
Range.setStartBefore() - Web APIs
the range.setstartbefore() method sets the start position of a range relative to another node.
Range.startOffset - Web APIs
WebAPIRangestartOffset
for other node types, the startoffset is the number of child nodes between the start of the startcontainer and the boundary point of the range.
ReadableByteStreamController.close() - Web APIs
exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason.
ReadableByteStreamController.enqueue() - Web APIs
exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existant or detached.
ReadableByteStreamController.error() - Web APIs
exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason.
ReadableStream.ReadableStream() - Web APIs
when a button is pressed, the generation is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream.
ReadableStream.pipeTo() - Web APIs
piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it.
ReadableStream.tee() - Web APIs
teeing a stream will generally lock it for the duration, preventing other readers from locking it.
ReadableStreamBYOBReader.ReadableStreamBYOBReader() - Web APIs
exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader, or its stream controller is not a readablebytestreamcontroller.
ReadableStreamBYOBReader.releaseLock() - Web APIs
if the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed.
ReadableStreamDefaultController.close() - Web APIs
when a button is pressed, the generation is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream.
ReadableStreamDefaultController.desiredSize - Web APIs
examples the a readable stream with an underlying push source and backpressure support example in the spec provides a good example of using desiredsize to manually detect when the stream is full and apply backpressure, and also of using readablestreamdefaultcontroller.error() to manually trigger a stream error if another part of the system it relies on fails.
ReadableStreamDefaultController.enqueue() - Web APIs
when a button is pressed, the generation is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream.
ReadableStreamDefaultController - Web APIs
when a button is pressed, the generation is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream.
ReadableStreamDefaultReader.cancel() - Web APIs
each chunk is read sequentially and output to the ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
ReadableStreamDefaultReader.read() - Web APIs
each chunk is read sequentially and output to the ui as an array of utf-8 bytes, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
ReadableStreamDefaultReader.releaseLock() - Web APIs
if the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed.
ReadableStreamDefaultReader - Web APIs
examples in the following example, an artifical response is created to stream html fragments fetched from another resource to the browser.
Request() - Web APIs
WebAPIRequestRequest
note the following behavioural updates to retain security while making the constructor less likely to throw exceptions: if this object exists on another origin to the constructor call, the request.referrer is stripped out.
Request.destination - Web APIs
others are script-based, in which case the received data is delivered to a script by calling it and passing the data along.
Request - Web APIs
WebAPIRequest
you can create a new request object using the request() constructor, but you are more likely to encounter a request object being returned as the result of another api operation, such as a service worker fetchevent.request.
Response.useFinalURL - Web APIs
in other contexts it will return undefined.
Response - Web APIs
WebAPIResponse
you can create a new response object using the response.response() constructor, but you are more likely to encounter a response object being returned as the result of another api operation—for example, a service worker fetchevent.respondwith, or a simple windoworworkerglobalscope.fetch().
SVGDocument - Web APIs
svg document interface when an "svg" element is embedded inline as a component of a document from another namespace, such as when an "svg" element is embedded inline within an xhtml document, then an svgdocument object will not exist; instead, the root object in the document object hierarchy will be a document object of a different type, such as an htmldocument object.
SVGFitToViewBox - Web APIs
svg fit to view box interface the svgfittoviewbox interface is used to reflect the viewbox and preserveaspectratio attributes, and is mixed in to other interfaces for elements that support these two attributes.
SVGLength - Web APIs
WebAPISVGLength
exceptions: a domexception with code not_supported_err is raised if unittype is svg_lengthtype_unknown or not a valid unit type constant (one of the other svg_lengthtype_* constants defined on this interface).
SVGMarkerElement - Web APIs
if markerunits is svg_marker_orient_angle, the angle value for attribute orient; otherwise, it will be set to zero.
SVGMatrix - Web APIs
WebAPISVGMatrix
this matrix is post-multiplied by another matrix, returning the resulting new matrix as svgmatrix.
SVGStringList - Web APIs
length unsigned long a mirror of the value in numberofitems, for consistency with other interfaces.
SVGTests - Web APIs
WebAPISVGTests
the svgtests interface is used to reflect conditional processing attributes and is mixed into other interfaces for elements that support these attributes.
SVGTextContentElement - Web APIs
f8" stroke="#d4dde4" stroke-width="2px" /><text x="156" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextcontentelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants constant value description lengthadjust_unknown 0 some other value.
SVGUnitTypes - Web APIs
the svgunittypes interface defines a commonly used set of constants used for reflecting gradientunits, patterncontentunits and other similar attributes.
SVGZoomAndPan - Web APIs
the svgzoomandpan interface is used to reflect the zoomandpan attribute, and is mixed in to other interfaces for elements that support this attribute.
Screen.availHeight - Web APIs
on a windows system, this would function similarly, by opening the window and sizing it vertically so it uses all available vertical space, leaving room for the taskbar and any other interface elements that reserve space.
Screen.height - Web APIs
WebAPIScreenheight
widgets such as taskbars or other special application windows that integrate with the os (e.g., the spinner player minimized to act like an additional toolbar on windows) may reduce the amount of space available to browser windows and other applications.
Screen.lockOrientation() - Web APIs
otherwise, the screen orientation will change from an orientation to another as long as the orientations are amongst the orientations the device has been locked to.
Screen.width - Web APIs
WebAPIScreenwidth
when other widgets occupy space that cannot be used by the window object, there is a difference in window.screen.width and window.screen.availwidth.
Screen Wake Lock API - Web APIs
navigator.wakelock returns a wakelock object instance, from which all other functionality can be accessed.
Selection.addRange() - Web APIs
example currently only firefox supports multiple selection ranges, other browsers will not add new ranges to the selection if it already contains one.
Selection.anchorNode - Web APIs
the selection's anchor does not move, but the selection's focus, the other end of the selection, does move.
Selection.focusNode - Web APIs
the selection's focus moves, but the selection's anchor, the other end of the selection, does not move.
Selection API - Web APIs
extensions to other interfaces window.getselection(), document.getselection() returns a selection object representing the range of text selected by the user or the current position of the caret.
Sensor - Web APIs
WebAPISensor
the sensor interface of the the sensor apis is the base class for all the other sensor interfaces.
Server-sent events - Web APIs
living standard see also tools eventsource polyfill for node.js remy sharp’s eventsource polyfill yaffle’s eventsource polyfill rick waldron’s jquery plugin intercooler.js declarative sse support related topics ajax javascript websockets other resources a twitter like application powered by server-sent events and its code on github.
ServiceWorkerContainer.onmessage - Web APIs
as the event object of onmessage) are represented by messageevent objects in modern browsers, for consistency with other web messaging features.
ServiceWorkerGlobalScope.onmessage - Web APIs
as the event object of onmessage) are represented by messageevent objects in modern browsers, for consistency with other web messaging features.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
consider using another method to synchronize subscription information between your service worker and the app server, or make sure your code using fetch() is robust enough to handle cases where attempts to exchange data fail.
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
ServiceWorkerMessageEvent.data - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
ServiceWorkerMessageEvent.lastEventId - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
ServiceWorkerMessageEvent.origin - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
ServiceWorkerMessageEvent.ports - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
ServiceWorkerMessageEvent.source - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
ServiceWorkerMessageEvent - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
ServiceWorkerRegistration.getNotifications() - Web APIs
notifications created by one service worker on the same origin will not be available to other active services workers on that same origin.
ServiceWorkerRegistration.unregister() - Web APIs
the promise will resolve to false if no registration was found, otherwise it resolves to true irrespective of whether unregistration happened or not (it may not unregister if someone else just called serviceworkercontainer.register() with the same scope.) the service worker will finish any ongoing operations before it is unregistered.
ShadowRoot.mode - Web APIs
WebAPIShadowRootmode
examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; // another way to check whether the shadow root is open; it will return null if not if(shadow) { // if it is open, close it to stop people stealing our secrets!
SharedWorker() - Web APIs
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.
SharedWorker - Web APIs
otherwise called implicitly by onmessage setter.
SharedWorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
SourceBuffer.changeType() - Web APIs
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.
SpeechGrammar - Web APIs
grammar is defined using jspeech grammar format (jsgf.) other formats may also be supported in the future.
SpeechGrammarList.addFromString() - Web APIs
weight optional a float representing the weight of the grammar relative to other grammars present in the speechgrammarlist.
SpeechGrammarList.addFromURI() - Web APIs
weight optional a float representing the weight of the grammar relative to other grammars present in the speechgrammarlist.
SpeechGrammarList - Web APIs
grammar is defined using jspeech grammar format (jsgf.) other formats may also be supported in the future.
SpeechRecognition - Web APIs
after some other values have been defined, we then set it so that the recognition service starts when a click event occurs (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.
SpeechRecognitionError.error - Web APIs
in this case it would allow another more suitable speech recognition service to be used instead.
SpeechRecognitionErrorEvent.error - Web APIs
in this case it would allow another more suitable speech recognition service to be used instead.
SpeechRecognitionEvent.results - Web APIs
final results on the other hand will not be overwritten or removed.
SpeechSynthesis.cancel() - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); synth.cancel(); // utterance1 stops being spoken immediately, and both are removed from the queue specifications specification status comment web speech apithe definition of 'cancel()' in that specification.
SpeechSynthesis.pause() - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); synth.pause(); // pauses utterances being spoken specifications specification status comment web speech apithe definition of 'pause()' in that specification.
SpeechSynthesis.pending - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); var amipending = synth.pending; // will return true if utterance 1 is still being spoken and utterance 2 is in the queue specifications specification status comment web speech apithe definition of 'pending' in that specification.
SpeechSynthesis.resume() - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); synth.pause(); // pauses utterances being spoken synth.resume() // resumes speaking specifications specification status comment web speech apithe definition of 'resume()' in that specification.
SpeechSynthesis.speaking - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); var amispeaking = synth.speaking; // will return true if utterance 1 or utterance 2 are currently being spoken specifications specification status comment web speech apithe definition of 'speaking' in that specification.
SpeechSynthesisErrorEvent.error - Web APIs
audio-busy the operation couldn't be completed at this time because the user-agent couldn't access the audio output device (for example, the user may need to correct this by closing another application.) audio-hardware the operation couldn't be completed at this time because the user-agent couldn't identify an audio output device (for example, the user may need to connect a speaker or configure system settings.) network the operation couldn't be completed at this time because some required network communication failed.
SpeechSynthesisUtterance.rate - Web APIs
other values act as a percentage relative to this, so for example 2 is twice as fast, 0.5 is half as fast, etc.
StaticRange - Web APIs
usage notes a dom range specifies a span of content in a document, potentially beginning inside one node (or element) and ending inside another one.
Storage.setItem() - Web APIs
WebAPIStoragesetItem
(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().
Storage - Web APIs
WebAPIStorage
if it doesn't, we run another function, populatestorage(), which uses storage.setitem() to set the item values, then runs setstyles().
StorageEstimate.usage - Web APIs
the value is an estimate because the user agent may use compression, duplication prevention techniques, and other methods to improve storage efficiency.
StorageEvent - Web APIs
a storageevent is sent to a window when a storage area it has access to is changed within the context of another document.
StorageManager.persist() - Web APIs
the persist() method of the storagemanager interface requests permission to use persistent storage, and returns a promise that resolves to true if permission is granted and box mode is persistent, and false otherwise.
Using the Storage Access API - Web APIs
usage notes the storage access api is designed to allow embedded content to request access to storage that would otherwise be blocked when a user’s browser is set to block all third-party cookies.
Storage Access API - Web APIs
if a page from top-level origin foo.example embeds more than one <iframe> from tracker.example, and one of those <iframe>s uses the storage access api in order to obtain storage access successfully, all other iframes from tracker.example on foo.example top-level origins will immediately gain storage access as well, without needing to call requeststorageaccess() separately.
StylePropertyMapReadOnly - Web APIs
</p> <dl id="output"></dl> we add a touch of css with a custom property to better demonstrate the output: p { --somevariable: 1.6em; --someothervariable: translatex(33vw); --anothervariable: 42; line-height: var(--somevariable); } we add javascript to grab our paragraph and return back a definition list of all the default css property values using computedstylemap().
StyleSheet.ownerNode - Web APIs
syntax noderef = stylesheet.ownernode example <html lang="en"> <head> <link rel="stylesheet" href="example.css"> </head> <body> <button onclick="alert(document.stylesheets[0].ownernode)">show example.css’s ownernode</button> </body> </html> // displays "object htmllinkelement" notes for style sheets that are included by other style sheets, such as with @import, the value of this property is null.
SubtleCrypto.deriveBits() - Web APIs
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().
SubtleCrypto.deriveKey() - Web APIs
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().
SubtleCrypto.exportKey() - Web APIs
otherwise the promise fulfills with an arraybuffer containing the key.
TextDecoder() - Web APIs
12" 'hz-gb-2312' "big5", "big5-hkscs", "cn-big5", "csbig5", "x-x-big5" 'big5' "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.
TextEncoder() - Web APIs
syntax encoder = new textencoder(); parameters textencoder() takes no parameters since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53, an encoding type label was accepted as a paramer to the textencoder object, since then both browers have removed support for any encoder type other than utf-8, to match the spec.
TextTrack.mode - Web APIs
WebAPITextTrackmode
while the track's presence is exposed in the dom, the user agent is otherwise ignoring it.
TextTrack - Web APIs
WebAPITextTrack
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.
TextTrackCue - Web APIs
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.
TextTrackList: change event - Web APIs
the change event is fired when a text track is made active or inactive, or a texttracklist is otherwise changed.
Touch() - Web APIs
WebAPITouchTouch
the user agent may use 0 as the value in this case, or it may use any other value in the allowed range.
Touch - Web APIs
WebAPITouch
properties this interface has no parent, and doesn't inherits or implements any other property.
TouchEvent.altKey - Web APIs
WebAPITouchEventaltKey
otherwise, it is false.
TouchEvent.ctrlKey - Web APIs
otherwise, it is false.
TouchEvent.metaKey - Web APIs
otherwise, it is false.
TouchEvent.shiftKey - Web APIs
otherwise, it is false.
TouchEvent - Web APIs
the touch point has left the document window and moved into the browser's ui area, a plug-in, or other external content.
TouchList.item() - Web APIs
WebAPITouchListitem
target = document.getelementbyid("target"); target.addeventlistener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches list; // otherwise set touch to the first item in the touches list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status comment touch events – level 2 draft non-stable version.
TouchList.length - Web APIs
WebAPITouchListlength
target = document.getelementbyid("target"); target.addeventlistener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches list; // otherwise set touch to the first item in the touches list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status comment touch events – level 2 draft non-stable version.
Multi-touch interaction - Web APIs
however, the interfaces can be a bit tricky for programmers to use because touch events are very different from other dom input events, such as mouse events.
TransformStream - Web APIs
let responses = [ /* conjoined response tree */ ] let {readable, writable} = new transformstream responses.reduce( (a, res, i, arr) => a.then(() => res.pipeto(writable, {preventclose: (i+1) !== arr.length})), promise.resolve() ) note that this is not resilient to other influences.
TreeWalker.whatToShow - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
TreeWalker - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
UIEvent.detail - Web APIs
WebAPIUIEventdetail
for all other uievent objects, uievent.detail is always zero.
UIEvent.isChar - Web APIs
WebAPIUIEventisChar
syntax var ischar = uievent.ischar; value a boolean which is true if the event produces a character; otherwise false.
URLSearchParams.get() - Web APIs
return value a usvstring if the given search parameter is found; otherwise, null.
URLSearchParams.set() - Web APIs
if there were several matching values, this method deletes the others.
URLSearchParams - Web APIs
if there are several values, the others are deleted.
URLUtilsReadOnly - Web APIs
these were then inherited by other interfaces, such as workerlocation.
URL API - Web APIs
WebAPIURL API
other functions within urlsearchparams let you change the value of keys, add and delete keys and their values, and even sort the list of parameters.
USB.requestDevice() - Web APIs
WebAPIUSBrequestDevice
on the other hand if the user agent finds two of the first listed device and one of the second, then all three devices will be listed.
USBDevice.deviceClass - Web APIs
the other two properties are usbdevice.devicesubclass and usbdevice.deviceprotocol.
USBDevice.controlTransferIn() - Web APIs
recipient: specifices the target of the transfer on the device, one of "device", "interface", "endpoint", or "other".
USBDevice.controlTransferOut() - Web APIs
recipient: specifices the target of the transfer on the device, one of "device", "interface", "endpoint", or "other".
USBDevice.deviceClass - Web APIs
the other two properties are usbdevice.devicesubclass and usbdevice.deviceprotocol.
USBDevice.deviceProtocol - Web APIs
the other two properties are usbdevice.deviceclass and usbdevice.devicesubclass.
USBDevice.deviceSubclass - Web APIs
the other two properties are usbdevice.deviceclass and usbdevice.deviceprotocol.
USBDevice.usbVersionMajor - Web APIs
the other two properties are usbdevice.usbversionminor and usbdevice.usbversionsubminor.
USBDevice.usbVersionMinor - Web APIs
the other two properties are usbdevice.usbversionmajor and usbdevice.usbversionsubminor.
USBDevice.usbVersionSubminor - Web APIs
the other two properties are usbdevice.usbversionmajor and usbdevice.usbversionminor.
USBInterface - Web APIs
it can be changed by calling usbdevice.selectalternateinterface() with any other value found in alternates.
ValidityState.typeMismatch - Web APIs
when the value provided doesn't match the expected value based on the type for other input types, you get different errors.
Vibration API - Web APIs
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.
VideoPlaybackQuality - Web APIs
properties the videoplaybackquality interface doesn't inherit properties from any other interfaces.
Videotrack.language - Web APIs
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.
VideoTrack.selected - Web APIs
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.
VideoTrack - Web APIs
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.
VideoTrackList - Web APIs
selectedindex read only the index of the currently selected track, if any, or −1 otherwise.
Visual Viewport API - Web APIs
the visual viewport is the visual portion of a screen excluding on-screen keyboards, areas outside of a pinch-zoom area, or any other on-screen artifact that doesn't scale with the dimensions of a page.
WaveShaperNode.curve - Web APIs
their s-shape, for instance, helps create a smoother sounding result.
WaveShaperNode.oversample - Web APIs
their s-shape, for instance, helps create a smoother sounding result.
WaveShaperNode - Web APIs
their s-shape, for instance, helps create a smoother sounding result.
WebGL2RenderingContext.getFragDataLocation() - Web APIs
return value a glint indicating the assigned color number binding, or -1 otherwise.
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); var transformfeedbackoutputs = ['gl_position', 'anotheroutput']; gl.transformfeedbackvaryings(shaderprog, transformfeedbackoutputs, gl.interleaved_attribs); gl.linkprogram(shaderprog); specifications specification status comment webgl 2.0the definition of 'transformfeedbackvaryings' in that specification.
WebGL2RenderingContext - Web APIs
webgl2renderingcontext.copybuffersubdata() copies part of the data of a buffer to another buffer.
WebGLQuery - Web APIs
another kind of queries are disjoint timer queries, which allow you to measure performance and profiling of your gpu.
WebGLRenderingContext.getActiveUniform() - Web APIs
otherwise, it is 1 (this includes interface blocks instanced with arrays).
WebGLRenderingContext.getAttribLocation() - Web APIs
returns -1 otherwise.
WebGLRenderingContext.getProgramInfoLog() - Web APIs
return value a domstring that contains diagnostic messages, warning messages, and other information about the last linking or validation operation.
WebGLRenderingContext.getShaderInfoLog() - Web APIs
return value a domstring that contains diagnostic messages, warning messages, and other information about the last compile operation.
WebGLRenderingContext.getVertexAttrib() - Web APIs
otherwise false.
WebGLRenderingContext.isBuffer() - Web APIs
the webglrenderingcontext.isbuffer() method of the webgl api returns true if the passed webglbuffer is valid and false otherwise.
WebGLRenderingContext.isContextLost() - Web APIs
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.
WebGLRenderingContext.isFramebuffer() - Web APIs
the webglrenderingcontext.isframebuffer() method of the webgl api returns true if the passed webglframebuffer is valid and false otherwise.
WebGLRenderingContext.isProgram() - Web APIs
the webglrenderingcontext.isprogram() method of the webgl api returns true if the passed webglprogram is valid, false otherwise.
WebGLRenderingContext.isRenderbuffer() - Web APIs
the webglrenderingcontext.isrenderbuffer() method of the webgl api returns true if the passed webglrenderbuffer is valid and false otherwise.
WebGLRenderingContext.isShader() - Web APIs
the webglrenderingcontext.isshader() method of the webgl api returns true if the passed webglshader is valid, false otherwise.
WebGLRenderingContext.isTexture() - Web APIs
the webglrenderingcontext.istexture() method of the webgl api returns true if the passed webgltexture is valid and false otherwise.
WebGLRenderingContext.lineWidth() - Web APIs
because of these implementation defined limits it is not recommended to use line widths other than 1.0 since there is no guarantee any user's browser will display any other width.
WebGLRenderingContext.pixelStorei() - Web APIs
glboolean false true, false webgl gl.unpack_premultiply_alpha_webgl multiplies the alpha channel into the other color channels glboolean false true, false webgl gl.unpack_colorspace_conversion_webgl default color space conversion or no color space conversion.
WebGLRenderingContext.stencilFunc() - Web APIs
gl.enable(gl.stencil_test); gl.stencilfunc(gl.less, 0, 0b1110011); to get the current stencil function, reference value, or other stencil information, query the following constants with getparameter().
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
gl.enable(gl.stencil_test); gl.stencilfuncseparate(gl.front, gl.less, 0.2, 1110011); to get the current stencil function, reference value, or other stencil information, query the following constants with getparameter().
WebGLRenderingContext.texImage2D() - Web APIs
d_byte 4 4 rgb unsigned_byte 3 3 rgba unsigned_short_4_4_4_4 4 2 rgba unsigned_short_5_5_5_1 4 2 rgb unsigned_short_5_6_5 3 2 luminance_alpha unsigned_byte 2 2 luminance unsigned_byte 1 1 alpha unsigned_byte 1 1 other possible values in webgl2 for the versions of teximage2d that take an arraybufferview or a glintptr offset sized format base format r bits g bits b bits a bits shared bits color renderable texture filterable r8 red 8 ● ● r8_snorm red s8 ● ...
WebGLShader - Web APIs
examples creating a vertex shader note that there are many other strategies for writing and accessing shader source code strings.
A basic 2D WebGL animation example - Web APIs
since the two axes aren't the same length, if we don't adjust the values of one of the two axes, the square will get stretched out in one direction or the other.
Clearing by clicking - Web APIs
// otherwise, initialize the drawing buffer (the viewport).
Detect WebGL - Web APIs
this is also done in other graphics {̣{glossary("api")}}, such as the canvas 2d rendering context.
Raining rectangles - Web APIs
// otherwise we won't get any animation.
Compressed texture formats - Web APIs
usage unless otherwise specified, this article applies to both webgl 1 and 2 contexts.
Data in WebGL - Web APIs
WebAPIWebGL APIData
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.
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.
Using shaders to apply color in WebGL - Web APIs
by default, all other pixels' colors (and all its other attributes, including position) are computed using interpolation, automatically creating smooth gradients.
WebGL tutorial - Web APIs
webgl elements can be mixed with other html elements and composited with other parts of the page or page background.
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
guides data in webgl a guide to variables, buffers, and other types of data used when writing webgl code.
Taking still photos with WebRTC - Web APIs
finally, the width and height of both the video and the canvas are set to match each other by calling element.setattribute() on each of the two properties on each element, and setting widths and heights as appropriate.
WebRTC Statistics API - Web APIs
mapping of statistic category names to the dictionaries they implement statistic category name (rtcstatstype) description dictionaries implemented candidate-pair statistics describing the change from one rtcicetransport to another, such as during an ice restart.
Writing a WebSocket server in C# - Web APIs
full list of opcodes the second byte, which currently has a value of 131, is another bitfield that breaks down as such: mask (bit 0) payload length (bit 1:7) 1 0x83=0000011 mask bit: defines whether the "payload data" is masked.
Writing a WebSocket server in Java - Web APIs
although other server-side languages can be used to create a websocket server, this example uses oracle java to simplify the example code.
WebXR application life cycle - Web APIs
when the time comes (such as when the user exits your app or navigates away from your site), end the xr session; otherwise, continue the loop until the user chooses to exit xr mode.
Targeting and hit detection - Web APIs
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.
Keyframe Formats - Web APIs
a single keyframe), and the browser will infer the other end of the animation if it is able to.
Web Animations API - Web APIs
extensions to other interfaces the web animations api adds some new features to document and element.
Tools for analyzing Web Audio usage - Web APIs
while working on your web audio api code, you may find that you need tools to analyze the graph of nodes you create or to otherwise debug your work.
Web Speech API - Web APIs
speech synthesis speechsynthesis the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides.
Web Storage API - Web APIs
in addition, we have provided an event output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information outputted as the storageevent is fired.
Window.alert() - Web APIs
WebAPIWindowalert
example window.alert("hello world!"); alert("hello world!"); both produce: notes the alert dialog should be used for messages which do not require any response on the part of the user, other than the acknowledgement of the message.
Window: animationcancel event - Web APIs
in other words, any time it stops running without sending an animationend event.
Window: animationiteration event - Web APIs
the animationiteration event is fired when an iteration of a css animation ends, and another one begins.
Window: beforeunload event - Web APIs
if the user confirms, the browser navigates to the new page, otherwise it cancels the navigation.
window.cancelAnimationFrame() - Web APIs
other browsers can use something like date.now().
Window.console - Web APIs
WebAPIWindowconsole
currently there are many implementation differences among browsers, but work is being done to bring them together and make them more consistent with one another.
Window.devicePixelRatio - Web APIs
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.
window.dump() - Web APIs
WebAPIWindowdump
on other operating systems, it's enough to launch the application from a terminal.
Window: error event - Web APIs
bubbles no cancelable no interface event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise.
Window.find() - Web APIs
WebAPIWindowfind
returns true if the string is found; otherwise, false.
Window.frameElement - Web APIs
if the window isn't embedded into another document, or if the document into which it's embedded has a different origin, the value is null instead.
Window.fullScreen - Web APIs
WebAPIWindowfullScreen
syntax isinfullscreen = windowref.fullscreen; with chrome privileges, the property is read-write, otherwise it is read-only.
Window.getAttention() - Web APIs
on linux, the behaviour varies from window manager to window manager - some flash the taskbar button, others focus the window immediately.
Window.history - Web APIs
WebAPIWindowhistory
for security reasons the history object doesn't allow the non-privileged code to access the urls of other pages in the session history, but it does allow it to navigate the session history.
Window.mozAnimationStartTime - Web APIs
this value should be used instead of, for example, date.now(), because this value will be the same for all animations started in this window during this refresh interval, allowing them to remain in sync with one another.
Window.name - Web APIs
WebAPIWindowname
syntax string = window.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.
Window.ondragdrop - Web APIs
WebAPIWindowondragdrop
removed in firefox 50, and never implemented in any other browser.
Window.onpaint - Web APIs
WebAPIWindowonpaint
this event occurs after the load event for a window, and reoccurs each time the window needs to be re-rendered, such as when another window obscures it and is then cleared away.
Obsolete features - Web APIs
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.
Window: pageshow event - Web APIs
this includes: initially loading the page navigating to the page from another page in the same window or tab restoring a frozen page on mobile oses returning to the page using the browser's forward or back buttons during the initial page load, the pageshow event fires after the load event.
Window.pkcs11 - Web APIs
WebAPIWindowpkcs11
summary returns the pkcs11 object, which is used to install drivers and other software associated with the pkcs11 protocol.
Window.scrollX - Web APIs
WebAPIWindowscrollX
additionally, older versions of internet explorer (< 9) do not support either property and must be worked around by checking other non-standard properties.
Window.scrollY - Web APIs
WebAPIWindowscrollY
additionally, older versions of internet explorer (< 9) do not support either property and must be worked around by checking other non-standard properties.
Window.setImmediate() - Web APIs
this method is used to break up long running operations and run a callback function immediately after the browser has completed other operations such as events and display updates.
Window.stop() - Web APIs
WebAPIWindowstop
because of how scripts are executed, this method cannot interrupt its parent document's loading, but it will stop its images, new windows, and other still-loading objects.
Window: storage event - Web APIs
the storage event of the window interface fires when a storage area (localstorage) has been modified in the context of another document.
Window: unhandledrejection event - Web APIs
you can prevent that from happening by adding a handler for unhandledrejection events that—in addition to any other tasks you wish to perform—calls preventdefault() to cancel the event, preventing it from bubbling up to be handled by the runtime's logging code.
WindowOrWorkerGlobalScope.atob() - Web APIs
you can use the btoa() method to encode and transmit data which may otherwise cause communication problems, then transmit it and use the atob() method to decode the data again.
Worker() - Web APIs
WebAPIWorkerWorker
though 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.
WorkerGlobalScope.console - Web APIs
if you are calling console.log() from a dedicatedworkerglobalscope or other worker scope that acts on a single loaded window, that tab's web console will receive the logs.
WorkerGlobalScope - Web APIs
for example, you could import another script into the worker and print out the contents of the worker scope's navigator object using the following two lines: importscripts('foo.js'); console.log(navigator); since the global scope of the worker script is effectively the global scope of the worker you are running (dedicatedworkerglobalscope or whatever) and all worker global scopes inherit methods, properties, etc.
Worklet - Web APIs
WebAPIWorklet
web audio render thread web audio api animationworklet for creating scroll-linked and other high performance procedural animations.
WritableStream.getWriter() - Web APIs
while the stream is locked, no other writer can be acquired until this one is released.
WritableStream - Web APIs
while the stream is locked, no other writer can be acquired until this one is released.
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
exceptions typeerror the provided stream value is not a writablestream, or it is locked to another writer already.
WritableStreamDefaultWriter.releaseLock() - Web APIs
if the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.
XDomainRequest - Web APIs
it was removed in internet explorer 10 in favor of using xmlhttprequest with proper cors; if you are targeting internet explorer 10 or later, or wish to support any other browser, you need to use standard http access control.
Sending and Receiving Binary Data - Web APIs
add information about other browsers' support here.
XMLHttpRequest() - Web APIs
this can't be combined with sending cookies or other user credentials.
XMLHttpRequest.multipart - Web APIs
note: when this is set, the onload handler and other event handlers are not reset after the first xmldocument is loaded, and the onload handler is called after each part of the response is received.
XMLHttpRequest.overrideMimeType() - Web APIs
the xmlhttprequest method overridemimetype() specifies a mime type other than the one provided by the server to be used instead when interpreting the data being transferred in a request.
XMLHttpRequest.responseText - Web APIs
since the responsetext property is only valid for text content, any other value is an error condition.
XMLHttpRequest.responseXML - Web APIs
responsexml is null for any other types of data, as well as for data: urls.
XMLHttpRequest.sendAsBinary() - Web APIs
another possible approach to send binary data is the stringview non native typed arrays superclass in conjunction with the send() method.
XMLHttpRequest - Web APIs
it must be called before any other method calls.
XMLSerializer.serializeToString() - Web APIs
the following types are also permitted as descendants of the root node, in addition to node and attr: documenttype document documentfragment element comment text processinginstruction attr if any other type is encountered, a typeerror exception is thrown.
XPathException - Web APIs
constants constant value description invalid_expression_err 51 if the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific xpathevaluator or contains specialized extension functions or variables not supported by this implementation.
XRBoundedReferenceSpace - Web APIs
the specified bounds may, in fact, describe the shape and size of the room the user is located in, in order to let the webxr site or application prevent the user from colliding with the walls or other obstacles in the real world.
XREye - Web APIs
WebAPIXREye
none the xrview describes a monoscopic view, or the view otherwise doesn't represent a particular eye's point-of-view.
XRFrame - Web APIs
WebAPIXRFrame
in addition to providing a reference to the xrsession for which this frame is to be rendered, the getviewerpose() method is provided to obtain the xrviewerpose describing the viewer's position and orientation in space, and getpose() can be used to create an xrpose describing the relative position of one xrspace relative to another.
XRInputSource.gripSpace - Web APIs
the y-axis is implied by the relationship between the other two axes; as is always the case, it's the cross product of the other two axes (lying 90° away from both the x and z axes).
XRInputSource.profiles - Web APIs
upon does not uniquely identify a specific device; rather, it identifies a configuration that the product is capable of using does not provide information about handedness of the device, if applicable the webxr input profiles registry is used by device developers and browser developers to attempt to ensure that a given device will report the same profile strings regardless of which browser or other user agent you use.
XRInputSource.targetRaySpace - Web APIs
the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks.
XRInputSourceArray.entries() - Web APIs
let sources = xrsession.inputsources; for (let input of sources.entries()) { if (input.gamepad) { checkgamepad(input.gamepad); } else { if (input.targetraymode === "tracked-pointer" && input.handedness === player.handedness) { /* handle main hand controller */ handlemainhandinput(input); } else { /* handle other inputs */ } } } for each input in the llist, gamepad inputs are dispatched to a checkgamepad() with the input's gamepad object, taken from its gamepad property, as an input for other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method.
XRInputSourceArray.forEach() - Web APIs
let inputsources = xrsession.inputsources; inputsources.foreach((input) => { if (input.gamepad) { checkgamepad(input.gamepad); } else { if (input.targetraymode === "tracked-pointer" && input.handedness === player.handedness) { /* handle main hand controller */ handlemainhandinput(input); } else { /* handle other inputs */ } } }); for each input in the llist, the callback dispatches gamepad inputs to a checkgamepad() with the input's gamepad object, taken from its gamepad property, as an input for other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method.
XRInputSourceEvent.inputSource - Web APIs
this event indicates an action the user has taken using a webxr input controller, such as a hand controller, motion sensing device, or other input apparatus.
XRPermissionStatus.granted - Web APIs
otherwise, typically, one of the other reference space types will be used more often.
XRPose.transform - Web APIs
WebAPIXRPosetransform
if the source is a controller in the user's primary hand, a function is called on the targeted object called primaryaction(); otherwise, it calls the targeted object's offhandaction() function.
XRPose - Web APIs
WebAPIXRPose
e which has been adjusted to position and orient the node to provide the desired viewing position and angle: viewerpose = xrframe.getviewerpose(adjreferencespace); here, adjreferencespace is a reference space which has been updated using the base frame of reference for the frame and any adjustments needed to position the viewer based on movement or rotation which is being supplied from a source other than the xr device, such as keyboard or mouse inputs.
XRReferenceSpaceType - Web APIs
otherwise, typically, one of the other reference space types will be used more often.
XRRenderStateInit - Web APIs
the default value is otherwise π * 0.5 (half of the value of pi).
XRSession.requestAnimationFrame() - Web APIs
this can be used to obtain the poses of the viewer and the scene itself, as well as other information needed to render a frame of an ar or vr scene.
XRSession.requestReferenceSpace() - Web APIs
otherwise, typically, one of the other reference space types will be used more often.
XRSessionMode - Web APIs
important: the immersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation.
XRSpace - Web APIs
WebAPIXRSpace
there are exceptions to this static nature; most commonly, an xrreferencespace may move in order to adjust based on reconfiguration of the user's headset or other motion-sensitive device.
XRSystem: devicechange event - Web APIs
if there is, the button to enter xr mode is enabled; otherwise it's disabled.
XRSystem: requestSession() - Web APIs
important: the immersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation.
XRSystem - Web APIs
WebAPIXRSystem
if, on the other hand, there is already an ongoing xr session, we instead call end() to end the current session.
XRViewport.y - Web APIs
WebAPIXRViewporty
note: although other web apis typically consider the y axis to begin at the top and grow larger progressing downward, webgl reverses this, with y growing larger as it goes upward on the screen.
XRViewport - Web APIs
the precise orientation of the coordinate system may vary with other surface types, but in webgl, the origin (0, 0) is located at the bottom-left corner of the surface.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
the right eye gets the other half of the frame buffer, with its viewport's x set at 639.
XRWebGLLayerInit.alpha - Web APIs
otherwise, the color buffer won't have an alpha channel.
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
a value of 2.0, on the other hand, creates a frame buffer whose resolution is double that of the actual display buffer.
XRWebGLLayerInit.ignoreDepthValues - Web APIs
the depth buffer is typically used to assist in ordering vertices and, by extension, polygons while compositing, to ensure that the scene is correctly composited, with objects the correct distance away and with clipping and other distance-related computations performed as accurately as possible.
Introduction - Web APIs
xsl (extensible stylesheet language) transformations are composed of two parts: xsl elements, which allow the transformation of an xml tree into another markup tree and xpath, a selection language for trees.
XSL Transformations in Mozilla FAQ - Web APIs
this includes stuff like text entered into textfields and other dynamic changes.
XSLTProcessor - Web APIs
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.
msPutPropertyEnabled - Web APIs
otherwise, it returns an hresult error code.
msWriteProfilerMark - Web APIs
otherwise, it returns an hresult error code.
Using the alert role - Accessibility
dynamic changes that are less urgent should use a less aggressive method, such as aria-live="polite" or other live region roles.
Using the aria-labelledby attribute - Accessibility
in addition to form elements, you can use the aria-labelledby attribute to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and other types of objects.
Using the aria-valuenow attribute - Accessibility
value string representation of a number possible effects on user agents and assistive technology for elements with role progressbar and scrollbar, assistive technologies should render the actual value as a percentage, calculated as a position on the range from aria-valuemin to aria-valuemax if both are defined, otherwise the actual value with a percent indicator.
Using the log role - Accessibility
in contrast to other types of live region, this role is sequentially ordered and new information is only added to the end of the log.
Using the status role - Accessibility
if another part of the page controls what appears in the status, the relationship should be made explicit via the aria-controls attribute.
ARIA annotations - Accessibility
2019, 19:29</time></p> </div> <div role="comment" id="thread-2" data-author="chris"> <h3>marcus said</h3> <p class="comment-text">the guitar solo could do with a touch more chorus, and a slightly lower volume.</p> <p><time datetime="2019-03-29t15:35">march 29 2019, 15:35</time></p> </div> nested comments are also possible with aria annotations — simply nest the comments inside one another, like so: <div role="comment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="comment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> <div role="comment" data-author="marcus"> <h3>marcus replied</h3> <p class="comment-text">i don't know about that.
ARIA: Comment role - Accessibility
></p> </div> <div role="comment" id="thread-2" data-author="chris"> <h3>marcus said</h3> <p class="comment-text">the guitar solo could do with a touch more chorus, and a slightly lower volume.</p> <p><time datetime="2019-03-29t15:35">march 29 2019, 15:35</time></p> </div> nested comments nested comments are also possible with aria annotations — simply nest the comments inside one another, like so: <div role="comment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="comment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> <div role="comment" data-author="marcus"> <h3>marcus replied</h3> <p class="comment-text">i don't know about that.
ARIA: form role - Accessibility
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.
ARIA: heading role - Accessibility
although theoretically you can go higher, and some screen readers may support it, the results can be unpredictable with other browser/screen reader combinations.
Alerts - Accessibility
because this is not allowed by the windows api specs, and possibly others.
HTML To MSAA - Accessibility
io" role_system_ radiobutton n/a n/a state_system_ marqueed used as state checkable state_system_ checked if checked property of dom element returns true n/a "select" event_object_ statechange when state is changed label role_system_ statictext from child nodes n/a n/a n/a n/a n/a legend role_system_ statictext n/a n/a n/a label_for (0x1002), points to caption element n/a n/a li and others role_system_ listitem n/a n/a state_system_ readonly n/a n/a n/a contains child accessible for list bullet ol, ul and others role_system_ list n/a n/a state_system_ readonly n/a n/a n/a optgroup bstr role n/a n/a n/a n/a n/a n/a option role_system_ listitem from @label attribute, from child text nodes n/a state_system_ selected if option is selected n/a "select" event_object_ selectio...
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
WebCSS--*
property names that are prefixed with --, like --example-name, represent custom properties that contain a value that can be used in other declarations using the var() function.
-moz-image-rect - CSS: Cascading Style Sheets
the other corners follow a similar pattern: #box3 { background-image: -moz-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 50%, 50%, 100%, 0%); width:133px; height:136px; position:absolute; } #box4 { background-image: -moz-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 50%, 100%, 100%, 50%); width:133px; height:136px; position:absolute; } html...
-moz-orient - CSS: Cascading Style Sheets
formal definition initial valueinlineapplies toany element; it has an effect on progress and meter, but not on <input type="range"> or other elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax inline | block | horizontal | vertical examples html <p> the following progress meter is horizontal (the default): </p> <progress max="100" value="75"></progress> <p> the following progress meter is vertical: </p> <progress class="vert" max="100" value="75"></progress> css .vert { -moz-orient: vertic...
-moz-outline-radius-bottomleft - CSS: Cascading Style Sheets
toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples rounding a outline since this is a firefox-only property, this example will not display the desired effect if you are viewing this in a browser other than firefox.
-moz-outline-radius-bottomright - CSS: Cascading Style Sheets
pea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's bottom-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-bottomright: 2em; } result the example above will not display the desired effect if you are viewing this in a browser other than firefox.
-moz-outline-radius-topleft - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples the example below will not display the desired effect if you are viewing this in a browser other than firefox.
-moz-outline-radius-topright - CSS: Cascading Style Sheets
ion typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's top-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-topright: 2em; } result the example above will not display the desired effect if you are viewing this in a browser other than firefox.
-moz-outline-radius - CSS: Cascading Style Sheets
: a length, percentage or calc();-moz-outline-radius-bottomright: a length, percentage or calc();-moz-outline-radius-bottomleft: a length, percentage or calc(); formal syntax <outline-radius>{1,4} [ / <outline-radius>{1,4} ]?where <outline-radius> = <length> | <percentage> examples rounding an outline note: this example will not display the desired effect if you are viewing this in a browser other than firefox.
-webkit-line-clamp - CSS: Cascading Style Sheets
in most cases you will also want to set overflow to hidden, otherwise the contents won't be clipped but an ellipsis will still be shown after the specified number of lines.
:-moz-first-node - CSS: Cascading Style Sheets
the :-moz-first-node css pseudo-class is a mozilla extension that represents any element that is the first child node of some other element.
:-moz-last-node - CSS: Cascading Style Sheets
the :-moz-last-node css pseudo-class is a mozilla extension that represents any element that is the last child node of some other element.
:-moz-ui-invalid - CSS: Cascading Style Sheets
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.
:-moz-ui-valid - CSS: Cascading Style Sheets
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.
::after (:after) - CSS: Cascading Style Sheets
WebCSS::after
this shows how flexible ::before and ::after can be, though for the most accessible experience a semantic disclosure widget created in some other way (such as with details and summary elements) is likely to be more appropriate.
::backdrop - CSS: Cascading Style Sheets
::backdrop neither inherits from nor is inherited by any other elements.
::cue-region - CSS: Cascading Style Sheets
this can be used to style captions and other cues in media with vtt tracks.
::cue - CSS: Cascading Style Sheets
WebCSS::cue
this can be used to style captions and other cues in media with vtt tracks.
:any-link - CSS: Cascading Style Sheets
WebCSS:any-link
in other words, it matches every <a>, <area>, or <link> element that has an href attribute.
:dir() - CSS: Cascading Style Sheets
WebCSS:dir
other document types may have different methods.
:focus-within - CSS: Cascading Style Sheets
in other words, it represents an element that is itself matched by the :focus pseudo-class or has a descendant that is matched by :focus.
:host - CSS: Cascading Style Sheets
WebCSS:host
the :host css pseudo-class selects the shadow host of the shadow dom containing the css it is used inside — in other words, this allows you to select a custom element from inside its shadow dom.
:hover - CSS: Cascading Style Sheets
WebCSS:hover
depending on the browser, the :hover pseudo-class might never match, match only for a moment after touching an element, or continue to match even after the user has stopped touching and until the user touches another element.
:invalid - CSS: Cascading Style Sheets
WebCSS:invalid
the :invalid css pseudo-class represents any <input> or other <form> element whose contents fail to validate.
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
WebCSS:is
since <section>, <article>, <aside>, and <nav> are commonly nested together, without :is(), styling them to match one another can be tricky.
:lang() - CSS: Cascading Style Sheets
WebCSS:lang
for other document types there may be other document methods for determining the language.
:left - CSS: Cascading Style Sheets
WebCSS:left
all other properties will be ignored, and only the page box, not the document content on the page, will be affected.
:link - CSS: Cascading Style Sheets
WebCSS:link
to style links appropriately, put the :link rule before all other link-related rules, as defined by the lvha-order: :link — :visited — :hover — :active.
:not() - CSS: Cascading Style Sheets
WebCSS:not
the list must not contain another negation selector or a pseudo-element.
:nth-last-of-type() - CSS: Cascading Style Sheets
formal syntax :nth-last-of-type( <nth> )where <nth> = <an-plus-b> | even | odd examples html <div> <span>this is a span.</span> <span>this is another span.</span> <em>this is emphasized.</em> <span>wow, this span gets limed!!!</span> <strike>this is struck through.</strike> <span>here is one last span.</span> </div> css span:nth-last-of-type(2) { background-color: lime; } result specifications specification status comment selectors level 4the definition of ':nth-last-of-type' in that specification.
:read-only - CSS: Cascading Style Sheets
the :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs.the :read-write pseudo-class on the other hand is used to provide some nicer styling to the editable <textarea>.
:read-write - CSS: Cascading Style Sheets
the :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs.the :read-write pseudo-class on the other hand is used to provide some nicer styling to the editable <textarea>.
:right - CSS: Cascading Style Sheets
WebCSS:right
all other properties will be ignored, and only the page box, not the document content on the page, will be affected.
:target - CSS: Cascading Style Sheets
WebCSS:target
click on the link above to try out!</p> <p id="p2">this is <i>another paragraph</i>, also accessible from the links above.
:where() - CSS: Cascading Style Sheets
WebCSS:where
in other versions of firefox it is behind a pref — layout.css.is-where-selectors.enabled).
negative - CSS: Cascading Style Sheets
if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored.
font-family - CSS: Cascading Style Sheets
syntax /* <string> values */ font-family: "font family"; font-family: 'another font family'; /* <custom-ident> value */ font-family: examplefont; values <family-name> specifies the name of the font family.
font-stretch - CSS: Cascading Style Sheets
accessibility concerns people with dyslexia and other cognitive conditions may have difficulty reading fonts that are too condensed, especially if the font has a low contrast color ratio.
font-style - CSS: Cascading Style Sheets
on the other hand, if a true italicized version of the font family exists, we can include it in the src descriptor and specify the font style as italic, so that it is clear that the font is italicized.
src - CSS: Cascading Style Sheets
WebCSS@font-facesrc
as with other urls in css, the url may be relative, in which case it is resolved relative to the location of the style sheet containing the @font-face rule.
-ms-high-contrast - CSS: Cascading Style Sheets
because high contrast mode themes are dynamic, use these color keywords in place of other css color values.
display-mode - CSS: Cascading Style Sheets
in this mode, the user agent will exclude ui elements for controlling navigation, but can include other ui elements such as a status bar.
forced-colors - CSS: Cascading Style Sheets
color fill stroke text-decoration-color text-emphasis-color border-color outline-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.
prefers-color-scheme - CSS: Cascading Style Sheets
(any other value causes firefox to return light.) the prefers-color-scheme css media feature is used to detect if the user has requested the system use a light or dark color theme.
scan - CSS: Cascading Style Sheets
WebCSS@mediascan
rather, it means the process by which an image is painted onto a television screen (or other device).
bleed - CSS: Cascading Style Sheets
WebCSS@pagebleed
otherwise it computes to zero.
@page - CSS: Cascading Style Sheets
WebCSS@page
attempts to change any other css properties will be ignored.
height - CSS: Cascading Style Sheets
WebCSS@viewportheight
syntax /* one value */ height: auto; height: 320px; height: 15em; /* two values */ height: 320px 200px; values auto the used value is calculated from the other css descriptors' values.
width - CSS: Cascading Style Sheets
WebCSS@viewportwidth
syntax /* an example with one viewport value: */ @viewport { width: 320px; } /* an example with two viewport values: */ @viewport { width: 320px, 120px; } values auto the used value is calculated from the other css descriptors' values.
@viewport - CSS: Cascading Style Sheets
WebCSS@viewport
this may be either the full screen or the full screen area minus areas controlled by the operating system (such as a taskbar) or the application-available screen area (either the full screen or the screen minus any areas owned by the operating system or other applications).
Detecting CSS animation support - CSS: Cascading Style Sheets
otherwise, we can use javascript to create the desired css animation effects.
Border-image generator - CSS: Cascading Style Sheets
</div> <!-- border-image-width --> <div id="border-width-control" class="category"> <div class="title"> border-image-width </div> </div> <!-- border-image-outset --> <div id="border-outset-control" class="category"> <div class="title"> border-image-outset </div> </div> <!-- other-settings --> <div id="aditional-properties" class="category"> <div class="title"> aditional-properties </div> <div class="property"> <div class="name"> repeat-x </div> <div class="ui-dropdown border-repeat" data-topic="image-repeat-x" data-selected="2"> <div data-value="0">repeat</div> ...
Resizing background images with background-size - CSS: Cascading Style Sheets
d-image: url(https://www.mozilla.org/media/img/logos/firefox/logo-quantum.9c5e96634f92.png); background-size: 150px; width: 300px; height: 300px; border: 2px solid; color: pink; } result stretching an image you can also specify both the horizontal and vertical sizes of the image, like this: background-size: 300px 150px; the result looks like this: scaling an image up on the other end of the spectrum, you can scale an image up in the background.
Using multiple backgrounds - CSS: Cascading Style Sheets
these are layered atop one another with the first background you provide on top and the last background listed in the back.
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
styles in the css backgrounds and borders module allow filling backgrounds with color or an image (clipped or resized), or modifying them in other ways.
Using URL values for the cursor property - CSS: Cascading Style Sheets
if that file does not exist or is not valid for some other reason, bar.gif is tried, and if that can't be used either, auto will be used.
Box alignment in Flexbox - CSS: Cascading Style Sheets
as soon as there is no space available for the auto margin, the item behaves in the same way as all the other flex items and shrinks to try to fit into space.
CSS Basic Box Model - CSS: Cascading Style Sheets
a box overflow overflow-x overflow-y properties controlling the size of a box height width max-height max-width min-height min-width properties controlling the margins of a box margin margin-bottom margin-left margin-right margin-top margin-trim properties controlling the paddings of a box padding padding-bottom padding-left padding-right padding-top other properties visibility guides introduction to the css box model explains one of the fundamental concept of css: the box model.
Basic Concepts of Multicol - CSS: Cascading Style Sheets
key concepts and terminology multicol is unlike any of the other layout methods we have in css in that it fragments the content, including all descendent elements, into columns.
Handling content breaks in multicol - CSS: Cascading Style Sheets
a column box can contain other markup and there are many places where a break would not be ideal.
CSS Display - CSS: Cascading Style Sheets
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 areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and writing modes css grid layout and accessibility css grid layout and...
CSS Flexible Box Layout - CSS: Cascading Style Sheets
justify-content align-content align-items align-self place-content place-items row-gap column-gap gap glossary entries flexbox flex container flex item main axis cross axis flex guides basic concepts of flexbox an overview of the features of flexbox relationship of flexbox to other layout methods how flexbox relates to other layout methods, and other css specifications aligning items in a flex container how the box alignment properties work with flexbox.
CSS Grid Layout - CSS: Cascading Style Sheets
-row-start grid-column-start grid-row-end grid-column-end grid-row grid-column grid-area row-gap column-gap gap css functions repeat() minmax() fit-content() css data types <flex> glossary entries grid grid lines grid tracks grid cell grid area gutters grid axis grid row grid column guides basic concepts of grid layout relationship of grid layout to other layout methods layout using line-based placement grid template areas layout using named grid lines auto-placement in css grid layout box alignment in css grid layout css grid, logical values and writing modes css grid layout and accessibility css grid and progressive enhancement realising common layouts using css grid subgrid external resources css grid and ie11 (polyfill) exampl...
CSS Images - CSS: Cascading Style Sheets
css images is a module of css that defines what types of images can be used (the <image> type, containing urls, gradients and other types of images), how to resize them and how they, and other replaced content, interact with the different layout models.
Using CSS counters - CSS: Cascading Style Sheets
the counter's name must not be "none", "inherit", or "initial"; otherwise the declaration is ignored.
Logical properties for floating and positioning - CSS: Cascading Style Sheets
new two- and four-value shorthands as with other properties in the specification we have some new shorthand properties, which give the ability to set two or four values at once.
CSS Logical Properties and Values - CSS: Cascading Style Sheets
ne-start padding (logical keyword) padding-block padding-block-end padding-block-start padding-inline padding-inline-end padding-inline-start properties for floating and positioning clear (inline-end and inline-start keywords) float (inline-end and inline-start keywords) inset inset-block inset-block-end inset-block-start inset-inline inset-inline-end inset-inline-start other properties caption-side (inline-end and inline-start keywords) overflow-block overflow-inline overscroll-behavior-block overscroll-behavior-inline resize (block and inline keywords) text-align (end and start keywords) deprecated properties offset-block-end (now inset-block-end ) offset-block-start (now inset-block-start ) offset-inline-end (now inset-inline-end )...
CSS Overflow - CSS: Cascading Style Sheets
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.
Stacking without the z-index property - CSS: Cascading Style Sheets
element #5 is static, and so is drawn below the other four elements, even though it comes later in the html markup.
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
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.
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
suppose you wish to style any h2 element that is the target of a url, but do not want any other kind of element to get a target style.
Shapes from box values - CSS: Cascading Style Sheets
for more complex shapes you will need to use one of the basic shapes as a value, or define your shape from an image as covered in other guides in this section.
Using CSS transforms - CSS: Cascading Style Sheets
it is a space-separated list of transforms, which are applied one after the other, as requested by the composition operation.
Descendant combinator - CSS: Cascading Style Sheets
/* 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.
Questions about CSS - CSS: Cascading Style Sheets
WebCSSFAQ
cascading style sheets (css) is a rule-based language allowing developers to define styles to apply to html elements (or other markup structures).
Column layouts - CSS: Cascading Style Sheets
when you are happy for wrapped items to share out space along their line only and not line up with items in other lines.
Grid wrapper - CSS: Cascading Style Sheets
lbacks or alternative methods when using this recipe at page level it can be useful to set a max-width along with left and right auto margins to center the content horizontally: .grid { max-width: 1200px; margin: 0 auto; // horizontally centers the container } /* remove the max-width and margins if the browser supports grid */ @supports (display: grid) { .grid { display: grid; /* other grid code goes here */ max-width: none; margin: 0; } } to “break out” a full-width item to the edge of the viewport you can then use this trick (courtesy of una kravets): .item { width: 100vw; margin-left: 50%; transform: translate3d(-50%, 0, 0); } this gives a good approximation of the layout, only without the benefit of being able to align items easily on an exact grid.
Pagination - CSS: Cascading Style Sheets
recipe download this example choices made this pattern is laid out using flexbox — one flex container nested inside another.
Split Navigation - CSS: Cascading Style Sheets
requirements a common navigation pattern is to have one element pushed away from the others.
Sticky footers - CSS: Cascading Style Sheets
then we set our main content to flex-grow: 1 and the other two elements to flex-shrink: 0 — this prevents them from shrinking smaller when content fills the main area.
Testing media queries programmatically - CSS: Cascading Style Sheets
this makes our listener perform adjustments based on the current device orientation; otherwise, our code might assume the device is in portrait mode at startup, even if it's actually in landscape mode.
Mozilla CSS extensions - CSS: Cascading Style Sheets
e-theme -moz-maemo-classic -moz-device-pixel-ratio -moz-os-version -moz-scrollbar-end-backward -moz-scrollbar-end-forward -moz-scrollbar-start-backward -moz-scrollbar-start-forward -moz-scrollbar-thumb-proportional -moz-touch-enabled -moz-windows-accent-color-in-titlebar -moz-windows-classic -moz-windows-compositor -moz-windows-default-theme -moz-windows-glass -moz-windows-theme other -moz-alt-content (see bug 11011) ...
Paged media - CSS: Cascading Style Sheets
paged media properties control the presentation of content for print or any other media that splits content into discrete pages.
Pseudo-classes - CSS: Cascading Style Sheets
no significant change for other pseudo-classes defined in selectors level 3 and html5 (though semantic meaning not taken over).
Cubic Bezier Generator - CSS: Cascading Style Sheets
ocument.getelementbyid('y2').value; drawbeziercurve(x1, y1, x2, y2); } const radius = 4; // place needed to draw the rulers const rulers = 30.5; const margin = 10.5; const basic_scale_size = 5; // size of 0.1 tick on the rulers var scaling; //limitation: scaling is computed once: if canvas.height/canvas.width change it won't be recalculated var dragsm = 0; // drag state machine: 0 = nodrag, others = object being dragged function initcanvas() { // get the canvas element using the dom var canvas = document.getelementbyid('bezier'); // make sure we don't execute when canvas isn't supported if (canvas.getcontext) { // use getcontext to use the canvas for drawing var ctx = canvas.getcontext('2d'); scaling = math.min(canvas.height - rulers - margin, ca...
Tools - CSS: Cascading Style Sheets
WebCSSTools
other tools css animation - stylie to check the device display information (helpful in responsive web design) - mydevice.io css menus - cssmenumaker.com a mighty, modern css linter that helps you enforce consistent conventions and avoid errors in your stylesheets - stylelint ...
Type selectors - CSS: Cascading Style Sheets
in other words, it selects all elements of the given type within a document.
all - CSS: Cascading Style Sheets
WebCSSall
it can set properties to their initial or inherited values, or to the values specified in another stylesheet origin.
animation-fill-mode - CSS: Cascading Style Sheets
the element will instead be displayed using any other css rules applied to it.
animation-name - CSS: Cascading Style Sheets
it can be used to deactivate an animation without changing the ordering of the other identifiers, or to deactivate animations coming from the cascade.
background-blend-mode - CSS: Cascading Style Sheets
the background-blend-mode css property sets how an element's background images should blend with each other and with the element's background color.
background-clip - CSS: Cascading Style Sheets
if the element has no background-image or background-color, this property will only have a visual effect when the border has transparent regions or partially opaque regions (due to border-style or border-image); otherwise, the border masks the difference.
background-image - CSS: Cascading Style Sheets
the background images are drawn on stacking context layers on top of each other.
background - CSS: Cascading Style Sheets
d to the height for vertical offsetsbackground-size: relative to the background positioning areacomputed valueas each of the properties of the shorthand:background-image: as specified, but with <url> values made absolutebackground-position: a list, each item consisting of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentagebackground-size: as specified, but with relative lengths converted into absolute lengthsbackground-repeat: a list, each item consisting of two keywords, one per dimensionbackground-origin: as specifiedbackground-clip: as specifiedbackground-attachment: as specifiedbackground-color: computed coloranimation typeas each of the properties of the shorthand:background-color: a colorb...
border-block-color - CSS: Cascading Style Sheets
border-block-color: yellow; border-block-color: #f5f6f7; the border color in the other dimension can be set with border-inline-color which sets border-inline-start-color, and border-inline-end-color.
border-block-end-color - CSS: Cascading Style Sheets
syntax border-block-end-color: yellow; border-block-end-color: #f5f6f7; related properties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element.
border-block-end-style - CSS: Cascading Style Sheets
syntax /* <'border-style'> values */ border-block-end-style: dashed; border-block-end-style: dotted; border-block-end-style: groove; related properties are border-block-start-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element.
border-block-end-width - CSS: Cascading Style Sheets
syntax /* <'border-width'> values */ border-block-end-width: 5px; border-block-end-width: thick; related properties are border-block-start-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element.
border-block-end - CSS: Cascading Style Sheets
related properties are border-block-start, border-inline-start, and border-inline-end, which define the other borders of the element.
border-block-start-color - CSS: Cascading Style Sheets
syntax border-block-start-color: blue; border-block-start-color: #4c5d21; related properties are border-block-end-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element.
border-block-start-style - CSS: Cascading Style Sheets
syntax /* <'border-style'> values */ border-block-start-style: dashed; border-block-start-style: dotted; border-block-start-style: groove; related properties are border-block-end-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element.
border-block-start-width - CSS: Cascading Style Sheets
syntax /* <'border-width'> values */ border-block-start-width: 5px; border-block-start-width: thick; related properties are border-block-end-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element.
border-block-style - CSS: Cascading Style Sheets
/* <'border-style'> values */ border-block-style: dashed; border-block-style: dotted; border-block-style: groove; the border style in the other dimension can be set with border-inline-style, which sets border-inline-start-style, and border-inline-end-style.
border-block-width - CSS: Cascading Style Sheets
/* <'border-width'> values */ border-block-width: 5px; border-block-width: thick; the border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width.
border-block - CSS: Cascading Style Sheets
the borders in the other dimension can be set with border-inline, which sets border-inline-start, and border-inline-end.
border-image-slice - CSS: Cascading Style Sheets
these are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element.
border-inline-color - CSS: Cascading Style Sheets
border-inline-color: yellow; border-inline-color: #f5f6f7; the border color in the other dimension can be set with border-block-color which sets border-block-start-color, and border-block-end-color.
border-inline-end-color - CSS: Cascading Style Sheets
syntax border-inline-end-color: rebeccapurple; border-inline-end-color: #663399; related properties are border-block-start-color, border-block-end-color, and border-inline-start-color, which define the other border colors of the element.
border-inline-end-style - CSS: Cascading Style Sheets
syntax /* <'border-style'> values */ border-inline-end-style: dashed; border-inline-end-style: dotted; border-inline-end-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-start-style, which define the other border styles of the element.
border-inline-end-width - CSS: Cascading Style Sheets
syntax /* <'border-width'> values */ border-inline-end-width: 2px; border-inline-end-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-start-width, which define the other border widths of the element.
border-inline-start-color - CSS: Cascading Style Sheets
syntax border-inline-start-color: red; border-inline-start-color: #ee4141; related properties are border-block-start-color, border-block-end-color, and border-inline-end-color, which define the other border colors of the element.
border-inline-start-style - CSS: Cascading Style Sheets
syntax /* <'border-style'> values */ border-inline-start-style: dashed; border-inline-start-style: dotted; border-inline-start-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-end-style, which define the other border styles of the element.
border-inline-start-width - CSS: Cascading Style Sheets
syntax /* <'border-width'> values */ border-inline-start-width: 5px; border-inline-start-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-end-width, which define the other border widths of the element.
border-inline-style - CSS: Cascading Style Sheets
/* <'border-style'> values */ border-inline-style: dashed; border-inline-style: dotted; border-inline-style: groove; the border style in the other dimension can be set with border-block-style, which sets border-block-start-style, and border-block-end-style.
border-inline-width - CSS: Cascading Style Sheets
/* <'border-width'> values */ border-inline-width: 5px 10px; border-inline-width: 5px; border-inline-width: thick; the border width in the other dimension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width.
border-inline - CSS: Cascading Style Sheets
the borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end.
border - CSS: Cascading Style Sheets
WebCSSborder
to make them different from each other, however, you can use the longhand border-width, border-style, and border-color properties, which accept different values for each side.
box-decoration-break - CSS: Cascading Style Sheets
note that if you stack the rendering of the two fragments horizontally next to each other it will result in the non-fragmented rendering.
box-flex-group - CSS: Cascading Style Sheets
each element within that group is given extra space based on the ratio of that element's flexibility compared to the flexibility of other elements within the same flex group.
box-lines - CSS: Cascading Style Sheets
WebCSSbox-lines
once the number of lines has been determined, elements with a computed value for box-flex other than 0 stretch as necessary in an attempt to fill the remaining space on the lines.
break-after - CSS: Cascading Style Sheets
values */ break-after: avoid-page; break-after: page; break-after: left; break-after: right; break-after: recto; break-after: verso; /* column break values */ break-after: avoid-column; break-after: column; /* region break values */ break-after: avoid-region; break-after: region; /* global values */ break-after: inherit; break-after: initial; break-after: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
break-before - CSS: Cascading Style Sheets
ak-before: avoid-page; break-before: page; break-before: left; break-before: right; break-before: recto; break-before: verso; /* column break values */ break-before: avoid-column; break-before: column; /* region break values */ break-before: avoid-region; break-before: region; /* global values */ break-before: inherit; break-before: initial; break-before: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
break-inside - CSS: Cascading Style Sheets
/* keyword values */ break-inside: auto; break-inside: avoid; break-inside: avoid-page; break-inside: avoid-column; break-inside: avoid-region; /* global values */ break-inside: inherit; break-inside: initial; break-inside: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
calc() - CSS: Cascading Style Sheets
WebCSScalc
-pixel gap between both sides of the banner and the edges of the window: .banner { position: absolute; left: 40px; width: calc(100% - 80px); border: solid black 1px; box-shadow: 1px 2px; background-color: yellow; padding: 6px; text-align: center; box-sizing: border-box; } <div class="banner">this is a banner!</div> automatically sizing form fields to fit their container another use case for calc() is to help ensure that form fields fit in the available space, without extruding past the edge of their container, while maintaining an appropriate margin.
clamp() - CSS: Cascading Style Sheets
WebCSSclamp
the expressions can be math functions (see calc() for more information), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions.
clear - CSS: Cascading Style Sheets
WebCSSclear
vertical margins between two floated elements on the other hand will not collapse.
clip - CSS: Cascading Style Sheets
WebCSSclip
formal definition initial valueautoapplies toabsolutely positioned elementsinheritednocomputed valueauto if specified as auto, otherwise a rectangle with four values, each of which is auto if specified as auto or the computed length otherwiseanimation typea rectangle formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image css .dotted-border { border: dotted; position: relative; width: 536px; height: 350px; } #top-left, #middle, #bottom-right { position: abs...
color-adjust - CSS: Cascading Style Sheets
in other words, there isn't any guarantee that color-adjust will do anything.
column-count - CSS: Cascading Style Sheets
syntax /* keyword value */ column-count: auto; /* <integer> value */ column-count: 3; /* global values */ column-count: inherit; column-count: initial; column-count: unset; values auto the number of columns is determined by other css properties, such as column-width.
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
for all other layout types it is 0.
column-width - CSS: Cascading Style Sheets
auto the width of the column is determined by other css properties, such as column-count.
<dimension> - CSS: Cascading Style Sheets
WebCSSdimension
css uses dimensions to specify distances (<length>), durations (<time>), frequencies (<frequency>), resolutions (<resolution>), and other quantities.
blur() - CSS: Cascading Style Sheets
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.
fit-content() - CSS: Cascading Style Sheets
otherwise it is relative to the available inline size or block size of the laid out box depending on the writing mode.
<flex> - CSS: Cascading Style Sheets
it is used in grid-template-columns, grid-template-rows and other related properties.
font-feature-settings - CSS: Cascading Style Sheets
these lead to more effective, predictable, understandable results than font-feature-settings, which is a low-level feature designed to handle special cases where no other way exists to enable or access an opentype font feature.
font-kerning - CSS: Cascading Style Sheets
in well-kerned fonts, this feature makes character spacing more uniform and pleasant to read than it would otherwise be.
font-stretch - CSS: Cascading Style Sheets
all values of font-stretch less than 100% select the condensed face, while all other values select the normal face.
font-style - CSS: Cascading Style Sheets
in general, for a requested angle of 14 degrees or greater, larger angles are prefered; otherwise, smaller angles are preferred (see the spec's font matching section for the precise algorithm).
font-synthesis - CSS: Cascading Style Sheets
fonts used for chinese, japanese, korean and other logographic scripts tend not to include these variants, and synthesizing them may impede the legibility of the text.
font-variant-east-asian - CSS: Cascading Style Sheets
valueas specifiedanimation typediscrete formal syntax normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]where <east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]<east-asian-width-values> = [ full-width | proportional-width ] examples setting east asian glyph variants this example require font "yu gothic" installed in your os, other fonts may not support opentype features.
font-variant-numeric - CSS: Cascading Style Sheets
ic: diagonal-fractions; /* <numeric-fraction-values> */ font-variant-numeric: stacked-fractions; /* <numeric-fraction-values> */ font-variant-numeric: oldstyle-nums stacked-fractions; /* global values */ font-variant-numeric: inherit; font-variant-numeric: initial; font-variant-numeric: unset; this property can take one of two forms: either the keyword value normal or one or more of the other values listed below, space-separated, in any order.
font-variant-position - CSS: Cascading Style Sheets
they are merely graphically enhanced, and have no effect on the line-height and other box characteristics.
font-variant - CSS: Cascading Style Sheets
none sets the value of the font-variant-ligatures to none and the values of the other longhand property as normal, their initial value.
font - CSS: Cascading Style Sheets
WebCSSfont
lfcomputed valueas each of the properties of the shorthand:font-style: as specifiedfont-variant: as specifiedfont-weight: the keyword or the numerical value as specified, with bolder and lighter transformed to the real valuefont-stretch: as specifiedfont-size: as specified, but with relative lengths converted into absolute lengthsline-height: for percentage and length values, the absolute length, otherwise as specifiedfont-family: as specifiedanimation typeas each of the properties of the shorthand:font-style: discretefont-variant: discretefont-weight: a font weightfont-stretch: a font stretchfont-size: a lengthline-height: either number or lengthfont-family: discrete formal syntax [ [ <'font-style'> | <font-variant-css21> | <'font-weight'> | <'font-stretch'> ]?
<frequency> - CSS: Cascading Style Sheets
WebCSSfrequency
in other words, 0 is invalid and does not represent 0hz or 0khz.
hanging-punctuation - CSS: Cascading Style Sheets
allow-end a stop or comma at the end of a line hangs if it does not otherwise fit prior to justification.
height - CSS: Cascading Style Sheets
WebCSSheight
accessibility concerns ensure that elements set with a height are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
ident - CSS: Cascading Style Sheets
WebCSSident
on the other hand, as there are several ways to escape a character, toto\?
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
the image-set() function can not be nested inside another image-set() function.
image() - CSS: Cascading Style Sheets
unlike declaring a background-color, which is placed under or behind all the background images, this can be used to put (generally semi-transparent) colors over other images.
inherit - CSS: Cascading Style Sheets
WebCSSinherit
for inherited properties, this reinforces the default behavior, and is only needed to override another rule.
left - CSS: Cascading Style Sheets
WebCSSleft
formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the width of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples positioning elements html <div id="wrap"> <div id="example_1"> <pre> position: absolute; left: 20px; top: 20px; </pre> <p>the only containing element for this div is the main window, so it positions itself in relation to it.</p> </div> <div id="ex...
letter-spacing - CSS: Cascading Style Sheets
for text styled with a very large negative value, the letters will overlap each other to the point where the word(s) may be unrecognizable.
line-height - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the font size of the element itselfcomputed valuefor percentage and length values, the absolute length, otherwise as specifiedanimation typeeither number or length formal syntax normal | <number> | <length> | <percentage> examples basic example /* all rules below have the same resultant line height */ div { line-height: 1.2; font-size: 10pt; } /* number/unitless */ div { line-height: 1.2em; font-size: 10pt; } /* length */ div { line-height: 120%; font-size: 10pt; } /* percentage */ div { f...
margin-block - CSS: Cascading Style Sheets
formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typediscrete formal syntax <'margin-left'>{1,2} examples setting block start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-block: 20px 40px; background-color: #c8c800; } result specifications specif...
margin-bottom - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
margin-left - CSS: Cascading Style Sheets
flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
margin-right - CSS: Cascading Style Sheets
flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
margin-top - CSS: Cascading Style Sheets
formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
margin-trim - CSS: Cascading Style Sheets
ground-color: red; margin: 20px; padding: 20px; display: inline-block; } article > span { background-color: black; color: white; text-align: center; padding: 10px; margin-right: 20px; } the problem here is that you'd end up with 20px too much spacing at the right of the row, so you'd maybe do this to fix it: span:last-child { margin-right: 0; } it is a pain having to write another rule to achieve this, and it is also not very flexible.
margin - CSS: Cascading Style Sheets
WebCSSmargin
initial valueas each of the properties of the shorthand:margin-bottom: 0margin-left: 0margin-right: 0margin-top: 0applies toall elements, except elements with table display types other than table-caption, table and inline-table.
mask-border-slice - CSS: Cascading Style Sheets
these are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element.
mask-origin - CSS: Cascading Style Sheets
in other words, this property specifies the origin position of an image specified by the mask-image css property.
mask-position - CSS: Cascading Style Sheets
terapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to size of mask painting area minus size of mask layer image (see the text for background-position)computed valueconsists of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentage.animation typerepeatable list of simple list of length, percentage, or calc formal syntax <position>#where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
max-block-size - CSS: Cascading Style Sheets
the other dimension's maximum length is specified using the max-inline-size property.
max-height - CSS: Cascading Style Sheets
accessibility concerns ensure that elements set with a max-height are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
max-width - CSS: Cascading Style Sheets
WebCSSmax-width
accessibility concerns ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
object-fit - CSS: Cascading Style Sheets
see also other image-related css properties: object-position, image-orientation, image-rendering, image-resolution.
object-position - CSS: Cascading Style Sheets
see also other image-related css properties: object-fit, image-orientation, image-rendering, image-resolution.
offset-distance - CSS: Cascading Style Sheets
formal definition initial value0applies totransformable elementsinheritednopercentagesrefer to the total path lengthcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea length, percentage or calc(); formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples using offset-distance in an animation the motion aspect in css motion path typically comes from animating the offset-distance property.
offset-position - CSS: Cascading Style Sheets
formal definition initial valueautoapplies totransformable elementsinheritednopercentagesrefertosizeofcontainingblockcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea position formal syntax auto | <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
offset - CSS: Cascading Style Sheets
WebCSSoffset
ath: noneoffset-distance: 0offset-anchor: autooffset-rotate: autoapplies totransformable elementsinheritednopercentagesas each of the properties of the shorthand:offset-position: refertosizeofcontainingblockoffset-distance: refer to the total path lengthoffset-anchor: relativetowidthandheightcomputed valueas each of the properties of the shorthand:offset-position: for <length> the absolute value, otherwise a percentageoffset-path: as specifiedoffset-distance: for <length> the absolute value, otherwise a percentageoffset-anchor: for <length> the absolute value, otherwise a percentageoffset-rotate: as specifiedanimation typeas each of the properties of the shorthand:offset-position: a positionoffset-path: as <angle>, <basic-shape> or <path()>offset-distance: a length, percentage or calc();offset-...
outline-offset - CSS: Cascading Style Sheets
in other words, it is the same as the parent element's background.
outline - CSS: Cascading Style Sheets
WebCSSoutline
how to design useful and usable focus indicators wcag 2.1: understanding success criterion 2.4.7: focus visible formal definition initial valueas each of the properties of the shorthand:outline-color: invert, for browsers supporting it, currentcolor for the otheroutline-style: noneoutline-width: mediumapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:outline-color: for the keyword invert, the computed value is invert.
Guide to scroll anchoring - CSS: Cascading Style Sheets
this has happened because large images or some other elements have just loaded further up in the content.
overscroll-behavior-block - CSS: Cascading Style Sheets
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing block overscrolling in this demo we have two block-level boxes, one inside the other.
overscroll-behavior-inline - CSS: Cascading Style Sheets
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing inline overscrolling in this demo we have two block-level boxes, one inside the other.
overscroll-behavior-x - CSS: Cascading Style Sheets
mal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling horizontally in our simple overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other.
overscroll-behavior - CSS: Cascading Style Sheets
yword values */ overscroll-behavior: auto; /* default */ overscroll-behavior: contain; overscroll-behavior: none; /* two values */ overscroll-behavior: auto contain; /* global values */ overscroll-behavior: inherit; overscroll-behavior: initial; overscroll-behavior: unset; by default, mobile browsers tend to provide a "bounce" effect or even a page refresh when the top or bottom of a page (or other scroll area) is reached.
padding-block-end - CSS: Cascading Style Sheets
it relates to padding-block-start, padding-inline-start, and padding-inline-end, which define the other paddings of the element.
padding-block-start - CSS: Cascading Style Sheets
it relates to padding-block-end, padding-inline-start, and padding-inline-end, which define the other paddings of the element.
padding-inline-end - CSS: Cascading Style Sheets
it relates to padding-block-start, padding-block-end, and padding-inline-start, which define the other paddings of the element.
padding-inline-start - CSS: Cascading Style Sheets
it relates to padding-block-start, padding-block-end, and padding-inline-end, which define the other paddings of the element.
page-break-after - CSS: Cascading Style Sheets
user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples setting a page break after footnotes /* move to a new page after footnotes */ div.footnotes { page-break-after: always; } specifications specification status comment css logical properties and...
page-break-before - CSS: Cascading Style Sheets
user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples avoid a page break before the dic /* avoid page break before the div */ div.note { page-break-before: avoid; } specifications specification status comment css logical properties and values l...
page-break-inside - CSS: Cascading Style Sheets
user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid examples avoiding page breaks inside elements html <div class="page"> <p>this is the first paragraph.</p> <section class="list"> <span>a list</span> <ol> <li>one</li> <!-- <li>two</li> --> </ol> </section> <ul> <li>one</li> <!-- <li>...
paint-order - CSS: Cascading Style Sheets
when one value is specified, that one is painted first, followed by the other two in their default order relative to one another.
perspective-origin - CSS: Cascading Style Sheets
formal definition initial value50% 50%applies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valuefor <length> the absolute value, otherwise a percentageanimation typesimple list of length, percentage, or calc formal syntax <position>where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
quotes - CSS: Cascading Style Sheets
WebCSSquotes
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.
resize - CSS: Cascading Style Sheets
WebCSSresize
resize does not apply to the following: inline elements block elements for which the overflow property is set to visible formal definition initial valuenoneapplies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframesinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | both | horizontal | vertical | block | inline examples disabling resizability of textareas in many browsers, <textarea> elements are resizable by default.
<resolution> - CSS: Cascading Style Sheets
in other words, 0 is invalid and does not represent 0dpi, 0dpcm, or 0dppx.
revert - CSS: Cascading Style Sheets
WebCSSrevert
if used by a site's own styles (the author origin), revert rolls back the property's cascaded value to the user's custom style, if one exists; otherwise, it rolls the style back to the user agent's default style.
scroll-behavior - CSS: Cascading Style Sheets
note that any other scrolls, such as those performed by the user, are not affected by this property.
scroll-padding-block-end - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding-block-start - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding-block - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targeted element and the edges of the scrollport.
scroll-padding-bottom - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding-inline-end - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding-inline-start - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding-inline - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding-left - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding-right - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding-top - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport.
scroll-padding - CSS: Cascading Style Sheets
this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars), or simply to put more breathing room between a targeted element and the edges of the scrollport.
scrollbar-color - CSS: Cascading Style Sheets
auto default platform rendering for the track portion of the scrollbar, in the absence of any other related scrollbar color properties.
shape-margin - CSS: Cascading Style Sheets
s adding a margin to a polygon html <section> <div class="shape"></div> we are not quite sure of any one thing in biology; our knowledge of geology is relatively very slight, and the economic laws of society are uncertain to every one except some individual who attempts to set them forth; but before the world was fashioned the square on the hypotenuse was equal to the sum of the squares on the other two sides of a right triangle, and it will be so after this world is dead; and the inhabitant of mars, if he exists, probably knows its truth as we know it.</section> css section { max-width: 400px; } .shape { float: left; width: 150px; height: 150px; background-color: maroon; clip-path: polygon(0 0, 150px 150px, 0 150px); shape-outside: polygon(0 0, 150px 150px, 0 150px); shap...
<string> - CSS: Cascading Style Sheets
WebCSSstring
importantly, certain characters which would otherwise be invalid can be escaped with a backslash.
table-layout - CSS: Cascading Style Sheets
cells use the overflow property to determine whether to clip any overflowing content, but only if the table has a known width; otherwise, they won't overflow the cells.
text-align - CSS: Cascading Style Sheets
using a <string> value only, in which case the other value defaults to right.
text-decoration-skip-ink - CSS: Cascading Style Sheets
that is, they are interrupted where they would otherwise cross over a glyph.
text-decoration-skip - CSS: Cascading Style Sheets
note: most other browsers are converging on supporting the simpler text-decoration-skip-ink property.
text-overflow - CSS: Cascading Style Sheets
to make text overflow its container you have to set other css properties: overflow and white-space.
text-rendering - CSS: Cascading Style Sheets
ff fi fl ffl</p> <p class="big">lyowat - ff fi fl ffl</p> css .small { font: 19.9px "constantia", "times new roman", "georgia", "palatino", serif; } .big { font: 20px "constantia", "times new roman", "georgia", "palatino", serif; } result optimizespeed vs optimizelegibility this example shows the difference between the appearance of optimizespeed and optimizelegibility (in your browser; other browsers may vary).
text-underline-offset - CSS: Cascading Style Sheets
while an element can have multiple text-decoration lines, text-underline-offset only impacts underlining, and not other possible line decoration options such as overline or line-through.
<time> - CSS: Cascading Style Sheets
WebCSStime
in other words, 0 is invalid and does not represent 0s or 0ms.
touch-action - CSS: Cascading Style Sheets
when a gesture is started, the browser intersects the touch-action values of the touched element and its ancestors, up to the one that implements the gesture (in other words, the first containing scrolling element).
matrix() - CSS: Cascading Style Sheets
the constant values are implied and not passed as parameters; the other parameters are described in the column-major order.
matrix3d() - CSS: Cascading Style Sheets
kground: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: rotatey(-90deg) translatez(50px); } .top { background: rgba(210,210,0,.7); transform: rotatex(90deg) translatez(50px); } .bottom { background: rgba(210,0,210,.7); transform: rotatex(-90deg) translatez(50px); } result matrix translation and scale example another transform3d() example, which implements an animated combined translate and scale.
rotate() - CSS: Cascading Style Sheets
s(a)0001 cos(a)-sin(a)00sin(a)cos(a)0000100001 [cos(a) sin(a) -sin(a) cos(a) 0 0] examples basic example html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotate(45deg); /* equal to rotatez(45deg) */ background-color: pink; } result combining rotation with another transformation if you want apply multiple transformations to an element, be careful about the order in which you specify your transformations.
rotate3d() - CSS: Cascading Style Sheets
in other words, the order in which the rotations are applied impacts the result.
rotateX() - CSS: Cascading Style Sheets
in other words, the order in which the rotations are applied impacts the result.
rotateY() - CSS: Cascading Style Sheets
in other words, the order in which the rotations are applied impacts the result.
rotateZ() - CSS: Cascading Style Sheets
in other words, the order in which the rotations are applied impacts the result.
translateZ() - CSS: Cascading Style Sheets
this has the effect of making the element appear larger when viewed on a 2d display, or closer when viewed using a vr headset or other 3d display device.
transition-delay - CSS: Cascading Style Sheets
in other words, the effect will be animated as if it had already been running for the given length of time.
unset - CSS: Cascading Style Sheets
WebCSSunset
in other words, it behaves like the inherit keyword in the first case, when the property is an inherited property, and like the initial keyword in the second case, when the property is a non-inherited property.
user-select - CSS: Cascading Style Sheets
auto the used value of auto is determined as follows: on the ::before and ::after pseudo elements, the used value is none if the element is an editable element, the used value is contain otherwise, if the used value of user-select on the parent of this element is all, the used value is all otherwise, if the used value of user-select on the parent of this element is none, the used value is none otherwise, the used value is text text the text can be selected by the user.
var() - CSS: Cascading Style Sheets
WebCSSvar
the var() css function can be used to insert the value of a custom property (sometimes called a "css variable") instead of any part of a value of another property.
white-space - CSS: Cascading Style Sheets
newline characters in the source are handled the same as other white space.
width - CSS: Cascading Style Sheets
WebCSSwidth
accessibility concerns ensure that elements set with a width aren't truncated and don't obscure other content when the page is zoomed to increase text size.
will-change - CSS: Cascading Style Sheets
but adding will-change directly in a stylesheet implies that the targeted elements are always a few moments away from changing and the browser will keep the optimizations for much longer time than it would have otherwise.
word-spacing - CSS: Cascading Style Sheets
for text styled with a large negative value, the words will overlap each other to the point where the the beginning and end of each word is unrecognizable.
writing-mode - CSS: Cascading Style Sheets
the flow direction in horizontal scripts is also affected by the directionality of that script, either left-to-right (ltr, like english and most other languages) or right-to-left (rtl, like hebrew or arabic).
z-index - CSS: Cascading Style Sheets
WebCSSz-index
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.
exsl:object-type() - EXSLT
note: most xslt object types can be coerced into each other safely; however, certain coercsions to raise error conditions.
regexp:test() - EXSLT
WebEXSLTregexptest
the character flags are: g global match has no effect for this function; it's allowed for consistency with other regexp functions.
Regular expressions (regexp) - EXSLT
WebEXSLTregexp
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.
set:difference() - EXSLT
WebEXSLTsetdifference
in other words, it returns a node-set whose nodes are in one node-set but not in the other.
set:has-same-node() - EXSLT
returns true if the two node-sets have any nodes in common; otherwise false.
set:intersection() - EXSLT
in other words, it returns a node-set containing all the nodes that exits in both nodeset1 and nodeset2.
set:leading() - EXSLT
WebEXSLTsetleading
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:leading() returns the nodes in one node-set that come before the first node in the other node-set.
set:trailing() - EXSLT
WebEXSLTsettrailing
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:trailing() returns the nodes in one node-set that come after the first node in the other node-set.
Community - Developer guides
WebGuideAJAXCommunity
if you know of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here.
WAI ARIA Live Regions/API Support - Developer guides
the screen reader may wish to take other factors into account, such as the type of change, the size of the change, where the change occured, etc.
Media buffering, seeking, and time ranges - Developer guides
this article discusses how to build a buffer/seek bar using timeranges, and other features of the media api.
Creating and triggering events - Developer guides
elem.addeventlistener('build', function (e) { // e.target matches elem }, false); // target can be any element or other eventtarget.
Mouse gesture events - Developer guides
note: these gesture events are available to add-ons and other browser chrome code, but are never sent to regular web page content.
Mutation events - Developer guides
domelementnamechanged and domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well.
Overview of events and handlers - Developer guides
events and event handling provide a core technique in javascript for reacting to incidents occurring when a browser accesses a web page, including events from preparing a web page for display, from interacting with the content of the web page, relating to the device on which the browser is running, and from many other causes such as media stream playback or animation timing.
Touch events (Mozilla experimental) - Developer guides
the stream id is unique until the moztouchup event occurs; after that, the value may be recycled for another series of events.
Graphics on the Web - Developer guides
svg scalable vector graphics (svg) lets you use lines, curves, and other geometric shapes to render graphics.
Making content editable - Developer guides
most commands affect the document's selection by, for example, applying a style to the text (bold, italics, etc), while others insert new elements (like adding a link) or affect an entire line (indenting).
Introduction to Web development - Developer guides
for another (overlapping) set of links to learning resources, see the mdn learning pages.
Mobile-friendliness - Developer guides
on the other hand, if many of your site’s users are on devices with less capable browsers, that may eliminate certain strategies as viable options.
Parsing and serializing XML - Developer guides
in some browsers it is, while in others it is simply an alias for the document interface.
Printing - Developer guides
there may be other cases in which you want to manage the printing process, but these are some of the most common scenarios.
The Unicode Bidirectional Text Algorithm - Developer guides
there are two sets of control characters; one set opens the override, and another restores the original directionality.
HTML attribute: max - HTML: Hypertext Markup Language
WebHTMLAttributesmax
syntax for max values for other elements input type syntax example <progress> <number> <progress id="file" max="100" value="70"> 70% </progress> <meter> <number> <meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="40"> at 40/100</meter> ...
HTML attribute: min - HTML: Hypertext Markup Language
WebHTMLAttributesmin
syntax for min values for other elements input type syntax example <meter> <number> <meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="40"> at 40/100</meter> impact on step the value of min and step define what are valid values, even if the step attribute is not included, as step defaults to 0.
HTML attribute: minlength - HTML: Hypertext Markup Language
this value must be less than or equal to the value of maxlength, otherwise the value will never be valid, as it is impossible to meet both criteria.
HTML attribute: pattern - HTML: Hypertext Markup Language
you should also include other explanatory text nearby.
HTML attribute: readonly - HTML: Hypertext Markup Language
note: only text controls can be made read-only, since for other controls (such as checkboxes and buttons) there is no useful distinction between being read-only and being disabled, so the readonly attribute does not apply.
Block-level elements - HTML: Hypertext Markup Language
inline there are a couple of key differences between block-level elements and inline elements: content model generally, block-level elements may contain inline elements and (sometimes) other block-level elements.
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
the -adaptation_sets argument assigns them into adaptation sets; for example, this creates one set (0) that contains the streams 0, 1, 2 and 3 (the videos), and another set (1) that contains only stream 4, the audio stream.
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
derstanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 mdn understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.1 | w3c understanding wcag 2.0 understanding success criterion 2.4.6 | w3c understanding wcag 2.0 understanding success criterion 2.4.10 | w3c understanding wcag 2.0 labeling section content another common navigation technique for users of screen reading software is to generate a list of sectioning content and use it to determine the page's layout.
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
WebHTMLElementapplet
name this attribute assigns a name to the applet so that it can be identified by other resources; particularly scripts.
<article>: The Article Contents element - HTML: Hypertext Markup Language
WebHTMLElementarticle
a given document can have multiple articles in it; for example, on a blog that shows the text of each article one after another as the reader scrolls, each post would be contained in an <article> element, possibly with one or more <section>s within.
<big>: The Bigger Text element - HTML: Hypertext Markup Language
WebHTMLElementbig
attributes this element has no other attributes than the global attributes, common to all elements.
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
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.
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
the following is some data we've collected from various tests and other sources (e.g.
<center>: The Centered Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcenter
for centering blocks, use other css properties like margin-left and margin-right and set them to auto (or set margin to 0 auto).
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
the html <dialog> element represents a dialog box or other interactive component, such as a dismissable alert, inspector, or subwindow.
<dir>: The Directory element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementdir
attributes like all other html elements, this element supports the global attributes.
<div>: The Content Division element - HTML: Hypertext Markup Language
WebHTMLElementdiv
usage notes the <div> element should be used only when no other semantic element (such as <article> or <nav>) is appropriate.
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
WebHTMLElementembed
this content is provided by an external application or other source of interactive content such as a browser plug-in.
<font> - HTML: Hypertext Markup Language
WebHTMLElementfont
attributes like all other html elements, this element supports the global attributes.
<footer> - HTML: Hypertext Markup Language
WebHTMLElementfooter
note that a <footer> element must not be a descendant of an <address>, <header> or another <footer> element.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
permitted parents any element that accepts flow content implicit aria role form if the form has an accessible name, otherwise no corresponding role permitted aria roles search, none or presentation dom interface htmlformelement attributes this element includes the global attributes.
<frameset> - HTML: Hypertext Markup Language
WebHTMLElementframeset
attributes like all other html elements, this element supports the global attributes.
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
WebHTMLElementhead
otherwise, one or more elements of metadata content where exactly one is a <title> element.
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
WebHTMLElementhtml
all other elements must be descendants of this element.
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
e="button" value="button 2"> <input type="button" value="button 3"> </fieldset> const button = document.queryselector('input'); const fieldset = document.queryselector('fieldset'); button.addeventlistener('click', disablebutton); function disablebutton() { fieldset.disabled = true; window.settimeout(function() { fieldset.disabled = false; }, 2000); } note: firefox will, unlike other browsers, by default, persist the dynamic disabled state of a <button> across page loads.
<input type="reset"> - HTML: Hypertext Markup Language
WebHTMLElementinputreset
buttons such as reset don't have a value otherwise.
<isindex> - HTML: Hypertext Markup Language
WebHTMLElementisindex
attributes like all other html elements, this element accepted the global attributes.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
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.
<li> - HTML: Hypertext Markup Language
WebHTMLElementli
tag omission the end tag can be omitted if the list item is immediately followed by another <li> element, or if there is no more content in its parent element.
<listing> - HTML: Hypertext Markup Language
WebHTMLElementlisting
attributes this element has no other attributes than the global attributes, common to all elements.
<map> - HTML: Hypertext Markup Language
WebHTMLElementmap
the value of the name attribute must not be a compatibility-caseless match for the value of the name attribute of another <map> element in the same document.
<multicol>: The HTML Multi-Column Layout element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmulticol
it's covered here only to warn you off in case you stumble on it in any other documentation.
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
WebHTMLElementnav
the html <nav> element represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents.
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnextid
attributes like all other html elements, this element accepts the global attributes.
<noscript> - HTML: Hypertext Markup Language
WebHTMLElementnoscript
otherwise: flow content or phrasing content.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
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>.
<optgroup> - HTML: Hypertext Markup Language
WebHTMLElementoptgroup
the end tag is optional if this element is immediately followed by another <optgroup> element, or if the parent element has no more content.
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
for a space-separated list of other elements’ ids, indicating that those elements contributed input values to (or otherwise affected) the calculation.
<param>: The Object Parameter element - HTML: Hypertext Markup Language
WebHTMLElementparam
object: an id of another <object> in the same document.
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
the <img> element serves two purposes: it describes the size and other attributes of the image and its presentation.
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
WebHTMLElementrp
permitted content text tag omission the end tag can be omitted if the element is immediately followed by an <rt> or another <rp> element, or if there is no more content in the parent element.
<section>: The Generic Section element - HTML: Hypertext Markup Language
WebHTMLElementsection
implicit aria role region if the element has an accessible name, otherwise no corresponding role permitted aria roles alert, alertdialog, application, banner, complementary, contentinfo, dialog, document, feed, log, main, marquee, navigation, none, note, presentation, search, status, tabpanel dom interface htmlelement attributes this element only includes the global attributes.
<span> - HTML: Hypertext Markup Language
WebHTMLElementspan
it should be used only when no other semantic element is appropriate.
<strike> - HTML: Hypertext Markup Language
WebHTMLElementstrike
in all other cases use <s>.
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
WebHTMLElementstrong
another accepted use for <strong> is to denote the labels of paragraphs which represent notes or warnings within the text of a page.
<template>: The Content Template element - HTML: Hypertext Markup Language
WebHTMLElementtemplate
orall("td"); td[0].textcontent = "1235646565"; td[1].textcontent = "stuff"; tbody.appendchild(clone); // clone the new row and insert it into the table var clone2 = template.content.clonenode(true); td = clone2.queryselectorall("td"); td[0].textcontent = "0384928528"; td[1].textcontent = "acme kidney beans 2"; tbody.appendchild(clone2); } else { // find another way to add the rows to the table because // the html template element is not supported.
<time> - HTML: Hypertext Markup Language
WebHTMLElementtime
implicit aria role no corresponding role permitted aria roles any dom interface htmltimeelement attributes like all other html elements, this element supports the global attributes.
<title>: The Document Title element - HTML: Hypertext Markup Language
WebHTMLElementtitle
permitted parents a <head> element that contains no other <title> element.
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
WebHTMLElementtrack
default this attribute indicates that the track should be enabled unless the user's preferences indicate that another track is more appropriate.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
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>.
<wbr> - HTML: Hypertext Markup Language
WebHTMLElementwbr
the html <wbr> element represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location.
<xmp> - HTML: Hypertext Markup Language
WebHTMLElementxmp
attributes this element has no other attributes than the global attributes, common to all elements.
draggable - HTML: Hypertext Markup Language
for other elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example.
hidden - HTML: Hypertext Markup Language
elements and scripts may, however, refer to elements that are hidden in other contexts.
itemtype - HTML: Hypertext Markup Language
google and other major search engines support the schema.org vocabulary for structured data.
x-ms-acceleratorkey - HTML: Hypertext Markup Language
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.
Global attributes - HTML: Hypertext Markup Language
it can have the following values: off or none, no autocapitalization is applied (all letters default to lowercase) on or sentences, the first letter 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 class a space-separated list of the classes of the element.
Link types: noopener - HTML: Hypertext Markup Language
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.
Link types: noreferrer - HTML: Hypertext Markup Language
the noreferrer keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser, when navigating to the target resource, to omit the referer header and otherwise leak no referrer information — and additionally to behave as if the noopener keyword were also specified.
HTML reference - HTML: Hypertext Markup Language
link types in html, the following link types indicate the relationship between two documents, in which one links to the other using an <a>, <area>, or <link> element.
Common MIME types - HTTP
application/octet-stream is the default value for all other cases.
Reason: CORS request did not succeed - HTTP
other possible causes include: trying to access an https resource that has an invalid certificate will cause this error.
Reason: CORS request external redirect not allowed - HTTP
for example, if the page https://service.tld/fetchdata were requested, and the http response is "301 moved permanently", "307 temporary redirect", or "308 permanent redirect" with a location of https://anotherservice.net/getdata, the cors request will fail in this manner.
Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’ - HTTP
this header specifies a comma-delineated list of the http methods which may be used when using cors to access the url specified in the request; if the request is using any other method, this error occurs.
Reason: CORS request not HTTP - HTTP
therefore, other resources in the same directory or its subdirectories no longer satisfy the cors same-origin rule.
CORS errors - HTTP
WebHTTPCORSErrors
this is used to explicitly allow some cross-origin requests while rejecting others.
Connection management in HTTP/1.x - HTTP
setting connection to anything other than close, usually retry-after, will make them persistent.
Cross-Origin Resource Policy (CORP) - HTTP
cross-origin resource policy is a policy set by the cross-origin-resource-policy http header that lets web sites and applications opt in to protection against certain requests from other origins (such as those issued with elements like <script> and <img>), to mitigate speculative side-channel attacks, like spectre, as well as cross-site script inclusion attacks.
Accept-Patch - HTTP
two others content encoding, bzip and bzip2, are sometimes used, though not standard.
Accept - HTTP
WebHTTPHeadersAccept
image/* will match image/png, image/svg, image/gif and any other image types.
Access-Control-Allow-Headers - HTTP
cess-control-request-method, access-control-request-headers, and origin, such as: options /resource/foo access-control-request-method: delete access-control-request-headers: origin, x-requested-with origin: https://foo.bar.org response if the server allows cors requests to use the delete method, it responds with an access-control-allow-methods response header, which lists delete along with the other methods it supports: http/1.1 200 ok content-length: 0 connection: keep-alive access-control-allow-origin: https://foo.bar.org access-control-allow-methods: post, get, options, delete access-control-max-age: 86400 if the requested method isn't supported, the server will respond with an error.
Access-Control-Request-Headers - HTTP
examples access-control-request-headers: x-pingother, content-type specifications specification status comment fetchthe definition of 'access-control-request-headers' in that specification.
Age - HTTP
WebHTTPHeadersAge
if it is age: 0, it was probably just fetched from the origin server; otherwise it is usually calculated as a difference between the proxy's current date and the date general header included in the http response.
Authorization - HTTP
other types: iana registry of authentication schemes authentification for aws servers (aws4-hmac-sha256) <credentials> if the "basic" authentication scheme is used, the credentials are constructed like this: the username and the password are combined with a colon (aladdin:opensesame).
CSP: block-all-mixed-content - HTTP
if the former is set, the latter does nothing, so set one directive or the other – not both, unless you want to force https on older browsers that do not force it after a redirect to http.
CSP: child-src - HTTP
it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: font-src - HTTP
it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: frame-ancestors - HTTP
syntax one or more sources can be set for the frame-ancestors policy: content-security-policy: frame-ancestors <source>; content-security-policy: frame-ancestors <source> <source>; sources <source> can be one of the following: the frame-ancestors directive’s syntax is similar to a source list of other directives (e.g.
CSP: frame-src - HTTP
it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: manifest-src - HTTP
it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: media-src - HTTP
it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: object-src - HTTP
it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
CSP: referrer - HTTP
"origin-when-cross-origin" / "origin-when-crossorigin" send a full url when performing a same-origin request, but only send the origin of the document for other cases.
CSP: report-to - HTTP
content-security-policy: ...; report-to groupname the directive has no effect in and of itself, but only gains meaning in combination with other directives.
CSP: report-uri - HTTP
the directive has no effect in and of itself, but only gains meaning in combination with other directives.
CSP: worker-src - HTTP
it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial.
Feature-Policy: fullscreen - HTTP
it can do so by delivering the following http response header to define a feature policy: feature-policy: fullscreen 'self' then include an allow attribute on the <iframe> element: <iframe src="https://other.com/videoplayer" allow="fullscreen"></iframe> iframe attributes can selectively enable features in certain frames, and not in others, even if those frames contain documents from the same origin.
Feature-Policy: geolocation - HTTP
it can do so by delivering the following http response header to define a feature policy: feature-policy: geolocation 'self' then include an allow attribute on the <iframe> element: <iframe src="https://other.com/map" allow="geolocation"></iframe> iframe attributes can selectively enable features in certain frames, and not in others, even if those frames contain documents from the same origin.
web-share - HTTP
the http feature-policy header web-share directive controls controls whether the current document is allowed to use the navigator.share() of web share api to share text, links, images, and other content to arbitrary destiations of user's choice.
Feature-Policy - HTTP
web-share controls whether or not the current document is allowed to use the navigator.share() of web share api to share text, links, images, and other content to arbitrary destiations of user's choice, e.g.
If-Unmodified-Since - HTTP
the if-unmodified-since request http header makes the request conditional: the server will send back the requested resource, or accept it in the case of a post or another non-safe method, only if it has not been last modified after the given date.
Keep-Alive - HTTP
unless 0, this value is ignored for non-pipelined connections as another request will be sent in the next response.
Public-Key-Pins - HTTP
some browsers might allow other hashing algorithms than sha-256 in the future.
Sec-Fetch-User - HTTP
?1 the navigation request was triggered by something other than a user activation.
Timing-Allow-Origin - HTTP
the timing-allow-origin response header specifies origins that are allowed to see values of attributes retrieved via features of the resource timing api, which would otherwise be reported as zero due to cross-origin restrictions.
Transfer-Encoding - HTTP
the content-length header is omitted in this case and at the beginning of each chunk you need to add the length of the current chunk in hexadecimal format, followed by '\r\n' and then the chunk itself, followed by another '\r\n'.
Upgrade - HTTP
WebHTTPHeadersUpgrade
for example: connection: upgrade upgrade: a_protocol/1, example ,another_protocol/2.2 directives any comma-separated list protocol names (each with optional protocol version) one or more protocol names with optional version ("/" separated).
Vary - HTTP
WebHTTPHeadersVary
it can help google and other search engines to discover the mobile version of a page, and might also tell them that no cloaking is intended.
X-Forwarded-Proto - HTTP
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.
POST - HTTP
WebHTTPMethodsPOST
text/plain when the post request is sent via a method other than an html form — like via an xmlhttprequest — the body can take any type.
Network Error Logging - HTTP
le the ip address is unreachable tcp.failed the tcp connection failed due to reasons not covered by previous errors http.error the user agent successfully received a response, but it had a 4xx or 5xx status code http.protocol.error the connection was aborted due to an http protocol error http.response.invalid response is empty, has a content-length mismatch, has improper encoding, and/or other conditions that prevent user agent from processing the response http.response.redirect_loop the request was aborted due to a detected redirect loop http.failed the connection failed due to errors in http protocol not covered by previous errors specifications specification network error logging ...
HTTP Public Key Pinning (HPKP) - HTTP
some browsers might allow other hashing algorithms than sha-256 in the future.
HTTP range requests - HTTP
range requests and chunking are compatible and can be used with or without each other.
202 Accepted - HTTP
WebHTTPStatus202
it is intended for cases where another process or server handles the request, or for batch processing.
302 Found - HTTP
WebHTTPStatus302
in the cases where you want the method used to be changed to get, use 303 see other instead.
307 Temporary Redirect - HTTP
WebHTTPStatus307
in the cases where you want the method used to be changed to get, use 303 see other instead.
308 Permanent Redirect - HTTP
WebHTTPStatus308
note: some web applications may use the 308 permanent redirect in a non-standard way and for other purposes.
412 Precondition Failed - HTTP
WebHTTPStatus412
this happens with conditional requests on methods other than get or head when the condition defined by the if-unmodified-since or if-none-match headers is not fulfilled.
451 Unavailable For Legal Reasons - HTTP
WebHTTPStatus451
note: the link header might also contain a rel="blocked-by" relation identifying the entity and implementing blockage, not any other entity mandating it.
501 Not Implemented - HTTP
WebHTTPStatus501
a 501 response is cacheable by default; that is, unless caching headers instruct otherwise.
511 Network Authentication Required - HTTP
WebHTTPStatus511
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).
CSS Houdini
worklets reference other topics related topics which may be of interest, since they can be used in tandem with houdini apis in interesting ways.
Iterators and generators - JavaScript
some built-in types, such as array or map, have a default iteration behavior, while other types (such as object) do not.
Text formatting - JavaScript
(the result is different in another time zone.) const msperday = 24 * 60 * 60 * 1000; // july 17, 2014 00:00:00 utc.
JavaScript language resources - JavaScript
implementations spidermonkey - the javascript engine used in various mozilla products, including firefox; rhino - the javascript engine is written in java; tamarin - the actionscript virtual machine (used in the adobe® flash® player); other implementations (wikipedia).
extends - JavaScript
the extends keyword is used in class declarations or class expressions to create a class that is a child of another class.
The legacy Iterator protocol - JavaScript
the deprecated firefox-only iterator protocol firefox, prior to version 26 implemented another iterator protocol that is similar to the standard es2015 iterator protocol.
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
decimal literals can start with a zero (0) followed by another decimal digit, but if all digits after the leading 0 are smaller than 8, the number is interpreted as an octal number.
RangeError: radix must be an integer - JavaScript
a radix that is larger than 10 uses alphabetical characters as digits; therefore, the radix can't be larger than 36, since the latin alphabet (used by english and many other languages) only has 26 characters.
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
the configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed.
TypeError: can't redefine non-configurable property "x" - JavaScript
the configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed.
SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead - JavaScript
the conditional compilation comment in ie is a little known feature, but it broke source maps with jquery and other libraries.
SyntaxError: test for equality (==) mistyped as assignment (=)? - JavaScript
for example: if ((x = y)) { // do the right thing } otherwise, you probably meant to use a comparison operator (e.g.
RangeError: invalid array length - JavaScript
otherwise, you might want to clamp the length before setting the length property, or using it as argument of the constructor.
ReferenceError: invalid assignment left-hand side - JavaScript
if (math.pi == 3 || math.pi == 4) { console.log('no way!'); } var str = 'hello, ' + 'from the ' + 'other side!'; ...
TypeError: invalid assignment to const "x" - JavaScript
rename if you meant to declare another constant, pick another name and re-name.
SyntaxError: missing : after property id - JavaScript
otherwise the property name can't be computed: var obj = { 'b'+'ar': 'foo' }; // syntaxerror: missing : after property id put the expression in brackets []: var obj = { ['b'+'ar']: 'foo' }; ...
SyntaxError: missing } after function body - JavaScript
examples forgotten closing curly bracket oftentimes, there is a missing curly bracket in your function code: var charge = function() { if (sunny) { usesolarcells(); } else { promptbikeride(); }; correct would be: var charge = function() { if (sunny) { usesolarcells(); } else { promptbikeride(); } }; it can be more obscure when using iife, closures, or other constructs that use a lot of different parenthesis and curly brackets, for example.
SyntaxError: missing name after . operator - JavaScript
concatenation if you are coming from another programming language (like php), it is also easy to mix up the dot operator (.) and the concatenation operator (+).
SyntaxError: missing ) after condition - JavaScript
if (3 > math.pi) { console.log("wait what?"); } misused is keyword if you are coming from another programming language, it is also easy to add keywords that don't mean the same or have no meaning at all in javascript.
TypeError: "x" is not a non-null object - JavaScript
you can't use other types as keys.
TypeError: can't delete non-configurable array element - JavaScript
the configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed.
ReferenceError: "x" is not defined - JavaScript
in other words, a function defined in the global scope can access all variables defined in the global scope.
SyntaxError: redeclaration of formal parameter "x" - JavaScript
in other words: you can omit the let keyword.
TypeError: Reduce of empty array with no initial value - JavaScript
var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y, 0) // the initial value is the neutral element of the addition another way would be two to handle the empty case, either before calling reduce, or in the callback after adding an unexpected dummy initial value.
Warning: unreachable code after return statement - JavaScript
es function f() { var x = 3; x += 4; return x; // return exits the function immediately x -= 3; // so this line will never run; it is unreachable } function f() { return // this is treated like `return;` 3 + 4; // so the function returns, and this line is never reached } valid cases function f() { var x = 3; x += 4; x -= 3; return x; // ok: return after all other statements } function f() { return 3 + 4 // ok: semicolon-less return with expression on the same line } ...
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
e strict" not allowed in function with default parameter 'use strict'; return a + b; } if the function should be in strict mode, and the entire script or enclosing function is also okay to be in strict mode, you can move the "use strict" directive outside of the function: 'use strict'; function sum(a = 1, b = 2) { return a + b; } function expression a function expression can use yet another workaround: var sum = function sum([a, b]) { // syntaxerror: "use strict" not allowed in function with destructuring parameter 'use strict'; return a + b; }; this can be converted to the following expression: var sum = (function() { 'use strict'; return function sum([a, b]) { return a + b; }; })(); arrow function if an arrow function needs to access the this variable, you c...
ReferenceError: assignment to undeclared variable "x" - JavaScript
in other words, there was an assignment without the var keyword.
SyntaxError: Unexpected token - JavaScript
for (let i = 0; i < 5,; ++i) { console.log(i); } // syntaxerror: expected expression, got ')' correct would be omitting the comma or adding another expression: for (let i = 0; i < 5; ++i) { console.log(i); } not enough brackets sometimes, you leave out brackets around if statements: function round(n, upperbound, lowerbound){ if(n > upperbound) || (n < lowerbound){ throw 'number ' + string(n) + ' is more than ' + string(upperbound) + ' or less than ' + string(lowerbound); }else if(n < ((upperbound + lowerbound)/2)){ return ...
TypeError: variable "x" redeclares argument - JavaScript
in other cases, you might to rename either the function parameter or the variable name.
TypeError: 'x' is not iterable - JavaScript
var obj = { 'france': 'paris', 'england': 'london' }; // iterate over the property names: for (let country of object.keys(obj)) { var capital = obj[country]; console.log(country, capital); } for (const [country, capital] of object.entries(obj)) console.log(country, capital); another option for this use case might be to use a map: var map = new map; map.set('france', 'paris'); map.set('england', 'london'); // iterate over the property names: for (let country of map.keys()) { let capital = map[country]; console.log(country, capital); } for (let capital of map.values()) console.log(capital); for (const [country, capital] of map.entries()) console.log(country,...
getter - JavaScript
note the following when working with the get syntax: it can have an identifier which is either a number or a string; it must have exactly zero parameters (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden).
setter - JavaScript
note the following when working with the set syntax: it can have an identifier which is either a number or a string; it must have exactly one parameter (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another set or with a data entry for the same property.
Array() constructor - JavaScript
if the argument is any other number, a rangeerror exception is thrown.
Array.prototype.reduce() - JavaScript
otherwise, it starts from index 1.
Array.prototype.reduceRight() - JavaScript
/** * function composition is way in which result of one function can * be passed to another and so on.
Array.prototype.copyWithin() - JavaScript
the copywithin() method shallow copies part of an array to another location in the same array and returns it without modifying its length.
Array.prototype.flatMap() - JavaScript
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.
Array.prototype.forEach() - JavaScript
(however, callback may do so) there is no way to stop or break a foreach() loop other than by throwing an exception.
Array.from() - JavaScript
as such, it may not be present in other implementations of the standard.
Array.prototype.includes() - JavaScript
it does not require this value to be an array object, so it can be applied to other kinds of objects (e.g.
Array.prototype.indexOf() - JavaScript
other parts are merely cosmetic conciseness.
Array.prototype.map() - JavaScript
otherwise, the value undefined will be used as its this value.
Array.of() - JavaScript
for more information, see: array.of() array.from() proposal array.of() polyfill polyfill running the following code before any other code will create array.of() if it's not natively available.
ArrayBuffer.isView() - JavaScript
return value true if the given argument is one of the arraybuffer views; otherwise, false.
Atomics.add() - JavaScript
this atomic operation guarantees that no other write happens until the modified value is written back.
Atomics.and() - JavaScript
this atomic operation guarantees that no other write happens until the modified value is written back.
Atomics.compareExchange() - JavaScript
this atomic operation guarantees that no other write happens until the modified value is written back.
Atomics.exchange() - JavaScript
this atomic operation guarantees that no other write happens between the read of the old value and the write of the new value.
Atomics.or() - JavaScript
this atomic operation guarantees that no other write happens until the modified value is written back.
Atomics.sub() - JavaScript
this atomic operation guarantees that no other write happens until the modified value is written back.
Atomics.xor() - JavaScript
this atomic operation guarantees that no other write happens until the modified value is written back.
Atomics - JavaScript
unlike the other global objects, atomics is not a constructor.
BigInt - JavaScript
1 : 0)) // ↪ [ -12n, 0, 0n, 4n, 4, 6, 10 ] note that comparisons with object-wrapped bigints act as with other objects, only indicating equality when the same object instance is compared: 0n === object(0n) // false object(0n) === object(0n) // false const o = object(0n) o === o // true conditionals a bigint behaves like a number in cases where: it is converted to a boolean: via the boolean function; when used with logical operators ||, &&, and !; or within a conditio...
BigInt64Array() constructor - JavaScript
examples different ways to create a bigint64array // from a length var bigint64 = new bigint64array(2); bigint64[0] = 42n; console.log(bigint64[0]); // 42n console.log(bigint64.length); // 2 console.log(bigint64.bytes_per_element); // 8 // from an array var arr = new bigint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new bigint64array([21n, 31n]); var y = new bigint64array(x); console.log(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new bigint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var bigint64 = new bigint64array(iterable); // bigint64array[1n, 2n, 3n] specifications specification ...
BigInt64Array - JavaScript
examples different ways to create a bigint64array // from a length var bigint64 = new bigint64array(2); bigint64[0] = 42n; console.log(bigint64[0]); // 42n console.log(bigint64.length); // 2 console.log(bigint64.bytes_per_element); // 8 // from an array var arr = new bigint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new bigint64array([21n, 31n]); var y = new bigint64array(x); console.log(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new bigint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var bigint64 = new bigint64array(iterable); // bigint64array[1n, 2n, 3n] specifications specification ...
BigUint64Array() constructor - JavaScript
examples different ways to create a biguint64array // from a length var biguint64 = new biguint64array(2); biguint64[0] = 42n; console.log(biguint64[0]); // 42n console.log(biguint64.length); // 2 console.log(biguint64.bytes_per_element); // 8 // from an array var arr = new biguint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new biguint64array([21n, 31n]); var y = new biguint64array(x); console.log(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new biguint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var biguint64 = new biguint64array(iterable); // biguint64array[1n, 2n, 3n] specifications specification...
BigUint64Array - JavaScript
examples different ways to create a biguint64array // from a length var biguint64 = new biguint64array(2); biguint64[0] = 42n; console.log(biguint64[0]); // 42n console.log(biguint64.length); // 2 console.log(biguint64.bytes_per_element); // 8 // from an array var arr = new biguint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new biguint64array([21n, 31n]); var y = new biguint64array(x); console.log(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new biguint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var biguint64 = new biguint64array(iterable); // biguint64array[1n, 2n, 3n] specifications specification...
Boolean - JavaScript
all other values, including any object, an empty array ([]), or the string "false", create an object with an initial value of true.
DataView() constructor - JavaScript
this means handling integer and float conversion, endianness, and other details of representing numbers in binary form.
Date.UTC() - JavaScript
if a parameter is outside of the expected range, the utc() method updates the other parameters to accommodate the value.
Date.prototype.getUTCMilliseconds() - JavaScript
this method is a companion to the other utc based methods that give hour portion, minute portion, etc.; this method gives milliseconds portion.
Date.prototype.setFullYear() - JavaScript
if a parameter you specify is outside of the expected range, setfullyear() attempts to update the other parameters and the date information in the date object accordingly.
Date.prototype.setTime() - JavaScript
description use the settime() method to help assign a date and time to another date object.
Date.prototype.setUTCFullYear() - JavaScript
if a parameter you specify is outside of the expected range, setutcfullyear() attempts to update the other parameters and the date information in the date object accordingly.
Date.prototype.setYear() - JavaScript
otherwise, the year for dateobj is set to yearvalue.
Error.prototype.stack - JavaScript
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).
FinalizationRegistry.prototype.register() - JavaScript
examples using register the following registers the target object referenced by target, passing in the held value "some value" and passing the target object itself as the unregistration token: registry.register(target, "some value", target); the following registers the target object referenced by target, passing in another object as the held value, and not passing in any unregistration token (which means target can't be unregistered): registry.register(target, {"useful": "info about target"}); specifications specification weakrefsthe definition of 'finalizationregistry.prototype.register' in that specification.
Float32Array() constructor - JavaScript
examples different ways to create a float32array // from a length var float32 = new float32array(2); float32[0] = 42; console.log(float32[0]); // 42 console.log(float32.length); // 2 console.log(float32.bytes_per_element); // 4 // from an array var arr = new float32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new float32array([21, 31]); var y = new float32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new float32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var float32 = new float32array(iterable); // float32array[1, 2, 3] specifications specification ecmascrip...
Float32Array - JavaScript
examples different ways to create a float32array // from a length var float32 = new float32array(2); float32[0] = 42; console.log(float32[0]); // 42 console.log(float32.length); // 2 console.log(float32.bytes_per_element); // 4 // from an array var arr = new float32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new float32array([21, 31]); var y = new float32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new float32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var float32 = new float32array(iterable); // float32array[1, 2, 3] specifications specification ecmascript (e...
Float64Array() constructor - JavaScript
examples different ways to create a float64array // from a length var float64 = new float64array(2); float64[0] = 42; console.log(float64[0]); // 42 console.log(float64.length); // 2 console.log(float64.bytes_per_element); // 8 // from an array var arr = new float64array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new float64array([21, 31]); var y = new float64array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(32); var z = new float64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var float64 = new float64array(iterable); // float64array[1, 2, 3] specifications specification ecmascrip...
Float64Array - JavaScript
examples different ways to create a float64array // from a length var float64 = new float64array(2); float64[0] = 42; console.log(float64[0]); // 42 console.log(float64.length); // 2 console.log(float64.bytes_per_element); // 8 // from an array var arr = new float64array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new float64array([21, 31]); var y = new float64array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(32); var z = new float64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var float64 = new float64array(iterable); // float64array[1, 2, 3] specifications specification ecmascript (e...
Function.caller - JavaScript
description if the function f was invoked by the top level code, the value of f.caller is null, otherwise it's the function that called f.
Function.name - JavaScript
let object = { // anonymous somemethod: function() {} }; object.somemethod.name = 'othermethod'; console.log(object.somemethod.name); // somemethod to change it, use object.defineproperty().
Int16Array() constructor - JavaScript
examples different ways to create an int16array // from a length var int16 = new int16array(2); int16[0] = 42; console.log(int16[0]); // 42 console.log(int16.length); // 2 console.log(int16.bytes_per_element); // 2 // from an array var arr = new int16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int16array([21, 31]); var y = new int16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new int16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int16 = new int16array(iterable); // int16array[1, 2, 3] specifications specification ecmascript (ecma-262)the d...
Int16Array - JavaScript
examples different ways to create an int16array // from a length var int16 = new int16array(2); int16[0] = 42; console.log(int16[0]); // 42 console.log(int16.length); // 2 console.log(int16.bytes_per_element); // 2 // from an array var arr = new int16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int16array([21, 31]); var y = new int16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new int16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int16 = new int16array(iterable); // int16array[1, 2, 3] specifications specification ecmascript (ecma-262)the d...
Int32Array() constructor - JavaScript
examples different ways to create an int32array // from a length var int32 = new int32array(2); int32[0] = 42; console.log(int32[0]); // 42 console.log(int32.length); // 2 console.log(int32.bytes_per_element); // 4 // from an array var arr = new int32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int32array([21, 31]); var y = new int32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new int32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int32 = new int32array(iterable); // int32array[1, 2, 3] specifications specification ecmascript (ecma-262)the ...
Int32Array - JavaScript
examples different ways to create an int32array // from a length var int32 = new int32array(2); int32[0] = 42; console.log(int32[0]); // 42 console.log(int32.length); // 2 console.log(int32.bytes_per_element); // 4 // from an array var arr = new int32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int32array([21, 31]); var y = new int32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new int32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int32 = new int32array(iterable); // int32array[1, 2, 3] specifications specification ecmascript (ecma-262)the ...
Int8Array() constructor - JavaScript
examples different ways to create an int8array // from a length var int8 = new int8array(2); int8[0] = 42; console.log(int8[0]); // 42 console.log(int8.length); // 2 console.log(int8.bytes_per_element); // 1 // from an array var arr = new int8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int8array([21, 31]); var y = new int8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new int8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int8 = new int8array(iterable); // int8array[1, 2, 3] specifications specification ecmascript (ecma-262)the definit...
Int8Array - JavaScript
examples different ways to create an int8array // from a length var int8 = new int8array(2); int8[0] = 42; console.log(int8[0]); // 42 console.log(int8.length); // 2 console.log(int8.bytes_per_element); // 1 // from an array var arr = new int8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int8array([21, 31]); var y = new int8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new int8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int8 = new int8array(iterable); // int8array[1, 2, 3] specifications specification ecmascript (ecma-262)the definit...
Intl.Collator - JavaScript
examples using collator the following example demonstrates the different potential results for a string occurring before, after, or at the same level as another: console.log(new intl.collator().compare('a', 'c')); // → a negative value console.log(new intl.collator().compare('c', 'a')); // → a positive value console.log(new intl.collator().compare('a', 'a')); // → 0 note that the results shown in the code above can vary between browsers and browser versions.
Intl.DateTimeFormat() constructor - JavaScript
implementations 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.
Intl.Locale.prototype.collation - JavaScript
pinyin ordering for latin, stroke order for cjk characters (used in chinese) trad traditional style ordering (such as in spanish) unihan pinyin ordering for latin, unihan radical-stroke ordering for cjk characters (used in chinese) zhuyin pinyin ordering for latin, zhuyin order for bopomofo and cjk characters (used in chinese) examples like other locale subtags, the collation type can be added to the intl.locale object via the locale string, or a configuration object argument to the constructor.
Intl.Locale.prototype.hourCycle - JavaScript
like other additional locale data, hour cycle type is an extension subtag, which extends the data contained in a locale string.
Intl.Locale.prototype.maximize() - JavaScript
other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the maximize() method.
Intl.Locale.prototype.minimize() - JavaScript
other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the minimize() method.
Intl.Locale.prototype.numberingSystem - JavaScript
full width digits geor georgian numerals — algorithmic gong gunjala gondi digits gonm masaram gondi digits grek greek upper case numerals — algorithmic greklow greek lower case numerals — algorithmic gujr gujarati digits guru gurmukhi digits hanidays han-character day-of-month numbering for lunar/other traditional calendars hanidec positional decimal system using chinese number ideographs as digits hans simplified chinese numerals — algorithmic hansfin simplified chinese financial numerals — algorithmic hant traditional chinese numerals — algorithmic hantfin traditional chinese financial numerals — algorithmic hebr ...
Intl.Locale.prototype.region - JavaScript
for example, english is spoken in the united kingdom and the united states of america, but there are differences in spelling and other language conventions between those two countries.
Intl.Locale.prototype.toString() - JavaScript
the tostring method allows locale instances to be provided as an argument to existing intl constructors, serialized in json, or any other context where an exact string representation is useful.
Intl.NumberFormat() constructor - JavaScript
the following properties fall into two groups: minimumintegerdigits, minimumfractiondigits, and maximumfractiondigits in one group, minimumsignificantdigits and maximumsignificantdigits in the other.
Intl.PluralRules.select() - JavaScript
return value a string representing the pluralization category of the number, can be one of zero, one, two, few, many or other.
Intl.RelativeTimeFormat() constructor - JavaScript
const rtf = new intl.relativetimeformat("en", { localematcher: "best fit", // other values: "lookup" numeric: "always", // other values: "auto" style: "long", // other values: "short" or "narrow" }); // format relative time using negative value (-1).
Intl.RelativeTimeFormat.prototype.format() - JavaScript
const rtf = new intl.relativetimeformat("en", { localematcher: "best fit", // other values: "lookup" numeric: "always", // other values: "auto" style: "long", // other values: "short" or "narrow" }); // format relative time using negative value (-1).
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
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.
Intl.RelativeTimeFormat - JavaScript
const rtf = new intl.relativetimeformat("en", { localematcher: "best fit", // other values: "lookup" numeric: "always", // other values: "auto" style: "long", // other values: "short" or "narrow" }); // format relative time using negative value (-1).
Map() constructor - JavaScript
syntax new map([iterable]) parameters iterable an array or other iterable object whose elements are key-value pairs.
Map.prototype.forEach() - JavaScript
otherwise, the value undefined will be passed for use as its this value.
Map.prototype.has() - JavaScript
return value true if an element with the specified key exists in the map object; otherwise false.
Math.acos() - JavaScript
return value the arccosine (angle in radians) of the given number if it's between -1 and 1; otherwise, nan.
Math.asin() - JavaScript
return value the arcsine (in radians) of the given number if it's between -1 and 1; otherwise, nan.
Math.hypot() - JavaScript
if any of the arguments is nan (unless another argument is ±infinity), the result is nan.
Math.log() - JavaScript
if you need a logarithm to other bases, use math.log(x) / math.log(otherbase) as in the example below; you might want to precalculate 1 / math.log(otherbase) .
Math.max() - JavaScript
-infinity is the initial comparant because almost every other value is bigger, that's why when no arguments are given, -infinity is returned.
Math.min() - JavaScript
for instance, this var x = f(foo); if (x > boundary) { x = boundary; } may be written as this var x = math.min(f(foo), boundary); math.max() can be used in a similar way to clip a value at the other end.
Math.pow() - JavaScript
2) math.pow(2, 1/3); // 1.2599210498948732 (cube root of 2) // signed exponents math.pow(7, -2); // 0.02040816326530612 (1/49) math.pow(8, -1/3); // 0.5 // signed bases math.pow(-7, 2); // 49 (squares are positive) math.pow(-7, 3); // -343 (cubes can be negative) math.pow(-7, 0.5); // nan (negative numbers don't have a real square root) // due to "even" and "odd" roots laying close to each other, // and limits in the floating number precision, // negative bases with fractional exponents always return nan math.pow(-7, 1/3); // nan specifications specification ecmascript (ecma-262)the definition of 'math.pow' in that specification.
Math.trunc() - JavaScript
description unlike the other three math methods: math.floor(), math.ceil() and math.round(), the way math.trunc() works is very simple.
Math - JavaScript
description unlike many other global objects, math is not a constructor.
Number.MAX_VALUE - JavaScript
if the result is less than or equal to max_value, the func1 function is called; otherwise, the func2 function is called.
Number.MIN_VALUE - JavaScript
if the result is greater than or equal to min_value, the func1 function is called; otherwise, the func2 function is called.
Number.isInteger() - JavaScript
description if the target value is an integer, return true, otherwise return false.
Object() constructor - JavaScript
otherwise, it will return an object of a type that corresponds to the given value.
Object.assign() - JavaScript
merging objects with same properties const o1 = { a: 1, b: 1, c: 1 }; const o2 = { b: 2, c: 2 }; const o3 = { c: 3 }; const obj = object.assign({}, o1, o2, o3); console.log(obj); // { a: 1, b: 2, c: 3 } the properties are overwritten by other objects that have the same properties later in the parameters order.
Object.create() - JavaScript
function myclass() { superclass.call(this); othersuperclass.call(this); } // inherit one class myclass.prototype = object.create(superclass.prototype); // mixin another object.assign(myclass.prototype, othersuperclass.prototype); // re-assign constructor myclass.prototype.constructor = myclass; myclass.prototype.mymethod = function() { // do something }; object.assign() copies properties from the othersuperclass prototype to the myclass pr...
Object.defineProperties() - JavaScript
ues, object.defineproperties is almost completely equivalent (note the comment in iscallable) to the following reimplementation in javascript: function defineproperties(obj, properties) { function converttodescriptor(desc) { function hasproperty(obj, prop) { return object.prototype.hasownproperty.call(obj, prop); } function iscallable(v) { // nb: modify as necessary if other values than functions are callable.
Object.fromEntries() - JavaScript
syntax object.fromentries(iterable); parameters iterable an iterable such as array or map or other objects implementing the iterable protocol.
Object.getOwnPropertyDescriptor() - JavaScript
return value a property descriptor of the given property if it exists on the object, undefined otherwise.
Object.prototype.hasOwnProperty() - JavaScript
y as a property name javascript does not protect the property name hasownproperty; thus, if the possibility exists that an object might have a property with this name, it is necessary to use an external hasownproperty to get correct results: var foo = { hasownproperty: function() { return false; }, bar: 'here be dragons' }; foo.hasownproperty('bar'); // always returns false // use another object's hasownproperty // and call it with 'this' set to foo ({}).hasownproperty.call(foo, 'bar'); // true // it's also possible to use the hasownproperty property // from the object prototype for this purpose object.prototype.hasownproperty.call(foo, 'bar'); // true note that in the last case there are no newly created objects.
Object.isSealed() - JavaScript
description returns true if the object is sealed, otherwise false.
Object.preventExtensions() - JavaScript
this behavior is specific to the internal [[prototype]] property, other properties of the target object will remain mutable.
Object.seal() - JavaScript
object.defineproperty(obj, 'foo', { get: function() { return 'g'; } }); // throws a typeerror // now any changes, other than to property values, // will fail.
Object.prototype.toString() - JavaScript
by using radix you can also convert base 10 numbers (like 1,2,3,4,5,.........) to another base numbers, in example below we are converting base 10 number to a base 2 (binary) number let basetenint = 10; console.log(basetenint.tostring(2)); // expected output is "1010" and same for big integers let bignum = bigint(20); console.log(bignum.tostring(2)); // expected output is "10100" some common radix are 2 for binary numbers, 8 for octal numbers, 10 for decimal numbers, 16...
handler.ownKeys() - JavaScript
if the target object is not extensible, then the result list must contain all the keys of the own properties of the target object and no other values.
handler.set() - JavaScript
but a set() handler can also be called indirectly, via the prototype chain or various other ways.
handler.setPrototypeOf() - JavaScript
return value the setprototypeof() method returns true if the [[prototype]] was successfully changed, otherwise false.
Proxy.revocable() - JavaScript
it can be any sort of object, including a native array, a function, or even another proxy.
Reflect.defineProperty() - JavaScript
examples using reflect.defineproperty() let obj = {} reflect.defineproperty(obj, 'x', {value: 7}) // true obj.x // 7 checking if property definition has been successful with object.defineproperty, which returns an object if successful, or throws a typeerror otherwise, you would use a try...catch block to catch any error that occurred while defining a property.
Reflect.setPrototypeOf() - JavaScript
it sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or to null, and returns true if the operation was successful, or false otherwise.
Reflect - JavaScript
returns a property descriptor of the given property if it exists on the object, undefined otherwise.
RegExp.prototype[@@search]() - JavaScript
otherwise, it returns -1.
RegExp.prototype.global - JavaScript
property attributes of regexp.prototype.global writable no enumerable no configurable yes description the value of global is a boolean and true if the "g" flag was used; otherwise, false.
RegExp.prototype.ignoreCase - JavaScript
property attributes of regexp.prototype.ignorecase writable no enumerable no configurable yes description the value of ignorecase is a boolean and true if the "i" flag was used; otherwise, false.
RegExpInstance.lastIndex - JavaScript
otherwise, lastindex is set to the next position following the most recent match.
RegExp.prototype.multiline - JavaScript
property attributes of regexp.prototype.multiline writable no enumerable no configurable yes description the value of multiline is a boolean and is true if the "m" flag was used; otherwise, false.
RegExp.$1-$9 - JavaScript
regexp.$1 : '0'; number; // "24" please note that any operation involving the usage of other regular expressions between a re.test(str) call and the regexp.$n property, might have side effects, so that accessing these special properties should be done instantly, otherwise the result might be unexpected.
RegExp.prototype.sticky - JavaScript
property attributes of regexp.prototype.sticky writable no enumerable no configurable yes description the value of sticky is a boolean and true if the "y" flag was used; otherwise, false.
RegExp.prototype.test() - JavaScript
otherwise, false.
RegExp.prototype.unicode - JavaScript
property attributes of regexp.prototype.unicode writable no enumerable no configurable yes description the value of unicode is a boolean and true if the "u" flag was used; otherwise false.
Set.prototype.delete() - JavaScript
return value returns true if value was successfully removed from myset; otherwise false.
Set.prototype.has() - JavaScript
return value returns true if an element with the specified value exists in the set object; otherwise false.
Planned changes to shared memory - JavaScript
note that setting the cross-origin-resource-policy header to any other value than same-origin opens up the resource to potential attacks, such as spectre.
String.prototype.concat() - JavaScript
changes to the original string or the returned string don't affect the other.
String.fromCodePoint() - JavaScript
instead, it requires the utf-16 surrogate pair in order to return a supplementary character: string.fromcharcode(0xd83c, 0xdf03); // code point u+1f303 "night with string.fromcharcode(55356, 57091); // stars" == "\ud83c\udf03" string.fromcodepoint(), on the other hand, can return 4-byte supplementary characters, as well as the more common 2-byte bmp characters, by specifying their code point (which is equivalent to the utf-32 code unit): string.fromcodepoint(0x1f303); // or 127747 in decimal specifications specification ecmascript (ecma-262)the definition of 'string.fromcodepoint' in that specification.
String.prototype.link() - JavaScript
the link() method creates a string representing the code for an <a> html element to be used as a hypertext link to another url.
String.prototype.normalize() - JavaScript
there are two main normalization forms, one based on canonical equivalence and the other based on compatibility.
String.prototype.padStart() - JavaScript
the padstart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length.
String.raw() - JavaScript
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.prototype.replaceAll() - JavaScript
syntax const newstr = str.replaceall(regexp|substr, newsubstr|function) when using a `regexp` you must have to set the global ("g") flag; otherwise, it will throw a typeerror: "replaceall must be called with a global regexp".
String.prototype.slice() - JavaScript
changes to the text in one string do not affect the other string.
String.prototype.substring() - JavaScript
= 0; i < fulls.length; ++i) { if (fulls.substring(i, i + olds.length) == olds) { fulls = fulls.substring(0, i) + news + fulls.substring(i + olds.length, fulls.length) } } return fulls } replacestring('world', 'web', 'brave new world') note that this can result in an infinite loop if olds is itself a substring of news — for example, if you attempted to replace 'world' with 'otherworld' here.
Symbol.iterator - JavaScript
some built-in types have a default iteration behavior, while other types (such as object) do not.
Symbol.keyFor() - JavaScript
return value a string representing the key for the given symbol if one is found on the global registry; otherwise, undefined.
Symbol.split - JavaScript
property attributes of symbol.split writable no enumerable no configurable no examples custom reverse split class reversesplit { [symbol.split](string) { const array = string.split(' '); return array.reverse(); } } console.log('another one bites the dust'.split(new reversesplit())); // expected output: [ "dust", "the", "bites", "one", "another" ] specifications specification ecmascript (ecma-262)the definition of 'symbol.split' in that specification.
TypedArray.BYTES_PER_ELEMENT - JavaScript
property attributes of typedarray.bytes_per_element writable no enumerable no configurable no description typedarray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted.
TypedArray.prototype.forEach() - JavaScript
otherwise, the value undefined will be passed for use as its this value.
TypedArray.prototype.map() - JavaScript
otherwise, the value undefined will be passed for use as its this value.
TypedArray.name - JavaScript
property attributes of typedarray.name writable no enumerable no configurable no description typedarray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted.
TypedArray.prototype.slice() - JavaScript
if a new element is added to either typed array, the other typed array is not affected.
Uint16Array() constructor - JavaScript
array constructor // without new is forbidden var dv = new uint16array([1, 2, 3]); examples different ways to create a uint16array // from a length var uint16 = new uint16array(2); uint16[0] = 42; console.log(uint16[0]); // 42 console.log(uint16.length); // 2 console.log(uint16.bytes_per_element); // 2 // from an array var arr = new uint16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint16array([21, 31]); var y = new uint16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint16 = new uint16array(iterable); // uint16array[1, 2, 3] specifications specification ecmascript (ecma-262...
Uint16Array - JavaScript
examples different ways to create a uint16array // from a length var uint16 = new uint16array(2); uint16[0] = 42; console.log(uint16[0]); // 42 console.log(uint16.length); // 2 console.log(uint16.bytes_per_element); // 2 // from an array var arr = new uint16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint16array([21, 31]); var y = new uint16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint16 = new uint16array(iterable); // uint16array[1, 2, 3] specifications specification ecmascript (ecma-262...
Uint32Array() constructor - JavaScript
examples different ways to create a uint32array // from a length var uint32 = new uint32array(2); uint32[0] = 42; console.log(uint32[0]); // 42 console.log(uint32.length); // 2 console.log(uint32.bytes_per_element); // 4 // from an array var arr = new uint32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint32array([21, 31]); var y = new uint32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new uint32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint32 = new uint32array(iterable); // uint32array[1, 2, 3] specifications specification ecmascript (ecma-26...
Uint32Array - JavaScript
examples different ways to create a uint32array // from a length var uint32 = new uint32array(2); uint32[0] = 42; console.log(uint32[0]); // 42 console.log(uint32.length); // 2 console.log(uint32.bytes_per_element); // 4 // from an array var arr = new uint32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint32array([21, 31]); var y = new uint32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new uint32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint32 = new uint32array(iterable); // uint32array[1, 2, 3] specifications specification ecmascript (ecma-26...
Uint8Array() constructor - JavaScript
examples different ways to create a uint8array // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8array([21, 31]); var y = new uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint8 = new uint8array(iterable); // uint8array[1, 2, 3] specifications specification ecmascript (ecma-262)the d...
Uint8Array - JavaScript
examples different ways to create a uint8array // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8array([21, 31]); var y = new uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint8 = new uint8array(iterable); // uint8array[1, 2, 3] specifications specification ecmascript (ecma-262)the d...
Uint8ClampedArray() constructor - JavaScript
examples different ways to create a uint8clampedarray // from a length var uintc8 = new uint8clampedarray(2); uintc8[0] = 42; uintc8[1] = 1337; console.log(uintc8[0]); // 42 console.log(uintc8[1]); // 255 (clamped) console.log(uintc8.length); // 2 console.log(uintc8.bytes_per_element); // 1 // from an array var arr = new uint8clampedarray([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8clampedarray([21, 31]); var y = new uint8clampedarray(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8clampedarray(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uintc8 = new uint8clampedarray(iterable); // uint8clampedarray[1, 2, 3] specifications specification...
Uint8ClampedArray - JavaScript
examples different ways to create a uint8clampedarray // from a length var uintc8 = new uint8clampedarray(2); uintc8[0] = 42; uintc8[1] = 1337; console.log(uintc8[0]); // 42 console.log(uintc8[1]); // 255 (clamped) console.log(uintc8.length); // 2 console.log(uintc8.bytes_per_element); // 1 // from an array var arr = new uint8clampedarray([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8clampedarray([21, 31]); var y = new uint8clampedarray(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8clampedarray(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uintc8 = new uint8clampedarray(iterable); // uint8clampedarray[1, 2, 3] specifications specification...
WeakMap() constructor - JavaScript
syntax new weakmap([iterable]) parameters iterable iterable is an array or other iterable object whose elements are key-value pairs (2-element arrays).
WeakMap.prototype.has() - JavaScript
return value boolean returns true if an element with the specified key exists in the weakmap object; otherwise false.
WeakSet.prototype.has() - JavaScript
return value boolean returns true if an element with the specified value exists in the weakset object; otherwise false.
WeakSet - JavaScript
if no other references to an object stored in the weakset exist, those objects can be garbage collected.
WebAssembly.Instance() constructor - JavaScript
syntax important: since instantiation for large modules can be expensive, developers should only use the instance() constructor when synchronous instantiation is absolutely required; the asynchronous webassembly.instantiatestreaming() method should be used at all other times.
WebAssembly.Module() constructor - JavaScript
syntax important: since compilation for large modules can be expensive, developers should only use the module() constructor when synchronous compilation is absolutely required; the asynchronous webassembly.compilestreaming() method should be used at all other times.
WebAssembly.Module.customSections() - JavaScript
(read high level structure for information on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other purposes, for example the name custom section, which allows developers to provide names for all the functions and locals in the module (like "symbols" in a native build).
WebAssembly.Table() constructor - JavaScript
the table2.wasm module contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the imported table (see text representation).
WebAssembly.Table - JavaScript
the table2.wasm module contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the imported table (see text representation).
WebAssembly.compile() - JavaScript
this function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the webassembly.instantiate() function should be used).
WebAssembly.compileStreaming() - JavaScript
this function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the webassembly.instantiatestreaming() function should be used).
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.
globalThis - JavaScript
naming several other popular name choices such as self and global were removed from consideration because of their potential to break compatibility with existing code.
parseFloat() - JavaScript
if parsefloat encounters a character other than a plus sign (+), minus sign (- u+002d hyphen-minus), numeral (0–9), decimal point (.), or exponent (e or e), it returns the value up to that character, ignoring the invalid character and characters following it.
Iteration protocols - JavaScript
some built-in types are built-in iterables with a default iteration behavior, such as array or map, while other types (such as object) are not.
Greater than (>) - JavaScript
the greater than operator (>) returns true if the left operand is greater than the right operand, and false otherwise.
Greater than or equal (>=) - JavaScript
the greater than or equal operator (>=) returns true if the left operand is greater than or equal to the right operand, and false otherwise.
Less than or equal (<=) - JavaScript
the less than or equal operator (<=) returns true if the left operand is less than or equal to the right operand, and false otherwise.
Strict equality (===) - JavaScript
otherwise, compare the two operand's values: numbers must have the same numeric values.
Unary plus (+) - JavaScript
syntax operator: +x description although unary negation (-) also can convert non-numbers, unary plus is the fastest and preferred way of converting something into a number, because it does not perform any other operations on the number.
class expression - JavaScript
syntax const myclass = class [classname] [extends otherclassname] { // class body }; description a class expression has a similar syntax to a class declaration (statement).
instanceof - JavaScript
this may not make sense at first, but for scripts dealing with multiple frames or windows, and passing objects from one context to another via functions, this will be a valid and strong issue.
new.target - JavaScript
in ordinary functions, it refers to the function itself, assuming it was invoked via the new operator; otherwise new.target is undefined.
typeof - JavaScript
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.
void operator - JavaScript
for example: <a href="javascript:void(0);"> click here to do nothing </a> <a href="javascript:void(document.body.style.backgroundcolor='green');"> click here for green background </a> note: javascript: pseudo protocol is discouraged over other alternatives, such as unobtrusive event handlers.
async function - JavaScript
to finish settimeout(concurrentstart, 4000) // after 2 seconds, logs "slow" and then "fast" // wait again settimeout(concurrentpromise, 7000) // same as concurrentstart // wait again settimeout(parallel, 10000) // truly parallel: after 1 second, logs "fast", then after 1 more second, "slow" await and parallelism in sequentialstart, execution suspends 2 seconds for the first await, and then another second for the second await.
class - JavaScript
syntax class name [extends othername] { // class body } description the class body of a class declaration is executed in strict mode.
const - JavaScript
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 // uncaugh...
for...of - JavaScript
} iterating over other iterable objects you can also iterate over an object that explicitly implements the iterable protocol: const iterable = { [symbol.iterator]() { return { i: 0, next() { if (this.i < 3) { return { value: this.i++, done: false }; } return { value: undefined, done: true }; } }; } }; for (const value of iterable) { console.log(value)...
function declaration - JavaScript
to return any other value, the function must have a return statement that specifies the value to return.
if...else - JavaScript
if the condition is falsy, another statement can be executed.
import.meta - JavaScript
for example, with the following html: <script type="module"> import './index.mjs?someurlinfo=5'; </script> ..the following javascript file will log the `someurlinfo parameter: // index.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 the same applies when a file imports another: // index.mjs import './index2.mjs?someurlinfo=5'; // index2.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 note that while node.js will pass on query parameters (or the hash) as in the latter example, as of node 14.1.0, a url with query parameters will err when loading in the form node --experimental-modules index.mjs?someurlinfo=5 (it is treated as a file rather than a ur...
throw - JavaScript
, 'dec']; if (months[mo] !== undefined) { return months[mo]; } else { throw new userexception('invalidmonthno'); } } try { // statements to try var mymonth = 15; // 15 is out of bound to raise the exception var monthname = getmonthname(mymonth); } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s.
try...catch - JavaScript
{ // statements to handle rangeerror exceptions } else if (e instanceof evalerror) { // statements to handle evalerror exceptions } else { // statements to handle any unspecified exceptions logmyerrors(e); // pass exception object to error handler } } a common use case for this is to only catch (and silence) a small subset of expected errors, and then re-throw the error in other cases: try { myroutine(); } catch (e) { if (e instanceof rangeerror) { // statements to handle this very common expected error } else { throw e; // re-throw the error unchanged } } the exception identifier when an exception is thrown in the try-block, exception_var (i.e., the e in catch (e)) holds the exception value.
Template literals (Template strings) - JavaScript
roblematic, because, per ecmascript grammar, a parser looks for valid unicode escape sequences, but finds malformed syntax: latex`\unicode` // throws in older ecmascript versions (es2016 and earlier) // syntaxerror: malformed unicode character escape sequence es2018 revision of illegal escape sequences tagged templates should allow the embedding of languages (for example dsls, or latex), where other escapes sequences are common.
JavaScript reference - JavaScript
ebassembly.runtimeerror statements javascript statements and declarations control flowblock break continue empty if...else switch throw try...catch declarations var let const functions and classes function function* async function return class iterations do...while for for each...in for...in for...of for await...of while other debugger import label with expressions and operators javascript expressions and operators.
JavaScript shells - JavaScript
mozrepl - connect to firefox and other mozilla apps, explore and modify them from the inside, while they're running.
display - Web app manifests
in this mode, the user agent will exclude ui elements for controlling navigation, but can include other ui elements such as a status bar.
icons - Web app manifests
for example, they can be used to represent the web application amongst a list of other applications, or to integrate the web application with an os's task switcher and/or system preferences.
name - Web app manifests
WebManifestname
type string mandatory yes the name member is a string that represents the name of the web application as it is usually displayed to the user (e.g., amongst a list of other applications, or as a label for an icon).
<math> - MathML
WebMathMLElementmath
in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it.
<menclose> - MathML
the symbols are each drawn as if the others are not present, and therefore may overlap.
<mfrac> - MathML
WebMathMLElementmfrac
otherwise, if set to false (which is the default value), numerator and denominator are on top of each other.
<mlabeledtr> - MathML
the first child is the label whereas all other children are representing row contents and are treated identically to children of <mtr> elements.
<mmultiscripts> - MathML
prescripts are optional and are separated by the empty tag <mprescripts/> (only one <mprescripts /> element is allowed, otherwise you will get an duplicatemprescripts error in the error console and "invalid-markup" in your rendering).
MathML element reference - MathML
are 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) 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> ...
Proving the Pythagorean theorem - MathML
we will now prove the pythagorean theorem: statement: in a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.
Handling media support issues in web content - Web media technologies
this may be simply the first frame of video; however, in many cases, the first frame is blank, or contains nothing but the logo of a business, or some other image that doesn't give the reader any context for the video's contents.
Guide to streaming audio and video - Web media technologies
hls may also be supported in other environments, although in some cases this support is conditional.
Recommended Web Performance Timings: How long is too long? - Web Performance
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.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
rum, on the other hand, provides real metrics from real users using the site or application.
Understanding latency - Web Performance
we can determine the amount of latency by measuring the speed with which the data moves from one network location to another.
Add to Home screen - Progressive web apps (PWAs)
note: the .webmanifest extension is specified in the media type registration section of the specification, but generally browsers will support manifests with other appropriate extensions, e.g.
PWA developer guide - Progressive web apps (PWAs)
for all other documentation about web development, which generally pertains to pwas as well, see our primary web development documentation.
Web API reference - Web technology reference
WebReferenceAPI
communication apis these apis let web pages and applications communicate with other pages or devices.
SVG Core Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeCore
value type: <integer>; animatable: no xml:base specifies a base iri other than the base iri of the document.
SVG Event Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeEvents
other event attributes are available on a case by case basis for each elements.
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: <funciri>|none|inherit; animatable: yes marker-mid it defines the arrowhead or polymarker that will be drawn at every vertex other than the first and last vertex of the given <path> element or basic shape.
alignment-baseline - SVG: Scalable Vector Graphics
<text alignment-baseline="baseline" x="60" y="110">a baseline</text> <!-- materialisation of anchors --> <circle cx="60" cy="10" r="3" fill="red" /> <circle cx="60" cy="65" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text{ font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> for object alignment in other elements (such as <text>), see dominant-baseline.
bias - SVG: Scalable Vector Graphics
WebSVGAttributebias
this allows representation of values that would otherwise be clamped to 0 or 1.
color-interpolation-filters - SVG: Scalable Vector Graphics
thus, in the default case, filter effects operations occur in the linearrgb color space, whereas all other color interpolations occur by default in the srgb color space.
color-interpolation - SVG: Scalable Vector Graphics
for gradients which make use of the href or the deprecated xlink:href attribute to reference another gradient, the gradient uses the propertyʼs value from the gradient element which is directly referenced by the fill or stroke property.
contentStyleType - SVG: Scalable Vector Graphics
if other style sheet languages become more popular they might not use the style attribute, instead it could be easily declared which style language is used in the <style>'s type attribute.
direction - SVG: Scalable Vector Graphics
for other cases, such as when using right-to-left languages, it may be sufficient to add the direction attribute to the outermost <svg> element, and allow that direction to inherit to all text elements: note: as a presentation attribute, direction can be used as a css property.
enable-background - SVG: Scalable Vector Graphics
otherwise, there is no current background image canvas, so graphics elements are only rendered onto the target device.
externalResourcesRequired - SVG: Scalable Vector Graphics
if an external resource is not available, progressive rendering is suspended, the document's svgload event is not fired and the animation timeline does not begin until that resource and all other required resources become available, have been parsed and are ready to be rendered.
font-weight - SVG: Scalable Vector Graphics
the font-weight attribute refers to the boldness or lightness of the glyphs used to render the text, relative to other fonts in the same font family.
href - SVG: Scalable Vector Graphics
WebSVGAttributehref
note: unlike other animation elements, the <discard> element does not support the deprecated xlink:href attribute.
in - SVG: Scalable Vector Graphics
WebSVGAttributein
posite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <fegaussianblur>, <femergenode>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile> usage notes value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes sourcegraphic this keyword represents the graphics elements that were the original input into the <filter> element.
kerning - SVG: Scalable Vector Graphics
WebSVGAttributekerning
the most common scenario, other than auto, is to set kerning to a value of 0 so that auto-kerning is disabled.
marker-mid - SVG: Scalable Vector Graphics
the marker is rendered on every vertex other than the first and last vertices of the path data.
mask - SVG: Scalable Vector Graphics
WebSVGAttributemask
.5,0.2 0.68,0.74 0.21,0.41 0.79,0.41 0.32,0.74" /> </mask> <!-- punch a hole in a shape of a star inside the red circle, revealing the yellow circle underneath --> <circle cx="50" cy="50" r="20" fill="yellow" /> <circle cx="50" cy="50" r="45" fill="red" mask="url(#mymask)"/> </svg> since svg2, the mask attribute is defined as a css property and is a shorthand for many other properties: mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-size, and mask-composite.
orient - SVG: Scalable Vector Graphics
WebSVGAttributeorient
for all other markers, auto-start-reverse means the same as auto.
refX - SVG: Scalable Vector Graphics
WebSVGAttributerefX
unlike other positioning attributes, refx is interpreted as being in the coordinate system of the symbol contents, after application of the viewbox and preserveaspectratio attributes.
refY - SVG: Scalable Vector Graphics
WebSVGAttributerefY
unlike other positioning attributes, refy is interpreted as being in the coordinate system of the symbol contents, after application of the viewbox and preserveaspectratio attributes.
rendering-intent - SVG: Scalable Vector Graphics
the rendering-intent attribute permits the specification of a color profile rendering intent other than the default.
style - SVG: Scalable Vector Graphics
WebSVGAttributestyle
note: in theory, the contentstyletype attribute could be used to specify styling languages other than css, like xsl(t).
text-anchor - SVG: Scalable Vector Graphics
it is not applicable to other types of auto-wrapped text.
transform-origin - SVG: Scalable Vector Graphics
the other value must be a <length>, a <percentage>, or one of the keywords top, center, and bottom.
transform - SVG: Scalable Vector Graphics
in other words: xnew = xold + <x> ynew = yold + <y> example html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- no translation --> <rect x="5" y="5" width="40" height="40" fill="green" /> <!-- horizontal translation --> <rect x="5" y="5" width="40" height="40" fill="blue" transform="translate(50)" /> <!-- vertical translatio...
type - SVG: Scalable Vector Graphics
WebSVGAttributetype
the other keywords represent convenience shortcuts to allow commonly used color operations to be performed without specifying a complete matrix.
units-per-em - SVG: Scalable Vector Graphics
note: this value is almost always necessary as nearly every other attribute requires the definition of a design grid.
vector-effect - SVG: Scalable Vector Graphics
vector effects are applied before any of the other compositing operations, i.e.
xlink:arcrole - SVG: Scalable Vector Graphics
for example, a resource might generically represent a "person," but in the context of a particular arc it might have the role of "mother" and in the context of a different arc it might have the role of "daughter." twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, <use> usage notes value...
xlink:href - SVG: Scalable Vector Graphics
value <iri> default value none animatable yes filter for <filter>, xlink:href defines the reference to another <filter> element within the current svg document fragment.
xml:base - SVG: Scalable Vector Graphics
the xml:base attribute specifies a base iri other than the base iri of the document or external entity.
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
the <a> svg element creates a hyperlink to other web pages, files, locations in the same page, email addresses, or any other url.
<animate> - SVG: Scalable Vector Graphics
WebSVGElementanimate
="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <rect width="10" height="10"> <animate attributename="rx" values="0;5;0" dur="10s" repeatcount="indefinite" /> </rect> </svg> attributes animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes this element implements the svganimateelement interface.
<animateMotion> - SVG: Scalable Vector Graphics
value type: <number>|auto|auto-reverse; default value: 0; animatable: no note: for <animatemotion> the default value for the calcmode attribute is paced animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes this element implements the svganimatemotionelement interface.
<desc> - SVG: Scalable Vector Graphics
WebSVGElementdesc
the hidden text of a <desc> element can also be concatenated with the visible text of other elements using multiple ids in an aria-describedby value.
<feMerge> - SVG: Scalable Vector Graphics
WebSVGElementfeMerge
this is achieved by other filters storing their output via the result attribute and then accessing it in a <femergenode> child.
<feMergeNode> - SVG: Scalable Vector Graphics
the femergenode takes the result of another filter to be processed by its parent <femerge>.
<g> - SVG: Scalable Vector Graphics
WebSVGElementg
the <g> svg element is a container used to group other svg elements.
<metadata> - SVG: Scalable Vector Graphics
WebSVGElementmetadata
the contents of <metadata> should be elements from other xml namespaces such as rdf, foaf, etc.
<pattern> - SVG: Scalable Vector Graphics
WebSVGElementpattern
the <pattern> is referenced by the fill and/or stroke attributes on other graphics elements to fill or stroke those elements with the referenced pattern.
<set> - SVG: Scalable Vector Graphics
WebSVGElementset
value type: <anything>; default value: none; animatable: no animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill other animation attributes most notably: attributename animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesanimation elementpermitted contentany number of the following elements, in any order:de...
<switch> - SVG: Scalable Vector Graphics
WebSVGElementswitch
other direct children will be bypassed and therefore not rendered.
<symbol> - SVG: Scalable Vector Graphics
WebSVGElementsymbol
that means that some browsers could refuse to directly display a <symbol> element even if the css display property tells otherwise.
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
it's possible to apply a gradient, pattern, clipping path, mask, or filter to <text>, like any other svg graphics element.
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
the svg <tspan> element defines a subtext within a <text> element or another <tspan> element.
<use> - SVG: Scalable Vector Graphics
WebSVGElementuse
however, any other attributes not set on the referenced element will be applied to the use element.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
general change notes length attribute and indexed property for list interfaces implementation status unknown <script> element in content model of all elements implementation status unknown initialize(), appenditem(), replaceitem(), and insertitembefore() on list objects making a copy of any list item being inserted that is already in another list implementation status unknown crossorigin attribute for <image> and <script> elements not implemented yet (at least for <image>; bug 1240357) rendering model change notes svg root and <foreignobject> not overflow:hidden in ua style sheet implementation status unknown allow overflow: auto; to clip and show scroll bars implementati...
Basic Transformations - SVG: Scalable Vector Graphics
embedding svg in svg in contrast to html, svg allows you to embed other svg elements seamlessly.
Getting started - SVG: Scalable Vector Graphics
(firefox users: click here) the rendering process involves the following: we start with the <svg> root element: a doctype declaration as known from (x)html should be left off because dtd based svg validation leads to more problems than it solves before svg 2, to identify the version of the svg for other types of validation the version and baseprofile attributes should always be used instead.
Positions - SVG: Scalable Vector Graphics
the grid for all elements, svg uses a coordinate system or grid system similar to the one used by canvas (and by a whole lot of other computer drawing routines).
SVG and CSS - SVG: Scalable Vector Graphics
this behavior is standardized, though only a few browsers support the :hover pseudo-class and other more complex css selectors on elements referenced via <use> elements, at the moment.
Tools for SVG - SVG: Scalable Vector Graphics
other renderers several projects exist that can create a raster image from an svg source.
Information Security Basics - Web security
a basic understanding of information security can help you avoid unnecessarily leaving your software and sites insecure and vulnerable to weaknesses that can be exploited for financial gain or other malicious reasons.
Insecure passwords - Web security
for example, a news site may save which news articles a user wants to go back to and read, but not save any other data about a user.
How to fix a website with blocked mixed content - Web security
for other domains, use the site's https version if available.
Features restricted to secure contexts - Web security
evelopment 60 web bluetooth 56 not supported not supported not supported web midi (see midiaccess, for example) 43 not supported not supported not supported web crypto api 60 79 not supported 75 secure context restrictions that vary by browser some browsers may decide to disable certain apis in non-secure contexts or apply other restrictions/security measures, despite the spec not requiring them.
Subdomain takeovers - Web security
(for "blog", you can substitute "e-commerce platform", "customer service platform", or any other "cloud-based" virtual hosting scenario.) the process you go through might look like this: you register the name "blog.example.com" with a domain registrar.
Transport Layer Security - Web security
http over tls tls provides three primary services that help ensure the safety and security of data exchanged with it: authentication authentication lets each party to the communication verify that the other party is who they claim to be.
Using templates and slots - Web Components
in other words, the dom tree from the <element-details> elements get composed together with the content of the shadow root.
XML Index - XML: Extensible Markup Language
WebXMLIndex
this means, unlike other markup languages, xml is not predefined so you must define your own tags.
XML introduction - XML: Extensible Markup Language
<?xml-stylesheet type="text/css" href="stylesheet.css"?> there is also another more powerful way to display xml: the extensible stylesheet language transformations (xslt) which can be used to transform xml into other languages such as html.
xml:base - XML: Extensible Markup Language
WebXMLxml:base
the base uri of an element is: the base uri specified by an xml:base attribute on the element, if one exists, otherwise the base uri of the element's parent element within the document entity or external entity, if one exists, otherwise the base uri of the document entity or external entity containing the element.
XML: Extensible Markup Language
WebXML
this means, unlike other markup languages, xml is not predefined so you must define your own tags.
child - XPath
WebXPathAxeschild
since only the root node or element nodes have children, any other use will select nothing.
Axes - XPath
WebXPathAxes
since only the root node or element nodes have children, any other use will select nothing.
choose - XPath
returns if the boolean parameter is true, the first object is returned; otherwise, the second object is returned.
contains - XPath
otherwise, false.
current - XPath
for an outermost expression (an expression not occurring within another expression), the current node is always the same as the context node (which will be returned by the .
document - XPath
other specific conditions exist with specified behaviors.
element-available - XPath
otherwise, it refers to an extension element.
id - XPath
WebXPathFunctionsid
if expression is a string, or anything other than a node-set, then expression is treated as a space-separated list of ids.
lang - XPath
WebXPathFunctionslang
otherwise, false.
namespace-uri - XPath
for nodes other than element and attribute nodes, the returned string will always be an empty string.
number - XPath
an object of a type other than the four basic types is converted to a number in a way that is dependent on that type.
starts-with - XPath
otherwise, false.
substring - XPath
notes as in other xpath functions, the position is not zero-based.
unparsed-entity-url - XPath
otherwise an empty string.
Index - XPath
WebXPathIndex
since only the root node or element nodes have children, any other use will select nothing.
XPath snippets - XPath
otherwise, you have to provide your own implementation of xpathnsresolver.
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
optional attributes use-attribute-sets builds an attribute set from other attribute sets.
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
the element must be defined before any other output document element inside the output document element for which it establishes attribute values.
<xsl:for-each> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfor-each
otherwise, nodes are processed in document order.
<xsl:include> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementinclude
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:include> element merges the contents of one stylesheet with another.
<xsl:namespace-alias> - XSLT: Extensible Stylesheet Language Transformations
the most common use for this element is in generating a stylesheet from another stylesheet.
<xsl:template> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtemplate
this can be any number other than infinity.
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
this applies even if there are other nodes such as comments or other pis between the xslt-param-namespace and xslt-param pis.
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
http://www.xml.com/pub/a/2000/08/holman/index.html tutorials/examples zvon xsl programmers: http://www.zvon.org/o_html/group_xsl.html jeni's xslt pages index: http://www.jenitennison.com/xslt/ xmlpitstop.com stylesheet center: http://www.xmlpitstop.com/default.asp?datatype=ssc xsl tutorial index: http://www.nwalsh.com/docs/tutorials/xsl/ other cover pages extensible stylesheet language (xsl): http://www.oasis-open.org/cover/xsl.html xsl-list subscribe: http://www.mulberrytech.com/xsl/xsl-list/ archives: http://www.biglist.com/lists/xsl-list/archives/ the xsl-list is a very active general mailing list, hosted by mulberry technologies mozilla.dev.tech.xslt google groups: http://groups.googl...
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
d) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (suppor...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
oose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:wit...
Caching compiled WebAssembly modules - WebAssembly
it is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object.
Loading and running WebAssembly code - WebAssembly
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 care about the instance, but it’s useful to have the module in case we want to cache it, share it with another worker or window via postmessage(), or simply create more instances.
Compiling an Existing C Module to WebAssembly - WebAssembly
these libraries often rely on c's standard library, an operating system, a file system and other things.
WebAssembly
examples wasmsobel see our webassembly-examples repo for a number of other examples.