SlideShare une entreprise Scribd logo
1  sur  60
LOOKING INTO HTML5
    CHRISTOPHER SCHMITT
THINGS ARE GOOD
BETWEEN US, XHTML, RIGHT?

        I MEAN.
  WE GET ALONG WELL.
 AND WE BOTH LIKE STUFF.
“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.”
     -TIM BERNERS-LEE
BLUEPRINTS VS REALITY
“TAKE CARE
  OF THE LUXURIES AND
THE NECESSITIES WILL TAKE
 CARE OF THEMSELVES.”
 -FRANK LLOYD WRIGHT
NEW HTML5 ELEMENTS

• article         • embed          • nest

• aside           • event-source   • output

• audio           • figure          • progress

• canvas          • footer         • source

• command         • header         • time

• datagrid        • mark           • video

• datalist        • meter

• datatemplate    • nav
BASIC HTML5 LAYOUT
<!DOCTYPE HTML>
<HTML LANG=quot;ENquot;>
<HEAD>
 <META CHARSET=quot;UTF-8quot;>
 <TITLE>BASIC HTML5 WEB DOCUMENT STRUCTURE</TITLE>
</HEAD>
<BODY>
 <H1>....</H1>
 <P>...</P>
 </BODY>
</HTML>
DIV ID=”header”
              DIV ID=”nav”

DIV ID=”section”




                         DIV ID=”sidecolumn”
DIV ID=”article”




             DIV ID=”footer”
HEADER
           NAV

SECTION




                   ASIDE
ARTICLE




          FOOTER
<BODY>
<HEADER>
 <H1>HEADING </H1>
</HEADER>
<NAV>
 <H3>SITE NAVIGATION</H3>
 <UL>...</UL>
</NAV>
<SECTION>
 <H3>WEBLOG ENTRY</H3>
 
<ARTICLE>
 
</SECTION>
<ASIDE>
  <P>YOU ARE READING quot;CHOCOLATE RAINquot;, AN ENTRY POSTED ON <TIME
DATETIME=quot;2009-03-05quot;>5 MARCH, 2009</TIME>, TO THE <A HREF=quot;#quot;>MISTY
COLLECTION</A>. SEE OTHER POSTS IN <A HREF=quot;#quot;>THIS COLLECTION</A>.</P>
</ASIDE>
<FOOTER>
 <P>...</P>
</FOOTER>
</BODY>
<SCRIPT TYPE=quot;TEXT/JAVASCRIPTquot;>
DOCUMENT.CREATEELEMENT('HEADER');
DOCUMENT.CREATEELEMENT('NAV');
DOCUMENT.CREATEELEMENT('SECTION');
DOCUMENT.CREATEELEMENT('ARTICLE');
DOCUMENT.CREATEELEMENT('ASIDE');
DOCUMENT.CREATEELEMENT('FOOTER');
</SCRIPT>




         http://ejohn.org/blog/html5-shiv/
BASIC CSS FORMATTING
HEADER
           NAV

SECTION




                   ASIDE
ARTICLE




          FOOTER
LESSONS LEARNED
• New   HTML5 elements are treated as inline elements.

  • Need    to use CSS property-value display:block

• IE6
    and IE7 need to be nudged to recognize HTML elements in
 order to have CSS be applied

  • document.createElement(‘html5element’);

  • Dean    Edwards IE7 script doesn’t help

  • There   isn’t a jQuery plugin to make it “easier”
LESSONS LEARNED


• For   Firefox 2 and Camino (Gecko 1.9)

  • HTML5       pages need to be served as XHTML

  • Content-Type: application/xhtml+xml;

  • ...Let   the irony set for a bit.
<?PHP
IF ( STRPOS($_SERVER['HTTP_USER_AGENT'], 'FIREFOX/2.0') > -1)
{
HEADER(quot;CONTENT-TYPE: APPLICATION/XHTML+XML;
CHARSET=UTF-8quot;);
ECHO'<!DOCTYPE HTML PUBLIC quot;-//W3C//DTD XHTML 1.0
TRANSITIONAL//ENquot; quot;HTTP://WWW.W3.ORG/TR/XHTML1/DTD/
XHTML1-TRANSITIONAL.DTDquot;>
<HTML XMLNS=quot;HTTP://WWW.W3.ORG/1999/XHTMLquot;
XML:LANG=quot;ENquot; LANG=quot;ENquot;>';
}
ELSE {
ECHO '<!DOCTYPE HTML><HTML>';
}?>

                       http://tr.im/h0Rj
