SlideShare une entreprise Scribd logo
1  sur  63
Télécharger pour lire hors ligne
Belgacom Skynet, 2011 - François Massart
Summary
1. A brief history of markup
2. The design of HTML5
3. Rich Media
4. Web Forms 2.0
5. Semantics
6. Using HTML5 today
A brief history of markup
Untitled document

•   First document “HTML Tags” in 1991

•   Evolutions like the <img> tag in HTML 2.0

•   HTML 4.01 published in 1999

•   XHTML 1: HTML as XML
    No new element, just stricter syntax
XHTML 1 Rules
• Considered as “Best practice”
• Everything in lowercase
  <H2>Wrong</H2>
  <h2>Correct</h2>

• Attribute values between quotes
  <p class=intro>Yaaak</p>
  <p class=”intro”>Yep!</p>
  <p class=”intro success”>Yep!</p>
XHTML 2

• HTML is replaced by XML
• Not backward compatible, hum...
• Disaster...
XHTML 2


XHTML2 HAS FAILED!
• Pure standards ideology vs Real world
• Representatives from Opera, Apple and
  Mozilla were unhappy
• Rebels formed the Web Hypertext
  Application Technology Work Group
WHATWG
• Discuss issues like the W3C but final
  decision is made by the editor (Ian
  Hickson)...
• In theory: less democratic process
• In practice: faster decisions
• They created...
  Web Forms 2.0 and Web Apps 1.0
Let’s cook...
Web Forms 2.0
     +
Web Apps 1.0
     =
  HTML5
The reunification
• XHTML 2 was going nowhere (and slowly!)
• WHATWG works can be used as basis
  for next versions of HTML...
• Confusing situation with 3 technologies:
  XHTML 2, HTML 5 and HTML5...
• Only keep HTML5
Current state of
        HTML5
• 2 groups working on HTML5
• WHATWG “Commit then review”
• W3C “Review then commit”
• Should become a “proposed
  recommendation” in 2022
• “Candidate recommendation” in 2012
Ready to use?
• Specifications due in 2012
• Depends on browsers support
• There won’t be a single point in
  time at which we can declare that
  the language is ready to use.

• You are already using HTML5
HTML5
         Specs




Users            Browsers
The design of HTML5
Simple principles

• Support existing content :)
• Do not reinvent the wheel
• Don’t go extreme, keep it real
Priority of
          constituencies
 In case of conflict, consider users over authors over
implementers over specifiers over theoretical purity.
Error handling
• Defined in the specifications
• For the first time!
• Browsers makers can focus on new
  features instead of errors
• How to deal with malformed documents?
• Very ambitious
New HTML DocType

•   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
    4.01//EN" "http://www.w3.org/TR/html4/
    strict.dtd">

•   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Strict //EN" "http://www.w3.org/TR/xhtml1/
    DTD/xhtml1-strict.dtd">

•   <!DOCTYPE html>
<!DOCTYPE html>

• Very pragmatic
• Need to support existing content
• Browsers support features, not doctypes
• DTD are meant for validators
• Quirks mode vs Standards mode
Keep it simple

•   <meta http-equiv="Content-Type" content="text/html;
    charset=UTF-8">

•   <meta charset="UTF-8">

•   <script type="text/javascript" src="file.js"></
    script>

•   <link rel="stylesheet" type="text/css"
    href="file.css">
Syntax rules get lazy

• You are free to enforce a particular style of
  writing (lowercase, uppercase, quotes...)
• Chose your syntax and hold on it!
• My recommandation: keep XHTML syntax
• But drop the value for Boolean attributes
New JavaScript APIs

• No real specification until now
• HTML5 will finally document all its APIs
• Ensure compatibility through all browsers
• What’s up? Undo manager, offline storage,
  drag and drop...
Rich Media
Filling the gaps

• HTML + CSS + JavaScript = Application
• Almost...
• You need a plug-in’s for video and audio
• Closed technologies
• Native is better :)
Canvas

• Environment for creating dynamic images via
  JavaScript drawing API
• Simple, elegant and fallback enabled
  <canvas id="my-first-canvas" width="360" height="240">
      <p>No canvas support? Ignore it and use its children:</p>
     <img src="puppy.jpg" alt="a cute puppy"/>
  </canvas>
Audio

• Available options:     autoplay, loop, controls...


• Simple as:
   <audio src="witchitalineman.mp3" loop></audio>


