SlideShare a Scribd company logo
Dive into HTML5

Doris Chen Ph.D.
Developer Evangelist
Microsoft
http://blogs.msdn.com/dorischen/
@doristchen
Who am I?
 Developer Evangelist at Microsoft based in Silicon
  Valley, CA
    Blog: http://blogs.msdn.com/b/dorischen/
    Twitter @doristchen
    Email: doris.chen@microsoft.com
 Has over 15 years of experience in the software industry
  focusing on web technologies
 Spoke and published widely at HTML5 Dev, JavaOne,
  O'Reilly, Silicon Valley Code Camp, SD West, SD Forum
  and worldwide User Groups meetings
 Doris received her Ph.D. from the University of California
  at Los Angeles (UCLA)
Agenda

         HTML5 Overview


         HTML5 Main Feature

         HTML5 Tools


         Summary and Resources




PAGE 3
HTML5 Overview
Where did HTML5 Come from?
 20 years of evolution: 1990 to 2010
HTML      2      3     3.2     4      4.01
                     XML     XHTML1          1.1     1SE   2
                             Web Forms 2           Web Apps 1 H HTML5
 W3C participate in HTML5 (2006)
    Formed working group to work with WHATWG (Web Hypertext
     Applications Technology Working Group) on HTML5 specification (2007)

 HTML4 + XHTML1 evolved into Web Apps 1 / HTML5
 2009 W3C dropped XHTML2 to focus on HTML5
6
W3C HTML Working Group

             •
             •
             •
             •
             •
100+ Specifications




                                           Geolocation
                                             ECMA
HTML   CSS                Web Apps   SVG
Microsoft Approach with HTML5
HTML5 in IE9
         HTML5                       CSS3                     SVG                       Others

• New Markup Elements      •   2D Transforms       • Shapes                   • ECMA Script 5 (all
• Canvas                                           • Clipping, Masking, and
                           •   Border Radius         Compositing                but Strict Mode)
• Audio
• Video                    •   Box-Shadow          • Transforms               • Native JSON
• Local Storage            •   Fonts (WOFF)        • Extensibility              support (IE8)
• Cross-Window Messaging                           • Gradients
                           •   Media Queries                                  • Performance API
• Text Selection APIs                              • Interactivity
• Parsing SVG in HTML      •   Multiple            • Linking and Views        • Geo-Location
                               Backgrounds         • Painting and Colors      • Data-uri (IE8)
                                                   • Paths
                           •   Namespaces                                     • DOM L2, L3
                                                   • Text
                           •   Opacity                                        • Selectors API L2
                           •   rgba(), hsl(),                                 • AJAX Navigation
                                                                                (IE8)
                               hsla()
                                                                              • DOMParser and
                           •   Selectors (IE8)
                                                                                XMLSerializer
                                                                              • ICC v2 and Color
                                                                                Profile
                                                                              • ARIA
                                       Hardware Acceleration
HTML5 in IE10 Platform Preview 3


        HTML5                   CSS3                 Others

• Application Cache   • 3D Transforms        • Advanced Hit Testing
• Drag&Drop           • Animations             APIs
• File API            • Flexible Box         • Async
• Forms Validation    • Floats               • Media Queries
• History             • Gradient               Listeners
• IndexedDB           • Grid                 • Web Performance
                                               APIs
• Sandbox             • Multi-Column
• Web Sockets         • Region
• Web Workers         • SVG Filter Effects
                      • Text Shadow
                      • Transitions
Demo
Real Life HTML5 Demo
HTML5 Main Feature
Dive Into HTML5
HTML5 Semantics
Semantic Document Structure
 HTML5 introduces a new semantic
  structure
     Replacing the use of DIV, SPAN
                                            HEADER
      and other elements with class and
      ID attributes
 New elements include header, nav,           NAV
  article, section, aside, and footer


                                          ARTICLE
                                                     ASIDE


                                            FOOTER
HTML Tags
   <div id=”header”>

   <div id=”nav”>




   <div
                       <div id=”article”>
   id=”sidebar”>




   <div id=”footer”>
New Semantic HTML Tags
   <header>

   <nav>




              <section>
   <aside>
                 <article>




   <footer>
