SlideShare una empresa de Scribd logo
1 de 74
Descargar para leer sin conexión
Using HTML5
 sensibly




Christian Heilmann, London Ajax User Meetup, February 2011
This will be a change from
my normal talks.

Instead of giving you the
facts, it is my turn to ask
some questions.
But first, let me tell you a
story. As stories are
important!
Back in 1939...




...Antarctica needed exploring
The Antarctic Explorer
So let’s see what went
wrong there...

★   Purely engineering driven
★   Tested while on the road
★   Never tested in the real
    environment
★   Massive media excitement before
    it proved its worth
HTML5 is the new hotness!
http://studio.html5rocks.com/
http://www.apple.com/html5/
http://html5advent.com/
Everything is HTML5 -
including browser specific
tricks.
To a degree this is
understandable.

There is a lot of confusion
about the players and the
specs.
HTML(5)


Markup                         general WTF

JavaScript APIs
Stuff for Browser/Parser developers
This gives people lots of
space for interpretation
and focus - and the
opportunity to rant.
The main premise of
HTML5 is pragmatism -
making things simpler for
all of us.
Another big topic is that
XML was just not for the
web - end users should not
suffer for the errors of the
authors.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
  <meta http-equiv="Content-Type"
        content="text/html; charset=UTF-8">
  <title>HTML - c'est moi!</title>
  <link rel="stylesheet" type="text/css"
        href="styles.css">
  <script type="text/javascript" src="magic.js">
  </script>
</head>
<body>
  <h1>Heading! Everybody duck!</h1>
  <p>I am content, hear me roar!</p>
  <p class="footer">By me!</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>HTML5, c'est moi, ou HTML...</title>
  <link rel="stylesheet" href="styles.css">
  <script src="magic.js"></script>
</head>
<body>
  <h1>Heading! Everybody duck!</h1>
  <p>I am content, hear me roar!</p>
  <p class="footer">By me!</p>
</body>
</html>
HTML5 also includes new
semantic elements (based
on class names in use) that
structure our documents
much better than before.
<!DOCTYPE html>
<html lang="en">
<head>
  <title>HTML5, c'est moi, ou HTML...</title>
  <link rel="stylesheet" href="styles.css">
  <script src="magic.js"></script>
</head>
<body>
  <header><h1>Heading! Everybody duck!</h1></header>
  <section>
    <p>I am content, hear me roar!</p>
  </section>
  <footer><p>By me!</p></footer>
</body>
</html>
HTML5 defines
and expects
browsers to fix
omissions for
us - and
doesn’t mind
case or quotes.
<!DOCTYPE html>
<html lang=en>
  <TITLE>HTML5, c'est moi, ou HTML...</title>
  <LINK rel=stylesheet href=styles.css>
  <script src=magic.js></SCRIPT>
<body>
  <HEADER><h1>Heading! Everybody duck!</h1></header>
  <section>
    <p>I am content, hear me roar!</p>
  </SECTION>
  <footer><p>By me!</p></FOOTER>
</body>
</HTML>
The reason is that browsers
do that anyways - just
check the generated code
of a document like that.
<!DOCTYPE html>
<html lang="en"><head>
  <title>HTML5, c'est moi, ou HTML...</title>
  <link rel="stylesheet" href="styles.css">
  <script src="magic.js"></script>
  </head><body>
  <header><h1>Heading! Everybody duck!</h1></header>
  <section>
    <p>I am content, hear me roar!</p>

  </section>
  <footer><p>By me!</p></footer>
</body></html>
<!DOCTYPE html>
<html lang=en>
  <TITLE>HTML5, c'est moi, ou HTML...</title>
  <LINK rel=stylesheet href=styles.css>
  <script src=magic.js></SCRIPT>
<body>
  <HEADER><h1>Heading! Everybody duck!</h1></header>
  <section>
    <p>I am content, hear me roar!</p>
  </SECTION>
  <footer><p>By me!</p></FOOTER>