• Can be controlled by JavaScript:
   document.getElementById('player').pause();
Big deal on codecs?

• Some format costs money (MP3, H264...)
• Others are free of charge
   <audio controls>
      <source src="witchitalineman.ogg" type="audio/ogg">
      <source src="witchitalineman.mp3" type="audio/mpeg">
   </audio>


• Online demo
Bulletproof example

<audio controls="">
  <source src="witchitalineman.ogg" type="audio/ogg">
  <source src="witchitalineman.mp3" type="audio/mpeg">
  <object type="application/x-shockwave-flash"
  data="player.swf?soundFile=witchitalineman.mp3">
    <param name="movie" value="player.swf?
    soundFile=witchitalineman.mp3">
     <a href="witchitalineman.mp3">Download the song</a>
  </object>
</audio>
Video
• Very similar to audio tag...
• Full example:
  <video controls width="360" height="240"
  poster="placeholder.jpg">
   <source src="movie.ogv" type="video/ogg">
   <source src="movie.mp4" type="video/mp4">
   <object type="application/x-shockwave-flash"
   width="360" height="240" data="player.swf?
   file=movie.mp4">
    <param name="movie" value="player.swf?file=movie.mp4">
    <a href="movie.mp4">Download the movie</a>
   </object>
  </video>
Web Forms 2.0
<input> revisited

• placeholder attribute
   <input type=”text” placeholder=”Keywords?” />


• autofocus attribute (Boolean)
   <input type=”text” autofocus />


• required attribute (Boolean)
   <input type=”text” required />
<input> revisited


• autocomplete attribute (on/off)
 •   <form action="/send.php" autocomplete="on">

 •   <input type="text" name="captcha"
     autocomplete="off" />
<datalist>

• Crossbreed between <input> and <select>
• Sample code:
  <input type="text" list="planets"/>
  <datalist id="planets">
      <option value="Mercury">
      ...
      <option value="Neptune">
  </datalist>
<input>’s new types
• type=”search”
• type=”email”
• type=”url”
• type=”tel” (try this in Mobile Safari)
• If unsupported fallback to default:
  type=”text”
<input>’s new types

• type=”range”
• type=”number”
• type=”date”
• type=”color”
• custom (type) pattern=”[d]{5}(-[d]{4})”
Nice! Can I style them?

• NO:-PE
• Web is NOT about control
• The user is used to his native browser UI
  elements...
• Browsers will probably make them nicer
Semantics
<mark>keyword</mark>


• Give importance to content in a special
  context (e.g. search results)
• Instead of <em> or <strong>
<time>

• Today using microformats:
  <abbr class="dtstart" title="1992-01-12">
      January 12th, 1992
  </abbr>


• Soon:
  <time class="dtstart" datetime="1992-01-12">
      January 12th, 1992
  </time>
<meter>

• Markup measurements, part of a scale
  (min/max values):
  <meter>9 out of 10 stars</meter>

  <meter max="10">9 stars</meter>

  <meter low="-273" high="100" min="12" max="30"
  optimum="21" value="25">
      It's quite warm for this time of year.
  </meter>
<progress>


• Markup measurement that is changing...
  Your profile is <progress>60%</progress> complete.

  <progress min="0" max="100" value="60"></progress>


• Great with JavaScript ! (File uploads, etc.)
Structure
 It’s the content that matters, not the position.

• <section>
• <header>
• <footer>
• <aside>
• <nav>
• <article>
<section>

• Grouping together thematically-related
  content vs <div> which have no semantic.
  <section>
      <h1>DOM Scripting</h1>
      <p>The book is aimed at designers rather
      than programmers.</p>
      <p>By Jeremy Keith</p>
  </section>
<header>
• It is NOT the “master head”.
• Described as “a group of introductory or
  navigational aids.”
  <section>
      <header>
          <h1>DOM Scripting</h1>
      </header>
      <p>...</p>
  </section>
<footer>
• NOT describing a position but...
• “should contain information about its
  containing element:
  author, copyright information, links to related content, etc.”
  <section>
      ...
      <footer>
          <p>Powered by Belga</p>
      </footer>
  </section>
<aside>

• Once again, it’s the content that matters,
  not the position.
• Example: pullquotes
  Nice to have, but you can remove them
  without affecting the main content.
