SlideShare a Scribd company logo
HTML5: What's new?
   Chris Mills, Opera Software




            Slides available on http://slideshare.net/chrisdavidmills
Who the hell am I?
‣ Opera open standards evangelist and tech writer
‣ Telling the world about open standards & Opera
‣ Improving web education
‣ Drinking beer & saving the world before morning
‣ Drumming in a heavy metal band
HTML5: what's new?
What is HTML5?
A new HTML spec that defines:
‣ New semantic elements
‣ New features such as native video, more
  powerful forms, web sockets
‣ New APIs for controlling such features
‣ Error handling, and other such useful things
There’s nothing wrong with
HTML4...




             http://www.flickr.com/photos/birdfarm/519230710/
But HTML5 has more bling
               As if! Not publishing this one...
HTML5 does not replace
HTML4
‣ It’s backwards compatible
‣ It fills up holes
‣ It adds new markup and APIs
‣ It competes with proprietary/plug-in technology
New syntax: better
semantics




             http://www.flickr.com/photos/zscheyge/49012397/
HTML5 doctype
<!doctype
html>
Typical website structure
<div
id="header"></div>
<div
id="nav"></div>
<div
id="main">


<div
class="article"></div>


<div
class="article"></div>




...
</div>
<div
id="footer"></div>
HTML5 update
<header></header>
<nav></nav>
<section
id="main">


<article></article>


<article></article>




...
</section>
<footer></footer>
<aside>
<aside>


<h2>About
the
author</h2>

 

<p>Chris
Mills
is
a
front‐end
bling
junkie





working
for
Opera
Software...</p>
</aside>
<time>
<p>Article
published
on
the



<time
datetime="2011‐03‐12T09:48">




12th
March
2011,
at
9:48am


</time>
</p>
<hgroup>
<hgroup>


<h1>Top
level
heading</h1>


<h2>This
is
a
really
descriptive
subtitle</h2>
</hgroup>
<figure> and <figcaption>
<figure>


<img
src="bear.jpg"







alt="this
is
the
bear
that
I
wrestled"
/>


<figcaption>This
is
the
bear
that
I


wrestled.</figcaption>
</figure>
Where does this leave the
humble <div>?
Use it for anything that isn’t covered by other new
elements, and is just a general grouping, e.g. for
styling purposes, for which you don’t want to
create a new section. An intro <div>, perhaps?
Browsers don’t ACTUALLY
support these ... yet
But we can get them displaying ok
‣ You can style any element with CSS, even if the
  browser doesn’t recognise it
‣ Give all the structural elements display:
block;
‣ IE also needs some scripting:
 createElement(‘article’);
‣ HTML5Shiv sorts it all out
New forms!




             http://www.flickr.com/photos/zscheyge/49012397/
HTML5 forms
Previously called Web Forms 2.0
‣ More powerful form controls
‣ Built-in validation
New input types
<input
type=range>
<input
type=date>
<input
type=number>
<input
type=color>
<input
type=search>
<input
type=email>
<input
type=url>
<input
type=tel>
Datalist
<input
type="text"
list="mydata">
<datalist
id="mydata">


<option
label="Mr"
value="Mister">


<option
label="Mrs"
value="Mistress">


<option
label="Ms"
value="Miss">
</datalist>
Validation
Form validation used to be horrendous

var
elements
=
document.getElementsByTagName('input');





//
loop
through
all
input
elements
in
form






Who the hell wants to write

for(var
i
=
0;
i
<
elements.length;
i++)
{







//
check
if
element
is
mandatory;
ie
has
a
pattern






var
pattern
=
elements.item(i).getAttribute('pattern');





this??



if
(pattern
!=
null)
{







var
value
=
elements.item(i).value;









//
validate
the
value
of
this
element,
using
its
defined
pattern







var
offendingChar
=
value.match(pattern);









//
if
an
invalid
character
is
found
or
the
element
was
left
empty







if(offendingChar
!=
null
||
value.length
==
0)
{











//
add
up
all
error
messages









str
+=
elements.item(i).getAttribute('errorMsg')
+
"n"
+
















"Found
this
illegal
value:
'"
+
offendingChar
+
"'
n";











//
notify
user
by
changing
background
color,
in
this
case
to
red









elements.item(i).style.background
=
"red";








}





}



}