HTML5 AUDIO
<!DOCTYPE HTML>
<HTML LANG=quot;ENquot;>
<HEAD>
<META CHARSET=quot;UTF-8quot;>
<TITLE>BASIC HTML5 WEB DOCUMENT STRUCTURE</TITLE>

   </HEAD>

   <BODY>

   
   <H1>VIDEO EXAMPLE</H1>

   
   <AUDIO SRC=quot;HTML5TEST.OGGquot; AUTOPLAY CONTROLS>

   
   
   <A HREF=quot;HTML5TEST.OGGquot;>DOWNLOAD AUDIO</A>

   
   </AUDIO>

   </BODY>
</HTML>
HTML5 AUDIO

• AUDIO  element attributes are SRC, AUTOBUFFER, AUTOPLAY,
  LOOP, CONTROLS

• If   you don’t have CONTROL, player becomes transparent

• Only    able to play OGG format in nightly build of Firefox.

   • Could   not get player to use MP3 audio
HTML5 VIDEO
<!DOCTYPE HTML>
<HTML LANG=quot;ENquot;>
<HEAD>
<META CHARSET=quot;UTF-8quot;>
<TITLE>BASIC HTML5 WEB DOCUMENT STRUCTURE</TITLE>

   </HEAD>

   <BODY>

   
   <H1>VIDEO EXAMPLE</H1>
        <OBJECT WIDTH=quot;425quot; HEIGHT=quot;344quot;><PARAM NAME=quot;MOVIEquot;

   
VALUE=quot;HTTP://WWW.YOUTUBE.COM/V/
4GUKSQAG5XI&HL=EN&FS=1quot;></PARAM><PARAM
NAME=quot;ALLOWFULLSCREENquot; VALUE=quot;TRUEquot;></PARAM><PARAM
NAME=quot;ALLOWSCRIPTACCESSquot; VALUE=quot;ALWAYSquot;></PARAM><EMBED
SRC=quot;HTTP://WWW.YOUTUBE.COM/V/4GUKSQAG5XI&HL=EN&FS=1quot;
TYPE=quot;APPLICATION/X-SHOCKWAVE-FLASHquot;
ALLOWSCRIPTACCESS=quot;ALWAYSquot; ALLOWFULLSCREEN=quot;TRUEquot;
WIDTH=quot;425quot; HEIGHT=quot;344quot;></EMBED></OBJECT>

   </BODY>
</HTML>
<!DOCTYPE HTML>
<HTML LANG=quot;ENquot;>
<HEAD>
<META CHARSET=quot;UTF-8quot;>
<TITLE>BASIC HTML5 WEB DOCUMENT STRUCTURE</TITLE>

   </HEAD>

   <BODY>

   
   <H1>VIDEO EXAMPLE</H1>
        <VIDEO SRC=quot;HTML5TEST.OGGquot;

   

   
   
   WIDTH=quot;320quot; HEIGHT=quot;240quot; CONTROLS 
 
        
  

   
   
   POSTER=quot;HTML5TESTVIDEOPOSTER.JPGquot;>

   
   
   <A HREF=quot;HTML5TESTVIDEO.OGGquot;>DOWNLOAD MOVIE</A>

   
   </VIDEO>

   </BODY>
</HTML>
VIDEO DEMOS


• Personal   demo

• http://tinyvid.tv/

• http://www.mozbox.org/jdll/video.xhtml
HTML5 VIDEO

• WIDTH   and HEIGHT should be required, IMO, but movie plays
  anyway based on the values in the video file itself.

• Video  formats may have their own posterframe. The browser
  should use that by default unless overridden by valid POSTER
  attribute value.

• Alternative   text is placed inside VIDEO element.

• If   you want to give users control, use CONTROL attribute.
HTML5 VIDEO


• Video can start automatically if using the AUTOPLAY=”1”
 attribute and value.

• Specprovides for LOOP, AUTOBUFFER which also take a value of
 O or 1.

• Codecs   support...
HTML5 VIDEO
  “It would be helpful for interoperability if all browsers could
    support the same codecs. However, there are no known
codecs that satisfy all the current players: we need a codec that
  is known to not require per-unit or per-distributor licensing,
 that is compatible with the open source development model,
  that is of sufficient quality as to be usable, and that is not an
 additional submarine patent risk for large companies. This is an
   ongoing issue and this section will be updated once more
                      information is available.”
    - http://www.whatwg.org/specs/web-apps/current-work/
          #video-and-audio-codecs-for-video-elements
LESSONS LEARNED