Pop quiz !
• What new structure markup element
  should contain the author’s infos ?
                                  •     <section>

                                  •     <header>

                                  •     <footer>

                                  •     <aside>

                                  •     <nav>

                                  •     <article>
<footer>
<nav>
• As expected: containing navigation
  informations.
• Usually a list of links
• Use it for site-wide links
• Often inside <header> which contains
  “navigational aids”
<article>
                        <header>
                        <footer>
<section>
                        <nav>

                        <aside>

                        <article>
<article>

• <article> a specialized kind of <section>.
• Self contained...
• Now what is “self contained”... Think of it
  as in a RSS feed.
• <article> vs <section>... Tricky task!
Using HTML5 today
Styling

• Browsers won’t apply default styling on
  “New elements”, define yours!
  section, article,
  header, footer, nav, aside, hgroup
  { display: block;}


• Internet Explorer cannot handle it!
  You need an extra JavaScript...
Validation

• Just a tool, use it wisely
• http://validator.nu/ will be used when
  doctype is HTML5...
• Even from our old friend
  http://validator.w3.org/
Feature detection

• Testing feature support
• Provide a JavaScript alternative
• Don’t re-invent the wheel!
• You can use Modernizr
Modernizr

• www.modernizr.com
  if (!Modernizr.inputtypes.color)
  {
      // JavaScript fallback goes here.
  }
Get on it!

• Dependable features
• Roughly usable features
• Experimental features
• Edge features
Dependable features
• doctype <!DOCTYPE html>
• charset <meta charset="UTF-8">
• self-closed tags (+optional quotes)
• no more type attributes type="text/css"
• new semantics <article>, <section>, ...
• data-* attributes <p data-timer="5">...
• contenteditable
Roughly usable features
• <audio> & <video>
• <canvas> demo
• SVG
• geolocation
• web sockets
• drag and drop
• input autofocus
• input placeholder
Experimental features
• form input types
• <meter> & <progress>
• web SQL database
• web storage
• web workers
• WebGL
• File API
• history.pushState
Edge features

• hardware acceleration
• IndexedDB
• orientation
• <device>
• audio data API
• <input speech>
• SVG filters
Go to and learn!
• Learn through books, websites, Google
  Reader, etc.
• HTML5 is a living standard...
  It’s alive ! Stay on your toes.
• Links:
  ! http://html5rocks.com/
  ! http://html5doctor.com/
  ! http://whatwg.org/html5

Contenu connexe

Tendances

Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
Gill Cleeren
 
HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - Altran
Robert Nyman
 
Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website
Phase2
 
SPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentialsSPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentials
Mark Rackley
 

Tendances (20)

Echo HTML5
Echo HTML5Echo HTML5
Echo HTML5
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
 
Web Components v1
Web Components v1Web Components v1
Web Components v1
 
[PSU Web 2011] HTML5 Design
[PSU Web 2011] HTML5 Design[PSU Web 2011] HTML5 Design
[PSU Web 2011] HTML5 Design
 
Html5
Html5Html5
Html5
 
HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - Altran
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Top 10 HTML5 features
Top 10 HTML5 featuresTop 10 HTML5 features
Top 10 HTML5 features
 
HTML 5 Fundamental
HTML 5 FundamentalHTML 5 Fundamental
HTML 5 Fundamental
 
TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have known
 
Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website
 
Html5
Html5Html5
Html5
 
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelComprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
 
HTML5: It goes to ELEVEN
HTML5: It goes to ELEVENHTML5: It goes to ELEVEN
HTML5: It goes to ELEVEN
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1
 
SPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentialsSPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentials
 
Frontend for developers
Frontend for developersFrontend for developers
Frontend for developers
 

En vedette

Managemen Aliran Kas untuk Perusahaan Jasa Konstruksi
Managemen Aliran Kas untuk Perusahaan Jasa KonstruksiManagemen Aliran Kas untuk Perusahaan Jasa Konstruksi
Managemen Aliran Kas untuk Perusahaan Jasa Konstruksi
Dr. Denies Priantinah
 

En vedette (10)

DevFest Makerere html5 presentation by caesar mukama
DevFest Makerere html5 presentation by caesar mukamaDevFest Makerere html5 presentation by caesar mukama
DevFest Makerere html5 presentation by caesar mukama
 
Presentation html5 css3 by thibaut
Presentation html5 css3 by thibautPresentation html5 css3 by thibaut
Presentation html5 css3 by thibaut
 
