The document provides an overview of HTML5 including:
- A brief history of HTML standards from 1991 to the development of HTML5 in 2009.
- An explanation that HTML5 is intended as a replacement for older HTML and XHTML standards.
- A preview of some new features covered in HTML5 like video, audio, canvas, forms, local storage and web workers.
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
In depth with html5 java2days 2010
1. In depth with HTML5
Andrew Lombardi
Owner, Tech Evangelist
Mystic Coders, LLC
andrew AT mysticcoders DOT com
kinabalu @ irc://irc.freenode.net - ##wicket, ##java
kinabalu @ twitter
Friday, October 8, 2010
13. A brief history of time (HTML)
1991 - First version of HTML
Friday, October 8, 2010
14. A brief history of time (HTML)
1991 - First version of HTML
1994 - HTML2 is born
Friday, October 8, 2010
15. A brief history of time (HTML)
1991 - First version of HTML
1994 - HTML2 is born
1996 - CSS1 + JavaScript
Friday, October 8, 2010
16. A brief history of time (HTML)
1991 - First version of HTML
1994 - HTML2 is born
1996 - CSS1 + JavaScript
1996 - First “developer”
mistakes Javascript for Java
Friday, October 8, 2010
18. A brief history of time (HTML)
1997 - HTML4
Friday, October 8, 2010
19. A brief history of time (HTML)
1997 - HTML4
1998 - CSS2
Friday, October 8, 2010
20. A brief history of time (HTML)
1997 - HTML4
1998 - CSS2
2000 - XHTML is hatched
Friday, October 8, 2010
21. A brief history of time (HTML)
1997 - HTML4
1998 - CSS2
2000 - XHTML is hatched
2000 - Malformed HTML
writers are burned at stake
Friday, October 8, 2010
23. A brief history of time (HTML)
2002 - Tableless Web Design
Friday, October 8, 2010
24. A brief history of time (HTML)
2002 - Tableless Web Design
2002 - Average HTML page
creation 5x longer
Friday, October 8, 2010
25. A brief history of time (HTML)
2002 - Tableless Web Design
2002 - Average HTML page
creation 5x longer
2005 - AJAX
Friday, October 8, 2010
26. A brief history of time (HTML)
2002 - Tableless Web Design
2002 - Average HTML page
creation 5x longer
2005 - AJAX
2009 - HTML5
Friday, October 8, 2010
27. HTML5 is...
HTML5 is a replacement for HTML
4.01, XHTML 1.0, and XHTML 1.1
Friday, October 8, 2010
53. Typing is so 2009
Instead of
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript"> ... </script>
Friday, October 8, 2010
54. Typing is so 2009
Instead of
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript"> ... </script>
Just do
<link rel="stylesheet" href="style.css" />
<script> ... </script>
Friday, October 8, 2010
55. Typing is so 2009
Instead of
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript"> ... </script>
Just do
<link rel="stylesheet" href="style.css" />
<script> ... </script>
We know what you mean.
Friday, October 8, 2010
56. Boolean Types in Tags
<input type="text" name="email" required />
Friday, October 8, 2010
57. Boolean Types in Tags
<input type="text" name="email" required />
If you reference it in the markup, it’s true.
Friday, October 8, 2010
60. Video and Audio in HTML5 has a lot of
promise, but patent hippos get in the way
Friday, October 8, 2010
61. HTML5 Video
Ogg - Not patent encumbered but quality is not there
H.264 - Only pay royalties if end-user video is not free
WebM / VP8 - Google released as royalty free after
purchasing from On2
Friday, October 8, 2010
62. HTML5 Video
Ogg - Not patent encumbered but quality is not there
H.264 - Only pay royalties if end-user video is not free
WebM / VP8 - Google released as royalty free after
purchasing from On2
Patent landscape for video is unclear
Friday, October 8, 2010
64. Video Attributes
autoplay - video starts playing as soon as it’s ready
controls - browser-specific controls for video displayed
height - height of video
width - width of video
loop - replay video on end
src - location of video
poster - image to show before video plays
Friday, October 8, 2010
73. Audio Attributes
autoplay - audio starts playing as soon as it’s ready
controls - browser-specific controls for audio displayed
preload - should browser preload audio? if autoplay -ignored
loop - replay audio on end
src - location of audio
Friday, October 8, 2010
80. Canvas Extreme
http://www.nihilogic.dk/labs/wolf/
Friday, October 8, 2010
81. Canvas Browser Support
Internet Explorer Mozilla Firefox Apple Safari Google Chrome
9.0 3.0 3.2 4.0
Friday, October 8, 2010
82. Forms in Wicket allow you to accept,
process and validate user input.
Friday, October 8, 2010
83. HTML5 Forms
Tag Description
type=”date” Represents a UTC formatted date
type=”color” Represents a hexadecimal RGB color value
type=”number” Represents a numeric value
type=”search” Simple text box but browser can choose to provide custom control
type=”email”, type=”url”, Represents contact details. Browser can choose to represent our handle input differently (i.e.
type=”tel” Mobile Safari)
type=”range” Represents a range of values with min/max
Friday, October 8, 2010
84. HTML5 Forms (more)
Tag Description
pattern=”some.regex” Use a regex to validate against the input without requiring Javascript involvement
placeholder=”Insert
Attached to input type=”text” to show placeholder text before user clicks
placeholder text here”
Boolean value used only once per page identifying the form component that should receive
autofocus immediate focus after page load
autocomplete on/off switch used to tell browser if it’s okay to autocomplete this field with saved data
Boolean value for semantically and functionally marking a field as requiring input before valid
required submission
<datalist> A combo box allowing selection via preselected values or entering custom
placeholder=”Insert
Attached to input type=”text” to show placeholder text before user clicks
placeholder text here”
Friday, October 8, 2010
85. New Form Tags Browser Support
Internet Explorer Mozilla Firefox Apple Safari Google Chrome
? 4.0 4.0 4.0
Friday, October 8, 2010
86. Semantic markup in HTML5 identifies
based on meaning rather than layout
Friday, October 8, 2010
87. New Semantic Tags
Tag Description
<section> A generic section of a document or application, a grouping of content typically with a header
<nav> Used to identify major navigation links on the page, usually in the header of a page
<article> A reusable, independently distributable composition in a document, page, application or site
<aside> Tangentially related content to the main article (sidebars, pull quotes, advertising)
<hgroup> Used to group h1-h6 elements when heading has multiple levels
<header> Represents a group of introductory or navigational aids
Friday, October 8, 2010
88. New Semantic Tags (more)
Tag Description
Represents a footer for its nearest ancestor sectioning content or root element. Bottom of a
<footer> page as well as <section>’s of a page are relevant here
<time> Represents time on a 24-hour clock, or precise date optionally with timezone
<mark> Represents a run of text in one document marked or highlighted for reference purposes
<meter> Can be used to mark up measurements, part of a scale with min/max values
<progress> Markup denoting a value that is in the process of changing
Friday, October 8, 2010
89. Semantic Browser Support
Internet Explorer Mozilla Firefox Apple Safari Google Chrome
9.0 3.0 3.2 4.0
Friday, October 8, 2010
90. Semantic Tag Browser Support
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
Friday, October 8, 2010
91. Semantic Tag Browser Support
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
Friday, October 8, 2010
92. Local Storage allows you to save up to
5MB of data for your web application
Friday, October 8, 2010
93. Local Storage
textarea.addEventListener('keyup', function () {
! window.localStorage['value'] = area.value;
! window.localStorage['timestamp'] = (new Date()).getTime();
}, false);
textarea.value = window.localStorage['value'];
http://www.mysticcoders.com/html5/webstorage.html
Friday, October 8, 2010
94. Local Storage Browser Support
Internet Explorer Mozilla Firefox Apple Safari Google Chrome
8.0 3.0 4.0 4.0
Friday, October 8, 2010
95. Workers at it’s simplest enable performing
computationally expensive tasks without
interrupting the user interface
Friday, October 8, 2010
96. Web Workers
<!DOCTYPE HTML>
<html>
<head>
<title>Worker example: One-core computation</title>
</head>
<body>
<p>The highest prime number discovered so far is: <output
id="result"></output></p>
<script>
var worker = new Worker('worker.js');
worker.onmessage = function (event) {
document.getElementById('result').textContent = event.data;
};
</script>
</body>
</html>
Friday, October 8, 2010
97. Web Workers
var n = 1;
search: while (true) {
n += 1;
for (var i = 2; i <= Math.sqrt(n); i += 1)
if (n % i == 0)
continue search;
// found a prime!
postMessage(n);
}
Friday, October 8, 2010
98. Web Workers
var n = 1;
search: while (true) {
n += 1;
for (var i = 2; i <= Math.sqrt(n); i += 1)
if (n % i == 0)
continue search;
// found a prime!
postMessage(n);
}
http://www.mysticcoders.com/html5/worker-example.html
Friday, October 8, 2010
99. Web Workers Browser Support
Internet Explorer Mozilla Firefox Apple Safari Google Chrome
Unknown 3.5 4.0 4.0
Friday, October 8, 2010
101. Geolocation
if (navigator.geolocation) {
! navigator.geolocation.getCurrentPosition(function(position) {
! var lat = position.coords.latitude;
! var lng = position.coords.longitude;
! alert('Your currently @ ('+lat+', '+lng+')');
! });
}
Friday, October 8, 2010
102. Geolocation
if (navigator.geolocation) {
! navigator.geolocation.getCurrentPosition(function(position) {
! var lat = position.coords.latitude;
! var lng = position.coords.longitude;
! alert('Your currently @ ('+lat+', '+lng+')');
! });
}
http://www.mysticcoders.com/html5/geolocation.html
Friday, October 8, 2010
103. 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);
! });
}
Friday, October 8, 2010
104. Geolocation Browser Support
Internet Explorer Mozilla Firefox Apple Safari Google Chrome
Unknown 3.5 5.0 5.0
Friday, October 8, 2010
105. More HTML5
application cache - specify with a cache.manifest files you’d like
the browser to eagerly cache for offline use
web database - embedded SQL database which most browsers
have chosen to use sqlite
cross document messaging - allows documents to communicate
regardless of source domain (no XSS script attacks)
drag and drop - allows elements to be draggable and droppable
Friday, October 8, 2010
106. More HTML5
webgl - provides an API for writing web applications utilizing
hardware accelerated 3D graphics
web notifications - provides an API for alerting users outside
of a web page via notifications
Friday, October 8, 2010
107. More websites for
HTML5 knowledge
C E S
U R
E SO
R
Friday, October 8, 2010
111. Q&A
Thanks for listening!
Andrew Lombardi
Owner, Tech Evangelist
Mystic Coders, LLC
andrew AT mysticcoders DOT com
kinabalu @ irc://irc.freenode.net - ##wicket, ##java
Friday, October 8, 2010