web standards: fueling innovation [web builder 2.0 - 2008]

56
Aaron Gustafson Web Standards: Fueling Innovation

Upload: aaron-gustafson

Post on 13-Jan-2015

2.269 views

Category:

Technology


0 download

DESCRIPTION

Web standards are all about rules and structure, formalities that many people find restrictive and stifling. From another perspective, however, the rigid structure of Web standards can be seen as a boon to creativity on the Web. In this session, Aaron Gustafson will teach you how to use smart JavaScript to leverage the extensibility of XHTML and CSS and push the boundaries of Web design and development, all while still adhering to the best practices of Web standards.

TRANSCRIPT

Page 1: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Aaron Gustafson

Web Standards: Fueling Innovation

Page 2: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

“I cannot help fearing that men may reach a point where they look on every new theory as a danger, every innovation as a toilsome trouble, every social advance as a !rst step toward revolution, and that they may absolutely refuse to move at all.

- Alexis de Tocqueville

Photo credit: Lachlan Hardy

Page 3: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

HTML = Foundation

Page 4: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Photo credit: Doblonaut

“Art is good when it springs from necessity. This kind of origin is the guarantee of its value; there is no other.

- Angela Carter

Page 5: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0 10

25

50

0

75

100

elements

attributes

HTML 1 HTML 2 HTML 3 HTML 3.2 HTML 4HTML 4.01XHTML 1

HTML 5

Progress

Page 6: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

25

0

50

75

100

12

elements

attributes

HTM

L 1

HTM

L 2

HTM

L 3

HTM

L 3

.2

HTM

L 4 H

TM

L 5

HTM

L 4

.01

XH

TM

L 1

1995 2000 2005 Future

Progress?

Page 7: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

25

0

50

75

100

-25

-50

13

HT

ML 1

HT

ML 2

HT

ML 3

HT

ML 3

.2

HT

ML 4

HT

ML 5

HT

ML 4

.01

XH

TM

L 1

1995 2000 2005 Future

Today

Progress?

Page 8: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

What’s wrong with this picture?

Photo credit: Matt Carman

Page 9: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

“The arrogance of success is to think that what you did yesterday will be su"cient for tomorrow.

- William Pollard

Photo credit: wvs

Page 10: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Innovation is within reach

Photo credit: Sa!anna

Page 11: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

components

Photo credit: jasonvance

Page 12: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

“The trick.... is to make sure that each limited mechanical part of the Web, each application, is within itself composed of simple parts that will never get too powerful.

- Tim Berners-LeePhoto credit: tricky™

Page 13: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]
Page 14: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

XFN:

Photo credit: Kelly McCarthy

<a href="http://easy-designs.net" rel="friend met co-worker colleague co-resident spouse muse sweetheart">Kelly McCarthy</a>

Page 15: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

XFN:

Photo credit: Kelly McCarthy

<a href="http://easy-designs.net" rel="me">Aaron</a>

Page 16: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

XFN:

Photo credit: Kelly McCarthy

<a href="http://duoh.com" rel="friend met colleague">Veerle Pieters</a>

Page 17: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

XFN:

Photo credit: Kelly McCarthy

<a href="http://duoh.com" rel="friend met colleague">Geert Leyseele</a>

Page 18: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

rel-tag:

Photo credit: {Psychic Noise}

<a href="http://en.wikipedia.org/wiki/Rudbeckia_hirta" rel="tag">Black-eyed Susan</a>

Page 19: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

rel-license:

Photo credit: Pear Biter

<a href="http://creativecommons.org/licenses/by-sa/ 2.0/deed.en" rel="license">Creative Commons Attribution-Share Alike 2.0</a>

Page 20: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

classi!cation

Photo credit: jasonvance

Page 21: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

ScaleabilityAs time goes by, people's expectations change, and more will be demanded of HTML. One manifestation of this is the pressure to add yet more tags. HTML 3.0 introduces a means for subclassing elements in an open-ended way.