• Works    in nightly builds of Firefox (3.2b) and only for OGG
 format.

  • Other browsers that said they supported the VIDEO format I
   could not get to work on my machines.

• Used VLC    to encode common movie files types to OGG

• People   really, really, really want this to work.
HTML5 AND MICROFORMATS
REPLACING ABBR

• ABBRis used by screenreaders to expand abbreviations like “lbs”
 or “NCAAP”

• Howeverunintended consequences occurred trying to
 workaround browser bugs for other HTML elements

• What   happens when a screenreaders text like this:

  • “Let’sgo to <abbr class=quot;geoquot;
   title=quot;30.300474;-97.747247quot;>Austin, TX</abbr>”

http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
REPLACING ABBR

• ABBRis used by screenreaders to expand abbreviations like “lbs”
 or “NCAAP”

• Howeverunintended consequences occurred trying to
 workaround browser bugs for other HTML elements

• What   happens when a screenreaders text like this:

  • “Let’sgo to <abbr class=quot;geoquot;
   title=quot;30.300474;-97.747247quot;>Austin, TX</abbr>”

http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
<DIV CLASS=quot;VEVENTquot;>
<A CLASS=quot;URLquot; HREF=quot;HTTP://WWW.WEB2CON.COM/quot;>HTTP://
WWW.WEB2CON.COM</A>
<SPAN CLASS=quot;SUMMARYquot;>WEB 2.0 CONFERENCE</SPAN>:
 <ABBR CLASS=quot;DTSTARTquot; TITLE=quot;2007-10-05quot;>OCTOBER 5</ABBR>-
 <ABBR CLASS=quot;DTENDquot; TITLE=quot;2007-10-20quot;>19</ABBR>,
AT THE <SPAN CLASS=quot;LOCATIONquot;>ARGENT HOTEL, SAN FRANCISCO, CA</SPAN>
</DIV>
<DIV CLASS=quot;VEVENTquot;>
 <A CLASS=quot;URLquot; HREF=quot;HTTP://WWW.WEB2CON.COM/quot;>HTTP://
 WWW.WEB2CON.COM</A>
 <SPAN CLASS=quot;SUMMARYquot;>WEB 2.0 CONFERENCE</SPAN>:
 <TIME CLASS=quot;DTSTARTquot; DATETIME=quot;2007-10-05quot;>OCTOBER 5</TIME>-
  <TIME CLASS=quot;DTENDquot; DATETIME=quot;2007-10-20quot;>19</TIME>,
 AT THE <SPAN CLASS=quot;LOCATIONquot;>ARGENT HOTEL, SAN FRANCISCO, CA</SPAN>
 </DIV>




http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
HTML5 CANVAS
<CANVAS ID=quot;MYCANVASquot; WIDTH=quot;300quot; HEIGHT=quot;150quot;>
FALLBACK CONTENT, IN CASE THE BROWSER DOES NOT SUPPORT CANVAS.
</CANVAS>
<SCRIPT TYPE=quot;TEXT/JAVASCRIPTquot;><!--
WINDOW.ADDEVENTLISTENER('LOAD', FUNCTION () {
 // GET THE CANVAS ELEMENT.
 VAR ELEM = DOCUMENT.GETELEMENTBYID('MYCANVAS');
 IF (!ELEM || !ELEM.GETCONTEXT) {
   RETURN;
 }

 // GET THE CANVAS 2D CONTEXT.
 VAR CONTEXT = ELEM.GETCONTEXT('2D');
 IF (!CONTEXT) {
   RETURN;
 }

  // NOW YOU ARE DONE! LET'S DRAW A BLUE RECTANGLE.
  CONTEXT.FILLSTYLE = '#00F';
  CONTEXT.FILLRECT(0, 0, 150, 100);
}, FALSE);
// --></SCRIPT>
// GET THE CANVAS ELEMENT.
VAR ELEM = DOCUMENT.GETELEMENTBYID('MYCANVAS');
IF (!ELEM || !ELEM.GETCONTEXT) {
  RETURN;
}

// GET THE CANVAS 2D CONTEXT.
VAR CONTEXT = ELEM.GETCONTEXT('2D');
IF (!CONTEXT) {
  RETURN;
}

 CONTEXT.FILLSTYLE = '#00F';
 CONTEXT.STROKESTYLE = '#F00';
 CONTEXT.LINEWIDTH = 4;

  // DRAW A RIGHT TRIANGLE.
  CONTEXT.BEGINPATH();
  CONTEXT.MOVETO(10, 10);
  CONTEXT.LINETO(100, 10);
  CONTEXT.LINETO(10, 100);
  CONTEXT.LINETO(10, 10);
  CONTEXT.FILL();
  CONTEXT.STROKE();
  CONTEXT.CLOSEPATH();
}, FALSE);
// GET THE CANVAS ELEMENT.
VAR ELEM = DOCUMENT.GETELEMENTBYID('MYCANVAS');
IF (!ELEM || !ELEM.GETCONTEXT) {
  RETURN;
}

