AEA Seattle - Day 3 - A Day Apart

Hey, do you know what an asterisk is? Well if you do and you see one, it means that the session you’re looking at is currently taking place. Alright?

Understand HTML5

Jeremy Keith
Web standards are a lot like sausages. They’re great, they’re delicious, but you don’t want to see how they’re made.
Jeremy Keith

HTML5

  1. History
  2. The Specification
  3. Semantics
  4. Structure

History

HTML

  1. October 1991: HTML Tags - Tim Berners-Lee
  2. November 1995: HTML 2.0 - IETF
  3. January 1997: HTML 3.2 - W3C
  4. December 1997: HTML 4.0 - Strict, Transitional, Frameset
  5. December 1999: HTML 4.01

XHTML

  1. January 2000: XHTML 1.0 - Strict, Transitional, Frameset. This was essentially just taking HTML 4.01 and making it XML.
  2. May 2001: XHTML 1.1 - mime-type:application/xml
  3. Never: XHTML 2.0. This was going to be completely different. They even debated removing the ‹img› tag.

Web Hypertext Application Technology Working Group (WHATWG)

  1. June 2004: Opera and Mozilla set up the mailing list.
  2. HTML5 - Web Applications 1.0 & Web Forms 2.0
  3. October 2006: Reinventing HTML - Tim Berners-Lee
  4. May 2007: W3C HTML Working Group
  5. January 2008: HTML 5

Timeline

  1. ? (any day now): Last Call Working Draft
  2. 2012: Candidate Recommendation (most standards we use are in this status). This is the date that matters, it means the spec is done.
  3. 2022: Proposed Recommendation - There need to be at least 2 fully operable implementations. HTML 4 wasn’t completely implimented by IE until 8.
  4. None of the dates are really that relevant. All that matters is whether or not browsers support features.

The Specification

Design Principles

Doctype

  • ‹!DOCTYPE html› - It’s HTML, it doesn’t matter which version it is.
  • Browsers don’t care about the doctype (except for triggering quirks or standards mode). The only reason they were originally created is for validators.
  • You can even leave the HTML 5 doctype out and be okay.
  • HTML 5 is technically any HTML document.

Character Encoding

  • Sending the character encoding from the server is the preferred way.
  • ‹meta charset="utf-8"›

Serialisation

  • HTML5 - must be served using the text/html MIME type.
  • XHTML5 - must be served using an XML MIME type, such as application/xhtml+xml or application/xml.

Syntax

  • You don’t have to close stand-alone elements (like ‹img›) and some elements don’t need closing tags (like ‹li›)
  • Also, you can use uppercase element and attribute names.
  • Quotes don’t need to be used around attribute values.
  • If you write strict code, keep doing it.

Error Handling

  • The HTML 5 spec will specify what to do when handed bad markup.
  • This doesn’t really effect HTML authors, but it’s hugely beneficial for browser makers.

APIs

  • document.write
  • window.history
  • innerHTML
  • conteteditable
  • Drag and Drop
  • Offline storage

Audio

  • Opening and closing audio tags
  • src attribute
  • controls attribute - Can’t style, but you don’t need to show them. You can make your own and use JavaScript API to make them work.
  • preload attribute
  • Fallback content between the opening and closing tags. This content is only provided for browsers that don’t support the audio tag.

Video

  • Opening and closing video tags
  • All the same attributes as the audio tag
  • width and height attributes - Can be done through CSS too
  • source tag - Source is not an attribute for video
  • Fallback content (works the same way as audio fallbacks).

Canvas

  • Basically a dynamic image

Forms

  • Search
  • Tel
  • Email
  • URL
  • Datetime, date, month, week, time
  • Range (slider)

Semantics

Removed

  • Presentational elements like font, big, center, etc. have been removed.
  • Presentational attributes like border, bgcolor, etc. have been removed.
  • frame, frameset, and noframes are gone.
  • acronym is gone.
  • axis and summary(?) attributes are gone.