HTML5 Semantic Tags
Supported in Internet Explorer 9
<body>                                </section>
 <header>                           </article>
  <hgroup>                          ...
   <h1>Doris Chen Dancing</h1>      </section>
   <h2>Funky Town!</h2>
  </hgroup>                          <aside>Aside items (i.e.
 </header>                         links)</aside>

 <nav>                              <figure>
 <ul>Navigation links</ul>           <img src="..." />
 </nav>                              <figcaption>Doris
                                   dancing</figcaption>
 <section>                          </figure>
 <article>
  <header>                          <footer>Copyright © 2011</footer>
    <h1>Can you believe it?</h1>
  </header>                        </body>
  <section>
  <mark>Doris dancing!</mark>
CSS3
 IE9
     2D Transforms
     Border Radius
     Box-Shadow
     Fonts (WOFF)
     Media Queries
     Multiple Backgrounds
     Namespaces
     Opacity
     rgba(), hsl(), hsla()
     Selectors (IE8)
 IE10 Platform Preview
     Grid
     Flexbox
     Gradient
     Multi-Column
     Floats
Demo
CSS3
HTML5 Video & Audio
 <audio     <video
 src=       src=       The url to the audio or video
            width=     The width of the video element
            height=    The height of the video element
            poster=    The url to the thumbnail of the video
 preload=   preload=   (none, metadata, auto) Start downloading
 autoplay   autoplay   Audio or video should play immediately
 loop       loop       Audio or video should return to start and play
 controls   controls   Will show controls (play, pause, scrub bar)
 >          >
 …          …
 </audio>   </video>
Compatibility Table
 HTML5 Audio




                                 10.0.648.24
vCurrent    9+    6+    5.0.4+                 11.01+
                                      +


MP3 audio
            Yes   No     Yes        Yes        No (*)
support

WAV PCM
audio       No    Yes    Yes        Yes         Yes
support

AAC audio
            Yes   No     Yes        Yes        No (*)
format
Compatibility Table
HTML5 <video>




                                      10.0.648.24
vCurrent      9+     6+      5.0.4+                 11.01+
                                           +


VP8
(WebM)
                     Yes     No (*)      Yes         Yes
video
support
              Yes

H.264 video
                    No (*)    Yes       Yes (*)     No (*)
format
Demo

• Let’s have some fun with Video
Introduction to SVG
SVG basics
Scalable Vector Graphics
 Scalable Vector Graphic
    To draw 2D vector graphics using XML
    “retained mode” : the objects tree is kept in memory
 Full DOM support
    Access to the SVG elements through the DOM
 SVG elements can be styled with CSS & can be
  decorated with ARIA
 Included in HTML5 spec
    Native support in IE9 and other modern browsers
 Can be used from an external .svg file or in-line in
  the document
HTML5 <svg>
Let’s see a very simple example


 <svg width="400" height="200"
 xmlns="http://www.w3.org/2000/svg">
    <rect fill="red" x="20" y="20" width="100"
 height="75" />
    <rect fill="blue" x="50" y="50" width="100"
 height="75" />
 </svg>
SVG basics            SVG Feature

                       SVG 1.1 2nd Edition
                                                 IE9



SVG 1.1 2nd Edition   Document Structure
                                  in IE9
                                                 

in IE9                Basic Shapes               

                      Paths                      

                      Text                       

                      Transforms                 

                      Painting, Filling, Color   

                      Scripting                  

                      Styling                    

                      Gradients and Patterns     

                      Clipping and Masking       

                      Markers and Symbols        

                      Filter Effects

                      Declarative Animation

                      SVG Fonts
Demo
SVG Basics
The element, some styling & interactivity
Introduction to Canvas
Canvas basics
 Dynamic bitmap with JS
 Allow drawing into a bitmap area
    See it as a dynamic PNG ;-)
 JavaScript APIs & drawing primitives
    Rectangles, lines, fills, arcs, Bezier curves, etc.
 Immediate mode : « Fire and Forget »
    It does not remember what you drew last.
    It’s up to you to maintain your objects tree
 This is a black box : content not visible into the DOM
    Beware of accessibility issues
 Simple API: 45 methods, 21 attributes