// GET THE CANVAS 2D CONTEXT.
VAR CONTEXT = ELEM.GETCONTEXT('2D');
IF (!CONTEXT) {
  RETURN;
}

 CONTEXT.FILLSTYLE = '#00F';
 CONTEXT.STROKESTYLE = '#F00';
 CONTEXT.LINEWIDTH = 4;

  // DRAW A RIGHT TRIANGLE.
  CONTEXT.BEGINPATH();
  CONTEXT.MOVETO(10, 10);
  CONTEXT.LINETO(100, 10);
  CONTEXT.LINETO(10, 100);
  CONTEXT.LINETO(10, 10);
  CONTEXT.FILL();
  CONTEXT.STROKE();
  CONTEXT.CLOSEPATH();
}, FALSE);
http://flickr.com/photos/dunstan/3099313036/
HTML5 AND LOCAL
DATABASE, APP CACHE,
   GEOLOCATION,
    YOUR PHONE
http://www.youtube.com/watch?v=VmjxmOtNZCk&fmt=18
DATABASE, APP CACHE,
          GEOLOCATION LINKS
    W3C HTML5 Database Storage Specification:
•
    http://tr.im/h13y

    W3C Geolocation API Specification:
•
    http://tr.im/h12L

    W3C HTML5 Offline Web Applications:
•
    http://tr.im/h12z

    Safari Dev Connection on HTML5 Offline Application Cache:
•
    http://tr.im/h12f

    WebKit Does HTML5 Client-Side Storage:
•
    http://tr.im/h140
“HTML 5 IS A KLUDGE.”
  - BRUCE LAWSON
THANK YOU!
  Christopher Schmitt
schmitt@heatvision.com
   twitter: @teleject
Creative Commons Citations

    http://www.flickr.com/photos/gurock20/459901107/
        http://www.flickr.com/photos/wili/214317898/
       http://www.flickr.com/photos/gadl/421838292/
     http://www.flickr.com/photos/tantek/1141384818/
http://dev.opera.com/articles/view/html-5-canvas-the-basics/

Contenu connexe

Tendances

SharePoint 2010 Web Standards & Accessibility
SharePoint 2010 Web Standards & AccessibilitySharePoint 2010 Web Standards & Accessibility
SharePoint 2010 Web Standards & Accessibility
Mavention
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
sagaroceanic11
 
Joomla security nuggets
Joomla security nuggetsJoomla security nuggets
Joomla security nuggets
guestbd1cdca
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
BG Java EE Course
 
CICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your MindCICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your Mind
ciconf
 
Introdution to HTML 5
Introdution to HTML 5Introdution to HTML 5
Introdution to HTML 5
onkar_bhosle
 

Tendances (20)

An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 
Ant User Guide
Ant User GuideAnt User Guide
Ant User Guide
 
SharePoint 2010 Web Standards & Accessibility
SharePoint 2010 Web Standards & AccessibilitySharePoint 2010 Web Standards & Accessibility
SharePoint 2010 Web Standards & Accessibility
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenario
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
Lecture 3 Javascript1
Lecture 3  Javascript1Lecture 3  Javascript1
Lecture 3 Javascript1
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted NewardArchitecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
 
Joomla security nuggets
Joomla security nuggetsJoomla security nuggets
Joomla security nuggets
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
 
CICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your MindCICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your Mind
 
Introdution to HTML 5
Introdution to HTML 5Introdution to HTML 5
Introdution to HTML 5
 
Intro to html 5
Intro to html 5Intro to html 5
Intro to html 5
 
Html 5 New Features
Html 5 New FeaturesHtml 5 New Features
Html 5 New Features
 

Similaire à Looking into HTML5

HTML5 - What h#@$ is it?
HTML5 - What h#@$ is it?HTML5 - What h#@$ is it?
HTML5 - What h#@$ is it?
Carlos Ramon
 
Is it time to start using HTML 5
Is it time to start using HTML 5Is it time to start using HTML 5
Is it time to start using HTML 5
Ravi Raj
 

Similaire à Looking into HTML5 (20)