...This ability to make fresh distinctions can be exploited to impart distinct rendering styles or to support richer search mechanisms, without further complicating the HTML document format itself.

- HTML 3.0 Draft

Page 22: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

CLASSThis a space separated list of SGML NAME tokens and is used to subclass tag names.

...The CLASS attribute is most commonly used to attach a di#erent style to some element, but it is recommended that where practical class names should be picked on the basis of the element's semantics, as this will permit other uses, such as restricting search through documents by matching on element class names.

- HTML 3.0 Draft

Page 23: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]
Page 24: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

“Microformats are carefully designed (X)HTML class names that extend the semantics of (X)HTML and enable authors to publish higher semantic !delity content such as people, events, reviews, etc.

- Tantek Çelik

Page 25: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

HTML 3:<person>Joe Blow</person>

microformats:<div class="vcard"> <span class="fn"> Joe Blow </span></div>

Photo credit: assbach

Page 26: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

HTML 3:<person>Joe Blow</person>

microformats:<div class="vcard"><span class="fn"> Joe Blow</span><a class="org url" href="http://web.com"> Company</a><div class="tel"> <span class="type"> Work</span> +1-650-289-4040</div></div>

Photo credit: assbach

Page 27: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Figure 1: The “Faces of the Fallen” exhibit

at Arlington National Cemetery

Photo by Aaron Gustafson

HTML 3:<fig src="photo.jpg"><caption><em>Figure 1:</em> The “Faces of the Fallen” exhibit at Arlington National Cemetary </caption><credit>Aaron Gustafson </credit></fig>

Page 28: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Figure 1: The “Faces of the Fallen” exhibit

at Arlington National Cemetery

Photo by Aaron Gustafson

microformats:<div class="figure"><img src="fa.jpg" alt="" /><p class="credit vcard"> <abbr class="type" title="Photograph">Photo </abbr> by <cite class="fn">Aaron Gustafson </cite></p><p class="caption"><em class="legend">Figure 1</em> The <span class="subject"> “Faces of the Fallen” exhibit</span> at Arlington National Cemetery.</p></div>

Page 29: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Figure 1: The “Faces of the Fallen” exhibit

at Arlington National Cemetery

Photo by Aaron Gustafson

HTML 5:<figure><img src="fa.jpg" alt="" /><legend>Figure 1</legend><p>Photo by <cite>Aaron Gustafson</cite></p><p>The “Faces of the Fallen” exhibit at Arlington National Cemetery.</p></figure>

Page 30: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

extensibility

Photo credit: Guillermo

Page 31: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Why the need for XHTML?Document developers and user agent designers are constantly discovering new ways to express their ideas through new markup.

...The XHTML family is designed to accommodate these extensions through XHTML modules

...These modules will permit the combination of existing and new feature sets when developing content and when designing new user agents.

- XHTML 1.0 Recommendation

Page 32: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Customize an existing DTD

31

<!ELEMENT input EMPTY> <!-- form control -->

<!ATTLIST input

%attrs;

%focus;

type %InputType; "text"

name CDATA #REQUIRED

value CDATA #IMPLIED

checked (checked) #IMPLIED

disabled (disabled) #IMPLIED

readonly (readonly) #IMPLIED

required (required) #IMPLIED

size CDATA #IMPLIED

maxlength %Number; #IMPLIED

src %URI; #IMPLIED

alt CDATA #IMPLIED

usemap %URI; #IMPLIED

onselect %Script; #IMPLIED

onchange %Script; #IMPLIED

accept %ContentTypes; #IMPLIED

>

Page 33: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Complex custom attributes

32

<!ENTITY % VSchema

"(email | phone | address | postcode |

name | title |

alpha | numeric | alphanumeric |

date | range)"

>

<!--

Implementation of ValidateFor

To be used on text inputs, range takes the type of schema (VScema, above)

validation should be performed against:

validatefor="name"

-->

