Extensibility, HTML, and the Web ecosystem

Extensibility, HTML, and the Web ecosystem

Edward O'Connor
BarCamp San Diego 5

There are at least 32.89 billion web pages.

HTML

the language of the Web

angle brackets

elements and attributes

<a href>, <img src alt>, etc.

Why was HTML so wildly successful?

1. view source

2. cut & paste

3. F5

engine of generativity

[Generativity is] the ability of a self-contained system to provide an independent ability to create, generate or produce content without any input from the originators of the system.

Generativity on Wikipedia

HTML is a controlled vocabulary

104 elements, 169 attributes

What if that's not enough?

Extending HTML

1. alter meaning of existing els/attrs

layer additional meaning

@class, @id, @rel, meta@name

semantic class names

<ul class="blogroll">

<em class="RFC2119">MUST</em>

Avoiding collisions

apple: computer or fruit?

word sense disambiguation

centralized
(pre-defined @rel / meta@name values)

coordinated (microformats)

distributed: head@profile

<html>
<head profile="http://example.com/RFC2119"/>
  …
</head>
<body>
  …
  <em class="RFC2119">MUST</em>
  …
</body>
</html>

distributed: JFGI

2. Adding new elements and attributes

There are only two hard things in Computer Science: cache invalidation and naming things.

Phil Karlton

centralized v. distributed

centralized: HTML WG

distributed: ?

distributed extensibility

(ISSUE-41)

the promise of XHTML, circa 1998

<aside>: XML

elements and attributes

also angle brackets

<foo bar="baz"/>

looks so much like HTML

looks are deceiving!

</aside>

Distributed extensibility ends up reducing to a power-struggle between browser vendors who want to dictate what the vocabulary of the Web is—and content creators who do not want to cede this right entirely to the browser.

TV Raman, W3C TAG

There is no vast, browser-wing conspiracy. Really. Honest.

<apple>: computer or fruit?

Coping mechanisms

1. punt

<canvas>

We're stuck with them.

Support Existing Content

2. Sufficiently Interesting(TM) prefixes

<moz-blink>, <ms-marquee>, <apple-canvas>

(Think Python package names)

-moz-border-radius

3. Controlled prefix minting

DNS

(Java package names)

<com.netscape.tags.blink>
<com.microsoft.tags.marquee>
<com.apple.tags.canvas>

somewhat ugly

4. URI-based qualification

foo

becomes

{http://example.com/ns#, foo}

Names become {uri, term} pair

Gets ugly FAST

<{http://example.com/ns1#, foo}>
  <{http://example.com/ns2#, bar}
     {http://example.com/ns3#, baz}="quux"/>
</{http://example.com/ns1#, foo}>

Namespaces in XML

Prefix-based indirection

<foo xmlns="http://example.com/ns1#"
     xmlns:alpha="http://example.com/ns2#"
     xmlns:beta="http://example.com/ns3#">
  <alpha:bar beta:baz="quux"/>
</foo>

Common case

<foo>
  <alpha:bar beta:baz="quux"/>
</foo>

Prefix is ephemeral

<foo xmlns="http://example.com/ns1#"
     xmlns:alpha="http://example.com/ns1#">
  <bar/>
  <alpha:bar/>
</foo>

Lifts part of element name into metadata

Data and metadata

the accuracy of metadata is inversely proportional to the square of the distance between the metadata and the data which it proports to describe.

Ruby's Postulate

HTTP headers
v.
<meta name="http-equiv">

authoritative metadata

document fragments

1. view source

2. cut & paste

3. F5

engine of metacrap

There is no such thing as risk-free copy and paste.

Shelley Powers

Disambiguation redux

The only risk is copying and pasting them into a document that doesn't provide namespace definitions for the prefixes[...]

[... or are] you thinking that someone will be using different namespaces but the same prefix? Come on — do you really think that will happen?

Shelley Powers

Yes. Yes, it will.

morons and assholes

SearchMonkey v1: hard-coded prefixes

Google's handling of RDF blocks for license declarations is all done with regular expressions instead of actually parsing the namespaces[...]

Ian Hickson

Feed parsing

And frankly, few people will be doing copying and pasting. Most metadata will probably be added either as part of an underlying tool[...]

Shelley Powers

argumentum ad adminiculum
the tools won't save us

Hand authoring

[E]arly adopters having difficulties is indicative of a feature that will be significantly more problematic when used by the (less well informed/competent) population of authors as a whole.

James Graham

Web Environmentalism

Would the Web platform be better if <canvas> were <apple:canvas xmlns:apple="http://www.apple.com/2004/07/namespaces/webkit/dashboard#"> instead of <canvas>?

Henri Sivonen

Categorical imperative

Design for Bob

Varieties of disambiguation and extensibility worth wanting

benefits: how well do they allow author to express novel semantics and how well can we avoid collisions

costs: how badly do they harm the Web

80/20

1. Adding elements and attributes:

require wide (WG) review

Prefix-based indirection within a URI-based extensibility scheme: benefits not worth the cost

2. Augmenting existing elements and attributes

Profiling is overkill; head@profile unused in practice by the very communities it was for

Sufficiently-Interesting, Google-able, semantic class names appear to get us all the disambiguation we need

Java-style DNS-derived names for the extra-paranoid

Upcoming microdata attribues @item, @itemprop, @subject avoid colloding with class names in the wild

Look ma, no namespaces

thank you

cc by-sa 3.0