</body>
</HTML>
<!DOCTYPE html>
<html lang="en"><head>
  <title>HTML5, c'est moi, ou HTML...</title>
  <link rel="stylesheet" href="styles.css">
  <script src="magic.js"></script>
</head><body>
  <header><h1>Heading! Everybody duck!</h1></header>
  <section>
     <p>I am content, hear me roar!
  	 <footer></footer>
     </p>
     <p>By me!</p>
  </section>
</body></html>
Browsers fix a lot of stuff
for us, this has always been
the case.
?
Can innovation be based on
“people never did this
correctly anyways”?
?
Is it HTML or BML?
?
Should HTML be there only
for browsers?

What about conversion
Services? Search bots?
Content scrapers?
Internet Explorer 6
Internet Explorer doesn’t
allow styling for elements it
doesn’t understand as part
of HTML.
HTML is the thing we base
everything on - so if we
exclusively use the new
HTML5 elements, we give
IE unstyled documents.
Time to apply
some fixes!
First fix - elements created
with JS can be styled in IE.
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <style>header{color:#fff;background:#369;}</style>
  <script>document.createElement('header');</script>
</head>
<body>
  <header><h1>Hello!</h1></header>
</body>
</html>
Remy Sharp packaged that
up nicely in HTML5shiv.




   http://code.google.com/p/html5shiv/
Cue the purists of the web.
“HTML should work without
JavaScript!”
Next solution:
Sending HTML5 as XML or
giving it a namespace.
http://www.ibm.com/developerworks/xml/library/x-think45/

http://www.debeterevormgever.nl/html5-ie-without-javascript/
Purist solution:
add DIVs around the new
elements.
.header,header,
.footer,footer,
.aside,aside,
.section,section{
  display:block;
}
<!DOCTYPE html>
<html lang="en">
  <head><meta charset="utf-8">
    <title>HTML5, c'est moi, ou HTML...</title>
    <link rel="stylesheet" href="styles.css">
    <script src="magic.js"></script>
  </head>
  <body>
  <div class="header"><header>
    <h1>Heading! Everybody duck!</h1>
  </header></div>
  <div class="section"><section>
    <p>I am content, hear me roar!</p>
  </section></div>
  <div class="footer"><footer>
    <p>By me</p>
  </footer></div>
</body>
</html>
Bloody Internet Explorer!
We always have to do
things extra for it!
All browsers fail in one way
or another and need
patches. Our job is to know
them.

Luckily, there is help.
http://www.modernizr.com/
http://html5boilerplate.com/
And as if by magic - the
much shorter and
pragmatic markup became
more complex again.
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6">
<![endif]-->
<!--[if IE 7 ]>     <html lang="en" class="no-js ie7">
<![endif]-->
<!--[if IE 8 ]>     <html lang="en" class="no-js ie8">
<![endif]-->
<!--[if IE 9 ]>     <html lang="en" class="no-js ie9">
<![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"
class="no-js"> <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible"
content="IE=edge,chrome=1">
  <title></title>
  <meta name="viewport" content="width=device-width,
initial-scale=1.0">
<link rel="shortcut icon" href="/favicon.ico">
  <link rel="apple-touch-icon" href="/apple-touch-
icon.png">
  <link rel="stylesheet" href="css/style.css?v=2">
  <script src="js/libs/modernizr-1.6.min.js"></script>
</head>
<body>
  <div id="container">
    <header>
    </header>
    <div id="main">
    </div>
    <footer>
    </footer>
  </div> <!-- end of #container -->
  <script src="//ajax.googleapis.com/ajax/libs/jquery/
1.4.2/jquery.js">
  </script>
<script>!window.jQuery && document.write(unescape
('%3Cscript src="js/libs/jquery-1.4.2.js"%3E%3C/script
%3E'))</script>
  <!-- scripts concatenated and minified via ant build
script-->
  <script src="js/plugins.js"></script>
  <script src="js/script.js"></script>
  <!-- end concatenated and minified scripts-->
  <!--[if lt IE 7 ]>
    <script src="js/libs/dd_belatedpng.js"></script>
    <script> DD_belatedPNG.fix('img, .png_bg'); </
script>
  <![endif]-->
</body>
</html>
One solution to use HTML5
APIs with legacy browsers
is using polyfills.
https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-
browser-Polyfills
?
Should we shoe-horn new
technology into legacy
browsers?
?
Do patches add complexity
as we need to test their
performance?
?
How about moving IE<9
fixes to the server side?
Padding with DIVs with
classes and no JS for IE?
Making video and audio
simpler.
Embedding audio and video
is easy in HTML5
<video src="interview.ogv" controls>
  <a href="interview.ogv">Download the video</a>
</video>
To make all capable
browsers play the video...
<video controls>
  <source src="interview.mp4" type="video/mp4">
  </source>
  <source src="interview.webm" type="video/webm">
  </source>
  <source src="interview.ogv" type="video/ogg">
  </source>
  <p>Download the
    <a href="interview.mp4">video in MP4 format</a>.
  </p>
</video>
Where there is a need,
there is an opportunity for a
business.
However, there is a real
problem for businesses.
http://www.webkitchen.be/2011/01/26/stealing-
content-was-never-easier-than-with-html5/
?
Can we expect content
creators to create video in
many formats to support
an open technology?
?
Can a service like vid.ly be
trusted for content creation
and storage?
?
Is HTML5 not applicable for
premium content?
It is time for all of us to
take initiative and make
this work.
Question authority and call
out wrong messaging.
Bad use of technology
doesn’t only break end user
experiences - it breaks the
web!
http://gawker.com/#!5754678/what-should-our-new-
national-anthem-be
http://www.whatwg.org/mailing-list
https://developer.mozilla.org/
Thanks!

Chris Heilmann
@codepo8
http://icant.co.uk

Más contenido relacionado

La actualidad más candente

The Rich Standard: Getting Familiar with HTML5
The Rich Standard: Getting Familiar with HTML5The Rich Standard: Getting Familiar with HTML5
The Rich Standard: Getting Familiar with HTML5Todd Anglin
 
Don't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsDon't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsStoyan Stefanov
 
Speak The Web: The HTML5 Experiments
Speak The Web: The HTML5 ExperimentsSpeak The Web: The HTML5 Experiments
Speak The Web: The HTML5 Experimentsguestd427df
 
A Holistic View of Website Performance
A Holistic View of Website PerformanceA Holistic View of Website Performance
A Holistic View of Website PerformanceRene Churchill
 
Intro to Web Development
Intro to Web DevelopmentIntro to Web Development
Intro to Web DevelopmentFrank Wu
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGapAlex S
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1Wataru OKAMOTO
 
Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8
Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8
Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8spierre
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrMichael Enslow
 
Deliverance talk at plone meetup
Deliverance talk at plone meetupDeliverance talk at plone meetup
Deliverance talk at plone meetupJazkarta, Inc.
 
Real World Web Standards
Real World Web StandardsReal World Web Standards
Real World Web Standardsgleddy
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsNathan Smith
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPPaul Redmond
 
Polytechnic 1.0 Granada
Polytechnic 1.0 GranadaPolytechnic 1.0 Granada
Polytechnic 1.0 GranadaIsrael Blancas
 

La actualidad más candente (20)

The Rich Standard: Getting Familiar with HTML5
The Rich Standard: Getting Familiar with HTML5The Rich Standard: Getting Familiar with HTML5
The Rich Standard: Getting Familiar with HTML5
 
Don't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsDon't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web Applications
 
Speak The Web: The HTML5 Experiments
Speak The Web: The HTML5 ExperimentsSpeak The Web: The HTML5 Experiments
Speak The Web: The HTML5 Experiments
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
A Holistic View of Website Performance
A Holistic View of Website PerformanceA Holistic View of Website Performance
A Holistic View of Website Performance
 
Intro to Web Development
Intro to Web DevelopmentIntro to Web Development
Intro to Web Development
 
Taking your Web App for a walk
Taking your Web App for a walkTaking your Web App for a walk
Taking your Web App for a walk
 
HTML5 Design
HTML5 DesignHTML5 Design
HTML5 Design
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1
 
Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8
Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8
Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8
 
HTML5
HTML5HTML5
HTML5
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Deliverance talk at plone meetup
Deliverance talk at plone meetupDeliverance talk at plone meetup
Deliverance talk at plone meetup
 
Looking into HTML5 + CSS3
Looking into HTML5 + CSS3Looking into HTML5 + CSS3
Looking into HTML5 + CSS3
 
Real World Web Standards
Real World Web StandardsReal World Web Standards
Real World Web Standards
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile Apps
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
 
Polytechnic 1.0 Granada
Polytechnic 1.0 GranadaPolytechnic 1.0 Granada
Polytechnic 1.0 Granada
 

Similar a Using HTML5 sensibly

An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5Steven Chipman
 
5 ways to embrace HTML5 today
5 ways to embrace HTML5 today5 ways to embrace HTML5 today
5 ways to embrace HTML5 todayDaniel Ryan
 
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpOptimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpMatthew Davis
 
SW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalSW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalJen Simmons
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010Ignacio Coloma
 
Webware - from Document to Operating System
Webware - from Document to Operating System Webware - from Document to Operating System
Webware - from Document to Operating System Channy Yun
 
Using Cool New Frameworks in (Mobile) Domino Apps
Using Cool New Frameworks in (Mobile) Domino AppsUsing Cool New Frameworks in (Mobile) Domino Apps
Using Cool New Frameworks in (Mobile) Domino AppsTeamstudio
 
Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioChristian Heilmann
 
HTML5: A brave new world of markup
HTML5: A brave new world of markupHTML5: A brave new world of markup
HTML5: A brave new world of markupChris Mills
 
Rey Bango - HTML5: polyfills and shims
Rey Bango -  HTML5: polyfills and shimsRey Bango -  HTML5: polyfills and shims
Rey Bango - HTML5: polyfills and shimsStarTech Conference
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential TrainingKaloyan Kosev
 
Stefan Judis "Did we(b development) lose the right direction?"
Stefan Judis "Did we(b development) lose the right direction?"Stefan Judis "Did we(b development) lose the right direction?"
Stefan Judis "Did we(b development) lose the right direction?"Fwdays
 

Similar a Using HTML5 sensibly (20)

An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
5 ways to embrace HTML5 today
5 ways to embrace HTML5 today5 ways to embrace HTML5 today
5 ways to embrace HTML5 today
 
Html5
Html5Html5
Html5
 
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpOptimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
 
SW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalSW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+Drupal
 
Looking into HTML5
Looking into HTML5Looking into HTML5
Looking into HTML5
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010
 
Webware - from Document to Operating System
Webware - from Document to Operating System Webware - from Document to Operating System
Webware - from Document to Operating System
 
Using Cool New Frameworks in (Mobile) Domino Apps
Using Cool New Frameworks in (Mobile) Domino AppsUsing Cool New Frameworks in (Mobile) Domino Apps
Using Cool New Frameworks in (Mobile) Domino Apps
 
WHAT IS HTML5?(20100510)
WHAT IS HTML5?(20100510)WHAT IS HTML5?(20100510)
WHAT IS HTML5?(20100510)
 
HTML5 and Joomla! 2.5 Template
HTML5 and Joomla! 2.5 TemplateHTML5 and Joomla! 2.5 Template
HTML5 and Joomla! 2.5 Template
 
Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audio
 
HTML5: A brave new world of markup
HTML5: A brave new world of markupHTML5: A brave new world of markup
HTML5: A brave new world of markup
 
Rey Bango - HTML5: polyfills and shims
Rey Bango -  HTML5: polyfills and shimsRey Bango -  HTML5: polyfills and shims
Rey Bango - HTML5: polyfills and shims
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Please dont touch-3.6-jsday
Please dont touch-3.6-jsdayPlease dont touch-3.6-jsday
Please dont touch-3.6-jsday
 
Shifting Gears
Shifting GearsShifting Gears
Shifting Gears
 
Stefan Judis "Did we(b development) lose the right direction?"
Stefan Judis "Did we(b development) lose the right direction?"Stefan Judis "Did we(b development) lose the right direction?"
Stefan Judis "Did we(b development) lose the right direction?"
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 

Más de Christian Heilmann

Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Christian Heilmann
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilegeChristian Heilmann
 
Seven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloSeven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloChristian Heilmann
 
Artificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteArtificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteChristian Heilmann
 
Killing the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteKilling the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteChristian Heilmann
 
Progressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandProgressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandChristian Heilmann
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilegeChristian Heilmann
 
Five ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerFive ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerChristian Heilmann
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Christian Heilmann
 
You learned JavaScript - now what?
You learned JavaScript - now what?You learned JavaScript - now what?
You learned JavaScript - now what?Christian Heilmann
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Christian Heilmann
 
Progressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachProgressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachChristian Heilmann
 
Progressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsProgressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsChristian Heilmann
 
Non-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansNon-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansChristian Heilmann
 
Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Christian Heilmann
 
CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlChristian Heilmann
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Christian Heilmann
 
The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)Christian Heilmann
 

Más de Christian Heilmann (20)

Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019Develop, Debug, Learn? - Dotjs2019
Develop, Debug, Learn? - Dotjs2019
 
Hinting at a better web
Hinting at a better webHinting at a better web
Hinting at a better web
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilege
 
Seven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC OsloSeven ways to be a happier JavaScript developer - NDC Oslo
Seven ways to be a happier JavaScript developer - NDC Oslo
 
Artificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynoteArtificial intelligence for humans… #AIDC2018 keynote
Artificial intelligence for humans… #AIDC2018 keynote
 
Killing the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynoteKilling the golden calf of coding - We are Developers keynote
Killing the golden calf of coding - We are Developers keynote
 
Progressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays FinlandProgressive Web Apps - Techdays Finland
Progressive Web Apps - Techdays Finland
 
Taking the "vile" out of privilege
Taking the "vile" out of privilegeTaking the "vile" out of privilege
Taking the "vile" out of privilege
 
Five ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developerFive ways to be a happier JavaScript developer
Five ways to be a happier JavaScript developer
 
Taking the P out of PWA
Taking the P out of PWATaking the P out of PWA
Taking the P out of PWA
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"
 
You learned JavaScript - now what?
You learned JavaScript - now what?You learned JavaScript - now what?
You learned JavaScript - now what?
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"
 
Progressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReachProgressive Web Apps - Covering the best of both worlds - DevReach
Progressive Web Apps - Covering the best of both worlds - DevReach
 
Progressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worldsProgressive Web Apps - Covering the best of both worlds
Progressive Web Apps - Covering the best of both worlds
 
Non-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humansNon-trivial pursuits: Learning machines and forgetful humans
Non-trivial pursuits: Learning machines and forgetful humans
 
Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center Progressive Web Apps - Bringing the web front and center
Progressive Web Apps - Bringing the web front and center
 
CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. Control
 
Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
 
The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)The Soul in The Machine - Developing for Humans (FrankenJS edition)
The Soul in The Machine - Developing for Humans (FrankenJS edition)
 

Último

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Último (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

Using HTML5 sensibly

  • 1. Using HTML5 sensibly Christian Heilmann, London Ajax User Meetup, February 2011
  • 2. This will be a change from my normal talks. Instead of giving you the facts, it is my turn to ask some questions.
  • 3. But first, let me tell you a story. As stories are important!
  • 4. Back in 1939... ...Antarctica needed exploring
  • 6.
  • 7.
  • 8.
  • 9. So let’s see what went wrong there... ★ Purely engineering driven ★ Tested while on the road ★ Never tested in the real environment ★ Massive media excitement before it proved its worth
  • 10.
  • 11. HTML5 is the new hotness!
  • 15. Everything is HTML5 - including browser specific tricks.
  • 16. To a degree this is understandable. There is a lot of confusion about the players and the specs.
  • 17. HTML(5) Markup general WTF JavaScript APIs Stuff for Browser/Parser developers
  • 18. This gives people lots of space for interpretation and focus - and the opportunity to rant.
  • 19. The main premise of HTML5 is pragmatism - making things simpler for all of us.
  • 20. Another big topic is that XML was just not for the web - end users should not suffer for the errors of the authors.
  • 21. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>HTML - c'est moi!</title> <link rel="stylesheet" type="text/css" href="styles.css"> <script type="text/javascript" src="magic.js"> </script> </head> <body> <h1>Heading! Everybody duck!</h1> <p>I am content, hear me roar!</p> <p class="footer">By me!</p> </body> </html>
  • 22. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>HTML5, c'est moi, ou HTML...</title> <link rel="stylesheet" href="styles.css"> <script src="magic.js"></script> </head> <body> <h1>Heading! Everybody duck!</h1> <p>I am content, hear me roar!</p> <p class="footer">By me!</p> </body> </html>
  • 23. HTML5 also includes new semantic elements (based on class names in use) that structure our documents much better than before.
  • 24. <!DOCTYPE html> <html lang="en"> <head> <title>HTML5, c'est moi, ou HTML...</title> <link rel="stylesheet" href="styles.css"> <script src="magic.js"></script> </head> <body> <header><h1>Heading! Everybody duck!</h1></header> <section> <p>I am content, hear me roar!</p> </section> <footer><p>By me!</p></footer> </body> </html>
  • 25. HTML5 defines and expects browsers to fix omissions for us - and doesn’t mind case or quotes.
  • 26. <!DOCTYPE html> <html lang=en> <TITLE>HTML5, c'est moi, ou HTML...</title> <LINK rel=stylesheet href=styles.css> <script src=magic.js></SCRIPT> <body> <HEADER><h1>Heading! Everybody duck!</h1></header> <section> <p>I am content, hear me roar!</p> </SECTION> <footer><p>By me!</p></FOOTER> </body> </HTML>
  • 27. The reason is that browsers do that anyways - just check the generated code of a document like that.
  • 28. <!DOCTYPE html> <html lang="en"><head> <title>HTML5, c'est moi, ou HTML...</title> <link rel="stylesheet" href="styles.css"> <script src="magic.js"></script> </head><body> <header><h1>Heading! Everybody duck!</h1></header> <section> <p>I am content, hear me roar!</p> </section> <footer><p>By me!</p></footer> </body></html>
  • 29. <!DOCTYPE html> <html lang=en> <TITLE>HTML5, c'est moi, ou HTML...</title> <LINK rel=stylesheet href=styles.css> <script src=magic.js></SCRIPT> <body> <HEADER><h1>Heading! Everybody duck!</h1></header> <section> <p>I am content, hear me roar!</p> </SECTION> <footer><p>By me!</p></FOOTER> </body> </HTML>
  • 30. <!DOCTYPE html> <html lang="en"><head> <title>HTML5, c'est moi, ou HTML...</title> <link rel="stylesheet" href="styles.css"> <script src="magic.js"></script> </head><body> <header><h1>Heading! Everybody duck!</h1></header> <section> <p>I am content, hear me roar! <footer></footer> </p> <p>By me!</p> </section> </body></html>
  • 31. Browsers fix a lot of stuff for us, this has always been the case.
  • 32. ? Can innovation be based on “people never did this correctly anyways”?
  • 33. ? Is it HTML or BML?
  • 34. ? Should HTML be there only for browsers? What about conversion Services? Search bots? Content scrapers?
  • 36. Internet Explorer doesn’t allow styling for elements it doesn’t understand as part of HTML.
  • 37. HTML is the thing we base everything on - so if we exclusively use the new HTML5 elements, we give IE unstyled documents.
  • 39. First fix - elements created with JS can be styled in IE. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <style>header{color:#fff;background:#369;}</style> <script>document.createElement('header');</script> </head> <body> <header><h1>Hello!</h1></header> </body> </html>
  • 40. Remy Sharp packaged that up nicely in HTML5shiv. http://code.google.com/p/html5shiv/
  • 41. Cue the purists of the web. “HTML should work without JavaScript!”
  • 42. Next solution: Sending HTML5 as XML or giving it a namespace. http://www.ibm.com/developerworks/xml/library/x-think45/ http://www.debeterevormgever.nl/html5-ie-without-javascript/
  • 43. Purist solution: add DIVs around the new elements. .header,header, .footer,footer, .aside,aside, .section,section{ display:block; }
  • 44. <!DOCTYPE html> <html lang="en"> <head><meta charset="utf-8"> <title>HTML5, c'est moi, ou HTML...</title> <link rel="stylesheet" href="styles.css"> <script src="magic.js"></script> </head> <body> <div class="header"><header> <h1>Heading! Everybody duck!</h1> </header></div> <div class="section"><section> <p>I am content, hear me roar!</p> </section></div> <div class="footer"><footer> <p>By me</p> </footer></div> </body> </html>
  • 45. Bloody Internet Explorer! We always have to do things extra for it!
  • 46. All browsers fail in one way or another and need patches. Our job is to know them. Luckily, there is help.
  • 49. And as if by magic - the much shorter and pragmatic markup became more complex again.
  • 50.
  • 51. <!doctype html> <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="viewport" content="width=device-width, initial-scale=1.0">
  • 52. <link rel="shortcut icon" href="/favicon.ico"> <link rel="apple-touch-icon" href="/apple-touch- icon.png"> <link rel="stylesheet" href="css/style.css?v=2"> <script src="js/libs/modernizr-1.6.min.js"></script> </head> <body> <div id="container"> <header> </header> <div id="main"> </div> <footer> </footer> </div> <!-- end of #container --> <script src="//ajax.googleapis.com/ajax/libs/jquery/ 1.4.2/jquery.js"> </script>
  • 53. <script>!window.jQuery && document.write(unescape ('%3Cscript src="js/libs/jquery-1.4.2.js"%3E%3C/script %3E'))</script> <!-- scripts concatenated and minified via ant build script--> <script src="js/plugins.js"></script> <script src="js/script.js"></script> <!-- end concatenated and minified scripts--> <!--[if lt IE 7 ]> <script src="js/libs/dd_belatedpng.js"></script> <script> DD_belatedPNG.fix('img, .png_bg'); </ script> <![endif]--> </body> </html>
  • 54. One solution to use HTML5 APIs with legacy browsers is using polyfills.
  • 56. ? Should we shoe-horn new technology into legacy browsers?
  • 57. ? Do patches add complexity as we need to test their performance?
  • 58. ? How about moving IE<9 fixes to the server side? Padding with DIVs with classes and no JS for IE?
  • 59. Making video and audio simpler.
  • 60. Embedding audio and video is easy in HTML5 <video src="interview.ogv" controls> <a href="interview.ogv">Download the video</a> </video>
  • 61. To make all capable browsers play the video... <video controls> <source src="interview.mp4" type="video/mp4"> </source> <source src="interview.webm" type="video/webm"> </source> <source src="interview.ogv" type="video/ogg"> </source> <p>Download the <a href="interview.mp4">video in MP4 format</a>. </p> </video>
  • 62. Where there is a need, there is an opportunity for a business.
  • 63.
  • 64. However, there is a real problem for businesses.
  • 66. ? Can we expect content creators to create video in many formats to support an open technology?
  • 67. ? Can a service like vid.ly be trusted for content creation and storage?
  • 68. ? Is HTML5 not applicable for premium content?
  • 69. It is time for all of us to take initiative and make this work.
  • 70. Question authority and call out wrong messaging.
  • 71. Bad use of technology doesn’t only break end user experiences - it breaks the web! http://gawker.com/#!5754678/what-should-our-new- national-anthem-be