<!ELEMENT input EMPTY> <!-- form control -->

<!ATTLIST input

...

usemap %URI; #IMPLIED

validatefor %VSchema; #IMPLIED

onselect %Script; #IMPLIED

onchange %Script; #IMPLIED

accept %ContentTypes; #IMPLIED

>

Page 34: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Or get Modular

33

<!ATTLIST %input.qname;

%FormValidation.pfx;limit CDATA #IMPLIED

%FormValidation.pfx;range CDATA #IMPLIED

%FormValidation.pfx;required (required) #IMPLIED

%FormValidation.pfx;match IDREF #IMPLIED

%FormValidation.pfx;maxlength %Number; #IMPLIED

%FormValidation.pfx;validatefor %VSchema; #IMPLIED

>

Tutorial on XHTML Modularization: http://tinyurl.com/52g2xc

Page 35: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Put your creation to work

34

<form action="/path/to/action" method="post">

<ol>

<li>

<label for="email">Your Email</label>

<input type="text" id="email" name="email" required="required"

maxlength="255" validatefor="email" />

</li>

<li>

<label for="pw1">Password</label>

<input type="password" id="pw1" name="pw1" required="required"

maxlength="20" validatefor="alphanumeric" match="pw2" />

</li>

<li>

<label for="pw2">Confirm Password</label>

<input type="password" id="pw2" name="pw2" required="required"

maxlength="20" validatefor="alphanumeric" match="pw1" />

</li>

<li><button type="submit">Register</button></li>

</ol>

</form>

Page 36: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

4.1.2.1 Vendor-speci!c extensionsIn CSS, identi!ers may begin with '-' (dash) or '_' (underscore). Keywords and property names beginning with -' or '_' are reserved for vendor-speci!c extensions.

- CSS 2.1 Speci!cation

Page 37: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Currently used by browsers

36

div {

-moz-border-radius: 10px;

-webkit-border-radius: 10px;

background: #444;

border: 3px solid #222;

color: #fff;

opacity: .9;

padding: 6px;

}

Page 38: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Currently used by browsers

36

div {

-moz-border-radius: 10px;

-webkit-border-radius: 10px;

background: #444;

border: 3px solid #222;

color: #fff;

opacity: .9;

padding: 6px;

}

Lorem ipsum dolor sit amet, consectetuer adipiscing

elit, sed diam nonummy nibh euismod tincidunt ut

laoreet dolore magna aliquam erat volutpat. Ut wisi

enim ad minim veniam, quis nostrud exerci tation

ullamcorper suscipit lobortis nisl ut aliquip ex ea

commodo consequat. Duis autem vel eum iriure

dolor in hendrerit in vulputate.

Page 39: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

be your own vendor

Photo credit: Rigmarole

Page 40: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Presentation where it belongs

38

div#focal img {

-easy-frame: polaroid;

}

Page 41: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Photo credit: kayepants

putting it together

Page 42: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Progressive Enhancement

sweet & simple

Page 43: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Classification for

interface control

Page 44: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Crufty

42

<h1>Pumpkin Pie</h1>

<div class="container">

<div class="section">

<h2>Overview</h2>

<img src="pie.jpg" alt="">

<p>Whether you're hosting a festive party or a casual get-together with

friends, our Pumpkin Pie will make entertaining easy!</p>

...

</div>

...

<ul class="tabs">

<li><a href="#">Overview</a></li>

<li><a href="#">Ingredients</a></li>

<li><a href="#">Directions</a></li>

<li><a href="#">Nutrition</a></li>

</ul>

</div>

Page 45: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Classy

43

<h1>Pumpkin Pie</h1>

<div class="tabbed">

<h2>Overview</h2>

<img src="pie.jpg" alt="" />

<p>Whether you're hosting a festive party or a casual get-together with

friends, our Pumpkin Pie will make entertaining easy!</p>

...

<h2>Ingredients</h2>

<ul>