Html5 presentation slides
Html5 presentation slidesHtml5 presentation slides
Html5 presentation slides
 
HTML5 presentations on SlideShare
HTML5 presentations on SlideShareHTML5 presentations on SlideShare
HTML5 presentations on SlideShare
 
INDIA AND AUSTRALIA TAX TREATY.
INDIA AND AUSTRALIA TAX TREATY.INDIA AND AUSTRALIA TAX TREATY.
INDIA AND AUSTRALIA TAX TREATY.
 
Managemen Aliran Kas untuk Perusahaan Jasa Konstruksi
Managemen Aliran Kas untuk Perusahaan Jasa KonstruksiManagemen Aliran Kas untuk Perusahaan Jasa Konstruksi
Managemen Aliran Kas untuk Perusahaan Jasa Konstruksi
 
Tata Cara Perhitungan Harga Satuan Pekerjaan Pipa dan Saniter
Tata Cara Perhitungan Harga Satuan Pekerjaan Pipa dan SaniterTata Cara Perhitungan Harga Satuan Pekerjaan Pipa dan Saniter
Tata Cara Perhitungan Harga Satuan Pekerjaan Pipa dan Saniter
 
html5.ppt
html5.ppthtml5.ppt
html5.ppt
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
5g ppt new
5g ppt new5g ppt new
5g ppt new
 

Similaire à HTML5, just another presentation :)

Darwin web standards
Darwin web standardsDarwin web standards
Darwin web standards
Justin Avery
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Lucidworks
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
Thinkful
 
[Access U 2010] HTML5 & Accessibility
[Access U 2010] HTML5 & Accessibility[Access U 2010] HTML5 & Accessibility
[Access U 2010] HTML5 & Accessibility
Christopher Schmitt
 

Similaire à HTML5, just another presentation :) (20)

The web context
The web contextThe web context
The web context
 
Darwin web standards
Darwin web standardsDarwin web standards
Darwin web standards
 
Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3
 
HTML5 tags.ppt
HTML5 tags.pptHTML5 tags.ppt
HTML5 tags.ppt
 
Advanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoAdvanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojo
 
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
 
Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
 
Looking into HTML5 + CSS3
Looking into HTML5 + CSS3Looking into HTML5 + CSS3
Looking into HTML5 + CSS3
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18
 
HTML5 History & Features
HTML5 History & FeaturesHTML5 History & Features
HTML5 History & Features
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
 
HTML5: Introduction
HTML5: IntroductionHTML5: Introduction
HTML5: Introduction
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
 
Rohit&kunjan
Rohit&kunjanRohit&kunjan
Rohit&kunjan
 
[Access U 2010] HTML5 & Accessibility
[Access U 2010] HTML5 & Accessibility[Access U 2010] HTML5 & Accessibility
[Access U 2010] HTML5 & Accessibility
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and Rendering
 
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
 
Rapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapRapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with Bootstrap
 