Changed

  • The a element can now be wrapped around anything.
  • The b element has been changed to stylistically offset text from the normal prose without conveying extra important.
  • The i works pretty much the same as the b. Both convey no semantic meaning.
  • Now hr is a paragraph-level thematic break.
  • The small element is for small print (for some reason big was removed though).

New Elements

  • mark - An inline element marked or highlighted for reference purposes due to it’s relevance in another context (Google highlighted words).
  • time - A way to encode times in a machine-readable way.
  • article
  • aside
  • details
  • figure
  • footer
  • header
  • hgroup
  • nav
  • section

Structure

Sectioning Content

  • Content that defines the scope of headings and footers.
  • section, article, aside, nav
  • Explicit sections help to define the outline of a document.

Sectioning Roots

  • blockquote, body, figure, td
  • These elements can have their own outlines, but the sections and headings inside these elements to not contribute to the outlines of their ancestors.

Lunch

Bell Harbor Conference Center
Om nom nom nom.

Fish And Chips!

  • I wanted fish and chips last night, but couldn’t find any.
  • Met a cool guy from New York and talked about the conference.
  • This chocolate chip cookie is delicious.

Explore CSS3

Dan Cederholm

3 Chunks

Chunk #1

  • What works today?
  • Transitions, Transforms & Animation
  • Borders & Backgrounds
  • Color & Transparency

Chunk #2

  • Selectors
  • Typography
  • Layout

Chunk #3

  • How are you and I using CSS3?
  • Dribbble
  • Other sites

Progressive Enrichment

  • Style + CSS3
  • Advanced CSS2 + CSS3
  • TV metaphor - It’s like watching a show on a black & white vs. a color TV.
  • Visual rewards vs. “broken”
  • AKA: Really cool stuff that doesn’t work in IE

What Works Today?

Vender-specific Properties

  • -webkit-border-radius, -moz-border-radius, border-radius - Put the non-prefixed version last.
  • Important for testing implementations
  • Precursor for proposed standards
  • Enable us to use stuff now

Transitions

Border Radius

  • Non-prefixed version of individual corner is the same as Webkit - border-top-left-radius
  • Non-uniform radii - border-radius: 0.5em 10px

Text Shadow

  • Actually a CSS2 property that has been in Webkit for a long time.
  • Text Thinning - use a text-shadow the same color as the background to thin out the text. This doesn’t work in Snow Leopard.

Box Shadow

  • Best part - it doesn’t eat into grid gutters.

Multiple Backgrounds

  • Create a fallback for browsers that don’t support mutliple backgrounds. Put the fallback before the multiple background rule.

Color & Opacity

  • Use RGBa on text colors to make them slightly transparent and allow the background color to bleed into the text color.
  • ::selection - Custom selection colors

CSS & CSS3 Selectors

  • Selector compatibility table
  • Use advanced selectors for non-critical situations like removing borders.
  • :first-child (CSS 2.1) works in IE8 and above.
  • Attribute selectors (CSS 2.1) supported by IE7+
  • Disabled/enabled input psuedo-selectors: input[type="text']:disabled

Typography & CSS3

  • Good typography is about using the font faces that we have well, not choosing good font faces.

Drop Caps

  • We can now use :first-letter instead of wrapping the first character in a span.
  • Used in combination with :first-of-type, :first-letter can be used to create a drop caps on just the first paragraph.

Font Embedding

  • Introduced in CSS2
  • Removed in CSS2.1
  • Readded in CSS3

WOFF - Web Open Font Format

  • New standard for type
  • Compressed and designed for the web
  • Includes meta data about the font and where it came from
  • Not encrypted
  • Supported in Firefox 3.6

CSS3 Layout

How Can We Use CSS3 Now?

  • Personal projects
  • Prototyping
  • Non-critical enrichments

Highlights from day 3

  1. Ate a cinnamon roll for breakfast.