HTML5 - techMaine Presentation 5/18/09
HTML5 - techMaine Presentation 5/18/09HTML5 - techMaine Presentation 5/18/09
HTML5 - techMaine Presentation 5/18/09
 
Looking into HTML5 + CSS3
Looking into HTML5 + CSS3Looking into HTML5 + CSS3
Looking into HTML5 + CSS3
 
[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5
 
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
 
Html5
Html5 Html5
Html5
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
HTML5 - What h#@$ is it?
HTML5 - What h#@$ is it?HTML5 - What h#@$ is it?
HTML5 - What h#@$ is it?
 
Los Angeles HTML5 User Group Meeting Ask the Expert Session
Los Angeles HTML5 User Group Meeting Ask the Expert SessionLos Angeles HTML5 User Group Meeting Ask the Expert Session
Los Angeles HTML5 User Group Meeting Ask the Expert Session
 
Intro to HTML 5
Intro to HTML 5Intro to HTML 5
Intro to HTML 5
 
Html5
Html5Html5
Html5
 
HTML5
HTML5HTML5
HTML5
 
Michael(tm) Smith: HTML5 at Web Directions South 2008
Michael(tm) Smith: HTML5 at Web Directions South 2008Michael(tm) Smith: HTML5 at Web Directions South 2008
Michael(tm) Smith: HTML5 at Web Directions South 2008
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introduction
 
HTML5
HTML5HTML5
HTML5
 
Is it time to start using HTML 5
Is it time to start using HTML 5Is it time to start using HTML 5
Is it time to start using HTML 5
 
Using HTML5 sensibly
Using HTML5 sensiblyUsing HTML5 sensibly
Using HTML5 sensibly
 
Thadomal IEEE-HTML5-Workshop
Thadomal IEEE-HTML5-WorkshopThadomal IEEE-HTML5-Workshop
Thadomal IEEE-HTML5-Workshop
 
Lca2009 Video A11y
Lca2009 Video A11yLca2009 Video A11y
Lca2009 Video A11y
 
HTML5: The Next Internet Goldrush
HTML5: The Next Internet GoldrushHTML5: The Next Internet Goldrush
HTML5: The Next Internet Goldrush
 
Mozilla Firefox Extension Development, Course 1: Basic
Mozilla Firefox Extension Development, Course 1: BasicMozilla Firefox Extension Development, Course 1: Basic
Mozilla Firefox Extension Development, Course 1: Basic
 

Plus de Christopher Schmitt

[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code
Christopher Schmitt
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
Christopher Schmitt
 
[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
GitHub for People Who Don't Code
GitHub for People Who Don't CodeGitHub for People Who Don't Code
GitHub for People Who Don't Code
Christopher Schmitt
 
[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs
Christopher Schmitt
 

Plus de Christopher Schmitt (20)

Keeping Colors from Killing Your Product
Keeping Colors from Killing Your ProductKeeping Colors from Killing Your Product
Keeping Colors from Killing Your Product
 
[funka] Adaptive Images in Responsive Web Design
[funka] Adaptive Images in Responsive Web Design[funka] Adaptive Images in Responsive Web Design
[funka] Adaptive Images in Responsive Web Design
 
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
 
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
 
[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
 
[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
 
[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design
 
[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design
 
[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
 
GitHub for People Who Don't Code
GitHub for People Who Don't CodeGitHub for People Who Don't Code
GitHub for People Who Don't Code
 
[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design
 
[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design
 
[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design
 
[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs
 
[amigos] HTML5 and CSS3
[amigos] HTML5 and CSS3[amigos] HTML5 and CSS3
[amigos] HTML5 and CSS3
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Looking into HTML5

  • 1. LOOKING INTO HTML5 CHRISTOPHER SCHMITT
  • 2. THINGS ARE GOOD BETWEEN US, XHTML, RIGHT? I MEAN. WE GET ALONG WELL. AND WE BOTH LIKE STUFF.
  • 3. “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.” -TIM BERNERS-LEE
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. “TAKE CARE OF THE LUXURIES AND THE NECESSITIES WILL TAKE CARE OF THEMSELVES.” -FRANK LLOYD WRIGHT
  • 11. NEW HTML5 ELEMENTS • article • embed • nest • aside • event-source • output • audio • figure • progress • canvas • footer • source • command • header • time • datagrid • mark • video • datalist • meter • datatemplate • nav
  • 13. <!DOCTYPE HTML> <HTML LANG=quot;ENquot;> <HEAD> <META CHARSET=quot;UTF-8quot;> <TITLE>BASIC HTML5 WEB DOCUMENT STRUCTURE</TITLE> </HEAD> <BODY> <H1>....</H1> <P>...</P> </BODY> </HTML>
  • 14.
  • 15. DIV ID=”header” DIV ID=”nav” DIV ID=”section” DIV ID=”sidecolumn” DIV ID=”article” DIV ID=”footer”
  • 16. HEADER NAV SECTION ASIDE ARTICLE FOOTER
  • 17. <BODY> <HEADER> <H1>HEADING </H1> </HEADER> <NAV> <H3>SITE NAVIGATION</H3> <UL>...</UL> </NAV> <SECTION> <H3>WEBLOG ENTRY</H3> <ARTICLE> </SECTION> <ASIDE> <P>YOU ARE READING quot;CHOCOLATE RAINquot;, AN ENTRY POSTED ON <TIME DATETIME=quot;2009-03-05quot;>5 MARCH, 2009</TIME>, TO THE <A HREF=quot;#quot;>MISTY COLLECTION</A>. SEE OTHER POSTS IN <A HREF=quot;#quot;>THIS COLLECTION</A>.</P> </ASIDE> <FOOTER> <P>...</P> </FOOTER> </BODY>
  • 18.
  • 19.
  • 21.
  • 23. HEADER NAV SECTION ASIDE ARTICLE FOOTER
  • 24.
  • 25.
  • 26. LESSONS LEARNED • New HTML5 elements are treated as inline elements. • Need to use CSS property-value display:block • IE6 and IE7 need to be nudged to recognize HTML elements in order to have CSS be applied • document.createElement(‘html5element’); • Dean Edwards IE7 script doesn’t help • There isn’t a jQuery plugin to make it “easier”
  • 27. LESSONS LEARNED • For Firefox 2 and Camino (Gecko 1.9) • HTML5 pages need to be served as XHTML • Content-Type: application/xhtml+xml; • ...Let the irony set for a bit.
  • 28. <?PHP IF ( STRPOS($_SERVER['HTTP_USER_AGENT'], 'FIREFOX/2.0') > -1) { HEADER(quot;CONTENT-TYPE: APPLICATION/XHTML+XML; CHARSET=UTF-8quot;); ECHO'<!DOCTYPE HTML PUBLIC quot;-//W3C//DTD XHTML 1.0 TRANSITIONAL//ENquot; quot;HTTP://WWW.W3.ORG/TR/XHTML1/DTD/ XHTML1-TRANSITIONAL.DTDquot;> <HTML XMLNS=quot;HTTP://WWW.W3.ORG/1999/XHTMLquot; XML:LANG=quot;ENquot; LANG=quot;ENquot;>'; } ELSE { ECHO '<!DOCTYPE HTML><HTML>'; }?> http://tr.im/h0Rj
  • 30. <!DOCTYPE HTML> <HTML LANG=quot;ENquot;> <HEAD> <META CHARSET=quot;UTF-8quot;> <TITLE>BASIC HTML5 WEB DOCUMENT STRUCTURE</TITLE> </HEAD> <BODY> <H1>VIDEO EXAMPLE</H1> <AUDIO SRC=quot;HTML5TEST.OGGquot; AUTOPLAY CONTROLS> <A HREF=quot;HTML5TEST.OGGquot;>DOWNLOAD AUDIO</A> </AUDIO> </BODY> </HTML>
  • 31.
  • 32. HTML5 AUDIO • AUDIO element attributes are SRC, AUTOBUFFER, AUTOPLAY, LOOP, CONTROLS • If you don’t have CONTROL, player becomes transparent • Only able to play OGG format in nightly build of Firefox. • Could not get player to use MP3 audio
  • 34. <!DOCTYPE HTML> <HTML LANG=quot;ENquot;> <HEAD> <META CHARSET=quot;UTF-8quot;> <TITLE>BASIC HTML5 WEB DOCUMENT STRUCTURE</TITLE> </HEAD> <BODY> <H1>VIDEO EXAMPLE</H1> <OBJECT WIDTH=quot;425quot; HEIGHT=quot;344quot;><PARAM NAME=quot;MOVIEquot; VALUE=quot;HTTP://WWW.YOUTUBE.COM/V/ 4GUKSQAG5XI&HL=EN&FS=1quot;></PARAM><PARAM NAME=quot;ALLOWFULLSCREENquot; VALUE=quot;TRUEquot;></PARAM><PARAM NAME=quot;ALLOWSCRIPTACCESSquot; VALUE=quot;ALWAYSquot;></PARAM><EMBED SRC=quot;HTTP://WWW.YOUTUBE.COM/V/4GUKSQAG5XI&HL=EN&FS=1quot; TYPE=quot;APPLICATION/X-SHOCKWAVE-FLASHquot; ALLOWSCRIPTACCESS=quot;ALWAYSquot; ALLOWFULLSCREEN=quot;TRUEquot; WIDTH=quot;425quot; HEIGHT=quot;344quot;></EMBED></OBJECT> </BODY> </HTML>
  • 35. <!DOCTYPE HTML> <HTML LANG=quot;ENquot;> <HEAD> <META CHARSET=quot;UTF-8quot;> <TITLE>BASIC HTML5 WEB DOCUMENT STRUCTURE</TITLE> </HEAD> <BODY> <H1>VIDEO EXAMPLE</H1> <VIDEO SRC=quot;HTML5TEST.OGGquot; WIDTH=quot;320quot; HEIGHT=quot;240quot; CONTROLS POSTER=quot;HTML5TESTVIDEOPOSTER.JPGquot;> <A HREF=quot;HTML5TESTVIDEO.OGGquot;>DOWNLOAD MOVIE</A> </VIDEO> </BODY> </HTML>
  • 36. VIDEO DEMOS • Personal demo • http://tinyvid.tv/ • http://www.mozbox.org/jdll/video.xhtml
  • 37. HTML5 VIDEO • WIDTH and HEIGHT should be required, IMO, but movie plays anyway based on the values in the video file itself. • Video formats may have their own posterframe. The browser should use that by default unless overridden by valid POSTER attribute value. • Alternative text is placed inside VIDEO element. • If you want to give users control, use CONTROL attribute.
  • 38. HTML5 VIDEO • Video can start automatically if using the AUTOPLAY=”1” attribute and value. • Specprovides for LOOP, AUTOBUFFER which also take a value of O or 1. • Codecs support...
  • 39. HTML5 VIDEO “It would be helpful for interoperability if all browsers could support the same codecs. However, there are no known codecs that satisfy all the current players: we need a codec that is known to not require per-unit or per-distributor licensing, that is compatible with the open source development model, that is of sufficient quality as to be usable, and that is not an additional submarine patent risk for large companies. This is an ongoing issue and this section will be updated once more information is available.” - http://www.whatwg.org/specs/web-apps/current-work/ #video-and-audio-codecs-for-video-elements
  • 40. LESSONS LEARNED • Works in nightly builds of Firefox (3.2b) and only for OGG format. • Other browsers that said they supported the VIDEO format I could not get to work on my machines. • Used VLC to encode common movie files types to OGG • People really, really, really want this to work.
  • 42. REPLACING ABBR • ABBRis used by screenreaders to expand abbreviations like “lbs” or “NCAAP” • Howeverunintended consequences occurred trying to workaround browser bugs for other HTML elements • What happens when a screenreaders text like this: • “Let’sgo to <abbr class=quot;geoquot; title=quot;30.300474;-97.747247quot;>Austin, TX</abbr>” http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
  • 43. REPLACING ABBR • ABBRis used by screenreaders to expand abbreviations like “lbs” or “NCAAP” • Howeverunintended consequences occurred trying to workaround browser bugs for other HTML elements • What happens when a screenreaders text like this: • “Let’sgo to <abbr class=quot;geoquot; title=quot;30.300474;-97.747247quot;>Austin, TX</abbr>” http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
  • 44. <DIV CLASS=quot;VEVENTquot;> <A CLASS=quot;URLquot; HREF=quot;HTTP://WWW.WEB2CON.COM/quot;>HTTP:// WWW.WEB2CON.COM</A> <SPAN CLASS=quot;SUMMARYquot;>WEB 2.0 CONFERENCE</SPAN>: <ABBR CLASS=quot;DTSTARTquot; TITLE=quot;2007-10-05quot;>OCTOBER 5</ABBR>- <ABBR CLASS=quot;DTENDquot; TITLE=quot;2007-10-20quot;>19</ABBR>, AT THE <SPAN CLASS=quot;LOCATIONquot;>ARGENT HOTEL, SAN FRANCISCO, CA</SPAN> </DIV>
  • 45. <DIV CLASS=quot;VEVENTquot;> <A CLASS=quot;URLquot; HREF=quot;HTTP://WWW.WEB2CON.COM/quot;>HTTP:// WWW.WEB2CON.COM</A> <SPAN CLASS=quot;SUMMARYquot;>WEB 2.0 CONFERENCE</SPAN>: <TIME CLASS=quot;DTSTARTquot; DATETIME=quot;2007-10-05quot;>OCTOBER 5</TIME>- <TIME CLASS=quot;DTENDquot; DATETIME=quot;2007-10-20quot;>19</TIME>, AT THE <SPAN CLASS=quot;LOCATIONquot;>ARGENT HOTEL, SAN FRANCISCO, CA</SPAN> </DIV> http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
  • 47. <CANVAS ID=quot;MYCANVASquot; WIDTH=quot;300quot; HEIGHT=quot;150quot;> FALLBACK CONTENT, IN CASE THE BROWSER DOES NOT SUPPORT CANVAS. </CANVAS>
  • 48. <SCRIPT TYPE=quot;TEXT/JAVASCRIPTquot;><!-- WINDOW.ADDEVENTLISTENER('LOAD', FUNCTION () { // GET THE CANVAS ELEMENT. VAR ELEM = DOCUMENT.GETELEMENTBYID('MYCANVAS'); IF (!ELEM || !ELEM.GETCONTEXT) { RETURN; } // GET THE CANVAS 2D CONTEXT. VAR CONTEXT = ELEM.GETCONTEXT('2D'); IF (!CONTEXT) { RETURN; } // NOW YOU ARE DONE! LET'S DRAW A BLUE RECTANGLE. CONTEXT.FILLSTYLE = '#00F'; CONTEXT.FILLRECT(0, 0, 150, 100); }, FALSE); // --></SCRIPT>
  • 49.
  • 50. // GET THE CANVAS ELEMENT. VAR ELEM = DOCUMENT.GETELEMENTBYID('MYCANVAS'); IF (!ELEM || !ELEM.GETCONTEXT) { RETURN; } // GET THE CANVAS 2D CONTEXT. VAR CONTEXT = ELEM.GETCONTEXT('2D'); IF (!CONTEXT) { RETURN; } CONTEXT.FILLSTYLE = '#00F'; CONTEXT.STROKESTYLE = '#F00'; CONTEXT.LINEWIDTH = 4; // DRAW A RIGHT TRIANGLE. CONTEXT.BEGINPATH(); CONTEXT.MOVETO(10, 10); CONTEXT.LINETO(100, 10); CONTEXT.LINETO(10, 100); CONTEXT.LINETO(10, 10); CONTEXT.FILL(); CONTEXT.STROKE(); CONTEXT.CLOSEPATH(); }, FALSE);
  • 51.
  • 52. // GET THE CANVAS ELEMENT. VAR ELEM = DOCUMENT.GETELEMENTBYID('MYCANVAS'); IF (!ELEM || !ELEM.GETCONTEXT) { RETURN; } // GET THE CANVAS 2D CONTEXT. VAR CONTEXT = ELEM.GETCONTEXT('2D'); IF (!CONTEXT) { RETURN; } CONTEXT.FILLSTYLE = '#00F'; CONTEXT.STROKESTYLE = '#F00'; CONTEXT.LINEWIDTH = 4; // DRAW A RIGHT TRIANGLE. CONTEXT.BEGINPATH(); CONTEXT.MOVETO(10, 10); CONTEXT.LINETO(100, 10); CONTEXT.LINETO(10, 100); CONTEXT.LINETO(10, 10); CONTEXT.FILL(); CONTEXT.STROKE(); CONTEXT.CLOSEPATH(); }, FALSE);
  • 54. HTML5 AND LOCAL DATABASE, APP CACHE, GEOLOCATION, YOUR PHONE
  • 56. DATABASE, APP CACHE, GEOLOCATION LINKS W3C HTML5 Database Storage Specification: • http://tr.im/h13y W3C Geolocation API Specification: • http://tr.im/h12L W3C HTML5 Offline Web Applications: • http://tr.im/h12z Safari Dev Connection on HTML5 Offline Application Cache: • http://tr.im/h12f WebKit Does HTML5 Client-Side Storage: • http://tr.im/h140
  • 57. “HTML 5 IS A KLUDGE.” - BRUCE LAWSON
  • 58.
  • 59. THANK YOU! Christopher Schmitt schmitt@heatvision.com twitter: @teleject
  • 60. Creative Commons Citations http://www.flickr.com/photos/gurock20/459901107/ http://www.flickr.com/photos/wili/214317898/ http://www.flickr.com/photos/gadl/421838292/ http://www.flickr.com/photos/tantek/1141384818/ http://dev.opera.com/articles/view/html-5-canvas-the-basics/