Results 21 - 40 of 63

Optimizing canvas

The following is a collection of tips to improve performance
Advanced Canvas Graphics HTML HTML5 Tutorial


The Geolocation interface represents an object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location.
Advanced API Geolocation API Interface Reference Référence


A MutationRecord represents an individual DOM mutation. It is the object that is passed to MutationObserver's callback.
Advanced API DOM DOM Reference NeedsContent Reference

Using the Notifications API

The Notifications API lets a web page or app send notifications that are displayed outside the page at the system level; this lets web apps send information to a user even if the application is idle or in the background. This article looks at the basics of using this API in your own apps.
Advanced API DOM Guide Notifications Tutorial

Using server-sent events

The server-sent event API is contained in the EventSource interface; to open a connection to the server to begin receiving events from it, create a new EventSource object specifying the URI of a script that generates the events. For example:
Advanced DOM Guide Server-sent events

Touch events

In order to provide quality support for touch-based user interfaces, touch events offer the ability to interpret finger (or stylus) activity on touch screens or trackpads.
Advanced DOM Event Guide Mobile Overview

The structured clone algorithm

The structured clone algorithm is a new algorithm defined by the HTML5 specification for serializing complex JavaScript objects. It's more capable than JSON in that it supports the serialization of objects that contain cyclic graphs — objects can refer to objects that refer to other objects in the same graph. In addition, in some cases, the structured clone algorithm may be more efficient than JSON.
Advanced DOM HTML5 JavaScript Reference Référence

Using Web Workers

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. Thus, using the window shortcut to get the current global scope (instead of self) within a Worker will return an error.
Advanced Firefox Guide HTML5 JavaScript Workers

Content categories

Each HTML element must abide by rules defining what kind of content it can have. These rules are grouped into content models common to several elements. Each HTML element belongs to zero, one, or multiple content models, each setting rules that the element's content must follow in an HTML-conformant document.
Advanced Guide HTML HTML5 NeedsUpdate Web

CORS enabled image

The HTML specification introduces a crossorigin attribute for images that, in combination with an appropriate CORS header, allows images defined by the <img> element loaded from foreign origins to be used in canvas as if they were being loaded from the current origin.
Advanced Canvas CORS HTML Reference Référence Security

CORS settings attributes

In HTML5, some HTML elements which provide support for CORS, such as <img> or <video>, have a crossorigin attribute (crossOrigin property), which lets you configure the CORS requests for the element's fetched data. These attributes are enumerated, and have the following possible values:
Advanced CORS HTML NeedsContent NeedsExample Reference Security

Optimizing your pages for speculative parsing

Traditionally in browsers the HTML parser has run on the main thread and has blocked after a </script> tag until the script has been retrieved from the network and executed. The HTML parser in Firefox 4 and later supports speculative parsing off the main thread. It parses ahead while scripts are being downloaded and executed. As in Firefox 3.5 and 3.6, the HTML parser starts speculative loads for scripts, style sheets and images it finds ahead in the stream. However, in Firefox 4 and later the HTML parser also runs the HTML tree construction algorithm speculatively. The upside is that when a speculation succeeds, there's no need to reparse the part of the incoming file that was already scanned for scripts, style sheets and images. The downside is that there's more work lost when the speculation fails.
Advanced HTML HTML5 NeedsUpdate Web Development

Scaling background images

The background-size CSS property makes it possible to adjust the size of background images, instead of the default behavior of tiling the image at its full size. You can scale the image upward or downward as desired.
Advanced CSS CSS Background Example Graphics Guide Web

Using CSS Flexible Boxes

The CSS3 Flexible Box, or flexbox, is a layout mode providing for the arrangement of elements on a page such that the elements behave predictably when the page layout must accommodate different screen sizes and different display devices. For many applications, the flexible box model provides an improvement over the block model in that it does not use floats, nor do the flex container's margins collapse with the margins of its contents.
#RWD Advanced Boxes CSS Example Flexible Guide Web