<li>1 (9<abbr title="inch">in</abbr>) unbaked deep dish pie crust</li>

<li>! cup white sugar</li>

<li>1 <abbr title="teaspoon">tsp</abbr> ground cinnamon</li>

...

</ul>

<h2>Directions</h2>

...

</div>

Page 46: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Classy

44

Using Prototype:document.observe("dom:loaded", function(){

var cabinet = [];

$$('.tabbed').each( function( item, i ){

cabinet.push( new TabInterface( item, i ) );

});

});

TabInterface: http://tinyurl.com/3paywu

Page 47: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

JavaScript: good at looking for things to do

Photo credit: Messiah Divine

Page 48: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Classification for

better form controls

Faster

FasterMediumSlower

Page 49: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Classy

47

<label for="speed">Select a Speed:</label>

<select name="speed" class="slider">

<option value="Slower">Slower</option>

<option value="Slow">Slow</option>

<option value="Medium" selected="selected">Medium</option>

<option value="Fast">Fast</option>

<option value="Faster">Faster</option>

</select>

accessibleUISlider: http://tinyurl.com/4kstyj

Page 50: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Classy

47

<label for="speed">Select a Speed:</label>

<select name="speed" class="slider">

<option value="Slower">Slower</option>

<option value="Slow">Slow</option>

<option value="Medium" selected="selected">Medium</option>

<option value="Fast">Fast</option>

<option value="Faster">Faster</option>

</select>

Using jQuery:$('select.slider').accessibleUISlider();

accessibleUISlider: http://tinyurl.com/4kstyj

Page 51: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Classy

47

<label for="speed">Select a Speed:</label>

<select name="speed" class="slider">

<option value="Slower">Slower</option>

<option value="Slow">Slow</option>

<option value="Medium" selected="selected">Medium</option>

<option value="Fast">Fast</option>

<option value="Faster">Faster</option>

</select>

Using jQuery:$('select.slider').accessibleUISlider();

accessibleUISlider: http://tinyurl.com/4kstyj

A step farther?select {

-jQueryUI-control: slider;

}

Page 52: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Don’t be afraid

to get creative

Page 53: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

WEB STANDARDS: FUELING INNOVATION

WEB BUILDER 2.0

Presentational Flash

49

#sidebar:after {

-gfss-source: url(spiral.swf);

-gfss-background-color: #000;

-gfss-flash-version: 6;

-gfss-quality: high;

-gfss-width: 50;

-gfss-height: 50;

position: absolute;

top: 0;

left: 0;

}

Page 54: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

“Innovation is the ability to see change as an opportunity - not a threat.

- AnonymousPhoto credit: Erica_Marshall

Page 55: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Aaron Gustafson

Web Standards: Fueling Innovation

Page 56: Web Standards: Fueling Innovation [Web Builder 2.0 - 2008]

Slides available athttp://slideshare.net/AaronGustafson

This presentation is licensed underCreative Commons

Attribution-Noncommercial-Share Alike 3.0

flickr Photo Credits“One Step at a Time” by Lachlan Hardy

“solid foundation” by nuanc“Rocas del fuego y del agua” by Doblonaut

“Pinkstone” by Matt Carman“reflecting_building_633_dark-sky_01” by wvs

“I love my toolbox 15 July Scavenger Hunt” by Sa!anna“Look like dead, but they're alive!” by iosonofabio

“Simple” by tricky™“Kelly, Aaron, Geert & Veerle” by Kelly McCarthy

“3/365 ~ Just because you are lost, doesn't mean that people can't find you...” by {Psychic Noise}“The Sun Sets on Château de Chillon” by Pear Biter“112 Classification of Knowledge” by jasonvance

“#256 Exchanging change with exchange” by assbach“Legospective” by Guillerm"

“crawfordmarketcarrotman” by Rigmarole“70:365 Happyface vs. Sadface” by kayepants

“Monkey Grooming” by Messiah Divine“Wanna go for a ride?” by Erica_Marshall