SlideShare a Scribd company logo
1 of 101
Download to read offline
<HTML 5>
 & microformats
 for pragmatists


Wojtek Zajac       Kraków, 29.04.2010 r.
H!
    I’m Wojtek Zając. Some facts about me:
•   Since 2006 working for XHTMLized.com
    (earlier: freelance)

•   specialities:
    • web accessibility
    • high performance optimization
•   worked for:
    • Twitter
    • FOX
    • Threadless
    • O’Reilly
•   also… User Experience Designer, PlatformaKiwi.pl (startup)



                           wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
·A                           ·




                            }
•   Introduction                                                 M
•   New elements / attributes                                •   XFN

•   Web Forms 2.0                                            •   hCard
                                                             •   Use cases:
•   Accessibility (WAI-ARIA)
                                                                 •   adr
•   Graphics (SVG/Canvas)
                                                                 •   hCard
•   Multimedia (Video/Audio)                                     •   hCalendar

•   Geolocation
•   Web Workers



                   wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
R
                                                 .
                      T            I                 W



http://www.flickr.com/photos/sprengben/4315145017/
                           wojtek zajac • @theanxy   • wojtekzajac.com
Tim Berners-Lee
                   DIRECTOR, WORLD WIDE WEB CONSORTIUM


                      “The attempt to get the world
                   to switch to XML, including quotes
                   around attribute values and slashes
                     in empty tags and namespaces
                         all at once didn’t work.”




wojtek zajac   •    @theanxy   •   wojtekzajac.com
·O                  !DOCTYPE ·


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

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">




              wojtek zajac   •   @theanxy   •   wojtekzajac.com
·N                  !DOCTYPE ·

                Optional for
                                 XHTML 5


<!DOCTYPE html>
<html lang=“pl”>
   <head>
       <meta charset="utf-8">




              wojtek zajac   •   @theanxy   •   wojtekzajac.com
DIV ID=“header”


                    DIV ID=“nav”

 DIV CLASS=“article”



                                        DIV ID=“sidebar”
DIV CLASS=“section”




                   DIV ID=“footer”




wojtek zajac   •    @theanxy   •     wojtekzajac.com
<header>


                      <nav>

       <article>



                                            <aside>
      <section>




                     <footer>




wojtek zajac   •   @theanxy     •   wojtekzajac.com
<header>


                      <nav>

       <article>



                                            <aside>
      <section>




                     <footer>




wojtek zajac   •   @theanxy     •   wojtekzajac.com
New structural elements


                                                       <header>
• header
• nav                                                   <nav>


• section                                  <article>


• article                                                         <aside>
• aside                                   <section>


• footer
                                                       <footer>




       wojtek zajac   •   @theanxy   •   wojtekzajac.com
Even more elements


•   hgroup                                   This album got
                                             <meter value="5.2"
•   details                                         min="0.0"
                                                    max="10.0"
•   summary                                         low="5.0"
                                                    high="7.5"
•   mark                                            optimum="9.0">

•   time                                              7.4
                                             </meter> points in review.
•   output
                                             You’re <progress value="48"
•   meter                                    max="91"> halfway through

•   progress                                 reading this article.




               wojtek zajac   •   @theanxy    •   wojtekzajac.com
Changes


•   Links can contain block elements
•   <b>, <i>, <small> with changed semantics             <a href=”#” class=”story”>
                                                            <img src=”img.png” />
•   <address> issues
                                                            <h4>Title</h4>

•   <ol>   attributes: start, reversed                      <p>Text description</p>
                                                         </a>
•   contenteditable

•   data-*




                       wojtek zajac   •   @theanxy   •    wojtekzajac.com
Web Forms 2.0
much better than Your Old HTML 4.01 Forms




        wojtek zajac   •   @theanxy   •   wojtekzajac.com
Placeholder text




<form>
  <input name="q" placeholder="Search Bookmarks and History">
  <input type="submit" value="Search">
</form>




       wojtek zajac   •   @theanxy   •   wojtekzajac.com
E-mail address


<form>
  <input type="email">
  <input type="submit" value="Go">
</form>




           wojtek zajac   •   @theanxy   •   wojtekzajac.com
Number input


<form>
  <input type="number">
  <input type="submit" value="Go">
</form>




           wojtek zajac   •   @theanxy   •   wojtekzajac.com
Web address


