SlideShare a Scribd company logo
HTML5 Workshop


Thorsten Rinne I 9th October 2011




                                    © 201 Mayflower GmbH
                                         1
Team Lead
Scrum Master
Head of Open Source Labs

@ThorstenRinne
                           HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 2
                                                                                   1
© Landeshauptstadt Mainz




            Who are you?   HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 3
                                                                                   1
Who‘s already using ...




               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 4
                                                                       1
HTML5 in one sentence?




              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 5
                                                                      1
„HTML5 is about moving
  from documents to
 applications and from
  hacks to solutions.“

                                      Chris Heilmann on Twitter
              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 6
                                                                      1
HTML5 for Developers?




             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 7
                                                                     1
HTML5 ~= HTML + CSS + JS




               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 8
                                                                       1
Agenda today

       HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 9
                                                               1
- A little bit history of HTML
- HTML5 basics
- Changes / Improvements
- New semantics / tags
- SVG / Canvas /Audio / Video
- Webforms
- Microdata / Storage
- JS APIs (Websockets, Webworker, ...)
- CSS3
- Little helpers
- Current Pitfalls
                            HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 10
                                                                                    1
HTML history

        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 1
                                                                1   1
1989:
HTML was born at CERN.

              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 12
                                                                      1
1989:
Invented by Tim Berners-Lee
   No, not by a Neutrino.
                 HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 13
                                                                         1
HTML was based on SGML
   from the 1960ies.


              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 14
                                                                      1
1993:
HTML was submitted to the
          IETF
                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 15
                                                                        1
1993:
  IETF required the first
implementation: Mosaic
               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 16
                                                                       1
1996:
Tim Berners-Lee created the
     World Wide Web
    Consortium (W3C)
                 HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 17
                                                                         1
1996:
    Browser war:
Netscape vs. Microsoft
              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 18
                                                                      1
- Browser free for users   - Bundled „free“ with OS
- Web to replace OS        - 1995: 6 persons are
- Java should deliver      working on IE up to
web apps                   1000 in 1999
- 4 versions in 7 years    - 6 versions in 6 years


        Netscape lost that war...
                                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 19
                                                                                        1
The dark age of the Web...




                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 20
                                                                        1
XHTML 2.0

HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 21
                                                        1
HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 22
                                                        1
But ...
    HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 23
                                                            1
1999:
PHP 3.0 - MySQL 3.22
     Apache 1.3
             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 24
                                                                     1
1999:
 Internet Explorer 5.0
XMLHttpRequest Object
              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 25
                                                                      1
As time goes by ...




             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 26
                                                                     1
since 5.0 (1999)


    since 1.0 (2004)


            since 1.2 (2004)


                   since 7.6 (2004)
                    HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 27
                                                                            1
2005:
Ajax: A New Approach to
   Web Applications
                          Blog entry by Jesse James Garret
              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 28
                                                                      1
HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 29
                                                        1
Google Suggest

 Google Mail

Google Maps
          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 30
                                                                  1
2006:
 Comet
         HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 31
                                                                 1
HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 32
                                                        1
Push   Ajax




              Push




                     HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 33
                                                                             1
Okay, what‘s happening?




              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 34
                                                                      1
Content
  vs.
Context
     HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 35
                                                             1
Facebook is an
 application!



          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 36
                                                                  1
Page
  vs.
Stream
    HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 37
                                                            1
Twitter is an
application!



          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 38
                                                                  1
Applications?

        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 39
                                                                1
Apps!

    HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 40
                                                            1
HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 41
                                                        1
HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 42
                                                        1
online == offline
          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 43
                                                                  1
Is this the new web?




                 HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 44
                                                                         1
The future is a web app!


               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 45
                                                                       1
HTML 5 Basics

        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 46
                                                                1
<!DOCTYPE html>



         HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 47
                                                                 1
Dropped stuff

        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 48
                                                                1
Dropped HTML4 stuff


          KISS
Keep it simple & stupid

              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 49
                                                                      1
Dropped HTML4 stuff


Removed redundant or
  broken elements

             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 50
                                                                     1
Dropped HTML4 stuff

  <acronym>
        ↓
    <abbr>

            HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 51
                                                                    1
Dropped HTML4 stuff

   <applet>
        ↓
   <object>

            HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 52
                                                                    1
Dropped HTML4 stuff

     <dir>
        ↓
      <ul>

             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 53
                                                                     1
Dropped HTML4 stuff

  <frame>
 <frameset>
 <noframe>

            HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 54
                                                                    1
Dropped HTML4 stuff


  HTML5 should be
similiar to HTML4 and
      XHTML 1.0
             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 55
                                                                     1
Dropped HTML4 stuff


   HTML5 should
explicitly require CSS.

               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 56
                                                                       1
Dropped HTML4 stuff


Presentational elements
and attributes removed.

              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 57
                                                                      1
Dropped HTML4 stuff

  plaintext, isindex
   <basefont>, <big>,
<center>, <font>, <s>,
 <strike>, <tt>, <u>
 align, alink, vlink
              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 58
                                                                      1
Improvements

       HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 59
                                                               1
Attributes for transition

        <img>

   border=0 if present


                 HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 60
                                                                         1