HTML5, just another presentation :)

  • 1. Belgacom Skynet, 2011 - François Massart
  • 2. Summary 1. A brief history of markup 2. The design of HTML5 3. Rich Media 4. Web Forms 2.0 5. Semantics 6. Using HTML5 today
  • 3. A brief history of markup
  • 4. Untitled document • First document “HTML Tags” in 1991 • Evolutions like the <img> tag in HTML 2.0 • HTML 4.01 published in 1999 • XHTML 1: HTML as XML No new element, just stricter syntax
  • 5. XHTML 1 Rules • Considered as “Best practice” • Everything in lowercase <H2>Wrong</H2> <h2>Correct</h2> • Attribute values between quotes <p class=intro>Yaaak</p> <p class=”intro”>Yep!</p> <p class=”intro success”>Yep!</p>
  • 6. XHTML 2 • HTML is replaced by XML • Not backward compatible, hum... • Disaster...
  • 8. • Pure standards ideology vs Real world • Representatives from Opera, Apple and Mozilla were unhappy • Rebels formed the Web Hypertext Application Technology Work Group
  • 9. WHATWG • Discuss issues like the W3C but final decision is made by the editor (Ian Hickson)... • In theory: less democratic process • In practice: faster decisions • They created... Web Forms 2.0 and Web Apps 1.0
  • 10. Let’s cook... Web Forms 2.0 + Web Apps 1.0 = HTML5
  • 11. The reunification • XHTML 2 was going nowhere (and slowly!) • WHATWG works can be used as basis for next versions of HTML... • Confusing situation with 3 technologies: XHTML 2, HTML 5 and HTML5... • Only keep HTML5
  • 12. Current state of HTML5 • 2 groups working on HTML5 • WHATWG “Commit then review” • W3C “Review then commit” • Should become a “proposed recommendation” in 2022 • “Candidate recommendation” in 2012
  • 13. Ready to use? • Specifications due in 2012 • Depends on browsers support • There won’t be a single point in time at which we can declare that the language is ready to use. • You are already using HTML5
  • 14. HTML5 Specs Users Browsers
  • 15. The design of HTML5
  • 16. Simple principles • Support existing content :) • Do not reinvent the wheel • Don’t go extreme, keep it real
  • 17. Priority of constituencies In case of conflict, consider users over authors over implementers over specifiers over theoretical purity.
  • 18. Error handling • Defined in the specifications • For the first time! • Browsers makers can focus on new features instead of errors • How to deal with malformed documents? • Very ambitious
  • 19. New HTML DocType • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/ strict.dtd"> • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/ DTD/xhtml1-strict.dtd"> • <!DOCTYPE html>
  • 20. <!DOCTYPE html> • Very pragmatic • Need to support existing content • Browsers support features, not doctypes • DTD are meant for validators • Quirks mode vs Standards mode
  • 21. Keep it simple • <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> • <meta charset="UTF-8"> • <script type="text/javascript" src="file.js"></ script> • <link rel="stylesheet" type="text/css" href="file.css">
  • 22. Syntax rules get lazy • You are free to enforce a particular style of writing (lowercase, uppercase, quotes...) • Chose your syntax and hold on it! • My recommandation: keep XHTML syntax • But drop the value for Boolean attributes
  • 23. New JavaScript APIs • No real specification until now • HTML5 will finally document all its APIs • Ensure compatibility through all browsers • What’s up? Undo manager, offline storage, drag and drop...
  • 25. Filling the gaps • HTML + CSS + JavaScript = Application • Almost... • You need a plug-in’s for video and audio • Closed technologies • Native is better :)
  • 26. Canvas • Environment for creating dynamic images via JavaScript drawing API • Simple, elegant and fallback enabled <canvas id="my-first-canvas" width="360" height="240"> <p>No canvas support? Ignore it and use its children:</p> <img src="puppy.jpg" alt="a cute puppy"/> </canvas>
  • 27. Audio • Available options: autoplay, loop, controls... • Simple as: <audio src="witchitalineman.mp3" loop></audio> • Can be controlled by JavaScript: document.getElementById('player').pause();
  • 28. Big deal on codecs? • Some format costs money (MP3, H264...) • Others are free of charge <audio controls> <source src="witchitalineman.ogg" type="audio/ogg"> <source src="witchitalineman.mp3" type="audio/mpeg"> </audio> • Online demo
  • 29. Bulletproof example <audio controls=""> <source src="witchitalineman.ogg" type="audio/ogg"> <source src="witchitalineman.mp3" type="audio/mpeg"> <object type="application/x-shockwave-flash" data="player.swf?soundFile=witchitalineman.mp3"> <param name="movie" value="player.swf? soundFile=witchitalineman.mp3"> <a href="witchitalineman.mp3">Download the song</a> </object> </audio>
  • 30. Video • Very similar to audio tag... • Full example: <video controls width="360" height="240" poster="placeholder.jpg"> <source src="movie.ogv" type="video/ogg"> <source src="movie.mp4" type="video/mp4"> <object type="application/x-shockwave-flash" width="360" height="240" data="player.swf? file=movie.mp4"> <param name="movie" value="player.swf?file=movie.mp4"> <a href="movie.mp4">Download the movie</a> </object> </video>
  • 32. <input> revisited • placeholder attribute <input type=”text” placeholder=”Keywords?” /> • autofocus attribute (Boolean) <input type=”text” autofocus /> • required attribute (Boolean) <input type=”text” required />
  • 33. <input> revisited • autocomplete attribute (on/off) • <form action="/send.php" autocomplete="on"> • <input type="text" name="captcha" autocomplete="off" />
  • 34. <datalist> • Crossbreed between <input> and <select> • Sample code: <input type="text" list="planets"/> <datalist id="planets"> <option value="Mercury"> ... <option value="Neptune"> </datalist>
  • 35. <input>’s new types • type=”search” • type=”email” • type=”url” • type=”tel” (try this in Mobile Safari) • If unsupported fallback to default: type=”text”
  • 36. <input>’s new types • type=”range” • type=”number” • type=”date” • type=”color” • custom (type) pattern=”[d]{5}(-[d]{4})”
  • 37. Nice! Can I style them? • NO:-PE • Web is NOT about control • The user is used to his native browser UI elements... • Browsers will probably make them nicer
  • 39. <mark>keyword</mark> • Give importance to content in a special context (e.g. search results) • Instead of <em> or <strong>
  • 40. <time> • Today using microformats: <abbr class="dtstart" title="1992-01-12"> January 12th, 1992 </abbr> • Soon: <time class="dtstart" datetime="1992-01-12"> January 12th, 1992 </time>
  • 41. <meter> • Markup measurements, part of a scale (min/max values): <meter>9 out of 10 stars</meter> <meter max="10">9 stars</meter> <meter low="-273" high="100" min="12" max="30" optimum="21" value="25"> It's quite warm for this time of year. </meter>
  • 42. <progress> • Markup measurement that is changing... Your profile is <progress>60%</progress> complete. <progress min="0" max="100" value="60"></progress> • Great with JavaScript ! (File uploads, etc.)
  • 43. Structure It’s the content that matters, not the position. • <section> • <header> • <footer> • <aside> • <nav> • <article>
  • 44. <section> • Grouping together thematically-related content vs <div> which have no semantic. <section> <h1>DOM Scripting</h1> <p>The book is aimed at designers rather than programmers.</p> <p>By Jeremy Keith</p> </section>
  • 45. <header> • It is NOT the “master head”. • Described as “a group of introductory or navigational aids.” <section> <header> <h1>DOM Scripting</h1> </header> <p>...</p> </section>
  • 46. <footer> • NOT describing a position but... • “should contain information about its containing element: author, copyright information, links to related content, etc.” <section> ... <footer> <p>Powered by Belga</p> </footer> </section>
  • 47. <aside> • Once again, it’s the content that matters, not the position. • Example: pullquotes Nice to have, but you can remove them without affecting the main content.
  • 48. Pop quiz ! • What new structure markup element should contain the author’s infos ? • <section> • <header> • <footer> • <aside> • <nav> • <article>
  • 50. <nav> • As expected: containing navigation informations. • Usually a list of links • Use it for site-wide links • Often inside <header> which contains “navigational aids”
  • 51. <article> <header> <footer> <section> <nav> <aside> <article>
  • 52. <article> • <article> a specialized kind of <section>. • Self contained... • Now what is “self contained”... Think of it as in a RSS feed. • <article> vs <section>... Tricky task!
  • 54. Styling • Browsers won’t apply default styling on “New elements”, define yours! section, article, header, footer, nav, aside, hgroup { display: block;} • Internet Explorer cannot handle it! You need an extra JavaScript...
  • 55. Validation • Just a tool, use it wisely • http://validator.nu/ will be used when doctype is HTML5... • Even from our old friend http://validator.w3.org/
  • 56. Feature detection • Testing feature support • Provide a JavaScript alternative • Don’t re-invent the wheel! • You can use Modernizr
  • 57. Modernizr • www.modernizr.com if (!Modernizr.inputtypes.color) { // JavaScript fallback goes here. }
  • 58. Get on it! • Dependable features • Roughly usable features • Experimental features • Edge features
  • 59. Dependable features • doctype <!DOCTYPE html> • charset <meta charset="UTF-8"> • self-closed tags (+optional quotes) • no more type attributes type="text/css" • new semantics <article>, <section>, ... • data-* attributes <p data-timer="5">... • contenteditable
  • 60. Roughly usable features • <audio> & <video> • <canvas> demo • SVG • geolocation • web sockets • drag and drop • input autofocus • input placeholder
  • 61. Experimental features • form input types • <meter> & <progress> • web SQL database • web storage • web workers • WebGL • File API • history.pushState
  • 62. Edge features • hardware acceleration • IndexedDB • orientation • <device> • audio data API • <input speech> • SVG filters
  • 63. Go to and learn! • Learn through books, websites, Google Reader, etc. • HTML5 is a living standard... It’s alive ! Stay on your toes. • Links: ! http://html5rocks.com/ ! http://html5doctor.com/ ! http://whatwg.org/html5