1. HTML5
What it is, what it’s not, and what parts of it we can use today.
October 21, 2010
Steven G. Chipman
2. In 140 Characters ....
“HTML5 is a vocabulary and set of application programming interfaces that
make up a core declarative language for web sites and applications.”
@mollydotcom
4. You’re no doubt familiar with ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
97. Things to keep in mind ...
• 5MB of storage
• EVERYTHING is returned as as string, just like cookies
• If you run out of space, an exception will be thrown.
• Unlike Flash LSOs, you can’t ask for more space.
• Some browsers allow users to set the limit, so you may have less than 5MB
110. Things to be aware of ...
• Workers can not access or manipulate the DOM.
• They do not have access to the scripts in the page that spawned it.
• Using importScripts, a Worker can access other javascript libraries.
116. Getting IE to recognize new elements ...
<script>
document.createElement(“section”);
document.createElement(“article”);
// ... and so on
</script>
* otherwise you won’t be able to style these elements in IE8 and below
117. Testing for attribute support ...
function elementSupportsAttribute(element,attribute) {
var ele = document.createElement(element);
return attribute in ele ? true : false;
}
118. Testing for input type support ...
function elementSupportsType(type) {
var input = document.createElement(“input”);
input.setAttribute(“type”,type);
return input.getAttribute(“type”) == “text” ? false : true;
}
119. According to Microsoft ...
IE9 is the bomb: http://samples.msdn.microsoft.com/ietestcenter/
120. Modernizr
• Detects support, does NOT provide it
• Javascript hooks such as Modernizr.canvas
• Adds classes to the HTML element that define available features
• Sets up elements for IE 6 through 8
• MIT-BSD License
121. Resources
• HTML5 for Web Designers by Jeremy Keith - http://books.alistapart.com/
• Dive into HTML5 by Mark Pilgrim - http://diveintohtml5.org/
• The Spec: http://dev.w3.org/html5/spec/Overview.html
• The HTML5 Test: http://www.html5test.com/
• Modernizr: http://www.modernizr.com/