Attributes for transition

         <script>

language have to JavaScript if
          present

                   HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 61
                                                                           1
Attributes for transition

     <a>, <img>

„name“ dropped, use „id“


                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 62
                                                                        1
Problematic Attributes

         rev

misunderstood/misused


               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 63
                                                                       1
Problematic Attributes

      longdesc

often harms accessibility


                 HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 64
                                                                         1
Problematic Attributes

       <html>

 The version number. :-)


                 HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 65
                                                                         1
Updated elements

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

               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 66
                                                                       1
Better consistency

       <a>
    more flexible
  <a>, <area>
new media attribute

             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 67
                                                                     1
Better consistency

 <a href=“http://
  m.twitter.com“
  rel=“alternate“
 media=“handheld“>
Twitter Mobile</a>
              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 68
                                                                      1
Better consistency

class, dir, id, lang,
style, tabindex, title
    Now for all elements!


                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 69
                                                                        1
Real life solutions

   <iframe>
 for nested HTML



             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 70
                                                                     1
Real life solutions

    <embed>
    for plugins



              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 71
                                                                      1
Real life solutions

<base>, <a>, <area>
   target attribute



               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 72
                                                                       1
Real life solutions

 <li> value attribute
 <ol> start attribute
<ol> reverse attribute


                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 73
                                                                        1
Real life solutions

     data attribute

for custom data-* attributes


                  HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 74
                                                                          1
Example Facebook Like

 <div class="fb-like"
data-send="true" data-
width="450" data-show-
 faces="true"></div>

              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 75
                                                                      1
New semantics

        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 76
                                                                1
HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 77
                                                        1
New HTML semantics

  <section> scopes
<address> and headings



              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 78
                                                                      1
New HTML semantics

    <header>
    <hgroup>
      <nav>
    <article>
    <footer>
            HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 79
                                                                    1
New HTML semantics

     <time>
   <details>
    <figure>
  <figcaption>
     <mark>
            HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 80
                                                                    1
From XHTML 1.1 & 2.0

                <ruby>
                 <rt>
                 <rp>
No, <rt> is not for marking up Twitter retweets
 for Japanese, Hiragana expansions of Kanji
                              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 81
                                                                                      1
New <link> relations
<link rel="alternate" type="application/atom+xml"
      title="My Weblog feed"
      href="http://www.phpconference.de/feed/">
<link rel="search" type="application/opensearchdescription+xml"
      title="My Weblog search"
      href="http://www.phpconference.de/opensearch.xml">
<link rel="icon" href="/favicon.ico">

<link   rel="pingback" href="http://www.phpconference.de/xmlrpc.php">
<link   rel="prefetch" href="http://www.phpconference.de/main.php">
<link   rel="archives" href="http://www.phpconference.de/archive/">
<link   rel="external" href="http://www.php.net">
<link   rel="license" href="http://www.gnu.org/licenses/gpl.html">
<link   rel="nofollow" href="http://www.ruby-lang.org">




                                           HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 82
                                                                                                   1
Demo
SVG / Canvas

       HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 84
                                                               1
SVG / Canvas

      <svg>
  vector graphics
   <canvas>
drawing with scripts

              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 85
                                                                      1
Canvas




         HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 86
                                                                 1
Demo
Audio

   <audio id="audio"
    src="sound.mp3"
   controls></audio>
document.getElementById
("audio").muted = false;

                 HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 88
                                                                         1
Demo
Video

           Demo:
http://www.youtube.com/html5



                   HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 90
                                                                           1
WebForms

     HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 91
                                                             1
WebForms attributes (I)
<input type="text" placeholder="Mayflower GmbH">




                                        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 92
                                                                                                1
WebForms attributes (II)
<input type="text" maxlength="256" name="q" autofocus>




<input type="text" maxlength="256" name="q" required="true">




                                        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 93
                                                                                                1
WebForms attributes (III)
<input type="tel" name="phonenumber">




<input type="url" name="url">




<input type="email" name="emailaddress">




                                           HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 94
                                                                                                   1
WebForms attributes (IV)
<input type="number" min="0" max="10" step="2" value="6">




                                        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 95
                                                                                                1
WebForms attributes (V)
<input type="range" min="0" max="10" step="2" value="6">




                                        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 96
                                                                                                1
HTML5 Speech Input
<input type="text" x-webit-speech>




                                     HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 97
                                                                                             1
Date Picker
<input   type="date">
<input   type="month">
<input   type="week">
<input   type="time">
<input   type="datetime">




                             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 98
                                                                                     1
Color Picker
<input type="color">




                          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 99
                                                                                  1
Demo
Microdata

      HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 101
                                                              1
HTML 5 Microdata is
machine-readable data in
  HTML. Recursion. :-)

               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 102
                                                                       1
Storage

     HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 103
                                                             1
Web Storage
‣„short living“ data
 ‣sessionStorage object
 ‣will be deleted by closing the browser
‣„long living“ data
 ‣localStorage object
 ‣won‘t be deleted after closing the browser

Safari/Chrome     Firefox          IE                                  Opera

     2 MB       5 MB ~ 200MB      5 MB                                    4 MB



                                     HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 104
                                                                                             1
