Search completed in 1.27 seconds.
General asynchronous programming concepts - Learn web development
Asynchronous? Normally, a given program's code runs straight along, with only one thing happening at once. ...
... Asynchronous? Normally, a given program's code runs straight along, with only one thing happening at once. ...
... Asynchronous? Normally, a given program's code runs straight along, with only one thing happening at once. ...
...erful APIs, you'll find more cases where the only way to do things is asynchronously. It used to be hard to write asynchronous code. It still takes getting used to, but it's gotten a lot easier. ...
Basic concepts - Web APIs
dless of network availability, these applications can work both online and offline. IndexedDB is useful for applications that store a large amount of data (for example, a catalog of DVDs in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads). About this document This introduction discusses essential
concepts and terminology in IndexedDB. It gives you the big picture and explains key
concepts. You'll find the following useful: For an overview of the design and structure of IndexedDB, see Big
Concepts. To learn more about IndexedDB terms, see the Definitions section. For a detailed tutorial on how to use the API, see Using IndexedDB. For the reference documentation on the IndexedDB API, refer ba...
..., but this was removed from the spec due to lack of interest by the web community. IndexedDB used to have a competing spec, WebSQL Database, but the W3C deprecated it on November 18, 2010. While both IndexedDB and WebSQL are solutions for storage, they do not offer the same functionalities. WebSQL Database is a relational database access system, whereas IndexedDB is an indexed table system. Big
concepts If you have assumptions from working with other types of databases, you might get thrown off when working with IndexedDB. So keep the following important
concepts in mind: IndexedDB databases store key-value pairs. The values can be complex structured objects, and keys can be properties of those objects. You can create indexes that use any property of the objects for quick searching, as we...
..." (Chrome) modes. At the end of the session, the browser wipes out the database. The disk or quota limit has been reached. The data is corrupt. An incompatible change is made to the feature. The exact circumstances and browser capabilities change over time, but the general philosophy of the browser vendors is to make the best effort to keep the data when possible. Next steps With these big
concepts under our belts, we can get to more concrete stuff. For a tutorial on how to use the API, see Using IndexedDB. ...
Web Animations API Concepts - Web APIs
To learn how to put the API to use, check out its sister article, Using the Web Animations API. The Web Animations API fills the gap between declarative CSS animations and transitions, and dynamic JavaScript animations. ...
...dditional iterations of it along the timeline. In the future, we might have timelines based on gestures or scroll position or even parent and child timelines. The Web Animations API opens up so many possibilities! Animation The animation model can be thought of as an array of snapshots of what the animation could look like at any given time, lined up along the duration of the animation. Core
Concepts Web animations consist of Timeline Objects, Animation Objects, and Animation Effect Objects working together. By assembling these disparate objects, we can create animations of our own. Timeline Timeline objects provide the useful property currentTime, which lets us see how long the page has been opened for: it's the "current time" of the document's timeline, which started when the page was op...
Digital video concepts - Web media technologies
Encoding color Representing the colors in an image or video requires several values for each pixel. What those values are depends on how you "split up" the color when converting it to numeric form. There are several color models, and video codec makes use of one or more of these to represent their pixels during the encoding process as well as after decoding the video frames. ...
... hue of the color of the light arriving at that part of the retina. As our eyes capture a scene, they essentially take two photos at once: a finely-detailed greyscale image and a somewhat fuzzy, lower-resolution map of the colors of light received across the retina at the same time. The final color image is created by the brain, which essentially layers the colors onto the greyscale pixels. YUV
concepts YUV works by defining a color space with three components: Luma (Y') The brightness of the pixel. Without the other two components, the luma of each pixel in the frame produces a greyscale representation of the image. In BT.709 (used for HDTV), for example, the luma value is the weighted sum of the gamma-corrected red, green, and blue components of the pixel, using the formula Y' = 0.2126R' ...
WebAssembly Concepts - WebAssembly
What is WebAssembly? WebAssembly is a new type of code that can be run in modern web browsers and provides new features and major gains in performance. It is not primarily intended to be written by hand, rather it is designed to be an effective compilation target for low-level source languages like C, C++, Rust, etc. This has huge implications for the web platform -- it provides a way to run code written in multiple languages on the web at near-native speed, with client apps running on the web that previously couldn't have done so. ...
...t code types can call each other as required -- the WebAssembly JavaScript API wraps exported WebAssembly code with JavaScript functions that can be called normally, and WebAssembly code can import and synchronously call normal JavaScript functions. In fact, the basic unit of WebAssembly code is called a module and WebAssembly modules are symmetric in many ways to ES2015 modules. WebAssembly key
concepts There are several key
concepts needed to understand how WebAssembly runs in the browser. All of these
concepts are reflected 1:1 in the WebAssembly JavaScript API. Module: Represents a WebAssembly binary that has been compiled by the browser into executable machine code. A Module is stateless and thus, like a Blob, can be explicitly shared between windows and workers (via postMessage()). A Mo...
Fetch basic concepts - Web APIs
Note: This article will be added to over time. If you find a Fetch concept that you feel needs explaining better, let someone know on the MDN discussion forum, or MDN Web Docs room on Matrix. ...
Streams API concepts - Web APIs
The Streams API adds a very useful set of tools to the web platform, providing objects allowing JavaScript to programmatically access streams of data received over the network and process them as desired by the developer. Some of the
concepts and terminology associated with streams might be new to you -- this article explains all you need to know. Readable streams A readable stream is a data source represented in JavaScript by a ReadableStream object that flows from an underlying source -- this is a resource somewhere on the network or elsewhere on your domain that you want to get data from. There are two types of underlying source: Push sources constantly push data at you when you've accessed them, and it is up to you to start, pause, or cancel access to the stream. Examples include video ...
Basic Concepts of Multicol - CSS: Cascading Style Sheets
Multiple-column Layout, usually referred to as multicol, is a specification for laying out content into a set of column boxes much like columns in a newspaper. This guide explains how the specification works with some common use case examples. 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. This happens in the same way that content is fragmented into pages when we work with CSS Paged Media, for example by creating a print stylesheet. The properties defined by the specification are: column-width column-count columns column-rule-color column-rule-style column-rule-width column-rule column-span column-fill column-gap By adding column-count or column-width...
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
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. Block and inline dimensions A key concept of working with flow relative properties and values is the two dimensions of block and inline. As we saw above, newer CSS layout methods such as Flexbox and Grid Layout use the
concepts of block and inline rather than right and left/top and bottom when aligning items. The inline dimension is the dimension along which a line of text runs in the writing mode in use. Therefore, in an English document with the text running horizontally left to right, or an Arabic document with the text running horizontally right to left, the inline dimension is horizontal. Switch to a vertical writ...
Index - Learn web development
t is a Domain Name? Beginner, Domain names, Infrastructure, Intro, NeedsActiveLearning, Web Domain names are a key part of the Internet infrastructure. They provide a human-readable address for any web server available on the Internet. 29 What is a URL? Beginner, Infrastructure, NeedsActiveLearning, URL, resources, urls With Hypertext and HTTP, URL is one of the key
concepts of the Web. It is the mechanism used by browsers to retrieve any published resource on the web. 30 What is a web server? Beginner, Infrastructure, needsSchema The term web server can refer to hardware or software, or both of them working together. 31 What is accessibility? Accessibility, Beginner, Intro, NeedsActiveLearning, Web Because of physical or tec...
...nchronous, requestAnimationFrame, setInterval, setTimeout, timeouts This tutorial looks at the traditional methods JavaScript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g. a set number of times per second), discusses what they are useful for, and considers their inherent issues. 52 General asynchronous programming
concepts JavaScript, Learn, Promises, Threads, asynchronous, blocking In this article, we'll run through a number of important
concepts relating to asynchronous programming, and how this looks in web browsers and JavaScript. You should understand these
concepts before working through the other articles in the module. 53 Graceful asynchronous programming with Promises Beginner, Cod...
...e, JavaScript, Learn, Method, anonymous, invoke, l10n:priority, parameters 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. In this article we'll explore fundamental
concepts behind functions such as basic syntax, how to invoke and define them, scope, and parameters. 93 Image gallery Assessment, Beginner, CodingScripting, Conditionals, Event Handler, JavaScript, Learn, Loops, events, l10n:priority Now that we've looked at the fundamental building blocks of JavaScript, we'll test your knowledge of loops, functions, conditionals and events by gettin...
...And 9 more matches
Index - Web APIs
Fetch, edge case, relative URL This article explains an edge case that occurs with fetch (and potentially other APIs exhibiting the same kind of resource retrieval behavior). When a cross-origin fetch involving a relative URL is initiated from an <iframe>, the relative URL used to be resolved against the current global location, rather than the iframe's location. 1300 Fetch basic
concepts API, Fetch, Fetch API, XMLHttpRequest,
concepts, guard, request At the heart of Fetch are the Interface abstractions of HTTP Requests, Responses, Headers, and Body payloads, along with a global fetch method for initiating asynchronous resource requests. Because the main components of HTTP are abstracted as JavaScript objects, it is easy for other APIs to make use of such functionality. ...
...ctionality. 1301 Using Fetch API, BODY, Experimental, Fetch, Guide, HTTP, Promise, Response, fetch POST & string body, request This kind of functionality was previously achieved using XMLHttpRequest. 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. 1302 FetchEvent API, FetchEvent, Interface, Offline, Reference, Service Workers, Workers This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows...
...indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution. This is the main landing page for MDN's IndexedDB coverage -- here we provide links to the full API reference and usage guides, browser support details, and some explanation of key
concepts. 2153 Basic
concepts Advanced, IndexedDB,
concepts This introduction discusses essential
concepts and terminology in IndexedDB. It gives you the big picture and explains key
concepts. 2154 Browser storage limits and eviction criteria Database, IndexedDB, LRU, Storage, client-side, eviction, limit There are a number of web technologies that store data of o...
...And 8 more matches
Using IndexedDB - Web APIs
dexedDB is a way for you to persistently store data inside a user's browser. Because it lets you create web applications with rich query abilities regardless of network availability, your applications can work both online and offline. About this document This tutorial walks you through using the asynchronous API of IndexedDB. If you are not familiar with IndexedDB, you should first read Basic
Concepts About IndexedDB. For the reference documentation on the IndexedDB API, see the IndexedDB article and its subpages. This article documents the types of objects used by IndexedDB, as well as the methods of the asynchronous API (the synchronous API was removed from spec). Basic pattern The basic pattern that IndexedDB encourages is the following: Open a database. Create an object store in t...
...pattern that IndexedDB encourages is the following: Open a database. Create an object store in the database. Start a transaction and make a request to do some database operation, like adding or retrieving data. Wait for the operation to complete by listening to the right kind of DOM event. Do something with the results (which can be found on the request object). With these big
concepts under our belts, we can get to more concrete stuff. Creating and structuring the store Using an experimental version of IndexedDB In case you want to test your code in browsers that still use a prefix, you can use the following code: // In the following line, you should include the prefixes of implementations you want to test. window.indexedDB = window.indexedDB || window.mozIndexedDB || wi...
... the index, the index ensures that no two objects are stored with both having the same value for the index's key path. So, for example, if you have an object store which holds a set of people, and you want to ensure that no two people have the same email address, you can use an index with the unique flag set to enforce this. That may sound confusing, but this simple example should illustrate the
concepts. First, we'll define some customer data to use in our example: // This is what our customer data looks like. const customerData = [ { ssn: "444-44-4444", name: "Bill", age: 35, email: "bill@company.com" }, { ssn: "555-55-5555", name: "Donna", age: 32, email: "donna@home.org" } ]; Of course, you wouldn't use someone's social security number as the primary key to a customer table because not...
...And 2 more matches
Web Audio API - Web APIs
Basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. ...
... drum machines and sequencers are well within reach. The Web Audio API also allows us to control how audio is spatialized. Using a system based on a source-listener model, it allows control of the panning model and deals with distance-induced attenuation induced by a moving source (or moving listener). You can read about the theory of the Web Audio API in a lot more detail in our article Basic
concepts behind Web Audio API. Web Audio API target audience The Web Audio API can seem intimidating to those that aren't familiar with audio or music terms, and as it incorporates a great deal of functionality it can prove difficult to get started if you are a developer. It can be used to simply incorporate audio into your website or application, by providing atmosphere like futurelibrary.no, or audi...
...ing atmosphere like futurelibrary.no, or auditory feedback on forms. However, it can also be used to create advanced interactive instruments. With that in mind, it is suitable for both developers and musicians alike. We have a simple introductory tutorial for those that are familiar with programming but need a good introduction to some of the terms and structure of the API. There's also a Basic
Concepts Behind Web Audio API article, to help you understand the way digital audio works, specifically in the realm of the API. This also includes a good introduction to some of the
concepts the API is built upon. Learning coding is like playing cards -- you learn the rules, then you play, then you go back and learn the rules again, then you play again. So if some of the theory doesn't quite fit after t...
...And 2 more matches
LocalFileSystem - Web APIs
Creating new storage You request access to a sandboxed file system by calling window.requestFileSystem(). The argument of a successful callback is the FileSystem object, which has two properties: the name and root of the file system. You can call the method more than once if you want to create two file systems: one that's temporary and one that's persistent. ...
...age You request access to a sandboxed file system by calling window.requestFileSystem(). The argument of a successful callback is the FileSystem object, which has two properties: the name and root of the file system. You can call the method more than once if you want to create two file systems: one that's temporary and one that's persistent. (To learn more about the storage types, see the Basic
Concepts article.) In most cases, you need to create only one file system, but in a few cases, it might be useful to create a second one. For example, if you were to create a mail app, you might create a temporary storage for caching assets (like images and attachments) to speed up performance, while creating persistent storage for unique data--such as drafts of emails that were composed while offline--th...
...f the API is described at Managing HTML5 Offline Storage.) Working within a single origin The file system is sandboxed to a single origin. This means that your app cannot read, or write the files of another app's files. Your app cannot access files in an arbitrary folder (such as, My Pictures, My Documents) on the user's hard drive either. For more information about restrictions, see the Basic
Concepts article. Example The following is a code snippet that shows how you can request a file system storage. //Taking care of the browser-specific prefix window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; // The first parameter defines the type of storage: persistent or temporary // Next, set the size of space needed (in bytes) // initFs is the success callback...
...request to obtain the file system is denied. Its argument is the FileError object. Returns void Exceptions This method can raise an FileError with the following code: Exception Description SECURITY_ERROR The application does not have permission to access the file system interface. For example, you cannot run from file://. For more details, see the article on basic
concepts. resolveLocalFileSystemURL() Lets you look up the entry for a file or directory with a local URL. void resolveLocalFileSystemURL( in DOMString url, in EntryCallback successCallback, in optional ErrorCallback errorCallback ); Parameters url The URL of a local file in the file system. successCallback The success callback that is called when the browser provides the file or di...
Index - Archive of obsolete content
of button which is drawn differently. Unlike normal buttons, a statusbarpanel can only have a label or an image but not both. This element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. 750 A XUL Bestiary Add-ons, Extensions, NeedsTechnicalReview, XUL This XULNote presents some of the key
concepts and terms in the XUL development environment. The purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. I selected items for this group because they seemed to be either shrouded in mystery, misused as
concepts or terms, or underestimated according to their role in XUL and cross-platform development. In contrast to the Mozilla Jargo...
...nd aims at extending CSS2.1. It brings a lot of long-awaited novelties, like rounded corners, shadows, gradients, transitions or animations, as well as new layouts like multi-columns, flexible box or grid layouts. 3245 Case Sensitivity in class and id Names CSS, HTML No summary! 3246 Creating a dynamic status bar extension Add-ons, Extensions, NeedsUpdate
Concepts covered in the previous sample won't be reiterated here; instead, refer to the downloadable sample code or to the previous sample for further details. 3247 Creating a status bar extension Add-ons, Extensions, NeedsUpdate Many of the
concepts introduced here apply to any XUL-based application; however, to keep from getting completely overwhelmed, we're going to focus specifica...
...of transforming encrypted information so that it is intelligible again. 3743 Introduction to Public-Key Cryptography Security, Tutorial Public-key cryptography and related standards and techniques underlie the security features of many products such as signed and encrypted email, single sign-on, and Secure Sockets Layer (SSL) communications. This document introduces the basic
concepts of public-key cryptography. For an overview of SSL, see "Introduction to SSL." For an overview of encryption and decryption, see "Encryption and Decryption." Information on digital signatures is available from "Digital Signatures." 3744 Introduction to SSL SSL, Security This document introduces the Secure Sockets Layer (SSL) protocol. SSL has been universally accepted on the ...
Cascade and inheritance - Learn web development
Overview: Building blocks Next The aim of this lesson is to develop your understanding of some of the most fundamental
concepts of CSS -- the cascade, specificity, and inheritance -- which control how CSS is applied to HTML and how conflicts are resolved. While working through this lesson may seem less 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! We encourage you to work through this section carefully, and check that you understand the
concepts before moving on. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps.) ...
... of inheritance, which means that some CSS properties by default inherit values set on the current element's parent element, and some don't. This can also cause some behavior that you might not expect. 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. This can seem like a set of tricky
concepts to understand. As you get more practice writing CSS, however, the way it works will become more obvious to you. The cascade Stylesheets cascade -- at a very simple level this means that the order of CSS rules matter; when two rules apply that have equal specificity the one that comes last in the CSS is the one that will be used. In the below example, we have two rules that could apply to the h...
...r parent's width. If this was the case, CSS would be very frustrating to use! Note: On MDN CSS property reference pages you can find a technical information box, usually at the bottom of the specifications section, which lists a number of data points about that property, including whether it is inherited or not. See the color property Specifications section, for example. Understanding how the
concepts work together These three
concepts together control which CSS applies to what element; in the below sections we'll see how they work together. It can sometimes seem a little bit complicated, but you will start to remember them as you get more experienced with CSS, and you can always look up the details if you forget! Even experienced developers don't remember all the details. The below video sh...
The web and web standards - Learn web development
ly old desktop machine that can't run modern browsers. Because you don't know exactly what your users will use, you need to design defensively -- make your web site as flexible as possible, so that all of the above users can make use of it, even if they might not all get the same experience. In short, we are trying to make the web work for all, as much as possible. You'll come across the below
concepts at some point in your studies. Cross-browser compatibility is the practice of trying to make sure your webpage works across as many devices as possible. This includes using technologies that all the browsers support, delivering better experiences to browsers that can handle them (progressive enhancement), and/or writing code so that it falls back to a simpler but still usable experience in old...
...ngle-column layout on mobile phone browsers. Try adjusting the width of your browser window now, and see what happens. Performance means getting web sites to load as quickly as possible, but also making them intuitive and easy to use so that users don't get frustrated and go somewhere else. Accessibility means making your websites usable by as many different kinds of people as possible (related
concepts are diversity and inclusion, and inclusive design). This includes people with visual impairments, hearing impairments, cognitive disabilities, or physical disabilities. It also goes beyond people with disabilities -- how about young or old people, people from different cultures, people using mobile devices, or people with unreliable or slow network connections? Internationalization means making ...
... cultures, who speak different languages to your own. There are technical considerations here (such as altering your layout so that it still works OK for right-to-left, or even vertical languages), and human ones (such as using simple, non-slang language so that people who have your language as their second or third language are more likely to understand your text). Privacy & Security. These two
concepts are related but different. Privacy refers to allowing people to go about their business privately and not spying on them or collecting more of their data than you absolutely need to. Security refers to constructing your website in a secure way so that malicious users cannot steal information contained on it from you or your users. See also History of the World Wide Web How does the internet...
Introduction to the File and Directory Entries API - Web APIs
a sandboxed, virtual file system. The File and Directory Entries API interacts with other related APIs. It was built on the File Writer API, which, in turn, was built on File API. Each of the APIs adds different functionality. These APIs are a giant evolutionary leap for web apps, which can now cache and process large amounts of data. About this document This introduction discusses essential
concepts and terminology in the File and Directory Entries API. It gives you the big picture and orients you to key
concepts. It also describes restrictions that raise security errors if you ignore them. To learn more about terminology used in this API, see the Definitions section. For the reference documentation on the File and Directory Entries API, see the reference landing page and its subpages. Th...
... The app can access partially downloaded files (so that you can watch the first chapter of your DVD, even if the app is still downloading the rest of the content or if the app didn't complete the download because you had to run to catch a train). Offline web mail client The client downloads attachments and stores them locally. The client caches attachments for later upload. ...
...DVD, even if the app is still downloading the rest of the content or if the app didn't complete the download because you had to run to catch a train). Offline web mail client The client downloads attachments and stores them locally. The client caches attachments for later upload. ...
IndexedDB API - Web APIs
indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution. This is the main landing page for MDN's IndexedDB coverage -- here we provide links to the full API reference and usage guides, browser support details, and some explanation of key
concepts. ...
...However, unlike SQL-based RDBMSes, which use fixed-column tables, IndexedDB is a JavaScript-based object-oriented database. ...
...ich use fixed-column tables, IndexedDB is a JavaScript-based object-oriented database. IndexedDB lets you store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be stored. You need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions. Read more about the
Concepts behind IndexedDB. Learn to use IndexedDB asynchronously from first principles with our Using IndexedDB guide. Combine IndexedDB for storing data offline with Service Workers for storing assets offline, as outlined in Making PWAs work offline with Service workers. Note: Like most web storage solutions, IndexedDB follows a same-origin policy. So while you can access stored data within a domain...
LocalFileSystemSync - Web APIs
of the File System API gives you access to a sandboxed file system. It is intended to be used with WebWorkers. The methods are implemented by worker objects. About this document This document was last updated on March 2, 2012 and follows the W3C Specifications (Working Draft) drafted on April 19, 2011. This specification is more or less abandonned, failing to get significant traction. ...
...et significant traction. Basic
concepts You can request access to a sandboxed file system by requesting LocalFileSystemSync object from within a web worker. The global methods in the window object requestFileSystemSync() and resolveLocalFileSystemSyncURL() methods are exposed to the Worker's global scope. Calling window.requestFileSystemSync() for creates new storage for your web app. For more
concepts, see the counterpart article for the asynchronous API. Example //Taking care of the browser-specific prefix window.requestFileSystemSync = window.requestFileSystemSync || window.webkitRequestFileSystemSync; // The first parameter defines the type of storage: persistent or temporary // Next, set the size of space needed (in bytes) // initFs is the success callback // And the last one is the er...
...t you need for your app. Returns FileSystemSync An object that represents the file system. Exceptions This method can raise an FileException with the following code: Exception Description SECURITY_ERROR The application does not have permission to access the file system interface. For example, you cannot run from file://. For more details, see the article on basic
concepts. resolveLocalFileSystemSyncURL() Allows the user to look up the Entry for a file or directory referred to by a local URL. void resolveLocalFileSystemURL( in DOMString url ); Parameter url The URL of a local file in the file system. Returns EntrySync An object that represents entries in the file system. Exceptions This method can raise a FileException with the following co...
Using writable streams - Web APIs
Note: If you are looking for information about readable streams, try Using readable streams instead. ...
... Note: If you are looking for information about readable streams, try Using readable streams instead. ...
... Note: If you are looking for information about readable streams, try Using readable streams instead. ...
WebGL: 2D and 3D graphics for the web - Web APIs
orm Buffer objects, Sync objects, Query objects, Transform Feedback objects, Promoted extensions that are now core to WebGL 2: Vertex Array objects, instancing, multiple render targets, fragment depth. See also the blog post "WebGL 2 lands in Firefox" and webglsamples.org/WebGL2Samples for a few demos. Guides and tutorials Below, you'll find an assortment of guides to help you learn WebGL
concepts and tutorials that offer step-by-step lessons and examples. Guides Data in WebGL A guide to variables, buffers, and other types of data used when writing WebGL code. WebGL best practices Tips and suggestions to help you improve the quality, performance, and reliability of your WebGL content. Using extensions A guide to using WebGL extensions. Tutorials WebGL tutorial A beginner's g...
... offer step-by-step lessons and examples. Guides Data in WebGL A guide to variables, buffers, and other types of data used when writing WebGL code. WebGL best practices Tips and suggestions to help you improve the quality, performance, and reliability of your WebGL content. Using extensions A guide to using WebGL extensions. Tutorials WebGL tutorial A beginner's guide to WebGL core
concepts. A good place to start if you don't have previous WebGL experience. Examples A basic 2D WebGL animation example This example demonstrates the simple animation of a one-color shape. Topics examined are adapting to aspect ratio differences, a function to build shader programs from sets of multiple shaders, and the basics of drawing in WebGL. WebGL by example A series of live samples with sh...
...have previous WebGL experience. Examples A basic 2D WebGL animation example This example demonstrates the simple animation of a one-color shape. Topics examined are adapting to aspect ratio differences, a function to build shader programs from sets of multiple shaders, and the basics of drawing in WebGL. WebGL by example A series of live samples with short explanations that showcase WebGL
concepts and capabilities. The examples are sorted according to topic and level of difficulty, covering the WebGL rendering context, shader programming, textures, geometry, user interaction, and more. Advanced tutorials WebGL model view projection A detailed explanation of the three core matrices that are typically used to represent a 3D object view: the model, view and projection matrices. Matrix ...
WebXR Device API - Web APIs
se two images is rendered into a single framebuffer, with the left eye's rendered image on the left and the right eye's viewpoint rendered into the right half of the buffer. 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. WebXR Device API
concepts and usage Example WebXR hardware setup While the older WebVR API was designed solely to support Virtual Reality (VR), WebXR provides support for both VR and Augmented Reality (AR) on the web. Support for AR functionality is added by the WebXR Augmented Reality Module. A typical XR device can have either 3 or 6 degrees of freedom and might or might not have an external positional sensor. The...
...to true, you must call makeXRCompatible() prior to attempting to use the WebGL context for WebXR rendering. Returns a Promise which resolves once the context has been prepared, or is rejected if the context cannot be configured for use by WebXR. Guides and tutorials The following guides and tutorials are a great resource to learn how to comprehend WebXR and the underlying 3D and VR/AR graphics
concepts. Foundations and basics Fundamentals of WebXR Before diving into the details of how to create content using WebXR, it may be helpful to read this overview of the technology, which includes introductions to terminology that may be unfamiliar to you, or which may be used in a new way. Matrix math for the web A guide covering how matrices can be used on the web, including both for CSS transfo...
... Before actually presenting a scene using an XR device such as a headset or goggles, you need to create a WebXR session bound to a rendering layer that draws the scene for presentation in each of the XR device's displays so that the 3D effect can be presented to the user. This guide covers how to create and stop WebXR sessions. Geometry and reference spaces in WebXR In this guide, the required
concepts of 3D geometry are briefly reviewed, and the fundamentals of how that geometry is represented in WebXR are detailed. Learn how reference spaces are used to position objects--and the viewer--and the differences among the available types of reference space, as well as their use cases. Spatial tracking in WebXR This guide describes how objects--including the user's body and its parts--are located ...
CSS Box Alignment - CSS: Cascading Style Sheets
Note: The documentation for each layout method will detail how Box Alignment is applied there. ...
...their grid areas is controlled with align-items. The first item overrides the align-items value set on the group by setting align-self to center. Flexbox Alignment Example In this example, three flex items are aligned on the main axis using justify-content and on the Cross Axis using align-items. The first item overrides the align-items set on the group by setting align-self to center. Key
concepts and terminology The specification details some alignment terminology to make it easier to discuss these alignment properties outside of their implementation within a particular layout method. There are also some key
concepts which are common to all layout methods. Relationship to writing modes Alignment is linked to writing modes in that when we align an item we do not consider whether we are ...
... layout Box alignment for block, absolutely positioned and table layout Reference CSS Properties justify-content align-content place-content justify-items align-items place-items justify-self align-self place-self row-gap column-gap gap Glossary Entries Cross axis Main axis Alignment container Alignment subject Fallback alignment Guides CSS Flexbox guide: Basic
concepts of Flexbox CSS Flexbox guide: Aligning items in a flex container CSS Grid guide: Box alignment in CSS Grid layouts External Resources Box alignment cheatsheet CSS Grid, Flexbox and Box alignment Thoughts on partial implementations of Box alignment ...
display - CSS: Cascading Style Sheets
> These values define whether an element generates display boxes at all. Valid <display-box> values: contents These elements don't produce a specific box by themselves. They are replaced by their pseudo-box and their child boxes. Please note that the CSS Display Level 3 spec defines how the contents value should affect "unusual elements" -- elements that aren't rendered purely by CSS box
concepts such as replaced elements. See Appendix B: Effects of display: contents on Unusual Elements for more details. Due to a bug in browsers this will currently remove the element from the accessibility tree -- screen readers will not look at what's inside. See the Accessibility concerns section below for more details. none Turns off the display of an element so that it has no effect on layout (th...
...ee the Syntax section. In addition, see the following material, which covers the various values of display in depth. ...
...exts 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 Progressive Enhancement Realizing common layouts using grids Accessibility concerns display: none Using a dis...
Introduction - Archive of obsolete content
y and adapt to your needs, as well as some working example extensions. The tutorial aims to be as brief as possible, often falling back on Mozilla documentation for more detailed information. You can think of it as a quick guide to the expansive world that is the Mozilla platform. Most links in this documentation are meant to be clicked and read. We'll start with a brief introduction to some key
concepts, in case you're not familiar with Mozilla and Firefox. Mozilla and Firefox The term Mozilla can be used to refer to several
concepts: the Mozilla project, the Mozilla Foundation, the Mozilla Corporation and the old Mozilla browser. Even Firefox is sometimes referred to as "Mozilla". If you're unfamiliar with these terms, it's good that you take some time and learn a little about Mozilla. This w...
... User Agent String for Firefox at the time of this writing (in US English, Mac OS X) is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:25.0.1) Gecko/20100101 Firefox/25.0.1 The highlighted section is the Gecko version: 25.0.1. You can read and copy the user agent string of any Firefox window, choosing "Help > Troubleshooting Information" from the main menu. On to the Tutorial With the basic
concepts out of the way, we can now get right into extension development. You are probably still wondering what exactly is an extension, what can it do, and how can you make them. Well, this whole tutorial is devoted to explaining that to you. Welcome to the world of extension development. Now let's get to it. Next >> This tutorial was kindly donated to Mozilla by Appcoast. ...
Layout System Overview - Archive of obsolete content
that are designed to model various formatting requirements of different HTML and XML elements. CSS2 defines several (block, inline, list-item, marker, run-in, compact, and various table types) and the standard HTML form controls require their own special frame types to be formatted as expected. The most essential frame types are Block and Inline, and these correspond to the most important Layout
concepts, the Block and Line. A block is a rectangular region that is composed of one or more lines. A line is a single row of text or other presentational elements. All layout happens in the context of a block, and all of the contents of a block are formatted into lines within that block. As the width of a block is changed, the contents of the lines must be reformatted. Consider for example a large parag...
...rame class that introduces the ability to manage a list of child frames. All frames that need to manage child frames (e.g. frames that are not themselves leaf frames) derive from Container Frame. Block Frame Reflow State Reflow Metrics Space Manager StyleSet StyleContext See also Layout FAQ Document History 05/20/2002 - Marc Attinasi: created, wrote highest level introduction to general layout
concepts, links to relevant specs and existing documents. Original Document Information Author(s): Marc Attinasi Last Updated Date: November 20, 2005 ...
A XUL Bestiary - Archive of obsolete content
In contrast to the Mozilla Jargon File, this article describes items of specific interest to the web or content developer looking to establish a context for understanding Mozilla's new technologies -- and in particular Mozilla's XML-based User Interface Language, XUL. ...
...In contrast to the Mozilla Jargon File, this article describes items of specific interest to the web or content developer looking to establish a context for understanding Mozilla's new technologies -- and in particular Mozilla's XML-based User Interface Language, XUL. ...
Introduction to Public-Key Cryptography - Archive of obsolete content
Public-key cryptography and related standards and techniques underlie the security features of many products such as signed and encrypted email, single sign-on, and Secure Sockets Layer (SSL) communications. This document introduces the basic
concepts of public-key cryptography. For an overview of SSL, see "Introduction to SSL." For an overview of encryption and decryption, see "Encryption and Decryption." Information on digital signatures is available from "Digital Signatures." Public-key cryptography is a set of well-established techniques and standards for protecting communications from eavesdropping, tampering, and impersonation attacks. Encryption and decryption allow two communicating parties to disguise information they send to each other. The sender encrypts, or scrambles, info...
...been modified in transit. Any attempt to modify data or substitute a false message for a legitimate one will be detected. Authentication allows the recipient of information to determine its origin-that is, to confirm the sender's identity. Nonrepudiation prevents the sender of information from claiming at a later date that the information was never sent. The sections that follow introduce the
concepts of public-key cryptography that underlie these capabilities. Certificates and Authentication Managing Certificates Certificates and Authentication A Certificate Identifies Someone or Something Authentication Confirms an Identity How Certificates Are Used Contents of a Certificate How CA Certificates Are Used to Establish Trust A Certificate Identifies Someone or Something A certif...
WebVR — Virtual Reality for the Web - Game development
the future looks bright -- we already have sufficient technology to make the VR experience "good enough" for playing games. There are many devices to chose from: desktop ones like Oculus Rift or HTC Vive, through consoles with Playstation VR (which admittedly doesn't support WebVR at this time), to mobile experiences like Gear VR or Google Cardboard. Note: For more information, read our WebVR
Concepts article. 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...
...to work on the implementation together), but sooner rather than later we'll see it in regular builds. The WebVR spec is in Editor's Draft status which means it is still subject to change. The development is led by Vladimir Vukicevic from Mozilla and Brandon Jones from Google. For more info be sure to visit the MozVR.com and WebVR.info websites. Using the WebVR API The WebVR API is based on two
concepts -- sending stereoscopic images to both lenses in your headset and receiving positional data for your head from the sensor, and those two are handled by HMDVRDevice (head-mounted display virtual reality device) and PositionSensorVRDevice. Get the devices To get information about devices connected to your computer, you can use the Navigator.getVRDevices method: navigator.getVRDevices().then(func...
Legacy layout methods - Learn web development
en fit your content columns inside these imaginary columns. In this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older project. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS and Styling boxes.) Objective: To understand the fundamental
concepts behind the grid layout systems used prior to CSS Grid Layout being available in browsers. Layout and grid systems before CSS Grid Layout It may seem surprising to anyone coming from a design background that CSS didn't have an inbuilt grid system until very recently, and instead we seemed to be using a variety of sub-optimal methods to create grid-like designs. We now refer to these as "le...
...ample running at 0_two-column-layout.html (see also the source code). Creating simple legacy grid frameworks The majority of legacy frameworks use the behavior of the float property to float one column up next to another in order to create something that looks like a grid. Working through the process of creating a grid with floats shows you how this works and also introduces some more advanced
concepts to build on the things you learned in the lesson on floats and clearing. The easiest type of grid framework to create is a fixed width one -- we just need to work out how much total width we want our design to be, how many columns we want, and how wide the gutters and columns should be. If we instead decided to lay out our design on a grid with columns that grow and shrink according to browser w...
What is a URL? - Learn web development
It is the mechanism used by browsers to retrieve any published resource on the web. URL stands for Uniform Resource Locator. ...
...It is the mechanism used by browsers to retrieve any published resource on the web. URL stands for Uniform Resource Locator. ...
Common questions - Learn web development
nternet work? The Internet is the backbone of the Web, the technical infrastructure that makes the Web possible. At its most basic, the Internet is a massive network of computers communicating with each other. This article discusses how it works, in broad terms. What is the difference between webpage, website, Web server, and search engine? In this article we describe various Web-related
concepts: webpages, websites, Web servers, and search engines. These terms are often a source of confusion for newcomers to the Web, or are used incorrectly. Let's discover what they actually mean! What are hyperlinks? In this article, we'll go over what hyperlinks are and why they matter. What is a URL? With Hypertext and HTTP, URL is a key concept when it comes to the Internet. It is the mec...
...article covers the all-important first step of every project: define what you want to accomplish with it. What do common Web layouts contain? When designing pages for your website, it's good to have an idea of the most common layouts. This article runs through some typical Web layouts, looking at the parts that make up each one. What is accessibility? This article introduces the basic
concepts behind Web accessibility. How can we design for all types of users? This article provides basic techniques to help you design websites for any kind of user -- quick accessibility wins, and other such things. What HTML features promote accessibility? This article describes specific features of HTML that can be used to make a webpage more accessible to people with different disabilities...
Graceful asynchronous programming with Promises - Learn web development
uivalent of a try...catch block in sync code. Bear in mind that synchronous try...catch won't work in async code. Promise terminology recap There was a lot to cover in the above section, so let's go back over it quickly to give you a short guide that you can bookmark and use to refresh your memory in the future. You should also go over the above section again a few more time to make sure these
concepts stick. When a promise is created, it is neither in a success or failure state. It is said to be pending. When a promise returns, it is said to be resolved. A successfully resolved promise is said to be fulfilled. It returns a value, which can be accessed by chaining a .then() block onto the end of the promise chain. The executor function inside the .then() block will contain the promise...
...e number, for example, and you'll be able to see the promise reject with the appropriate error messages! You could also try doing something else with the resolved message rather than just alerting it. Note: You can find our version of this example on GitHub as custom-promise2.html (see also the source code). A more real-world example The above example was kept deliberately simple to make the
concepts easy to understand, but it is not really very async. The asynchronous nature is basically faked using setTimeout(), although it does still show that promises are useful for creating a custom function with a sensible flow of operations, good error handling, etc. One example we'd like to invite you to study, which does show a useful async application of the Promise() constructor, is Jake Archibald...
Asynchronous JavaScript - Learn web development
ential information you need to work towards your goal. Get started Prerequisites Asynchronous JavaScript is a fairly advanced topic, and you are advised to work through JavaScript first steps and JavaScript building blocks modules before attempting this. ...
...us programming
concepts article in this module. If you are, then you can probably skip to the Introducing asynchronous JavaScript module. Note: If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as JSBin or Glitch. Guides General asynchronous programming
concepts In this article we'll run through a number of important
concepts relating to asynchronous programming, and how this looks in web browsers and JavaScript. You should understand these
concepts before working through the other articles in the module. Introducing asynchronous JavaScript In this article we briefly recap the problems associated with sychronous JavaScript, and take a first look a...
Introduction to events - Learn web development
Previous Overview: Building blocks Next Events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired. For example, if the user selects a button on a webpage, you might want to respond to that action by displaying an information box. In this article, we discuss some important
concepts surrounding events, and look at how they work in browsers. This won't be an exhaustive study; just what you need to know at this stage. Prerequisites: Basic computer literacy, a basic understanding of HTML and CSS, JavaScript first steps. Objective: To understand the fundamental theory of events, how they work in browsers, and how events may differ in different programming environme...
...te: If you are called on to support browsers older than Internet Explorer 8, you may run into difficulties, as such ancient browsers use different event models from newer browsers. But never fear, most JavaScript libraries (for example jQuery) have built-in functions that abstract away cross-browser differences. Don't worry about this too much at this stage in your learning journey. Other event
concepts In this section, we briefly cover some advanced
concepts that are relevant to events. It is not important to understand these
concepts fully at this point, but they might serve to explain some code patterns you'll likely come across. Event objects Sometimes inside an event handler function, you'll see a parameter specified with a name such as event, evt, or simply e. This is called the event o...
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. In this article we'll explore fundamental
concepts behind functions such as basic syntax, how to invoke and define them, scope, and parameters. Prerequisites: Basic computer literacy, a basic understanding of HTML and CSS, JavaScript first steps. Objective: To understand the fundamental
concepts behind JavaScript functions. Where do I find functions? In JavaScript, you'll find functions everywhere. In fact, we've been using functions all the wa...
... ...
Looping code - Learn web development
unt of food needed is set at 10, and the amount the farmer currently has is set at 0. In each iteration of the loop, we check whether the amount of food the farmer has is larger or equal to the amount he needs. If so, we can exit the loop. If not, the farmer spends an hour collecting two portions of food, and the loop runs again. Why bother? At this point, you probably understand the high-level
concepts behind loops, but you are probably thinking "OK, great, but how does this help me write better JavaScript code?" As we said earlier, loops are all to do with doing the same thing over and over again, which is great for rapidly completing repetitive tasks. Often, the code will be slightly different on each successive iteration of the loop, which means that you can complete a whole load of tasks t...
...e. If you want to go further with your loop learning, read our advanced Loops and iteration guide. Test your skills! You've reached the end of this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: Loops. Conclusion This article has revealed to you the basic
concepts behind, and different options available when looping code in JavaScript. You should now be clear on why loops are a good mechanism for dealing with repetitive code and are raring to use them in your own examples! If there is anything you didn't understand, feel free to read through the article again, or contact us to ask for help. ...
JavaScript building blocks - Learn web development
ook at loop structures in JavaScript. Functions -- reusable blocks of code Another essential concept in coding is functions. Functions allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command -- rather than having to type out the same code multiple times. In this article we'll explore fundamental
concepts behind functions such as basic syntax, how to invoke and define functions, scope, and parameters. Build your own function With most of the essential theory dealt with previously, this article provides a practical experience. Here you'll get some practice with building up your own custom function. Along the way, we'll also explain some further useful details of dealing with functions. Function ...
...ions return useful values. Introduction to events Events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired. For example if the user clicks a button on a webpage, you might want to respond to that action by displaying an information box. In this final article we will discuss some important
concepts surrounding events, and look at how they work in browsers. Assessments The following assessment will test your understanding of the JavaScript basics covered in the guides above. Image gallery Now that we've looked at the fundamental building blocks of JavaScript, we'll test your knowledge of loops, functions, conditionals and events by building a fairly common item you'll see on a lot of ...
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: The above text should have given you an important fact -- you aren't expected to remember everything! Professional web developers use tools like MDN Web Docs to look up things they have forgot...
... than it is about learning lots of syntaxes. Videos There are also a number of sites that have video learning content on them. YouTube is an obvious one, with channels such as Mozilla Layout Land, MozillaDeveloper, and Google ChromeDevelopers providing many useful videos. Many people prefer textual articles for more in-depth learning and reference material, and videos for quick explanations of
concepts and new features, but it is really up to you what you prefer to learn from. There is no right and wrong answer here. Interactive code playgrounds You might be the kind of person that prefers minimal instructions and would prefer to jump straight in and start playing with code. This is also a reasonable approach, and some learning sites tend to favor it. Codecademy for example is a learning site...
Deployment and next steps - Learn web development
Rich Harris, available at Frontend Masters. Even though Svelte is a relatively young project there are lots of tutorials and courses available on the web, so it's difficult to make a recommendation. Nevertheless, Svelte.js -- The Complete Guide by Academind is a very popular option with great ratings. The Svelte Handbook, by Flavio Copes, is also a useful reference for learning the main Svelte
concepts. If you prefer to read books, there's Svelte and Sapper in Action by Mark Volkman, expected to be published in September 2020, but which you can already preview online for free. If you want dive deeper and understand the inner working of Svelte's compiler you should check Tan Li Hau's Compile Svelte in your head blog posts. Here's Part 1, Part 2, and Part 3. Interacting with the community Th...
...ding and deploying a complete application. We learned about Svelte philosophy and what sets it apart from other front-end frameworks. We saw how to add dynamic behavior to our web site, how to organize our app in components and different ways to share information among them. We took advantage of the Svelte reactivity system and learned how to avoid common pitfalls. We also saw some advanced
concepts and techniques to interact with DOM elements and to programmatically extend HTML element capabilities using the use directive. Then we saw how to use stores to work with a central data repository, and we created our own custom store to persist our application's data to Web Storage. We also took a look at Svelte's TypeScript support. In this article we've learned about a couple of zero-fuss op...
Getting started with Svelte - Learn web development
nilla JavaScript. The outcome of this approach is not only smaller application bundles and better performance, but also a developer experience that is more approachable for people that have limited experience of the modern tooling ecosystem. Svelte sticks closely to the classic web development model of HTML, CSS, and JS, just adding a few extensions to HTML and JavaScript. It arguably has fewer
concepts and tools to learn than some of the other framework options. It's main current disadvantages are that it is a young framework -- its ecosystem is therefore more limited in terms of tooling, support, plugins, clear usage patterns, etc. than more mature frameworks, and there are also less job opportunities. But it's advantages should be enough to make you interested to explore it. Note: recently...
...etc. than more mature frameworks, and there are also less job opportunities. But it's advantages should be enough to make you interested to explore it. Note: recently Svelte has added official TypeScript support, one of its most requested features. We'll look at it later on in this tutorial series. We encourage you to go through the Svelte tutorial for a really quick introduction to the basic
concepts, before returning to this tutorial series to learn how to build something slightly more in-depth. It should take you about 30 minutes to complete. Use cases Svelte can be used to develop small pieces of an interface or whole applications. You can either start from scratch letting Svelte drive your UI or you can incrementally integrate it into an existing application. Nevertheless, Svelte is pa...
Introduction to cross browser testing - Learn web development
topic of (cross) browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages. Objective: To gain an understanding of the high-level
concepts involved in cross browser testing. What is cross browser testing? Cross browser testing is the practice of making sure that the web sites and web apps you create work across an acceptable number of web browsers. As a web developer, it is your responsibility to make sure that not only do your projects work, but they work for all your users, no matter what browser, device, or additional ass...
...g process to make sure your fix is working OK, and hasn't caused the site to break in other places or in other browsers. Reporting bugs Just to reiterate on what was said above, if you discover bugs in browsers, you should report them: Firefox Bugzilla EdgeHTML issue tracker Safari Chrome Opera Summary This article should have given you a high-level understanding of the most important
concepts you need to know about cross browser testing. Armed with this knowledge, you are now ready to move on and start learning about Cross browser testing strategies. Overview: Cross browser testing Next In this module Introduction to cross browser testing Strategies for carrying out testing Handling common HTML and CSS problems Handling common JavaScript problems Handling common access...
Avoiding leaks in JavaScript XPCOM components
Quite a lot has happened since this article was written. E. g. in Firefox 3, a cycle collector was introduced and refined in later versions, and Mozilla is currently working on a generational garbage collector for JS. This article needs to be updated to reflect the changes and the cases where they help. Take every information on this site with a grain of salt, although most
concepts and best practices still apply. Using XPCOM in JavaScript (also known as XPConnect) is an environment where memory management issues are not obvious. There are no calls to malloc and free and no reference counting. Despite this, it's easy to write JavaScript code that leaks. It's easy to write leaky code in any garbage-collected language. But it's even easier in this environment because some of the objects you'r...
...de in any garbage-collected language. But it's even easier in this environment because some of the objects you're dealing with are reference-counted behind the scenes. Programmers writing and reviewing JavaScript code in Mozilla should understand how code using XPCOM in JavaScript can leak so that they can avoid leaks. This document attempts to help them do so, first by explaining the underlying
concepts, and second by describing a number of common JavaScript patterns that cause leaks. Basics of memory management Creating objects that are not a fixed size for the lifetime of the program (global variables) or a fixed size for the lifetime of a function (stack variables) requires a system for dynamic memory allocation: a system that allocates memory from a space called the heap. The requirements ...
Index
oiding leaks in JavaScript XPCOM components Add-ons, Developing Mozilla, Extensions, Mozilla, NeedsUpdate, Obsolete, XPCOM, XPCOM:Language Bindings, XPConnect Programmers writing and reviewing JavaScript code in Mozilla should understand how code using XPCOM in JavaScript can leak so that they can avoid leaks. This document attempts to help them do so, first by explaining the underlying
concepts, and second by describing a number of common JavaScript patterns that cause leaks. 100 Creating XPCOM components Deprecated, Guide, NeedsMarkupWork, XPCOM This guide is about Gecko, and about creating XPCOM components for Gecko-based applications. 101 An Overview of XPCOM XPCOM This is a book about XPCOM. The book is presented as a tutorial about creating...
...ript patterns that cause leaks. 100 Creating XPCOM components Deprecated, Guide, NeedsMarkupWork, XPCOM This guide is about Gecko, and about creating XPCOM components for Gecko-based applications. 101 An Overview of XPCOM XPCOM This is a book about XPCOM. The book is presented as a tutorial about creating XPCOM components, but it covers all major aspects,
concepts, and terminology of the XPCOM component model along the way. 102 Building the WebLock UI XPCOM Up until now, we've been building a component that can be installed in any Gecko application. The XPCOM interfaces and tools you've used have been general, cross-platform, and available in the Gecko Runtime Environment or in any Gecko-based application after Mozilla 1.2 (when the GR...
Dominators view - Firefox Developer Tools
lled the Dominators view. This is useful for understanding the "retained size" of objects allocated by your site: that is, the size of the objects themselves plus the size of the objects that they keep alive through references. If you already know what shallow size, retained size, and dominators are, skip to the Dominators UI section. Otherwise, you might want to review the article on Dominators
concepts. Dominators UI To see the Dominators view for a snapshot, select "Dominators" in the "View" drop-down list. It looks something like this: The Dominators view consists of two panels: the Dominators Tree panel shows you which nodes in the snapshot are retaining the most memory the Retaining Paths panel (new in Firefox 47) shows the 5 shortest retaining paths for a single node. Dominato...
...n see the retaining object, and even that this particular array is the array of fierce monsters. But the array is also rooted directly, so if the object were to stop referencing the array, it would still not be eligible for garbage collection. This means that the object does not dominate the array, and is therefore not shown in the Dominators Tree view. See the relevant section of the Dominators
concepts article. Using the Call Stack view Finally, you can switch to the Call Stack view, see where the objects are being allocated, and jump to that point in the Debugger: ...
Fetch API - Web APIs
The Fetch API provides an interface for fetching resources (including across the network). It will seem familiar to anyone who has used XMLHttpRequest, but the new API provides a more powerful and flexible feature set.
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). It also defines related
concepts such as CORS and the HTTP Origin header semantics, supplan...
...were updated in these versions: Firefox version 61.0b13. Safari version 12. Chrome version 68. If you are targetting older versions of these browsers, be sure to include credentials: 'same-origin' init option on all api requests that may be affected by cookies/user login state. Note: Find out more about using the Fetch API features in Using Fetch, and study
concepts in Fetch basic
concepts. Aborting a fetch Browsers have started to add experimental support for the AbortController and AbortSignal interfaces (aka The Abort API), which allow operations like Fetch and XHR to be aborted if they have not already completed. See the interface pages for more details. Fetch Interfaces WindowOrWorkerGlobalScope.fetch() The fetch() method used to fetch a resourc...
FileSystemEntrySync - Web APIs
cluding copying, moving, removing, and reading files--as well as information about the file it points to--including the file name and its path from the root to the entry. Warning: This API was never accepted and never became standardized. 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. Basic
concepts The FileSystemEntrySync interface includes methods that you would expect for manipulating files and directories, but it also include a really handy method for getting a URL of the entry: toURL(). It also introduces a new URL scheme: filesystem:. You can use the filesystem: scheme on Google Chrome to see all the files and folders that are stored in the origin of your app. Just use filesystem: sc...
...directories. NO_MODIFICATION_ALLOWED_ERR One of the following is not writable: the source entry, its parent directory, and the target directory. QUOTA_EXCEEDED_ERR The operation would cause the application to exceed its storage quota. You can ask for a larger persistent storage, which your user must explicitly grant. For more information, see the article on basic
concepts. toURL() Returns a URL that can be used to identify this entry. It exposes a new URL scheme--filesystem:--that you can use to fill src or href attributes. For example, if you wanted to display an image and have its fileEntry, calling toURL() gives you the image file's file system URL. You get something like: filesystem:http://example.com/temporary/lolcat.png. The file system URL does no...
The HTML DOM API - Web APIs
images and the context of an HTML <canvas>, for example to draw on top of them. Management of media connected to the HTML media elements (<audio> and <video>). Dragging and dropping of content on webpages. 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. HTML DOM
concepts and usage In this article, we'll focus on the parts of the HTML DOM that involve engaging with HTML elements. Discussion of other areas, such as Drag and Drop, WebSockets, Web Storage, etc. can be found in the documentation for those APIs. Structure of an HTML document The Document Object Model (DOM) is an architecture that describes the structure of a document; each document is represented by...
...sider a <a> element, which is represented in the DOM by an object of type HTMLAnchorElement. The element, then, includes the anchor-specific properties and methods described in that class's documentation, but also those defined by HTMLElement and Element, as well as from Node and, finally, EventTarget. Each level defines a key aspect of the utility of the element. From Node, the element inherits
concepts surrounding the ability for the element to be contained by another element, and to contain other elements itself. Of special importance is what is gained by inheriting from EventTarget: the ability to receive and handle events such as mouse clicks, play and pause events, and so forth. There are elements that share commonalities and thus have an additional intermediary type. For example, the <aud...
Media Capture and Streams API (Media Stream) - Web APIs
the Media Streams API or simply MediaStream API, is an API related to WebRTC which provides support for streaming audio and video data. It provides the interfaces and methods for working with the streams and their constituent tracks, the constraints associated with data formats, the success and error callbacks when using the data asynchronously, and the events that are fired during the process.
Concepts and usage The API is based on the manipulation of a MediaStream object representing a flux of audio- or video-related data. See an example in Get the video. A MediaStream consists of zero or more MediaStreamTrack objects, representing various audio or video tracks. Each MediaStreamTrack may have one or more channels. The channel represents the smallest unit of a media stream, such as an audio s...
...ny existing code to instead use MediaStreamTrack directly. Events addtrack ended muted overconstrained removetrack started unmuted Guides and tutorials The articles below provide additional guidance and how-to information that will help you learn to use the API, and how to perform specific tasks that you may wish to handle. Capabilities, constraints, and settingsThe twin
concepts of constraints and capabilities let the browser and Web site or app exchange information about what constrainable properties the browser's implementation supports and what values it supports for each one. This article discusses capabilities and constraints, as well as media settings, and includes an example we call the Constraint Exerciser. ...
PaymentRequest: merchantvalidation event - Web APIs
merchantvalidation events are delivered by the Payment Request API to a PaymentRequest object when a payment handler requires that the merchant requesting the purchase validate itself as permitted to use the payment handler. See Merchant validation in Payment processing
concepts for details on how the merchant validation process works. Bubbles No Cancelable No Interface MerchantValidationEvent Event handler property onmerchantvalidation Examples In this example, an event handler is established for the merchantvalidation event. It uses the fetch() to send a request to its own server with an argument of the payment method's validation URL, obtained from the event's validationURL property. The merchant server should access the validation URL ...
... Related events payerdetailchange, paymentmethodchange, shippingaddresschange, and shippingoptionchange Specifications Specification Status Comment Payment Request APIThe definition of 'merchantvalidation' in that specification. Candidate Recommendation ...
Streams API - Web APIs
This is something browsers do anyway when receiving assets to be shown on webpages -- videos buffer and more is gradually available to play, and sometimes you'll see images display gradually as more is loaded. But this has never been available to JavaScript before. ...
...ed with ReadableStream.getReader(), cancel it with ReadableStream.cancel(), etc. More complicated uses involve creating your own stream using the ReadableStream() constructor, for example to process data inside a service worker. You can also write data to streams using WritableStream. Note: You can find a lot more details about the theory and practice of streams in our articles -- Streams API
concepts, Using readable streams, and Using writable streams. Stream interfaces Readable streams ReadableStream Represents a readable stream of data. It can be used to handle response streams of the Fetch API, or developer-defined streams (e.g. a custom ReadableStream() constructor). ReadableStreamDefaultReader Represents a default reader that can be used to read stream data supplied from a netwo...
WebGL by example - Web APIs
The examples are sorted according to topic and level of difficulty, covering the WebGL rendering context, shader programming, textures, geometry, user interaction, and more. Examples by topic The examples are sorted in order of increasing difficulty. But rather than just presenting them in a single long list, they are additionally divided into topics. Sometimes we revisit a topic several times, such as when needing to discuss it initially at a basic level, and later at intermediate and advanced levels. ...
...times, such as when needing to discuss it initially at a basic level, and later at intermediate and advanced levels. Instead of trying to juggle shaders, geometry, and working with GPU memory, already in the first program, the examples here explore WebGL in an incremental way. We believe that it leads to a more effective learning experience and ultimately a deeper understanding of the underlying
concepts. Explanations about the examples are found in both the main text and in comments within the code. You should read all comments, because more advanced examples could not repeat comments about parts of the code that were previously explained. Getting to know the rendering context Detect WebGL This example demonstrates how to detect a WebGL rendering context and reports the result to the user...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
t that brings together multiple disciplines in computer science, mathematics, art, graphic design, kinematics, anatomy, physiology, physics, and cinematography. Since we don't have a real camera, we imagine one, reproducing the effect of having a camera, without actually having the ability to move the user around the scene. There are a few articles about the fundamental math, geometry, and other
concepts behind WebGL and WebXR which may be useful to read before or while reading this one, including: Explaining basic 3D theory Matrix math for the web WebGL model view projection Geometry and reference spaces in WebXR Ed. note: Most diagrams used in this article to show how the camera moves while performing standard movements was taken from an article on the FilmmakerIQ web site; namely, from...
...ramatically change the results of the next operation performed. So you need to be careful about the order in which you apply your transforms when building your composite transform (or directly applying transforms in sequence). Applying the transform To apply the transform, you multiply the point or vector by the transform or composition of transforms. This has been a very quick overview of the
concepts of position in terms of physical location, orientation or facing direction, and perspective. For more detail on the subject, see the articles Geometry and reference spaces, WebGL model view projection, and Matrix math for the web. Simulating classic cinematography Cinematography is the art of designing, planning, and executing camera movements to create the desired look and emotion for a scene ...
Web Animations API - Web APIs
To get more information on the
concepts behind the API and how to use it, read Using the Web Animations API. Web Animations interfaces Animation Provides playback controls and a timeline for an animation node or source. ...
... The Web Animations API allows for synchronizing and timing changes to the presentation of a Web page, i.e. animation of DOM elements. It does so by combining two models: the Timing Model and the Animation Model.
Concepts and usage The Web Animations API provides a common language for browsers and developers to describe animations on DOM elements. To get more information on the
concepts behind the API and how to use it, read Using the Web Animations API. Web Animations interfaces Animation Provides playback controls and a timeline for an animation node or source. Can take an object created with the KeyframeEffect() constructor. KeyframeEffect Describes sets of animatable properties and values, called keyframes and their timing options. These can then be played using the Animation() constr...
Web Accessibility: Understanding Colors and Luminance - Accessibility
that color is received by the viewer. How the viewer perceives color after it gets to his eyes is yet another matter, and can be affected by overall health. Luckily, CSS Media Queries Level 5 will be a game-changer in accessibility initiatives, because it will allow users to select settings that accomodate their needs best. Color, contrast, and luminance are among the most central and critical
concepts to creating accessible web content with color. Luminance is of particular importance, however, because at the end of the day, understanding of what it is and how it is employed enables accessibility for those who are color-blind, as well as those who can perceive color. It is the luminance contrast that enable the color-blind to distinguish dark against light. Luminance must be established bef...
...of color contrast, W3C formulas are actually incorporating luminance, not just the colors ("hues") themselves. Terminology can be confusing, because different terms are often used to describe the same thing. "Luminance" and "Saturation" are particularly important to get right. For example, "saturation" is known as "chroma" in some circles. In others, "chroma" and "saturation" are two different
concepts. The "L" in the HSL color space is sometimes referred to as "luminosity," other times as "lightness." Even something seemingly simple like naming common colors can be open to debate. For example, the color "crimson red" may be described in hex values as #990000 by some and #DC143C by others. For the purposes of this document, we'll use terminlogy as it is defined in the W3C, in the CSS Color ...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
operties were initially defined in the CSS Grid specification and named grid-row-gap, grid-column-gap and grid-gap. They have been renamed and moved to Box Alignment in order that they can be used in all layout methods -- this will ultimately include flexbox. Until browsers implement the gap properties for flexbox, margins have to be used to create gaps between items. Writing Modes In the Basic
concepts of flexbox article, I explained that flexbox is writing mode aware. Writing modes are fully detailed in the CSS Writing Modes specification, which details how CSS supports the various different writing modes that exist internationally. We need to be aware of how this will impact our flex layouts as writing mode changes the direction that blocks are laid out in our document. Understanding block an...
...fference is between Flexbox and CSS Grid Layout -- why do we have two specifications that sometimes appear to be doing the same thing? The most straightforward answer to this question is defined in the specifications themselves. Flexbox is a one-dimensional layout method whereas Grid Layout is a two-dimensional layout method. The example below has a flex layout. As already described in the Basic
concepts article, flex items can be allowed to wrap but, once they do so, each line becomes a flex container of its own. When space is distributed flexbox does not look at the placement of items in other rows and tries to line things up with each other. If we create a very similar layout using Grid, we can control the layout in both rows and columns. These examples point to another key difference be...
CSS reference - CSS: Cascading Style Sheets
Also included is a brief DOM-CSS / CSSOM reference. Basic rule syntax Style rule syntax style-rule ::= selectors-list { properties-list } ... ...
...fies that the element selected by B is located within the table column specified by A. Elements which span multiple columns are considered to be a member of all of those columns. Pseudo Pseudo classes : Specifies a special state of the selected element(s). Pseudo elements :: Represents entities that are not included in HTML. See also: Selectors in the Selectors Level 4 specification. ...
CSS Tutorials - CSS: Cascading Style Sheets
y so that you can choose the most appropriate for your level. Editor's note: We should look at using "difficulty level" tags on the tutorial/guide pages so that difficulty-based lists can be automatically built. Beginner-level CSS tutorials Getting started This guide is aimed at complete beginners: You haven't written one single line of CSS? -- this is for you. It explains the fundamental
concepts of the language and guides you in writing basic stylesheets. Using multiple backgrounds Backgrounds are fundamental for nice styling: CSS allows you to set several of them on each box. This tutorial explains how they interact and how to achieve nice effects. Scaling background images CSS allows you to resize images used as an element's background. This tutorial describes how to achieve this i...
...dex Controlling superposition of boxes is a basic feature that is very quickly needed by Web developers. Though not that difficult, it requires a basic knowledge of CSS. Intermediate-level CSS tutorials After the release of CSS 2 (Level 1), new features have been added to CSS. Some of them are fancy and are pretty self contained. They are easy to use for anybody with a fair knowledge of basic
concepts. CSS Counters Counting items and pages is an easy task in CSS. Learn to use counter-reset, counter-increment, counters(), and counter(). CSS Animations CSS3 Animations allow you to define configurations of style, as keyframes, and to transition between them defining an animation. CSS Transitions CSS3 Transitions allow you to define an animation between several styles and to control the wa...
Constraint validation - Developer guides
HTML5 introduced new mechanisms for forms: it added new semantic types for the <input> element and constraint validation to ease the work of checking the form content on the client side. Basic, usual constraints can be checked, without the need for JavaScript, by setting new attributes; more complex constraints can be tested using the Constraint validation API. For a basic introduction to these
concepts, with examples, see the Form validation tutorial. Note: HTML5 Constraint validation doesn't remove the need for validation on the server side. Even though far fewer invalid form requests are to be expected, invalid ones can still be sent by non-compliant browsers (for instance, browsers without HTML5 and without JavaScript) or by bad people trying to trick your web application. Therefore, like w...
...ot only do most countries allow an optional prefix with the country code (like D- in Germany, F- in France or Switzerland), but some countries have postal codes with only a fixed number of digits; others, like the UK, have more complex structures, allowing letters at some specific positions. Note: This is not a comprehensive postal code validation library, but rather a demonstration of the key
concepts. As an example, we will add a script checking the constraint validation for this simple form: <form> <label for="ZIP">ZIP : </label> <input type="text" id="ZIP"> <label for="Country">Country : </label> <select id="Country"> <option value="ch">Switzerland</option> <option value="fr">France</option> <option value="de">Germany</option> <option value="nl">Th...
Introduction to Web development - Developer guides
head, list, form elements and more, explained by category. HTML beginners tutorial -- a tutorial and exercise that recap and take you through the basics you've learned above. HTML elements reference guide -- a comprehensive guide to HTML elements with details on how browsers support them CSS Getting started with CSS -- an absolute beginners guide to CSS covers basic
concepts and fundamentals CSS reference guide -- a complete guide to CSS with details on the level of Gecko/Firefox support for each. The W3C introduction to styling with CSS -- a brief guide to styling web pages for beginners. Common CSS questions -- common questions and answers for beginners Intermediate CSS
concepts -- grouping, pseudo-classes and more. JavaScript Beg...
...ed JavaScript -- learn about the JavaScript object model. Christian Heilmann's JavaScript best practices -- learn about some of the obvious and (not so) obvious best practices when writing JavaScript. Advanced Learning advanced JavaScript -- John Resig's guide to advanced JavaScript Crockford on Advanced JavaScript -- a three part video series on advanced JavaScript
concepts JavaScript Garden -- Documentation of the most quirky parts of JavaScript. Resources W3C Web Education Community Group Wiki Covers web design, HTML and HTML5, CSS, JavaScript and accessibility. This is a good starting point for beginners wishing to learn web development fundamentals across a number of areas. SitePoint A reliable reference site for l...
Basics of HTTP - HTTP
Articles Overview of HTTP Describes what HTTP is and its role in web architecture, including its position in the protocol stack. Evolution of HTTP HTTP was created in the early 1990s and has been extended several times. This article goes through its history and describes HTTP/0.9, HTTP/1.0, HTTP/1.1, and the modern HTTP/2, as well as novelties introduced over the years. ...
...es this structure, its purpose, and its possibilities. Frame and message structure in HTTP/2 HTTP/2 encapsulates and represents HTTP/1.x messages in a binary frame. This article explains the frame structure, its purpose, and the way it's encoded. Connection management in HTTP/1.x HTTP/1.1 was the first version of HTTP to support persistent connection and pipelining. This article explains both
concepts. Connection management in HTTP/2 HTTP/2 completely revisited how connections are created and maintained. This article explains how HTTP frames allow multiplexing and solve the 'head-of-line' blocking problem of former HTTP versions. Content Negotiation HTTP introduces a set of headers, starting with Accept as a way for a browser to announce the format, language, or encoding it prefers. This a...
Web audio codec guide - Web media technologies
s to use for your content. Additionally, WebRTC implementations generally use a subset of these codecs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-platform support of video and audio conferencing, and to integrate better with legacy telecommunication solutions. See Codecs used by WebRTC for details. For information about the fundamental
concepts behind how digital audio works, see the article Digital audio
concepts. Common codecs The list below denotes the codecs most commonly used on the web and which containers (file types) support them. If all you need to know is which codecs are even possible to use, this is for you. Of course, individual browsers may or may not choose to support all of these codecs, and their support for which con...
...coded file larger; it will never make it smaller. Of course, these effects can be altered by decisions made while encoding the audio. For example, if the encoder is configured to reduce the sample rate, the sample rate's effect on the output file will be reduced in kind. For more information about these and other features of audio data, see Audio data format and structure in Digital audio
concepts. The effect of codec configuration on encoded audio output Audio codecs typically employ cleverly-designed and highly-complex mathematical algorithms to take source audio data and compress it to take substantially less space in memory or network bandwidth. In addition to choosing the type of encoder to use, you may have the opportunity to adjust the encoder using parameters that choose specific...
The "codecs" parameter in common media types - Web media technologies
DD The two-digit component bit depth. This value must be one of 8, 10, or 12; which values are valid varies depending on the profile and other properties. M The one-digit monochrome flag; if this is 0, the video includes the U and V planes in addition to the Y plane. Otherwise, the video data is entirely in the Y plane and is therefore monochromatic. See YUV in Digital video
concepts for details on how the YUV color system works. The default value is 0 (not monochrome). CCC CCC indicates the chroma subsampling as three digits. The first digit is subsampling_x, the second is subsampling_y. If both of those are 1, the third is the value of chroma_sample_position; otherwise, the third digit is always 0. This, combined with the M component, can be used to constru...
...he first digit is the ones digit, and the second digit represents tenths. For example, level 3 is 30 and level 6.1 is 61. DD The bit depth of the luma and color component values; permitted values are 8, 10, and 12. CC A two-digit value indicating which chroma subsampling format to use. The following table lists permitted values; see Chroma subsampling in Digital video
concepts for additional information about this topic and others. WebM chroma subsampling identifiers Value Chroma subsampling format 00 4:2:0 with the chroma samples sited interstitially between the pixels 01 4:2:0 chroma subsampling with the samples colocated with luma (0, 0) 02 ...
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. This article teaches you what you'll need to know. Note: If you are unfamiliar with the basic
concepts mentioned in this article and need more explanation, read WebAssembly
concepts first, then come back. Some simple examples Let's run through some examples that explain how to use the WebAssembly JavaScript API, and how to use it to load a wasm module in a web page. Note: You can find the sample code in our webassembly-examples GitHub repo. Preparing the example First we need a wasm module! Grab our simple.wasm file and save a copy in a new directory on your local m...
...ging with Firefox DevTools for a video preview. Memory In the low-level memory model of WebAssembly, memory is represented as a contiguous range of untyped bytes called Linear Memory that are read and written by load and store instructions inside the module. In this memory model, any load or store can access any byte in the entire linear memory, which is necessary to faithfully represent C/C++
concepts like pointers. Unlike a native C/C++ program, however, where the available memory range spans the entire process, the memory accessible by a particular WebAssembly Instance is confined to one specific -- potentially very small -- range contained by a WebAssembly Memory object. This allows a single web app to use multiple independent libraries -- each of which are using WebAssembly internally --...
Local Storage - Archive of obsolete content
will have saved a lot of coding. Since templates are not necessary for most extensions and they're a complicated subject, it's better that you read it from the experts. There's a very detailed XUL Template Guide here. As mentioned before, it revolves around RDF, so you may need to take some time to understand how RDF works. There's a section about SQLite Templates in the guide, but there are some
concepts in it that will require you to read at least some of the rest of it. << PreviousNext >> This tutorial was kindly donated to Mozilla by Appcoast. ...
Adding preferences to an extension - Archive of obsolete content
<< PreviousNext >> This article takes the Creating a dynamic status bar extension sample to the next level, adding a popup menu that lets you quickly switch between multiple stocks to watch. It also adds a preference dialog that lets you switch to a stock other than one of the ones included in the popup menu. As before,
concepts covered in the previous articles in this series won't be rehashed here, so if you haven't already seen them: Creating a status bar extension Creating a dynamic status bar extension Also, for reference, you may want to take a look at Preferences System and the Preferences API. Download the sample You can download a copy of this sample to look over, or to use as the basis for your own extension. Get the code here: Download the sample Update the man...
Creating a dynamic status bar extension - Archive of obsolete content
This article builds upon the article Creating a status bar extension, which creates a static status bar panel in the Firefox status bar, by dynamically updating its content with information fetched from the web every few minutes. Specifically, this sample displays a stock quote in the status bar, and, when you mouse over it, displays a tooltip containing more detailed information about the stock.
Concepts covered in the previous sample won't be reiterated here; instead, refer to the downloadable sample code or to the previous sample for further details. Download the sample You can download a copy of this sample to look over, or to use as the basis for your own extension. Or, if you've already got the code from the Creating a status bar extension sample, you can follow this tutorial to update that ...
Creating a status bar extension - Archive of obsolete content
the goal of this series of articles is to help compile information for new extension developers into one place to make it easy to jump in and get started. Note: The extension created by this tutorial won't work in Firefox that don't have a static status bar (that is, Firefox 4 and up). You can find a more up-to-date tutorial in the XUL School tutorial The Essentials of an Extension. Many of the
concepts introduced here apply to any XUL-based application; however, to keep from getting completely overwhelmed, we're going to focus specifically on Firefox. This sample will add a static text string to the status bar at the bottom of Firefox browser windows. If this sounds a lot like the existing Building an Extension article, you're right. However, this sample will be expanded upon in later articles ...
Index - Archive of obsolete content
e of button which is drawn differently. Unlike normal buttons, a statusbarpanel can only have a label or an image but not both. This element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. 3 A XUL Bestiary Add-ons, Extensions, NeedsTechnicalReview, XUL This XULNote presents some of the key
concepts and terms in the XUL development environment. The purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. I selected items for this group because they seemed to be either shrouded in mystery, misused as
concepts or terms, or underestimated according to their role in XUL and cross-platform development. In contrast to the Mozilla Jargo...
Introduction to XUL - Archive of obsolete content
mplete documentation, see Broadcasters and Observers. An Example Window Below is a complete sample XUL document that describes a window with a menu bar and an HTML content area. The menu bar has a menu, File, with a single menu item that dumps "Hello world!" to the debug console when selected. The content area will display the contents of the file contentframe.html. This code introduces several
concepts useful for creating real world windows not explicitly covered in this document. Follow the links for details. <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/xul.css" type="text/css"?> <!DOCTYPE window> <window id="main-window" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menubar> <menu label="...
Introduction to SSL - Archive of obsolete content
): 2246,The TLS Protocol Version 1.0. Some Red Hat products already support TLS. Most other Red Hat products plan to support the protocol in future versions. This document is primarily intended for administrators of Red Hat server products, but the information it contains may also be useful for developers of applications that support SSL. The document assumes that you are familiar with the basic
concepts of public-key cryptography, as summarized in "Introduction to Public-Key Cryptography." The SSL Protocol The Transmission Control Protocol/Internet Protocol (TCP/IP) governs the transport and routing of data over the Internet. Other protocols, such as the HyperText Transport Protocol (HTTP), Lightweight Directory Access Protocol (LDAP), or Internet Messaging Access Protocol (IMAP), run "on top ...
Security - Archive of obsolete content
intended recipient. Decryption is the process of transforming encrypted information so that it is intelligible again.Introduction to Public-Key CryptographyPublic-key cryptography and related standards and techniques underlie the security features of many products such as signed and encrypted email, single sign-on, and Secure Sockets Layer (SSL) communications. This document introduces the basic
concepts of public-key cryptography. For an overview of SSL, see "Introduction to SSL." For an overview of encryption and decryption, see "Encryption and Decryption." Information on digital signatures is available from "Digital Signatures." Introduction to SSLThis document introduces the Secure Sockets Layer (SSL) protocol. SSL has been universally accepted on the World Wide Web for authenticated and ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
on. Since Jaxer allows you to define which code is reserved for the server-side, which code stays on the client-side, and which code is shared between the two, it's very possible to produce a single page application which could also include any number of external assets such as a popular third party framework. Listing 6 shows the beginning of our application which takes advantage of some of these
concepts. Listing 6 - Creating the User Interface <link href="/jaxer_examples/js/ext-2.1/resources/css/ext-all.css" type="text/css" rel="stylesheet"/> <script src="/jaxer_examples/js/ext-2.1/adapter/ext/ext-base.js"/> <script src="/jaxer_examples/js/ext-2.1/ext-all.js"/> <link href="/jaxer_examples/css/main.css" type="text/css" rel="stylesheet"/> <script runat="both" src="/jaxe...
Archive of obsolete content
process of building Mozilla projects. Archived open Web documentation The documentation listed below is archived, obsolete material about open Web topics. Beginner tutorials This page includes archived beginners tutorials, from various places around MDN. Case Sensitivity in class and id Names Creating a dynamic status bar extension
Concepts covered in the previous sample won't be reiterated here; instead, refer to the downloadable sample code or to the previous sample for further details. Creating a status bar extension Many of the
concepts introduced here apply to any XUL-based application; however, to keep from getting completely overwhelmed, we're going to focus specifically on Firefox. CSS3 ...
Building up a basic demo with A-Frame - Game development
s and works: If you have a VR device available, now is a good time to try out your scene with it too. Note: You can also check it out on GitHub. That was easier than you thought, right? A-Frame targets web developers by offering easy to use web markup and all the advantages that brings, such as JavaScript manipulation. It is easy to start with, but also provides a powerful API for advanced
concepts, as well as dealing with cross browser differences and suchlike. The community is growing, just like the number of supported VR devices -- it's a great time to start experimenting with such frameworks. ...
Building up a basic demo with Babylon.js - Game development
ylon.js, including setting up a development environment, structuring the necessary HTML, and writing the JavaScript code. We will try to create a simple demo first -- a cube rendered on the screen. 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. Environment setup To start developing with Babylon.js, you don't need much. You should start off by: Making sure you are using a modern browser with good WebGL support, such as the latest Firefox or Chrome. Creating a directory to store your experiments in. Saving a copy of the latest Babylon.js engine inside your directory. Opening the Babylon.js documentation...
Building up a basic demo with the PlayCanvas engine - Game development
le control inputs from various devices (including gamepads). That's quite an impressive list of features -- let's see some in action. We will try putting together a simple demo first -- a cube rendered on the screen. 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. Environment setup To start developing with PlayCanvas, you don't need much. You should start off by: Making sure you are using a modern browser with good WebGL support, such as the latest Firefox or Chrome. Creating a directory to store your experiments in. Saving a copy of the latest PlayCanvas engine inside your directory. Opening the PlayCanvas documentation...
3D games on the Web - Game development
he near future, which will bring many improvements and will help developers build games for the modern web using current, powerful hardware. Explaining the basic 3D theory The basics of 3D theory centers around shapes represented in a 3D space, with a coordinate system being used to calculate their positions. See our Explaining basic 3D theory article for all the information you need. Advanced
concepts You can do a lot more with WebGL. There are some advanced
concepts which you should dive into and learn more about -- like shaders, collision detection, or the latest hot topic: virtual reality on the web. Shaders It's worth mentioning shaders, which are a separate story on their own. Shaders use GLSL, a special OpenGL shading language, with syntax similar to C, that is executed directly by th...
Collision detection - Game development
g the rectangle or not because there are no helper functions in Canvas for this. For the sake of this tutorial we will do it the easiest way possible. We will check if the center of the ball is colliding with any of the given bricks. This won't give a perfect result every time, and there are much more sophisticated ways to do collision detection, but this will work fine for teaching you the basic
concepts. A collision detection function To kick this all off we want to create a collision detection function that will loop through all the bricks and compare every single brick's position with the ball's coordinates as each frame is drawn. For better readability of the code we will define the b variable for storing the brick object in every loop of the collision detection: function collisionDetectio...
TLD - MDN Web Docs Glossary: Definitions of Web-related terms
domains with three or more characters. unsponsored top-level domains Domains that operate directly under policies established by ICANN processes for the global Internet community, for example "com" and "edu". sponsored top-level domains (sTLD) These domains are proposed and sponsored by private organizations that decide whether an applicant is eligible to use the TLD, based on community theme
concepts. infrastructure top-level domain This group consists of one domain, the Address and Routing Parameter Area (ARPA). Learn more General knowledge TLD on Wikipedia List of top-level domains ...
Handling different text directions - Learn web development
ogical versions for most things, as they make a lot of sense once you start also dealing with layout methods such as flexbox and grid. Test your skills! We have covered a lot in this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: writing modes. Summary The
concepts explained in this lesson are becoming increasingly important in CSS. An understanding of the block and inline direction -- and how text flow changes with a change in writing mode -- will be very useful going forward. It will help you in understanding CSS even if you never use a writing mode other than a horizontal one. In the next module we will take a good look at overflow in CSS. Previous...
Sizing items in CSS - Learn web development
ation? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: Sizing. Summary This lesson has given you a rundown of some key issues that you might run into when sizing things on the web. When you move onto CSS Layout, sizing will become very important in mastering the different layout methods, so it is worth understanding the
concepts here before moving on. Previous Overview: Building blocks Next In this module Cascade and inheritance CSS selectors Type, class, and ID selectors Attribute selectors Pseudo-classes and pseudo-elements Combinators The box model Backgrounds and borders Handling different text directions Overflowing content Values and units Sizing items in CSS Images, media, ...
CSS building blocks - Learn web development
t of) the code examples in an online coding program such as JSBin or Glitch. Guides This module contains the following articles, which cover the most essential parts of the CSS language. Along the way you'll come across plenty of exercises to allow you to test your understanding. Cascade and inheritance The aim of this lesson is to develop your understanding of some of the most fundamental
concepts of CSS -- the cascade, specificity, and inheritance -- which control how CSS is applied to HTML and how conflicts are resolved. CSS selectors There are a wide variety of CSS selectors available, allowing for fine-grained precision when selecting elements to style. In this article and its sub-articles, we'll run through the different types in great detail, seeing how they work. The sub-articles ...
Grids - Learn web development
lets you lay content out in rows and columns, and has many features that make building complex layouts straightforward. This article will give you all you need to know to get started with page layout. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS and Styling boxes.) Objective: To understand the fundamental
concepts behind grid layout systems, and how to implement a grid layout using CSS Grid. What is grid layout? A grid is a collection of horizontal and vertical lines creating a pattern against which we can line up our design elements. They help us to create designs where elements don't jump around or change width as we move from page to page, providing greater consistency on our websites. A grid ...
Introduction to CSS layout - Learn web development
Prerequisites: The basics of HTML (study Introduction to HTML), and an idea of How CSS works (study Introduction to CSS.) Objective: To give you an overview of CSS page layout techniques. Each technique can be learned in greater detail in subsequent tutorials. ...
Responsive design - Learn web development
creen widths, resolutions, etc. It is an idea that changed the way we design for a multi-device web, and in this article, we'll help you understand the main techniques you need to know to master it. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps and CSS building blocks.) Objective: To understand the fundamental
concepts and history of responsive design. Historic website layouts At one point in history you had two options when designing a website: You could create a liquid site, which would stretch to fill the browser window or a fixed width site, which would be a fixed size in pixels. These two approaches tended to result in a website that looked its best on the screen of the person designing the s...
CSS layout - Learn web development
instruction on the fundamental layout tools and techniques available in CSS. At the end of the lessons is an assessment to help you check your understanding of layout methods, by laying out a webpage. Introduction to CSS layout This article will recap some of the CSS layout features we've already touched upon in previous modules -- such as different display values -- and introduce some of the
concepts we'll be covering throughout this module. Normal flow Elements on webpages lay themselves out according to normal flow - until we do something to change that. This article explains the basics of normal flow as a grounding for learning how to change it. Flexbox Flexbox is a one-dimensional layout method for laying out items in rows or columns. Items flex to fill additional space and shrink to ...
CSS first steps - Learn web development
ey terms about the language. Getting started with CSS In this article we will take a simple HTML document and apply CSS to it, learning some practical things about the language along the way. How CSS is structured Now that you have an idea about what CSS is and the basics of using it, it is time to look a little deeper into the structure of the language itself. We have already met many of the
concepts discussed here; you can return to this one to recap if you find any later
concepts confusing. How CSS works We have learned the basics of CSS, what it is for and how to write simple stylesheets. In this lesson we will take a look at how a browser takes CSS and HTML and turns that into a webpage. Using your new knowledge With the things you have learned in the last few lessons you should find ...
What is the difference between webpage, website, web server, and search engine? - Learn web development
These terms are often confused by newcomers to the web or are incorrectly used. Let's learn what they each mean! Prerequisites: You should know how the Internet works. Objective: Be able to describe the differences between a web page, a website, a web server, and a search engine. Summary As with any area of knowledge, the web comes with a lot of jargon. Don't worry, we won't overwhelm you with all of it (we have a glossary if you're curious). However, there are a few basic terms you need to understand at the outset, since you'll hear these expressions all the time as you read on. ...
What is accessibility? - Learn web development
Prerequisites: None. Objective: Learn what accessibility is and why it matters. Summary Because of physical or technical limitations, maybe your visitors can't experience your website the way you hoped. In this article we give general accessibility principles and explain a few rules. Active learning There is no active learning available yet. Dig deeper Accessibility: general principles We might associate accessibility at first with negative limitations. This building has to be accessible, so it must follow these regulations for door width and toilet size and elevator placement. That's a narrow way to think of accessibility. ...
Client-side form validation - Learn web development
Previous Overview: Forms Next Before submitting data to the server, it is important to ensure all required form controls are filled out, in the correct format. This is called client-side form validation, and helps ensure data submitted matches the requirements set forth in the various form controls. This article leads you through basic
concepts and examples of client-side form validation. Prerequisites: Computer literacy, a reasonable understanding of HTML, CSS, and JavaScript. Objective: To understand what client-side form validation is, why it's important, and how to apply various techniques to implement it. Client-side validation is an initial check and an important feature of good user experience; by catching invalid data on the client-side, the user c...
UI pseudo-classes - Learn web development
th styling form controls based on their validation state (is their data valid, or not?) You'll learn much more about setting and controlling validation constraints in our next article -- Client-side form validation -- but for now we'll keep things simple with regards to form validation, so it doesn't confuse things. Styling inputs based on whether they are required or not One of the most basic
concepts with regards to client-side form validation is whether a form input is required (it has to be filled in before the form can be submitted) or optional. <input>, <select>, and <textarea> elements have a required attribute available which, when set, means that you have to fill in that control before the form will successfully submit. For example: <form> <fieldset> <legend>Feedback form</lege...
Document and website structure - Learn web development
get it looking how you wanted, but as discussed before, we need to respect semantics and use the right element for the right job. This is because visuals don't tell the whole story. We use color and font size to draw sighted users' attention to the most useful parts of the content, like the navigation menu and related links, but what about visually impaired people for example, who might not find
concepts like "pink" and "large font" very useful? Note: Colorblind people represent around 4% of the world population or, to put it another way, approximately 1 in every 12 men and 1 in every 200 women are colorblind. Blind and visually impaired people represent roughly 4-5% of the world population (in 2012 there were 285 million such people in the world, while the total population was around 7 billion...
Getting started with HTML - Learn web development
the live output. Summary You made it to the end of the article! We hope you enjoyed your tour of the basics of HTML. At this point, you should understand what HTML looks like, and how it works at a basic level. You should also be able to write a few elements and attributes. The subsequent articles of this module go further on some of the topics introduced here, as well as presenting other
concepts of the language. Note: As you start to learn more about HTML, consider learning the basics of Cascading Style Sheets, or CSS. CSS is the language used to style web pages. (for example, changing fonts or colors, or altering the page layout) HTML and CSS work well together, as you will soon discover. ...
Introduction to HTML - Learn web development
which can be applied to pieces of text to give them different meaning in a document (Is it a paragraph? Is it a bulleted list? Is it part of a table?), structure a document into logical sections (Does it have a header? Three columns of content? A navigation menu?), and embed content such as images and videos into a page. This module will introduce the first two of these and introduce fundamental
concepts and syntax you need to know to understand HTML. Looking to become a front-end web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you don't need any previous HTML knowledge, but you should have at least basic familiarity with using computers and using the web pass...
Structuring the web with HTML - Learn web development
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. You should definitely start with the first one. Introduction to HTML This module sets the stage, getting you used to important
concepts and syntax, looking at applying HTML to text, how to create hyperlinks, and how to use HTML to structure a webpage. 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. HTML tables Representing tabular data on a webpage in a...
A first splash into JavaScript - Learn web development
mputer literacy, a basic understanding of HTML and CSS, an understanding of what JavaScript is. Objective: To have a first bit of experience at writing some JavaScript, and gain at least a basic understanding of what writing a JavaScript program involves. You won't be expected to understand all of the code in detail 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. In subsequent articles, you'll revisit all these features in a lot more detail! Note: Many of the code features you'll see in JavaScript are the same as in other programming languages -- functions, loops, etc. The code syntax looks different, but the
concepts are still largely the same. Thinking like a pro...
Object prototypes - Learn web development
example when you create a string, like this: let myString = 'This is my string.'; myString immediately has a number of useful methods available on it, like split(), indexOf(), replace(), etc. Note: It is worth reading our more in-depth guide to "Using prototypes in JavaScript", once you've made sense of this section and wish to know more. This section is intentionally simplified to make these
concepts a little easier to understand when you first meet them. Important: The prototype property is one of the most confusingly-named parts of JavaScript -- you might think that this points to the prototype object of the current object, but it doesn't (that's an internal object that can be accessed by __proto__, remember?). prototype instead is a property containing an object on which you define memb...
JavaScript performance - Learn web development
to omit what is not, in fact, necessary. But not all bytes downloaded have the same impact. JavaScript bytes have to be downloaded, parsed, and exectuted. JavaScript impacts download performance. We'll cover tips and tricks to minimize that impact on download. But JavaScript can also consume the main thread, the CPU, and the battery. It can make the UI feel unresponsive or janky. We'll introduce
concepts for handling that as well. Download impact Web applications include a lot of JavaScript. Many applications are built with a JavaScrpit framework, or multiple, with several additional dependencies. Often times third party scripts and APIs are added, including A/B testing, tracking pixels, and features like maps and support features. All of this JavaScript must be downloaded. Eventually. Perform...
Website security - Learn web development
tempt to protect. Most importantly, you should understand that a web application cannot trust any data from the web browser. All user data should be sanitized before it is displayed, or used in SQL queries and file system calls. With this article, you've come to the end of this module, covering your first steps in server-side website programming. We hope you've enjoyed learning these fundamental
concepts, and you're now ready to select a Web Framework and start programming. Previous Overview: First steps In this module Introduction to the server side Client-Server overview Server-side web frameworks Website security ...
Server-side website programming - Learn web development
ide 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. Basic knowledge of programming
concepts (or of a particular programming language) is useful, but not essential. Similarly, expertise in client-side coding is not required, but a basic knowledge will help you work better with the developers creating your client-side web "front end". You will need to understand "how the web works". We recommend that you first read the following topics: What is a web server What software do I need to...
Ember resources and troubleshooting - Learn web development
Due to the conciseness of using mut, it may be desireable to reach for it. However, mut has unnatural semantics and has caused much confusion over the term of its existence. There have been a coupleof new ideas put together into the form of addons that use the public apis, ember-set-helper and ember-box. Both of these try to solve the problems of mut by introducing more obvious / "less magic"
concepts, avoiding build-time transforms and implicit Glimmer VM behavior. With ember-set-helper: <Checkbox @value={{this.someData}} @onToggle={{set this "someData" (not this.someData)}} /> With ember-box: {{#let (box this.someData) as |someData|}} <Checkbox @value={{unwrap someData}} @onToggle={{update someData (not this.someData)}} /> {{/let}} Note that none of these solutions are ...
Introduction to client-side frameworks - Learn web development
f the frameworks in this module have a large, active community, each framework's ecosystem provides tooling that Improves the developer experience. These tools make it easy to add things like testing (to ensure that your application behaves as it should) or linting (to ensure that your code is error-free and stylistically consistent). Note: If you want to find out more details about web tooling
concepts, have a read of our Client-side tooling overview. Compartmentalization Most major frameworks encourage developers to abstract the different parts of their user interfaces into components -- maintainable, reusable chunks of code that can communicate with one another. All the code related to a given component can live in one file (or a couple of specific files), so that you as a developer know e...
Starting our Svelte Todo list app - Learn web development
elte component and put static markup and styles in place, leaving everything ready to start developing our To-Do list app features, which we'll go on to in subsequent articles. We want our users to be able to browse, add and delete tasks, and also to mark them as complete. This will be the basic functionality that we'll be developing in this tutorial series, plus we'll look at some more advanced
concepts along the way too. Prerequisites: At minimum, it is recommended that you are familiar with the core HTML, CSS, and JavaScript languages, and have knowledge of the terminal/command line. You'll need a terminal with node + npm installed to compile and build your app. Objective: To learn how to create a Svelte component, render it inside another component, pass...
Componentizing our Svelte app - Learn web development
r without passing around data and functions as props, or dispatching lots of events. Stores allows you to share reactive data among components that are not hierarchically related. We will look at Stores later on in the series. The code so far Git To see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/05-advanced-
concepts Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-
concepts Remember to run npm install && npm run dev to start your app in development mode. REPL To see the current state of the code in a REPL, visit: https://svelte.dev/repl/76cc90c43a37452e8c7f70521f88b698?version=3.23.2 Summary Now we have all of our app's required functionality in place. We ca...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
le their functionality. NewTodo: Displays the <input> field and Add button for adding a new todo. TodosStatus: Displays the "x out of y items completed" status heading. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/05-advanced-
concepts Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-
concepts Remember to run npm install && npm run dev to start your app in development mode. REPL To code along with us using the REPL, start at https://svelte.dev/repl/76cc90c43a37452e8c7f70521f88b698?version=3.23.2 Working on the MoreActions component Now we'll tackle the Check All and Remove Comp...
Dynamic behavior in Svelte: working with variables and props - Learn web development
todos, mark them as complete, and filter them by status. Prerequisites: At minimum, it is recommended that you are familiar with the core HTML, CSS, and JavaScript languages, and have knowledge of the terminal/command line. You'll need a terminal with node + npm installed to compile and build your app. Objective: Learn and put into practice some basic Svelte
concepts, like creating components, passing data using props, render JavaScript expressions into our markup, modify the components state and iterating over lists. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/03-adding-dynamic-behav...
Getting started with Vue - Learn web development
ive inside, inspected it, and made a few preliminary changes. With a basic introduction out of the way, we'll now go further and build up our sample app, a basic Todo list application that allows us to store a list of items, check them off when done, and filter the list by all, complete, and incomplete todos. In the next article we'll build our first custom component, and look at some important
concepts such as passing props into it and saving its data state. Previous Overview: Client-side JavaScript frameworks Next In this module Introduction to client-side frameworks Framework main features React Getting started with React Beginning our React todo list Componentizing our React app React interactivity: Events and state React interactivity: Editing, filtering, co...
Understanding client-side JavaScript frameworks - Learn web development
high-level structure of the whole project and an individual component, see how to run the project locally, and get it prepared to start building our example. 2. Creating our first Vue component Now it's time to dive deeper into Vue, and create our own custom component -- we'll start by creating a component to represent each item in the todo list. 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. 3. Rendering a list of Vue components At this point we've got a fully working component; we're now ready to add multiple ToDoItem components to our App. In this article we'll look at adding a set of todo item data to our App.vue component, which we'll then loop through and display inside To...
Implementing feature detection - Learn web development
rgh, no geolocation!'; document.body.appendChild(para); } Try your example out! Here we use the Modernizr.geolocation test to check whether geolocation is supported by the current browser. If it is, we run some code that gets your device's current location, and plots it on a Google Map. Summary This article covered feature detection in a reasonable amount of detail, going through the main
concepts and showing you how to both implement your own feature detection tests and use the Modernizr library to implement tests more easily. Next up, we'll start looking at automated testing. Previous Overview: Cross browser testing Next In this module Introduction to cross browser testing Strategies for carrying out testing Handling common HTML and CSS problems Handling common JavaScrip...
Strategies for carrying out testing - Learn web development
"what is cross-browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages; an idea of the high level principles of cross-browser testing. Objective: To gain an understanding of the high-level
concepts involved in cross-browser testing. Gotta test 'em all? When doing cross-browser testing, you need to work out a list of browsers you will need to test on to start with. There is no way you can test on every combination of browser and device your users might use to view your site -- there are just too many, and new ones appear all the time. Instead, you should try to make sure your site w...
Mozilla accessibility architecture
eristics. For example, they all expose an accessible name, or text representation, of each object, and they all use an enumerated integer value from a finite list, to expose the role of an object. Examples of accessible role constants are ROLE_BUTTON, ROLE_CHECKBOX and ROLE_LIST, although they can have slightly different names and values in each API. In general, the accessibility APIs use similar
concepts, but use different method, constant and interfaces names. Given that there is a fair amount of commonality between accessibility API toolkits, it made sense to write of the code in a cross platform manner, and then deal with the platform differences on a consistent manner. The shared code makes itself available to the toolkit-specific code via generic XPCOM interfaces that return information abou...
Software accessibility: Where are we today?
ial drivers, braille formatting routines and software based text-to-braille translation. The importance of braille itself must be emphasized. For those that read it, braille can offer higher levels of employment and life fulfillment. Refreshable braille displays of various sizes A braille embosser Audio- and braille- based user interfaces are
concepts that software designers are historically untrained for. The basic concept is easy - dealing with information when you're blind is like seeing everything through a mail slot - sequentially and methodically. Only small pieces of sequential, non-graphical information can be conveyed - via text-to-speech or a refreshable braille display. Whatever the user does, the software needs to respond with smal...
Accessibility and Mozilla
esign-related aspects to look out for, in no particular order.Accessibility/LiveRegionDevGuideThis page is currently under construction. This developer's guide lays out general guidelines that assistive technology (AT) developers can use in developing live region support. This guide was written from an ATK/AT-SPI point of view as part of the Orca Live Region Support project. However, many of the
concepts were also used during the development of FireVox, an AT using IAccessible2.Accessible Toolkit ChecklistPlease contact the Mozilla Accessibility Community with questions or feedback.CSUN Firefox MaterialsFirefox 1.5 is a fast, free, standards compliant web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the web. In addition to winning major awards such ...
Index
e the look and feel of the user interface and personalize it to your tastes. Learn how to create and share themes! 685 Obsolete Add-ons, Archive, Look & Feel, Obsolete, Themes This page contains theme documents and resources that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs. 686 Theme
concepts Theme, add-on Themes developed using the WebExtensions API in Firefox enable you to change the look of the browser by adding images to the header area of the Firefox browser; this is the area behind the menu bar, toolbars, address bar, search bar, and tab strip. 687 Using the AMO theme generator AMO, Add-ons, Firefox, Guide, Tutorial, add-on The theme generator on a...
Themes
Themes allow you to change the look and feel of the user interface and personalize it to your tastes. Learn how to create and share themes! Browser Themes Browser theme
concepts Get an introduction to creating themes for the latest versions of Firefox Using the AMO theme generator Use the theme generator to create and submit a new theme to AMO Lightweight Themes Lightweight themes have been deprecated and are no longer accepted by AMO. Only browser themes will be accepted going forward. Tools & Resources Browser theme manifest.json keys Browser extensions theme API Discourse forum Theme related blog posts Archived resources ...
A bird's-eye view of the Mozilla framework
lla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051104 SeaMonkey/1.1a from a new source tree checked out 11/04/05. The build ID is 2005110409. TheHelp Viewer files referenced in the article are located in /seamonkey/extensions/help/ This article also assumes you are familiar with the JavaScript and C++ programming languages, object-oriented programming (OOP) terminology and design
concepts, the Microsoft(R) Component Object Model (COM), and the CORBA OMG Interface Definition Language (IDL). Organization This article first covers some conceptual groundwork, then walks through a user scenario to illustrate how key Mozilla architectural components work together to support a simpleHelp Viewer UI action. Framework Layers At a high level, you can think of the Mozilla framework as con...
How Mozilla's build system works
For many developers, typing mach build to build the tree is sufficient to work with the source tree. This document explains how the build system works. Note: This document is not intended for developers who just want to build Mozilla. For that, see the Build Documentation. ...
Inner and outer windows
Consider that when the user is looking at a document in a browser window, not only can the document the user is currently viewing change, but the document's contents can change. 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. In order to represent these levels of complexity, two "types" of window need to be considered. These don't technically refer to windows as the user sees them, but rather a perspective on what the user is looking at. Windows and the bfcache An outer window is a browsing context; that is, the actual environment in which a Document is presented to the user. ...
Browser API
This means that window.top, window.parent, window.frameElement, etc. ...
Script security
he caller gets an opaque wrapper. An opaque wrapper denies all access to the target object. However, the privileged target is able to copy objects and functions into the less privileged scope using the exportFunction() and cloneInto() functions, and the less privileged scope is then able to use them. Security checks To determine the security relation between two compartments, Gecko uses two
concepts: security principals and the act of subsuming. To establish the security relationship between two compartments A and B, Gecko asks: Does the security principal for compartment A subsume the security principal for compartment B, and vice versa? Subsumes A subsumes B A has all of the privileges of B, and possibly more, and therefore A is allowed to see and do anything that B can see ...
Gecko's "Almost Standards" Mode
ill trigger "almost standards" mode, as will any XHTML 1.0 Transitional or Frameset DOCTYPE, with or without the URI. Authors outside of IBM do not need to worry about the custom DOCTYPE that will also trigger "almost standards" mode. Recommendations For authors who are attempting to migrate to validated markup using either HTML 4.01 or XHTML 1.0, and who are still using image-in-table design
concepts, make sure to use a DOCTYPE that will trigger "almost standards" mode. Also On MDC Images, Tables, and Mysterious Gaps Mozilla's DOCTYPE sniffing Mozilla's Quirks Mode Original Document Information Author(s): Eric A. Meyer, Netscape Communications Last Updated Date: Published 08 Nov 2002 Copyright Information: Copyright (C) 2001-2003 Netscape. All rights reserved. Note: This repri...
Mozilla Content Localized in Your Language
hat is the appropriate form of expressing pluralization in your language? If yes, list all forms of plural forms and examples if there is more than one. Additional discussions can be found Here. Voice What is the appropriate form of expressing voice in your language? How should emphasis be made in your language? Character styles How are bold, italics, underlines, etc. used to express certain
concepts in your language? If these are not applicable styles, what are some of the corresponding ways to express, emphasis or highlight some of the texts. Address Format What is the format in your language? ex: most Asian countries start from big to small: [Country] [postal code][state/province][city][district][street number and name][building and suite numbers][addressee] Countries of European l...
Mozilla Style System Documentation
a style context, it walks through the style sheets (interface nsIStyleSheet) attached to a document in the order defined by the CSS cascade and finds the style rules (interface nsIStyleRule) thatmatch the content node or content node + pseudo-element pair. (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. For the CSS stylesheets, this process corresponds to CSS selector matching. 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. (In ...
Power profiling overview
It is equivalent to an amount of energy consumed per unit time. In SI units, energy is measured in Joules, and power is measured in Watts, which is equivalent to Joules per second. ...
About NSPR
riting the current generation of NSPR was known as NSPR20. The first generation of NSPR was originally conceived just to satisfy the requirements of porting Java to various host environments. NSPR20, an effort started in 1996, built on that original idea, though very little is left of the original code. (The "20" in "NSPR20" does not mean "version 2.0" but rather "second generation".) Many of the
concepts have been reformed, expanded, and matured. Today NSPR may still be appropriate as the platform dependent layer under Java, but its primary application is supporting clients written entirely in C or C++. How It Works NSPR's goal is to provide uniform service over a wide range of operating system environments. It strives to not export the lowest common denominator, but to exploit the best feature...
Introduction to NSPR
The Netscape Portable Runtime (NSPR) API allows compliant applications to use system facilities such as threads, thread synchronization, I/O, interval timing, atomic operations, and several other low-level services in a platform-independent manner. This chapter introduces key NSPR programming
concepts and illustrates them with sample code. The current implementation of NSPR allows developers to compile a single source code base on Macintosh (PPC), Win32 (NT 3.51, NT 4.0, WIN'95), and over twenty versions of Unix. NSPR does not provide a platform for porting existing code. It must be used from the beginning of a software project. NSPR Naming Conventions Naming of NSPR types, functions, and macros follows the following conventions: Types exported by NSPR begin with PR and are followed by int...
An overview of NSS Internals
rammer simply needs to release the arena, and all individually allocated blocks will be released automatically. Often freeing is combined with immediately erasing (zeroing, zfree) the memory associated to the arena, in order to make it more difficult for attackers to extract keys from a memory dump. NSS uses many C data structures. Often NSS has multiple implementations for the same or similar
concepts. For example, there are multiple presentations of certificates, and the NSS internals (and sometimes even the application using NSS) might have to convert between them. Key responsibilites of NSS are verification of signatures and certificates. In order to verify a digital signature, we have to look at the application data (e.g., a document that was signed), the signature data block (the digit...
Index
rammer simply needs to release the arena, and all individually allocated blocks will be released automatically. Often freeing is combined with immediately erasing (zeroing, zfree) the memory associated to the arena, in order to make it more difficult for attackers to extract keys from a memory dump. NSS uses many C data structures. Often NSS has multiple implementations for the same or similar
concepts. For example, there are multiple presentations of certificates, and the NSS internals (and sometimes even the application using NSS) might have to convert between them. Key responsibilites of NSS are verification of signatures and certificates. In order to verify a digital signature, we have to look at the application data (e.g., a document that was signed), the signature data block (the digit...
Introduction to Network Security Services
d always be installed whether the target system has a 32-bit CPU or a 64-bit CPU. NSS will pick the right one for the local system at run time. Note that NSS 3.x is also available in the LP64 model for these platforms, but the LP64 model of NSS 3.x does not have these two extra shared libraries. ...
JSS
d through the SunPKCS11-NSS bridge. If you use JSS, you can easily get lists of modules and tokens that are configured in the NSS DB and freely access all of it. Documentation Before you use JSS, you should have a good understanding of the crypto technologies it uses. You might want to read these documents: Introduction to Public-Key Cryptography. Explains the basic
concepts of public-key cryptography that underlie NSS and JSS. Introduction to SSL. Introduces the SSL protocol, including information about cryptographic ciphers supported by SSL and the steps involved in the SSL handshake. For information on downloading NSS releases, see NSS sources building testing. Read Using JSS to get you started with development after you've built and downloaded...
sslintro.html
crypted communications. This chapter introduces some of the basic SSL functions. Chapter 2, "Getting Started With SSL" illustrates their use in sample client and server applications. An SSL application typically includes five parts: Initialization Configuration Communication Functions Used by Callbacks Cleanup Although the details differ somewhat for client and server applications, the
concepts and many of the functions are the same for both. WARNING: Some of the SSL header files provided as part of NSS 2.0 include both public APIs documented in the NSS 2.0 documentation set and private APIs intended for internal use by the NSS implementation of SSL. You should use only the SSL APIs (and related certificate, key, and PKCS #11 APIs) that are described in this document, the SSL Refere...
Network Security Services
to contribute to NSS, you might want to read the documents highlevel overview of internal details of NSS and getting started with NSS. Documentation Background Information Overview of NSS Provides a brief summary of NSS and its capabilities. NSS FAQ Answers basic questions about NSS. Introduction to Public-Key Cryptography Explains the basic
concepts of public-key cryptography that underlie NSS. Introduction to SSL Introduces the SSL protocol, including information about cryptographic ciphers supported by SSL and the steps involved in the SSL handshake. Getting Started NSS Releases This page contains information about the current and past releases of NSS. Get the source code and Build it Instructi...
JSAPI User Guide
myjs_system, 1, 0), JS_FS_END }; ... if (!JS_DefineFunctions(cx, global, myjs_global_functions)) return false; ... Once the functions are defined in global, any script that uses global as the global object can call them, just as any web page can call alert. In the environment we have created, the "hello world" script looks like this: system("echo hello world"); JSAPI
Concepts This section aims to fill in the major gaps in the picture of the JSAPI presented so far. To do anything useful with SpiderMonkey, you must read all three sections. JavaScript values Main article: JS::Value JavaScript is a dynamically typed language: variables and properties do not have a type that is fixed at compile time. How can a statically typed language, like C or C++, in which all vari...
JS_GetFunctionObject
specified function pointer, fun. fun must be either a function implemented by a JSNative (or JSFastNative) or the result of a call to JS_CompileFunction or similar functions. In other cases, the object returned by JS_GetFunctionObject is not necessarily safe to call and should not be exposed to script. In the JavaScript language, functions are objects. But in the JSAPI there are two separate
concepts: a JSObject is what is exposed to scripts and has properties and can be stored in variables; and the corresponding JSFunction contains the code of a function. For certain functions, the two have a strictly one-to-one relationship, and for those functions it is safe to call JS_GetFunctionObject to move from the JSFunction to the JSObject. However, for other functions, and particularly for JavaScr...
An Overview of XPCOM
<< PreviousNext >> This is a book about XPCOM. The book is presented as a tutorial about creating XPCOM components, but it covers all major aspects,
concepts, and terminology of the XPCOM component model along the way. This chapter provides a quick tour of XPCOM - an introduction to the basic
concepts and technologies in XPCOM and component development. The brief sections in this chapter introduce the
concepts at a very high level, so that we can discuss and use them with more familiarity in the tutorial itself, which describes the creation of a Mozilla component called WebLock. The XPCOM Solution The Cross Platform Component Object Module (XPCOM) is a framework which allows developers to break up monolithic software projects into smaller modularized pieces. These pieces, known ...
Preface
Format Description bold component names appear in bold in the text monospace code listings, interface names and members of interfaces (e.g., createInstance()) appear in monospaced font. Lines of code are placed in separate boxes. Additionally, filenames and directories appear in monospaced font. italic variables appear in italic. Important terms and new
concepts are also italicized the first time they appear in the text. Those terms are either explained immediately after they are cited, or else the reader is referred to a section in the book where they are described in detail. link References to other sections and to figures and tables are links to those sections. Acknowledgements Thanks to Peter Lubczynski, John Gaunt, Ellen Evans, a...
XPCOM guide
including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like. Avoiding leaks in JavaScript XPCOM componentsProgrammers writing and reviewing JavaScript code in Mozilla should understand how code using XPCOM in JavaScript can leak so that they can avoid leaks. ...
Index
o the Folder Pane Add-ons, Draft, Extensions, Guide, NeedsContent, thunderbird This is a stub page for a tutorial for Thunderbird 3. 73 An overview of Thunderbird components thunderbird The Thunderbird mail application is a group of components built on a set of technologies that can seem daunting to new developers. However, in many cases you only need to learn a few
concepts to write an extension. 74 Building a Thunderbird extension 1: introduction Add-ons, Extensions, thunderbird Thunderbird is a community managed open-source email application. It shares many of the technologies used by Mozilla Firefox, including JavaScript, the Gecko layout engine, the XUL XML User Interface Language and the XPCOM Cross-Platform Component Object Model. Similar ...
Thunderbird extensions
Still stuck? Ask in a community communication channel on the right. Feeling really brave? Read the source using a fancy interface; you can often find tests that demonstrate what you're trying to achieve. The Gloda database Thunderbird has a subsystem called Gloda. Gloda stands for << Global Database >>, and creates Thunderbird-wide relations between objects. Gloda provides
concepts such as Conversations, Messages, Identities, Contacts. All these
concepts are related : a Conversation contains Messages which are linked to Identities (from field, to field) which are themselves part of a Contact: indeed, a contact has multiple identities. Typical use cases for Gloda: find all messages whose subject matches [search term], find all messages from [person], find all messages i...
Debugger-API - Firefox Developer Tools
se their own Debugger instances. Examples Here are some things you can try out yourself that show off some of Debugger's features: Setting a breakpoint in a page, running a handler function when it is hit that evaluates an expression in the page's context. Showing how many objects different call paths allocate. Gecko-specific features While the Debugger core API deals only with
concepts common to any JavaScript implementation, it also includes some Gecko-specific features: [Global tracking][global] supports debugging all the code running in a Gecko instance at once--the 'chrome debugging' model. [Object wrapper][wrapper] functions help manipulate object references that cross privilege boundaries. Source Metadata Generated from file: js/src/doc/Debugger/Debugger-API.m...
Dominators - Firefox Developer Tools
You can see the dominators in a page using the Dominators view in the Memory tool. With a garbage-collected language, like JavaScript, the programmer doesn't generally have to worry about deallocating memory. ...
Memory - Firefox Developer Tools
. the Aggregate view shows memory usage as a table of allocated types. 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. If you've opted to record allocation stacks for the snapshot, the Aggregate and Dominators views can show you exactly where in your code allocations are happening.
Concepts Dominators Example pages Examples used in the Memory tool documentation. Monster example DOM allocation example ...
Background Tasks API - Web APIs
The Cooperative Scheduling of Background Tasks API (also referred to as the Background Tasks API or simply the requestIdleCallback() API) provides the ability to queue tasks to be executed automatically by the user agent when it determines that there is free time to do so.
Concepts and usage The main thread of a Web browser is centered around its event loop. This code draws any pending updates to the Document currently being displayed, runs any JavaScript code the page needs to run, accepts events from input devices, and dispatches those events to the elements that should receive them. In addition, the event loop handles interactions with the operating system, updates to the browser's own user interface, and so forth. It's an extremely busy chunk of code, and your main JavaScript code...
BaseAudioContext.createBuffer() - Web APIs
u can then set to play via in an AudioBufferSourceNode. For simple uses like playing an MP3, decodeAudioData() is what you should be using. Syntax var buffer = baseAudioContext.createBuffer(numOfchannels, length, sampleRate); Parameters Note: For an in-depth explanation of how audio buffers work, and what these parameters mean, read Audio buffers: frames, samples and channels from our Basic
concepts guide. numOfChannels An integer representing the number of channels this buffer should have. The default value is 1, and all user agents must support at least 32 channels. length An integer representing the size of the buffer in sample-frames (where each sample-frame is the size of a sample in bytes multiplied by numOfChannels). To determine the length to use for a specific number of secon...
CSS Painting API - Web APIs
You can then apply these values to properties like background-image to set complex custom backgrounds on an element. ...
Channel Messaging API - Web APIs
g 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. Note: This feature is available in Web Workers. Channel messaging
concepts and usage A message channel is created using the MessageChannel() constructor. 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...
Console API - Web APIs
The Console API provides functionality to allow developers to perform debugging tasks, such as logging messages or the values of variables at set points in your code, or timing how long an operation takes to complete.
Concepts and usage The Console API started as a largely proprietary API, with different browsers implementing it, albeit it in inconsistent ways. The Console API spec was created to define consistent behavior, and all modern browsers eventually settled on implementing this behavior -- although some implementations still have their own additional proprietary functions. Find out about these at: Google Chrome DevTools implementation Safari DevTools implementation Usage is very simple -- the console object -- available via window.console, or WorkerGlobalScope.console in workers;...
Constraint validation API - Web APIs
However, you may want to impose more complex constraints, or to provide clearer reporting of validation failures than the defaults. This can be done using the Constraint Validation API. Note: Client-side constraint validation doesn't remove the need for validation on the server side. ...
Content Index API - Web APIs
Content indexing allows developers to tell the browser about their specific offline content. This allows users to discover and view what is available, whilst giving developers the ability to add and manage this content. Examples could be a news website prefetching the latest articles in the background, or a content streaming app registering downloaded content. ...
Credential Management API - Web APIs
The Credential Management API lets a website store and retrieve user, federated, and public key credentials. These capabilities allow users to sign in without typing passwords, see the federated account they used to sign in to a site, and resume a session without the explicit sign-in flow of an expired session. Credential management
concepts and usage This API lets websites interact with a user agent's password system so that websites can deal in a uniform way with site credentials and user agents can provide better assistance with the management of their credentials. For example, user agents have a particularly hard time dealing with federated identity providers or esoteric sign-in mechanisms that use more than just a username and password. To address these problems, the Credential Managemen...
DirectoryEntrySync - Web APIs
emoving files in a directory. This interface has been abandonned: it was on a standard track and it proves not a good idea. Do not use it anymore. About this document This document was last updated on March 2, 2012 and follows the W3C Specifications (Working Draft) drafted on April 19, 2011. This specification is pretty much abandoned, having failed to reach any substantial traction. Basic
concepts If you want to create subdirectories, you have to create each child directory in sequence. If you try to create a directory using a full path that includes parent directories that do not exist yet, you get an error. So create the hierarchy by recursively adding a new path after creating the parent directory. Example The getFile() method returns a FileEntrySync, which represents a file in the f...
DirectoryReaderSync - Web APIs
d the entries in a directory. This interface has been abandonned: it was on a standard track and it proves not a good idea. Do not use it anymore. About this document This document was last updated on March 2, 2012 and follows the W3C Specifications (Working Draft) drafted on April 19, 2011. This specification is pretty much abandoned, having failed to reach any substantial traction. Basic
concepts Before you call the only method in this interface, readEntries(), create the DirectoryEntrySync object. But DirectoryEntrySync (as well as FileEntrySync) is not a data type that you can pass between a calling app and Web Worker thread. It's not a big deal, because you don't really need to have the main app and the worker thread see the same JavaScript object; you just need them to access the sam...
Using the W3C DOM Level 1 Core - Web APIs
ewElement = document.createElement("P"); // put the text in the paragraph newElement.appendChild(newText); // and put the paragraph on the end of the document by appending it to // the BODY (which is the parent of para) para.parentNode.appendChild(newElement); } You can see this script as a complete example. How can I learn more? Now that you are familiar with the basic
concepts of the DOM, you may want to learn about the DOM Level 1 fundamental methods. See also the DOM Level 1 Core specification from the W3C. It's a reasonably clear spec, although it is formal. The main thing that's useful to authors is the description of the different DOM objects and all their properties and methods. Also see our other DOM documentation. Original Document Information Author(s): ...
Using Fetch - Web APIs
and responses. It also provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network. This kind of functionality was previously achieved using XMLHttpRequest. 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. The fetch specification differs from jQuery.ajax() in three main ways: The Promise returned from fetch() won't reject on HTTP error status even if the response is an HTTP 404 or 500. Instead, it will resolve normally (with ok status set to false), and it will only reject on network failure or if anything prevented the request from completing. fetch() won'...
FileEntrySync - Web APIs
rySync interface of the File System API represents a file in a file system. It lets you write content to a file. Inherits from: EntrySync About this document This document was last updated on March 2, 2012 and follows the W3C Specifications (Working Draft) drafted on April 19, 2011. This specification is more or less abandoned as it didn't get significant traction among browser makers. Basic
concepts To write content to file, create a FileWriter object by calling createWriter(). Method overview FileWriterSync createWriter () raises (FileException); File file () raises (FileException); Methods createWriter() Creates a new FileWriter associated with the file that the FileEntry represents. void createWriter ( ) raises (FileException); Parameter None. Returns ...
FileException - Web APIs
The added complexity of using WebWorkers with this API makes debugging even more challenging. To simplify things a bit, wrap your worker code in a try/catch. ...
FileSystem - Web APIs
r additional APIs to create and manage file systems, such as Chrome's requestFileSystem() method. This interface will not grant you access to the users filesystem. Instead you will have a "virtual drive" within the browser sandbox. If you want to gain access to the users filesystem you need to invoke the user by eg. installing a Chrome extension. The relevant Chrome API can be found here. Basic
concepts There are two ways to get access to a FileSystem object: You can directly ask for one representing a sandboxed file system created just for your web app directly by calling window.requestFileSystem(). If that call is successful, it executes a callback handler, which receives as a parameter a FileSystem object describing the file system. You can get it from a file system entry object, throug...
FileSystemEntry - Web APIs
-as well as information about a file it points to--including the file name and its path from the root to the entry. Because this is a non-standard API, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it. Check the Browser compatibility section for details. Basic
concepts You don't create FileSystemEntry objects directly. Instead, you will receive an object based on this interface through other APIs. This interface serves as a base class for the FileSystemFileEntry and FileSystemDirectoryEntry interfaces, which provide features specific to file system entries representing files and directories, respectively. The FileSystemEntry interface includes methods that yo...
FileSystemFileEntry - Web APIs
ject that can be used to read the file. Properties Inherits the properties of its parent interface, FileSystemEntry, but has no properties unique to this interface. Methods file() Creates a new File object which can be used to read the file. Obsolete methods createWriter() Creates a new FileWriter object which allows writing to the file represented by the file system entry. Basic
concepts To write content to file, create a FileWriter object by calling createWriter(). To read a file, obtain a File object representing its contents by calling file(). Example The following code creates an empty file called "log.txt" (if it doesn't exist) and fills it with the text "Meow". Inside the success callback, event handlers are set up to handle the error error and writeend events. The text ...
FileSystemSync - Web APIs
In the File System API, a FileSystemSync object represents a file system. It has two properties. About this document This document was last updated on March 2, 2012 and follows the W3C Specifications (Working Draft) drafted on April 19, 2011. The specification is abandonned for the moment, failing to get significant traction. Basic
concepts The FileSystemSync object is your gateway to the entire API and you will use it a lot. So once you have a reference, cache the object in a global variable or class property. Attributes Attribute Type Description name readonly DOMString Name of the file system. The name must be unique across the list of exposed file systems. root readonly DirectoryEntry The root directory of the file system. ...
Geolocation API - Web APIs
olocation API allows the user to provide their location to web applications if they so desire. For privacy reasons, the user is asked for permission to report location information. WebExtensions that wish to use the Geolocation object must add the "geolocation" permission to their manifest. The user's operating system will prompt the user to allow location access the first time it is requested.
Concepts and usage You will often want to retrieve a user's location information in your web app, for example to plot their location on a map, or display personalized information relevant to their location. The Geolocation API is accessed via a call to navigator.geolocation; this will cause the user's browser to ask them for permission to access their location data. If they accept, then the browser will...
History API - Web APIs
The DOM Window object provides access to the browser's session history (not to be confused for WebExtensions history) through the history object. It exposes useful methods and properties that let you navigate back and forth through the user's history, and manipulate the contents of the history stack.
Concepts and usage Moving backward and forward through the user's history is done using the back(), forward(), and go() methods. Moving forward and backward To move backward through history: window.history.back() This acts exactly as if the user clicked on the Back button in their browser toolbar. Similarly, you can move forward (as if the user clicked the Forward button), like this: window.history.forward() Moving to a specific point in history You can use the go() method to load a speci...
InputDeviceCapabilities API - Web APIs
The InputDeviceCapabilities API provides details about the underlying sources of input events. The API attempts to describe how the device behaves rather than what it is. For example, the first version of the API indicates whether a device fires touch events rather than whether it is a touch screen. Input device capabilities
concepts and usage Because DOM events abstract device input, they provide no way to learn what device or type of device fired an event. This can lead to instances where the same action triggers multiple event handlers. To deal with this, developers make assumptions and use heuristics to normalize behavior on web pages. The InputDeviceCapabilities API addresses this problem by abstracting the capabilities of input devices. For example, let's say we have a web page that ...
Keyboard API - Web APIs
ng the string generated by particular physical key on a keyboard to correctly identify that key to a user. Keyboard locking enables a web page to capture keys that are normally reserved by the user agent or the underlying operating system. The intended use of the Keyboard API is by web applications such as games or remote access apps that provide a full-screen immersive experience. Keyboard API
concepts and usage Keyboard mapping On physical keyboards, the code attribute contains the physical location of the key that was pressed, and the key attribute contains the string generated by pressing the key at that physical location on the keyboard. The key value takes into account the keyboard's locale (for example, 'en-US'), layout (for example, 'QWERTY'), and modifier-key state (Shift, Control, et...
Long Tasks API - Web APIs
gives us visibility into tasks that take 50 milliseconds or more. The 50 ms threshold comes from the RAIL Model, in particular the "Response: process events in under 50 ms" section. Tasks that block the main thread for 50 ms or more cause, among other issues: Delayed "Time to interactive". High/variable input latency. High/variable event handling latency. Janky animations and scrolling.
Concepts Some key terms or ideas that are utilized by the Long Tasks API. Long task Any uninterrupted period where the main UI thread is busy for 50 ms or longer. Common examples include: Long running event handlers. Expensive reflows and other re-renders. Work the browser does between different turns of the event loop that exceeds 50 ms. Culprit browsing context container The "culprit b...
MediaStream Image Capture API - Web APIs
capturing images or videos from a photographic device. In addition to capturing data, it also allows you to retrieve information about device capabilities such as image size, red-eye reduction and whether or not there is a flash and what they are currently set to. Conversely, the API allows the capabilities to be configured within the constraints what the device allows. MediaStream image capture
concepts and usage The process of retrieving an image or video stream happens as described below. The example code is adapted from Chrome's Image Capture examples. First, get a reference to a device by calling MediaDevices.getUserMedia(). The example below simply says give me whatever video device is available, though the getUserMedia() method allows more specific capabilities to be requested. This meth...
MediaStream Recording API - Web APIs
tream Recording API, sometimes simply referred to as the Media Recording API or the MediaRecorder API, is closely affiliated with the Media Capture and Streams API and the WebRTC API. The MediaStream Recording API makes it possible to capture the data generated by a MediaStream or HTMLMediaElement object for analysis, processing, or saving to disk. It's also surprisingly easy to work with. Basic
concepts The MediaStream Recording API is comprised of a single major interface, MediaRecorder, which does all the work of taking the data from a MediaStream and delivering it to you for processing. The data is delivered by a series of dataavailable events, already in the format you specify when creating the MediaRecorder. You can then process the data further or write it to file as desired. Overview of...
Media Capabilities API - Web APIs
Different browsers support different media types and new media types are always being developed. With the Media Capabilities API, developers can ensure each user is getting the best bitrate and storage savings for their browser, device, and OS capabilities. Whether a device uses hardware or software decoding impacts how smooth and power ef...
Media Session API - Web APIs
ovides a way to customize media notifications. It does this by providing metadata for display by the user agent of the media your web app is playing, and allows you to create event handlers, to define your own behaviors for a user-agent playback controls. The aim of this is allowing users to know what's playing, and to control it, without opening the specific page that launched it. Media Session
concepts and usage The MediaMetadata interface lets a web site provide rich metadata to the platform UI for media that is playing. This metadata includes the title, artist (creator) name, album (collection), and artwork. The platform can show this metadata in media centers, notifications, device lockscreens, etc. The MediaSession interface lets users control playback of media through user-agent defined ...
Capabilities, constraints, and settings - Web APIs
ent (or browser) you're running on, which version it is, looking to see if certain objects exist, trying to see whether various things work or not and determining what errors occur, and so forth. The result has been a lot of very fragile code, or a reliance on libraries which figure this stuff out for you, then implement polyfills to patch the holes in the implementation on your behalf. The twin
concepts of constraints and capabilities let the browser and Web site or app exchange information about what constrainable properties the browser's implementation supports and what values it supports for each one. This article discusses capabilities and constraints, as well as media settings, and includes an example we call the Constraint Exerciser. The Constraint Exerciser lets you experiment with the re...
MerchantValidationEvent.methodName - Web APIs
ent property methodName is a read-only value which returns a string indicating the payment method identifier which represents the payment handler that requires merchant validation. Syntax methodID = merchantValidationEvent.methodName; Value A read-only DOMString which uniquely identifies the payment handler which is requesting merchant validation. See Merchant validation in Payment processing
concepts for more information on the process. Specifications Specification Status Comment Payment Request APIThe definition of 'MerchantValidationEvent.methodName' in that specification. Candidate Recommendation Initial definition. ...
MerchantValidationEvent.validationURL - Web APIs
the user agent complete the transaction. Syntax validationURL = merchantValidationEvent.validationURL; Value A read-only USVString giving the URL from which to load payment handler specific data needed to complete the merchant verification process. Once this has been loaded, it should be passed into complete(), either directly or using a promise. See Merchant validation in Payment processing
concepts for more information on the merchant validation process. Specifications Specification Status Comment Payment Request APIThe definition of 'MerchantValidationEvent.validationURL' in that specification. Candidate Recommendation Initial definition. ...
MerchantValidationEvent - Web APIs
Constructor MerchantValidationEvent() Secure context Creates a new MerchantValidationEvent object describing a merchantvalidation event that will be sent to the payment handler to request that it validate the merchant. ...
Navigation Timing API - Web APIs
The Navigation Timing API provides data that can be used to measure the performance of a web site. Unlike JavaScript-based libraries that have historically been used to collect similar information, the Navigation Timing API can be much more accurate and reliable. This article currently describes Navigation Timing Level 1. There is a specification for Level 2, but it is not yet covered here.
Concepts and usage You can use the Navigation Timing API to gather performance data on the client side, which you can then transmit to a server using XMLHttpRequest or other techniques. This API lets you measure data that was previously difficult to obtain, such as the amount of time needed to unload the previous page, how long domain lookups take, the total time spent executing the window's load handler...
Notifications API - Web APIs
feature is available in Web Workers. The Notifications API allows web pages to control the display of system notifications to the end user. These are outside the top-level browsing context viewport, so therefore can be displayed even when the user has switched tabs or moved to a different app. The API is designed to be compatible with existing notification systems, across different platforms.
Concepts and usage On supported platforms, showing a system notification generally involves two things. First, the user needs to grant the current origin permission to display system notifications, which is generally done when the app or site initialises, using the Notification.requestPermission() method. This should be done in response to a user gesture, such as clicking a button, for example: btn.addE...
OfflineAudioContext.OfflineAudioContext() - Web APIs
as you can create a new AudioContext using the new AudioContext() constructor with no arguments, the OfflineAudioContext() constructor requires three arguments, since it needs to create an AudioBuffer. This works in exactly the same way as when you create a new AudioBuffer with the AudioContext.createBuffer() method. For more detail, read Audio buffers: frames, samples and channels from our Basic
concepts guide. Return value A new OfflineAudioContext object whose associated AudioBuffer is configured as requested. Like a regular AudioContext, an OfflineAudioContext can be the target of events, therefore it implements the EventTarget interface. Example const offlineCtx = new OfflineAudioContext({ numberOfChannels: 2, length: 44100 * 40, sampleRate: 44100, }); const source = offlineCtx.cre...
PaymentResponse.methodName - Web APIs
standardized payment method identifiers or a URL used by the payment handler to process payments. Syntax var methodName = PaymentResponse.methodName; Value A DOMString uniquely identifying the payment handler being used to process the payment. This may be either a standardized identifier, or a URL used by the payment processor to handle payments. See Merchant validation in Payment processing
concepts for more information. Example The following example extracts the method name from the PaymentResponse object to the promise returned from PaymentRequest.show(). In a real-world implementation this data would then be sent to a payment server. payment.show().then(paymentResponse => { var paymentData = { // payment method string method: paymentResponse.methodName, // payment details...
Payment Request API - Web APIs
The Payment Request API provides a consistent user experience for both merchants and users. It is not a new way for paying for things; rather, it's a way for users to select their preferred way of paying for things, and make that information available to a merchant. Payment Request
concepts and usage Many problems related to online shopping-cart abandonment can be traced to checkout forms, which can be difficult and time consuming to fill out and often require multiple steps to complete. The Payment Request API is meant to reduce the number of steps needed to complete a payment online, potentially doing away with checkout forms. It aims to make the checkout process easier, by remembering a user's details, which are then passed along to a merchant hopefully without requiring a HTML for...
Permissions API - Web APIs
The Permissions API provides a consistent programmatic way to query the status of API permissions attributed to the current context. For example, the Permissions API can be used to determine if permission to access a particular API has been granted or denied.
Concepts and usage Historically different APIs handle their own permissions inconsistently -- for example the Notifications API allows for explicit checking of permission status and requesting permission, whereas the Geolocation API doesn't (which causes problems if the user denied the initial permission request). The Permissions API provides the tools to allow developers to implement a better user experience as far as permissions are concerned. The permissions property has been made available on the Navigator object, both in the standa...
Pointer Lock API - Web APIs
late a 3D model by moving the mouse without end. Without Pointer lock, the rotation or manipulation stops the moment the pointer reaches the edge of the browser or screen. 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. Basic
concepts Pointer lock is related to mouse capture. Mouse capture provides continued delivery of events to a target element while a mouse is being dragged, but it stops when the mouse button is released. Pointer lock is different from mouse capture in the following ways: It is persistent: Pointer lock does not release the mouse until an explicit API call is made or the user uses a specific release gest...
Push API - Web APIs
The Push API gives web applications the ability to receive messages pushed to them from a server, whether or not the web app is in the foreground, or even currently loaded, on a user agent. This lets developers deliver asynchronous notifications and updates to users that opt in, resulting in better engagement with timely new content. Push
concepts and usage When implementing PushManager subscriptions, it is vitally important that you protect against CSRF/XSRF issues in your app. See the following articles for more information: Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet Preventing CSRF and XSRF Attacks For an app to receive push messages, it has to have an active service worker. When the service worker is active, it can subscribe to push notifications, using PushM...
Resize Observer API - Web APIs
The Resize Observer API provides a performant mechanism by which code can monitor an element for changes to its size, with notifications being delivered to the observer each time the size changes.
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. For example, media queries / window.matchMedia are great for updating layouts at specific points when the viewport changes sizes, but what if you want to change layout in response to a specific element's size changing, which isn't the outer container? To achieve this, a limited solution would be to listen to changes to a suitable event that hints at the element you are inte...
Screen Capture API - Web APIs
The Screen Capture API introduces additions to the existing Media Capture and Streams API to let the user select a screen or portion of a screen (such as a window) to capture as a media stream. This stream can then be recorded or shared with others over the network. Screen Capture API
concepts and usage The Screen Capture API is relatively simple to use. Its sole method is MediaDevices.getDisplayMedia(), whose job is to ask the user to select a screen or portion of a screen to capture in the form of a MediaStream. To start capturing video from the screen, you call getDisplayMedia() on the instance of Media navigator.mediaDevices: captureStream = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions); The Promise returned by getDisplayMedia() resolves to a MediaStream which streams...
Screen Wake Lock API - Web APIs
Modern devices do this to save on battery power. Whilst this is a useful feature, some applications need the screen to stay awake to be their most useful. The Screen Wake Lock API prevents the screen from turning off, dimming or locking. It allows for a simple platform based solution which up until now could only be achieved via workarounds which were potentially power hungry. ...
Selection API - Web APIs
The Selection API provides functionality for reading and manipulating the range of text selected by the user.
Concepts and usage To retrieve the current text range the user has selected, you can use the Window.getSelection() or Document.getSelection() method, storing the return value -- a Selection object -- in a variable for futher use. Once your selection is in a variable, you perform a variety of operations on it, for example copying the selection to a text string using Selection.toString(), adding a range (as represented by a standard Range object) to the selection (or removing one) with Selection.addRange()/Selection.removeRange(), or changing the selection to be the entire contents of a DOM node using Selection.selectAllChildren(). You can run code in response to the selection being c...
Sensor APIs - Web APIs
Instead you'll use one of its subclasses to retrieve specific kinds of sensor data. For example, the accelerometer interface returns the acceleration of the device along all three axes at the time it is read. Sensors may or may not correspond exactly to a physical device sensor. For example, the Gyroscope interface corresponds exactly to a physical device interface. ...
Server-sent events - Web APIs
Traditionally, a web page has to send a request to the server to receive new data; that is, the page requests data from the server. With server-sent events, it's possible for a server to send new data to a web page at any time, by pushing messages to the web page. These incoming messages can be treated as Events + data inside the web page.
Concepts and usage To learn how to use server-sent events, see our article Using server-sent events. Interfaces EventSource Defines all the features that handle connecting to a server, receiving events/data, errors, closing a connection, etc. Examples Simple SSE demo using PHP Specification Specification Status Comment HTML Living StandardThe definition of 'Server-sent events' in that specification. Living Standard ...
Service Worker API - Web APIs
etween web applications, the browser, and the network (when available). They are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. They will also allow access to push notifications and background sync APIs. Service worker
concepts and usage A service worker is an event-driven worker registered against an origin and a path. It takes the form of a JavaScript file that can control the web-page/site that it is associated with, intercepting and modifying navigation and resource requests, and caching resources in a very granular fashion to give you complete control over how your app behaves in certain situations (the most obvio...
Storage Access API - Web APIs
for embedded, cross-origin content to gain unrestricted access to storage that it would normally only have access to in a first-party context (we refer to this as an origin's first-party storage). The API provides methods that allow embedded resources to check whether they currently have access to their first-party storage, and to request access to their first-party storage from the user agent.
Concepts and usage Most browsers implement a number of storage access policies that restrict access to cookies and site data for embedded, cross-origin resources. These restrictions range from giving embedded resources under each top-level origin a unique storage space to outright blocking of storage access when resources are loaded in a third-party context. The semantics around third-party cookie block...
Using readable streams - Web APIs
As a JavaScript developer, programmatically reading and manipulating streams of data received over the network, chunk by chunk, is very useful! But how do you use the Streams API's readable stream functionality? This article explains the basics. Note: This article assumes that you understand the use cases of readable streams, and are aware of the high-level
concepts. If not, we suggest that you first read the Streams
concepts and usage overview and dedicated Streams API
concepts article, then come back. Note: If you are looking for information on writable streams try Using writable streams instead. Browser support You can consume Fetch Body objects as streams and create your own custom readable streams in Firefox 65+ and Chrome 42+ (and equivalent Chromium-based browsers). Pipe chains are...
URL API - Web APIs
The URL API is a component of the URL standard, which defines what constitutes a valid Uniform Resource Locator and the API that accesses and manipulates URLs. The URL standard also defines
concepts such as domains, hosts, and IP addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded MIME type used to submit web forms' contents as a set of key/value pairs. URL
concepts and usage The majority of the URL standard is taken up by the definition of a URL and how it is structured and parsed. Also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing IP addresses and DOM addresses are specified. More interesting to most developers is the API itself. Accessing URL components Creating an...
Visual Viewport API - Web APIs
The Visual Viewport API provides an explicit mechanism for querying and modifying the properties of the window's visual viewport. 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. Visual Viewport
concepts and usage The mobile web contains two viewports, the layout viewport and the visual viewport. The layout viewport covers all the elements on a page and the visual viewport is what is actually visible on the screen. When the user pinch-zooms into the page, the visual viewport shrinks but the layout viewport is unchanged. User-interface features like the on-screen keyboard (OSK) can shrink the visual viewport without affecting the layout viewp...
Adding 2D content to a WebGL context - Web APIs
iformLocation(shaderProgram, 'uProjectionMatrix'), modelViewMatrix: gl.getUniformLocation(shaderProgram, 'uModelViewMatrix'), }, }; Creating the square plane Before we can render our square plane, we need to create the buffer that contains its vertex positions and put the vertex positions in it. We'll do that using a function we call initBuffers(); as we explore more advanced WebGL
concepts, this routine will be augmented to create more -- and more complex -- 3D objects. function initBuffers(gl) { // Create a buffer for the square's positions. const positionBuffer = gl.createBuffer(); // Select the positionBuffer as the one to apply buffer // operations to from here out. gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer); // Now create an array of positions for the squ...
Getting started with WebGL - Web APIs
s executed on a computer's Graphics Processing Unit (GPU). WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background. This article will introduce you to the basics of using WebGL. It's assumed that you already have an understanding of the mathematics involved in 3D graphics, and this article doesn't pretend to try to teach you 3D graphics
concepts itself. The code examples in this tutorial can also be found in the webgl-examples GitHub repository. It's worth noting here that this series of articles introduces WebGL itself; however, there are a number of frameworks available that encapsulate WebGL's capabilities, making it easier to build 3D applications and games, such as THREE.js and BABYLON.js. Preparing to render in 3D The first thi...
WebGL model view projection - Web APIs
ewer in the 3D virtual world. The view matrix is responsible for moving the objects in the scene to simulate the position of the camera being changed, altering what the viewer is currently able to see. The sections below offer an in-depth look into the ideas behind and implementation of the model, view, and projection matrices. These matrices are core to moving data around on the screen, and are
concepts that transcend individual frameworks and engines. Clip space In a WebGL program, data is typically uploaded to the GPU with its own coordinate system and then the vertex shader transforms those points into a special coordinate system known as clip space. Any data which extends outside of the clip space is clipped off and not rendered. However, if a triangle straddles the border of this space th...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
y needed to be for typical use cases. This was due to a small number of issues with the API and some potential race conditions that needed to be prevented. These issues have since been addressed, letting us simplify our WebRTC negotiation significantly. The perfect negotiation pattern is an example of the ways in which negotiation have improved since the early days of WebRTC. Perfect negotiation
concepts Perfect negotiation makes it possible to seamlessly and completely separate the negotiation process from the rest of your application's logic. Negotiation is an inherently 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 lo...
WebRTC API - Web APIs
to smooth over the differences among the WebRTC implementations across the environments supporting it. Adapter.js also handles prefixes and other naming differences to make the entire WebRTC development process easier, with more broadly compatible results. The library is also available as an NPM package. To learn more about Adapter.js, see Improving compatibility using WebRTC adapter.js. WebRTC
concepts and usage WebRTC serves multiple purposes; together with the Media Capture and Streams API, they provide powerful multimedia capabilities to the Web, including support for audio and video conferencing, file exchange, screen sharing, identity management, and interfacing with legacy telephone systems including support for sending DTMF (touch-tone dialing) signals. Connections between peers can be ...
Fundamentals of WebXR - Web APIs
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. In WebXR, the primary select and squeeze actions are directly supported using events, while other controls are available through a special WebXR-specific implementation of the Gamepad object. Basic
concepts Before getting into too much detail, let's consider some basic
concepts that you need to know before you learn how to develop XR code. Field of view The term field of view (FOV) is one which applies to any visual technology, from old film cameras to modern digital video cameras, including the cameras in computers and mobile devices. What is field of view? The field of view is, at its essence...
Geometry and reference spaces in WebXR - Web APIs
At a fundamental level, rendering of scenes for WebXR presentation in either augmented reality or virtual reality contexts is performed using WebGL, so the two APIs share much of the same design language. However, in order to provide the ability to present scenes in true 3D using XR headsets and other such equipment, WebXR has additional
concepts that must be understood. In this article, we introduce the ways in which WebXR expands upon the geometry of WebGL, and how the positions and orientations of objects--both physical and virtual--are described in relation to one another using spaces and, in particular, reference spaces. 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 potenti...
Lighting a WebXR setting - Web APIs
However, there are issues and details to keep in mind while creating your lighting code, especially for augmented reality (AR) applications. This guide discusses these topics. ...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
imilarly to represent other parts of the body, providing additional data to use when simulating the user's actions in their environment. In this guide, we'll explore how WebXR uses spaces and, more specifically, reference spaces, to track the positions, orientations, and movements of objects and of the user's body in the virtual world. Note: This article presumes that you are familiar with the
concepts introduced in Geometry and reference spaces in WebXR: that is, the basics of 3D coordinate systems, as well as WebXR spaces, reference spaces, and how reference spaces are used to create local coordinate systems for individual objects or movable components within a scene. Representing a position using a reference space As covered in Defining spatial relationships with reference spaces in Geome...
Using the Web Audio API - Web APIs
The Web Audio API does not replace the <audio> media element, but rather complements it, just like <canvas> coexists alongside the <img> element. Your use case will determine what tools you use to implement audio. If you simply want to control playback of an audio track, the <audio> media element provides a better, quicker solution than the Web Audio API. ...
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. This article explains how, and provides a couple of basic use cases. Note: You can find working examples of all the code snippets in our Voice-change-O-matic demo. ...
Web Authentication API - Web APIs
The Web Authentication API is an extension of the Credential Management API that enables strong authentication with public key cryptography, enabling passwordless authentication and/or secure second-factor authentication without SMS texts. Web authentication
concepts and usage The Web Authentication API (also referred to as WebAuthn) uses asymmetric (public-key) cryptography instead of passwords or SMS texts for registering, authenticating, and second-factor authentication with websites. This resolves significant security problems related to phishing, data breaches, and attacks against SMS texts or other second-factor authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords). Many...
Web Budget API - Web APIs
It is available in both document and worker environments. BudgetState Provides the amount of the user agent's processing budget at a specific point in time. Specifications Specification Status Comment Web Budget API Draft Initial definition. ...
Web Locks API - Web APIs
The Web Locks API allows scripts running in one tab or worker to asynchronously acquire a lock, hold it while work is performed, then release it. 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. Web Locks
Concepts and Usage A lock is an abstract concept representing some potentially shared resource, identified by a name chosen by the web app. For example, if a web app running in multiple tabs wants to ensure that only one tab is syncing data between the network and Indexed DB, each tab could try to acquire a "my_net_db_sync" lock, but only one tab will succeed (the leader election pattern.) The API is used as follows: The lock is requested. Wo...
Web Speech API - Web APIs
There are two components to this API: Speech recognition is accessed via the SpeechRecognition interface, which provides the ability to recognize voice context from an audio input (normally via the device's default speech recognition service) and respond appropriately. ...
Using the Web Storage API - Web APIs
The keys and the values are always strings (note that, as with objects, integer keys will be automatically converted to strings). You can access these values like an object, or with the Storage.getItem() and Storage.setItem() methods. ...
Using Web Workers - Web APIs
In this section we'll discuss the JavaScript found in our Basic dedicated worker example (run dedicated worker): This allows you to enter two numbers to be multiplied together. The numbers are sent to a dedicated worker, multiplied together, and the result is returned to the page and displayed. This example is rather trivial, but we decided to keep it simple while introducing you to basic worker
concepts. More advanced details are covered later on in the article. Worker feature detection For slightly more controlled error handling and backwards compatibility, it is a good idea to wrap your worker accessing code in the following (main.js): if (window.Worker) { ... } Spawning a dedicated worker Creating a new worker is simple. All you need to do is call the Worker() constructor, specifying...
Web Workers API - Web APIs
Web Workers makes it possible to run a script operation in a background thread separate from the main execution thread of a web application. The advantage of this is that laborious processing can be performed in a separate thread, allowing the main (usually the UI) thread to run without being blocked/slowed down. Web Workers
concepts and usage A worker is an object created using a constructor (e.g. Worker()) that runs a named JavaScript file -- this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. This context is represented by either a DedicatedWorkerGlobalScope object (in the case of dedicated workers - workers that are utilized by a single script), or a SharedWorkerGlobalScope (in the case of shared wo...
Cognitive accessibility - Accessibility
e. Providing more than one way to navigate your site can help people find information faster. Some users may prefer a table of contents, site map, or search functionality rather than reading and traversing through several pages to find what they need. Others may prefer to explore the site in a sequential manner, moving from page to page in order to best understand the site's layout, content, and
concepts. Ability to bypass blocks of content Providing a mechanism, such as a skiplink, to bypass blocks of content that are repeated on multiple web pages. Focus order makes sense The order of focus for interactive elements should make sense. To achieve this, the DOM order should match the visual order, which in turn should match the tabbing order. If the tab order jumps around, especi...
Accessibility documentation index - Accessibility
and other physical reactions in people with vestibular disorders. 105 Web accessibility for seizures and physical reactions Media Queries, PEAT, Photosensitve Epilepsy Analysis Tool, The Harding Test, color, epilepsy, musicogenic seizures, photosensitivity, prefers-reduced-motion, reflex epilepsy, saturation, seizure disorders, seizures, web animation 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 accessibility for seizures and physical reactions - Accessibility
Overview Seizures Seizures caused by light are known as photosensitive epilepsy. Content that flickers, flashes, or blinks can trigger photosensitive epilepsy. 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. Certain visual patterns, especially stripes, can also cause physical reactions even though they are not animated. ...
Alternative style sheets - CSS: Cascading Style Sheets
dThe definition of 'the "title" attribute for the style element' in that specification. Living Standard HTML Living StandardThe definition of 'meta http-equiv="default-style")' in that specification. Living Standard CSS Object Model (CSSOM)The definition of 'CSS Style Sheet Collections' in that specification. Working Draft The CSS OM specification defines the
concepts of the style sheet set name, its disabled flag, and the preferred CSS style sheet set name. It defines how these are determined, and lets the HTML specification define the HTML-specific behaviors by requiring it to define when to create a CSS style sheet. HTML 4.01 SpecificationThe definition of 'Alternative style sheets' in that specification. Recommendation Earlier, the HTML ...
CSS Multi-column Layout - CSS: Cascading Style Sheets
n specification are required in order to control how content breaks between columns. Reference Multiple-column Layout Properties column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns Related CSS Fragmentation Properties break-after break-before break-inside orphans widows Guides Basic
Concepts of Multicol An overview of the Multiple-column Layout specification Styling Columns How to use column rules and manage the spacing between columns. Spanning and Balancing How to make elements span across all columns and controlling the way columns are filled. Handling Overflow in Multicol What happens when an item overflows the column it is in and what happens when there is too much column...
CSS Containment - CSS: Cascading Style Sheets
erflow. This information is something that is usually known, and in fact quite obvious, to the web developer creating the page. However browsers cannot guess at your intent and cannot assume that an article will be entirely self-contained. Therefore this property gives you a nice way to explain to the browser this fact, and allow it to make performance optimizations based on that knowledge. Key
concepts and terminology This specification defines only one property, the contain property. The values for this property indicate the type of containment that you want to apply to that element. Layout containment article { contain: layout; } Layout is normally scoped to the entire document, which means that if you move one element the entire document needs to be treated as if things could have move...
CSS Display - CSS: Cascading Style Sheets
CSS properties display CSS data types <display-outside> <display-inside> <display-listitem> <display-box> <display-internal> <display-legacy> Guides CSS Flow Layout (display: block, display: inline) Block and Inline Layout in Normal Flow Flow Layout and Overflow Flow Layout and Writing Modes Formatting Contexts Explained In Flow and Out of Flow display: flex Basic
concepts of flexbox Aligning Items in a Flex Container Controlling Ratios of Flex Items Along the Main Axis Cross-browser Flexbox mixins Mastering Wrapping of Flex Items Ordering Flex Items Relationship of flexbox to other layout methods Backwards Compatibility of Flexbox Typical use cases of Flexbox display: grid Basic
Concepts of Grid Layout Relationship to other layout methods Line-based...
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
item get? flex-shrink: How much negative free space can be removed from this item? flex-basis: What is the size of the item before growing and shrinking happens? The properties are usually expressed as the shorthand flex property. The following code would set the flex-grow property to 2, flex-shrink to 1 and flex-basis to auto. .item { flex: 2 1 auto; } If you have read the article Basic
Concepts of Flexbox, then you will have already had an introduction to the properties. Here we will explore them in depth in order that you can fully understand what the browser is doing when you use them. Important
concepts when working on the main axis There are a few
concepts worth digging into before looking at how the flex properties work to control ratios along the main axis. These relate to the n...
CSS Flexible Box Layout - CSS: Cascading Style Sheets
n Box Alignment. The Flexbox spec now refers to the Box Alignment specification for up to date definitions. Also additional alignment properties are now defined in Box Alignment. 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. Ordering flex items Explaining the different ways to change the order and direction of items, and covering the potential issues in do...
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
In this article we will fully explore how this fundamental feature of the specification works. Starting your exploration of grid with numbered lines is the most logical place to begin, as when you use grid layout you always have numbered lines. The lines are numbered for columns and rows, and are indexed from 1. Note that grid is indexed according to the writing mode of the document. In a left to right language such as English line 1 is on the left-hand side of the grid. If you are working in a right-to-left language then line 1 will be the far right of the grid. ...
CSS Grid Layout - CSS: Cascading Style Sheets
auto-columns grid-auto-rows grid-auto-flow grid grid-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 Exter...
CSS Scroll Snap - CSS: Cascading Style Sheets
nline-end scroll-padding-block scroll-padding-block-start scroll-padding-block-end CSS Properties on Children scroll-snap-align scroll-margin scroll-margin-top scroll-margin-right scroll-margin-bottom scroll-margin-left scroll-margin-inline scroll-margin-inline-start scroll-margin-inline-end scroll-margin-block scroll-margin-block-start scroll-margin-block-end Guides Basic
concepts of CSS Scroll Snap Browser Compatibility and Scroll Snap Specification Specification Status Comment CSS Scroll Snap Module Level 1 Candidate Recommendation Initial definition ...
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. In a vertical writing mode they would be laid out vertically starting at the top. In the example below, the two (<div>) elements with the black borders form a block formatting context, inside which each word participates in an inline formatting context. The boxes in the horizontal writing mode run horizontally, and the vertical writing mode boxes run vertically. ...
Shorthand properties - CSS: Cascading Style Sheets
the link? Do you understand why the third and fourth links are the color that they are? Check the description of the values above if not. Which of the links will change color if you define a new color for the <a> element -- for example a { color: red; }? See Cascade and inheritance or Introducing the CSS Cascade for more information about how inheritance works in CSS. See also CSS Key
Concepts: CSS syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed, resolved, specified, used, and actual values. Definitions of value syntax, shorthand properties and replaced elements. Shorthand properties: animation, background, border, border-bottom, border-color, border-left, bord...
Visual formatting model - CSS: Cascading Style Sheets
odel is defined in CSS2, however, various level 3 specifications have added to this information. When reading specifications you will often find references to the model as defined in CSS2, so an understanding of the model and the terms used to describe it in CSS2 is valuable when reading other layout specifications. In this document we define the model and introduce some of the related terms and
concepts, linking to more specific pages on MDN for further details. The role of the viewport In continuous media, the viewport is the viewing area of the browser window. User agents can change the layout of the page when the viewport size changes -- for example, if you resize your window, or change the orientation of a mobile device. If the viewport is smaller than the size of the document then the us...
<display-box> - CSS: Cascading Style Sheets
keywords define whether an element generates display boxes at all. Syntax Valid <display-box> values: contents These elements don't produce a specific box by themselves. They are replaced by their pseudo-box and their child boxes. Please note that the CSS Display Level 3 spec defines how the contents value should affect "unusual elements" -- elements that aren't rendered purely by CSS box
concepts such as replaced elements. See Appendix B: Effects of display: contents on Unusual Elements for more details. Due to a bug in browsers this will currently remove the element from the accessibility tree -- screen readers will not look at what's inside. See the Accessibility concerns section below for more details. none Turns off the display of an element so that it has no effect on layout (th...
Inheritance - CSS: Cascading Style Sheets
ont-size: 200%; font-weight: bold; } This reverts the style of the font property to the user agent's default unless a user stylesheet exists, in which case that is used instead. Then it doubles the font size and applies a font-weight of "bold". See also CSS values for controlling inheritance: inherit, initial, unset, and revert Introducing the CSS cascade Cascade and inheritance CSS Key
Concepts: CSS syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed, resolved, specified, used, and actual values. Definitions of value syntax, shorthand properties and replaced elements. ...
CSS: Cascading Style Sheets
CSS grid, and positioning, and some of the legacy techniques you might still want to know about. Use CSS to solve common problems This module provides links to sections of content explaining how to use CSS to solve common problems when creating a web page. Reference CSS reference: This exhaustive reference for seasoned Web developers describes every property and concept of CSS. ...
Ajax - Developer guides
ich originally supported only XML parsing. This feature allows Web apps to obtain an HTML resource as a parsed DOM using XMLHttpRequest. View All... Tools axios Promise based HTTP client, which uses XMLHttpRequest internally. See also Ajax: A New Approach to Web Applications Jesse James Garrett, of Adaptive Path, wrote this article in February 2005, introducing Ajax and its related
concepts. XMLHttpRequest Specification WHATWG Living Standard ...
Block formatting context - Developer guides
cifications Specification Status Comment CSS Display Module Level 3The definition of 'Block Formatting Context' in that specification. Candidate Recommendation define BFC(abbr) etc. CSS Level 2 (Revision 1)The definition of 'Block Formatting Context' in that specification. Recommendation Initial definition. See also float, clear CSS Key
Concepts: CSS syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed, resolved, specified, used, and actual values. Definitions of value syntax, shorthand properties and replaced elements. ...
HTML5 - Developer guides
It is a new version of the language HTML, with new elements, attributes, and behaviors, and a larger set of technologies that allows the building of more diverse and powerful Web sites and applications. This set is sometimes called HTML5 & friends and often shortened to just HTML5. Designed to be usable by all Open Web developers, this reference page links to numerous resources about HTML5 technologies, classified into several groups based on their function. Semantics: allowing you to describe more precisely what your content is. ...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
you do use have far more impact. Color theory resources A full review of color theory is beyond the scope of this article, but there are plenty of articles about color theory available, as well as courses you can find at nearby schools and universities. A couple of useful resources about color theory: Color Science (Khan Academy in association with Pixar) An online course which introduces
concepts such as what color is, how it's percieved, and how to use colors to express ideas. Presented by Pixar artists and designers. Color theory on Wikipedia Wikipedia's entry on color theory, which has a lot of great information from a technical perspective. It's not really a resource for helping you with the color sleection process, but is still full of useful information. Color and accessibility ...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
sibility concerns Spelling out the acronym or abbreviation in full the first time it is used on a page is beneficial for helping people understand it, especially if the content is technical or industry jargon. Example <p>JavaScript Object Notation (<abbr>JSON</abbr>) is a lightweight data-interchange format.</p> This is especially helpful for people who are unfamiliar with the terminology or
concepts discussed in the content, people who are new to the language, and people with cognitive concerns. Specifications Specification Status Comment HTML Living StandardThe definition of '<abbr>' in that specification. Living Standard HTML5The definition of '<abbr>' in that specification. Recommendation HTML 4.01 SpecificationThe definition o...
HTML: Hypertext Markup Language
Looking to become a front-end web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Beginner's tutorials Our HTML Learning Area features multiple modules that teach HTML from the ground up -- no previous knowledge required. Introduction to HTML This module sets the stage, getting you used to important
concepts and syntax such as looking at applying HTML to text, how to create hyperlinks, and how to use HTML to structure a web page. 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. HTML tables Representing tabular data on a webp...
Feature Policy - HTTP
n features. Examples of what you can do with Feature Policy: Change the default behavior of autoplay on mobile and third party videos. Restrict a site from using sensitive APIs like camera or microphone. Allow iframes to use the fullscreen API. Block the use of outdated APIs like synchronous XHR and document.write(). Ensure images are sized properly and are not too big for the viewport.
Concepts and usage Feature Policy allows you to control which origins can use which features, both in the top-level page and in embedded frames. Essentially, you write a policy, which is an allowed list of origins for each feature. For every feature controlled by Feature Policy, the feature is only enabled in the current document or frame if its origin matches the allowed list of origins. For each polic...
HTTP Index - HTTP
on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser. A complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images, videos, scripts, and more 4 Basics of HTTP Guide, HTTP, Overview HTTP is a pretty extensible protocol. It relies on a few basic
concepts like the notion of resources and URIs, a simple structure of messages, and a client-server structure for the communication flow. On top of these basic
concepts, numerous extensions have appeared over the years, adding new functionality and new semantics by creating new HTTP methods or headers. 5 Choosing between www and non-www URLs Guide, HTTP, URL A recurring question among...
About JavaScript - JavaScript
of an event. JavaScript is an easy to learn and also powerful scripting language, widely used for controlling web page behavior. Contrary to popular misconception, JavaScript is not "Interpreted Java". In a nutshell, JavaScript is a dynamic scripting language supporting prototype based object construction. The basic syntax is intentionally similar to both Java and C++ to reduce the number of new
concepts required to learn the language. Language constructs, such as if statements, for and while loops, and switch and try ... catch blocks function the same as in these languages (or nearly so). JavaScript can function as both a procedural and an object oriented language. Objects are created programmatically in JavaScript, by attaching methods and properties to otherwise empty objects at run time, as ...
Introduction - JavaScript
<< PreviousNext >> This chapter introduces JavaScript and discusses some of its fundamental
concepts. What you should already know This guide assumes you have the following basic background: A general understanding of the Internet and the World Wide Web (WWW). Good working knowledge of HyperText Markup Language (HTML). Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript. Where to find JavaScript information The JavaScript documentation on MDN includes the following: Learn Web Development provides information for beginners and introduces basic
concepts of programming and the Internet. JavaScript Guide (this guide) provides an overview about the JavaScript language and its objects. JavaScript Re...
Numbers and dates - JavaScript
This includes using numbers written in various bases including decimal, binary, and hexadecimal, as well as the use of the global Math object to perform a wide variety of mathematical operations on numbers. Numbers In JavaScript, numbers are implemented in double-precision 64-bit binary format IEEE 754 (i.e., a number between +-2-1022 and +-2+1023, or about +-10-308 to +-10+308, with a numeric precision of 53 bits). Integer values up to +-253 - 1 can be represented exactly. ...
JavaScript technologies overview - JavaScript
plementation, Event, EventTarget, ... A less rigorous definition of the DOM Event Architecture, as well as specific events in DOM events. Other things such as DOM Traversal and DOM Range. From the ECMAScript point of view, objects defined in the DOM specification are called "host objects". HTML DOM HTML, the Web's markup language, is specified in terms of the DOM. Layered above the abstract
concepts defined in DOM Core, HTML also defines the meaning of elements. The HTML DOM includes such things as the className property on HTML elements, or APIs such as document.body. The HTML specification also defines restrictions on documents; for example, it requires all children of a <ul> element, which represents an unordered list, to be <li> elements, as those represent list items. In general, it al...
Memory Management - JavaScript
pproximation since the general problem of determining whether or not a specific piece of memory is still needed is undecidable. Garbage collection As stated above, the general problem of automatically finding whether some memory "is not needed anymore" is undecidable. As a consequence, garbage collectors implement a restriction of a solution to the general problem. This section will explain the
concepts that are necessary for understanding the main garbage collection algorithms and their respective limitations. References The main concept that garbage collection algorithms rely on is the concept of reference. Within the context of memory management, an object is said to reference another object if the former has access to the latter (either implicitly or explicitly). For instance, a JavaScript...
Examples - MathML
Pythagorean Theorem Small example showing a proof of the Pythagorean Theorem. ...
MathML documentation index - MathML
structures like lists or tables but fortunately there are many generators from simple notations, WYSIWYG editors and other Content Management Systems to help writing Web pages. 3 Examples Beginner, Example, Guide, MathML, NeedsBeginnerUpdate Below you'll find some examples you can look at to help you to understand how to use MathML to display increasingly complex mathematical
concepts in Web content. 4 MathML: Deriving the Quadratic Formula Beginner, Education, Example, Guide, HTML5, MathML, NeedsBeginnerUpdate This page outlines the derivation of the Quadratic Formula. 5 Proving the Pythagorean theorem Beginner, Example, Guide, HTML5 Math, Math education, MathML, NeedsBeginnerUpdate We will now prove the Pythagorean theorem: 6 ...
Media type and format guide: image, audio, and video content - Web media technologies
ameter as part of the type string. This guide describes the format and possible values of the codecs parameter for the common media types. Codecs used by WebRTC WebRTC doesn't use a container, but instead streams the encoded media itself from peer to peer using MediaStreamTrack objects to represent each audio or video track. This guide discusses the codecs commonly used with WebRTC. Guides
Concepts Digital audio
concepts An introduction to how audio is converted into digital form and stored for use by computers. It explains basic
concepts about how audio is sampled, as well as
concepts such as sample rate, audio frames, and audio compression. Digital video
concepts A guide to fundamental
concepts involved with digital video as used on the web, including basics about color formats, chr...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
s soon as they are available. Performance-wise, you can prefetch resources that are not needed right now, but might be in the near future, so the app will be faster when you actually need those resources. Summary In this article we took a simple look at how you can make your PWA work offline with service workers. Be sure to check out our further documentation if you want to learn more about the
concepts behind the Service Worker API and how to use it in more detail. Service Workers are also used when dealing with push notifications -- this will be explained in a subsequent article. Previous Overview: Progressive web apps Next ...
Mobile first - Progressive web apps (PWAs)
ack up to the top of the article. Conditional resource loading To actually implement responsive/adaptive designs, you will need to enlist a certain amount of conditional resource loading, again so that different devices can receive an optimal experience without having to shoulder the burden of many resources that they don't need. See below for more details. A simple example To demonstrate the
concepts, I wanted to cover in this article, I created a very simple app containing a nav menu, heading and single column of text. You can see my mobile first example running live, or grab the code to play with it on Github. To make my simple example I created a sample app structure from a Mozilla Mortar template. I installed the Volo automation tool by running the following on the command line sudo npm ...
Progressive web apps (PWAs)
to progressive web appsThis article provides an introduction to Progressive Web Apps (PWAs), discussing what they are and the advantages they offer over regular web apps.Making PWAs work offline with Service workersIn this article we took a simple look at how you can make your PWA work offline with service workers. Be sure to check out our further documentation if you want to learn more about the
concepts behind the Service Worker API and how to use it in more detail. Progressive loadingIn previous articles we covered APIs that help us make our js13kPWA example a Progressive Web App: Service Workers, Web Manifests, Notifications and Push. In this article we will go even further and improve the performance of the app by progressively loading its resources.Progressive web app structureNow that w...
Paths - SVG: Scalable Vector Graphics
chosen, and the actual path is undefined. It's possible to approximate them by making the start and end points of the path slightly askew, and then connecting them with another path segment. ...
Information Security Basics - Web security
Describes the primary security objectives, which are absolutely fundamental to understanding security Security Controls Defines major categories of security controls and discusses their potential disadvantages TCP/IP Security An overview of the TCP/IP model, with a focus on the security considerations for SSL Threats Briefly introduces major threat
concepts Vulnerabilities Defines the major categories of vulnerabilities and discusses the presence of vulnerabilities in all software ...
Tutorials
ons. For complete beginners to the Web Getting started with the Web Getting started with the Web is a concise series introducing you to the practicalities of web development. You'll set up the tools you need to construct a simple webpage and publish your own simple code. HTML Tutorials Introductory level Introduction to HTML This module sets the stage, getting you used to important
concepts and syntax, looking at applying HTML to text, how to create hyperlinks, and how to use HTML to structure a webpage. MDN HTML element reference A comprehensive reference for HTML elements, and how the different browsers support them. Creating a Simple Web Page with HTML An HTML guide for beginners that includes explanations of common tags, including HTML5 tags. Also includes a step-by-st...
Web Components
Web Components is a suite of different technologies allowing you to create reusable custom elements -- with their functionality encapsulated away from the rest of your code -- and utilize them in your web apps.
Concepts and usage As developers, we all know that reusing code as much as possible is a good idea. This has traditionally not been so easy for custom markup structures -- think of the complex HTML (and associated style and script) you've sometimes had to write to render custom UI controls, and how using them multiple times can turn your page into a mess if you are not careful. Web Components aims to solve such problems -- it consists of three main technologies, which can be used together to create versatile custom elements with encapsulated functionality that can be reused wherever y...
XPath
L with XSLT XSLT uses XPath to address code segments in an XML document that it wishes to transform. XPath snippets These are JavaScript utility functions, that can be used in your own code, based on DOM Level 3 XPath APIs. What is XSLT? This extensive introduction to XSLT and XPath assumes no prior knowledge of the technologies, and guides the reader through background, context, structure,
concepts, and introductory terminology. JXON JXON (lossless JavaScript XML Object Notation) is a generic name by which is defined the representation of JavaScript Objects using XML. There are some cases in which the whole content of an XML document must be read from the JavaScript interpreter (like for web-apps languages or settings XML documents, for example). In these cases JXON could represent the mo...
Index - XSLT: Extensible Stylesheet Language Transformations
and more data transfers are automated and take place between highly heterogeneous machines linked by a network. 14 An Overview NeedsHelp, NeedsMarkupWork, Transforming_XML_with_XSLT, XML, XSLT The eXtensible Stylesheet Language/Transform is a very powerful language, and a complete discussion of it is well beyond the scope of this article, but a brief discussion of some basic
concepts will be helpful in understanding the description of Netscape's capabilities that follows. 15 For Further Reading NeedsContent, NeedsHelp, Transforming_XML_with_XSLT, XML, XSLT http://www.amazon.com/XSLT-Programme.../dp/0764543814 16 Resources Extensions, NeedsContent, NeedsExample, NeedsLiveSample, XML, xsl No summary! 17 The Netscape XSLT/XPat...
XSLT: Extensible Stylesheet Language Transformations
s the JavaScript interface to the XSLT processing engine in Mozilla 1.2 and up. Specifying parameters using processing instructions Firefox allows stylesheet parameters to be specified when using the <?xml-stylesheet?> processing instruction. This is done using the <?xslt-param?> PI described in this document. XSLT & XPath Tutorial The TopXML XSLT tutorial introduces you to the basics of XSLT
concepts, syntax, and programming. XSLT Tutorial This W3Schools tutorial teaches the reader how to use XSLT to transform XML documents into other formats, like XHTML. What is XSLT? This extensive introduction to XSLT and XPath assumes no prior knowledge of the technologies and guides the reader through background, context, structure,
concepts and introductory terminology. Common XSLT Errors This art...
WebAssembly
llows you to take advantage of WebAssembly's performance and power and JavaScript's expressiveness and flexibility in the same apps, even if you don't know how to write WebAssembly code. And what's even better is that it is being developed as a web standard via the W3C WebAssembly Working Group and Community Group with active participation from all major browser vendors. Guides WebAssembly
concepts Get started by reading the high-level
concepts behind WebAssembly -- what it is, why it is so useful, how it fits into the web platform (and beyond), and how to use it. Compiling a New C/C++ Module to WebAssembly When you've written code in C/C++, you can then compile it into .wasm using a tool like Emscripten. Let's look at how it works. Compiling an Existing C Module to WebAssembly A core ...