Canvas Entire API
HTML5 <canvas>
Let’s see a very simple sample code


  <canvas id="myCanvas" width="200" height="200">
   Your browser doesn’t support Canvas, sorry.
  </canvas>

  <script type="text/javascript">
   var example = document.getElementById("myCanvas");
   var context = example.getContext("2d");
   context.fillStyle = "rgb(255,0,0)";
   context.fillRect(30, 30, 50, 50);
  </script>
Demo
Canvas Basics
The element, interactivity
When to Use What?
High level differences: SVG and Canvas
                Canvas                  SVG

  Abstraction   Pixel based (dynamic    Shape based
                bitmap)
  Elements      Single HTML element     Multiple graphical elements
                                        which become part of the
                                        Document Object Model
                                        (DOM)
  Driver        Modified through Script Modified through Script and
                only                    CSS
  Event Model   User Interaction is     User Interaction is
                granular (x,y)          abstracted (rect, path)


  Performance   Performance is better   Performance is better with
                with smaller surface    smaller number of objects
                and/or larger number of and/or larger surface.
                objects
The last piece to help you choose
Scenarios: Canvas and SVG
Use Case: Visualizing Data

 Maps
    Interactive Data Presentation
    High Speed Data


 <style type="text/css"media="screen">
     path:hover{fill:yellow;}
 </style>



 <canvas style="position:absolute;top:50px;left:50px"
 onclick="addWeather();" id="canvasGraph"height="500px"width="800px"/>

 for (var i= 0; i < weatherPatterns.length;i++) {
   weatherPatterns[i].x += Math.floor(Math.random() * 3)-1;
   weatherPatterns[i].y += Math.floor(Math.random() * 3) -1;
   myContext.drawImage(weatherImage[weatherPatterns[i].ImageIndex],
 weatherPatterns[i].x,
 weatherPatterns[i].y);
 }
Dive Into HTML5
HTML5 Tools
Tools to generate SVG
 You won’t be forced to type XML in notepad!

 Microsoft Visio
   Export as SVG

 Adobe Illustrator
    Save as SVG

 Inkspace
    Free Open source
     software
Tools to generate Canvas
You won’t be forced to type every JS primitives neither ;-)
 AI2Canvas plug-in :
  http://visitmix.com/labs/
  ai2canvas/
    export vector and bitmap
     artwork directly to an
     HTML5 canvas
    provides drawing,
     animation and coding
     options such as events so
     that you can build
     interactive, well-designed
     canvas-based web apps.
Tools
  F12 Developer Tools
F12 Developer Tools
Testing from Internet Explorer 9 to 7




     Browser Mode
          Changes the rendering
          engine only

     Great list of PolyFills
          Changes the rendering engine
          and user agent string




PAGE 45
Expression Web Super Preview




PAGE 46
Summary and Resources
Can I Use HTML5 Today?




PAGE 48
Resources
      • Started with HTML5
         • http://bit.ly/hpbwhv
      • Feature-specific demos
         • http://ie.microsoft.com/testdrive/
      • Real-world demos
         • http://www.beautyoftheweb.com/
      • Canvas demo by Community
         • http://www.canvasdemos.com/
      • Session Presentation and Demo
         • http://blogs.msdn.com/dorischen/




PAGE 49
Dive Into HTML5

More Related Content

PDF
Karwin bill zf-db-zend_con-20071009
PDF
All about GWT
PDF
Intro to CSS3
PDF
Python - A Comprehensive Programming Language
PDF
Code for Startup MVP (Ruby on Rails) Session 1
PPTX
NoSql-YesSQL mickey alon
PDF
Wordcamp Thessaloniki 2011 The Nextweb
PDF
CSS3: Ripe and Ready
Karwin bill zf-db-zend_con-20071009
All about GWT
Intro to CSS3
Python - A Comprehensive Programming Language
Code for Startup MVP (Ruby on Rails) Session 1
NoSql-YesSQL mickey alon
Wordcamp Thessaloniki 2011 The Nextweb
CSS3: Ripe and Ready

What's hot (19)