Web Storage
 <p>This page was requested <b>
 <script>
 if (!sessionStorage.pageCounter) {
   sessionStorage.setItem('pageCounter',0);
 }

  sessionStorage.setItem('pageCounter',
    parseInt(sessionStorage.pageCounter)+1);

  document.write(sessionStorage.pageCounter);
  </script>
  </b> times.</p>
  <p>
  <input value="sessionStorage leeren" type="button"
onClick="sessionStorage.clear();location.reload(true);">
  <input value="Seite laden" type="button"
onClick="location.reload(true);">
  </p>



                                        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 105
                                                                                                1
Demo
JS APIs

     HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 107
                                                             1
WebSockets
if ("WebSocket" in window) {
  var ws = new WebSocket("ws://example.com/service");
  ws.onopen = function() {
     // WebSocket is connected.
     // You can send data by send() method.
     ws.send("message to send");
    // ....
  };
  ws.onmessage = function (evt) {
     var received_msg = evt.data;
  };
  ws.onclose = function() {
     // WebSocket is closed
  };
} else {
  // the browser doesn't support WebSockets.
}




                                        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 108
                                                                                                1
Client
GET /demo HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: example.com
Origin: http://example.com
Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5
Sec-WebSocket-Key2: 12998 5 Y3 1 .P00

^n:ds[4U


                                                                               Server
                   HTTP/1.1 101 WebSocket Protocol Handshake
                   Upgrade: WebSocket
                   Connection: Upgrade
                   Sec-WebSocket-Origin: http://example.com
                   Sec-WebSocket-Location: ws://example.com/demo
                   Sec-WebSocket-Protocol: sample

                   8jKS'y:G*Co,Wxa-


                                          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 109
                                                                                                  1
Demo
WebWorker
                                                                             main.js
var myWorker = new Worker('backgroundTasks.js');

myWorker.onmessage = function(event) {
   alert(event.data);
};



                                                                      backgroundtask.js
self.onmessage = function(event) {
  // Do some heavy work
  self.postMessage('Hello, Amsterdam');
}




                                          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 1 1
                                                                                                  1   1
WebMessaging
<form>
<input type="text" name="msg" value="My message" id="msg">
<input type="submit">
<h2>Ziel iFrame:</h2>
<iframe id="iframe" src="postmessage.html"></iframe>
</form>
<script>
  var win = document.getElementById("iframe").contentWindow;
  addEvent(
    document.getElementsByTagName('form')[0], 'submit',
      function (e) {
         if (e.preventDefault)
           e.preventDefault();
         win.postMessage(document.getElementById("msg").value,
           "http://www.phpconference.nl");
         e.returnValue = false;
         return false;
  });
  </script>


                                          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 1
                                                                                                  1   12
Demo
Offline application cache
CACHE MANIFEST

# This is a comment

CACHE:
/css/screen.css
/css/offline.css
/js/screen.js
/img/logo.png

http://example.com/css/styles.css

FALLBACK:
/ /offline.html

NETWORK:
*




                                    HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 1
                                                                                            1   14
Demo
Geolocation
if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(
    function(position) {
      var lat     = position.coords.latitude;
      var lng     = position.coords.longitude;
      var options = {
        position: new google.maps.LatLng(lat, lng) }
      var marker = new google.maps.Marker(options);

          marker.setMap(map);
    });
}




                                      HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 1
                                                                                              1   16
FileReader API (I)
var reader = new FileReader();

reader.onload = function(e) {
   var bin = e.target.result; // bin is a binary string
};

reader.readAsBinaryString(file);




                                         HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 1
                                                                                                 1   17
FileReader API (II)
var xhr = new XMLHttpRequest();

