Bert Bos | HTML5 and the Open Web Platform
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
To view: switch to full screen
(With Javascript: press A)
Bert Bos (W3C) <bert@w3.org>
Presented at:
Iran Web Festival
Tehran, Iran
26 January 2012
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Version | Year | Syntax | Purpose |
---|---|---|---|
before 2.0 | ±1991 | SGML | For hypertext documents |
HTML 2.0 | 1995 | SGML | Bug fixes, better use of SGML |
HTML 3.2 | 1997 | SGML | Temporary specification to document various HTML variants, preparation for HTML 4 |
HTML 4.0 & 4.01 | 1997, 1999 | SGML | Support for internationalization, style sheets, accessibility, multimedia and scripting |
XHTML 1.0 & 1.1 | 2000, 2001 | XML | Alternative syntax of HTML 4 for XML-based environments. |
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
No consensus on anything else for creating the UI of Web applications
Small improvements to document mark-up
(<time>
, <section>
, etc.)
Make SVG (Tiny 1.2) and MathML (3.0) a required part of HTML
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
2.1 Billion HTML5 Browsers on Mobile Devices by 2016 says ABI Research- July 22, 2011
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Feature | Description |
---|---|
<time> | encode date and/or time (e.g., for microformats) |
<aside> | footnote/sidenote |
<details> , <summary> | collapsing/expanding text |
<figure> , <figcaption> | a figure with a caption |
<header> , <footer> | introductory, resp., concluding section of a chapter |
<hgroup> | to create subtitles |
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Feature | Description |
---|---|
<section> , <article> | variants of div
|
<nav> | encloses elements that are for navigation, rather than information |
<ruby> , <rp> , <rb> | ruby annotations |
<bdi> | bidi isolation, keep words together in bidirectional (right to left) text |
MathML | MathML 3.0 is included in HTML5 |
SVG | SVG Tiny 1.2 is included in HTML5 |
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Each component follows its own timeline:
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
text/html
) and
XML serialization (application/xhtml+xml
)
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
<video controls preload=auto poster="poster.png"> <source src="trailer.mp4" type="video/mp4"> <source src="trailer.webm" type="video/webm"> <track kind=subtitles src="brave.en" srclang=en label="English"> <track kind=captions src="brave_bis.en" srclang=en label="English for the Hard of Hearing"> <track kind=subtitles src="brave.fr" srclang=fr label="Français"> <p>Your user agent does not support the HTML5 Video element. </video>
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Chrome | Firefox | Internet Explorer | Opera | Safari | |
---|---|---|---|---|---|
video/mp4 | * | ✔ | ✔ | ||
video/ogg | ✔ | ✔ | ✔ | ||
video/webm | ✔ | ✔ | * | ✔ |
* if users install a plugin
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Resolution-dependent bitmap canvas
<canvas width="720" height="400"> </canvas>
Associated APIs:
ctx = canvas.getContext('2d');
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
You can use SVG to draw the UI
<video>...</video> <div id="controls"> <svg xmlns="http://www.w3.org/2000/svg"...> ... <g id="s-PlayButton"> <path id="s-PlayLogo" style="fill:#ffffff;fill-opacity:1" d="M 43,10 L 43,22 L 53,16 L 43,10 z"/> ... </g>...</svg> ... </div> ... document.getElementById("s-PlayBack"). addEventListener("click", svp_playButton, false);
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
SVG | ↔ | Canvas |
---|---|---|
document-based (Google indexes SVG) | ↔ | script-based |
vectors | ↔ | pixel operations |
object model with hit-testing and events | ↔ | low-level graphics API, no scene graph |
performance hit with large number of shapes | ↔ | fast rendering |
accessible | ↔ | must create accessible equivalent |
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
SVG | ↔ | Canvas |
---|---|---|
user interfaces | ↔ | fast-paced games |
scalable images | ↔ | very complex images |
interactive animations | ↔ | highly dynamic visualizations |
for designers | ↔ | for developers |
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Jabberwocky
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.(Jabberwocky, by Lewis Carroll)
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
A little game written in JavaScript.
The images are actually letters in a font.
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
MathML3 is included in HTML5:
... <ul> <li> <math mode="display"> <mrow> <munderover> <mo>∑</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>p</mi> </munderover> ...
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Different devices and user agents have different ways to determine position.
(Often multiple ways: GPS, Google Location Services…)
Single API for Web applications.
Privacy considerations: device (or user agent) must provide user with ways to easily grant/revoke permission to use location data.
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
window.localStorage['MyValue'] = "pretty value"; p.textContent = window.localStorage['MyValue'];
p.textContent = window.sessionStorage['MyValue'];
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Goal: Advanced audio capabilities for HTML5 audio
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Goal: provide methods to enhance aspects of application performance of user agent features and APIs.
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Lets computer decide when to draw the next frame
function draw_cb(time) {
// ... update display here...
// Re-queue ourselves:
window.requestAnimationFrame(draw_cb);
}
To start an animation:
id = window.requestAnimationFrame(draw_cb);
To cancel a queued request:
window.cancelRequestAnimationFrame(id);
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
See also IETF RTCWeb.
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Be aware of security and privacy considerations before using those features!
As a Web developer:
See also OWASP top 10.
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
November 14, 2011: First Draft of Standard for Online Privacy
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
<li role=menuitemcheckbox onclick='...' aria-checked=true>Sort by Name</li>
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Status | Chrome 13 | Firefox 6 | IE 9 | Opera 11.50 | Safari 5 | |
---|---|---|---|---|---|---|
Video | WD | ☼ | ☼ | ☼ | ☼ | ☼ |
Video formats | - | MPEG4 / WebM | WebM | MPEG4 / WebM | WebM | MPEG4 / WebM |
2D Canvas | WD | ☼ | ☼ | ☼ | ☼ | ☼ |
SVG | ✔ | ☼ | ☼ | ☼ | ☼ | ☼ |
Forms | WD | ☁ | ☁ | ☼ | ☁ | |
Multithreading (Workers) | WD | ☼ | ☼ | ☼ | ☼ | |
Bidirectional protocol | WD | ☂ | ☂ | ☂ | ||
Web storage | WD | ☼ | ☼ | ☼ | ☼ | ☼ |
Indexed DB | WD | ☁ | ||||
2D Transforms | FPWD | ☼ | ☼ | ☼ | ☼ | ☼ |
→
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Status | Chrome 13 | Firefox 6 | IE 9 | Opera 11.50 | Safari 5 | |
---|---|---|---|---|---|---|
3D Transforms | FPWD | ☁ | ☁ | ☁ | ||
Transitions | FPWD | ☼ | ☼ | ☼ | ☂ | |
Animations | FPWD | ☁ | ☁ | |||
Fonts | WD | ☼ | ☼ | ☼ | ☼ | ☼ |
Geolocation | ✔ | ☼ | ☼ | ☼ | ☼ | ☼ |
Navigation Timing | ✔ | ☼ | ☼ | |||
Media Queries | ✔ | ☼ | ☼ | ☼ | ☼ | ☼ |
Drag/drop | WD | ☼ | ☼ | ☼ | ☼ | ☼ |
HTML5 parser | WD | ☼ | ☼ | ☼ | ☼ |
Try caniuse.com
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Do not copy the following code:
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number if (ieversion>=9) return true; else return false;
You should write instead:
if (!!navigator.geolocation)
Try Modernizr
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
→
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
http://www.w3.org/Talks/2012/0125-HTML-Tehran/
To Lead the Web to its full potential
To Anticipate the Trends
To Increase your company value
Join W3C
http://www.w3.org/Consortium/join
or contact: Bernard Gidon <bgidon@w3.org>
Bert Bos <bert@w3.org>
GPG fingerprint:
7744 0204 52A5 14D9 147D
2A13 2D7A E420 184B 5BA4
SVG filters appled through CSS, not only to SVG, but to any element (proposed feature, first working draft expected soon)
MathML line breaking.