PDF
Word camp nextweb
PDF
Building Real-World Dojo Web Applications
PPTX
KEY
Trendsetting: Web Design and Beyond
PDF
Simply Responsive CSS3
PDF
CORE JAVA & ADVANCE JAVA
PPTX
Colors In CSS3
DOCX
CORE JAVA & ADVANCE JAVA
PDF
Presenter manual web designing (specially for summer interns)
PDF
Professional Frontend Engineering
PDF
Mansoura University CSED & Nozom web development sprint
ODP
Html5
PDF
Developing polyglot applications on Cloud Foundry (#oredev 2012)
PPTX
SeaJUG May 2012 mybatis
PDF
Using Spring with NoSQL databases (SpringOne China 2012)
PPTX
Svcc 2013-css3-and-mobile
PPTX
Hibernate in XPages
PDF
Advanced Site Studio Class, June 18, 2012
PPTX
HTML5 표준 소개
Word camp nextweb
Building Real-World Dojo Web Applications
Trendsetting: Web Design and Beyond
Simply Responsive CSS3
CORE JAVA & ADVANCE JAVA
Colors In CSS3
CORE JAVA & ADVANCE JAVA
Presenter manual web designing (specially for summer interns)
Professional Frontend Engineering
Mansoura University CSED & Nozom web development sprint
Html5
Developing polyglot applications on Cloud Foundry (#oredev 2012)
SeaJUG May 2012 mybatis
Using Spring with NoSQL databases (SpringOne China 2012)
Svcc 2013-css3-and-mobile
Hibernate in XPages
Advanced Site Studio Class, June 18, 2012
HTML5 표준 소개
Ad

Viewers also liked (15)

PDF
Practical HTML5: Using It Today
PDF
Ajax Performance Tuning and Best Practices
PDF
From 0 to Ember
PDF
Develop Netflix Movie Search App using jQuery, OData, JSONP and Netflix Techn...
PDF
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
PDF
Performance Optimization and JavaScript Best Practices
PDF
Create Influence, On Demand
PDF
The Tale of 2 CLIs - Ember-cli and Angular-cli
PPTX
Html5 Fit: Get Rid of Love Handles
PDF
Silicon Valley Code Camp 2016 - MongoDB in production
PPTX
Build Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCross
ODP
ES6 PPT FOR 2016
PPTX
PPTX
PDF
Introduction to Big Data
Practical HTML5: Using It Today
Ajax Performance Tuning and Best Practices
From 0 to Ember
Develop Netflix Movie Search App using jQuery, OData, JSONP and Netflix Techn...
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
Performance Optimization and JavaScript Best Practices
Create Influence, On Demand
The Tale of 2 CLIs - Ember-cli and Angular-cli
Html5 Fit: Get Rid of Love Handles
Silicon Valley Code Camp 2016 - MongoDB in production
Build Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCross
ES6 PPT FOR 2016
Introduction to Big Data
Ad

Similar to Dive Into HTML5 (20)

PDF
Dive into HTML5: SVG and Canvas
KEY
about HTML5
PDF
Change by HTML5
PPTX
HTML5 - A Whirlwind tour
PDF
HTML5 and Beyond
PPTX
Html5 more than just html5 v final
KEY
WHAT IS HTML5? (at CSS Nite Osaka)
PPT
Html5 Whats around the bend
PDF
HTML 5 Development for Windows Phone and Desktop
PDF
WordCamp Thessaloniki2011 The NextWeb
PDF
East of Toronto .NET Usergroup - Put the 5 in HTML
PDF
about:HTML&Firefox
PDF
Echo HTML5
PPTX
HTML5: An Overview
PPTX
Bringing HTML5 alive in SharePoint
PDF
HTML5がIE10/Windows 8にもたらすもの
PDF
HTML5 Intoduction for Web Developers
PDF
Building a Better Web with HTML5 and CSS3
PDF
Repaso rápido a los nuevos estándares web
Dive into HTML5: SVG and Canvas
about HTML5
Change by HTML5
HTML5 - A Whirlwind tour
HTML5 and Beyond
Html5 more than just html5 v final
WHAT IS HTML5? (at CSS Nite Osaka)
Html5 Whats around the bend
HTML 5 Development for Windows Phone and Desktop
WordCamp Thessaloniki2011 The NextWeb
East of Toronto .NET Usergroup - Put the 5 in HTML
about:HTML&Firefox
Echo HTML5
HTML5: An Overview
Bringing HTML5 alive in SharePoint
HTML5がIE10/Windows 8にもたらすもの
HTML5 Intoduction for Web Developers
Building a Better Web with HTML5 and CSS3
Repaso rápido a los nuevos estándares web

More from Doris Chen (19)

PDF
Practical tipsmakemobilefaster oscon2016
PDF
Building Web Sites that Work Everywhere
PDF
Angular mobile angular_u
PDF
Lastest Trends in Web Development
PDF
Angular or Backbone: Go Mobile!
PDF
OSCON Presentation: Developing High Performance Websites and Modern Apps with...
PDF
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
PDF
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
PDF
What Web Developers Need to Know to Develop Native HTML5/JS Apps
PDF
Windows 8 Opportunity
PDF
Wins8 appfoforweb fluent
PDF
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
PDF
What Web Developers Need to Know to Develop Windows 8 Apps
PDF
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
PDF
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
PDF
Introduction to CSS3
PDF
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
PDF
Practical HTML5: Using It Today
PDF
Developing Revolutionary Web Applications using Comet and Ajax Push
Practical tipsmakemobilefaster oscon2016
Building Web Sites that Work Everywhere
Angular mobile angular_u
Lastest Trends in Web Development
Angular or Backbone: Go Mobile!
OSCON Presentation: Developing High Performance Websites and Modern Apps with...
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
What Web Developers Need to Know to Develop Native HTML5/JS Apps
Windows 8 Opportunity
Wins8 appfoforweb fluent
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
What Web Developers Need to Know to Develop Windows 8 Apps
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Introduction to CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Practical HTML5: Using It Today
Developing Revolutionary Web Applications using Comet and Ajax Push

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation theory and applications.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Big Data Technologies - Introduction.pptx
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Approach and Philosophy of On baking technology
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
A comparative analysis of optical character recognition models for extracting...
A Presentation on Artificial Intelligence
Encapsulation theory and applications.pdf
Tartificialntelligence_presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Unlocking AI with Model Context Protocol (MCP)
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
MIND Revenue Release Quarter 2 2025 Press Release
Big Data Technologies - Introduction.pptx
1. Introduction to Computer Programming.pptx
Programs and apps: productivity, graphics, security and other tools
Approach and Philosophy of On baking technology
Accuracy of neural networks in brain wave diagnosis of schizophrenia

Dive Into HTML5

  • 1. Dive into HTML5 Doris Chen Ph.D. Developer Evangelist Microsoft http://blogs.msdn.com/dorischen/ @doristchen
  • 2. Who am I?  Developer Evangelist at Microsoft based in Silicon Valley, CA  Blog: http://blogs.msdn.com/b/dorischen/  Twitter @doristchen  Email: [email protected]  Has over 15 years of experience in the software industry focusing on web technologies  Spoke and published widely at HTML5 Dev, JavaOne, O'Reilly, Silicon Valley Code Camp, SD West, SD Forum and worldwide User Groups meetings  Doris received her Ph.D. from the University of California at Los Angeles (UCLA)
  • 3. Agenda HTML5 Overview HTML5 Main Feature HTML5 Tools Summary and Resources PAGE 3
  • 5. Where did HTML5 Come from?  20 years of evolution: 1990 to 2010 HTML 2 3 3.2 4 4.01 XML XHTML1 1.1 1SE 2 Web Forms 2 Web Apps 1 H HTML5  W3C participate in HTML5 (2006)  Formed working group to work with WHATWG (Web Hypertext Applications Technology Working Group) on HTML5 specification (2007)  HTML4 + XHTML1 evolved into Web Apps 1 / HTML5  2009 W3C dropped XHTML2 to focus on HTML5
  • 6. 6
  • 7. W3C HTML Working Group • • • • •
  • 8. 100+ Specifications Geolocation ECMA HTML CSS Web Apps SVG
  • 10. HTML5 in IE9 HTML5 CSS3 SVG Others • New Markup Elements • 2D Transforms • Shapes • ECMA Script 5 (all • Canvas • Clipping, Masking, and • Border Radius Compositing but Strict Mode) • Audio • Video • Box-Shadow • Transforms • Native JSON • Local Storage • Fonts (WOFF) • Extensibility support (IE8) • Cross-Window Messaging • Gradients • Media Queries • Performance API • Text Selection APIs • Interactivity • Parsing SVG in HTML • Multiple • Linking and Views • Geo-Location Backgrounds • Painting and Colors • Data-uri (IE8) • Paths • Namespaces • DOM L2, L3 • Text • Opacity • Selectors API L2 • rgba(), hsl(), • AJAX Navigation (IE8) hsla() • DOMParser and • Selectors (IE8) XMLSerializer • ICC v2 and Color Profile • ARIA Hardware Acceleration
  • 11. HTML5 in IE10 Platform Preview 3 HTML5 CSS3 Others • Application Cache • 3D Transforms • Advanced Hit Testing • Drag&Drop • Animations APIs • File API • Flexible Box • Async • Forms Validation • Floats • Media Queries • History • Gradient Listeners • IndexedDB • Grid • Web Performance APIs • Sandbox • Multi-Column • Web Sockets • Region • Web Workers • SVG Filter Effects • Text Shadow • Transitions
  • 15. HTML5 Semantics Semantic Document Structure  HTML5 introduces a new semantic structure  Replacing the use of DIV, SPAN HEADER and other elements with class and ID attributes  New elements include header, nav, NAV article, section, aside, and footer ARTICLE ASIDE FOOTER
  • 16. HTML Tags <div id=”header”> <div id=”nav”> <div <div id=”article”> id=”sidebar”> <div id=”footer”>
  • 17. New Semantic HTML Tags <header> <nav> <section> <aside> <article> <footer>
  • 18. HTML5 Semantic Tags Supported in Internet Explorer 9 <body> </section> <header> </article> <hgroup> ... <h1>Doris Chen Dancing</h1> </section> <h2>Funky Town!</h2> </hgroup> <aside>Aside items (i.e. </header> links)</aside> <nav> <figure> <ul>Navigation links</ul> <img src="..." /> </nav> <figcaption>Doris dancing</figcaption> <section> </figure> <article> <header> <footer>Copyright © 2011</footer> <h1>Can you believe it?</h1> </header> </body> <section> <mark>Doris dancing!</mark>
  • 19. CSS3  IE9  2D Transforms  Border Radius  Box-Shadow  Fonts (WOFF)  Media Queries  Multiple Backgrounds  Namespaces  Opacity  rgba(), hsl(), hsla()  Selectors (IE8)  IE10 Platform Preview  Grid  Flexbox  Gradient  Multi-Column  Floats
  • 21. HTML5 Video & Audio <audio <video src= src= The url to the audio or video width= The width of the video element height= The height of the video element poster= The url to the thumbnail of the video preload= preload= (none, metadata, auto) Start downloading autoplay autoplay Audio or video should play immediately loop loop Audio or video should return to start and play controls controls Will show controls (play, pause, scrub bar) > > … … </audio> </video>
  • 22. Compatibility Table HTML5 Audio 10.0.648.24 vCurrent 9+ 6+ 5.0.4+ 11.01+ + MP3 audio Yes No Yes Yes No (*) support WAV PCM audio No Yes Yes Yes Yes support AAC audio Yes No Yes Yes No (*) format
  • 23. Compatibility Table HTML5 <video> 10.0.648.24 vCurrent 9+ 6+ 5.0.4+ 11.01+ + VP8 (WebM) Yes No (*) Yes Yes video support Yes H.264 video No (*) Yes Yes (*) No (*) format
  • 24. Demo • Let’s have some fun with Video
  • 26. SVG basics Scalable Vector Graphics  Scalable Vector Graphic  To draw 2D vector graphics using XML  “retained mode” : the objects tree is kept in memory  Full DOM support  Access to the SVG elements through the DOM  SVG elements can be styled with CSS & can be decorated with ARIA  Included in HTML5 spec  Native support in IE9 and other modern browsers  Can be used from an external .svg file or in-line in the document
  • 27. HTML5 <svg> Let’s see a very simple example <svg width="400" height="200" xmlns="http://www.w3.org/2000/svg"> <rect fill="red" x="20" y="20" width="100" height="75" /> <rect fill="blue" x="50" y="50" width="100" height="75" /> </svg>
  • 28. SVG basics SVG Feature SVG 1.1 2nd Edition IE9 SVG 1.1 2nd Edition Document Structure in IE9  in IE9 Basic Shapes  Paths  Text  Transforms  Painting, Filling, Color  Scripting  Styling  Gradients and Patterns  Clipping and Masking  Markers and Symbols  Filter Effects Declarative Animation SVG Fonts
  • 29. Demo SVG Basics The element, some styling & interactivity
  • 31. Canvas basics Dynamic bitmap with JS  Allow drawing into a bitmap area  See it as a dynamic PNG ;-)  JavaScript APIs & drawing primitives  Rectangles, lines, fills, arcs, Bezier curves, etc.  Immediate mode : « Fire and Forget »  It does not remember what you drew last.  It’s up to you to maintain your objects tree  This is a black box : content not visible into the DOM  Beware of accessibility issues  Simple API: 45 methods, 21 attributes
  • 33. HTML5 <canvas> Let’s see a very simple sample code <canvas id="myCanvas" width="200" height="200"> Your browser doesn’t support Canvas, sorry. </canvas> <script type="text/javascript"> var example = document.getElementById("myCanvas"); var context = example.getContext("2d"); context.fillStyle = "rgb(255,0,0)"; context.fillRect(30, 30, 50, 50); </script>
  • 35. When to Use What?
  • 36. High level differences: SVG and Canvas Canvas SVG Abstraction Pixel based (dynamic Shape based bitmap) Elements Single HTML element Multiple graphical elements which become part of the Document Object Model (DOM) Driver Modified through Script Modified through Script and only CSS Event Model User Interaction is User Interaction is granular (x,y) abstracted (rect, path) Performance Performance is better Performance is better with with smaller surface smaller number of objects and/or larger number of and/or larger surface. objects
  • 37. The last piece to help you choose
  • 39. Use Case: Visualizing Data  Maps  Interactive Data Presentation  High Speed Data <style type="text/css"media="screen"> path:hover{fill:yellow;} </style> <canvas style="position:absolute;top:50px;left:50px" onclick="addWeather();" id="canvasGraph"height="500px"width="800px"/> for (var i= 0; i < weatherPatterns.length;i++) { weatherPatterns[i].x += Math.floor(Math.random() * 3)-1; weatherPatterns[i].y += Math.floor(Math.random() * 3) -1; myContext.drawImage(weatherImage[weatherPatterns[i].ImageIndex], weatherPatterns[i].x, weatherPatterns[i].y); }
  • 42. Tools to generate SVG You won’t be forced to type XML in notepad!  Microsoft Visio  Export as SVG  Adobe Illustrator  Save as SVG  Inkspace  Free Open source software
  • 43. Tools to generate Canvas You won’t be forced to type every JS primitives neither ;-)  AI2Canvas plug-in : http://visitmix.com/labs/ ai2canvas/  export vector and bitmap artwork directly to an HTML5 canvas  provides drawing, animation and coding options such as events so that you can build interactive, well-designed canvas-based web apps.
  • 44. Tools F12 Developer Tools
  • 45. F12 Developer Tools Testing from Internet Explorer 9 to 7 Browser Mode Changes the rendering engine only Great list of PolyFills Changes the rendering engine and user agent string PAGE 45
  • 46. Expression Web Super Preview PAGE 46
  • 48. Can I Use HTML5 Today? PAGE 48
  • 49. Resources • Started with HTML5 • http://bit.ly/hpbwhv • Feature-specific demos • http://ie.microsoft.com/testdrive/ • Real-world demos • http://www.beautyoftheweb.com/ • Canvas demo by Community • http://www.canvasdemos.com/ • Session Presentation and Demo • http://blogs.msdn.com/dorischen/ PAGE 49