<form>
  <input type="url">
  <input type="submit" value="Go">
</form>




           wojtek zajac   •   @theanxy   •   wojtekzajac.com
Range




<form>
  <input type="range" min=“1” max=“11” value=“9”>
  <input type="submit" value="Go">
</form>




     wojtek zajac   •   @theanxy   •   wojtekzajac.com
Date, time

<input type=”date”>                                  O nly:
<input type=”month”>
<input type=”week”>
<input type=”time”>
<input type=”datetime”>




                wojtek zajac   •   @theanxy   •   wojtekzajac.com
Search



                                       Plays nic
                                                 e   with WA
                                                            I-ARIA

 <input type="search" role=”search”>




wojtek zajac   •   @theanxy   •   wojtekzajac.com
WAI-ARIA
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
WAI-ARIA Landmark Roles

    Landmark                              HTML 5 element
  role=”application”                              none
    role=”banner”                                 none
 role=”complementary”                           <aside>
  role=”contentinfo”                            <footer>
     role=”main”                                  none
   role=”navigation”                             <nav>
     role=”search”                                none

                       ~ The Paciello Group

        wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
role=”banner”
                                   role=”search”




                                 role=”main”




    role=”main”                           role=”complementary”




    role=”contentinfo”

wojtek zajac      •   @theanxy     •   wojtekzajac.com
SVG/C
Scalable Vector Graphics (SVG)



<rect

   x=”0” y=”0”

   width=”100” height=”100”

   fill=”blue” stroke=”red”

   stroke-width=”5px”

   rx=”8” ry=”8”

   id=”myRect” class=”chart” />




                   wojtek zajac   •   @theanxy   •   wojtekzajac.com
Scalable Vector Graphics (SVG)
<!DOCTYPE html>

<html>

<body>

<svg width=”200” height=”200”>

   <rect

         x=”0” y=”0”

         width=”100” height=”100”

         fill=”blue” stroke=”red”

         stroke-width=”5px”

         rx=”8” ry=”8”

         id=”myRect” class=”chart” />

   </svg>

</body>

</html>




                         wojtek zajac   •   @theanxy   •   wojtekzajac.com
Scalable Vector Graphics (SVG)