if
(str
!=
"")
{





//
do
not
submit
the
form





alert("ERROR
ALERT!!n"
+str);






return
false;


HTML5 gives you this
<input
type="text"
required>
And this
<input
type="text"
required








pattern="[A‐z]{1,20}
[A‐z]{1,20}">
Other new attributes
autofocus
placeholder
min
max
step
New output mechanisms
<output>
<progress>
<meter>
<canvas>
Scriptable graphics
‣ Standard API for drawing
‣ Supporting across all modern browsers
The basics
<canvas
id="canvas"
width="400"
height="300">


...fallback...
</canvas>
The basics
var
ctx
=

document.getElementById('canvas').getContext('2d');

ctx.fillStyle
ctx.fillRect
<canvas> examples
‣ http://dev.opera.com/articles/view/html-5-
  canvas-the-basics/
‣ http://ejohn.org/blog/processingjs/
‣ http://www.hakim.se/experiments/
‣ http://www.canvasdemos.com/
‣ http://people.opera.com/patrickl/experiments/
  canvas/particle/3/
Video and audio!




             http://www.flickr.com/photos/zscheyge/49012397/
<video> and <audio>
New elements, plus new API for controlling audio
and video
The old school way
<object
width="425"
height="344">
<param
name="movie"

value="http://www.example.com/
v/LtfQg4KkR88&hl=en&fs=1"></param>
<param
name="allowFullScreen"
value="true"></param>
<embed
src="http://www.example.com/v/
LtfQg4KkR88&hl=en&fs=1"


type="application/x‐shockwave‐flash"


allowfullscreen="true"
width="425"

height="344"></embed>
</object>
The badass sexy new way
<video
src="video.webm"







width="480px"







height="283px"







controls







poster="poster.png">
</video>
Fallback
<video
src="video.webm"







width="480px"







height="283px"







controls







poster="poster.png">


<p>Your
browser
doesn’t
support
HTML5
video.
<a

href="myVideo.webm">Download
the
video
instead</
a>.</p>
</video>
Adding different formats
<video
width="480px"







height="283px"







controls







poster="poster.png">


<source
src="video.mp4"
type="video/mp4">


<source
src="video.webm"
type="video/webm">


<p>Your
browser
doesn’t
support
HTML5
video.
<a

href="myVideo.webm">Download
the
video
instead</
a>.</p>
</video>
Adding a Flash fallback
<object
type="application/x‐shockwave‐flash"

data="player.swf"
width="480"
height="283">


<param
name="allowfullscreen"
value="true">


<param
name="allowscriptaccess"
value="always">


<param
name="flashvars"
value="file=video.mp4">



                                                   



<!‐‐[if
IE]><param
name="movie"

value="player.swf"><![endif]‐‐>


<img
src="video.jpg"
width="480"
height="283"

alt="Video">
</object>
Captioning advancements
<track
src="sintel_en.srt"
kind="subtitles"

srclang="en"
label="English"
/>
<track
src="sintel_de.srt"
kind="subtitles"

srclang="de"
label="Deutsch"
/>
<track
src="sintel_es.srt"
kind="subtitles"

srclang="es"
label="Español"
/>
Going offline




                http://www.flickr.com/photos/zscheyge/49012397/
Offline apps!
‣ Generally, the web doesn't work very well
  without a web connection!
‣ What can we do about this?
Offline applications
‣ AppCache: Save an offline version of your web
  page files and use those to display your web
  page when you lose network.
‣ Web storage: Like cookies, but more powerful.
  Store things such as form data and user
  preferences
‣ WebSQL: A fully-functioning database in your
  browser. Store a user's data so they can
  continue working with it when the network goes
  down
Offline applications
‣ For more information, check out http://
 dev.opera.com/articles/view/taking-your-web-
 apps-offline-web-storage-appcache-websql/
And why is this all so good
again?




              http://www.flickr.com/photos/zscheyge/49012397/
Better consistency
‣ Better machine readability & interoperability:
 ‣ Easier syndication and reuse
 ‣ Less time worrying about design consistency
 ‣ Less time training up new team members
‣ Defined error handling means things work more
 consistently, even if they are broken!
 ‣ Better cross browser apps
 ‣ Less time spent debugging
Better accessibility
‣ For example, HTML5 video is keyboard
  accessible out of the box
‣ New elements bringing consistency is also
  important here
‣ Less time and money spent on accessibility
‣ 1 in 5 people in the UK have some kind of
  disability - a market you can’t ignore
Less reliance on JavaScript
‣ Less work for your developers to do, so faster
  implementation and prototyping
‣ Less pain for designers and other less technical
  team members
‣ Faster loading sites
Less reliance on Flash
‣ Means less skills needed in the team
‣ HTML5 plays nicer with the rest of the page; you
  can fill in any missing functionality with JS
‣ Less Flash means better accessibility (note: there
  are some HTML5 accessibility gotchas, like
  Canvas)
‣ Downloading a plugin breaks brand experience
  and can confuse users
HTML5 works on iDevices
‣ Like iPad and iPhone
‣ A crucial market to be in
‣ Flash has not been allowed on these devices
Offline apps!
‣ Never before possible...
Thanks for listening!
‣ cmills@opera.com
‣ @chrisdavidmills
‣ http://dev.opera.com/articles/tags/html5/
‣ http://html5doctor.com

More Related Content

KEY
HTML5: A brave new world of markup
PDF
Usability in the GeoWeb
PPTX
Fundamentals of HTML5
PPTX
Real World SharePoint Debacles
PPTX
Measuring Front-End Performance - What, When and How?
PDF
Progressive Enhancement using WSGI
PDF
Frontend performance metrics
PPTX
Untangling the web10
HTML5: A brave new world of markup
Usability in the GeoWeb
Fundamentals of HTML5
Real World SharePoint Debacles
Measuring Front-End Performance - What, When and How?
Progressive Enhancement using WSGI
Frontend performance metrics
Untangling the web10

What's hot (20)

PPTX
Untangling the web9
PPTX
Advanced front end debugging with ms edge and ms tools
PDF
orcreatehappyusers
PPTX
Gherkin for test automation in agile
PDF
HTML5 for PHP Developers - IPC
PDF
The What & Why of Pattern Lab
PPTX
10 things you can do to speed up your web app today 2016
PPT
Joomla as a mobile App backend - ideas, examples and experiences
PDF
Real solutions, no tricks
PPTX
Disrupting the application eco system with progressive web applications
PPTX
Untangling7
PDF
17 Web Performance Metrics You Should Care About
PDF
M is for modernization
PPTX
Untangling the web11
PPTX
Delhi student's day
PPTX
Develop a vanilla.js spa you and your customers will love
PPT
Web II - 01 - Introduction to server-side development
PPTX
Untangling spring week8
PPTX
Untangling6
PPTX
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
Untangling the web9
Advanced front end debugging with ms edge and ms tools
orcreatehappyusers
Gherkin for test automation in agile
HTML5 for PHP Developers - IPC
The What & Why of Pattern Lab
10 things you can do to speed up your web app today 2016
Joomla as a mobile App backend - ideas, examples and experiences
Real solutions, no tricks
Disrupting the application eco system with progressive web applications
Untangling7
17 Web Performance Metrics You Should Care About
M is for modernization
Untangling the web11
Delhi student's day
Develop a vanilla.js spa you and your customers will love
Web II - 01 - Introduction to server-side development
Untangling spring week8
Untangling6
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
Ad

Viewers also liked (8)

KEY
(For non-developers) HTML5: A richer web for everyone
KEY
CSS3: the new style council
PDF
HTML5 and CSS3 Shizzle
KEY
CSS3: stay tuned for style
PDF
HTML5 Pearson preso
PDF
A web sized education problem?
KEY
Selling Yourself Online Chrismills
PPT
[Slideshare] tafaqqahu-#5(august-2016)-lesson-#3f-problem-in–education- contn...
(For non-developers) HTML5: A richer web for everyone
CSS3: the new style council
HTML5 and CSS3 Shizzle
CSS3: stay tuned for style
HTML5 Pearson preso
A web sized education problem?
Selling Yourself Online Chrismills
[Slideshare] tafaqqahu-#5(august-2016)-lesson-#3f-problem-in–education- contn...
Ad

Similar to HTML5: what's new? (20)

KEY
Maximising Online Resource Effectiveness Workshop Session 3/8 Priority issues
PDF
James Turner (Caplin) - Enterprise HTML5 Patterns
PPTX
An Introduction to Web Components
PPTX
HTML5 and Search Engine Optimization (SEO)
PPT
Rey Bango - HTML5: polyfills and shims
PPTX
KEY
CICONF 2012 - Don't Make Me Read Your Mind
PPTX
High-Speed HTML5
PPTX
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
ODP
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
PDF
ASP NET Professional Projects 1st Edition Hersh Bhasin
PDF
News From the Front Lines - an update on Front-End Tech
PDF
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
PPT
Benefits of the CodeIgniter Framework
PPTX
JavaOne 2015 Devops and the Darkside CON6447
PPTX
Automation: PowerShell & DSC
PDF
Developing web applications in 2010
PDF
Building and evolving microservices: lessons from the frontlines - Ilias Bart...
PDF
Building and evolving microservices
PDF
Website & Internet + Performance testing
Maximising Online Resource Effectiveness Workshop Session 3/8 Priority issues
James Turner (Caplin) - Enterprise HTML5 Patterns
An Introduction to Web Components
HTML5 and Search Engine Optimization (SEO)
Rey Bango - HTML5: polyfills and shims
CICONF 2012 - Don't Make Me Read Your Mind
High-Speed HTML5
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
ASP NET Professional Projects 1st Edition Hersh Bhasin
News From the Front Lines - an update on Front-End Tech
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Benefits of the CodeIgniter Framework
JavaOne 2015 Devops and the Darkside CON6447
Automation: PowerShell & DSC
Developing web applications in 2010
Building and evolving microservices: lessons from the frontlines - Ilias Bart...
Building and evolving microservices
Website & Internet + Performance testing

More from Chris Mills (20)

PDF
More efficient, usable web
PDF
Feedback handling, community wrangling, panhandlin’
PDF
APIs for modern web apps
PDF
APIs, now and in the future
PDF
Guerrilla education
PDF
Web versus Native: round 1!
PDF
BrazilJS MDN
PDF
Empowering the "mobile web"
PDF
Documentation and publishing
PDF
MDN is easy!
PDF
Getting rid of images with CSS
PDF
Future layouts
PDF
Laying out the future
PDF
Accessibility doesn't exist
PDF
Responsive web design standards?
PDF
Adapt! Media queries and viewport
PDF
Adapt and respond: keeping responsive into the future
KEY
Angels versus demons: balancing shiny and inclusive
PDF
HTML5 and CSS3: does now really mean now?
PDF
The W3C and the web design ecosystem
More efficient, usable web
Feedback handling, community wrangling, panhandlin’
APIs for modern web apps
APIs, now and in the future
Guerrilla education
Web versus Native: round 1!
BrazilJS MDN
Empowering the "mobile web"
Documentation and publishing
MDN is easy!
Getting rid of images with CSS
Future layouts
Laying out the future
Accessibility doesn't exist
Responsive web design standards?
Adapt! Media queries and viewport
Adapt and respond: keeping responsive into the future
Angels versus demons: balancing shiny and inclusive
HTML5 and CSS3: does now really mean now?
The W3C and the web design ecosystem

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Spectroscopy.pptx food analysis technology
PDF
Electronic commerce courselecture one. Pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
The Rise and Fall of 3GPP – Time for a Sabbatical?
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation theory and applications.pdf
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectroscopy.pptx food analysis technology
Electronic commerce courselecture one. Pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation_ Review paper, used for researhc scholars
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Empathic Computing: Creating Shared Understanding
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
20250228 LYD VKU AI Blended-Learning.pptx
Spectral efficient network and resource selection model in 5G networks

HTML5: what's new?

Editor's Notes