xhr.open("POST", "upload.php");
xhr.overrideMimeType("text/plain;
  charset=x-user-defined-binary");
xhr.sendAsBinary();




xhr.upload.addEventListener("progress", function(e) {
  if (e.lengthComputable) {
    var percentage = Math.round((e.loaded * 100) / e.total);
    // do something
  }
}, false);




                                        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 1
                                                                                                1   18
CSS3

   HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 1
                                                           1   19
New selectors
.row:nth-child(even) { background: #cccccc; }
.row:nth-child(odd) { background: #ffffff; }




   row 1
   row 2
   row 3
   row 4


                                        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 120
                                                                                                1
Web Fonts
@font-face {
  font-family: 'Papyrus';
  src: url(Papyrus.otf);
}

header {
  font-family: 'Papyrus';
}




               Hallo, Welt!
                            HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 121
                                                                                    1
More new CSS3 features...




                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 122
                                                                        1
Lorem ipsum dolor sit     Lorem ipsum dolor sit     Lorem ipsum dolor sit          Lorem ipsum dolor sit
amet, consectetur         amet, consectetur         amet, consectetur              amet, consectetur
adipisicing elit, sed     adipisicing elit, sed     adipisicing elit, sed          adipisicing elit, sed
do eiusmod tempor         do eiusmod tempor         do eiusmod tempor              do eiusmod tempor
incididunt ut labore et   incididunt ut labore et   incididunt ut labore et        incididunt ut labore et
dolore magna aliqua.      dolore magna aliqua.      dolore magna aliqua.           dolore magna aliqua.
Ut enim ad minim          Ut enim ad minim          Ut enim ad minim               Ut enim ad minim
veniam, quis nostrud      veniam, quis nostrud      veniam, quis nostrud           veniam, quis nostrud


              Multi-column layouts
exercitation ullamco      exercitation ullamco      exercitation ullamco           exercitation ullamco
laboris nisi ut aliquip   laboris nisi ut aliquip   laboris nisi ut aliquip        laboris nisi ut aliquip
ex ea commodo             ex ea commodo             ex ea commodo                  ex ea commodo
consequat. Duis aute      consequat. Duis aute      consequat. Duis aute           consequat. Duis aute
irure dolor in            irure dolor in            irure dolor in                 irure dolor in
reprehenderit in          reprehenderit in          reprehenderit in               reprehenderit in
voluptate velit esse      voluptate velit esse      voluptate velit esse           voluptate velit esse
cillum dolore eu          cillum dolore eu          cillum dolore eu               cillum dolore eu
fugiat nulla pariatur.    fugiat nulla pariatur.    fugiat nulla pariatur.         fugiat nulla pariatur.
Excepteur sint            Excepteur sint            Excepteur sint                 Excepteur sint
occaecat cupidatat        occaecat cupidatat        occaecat cupidatat             occaecat cupidatat
non proident, sunt in     non proident, sunt in     non proident, sunt in          non proident, sunt in
culpa qui officia          culpa qui officia          culpa qui officia               culpa qui officia
deserunt mollit anim      deserunt mollit anim      deserunt mollit anim           deserunt mollit anim
id est laborum.           id est laborum.           id est laborum.                id est laborum.

                                                                   HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 123
                                                                                                                           1
Opacity
Opacity
Opacity
Opacity
Opacity
      HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 124
                                                              1
HSL / HSLA colours




            HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 125
                                                                    1
Finally rounded corners! :-)



                  HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 126
                                                                          1
Gradients




        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 127
                                                                1
Shadows
    HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 128
                                                            1
Shadows
    HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 129
                                                            1
Transitions and animations




                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 130
                                                                        1
Some CSS3 Fun?
http://leaverou.me/css3-secrets/




                    HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 131
                                                                            1
Little helpers

         HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 132
                                                                 1
HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 133
                                                        1
HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 134
                                                        1
caniuse.com



        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 135
                                                                1
html5test.com



         HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 136
                                                                 1
Current Pitfalls

          HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 137
                                                                  1
HTML5 in Browsern
                                                                               76 %

                                   69 %
                       65 %                     64 %



          47 %


31 %




IE9    Mobile Safari Safari 5.1
                                  Firefox 7
                                              Opera 11.5
                                                                            Chrome 14

                                                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 138
                                                                                                        1
HTML5 in the year 2011




              HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 139
                                                                      1
Cross
                         content
             Document               New tags              <audio>                    <video>
                         editable
             Messaging


IE 9



FF 4



Chrome 8+



Safari 5+



Opera 10.7



                                               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 140
                                                                                                       1
Simple                                      Offline
                         Texts in                                                     HTML5
             <canvas>               Drag and Drop       Application
                        <canvas>                          Cache                     WebForms
             support


IE 9



FF 4



Chrome 8+



Safari 5+



Opera 10.7



                                               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 141
                                                                                                       1
But...




         HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 142
                                                                 1
Browser statistics 2011




               HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 143
                                                                       1
What‘s safe to use today?




                HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 144
                                                                        1
contenteditable
  postMessage
Web Storage (IE 8+)

             HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 145
                                                                     1
Questions?




        HTML5 for PHP Developer I   Mayflower GmbH I 20th May 201 I 146
                                                                1
Thank you very much!




Contact   Thorsten Rinne
          thorsten.rinne@mayflower.de
          +49 89 242054-31
          @ThorstenRinne

          Mayflower GmbH
          Mannhardtstr. 6
          80538 München
          Germany


                                       © 201 Mayflower GmbH
                                            1

More Related Content

PDF
HTML5 for PHP Developers - DPC11
PDF
HTML5 for PHP Developers - IPC
PDF
One-Click Deployment with Jenkins
PDF
One Click Deployment with Jenkins
PDF
Continuous Improvement in PHP projects
KEY
PDF
Red5 Open Source Flash Server
HTML5 for PHP Developers - DPC11
HTML5 for PHP Developers - IPC
One-Click Deployment with Jenkins
One Click Deployment with Jenkins
Continuous Improvement in PHP projects
Red5 Open Source Flash Server

Viewers also liked (8)

PPTX
Workshop 1 create a web from zero
PDF
Confoo - 2012-02-27 au 2012-02-28 - HTML5 workshop
PDF
RIA - Entwicklung mit Ext JS
KEY
Html5 by gis tec
PDF
Html5 game programming overview
PDF
HTML5 JS APIs
PPT
R E C R U I T M E N T
PDF
Resume: Web Development and Design
Workshop 1 create a web from zero
Confoo - 2012-02-27 au 2012-02-28 - HTML5 workshop
RIA - Entwicklung mit Ext JS
Html5 by gis tec
Html5 game programming overview
HTML5 JS APIs
R E C R U I T M E N T
Resume: Web Development and Design
Ad

Similar to HTML5 Workshop (20)

PDF
HTML5 for PHP Developers - IPC
PPT
345345
PPT
ssfsd fsdf ds f
PPT
PPT
IntroductiontoPHP.ppt
PPT
IntroductiontoPHP.ppt
PPT
PPT
sdfsdfsdf
PPT
IntroductiontoPHP.ppt
PPT
IntroductiontoPHP.ppt
PPT
IntroductiontoPHP.ppt
PPT
IntroductiontoPHP.ppt
PPT
IntroductiontoPHP.ppt
PPT
IntroductiontoPHP.ppt
PPT
IntroductiontoPHP.ppt
PPT
PPT
IntroductiontoPHP.ppt
PPT
PPT
IntroductiontoPHP.ppt
PPT
ssfsd fsdf ds f
HTML5 for PHP Developers - IPC
345345
ssfsd fsdf ds f
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
sdfsdfsdf
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
IntroductiontoPHP.ppt
ssfsd fsdf ds f
Ad

More from Mayflower GmbH (20)

PDF
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
PDF
Why and what is go
PDF
Agile Anti-Patterns
PDF
JavaScript Days 2015: Security
PDF
Vom Entwickler zur Führungskraft
PPTX
Produktive teams
PDF
Salt and pepper — native code in the browser Browser using Google native Client
PDF
Plugging holes — javascript memory leak debugging
PDF
Usability im web
PDF
Rewrites überleben
PDF
JavaScript Security
PDF
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
PDF
Responsive Webdesign
PDF
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
PDF
Pair Programming Mythbusters
PDF
Shoeism - Frau im Glück
PDF
Bessere Software schneller liefern
PDF
Von 0 auf 100 in 2 Sprints
PDF
Piwik anpassen und skalieren
PDF
Agilitaet im E-Commerce - E-Commerce Breakfast
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Why and what is go
Agile Anti-Patterns
JavaScript Days 2015: Security
Vom Entwickler zur Führungskraft
Produktive teams
Salt and pepper — native code in the browser Browser using Google native Client
Plugging holes — javascript memory leak debugging
Usability im web
Rewrites überleben
JavaScript Security
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
Responsive Webdesign
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Pair Programming Mythbusters
Shoeism - Frau im Glück
Bessere Software schneller liefern
Von 0 auf 100 in 2 Sprints
Piwik anpassen und skalieren
Agilitaet im E-Commerce - E-Commerce Breakfast

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Tartificialntelligence_presentation.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Spectroscopy.pptx food analysis technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Electronic commerce courselecture one. Pdf
1. Introduction to Computer Programming.pptx
Network Security Unit 5.pdf for BCA BBA.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
Tartificialntelligence_presentation.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?
Group 1 Presentation -Planning and Decision Making .pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia
A Presentation on Artificial Intelligence
NewMind AI Weekly Chronicles - August'25-Week II
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectroscopy.pptx food analysis technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf

HTML5 Workshop

  • 1. HTML5 Workshop Thorsten Rinne I 9th October 2011 © 201 Mayflower GmbH 1
  • 2. Team Lead Scrum Master Head of Open Source Labs @ThorstenRinne HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 2 1
  • 3. © Landeshauptstadt Mainz Who are you? HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 3 1
  • 4. Who‘s already using ... HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 4 1
  • 5. HTML5 in one sentence? HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 5 1
  • 6. „HTML5 is about moving from documents to applications and from hacks to solutions.“ Chris Heilmann on Twitter HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 6 1
  • 7. HTML5 for Developers? HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 7 1
  • 8. HTML5 ~= HTML + CSS + JS HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 8 1
  • 9. Agenda today HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 9 1
  • 10. - A little bit history of HTML - HTML5 basics - Changes / Improvements - New semantics / tags - SVG / Canvas /Audio / Video - Webforms - Microdata / Storage - JS APIs (Websockets, Webworker, ...) - CSS3 - Little helpers - Current Pitfalls HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 10 1
  • 11. HTML history HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 1 1 1
  • 12. 1989: HTML was born at CERN. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 12 1
  • 13. 1989: Invented by Tim Berners-Lee No, not by a Neutrino. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 13 1
  • 14. HTML was based on SGML from the 1960ies. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 14 1
  • 15. 1993: HTML was submitted to the IETF HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 15 1
  • 16. 1993: IETF required the first implementation: Mosaic HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 16 1
  • 17. 1996: Tim Berners-Lee created the World Wide Web Consortium (W3C) HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 17 1
  • 18. 1996: Browser war: Netscape vs. Microsoft HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 18 1
  • 19. - Browser free for users - Bundled „free“ with OS - Web to replace OS - 1995: 6 persons are - Java should deliver working on IE up to web apps 1000 in 1999 - 4 versions in 7 years - 6 versions in 6 years Netscape lost that war... HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 19 1
  • 20. The dark age of the Web... HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 20 1
  • 21. XHTML 2.0 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 21 1
  • 22. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 22 1
  • 23. But ... HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 23 1
  • 24. 1999: PHP 3.0 - MySQL 3.22 Apache 1.3 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 24 1
  • 25. 1999: Internet Explorer 5.0 XMLHttpRequest Object HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 25 1
  • 26. As time goes by ... HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 26 1
  • 27. since 5.0 (1999) since 1.0 (2004) since 1.2 (2004) since 7.6 (2004) HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 27 1
  • 28. 2005: Ajax: A New Approach to Web Applications Blog entry by Jesse James Garret HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 28 1
  • 29. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 29 1
  • 30. Google Suggest Google Mail Google Maps HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 30 1
  • 31. 2006: Comet HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 31 1
  • 32. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 32 1
  • 33. Push Ajax Push HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 33 1
  • 34. Okay, what‘s happening? HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 34 1
  • 35. Content vs. Context HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 35 1
  • 36. Facebook is an application! HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 36 1
  • 37. Page vs. Stream HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 37 1
  • 38. Twitter is an application! HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 38 1
  • 39. Applications? HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 39 1
  • 40. Apps! HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 40 1
  • 41. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 41 1
  • 42. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 42 1
  • 43. online == offline HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 43 1
  • 44. Is this the new web? HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 44 1
  • 45. The future is a web app! HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 45 1
  • 46. HTML 5 Basics HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 46 1
  • 47. <!DOCTYPE html> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 47 1
  • 48. Dropped stuff HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 48 1
  • 49. Dropped HTML4 stuff KISS Keep it simple & stupid HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 49 1
  • 50. Dropped HTML4 stuff Removed redundant or broken elements HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 50 1
  • 51. Dropped HTML4 stuff <acronym> ↓ <abbr> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 51 1
  • 52. Dropped HTML4 stuff <applet> ↓ <object> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 52 1
  • 53. Dropped HTML4 stuff <dir> ↓ <ul> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 53 1
  • 54. Dropped HTML4 stuff <frame> <frameset> <noframe> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 54 1
  • 55. Dropped HTML4 stuff HTML5 should be similiar to HTML4 and XHTML 1.0 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 55 1
  • 56. Dropped HTML4 stuff HTML5 should explicitly require CSS. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 56 1
  • 57. Dropped HTML4 stuff Presentational elements and attributes removed. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 57 1
  • 58. Dropped HTML4 stuff plaintext, isindex <basefont>, <big>, <center>, <font>, <s>, <strike>, <tt>, <u> align, alink, vlink HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 58 1
  • 59. Improvements HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 59 1
  • 60. Attributes for transition <img> border=0 if present HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 60 1
  • 61. Attributes for transition <script> language have to JavaScript if present HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 61 1
  • 62. Attributes for transition <a>, <img> „name“ dropped, use „id“ HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 62 1
  • 63. Problematic Attributes rev misunderstood/misused HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 63 1
  • 64. Problematic Attributes longdesc often harms accessibility HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 64 1
  • 65. Problematic Attributes <html> The version number. :-) HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 65 1
  • 66. Updated elements <meta <meta http- charset=“UTF-8“> equiv=“Content-Type“ content=“text/html; charset=UTF-8“> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 66 1
  • 67. Better consistency <a> more flexible <a>, <area> new media attribute HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 67 1
  • 68. Better consistency <a href=“http:// m.twitter.com“ rel=“alternate“ media=“handheld“> Twitter Mobile</a> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 68 1
  • 69. Better consistency class, dir, id, lang, style, tabindex, title Now for all elements! HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 69 1
  • 70. Real life solutions <iframe> for nested HTML HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 70 1
  • 71. Real life solutions <embed> for plugins HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 71 1
  • 72. Real life solutions <base>, <a>, <area> target attribute HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 72 1
  • 73. Real life solutions <li> value attribute <ol> start attribute <ol> reverse attribute HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 73 1
  • 74. Real life solutions data attribute for custom data-* attributes HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 74 1
  • 75. Example Facebook Like <div class="fb-like" data-send="true" data- width="450" data-show- faces="true"></div> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 75 1
  • 76. New semantics HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 76 1
  • 77. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 77 1
  • 78. New HTML semantics <section> scopes <address> and headings HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 78 1
  • 79. New HTML semantics <header> <hgroup> <nav> <article> <footer> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 79 1
  • 80. New HTML semantics <time> <details> <figure> <figcaption> <mark> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 80 1
  • 81. From XHTML 1.1 & 2.0 <ruby> <rt> <rp> No, <rt> is not for marking up Twitter retweets for Japanese, Hiragana expansions of Kanji HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 81 1
  • 82. New <link> relations <link rel="alternate" type="application/atom+xml" title="My Weblog feed" href="http://www.phpconference.de/feed/"> <link rel="search" type="application/opensearchdescription+xml" title="My Weblog search" href="http://www.phpconference.de/opensearch.xml"> <link rel="icon" href="/favicon.ico"> <link rel="pingback" href="http://www.phpconference.de/xmlrpc.php"> <link rel="prefetch" href="http://www.phpconference.de/main.php"> <link rel="archives" href="http://www.phpconference.de/archive/"> <link rel="external" href="http://www.php.net"> <link rel="license" href="http://www.gnu.org/licenses/gpl.html"> <link rel="nofollow" href="http://www.ruby-lang.org"> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 82 1
  • 83. Demo
  • 84. SVG / Canvas HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 84 1
  • 85. SVG / Canvas <svg> vector graphics <canvas> drawing with scripts HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 85 1
  • 86. Canvas HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 86 1
  • 87. Demo
  • 88. Audio <audio id="audio" src="sound.mp3" controls></audio> document.getElementById ("audio").muted = false; HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 88 1
  • 89. Demo
  • 90. Video Demo: http://www.youtube.com/html5 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 90 1
  • 91. WebForms HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 91 1
  • 92. WebForms attributes (I) <input type="text" placeholder="Mayflower GmbH"> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 92 1
  • 93. WebForms attributes (II) <input type="text" maxlength="256" name="q" autofocus> <input type="text" maxlength="256" name="q" required="true"> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 93 1
  • 94. WebForms attributes (III) <input type="tel" name="phonenumber"> <input type="url" name="url"> <input type="email" name="emailaddress"> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 94 1
  • 95. WebForms attributes (IV) <input type="number" min="0" max="10" step="2" value="6"> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 95 1
  • 96. WebForms attributes (V) <input type="range" min="0" max="10" step="2" value="6"> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 96 1
  • 97. HTML5 Speech Input <input type="text" x-webit-speech> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 97 1
  • 98. Date Picker <input type="date"> <input type="month"> <input type="week"> <input type="time"> <input type="datetime"> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 98 1
  • 99. Color Picker <input type="color"> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 99 1
  • 100. Demo
  • 101. Microdata HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 101 1
  • 102. HTML 5 Microdata is machine-readable data in HTML. Recursion. :-) HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 102 1
  • 103. Storage HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 103 1
  • 104. Web Storage ‣„short living“ data ‣sessionStorage object ‣will be deleted by closing the browser ‣„long living“ data ‣localStorage object ‣won‘t be deleted after closing the browser Safari/Chrome Firefox IE Opera 2 MB 5 MB ~ 200MB 5 MB 4 MB HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 104 1
  • 105. Web Storage <p>This page was requested <b> <script> if (!sessionStorage.pageCounter) { sessionStorage.setItem('pageCounter',0); } sessionStorage.setItem('pageCounter', parseInt(sessionStorage.pageCounter)+1); document.write(sessionStorage.pageCounter); </script> </b> times.</p> <p> <input value="sessionStorage leeren" type="button" onClick="sessionStorage.clear();location.reload(true);"> <input value="Seite laden" type="button" onClick="location.reload(true);"> </p> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 105 1
  • 106. Demo
  • 107. JS APIs HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 107 1
  • 108. WebSockets if ("WebSocket" in window) { var ws = new WebSocket("ws://example.com/service"); ws.onopen = function() { // WebSocket is connected. // You can send data by send() method. ws.send("message to send"); // .... }; ws.onmessage = function (evt) { var received_msg = evt.data; }; ws.onclose = function() { // WebSocket is closed }; } else { // the browser doesn't support WebSockets. } HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 108 1
  • 109. Client GET /demo HTTP/1.1 Upgrade: WebSocket Connection: Upgrade Host: example.com Origin: http://example.com Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5 Sec-WebSocket-Key2: 12998 5 Y3 1 .P00 ^n:ds[4U Server HTTP/1.1 101 WebSocket Protocol Handshake Upgrade: WebSocket Connection: Upgrade Sec-WebSocket-Origin: http://example.com Sec-WebSocket-Location: ws://example.com/demo Sec-WebSocket-Protocol: sample 8jKS'y:G*Co,Wxa- HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 109 1
  • 110. Demo
  • 111. WebWorker main.js var myWorker = new Worker('backgroundTasks.js'); myWorker.onmessage = function(event) { alert(event.data); }; backgroundtask.js self.onmessage = function(event) { // Do some heavy work self.postMessage('Hello, Amsterdam'); } HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 1 1 1 1
  • 112. WebMessaging <form> <input type="text" name="msg" value="My message" id="msg"> <input type="submit"> <h2>Ziel iFrame:</h2> <iframe id="iframe" src="postmessage.html"></iframe> </form> <script> var win = document.getElementById("iframe").contentWindow; addEvent( document.getElementsByTagName('form')[0], 'submit', function (e) { if (e.preventDefault) e.preventDefault(); win.postMessage(document.getElementById("msg").value, "http://www.phpconference.nl"); e.returnValue = false; return false; }); </script> HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 1 1 12
  • 113. Demo
  • 114. Offline application cache CACHE MANIFEST # This is a comment CACHE: /css/screen.css /css/offline.css /js/screen.js /img/logo.png http://example.com/css/styles.css FALLBACK: / /offline.html NETWORK: * HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 1 1 14
  • 115. Demo
  • 116. Geolocation if (navigator.geolocation) { navigator.geolocation.getCurrentPosition( function(position) { var lat = position.coords.latitude; var lng = position.coords.longitude; var options = { position: new google.maps.LatLng(lat, lng) } var marker = new google.maps.Marker(options); marker.setMap(map); }); } HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 1 1 16
  • 117. FileReader API (I) var reader = new FileReader(); reader.onload = function(e) { var bin = e.target.result; // bin is a binary string }; reader.readAsBinaryString(file); HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 1 1 17
  • 118. FileReader API (II) var xhr = new XMLHttpRequest(); xhr.open("POST", "upload.php"); xhr.overrideMimeType("text/plain; charset=x-user-defined-binary"); xhr.sendAsBinary(); xhr.upload.addEventListener("progress", function(e) { if (e.lengthComputable) { var percentage = Math.round((e.loaded * 100) / e.total); // do something } }, false); HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 1 1 18
  • 119. CSS3 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 1 1 19
  • 120. New selectors .row:nth-child(even) { background: #cccccc; } .row:nth-child(odd) { background: #ffffff; } row 1 row 2 row 3 row 4 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 120 1
  • 121. Web Fonts @font-face { font-family: 'Papyrus'; src: url(Papyrus.otf); } header { font-family: 'Papyrus'; } Hallo, Welt! HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 121 1
  • 122. More new CSS3 features... HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 122 1
  • 123. Lorem ipsum dolor sit Lorem ipsum dolor sit Lorem ipsum dolor sit Lorem ipsum dolor sit amet, consectetur amet, consectetur amet, consectetur amet, consectetur adipisicing elit, sed adipisicing elit, sed adipisicing elit, sed adipisicing elit, sed do eiusmod tempor do eiusmod tempor do eiusmod tempor do eiusmod tempor incididunt ut labore et incididunt ut labore et incididunt ut labore et incididunt ut labore et dolore magna aliqua. dolore magna aliqua. dolore magna aliqua. dolore magna aliqua. Ut enim ad minim Ut enim ad minim Ut enim ad minim Ut enim ad minim veniam, quis nostrud veniam, quis nostrud veniam, quis nostrud veniam, quis nostrud Multi-column layouts exercitation ullamco exercitation ullamco exercitation ullamco exercitation ullamco laboris nisi ut aliquip laboris nisi ut aliquip laboris nisi ut aliquip laboris nisi ut aliquip ex ea commodo ex ea commodo ex ea commodo ex ea commodo consequat. Duis aute consequat. Duis aute consequat. Duis aute consequat. Duis aute irure dolor in irure dolor in irure dolor in irure dolor in reprehenderit in reprehenderit in reprehenderit in reprehenderit in voluptate velit esse voluptate velit esse voluptate velit esse voluptate velit esse cillum dolore eu cillum dolore eu cillum dolore eu cillum dolore eu fugiat nulla pariatur. fugiat nulla pariatur. fugiat nulla pariatur. fugiat nulla pariatur. Excepteur sint Excepteur sint Excepteur sint Excepteur sint occaecat cupidatat occaecat cupidatat occaecat cupidatat occaecat cupidatat non proident, sunt in non proident, sunt in non proident, sunt in non proident, sunt in culpa qui officia culpa qui officia culpa qui officia culpa qui officia deserunt mollit anim deserunt mollit anim deserunt mollit anim deserunt mollit anim id est laborum. id est laborum. id est laborum. id est laborum. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 123 1
  • 124. Opacity Opacity Opacity Opacity Opacity HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 124 1
  • 125. HSL / HSLA colours HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 125 1
  • 126. Finally rounded corners! :-) HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 126 1
  • 127. Gradients HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 127 1
  • 128. Shadows HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 128 1
  • 129. Shadows HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 129 1
  • 130. Transitions and animations HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 130 1
  • 131. Some CSS3 Fun? http://leaverou.me/css3-secrets/ HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 131 1
  • 132. Little helpers HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 132 1
  • 133. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 133 1
  • 134. HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 134 1
  • 135. caniuse.com HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 135 1
  • 136. html5test.com HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 136 1
  • 137. Current Pitfalls HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 137 1
  • 138. HTML5 in Browsern 76 % 69 % 65 % 64 % 47 % 31 % IE9 Mobile Safari Safari 5.1 Firefox 7 Opera 11.5 Chrome 14 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 138 1
  • 139. HTML5 in the year 2011 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 139 1
  • 140. Cross content Document New tags <audio> <video> editable Messaging IE 9 FF 4 Chrome 8+ Safari 5+ Opera 10.7 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 140 1
  • 141. Simple Offline Texts in HTML5 <canvas> Drag and Drop Application <canvas> Cache WebForms support IE 9 FF 4 Chrome 8+ Safari 5+ Opera 10.7 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 141 1
  • 142. But... HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 142 1
  • 143. Browser statistics 2011 HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 143 1
  • 144. What‘s safe to use today? HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 144 1
  • 145. contenteditable postMessage Web Storage (IE 8+) HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 145 1
  • 146. Questions? HTML5 for PHP Developer I Mayflower GmbH I 20th May 201 I 146 1
  • 147. Thank you very much! Contact Thorsten Rinne thorsten.rinne@mayflower.de +49 89 242054-31 @ThorstenRinne Mayflower GmbH Mannhardtstr. 6 80538 München Germany © 201 Mayflower GmbH 1