var rect = $(‘#myRect’);

rect.style.fill = ‘green’;

rect.onclick(funtion(){

      alert(‘Witaj świecie!’);

});




                        wojtek zajac   •   @theanxy   •   wojtekzajac.com
Canvas API

<canvas id=”canvas” width=”150” height=”150”></canvas>



var canvas = document.getElementById(“canvas”);

if (canvas.getContext) {

    var ctx = canvas.getContext(“2d”);



    ctx.fillStyle = “rgb(200,0,0)”;

    ctx.fillRect (10, 10, 55, 50);



    ctx.fillStyle = “rgba(0, 0 200, 0.5)”;

    ctx.fillRect (30, 30, 55, 50);

}




                      wojtek zajac       •   @theanxy    •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
http://code.google.com/p/quake2-gwt-port/

wojtek zajac   •   @theanxy   •   wojtekzajac.com
V   /A
http://www.flickr.com/photos/sugu/145087521/
S
                                            youtube.com


<object width="640" height="385">

  <param name="movie" value="http://www.youtube.com/v/km2UpEcSUGY&hl=en_US&fs=1&"></param>

  <param name="allowFullScreen" value="true"></param>

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

  <embed src="http://www.youtube.com/v/km2UpEcSUGY&hl=en_US&fs=1&"

            type="application/x-shockwave-flash" width="640" height="385">

  </embed>

</object>




                           wojtek zajac     •   @theanxy      •   wojtekzajac.com
N                                   /

  <video src=video.mp4                                         controls
         width=300
         height=400                                            autobuffer
         poster=poster.jpg>
                                                               loop
     alternative content
  </video>                                                     autoplay




Opera, Chrome, Firefox:   Ogg Theora                     <audio src=audio.mp3>
                                                             alternative content
Safari, Chrome:           H.264                          </audio>




                  wojtek zajac   •   @theanxy   •   wojtekzajac.com
http://media.chikuyonok.ru/ambilight/

wojtek zajac   •   @theanxy   •   wojtekzajac.com
P




~ Thomas Fuchs, http://ajaxian.com/archives/i-cant-believe-its-not-flash

            wojtek zajac   •   @theanxy   •   wojtekzajac.com
P
                                                        100%
                                                        90%
                                                        80%
                                                        70%




                                                                Zużycie procesora
                                                       60%
                                                       50%
                                                       40%
                                                       30%
                                                       20%
                                                       10%
                 Flash                                 0%
                                  HTML 5


~ Thomas Fuchs, http://ajaxian.com/archives/i-cant-believe-its-not-flash

            wojtek zajac   •   @theanxy   •   wojtekzajac.com
G
❶




wojtek zajac   •   @theanxy   •   wojtekzajac.com
❶




    wojtek zajac   •   @theanxy   •   wojtekzajac.com
❶                                     ❷




    wojtek zajac   •   @theanxy   •   wojtekzajac.com
❶                                     ❷




    wojtek zajac   •   @theanxy   •   wojtekzajac.com
Pretty pr
                                               ecise.
❶                                      ❷




    wojtek zajac   •   @theanxy   •    wojtekzajac.com
G
                      current location


function get_location() {
  if (Modernizr.geolocation) {
    navigator.geolocation.getCurrentPosition(show_map);
  } else {
    // not supported
  }
}




              wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
W
W
•   JS threading
               •   interface is not blocked
               •   http://html5demos.com/worker




wojtek zajac   •   @theanxy   •   wojtekzajac.com
When can I use HTML 5?


•   HTML 5 shiv

         <!--[if lt IE 9]>
         <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></
         script>
         <![endif]-->



                     http://code.google.com/p/html5shiv/




•   Modernizr
                     http://modernizr.com/




                wojtek zajac     •   @theanxy      •   wojtekzajac.com
When can I use HTML 5?


•   HTML 5 shiv

         <!--[if lt IE 9]>
         <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></
         script>
         <![endif]-->



                     http://code.google.com/p/html5shiv/




•   Modernizr
                     http://modernizr.com/




                wojtek zajac     •   @theanxy      •   wojtekzajac.com
U                        R

       A List Apart   http://www.alistapart.com/articles/previewo tml5

        W3C spec      http://dev.w3.org/html5/spec/Overview.html

HTML 5 differences     http://www.w3.org/TR/html5-diff/

  Dive into HTML 5    http://diveintohtml5.org

   HTML 5 Doctor      http://html5doctor.com

 HTML 5 Readiness     http://html5readiness.com/




           wojtek zajac   •   @theanxy   •   wojtekzajac.com
M
wojtek zajac   •   @theanxy   •   wojtekzajac.com
Microformats
                                    http://microformats.org/about


               “Designed for humans first and
               machines second, microformats
                are a set of simple, open data
               formats built upon existing and
                 widely adopted standards.”




wojtek zajac   •   @theanxy   •   wojtekzajac.com
Social Graph API
     http://code.google.com/apis/socialgraph/




  wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
<a href=“http://facebook.com/jkowalski”>My profile</a>



    wojtek zajac   •   @theanxy   •   wojtekzajac.com
<a href=“http://facebook.com/jkowalski”>My profile</a>



    wojtek zajac   •   @theanxy   •   wojtekzajac.com
Indentity consolidation




<a href=“http://facebook.com/jkowalski” rel=“me”>My profile</a>


        wojtek zajac   •   @theanxy   •   wojtekzajac.com
Indentity consolidation




<a href=“http://facebook.com/jkowalski” rel=“me”>My profile</a>


        wojtek zajac   •   @theanxy   •   wojtekzajac.com
XFN:
                                       XHTML friends network




<a href=“http://joe.com/” rel=“friend”>Joe’s website</a>



     wojtek zajac   •   @theanxy   •   wojtekzajac.com
XFN:
                                       XHTML friends network




              Relation?




<a href=“http://joe.com/” rel=“friend”>Joe’s website</a>



     wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
· hCard ·


                          http://wojtekzajac.com/">
                           Wojtek
                            Zajac




wojtek zajac   •   @theanxy   •   wojtekzajac.com
· hCard ·


<div                   >
   <a                           href="http://wojtekzajac.com/">
     <span                            >Wojtek</span>
     <span                             >Zajac</span>
   </a>
</div>




             wojtek zajac   •   @theanxy   •   wojtekzajac.com
· hCard ·


<div class=“vcard”>
   <a class=“fn n url” href="http://wojtekzajac.com/">
     <span class=“given-name”>Wojtek</span>
     <span class=“family-name”>Zajac</span>
   </a>
</div>




          wojtek zajac   •   @theanxy   •   wojtekzajac.com
❶   wojtek zajac
                   Use case:
Extracting physical address
      from a website



                   •   @theanxy   •   wojtekzajac.com
wojtek zajac • @theanxy • wojtekzajac.com
 wojtek zajac •          • wojtekzajac.com
wojtek zajac • @theanxy • wojtekzajac.com
 wojtek zajac •          • wojtekzajac.com
wojtek zajac • @theanxy • wojtekzajac.com
 wojtek zajac •          • wojtekzajac.com
❷  wojtek zajac
                  Use case:
Exporting business cards
  to the address book



                  •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
❸
wojtek zajac
               Use case:
      Adding event
     to the calendar



               •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
wojtek zajac   •   @theanxy   •   wojtekzajac.com
Specifications
            hCalendar          events information
                  hCard        contact information
            rel-license        specifying the license
          rel-nofollow         blocking link–crawling
                 rel-tag       marking up tags


                                 Drafts
hAtom: syndicated content               rel-enclosure
hAudio: audio files                      rel-home
hListing: listings / classifieds         rel-payment
hRecipe: recipes
hResume: resumes
hReview: reviews


         wojtek zajac      •     @theanxy   •   wojtekzajac.com
U                         R

Microformats.org official wiki     http://microformats.org/wiki/Main_Page

           hCard generator       http://microformats.org/code/hcard/creator

        hCalendar generator      http://microformats.org/code/hcalendar/creator

       Optimus transformer       http://microformatique.com/optimus/

   Operator (Firefox plugin)     https://addons.mozilla.org/en-US/firefox/addon/4106

           Social Graph API      http://codebits.eu/intra/s/session/79




                  wojtek zajac   •   @theanxy    •   wojtekzajac.com
Thanks!
                            Questions?



http://www.slideshare.net/wojciechzajac

Wojtek Zając
wojtek@wojtekzajac.com                      This work is licensed
                                             under a Creative

@theanxy                                  Commons Attribution 3.0
                                             Unported License

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

HTML5 and microformats for pragmatists

  • 1. <HTML 5> & microformats for pragmatists Wojtek Zajac Kraków, 29.04.2010 r.
  • 2. H! I’m Wojtek Zając. Some facts about me: • Since 2006 working for XHTMLized.com (earlier: freelance) • specialities: • web accessibility • high performance optimization • worked for: • Twitter • FOX • Threadless • O’Reilly • also… User Experience Designer, PlatformaKiwi.pl (startup) wojtek zajac • @theanxy • wojtekzajac.com
  • 3. wojtek zajac • @theanxy • wojtekzajac.com
  • 4. ·A · } • Introduction M • New elements / attributes • XFN • Web Forms 2.0 • hCard • Use cases: • Accessibility (WAI-ARIA) • adr • Graphics (SVG/Canvas) • hCard • Multimedia (Video/Audio) • hCalendar • Geolocation • Web Workers wojtek zajac • @theanxy • wojtekzajac.com
  • 5. wojtek zajac • @theanxy • wojtekzajac.com
  • 6. wojtek zajac • @theanxy • wojtekzajac.com
  • 7. wojtek zajac • @theanxy • wojtekzajac.com
  • 8. wojtek zajac • @theanxy • wojtekzajac.com
  • 9. R . T I W http://www.flickr.com/photos/sprengben/4315145017/ wojtek zajac • @theanxy • wojtekzajac.com
  • 10. Tim Berners-Lee DIRECTOR, WORLD WIDE WEB CONSORTIUM “The attempt to get the world to switch to XML, including quotes around attribute values and slashes in empty tags and namespaces all at once didn’t work.” wojtek zajac • @theanxy • wojtekzajac.com
  • 11. ·O !DOCTYPE · <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> wojtek zajac • @theanxy • wojtekzajac.com
  • 12. ·N !DOCTYPE · Optional for XHTML 5 <!DOCTYPE html> <html lang=“pl”> <head> <meta charset="utf-8"> wojtek zajac • @theanxy • wojtekzajac.com
  • 13.
  • 14.
  • 15. DIV ID=“header” DIV ID=“nav” DIV CLASS=“article” DIV ID=“sidebar” DIV CLASS=“section” DIV ID=“footer” wojtek zajac • @theanxy • wojtekzajac.com
  • 16. <header> <nav> <article> <aside> <section> <footer> wojtek zajac • @theanxy • wojtekzajac.com
  • 17. <header> <nav> <article> <aside> <section> <footer> wojtek zajac • @theanxy • wojtekzajac.com
  • 18. New structural elements <header> • header • nav <nav> • section <article> • article <aside> • aside <section> • footer <footer> wojtek zajac • @theanxy • wojtekzajac.com
  • 19. Even more elements • hgroup This album got <meter value="5.2" • details min="0.0" max="10.0" • summary low="5.0" high="7.5" • mark optimum="9.0"> • time 7.4 </meter> points in review. • output You’re <progress value="48" • meter max="91"> halfway through • progress reading this article. wojtek zajac • @theanxy • wojtekzajac.com
  • 20. Changes • Links can contain block elements • <b>, <i>, <small> with changed semantics <a href=”#” class=”story”> <img src=”img.png” /> • <address> issues <h4>Title</h4> • <ol> attributes: start, reversed <p>Text description</p> </a> • contenteditable • data-* wojtek zajac • @theanxy • wojtekzajac.com
  • 21. Web Forms 2.0 much better than Your Old HTML 4.01 Forms wojtek zajac • @theanxy • wojtekzajac.com
  • 22. Placeholder text <form> <input name="q" placeholder="Search Bookmarks and History"> <input type="submit" value="Search"> </form> wojtek zajac • @theanxy • wojtekzajac.com
  • 23. E-mail address <form> <input type="email"> <input type="submit" value="Go"> </form> wojtek zajac • @theanxy • wojtekzajac.com
  • 24. Number input <form> <input type="number"> <input type="submit" value="Go"> </form> wojtek zajac • @theanxy • wojtekzajac.com
  • 25. Web address <form> <input type="url"> <input type="submit" value="Go"> </form> wojtek zajac • @theanxy • wojtekzajac.com
  • 26. Range <form> <input type="range" min=“1” max=“11” value=“9”> <input type="submit" value="Go"> </form> wojtek zajac • @theanxy • wojtekzajac.com
  • 27. Date, time <input type=”date”> O nly: <input type=”month”> <input type=”week”> <input type=”time”> <input type=”datetime”> wojtek zajac • @theanxy • wojtekzajac.com
  • 28. Search Plays nic e with WA I-ARIA <input type="search" role=”search”> wojtek zajac • @theanxy • wojtekzajac.com
  • 30.
  • 31. wojtek zajac • @theanxy • wojtekzajac.com
  • 32. wojtek zajac • @theanxy • wojtekzajac.com
  • 33. WAI-ARIA Landmark Roles Landmark HTML 5 element role=”application” none role=”banner” none role=”complementary” <aside> role=”contentinfo” <footer> role=”main” none role=”navigation” <nav> role=”search” none ~ The Paciello Group wojtek zajac • @theanxy • wojtekzajac.com
  • 34. wojtek zajac • @theanxy • wojtekzajac.com
  • 35. role=”banner” role=”search” role=”main” role=”main” role=”complementary” role=”contentinfo” wojtek zajac • @theanxy • wojtekzajac.com
  • 36. SVG/C
  • 37. Scalable Vector Graphics (SVG) <rect x=”0” y=”0” width=”100” height=”100” fill=”blue” stroke=”red” stroke-width=”5px” rx=”8” ry=”8” id=”myRect” class=”chart” /> wojtek zajac • @theanxy • wojtekzajac.com
  • 38. Scalable Vector Graphics (SVG) <!DOCTYPE html> <html> <body> <svg width=”200” height=”200”> <rect x=”0” y=”0” width=”100” height=”100” fill=”blue” stroke=”red” stroke-width=”5px” rx=”8” ry=”8” id=”myRect” class=”chart” /> </svg> </body> </html> wojtek zajac • @theanxy • wojtekzajac.com
  • 39. Scalable Vector Graphics (SVG) var rect = $(‘#myRect’); rect.style.fill = ‘green’; rect.onclick(funtion(){ alert(‘Witaj świecie!’); }); wojtek zajac • @theanxy • wojtekzajac.com
  • 40. Canvas API <canvas id=”canvas” width=”150” height=”150”></canvas> var canvas = document.getElementById(“canvas”); if (canvas.getContext) { var ctx = canvas.getContext(“2d”); ctx.fillStyle = “rgb(200,0,0)”; ctx.fillRect (10, 10, 55, 50); ctx.fillStyle = “rgba(0, 0 200, 0.5)”; ctx.fillRect (30, 30, 55, 50); } wojtek zajac • @theanxy • wojtekzajac.com
  • 41. wojtek zajac • @theanxy • wojtekzajac.com
  • 42. wojtek zajac • @theanxy • wojtekzajac.com
  • 43. http://code.google.com/p/quake2-gwt-port/ wojtek zajac • @theanxy • wojtekzajac.com
  • 44. V /A http://www.flickr.com/photos/sugu/145087521/
  • 45. S youtube.com <object width="640" height="385"> <param name="movie" value="http://www.youtube.com/v/km2UpEcSUGY&hl=en_US&fs=1&"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed src="http://www.youtube.com/v/km2UpEcSUGY&hl=en_US&fs=1&" type="application/x-shockwave-flash" width="640" height="385"> </embed> </object> wojtek zajac • @theanxy • wojtekzajac.com
  • 46.
  • 47. N / <video src=video.mp4 controls width=300 height=400 autobuffer poster=poster.jpg> loop alternative content </video> autoplay Opera, Chrome, Firefox: Ogg Theora <audio src=audio.mp3> alternative content Safari, Chrome: H.264 </audio> wojtek zajac • @theanxy • wojtekzajac.com
  • 48. http://media.chikuyonok.ru/ambilight/ wojtek zajac • @theanxy • wojtekzajac.com
  • 49. P ~ Thomas Fuchs, http://ajaxian.com/archives/i-cant-believe-its-not-flash wojtek zajac • @theanxy • wojtekzajac.com
  • 50. P 100% 90% 80% 70% Zużycie procesora 60% 50% 40% 30% 20% 10% Flash 0% HTML 5 ~ Thomas Fuchs, http://ajaxian.com/archives/i-cant-believe-its-not-flash wojtek zajac • @theanxy • wojtekzajac.com
  • 51. G
  • 52. ❶ wojtek zajac • @theanxy • wojtekzajac.com
  • 53. wojtek zajac • @theanxy • wojtekzajac.com
  • 54. ❷ wojtek zajac • @theanxy • wojtekzajac.com
  • 55. ❷ wojtek zajac • @theanxy • wojtekzajac.com
  • 56. Pretty pr ecise. ❶ ❷ wojtek zajac • @theanxy • wojtekzajac.com
  • 57. G current location function get_location() { if (Modernizr.geolocation) { navigator.geolocation.getCurrentPosition(show_map); } else { // not supported } } wojtek zajac • @theanxy • wojtekzajac.com
  • 58. wojtek zajac • @theanxy • wojtekzajac.com
  • 59. W W
  • 60. JS threading • interface is not blocked • http://html5demos.com/worker wojtek zajac • @theanxy • wojtekzajac.com
  • 61. When can I use HTML 5? • HTML 5 shiv <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></ script> <![endif]--> http://code.google.com/p/html5shiv/ • Modernizr http://modernizr.com/ wojtek zajac • @theanxy • wojtekzajac.com
  • 62. When can I use HTML 5? • HTML 5 shiv <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></ script> <![endif]--> http://code.google.com/p/html5shiv/ • Modernizr http://modernizr.com/ wojtek zajac • @theanxy • wojtekzajac.com
  • 63. U R A List Apart http://www.alistapart.com/articles/previewo tml5 W3C spec http://dev.w3.org/html5/spec/Overview.html HTML 5 differences http://www.w3.org/TR/html5-diff/ Dive into HTML 5 http://diveintohtml5.org HTML 5 Doctor http://html5doctor.com HTML 5 Readiness http://html5readiness.com/ wojtek zajac • @theanxy • wojtekzajac.com
  • 64. M
  • 65. wojtek zajac • @theanxy • wojtekzajac.com
  • 66. Microformats http://microformats.org/about “Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards.” wojtek zajac • @theanxy • wojtekzajac.com
  • 67. Social Graph API http://code.google.com/apis/socialgraph/ wojtek zajac • @theanxy • wojtekzajac.com
  • 68. wojtek zajac • @theanxy • wojtekzajac.com
  • 69. <a href=“http://facebook.com/jkowalski”>My profile</a> wojtek zajac • @theanxy • wojtekzajac.com
  • 70. <a href=“http://facebook.com/jkowalski”>My profile</a> wojtek zajac • @theanxy • wojtekzajac.com
  • 71. Indentity consolidation <a href=“http://facebook.com/jkowalski” rel=“me”>My profile</a> wojtek zajac • @theanxy • wojtekzajac.com
  • 72. Indentity consolidation <a href=“http://facebook.com/jkowalski” rel=“me”>My profile</a> wojtek zajac • @theanxy • wojtekzajac.com
  • 73. XFN: XHTML friends network <a href=“http://joe.com/” rel=“friend”>Joe’s website</a> wojtek zajac • @theanxy • wojtekzajac.com
  • 74. XFN: XHTML friends network Relation? <a href=“http://joe.com/” rel=“friend”>Joe’s website</a> wojtek zajac • @theanxy • wojtekzajac.com
  • 75. wojtek zajac • @theanxy • wojtekzajac.com
  • 76.
  • 77.
  • 78.
  • 79. · hCard · http://wojtekzajac.com/"> Wojtek Zajac wojtek zajac • @theanxy • wojtekzajac.com
  • 80. · hCard · <div > <a href="http://wojtekzajac.com/"> <span >Wojtek</span> <span >Zajac</span> </a> </div> wojtek zajac • @theanxy • wojtekzajac.com
  • 81. · hCard · <div class=“vcard”> <a class=“fn n url” href="http://wojtekzajac.com/"> <span class=“given-name”>Wojtek</span> <span class=“family-name”>Zajac</span> </a> </div> wojtek zajac • @theanxy • wojtekzajac.com
  • 82. wojtek zajac Use case: Extracting physical address from a website • @theanxy • wojtekzajac.com
  • 83. wojtek zajac • @theanxy • wojtekzajac.com wojtek zajac • • wojtekzajac.com
  • 84. wojtek zajac • @theanxy • wojtekzajac.com wojtek zajac • • wojtekzajac.com
  • 85. wojtek zajac • @theanxy • wojtekzajac.com wojtek zajac • • wojtekzajac.com
  • 86. ❷ wojtek zajac Use case: Exporting business cards to the address book • @theanxy • wojtekzajac.com
  • 87. wojtek zajac • @theanxy • wojtekzajac.com
  • 88. wojtek zajac • @theanxy • wojtekzajac.com
  • 89. wojtek zajac • @theanxy • wojtekzajac.com
  • 90. wojtek zajac • @theanxy • wojtekzajac.com
  • 91. ❸ wojtek zajac Use case: Adding event to the calendar • @theanxy • wojtekzajac.com
  • 92. wojtek zajac • @theanxy • wojtekzajac.com
  • 93. wojtek zajac • @theanxy • wojtekzajac.com
  • 94. wojtek zajac • @theanxy • wojtekzajac.com
  • 95. wojtek zajac • @theanxy • wojtekzajac.com
  • 96. wojtek zajac • @theanxy • wojtekzajac.com
  • 97. wojtek zajac • @theanxy • wojtekzajac.com
  • 98. wojtek zajac • @theanxy • wojtekzajac.com
  • 99. Specifications hCalendar events information hCard contact information rel-license specifying the license rel-nofollow blocking link–crawling rel-tag marking up tags Drafts hAtom: syndicated content rel-enclosure hAudio: audio files rel-home hListing: listings / classifieds rel-payment hRecipe: recipes hResume: resumes hReview: reviews wojtek zajac • @theanxy • wojtekzajac.com
  • 100. U R Microformats.org official wiki http://microformats.org/wiki/Main_Page hCard generator http://microformats.org/code/hcard/creator hCalendar generator http://microformats.org/code/hcalendar/creator Optimus transformer http://microformatique.com/optimus/ Operator (Firefox plugin) https://addons.mozilla.org/en-US/firefox/addon/4106 Social Graph API http://codebits.eu/intra/s/session/79 wojtek zajac • @theanxy • wojtekzajac.com
  • 101. Thanks! Questions? http://www.slideshare.net/wojciechzajac Wojtek Zając wojtek@wojtekzajac.com This work is licensed under a Creative @theanxy Commons Attribution 3.0 Unported License