Fast development
Easy deployment
Simple to process: a form submits a list of name=value pairs
Good browser support
Validation
Repeats
Client Side Processing
Rich UIs
Of course JavaScript makes up for some of this, but it's relatively hard to write and maintain.
Toolkits help.
The W3C stopped HTML development with HTML 4 in 1999.
Microsoft stopped browser development in 2001 with IE6.
Maybe that was a little too soon?
Opera, Mozilla, Apple, KDE kept working
Opera, Mozilla, Apple
Minus one notable vendor
HTML 5
Web Apps 1.0
Web Forms 2.0
provides new strongly-typed input fields, new attributes for defining constraints, a repeating model for declarative repeating of form sections, new DOM interfaces, new DOM events for validation and dependency tracking, and XML submission and initialization of forms. It also standardises and codifies existing practice in areas that have not been previously documented, and clarifies some of the interactions of HTML form controls and CSS.
Use a type
attribute on an input
element
Web Forms 2.0 aware browsers can:
use custom controls (e.g. a calendar for a date)
check the validity of submitted data
Web Forms 2.0 unaware browsers can ignore this and operate as normal
<label>E-mail address: <input type="email" name="addr"></label> <p> <label>Start date: <input type="date" name="start"></label> </p>
date (Gregorian calendar)
time
datetime
datetime-local
month
week
number
url (absolute only)
range
<form>
<p>
<label>Time: <input type="time" name="time" /></label>
</p>
<p>
<label>Date and time:
<input type="datetime" name="datetime" />
</label>
</label>
</p>
<p>
<label>Local date and time:
<input type="datetime-local" name="localdatetime" />
</label>
</p>
<p>
<label>Month: <input type="month" name="month" /></label>
</p>
<p>
<label>Week: <input type="week" name="week" /></label>
</p>
<p>
<label>Number: <input type="number" name="number" /></label>
</p>
<p>
<label>URL: <input type="url" name="url" /></label>
</p>
<p>
<label><input type="submit" value="Send data" /></label>
</p>
</form>
date
time
datetime
datetime-local
month
week
number
<form>
<p>
<label>Pick a number between 1 and 12:
<input type="number" name="number" min='1' max='12' />
</label>
</p>
<p>
<label>Time:
<input type="time" min="08:30" max="12:00" name="morning" />
</label>
</p>
<p>
<label>Pick a day:
<input type="date" name="date" min="2007-03-22"/>
</label>
</p>
<p>
<label>Month:
<input type="month" name="month" />
</label>
</p>
<p>
<label><input type="submit" value="Send data" /></label>
</p>
</form>
Applies to any ranged type:
Specifies precision
Defaults to 1 except for time, which defaults to 60 seconds
<form>
<p>
<label>Pick a number between 1 and 12:
<input type="number" name="number" min='1' max='12' step='0.01'/>
</label>
</p>
<p>
<label>Time:
<input type="time" min="08:30" max="12:00" name="morning" step='1'/>
</label>
</p>
<p>
<label><input type="submit" value="Send data" /></label>
</p>
</form>
Like a number but exact value is not important
Can use a slider widget
min
max
step (defaults to 1)
<form>
<input type="range" name="number"
min='1' max='12' step='0.01'/></label>
<p>
<label>
<input type="submit" value="Send data" />
</label>
</p>
</form>
Specifies a regular expression the input value must match
Applies to text, password, email, and url types of the input
element, and the textarea
element
Regular expression dialect is same as JavaScript's (ECMA 262)
<form>
<p>
<label>Card number:
<input type="text" name="cardnumber"
pattern='\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d(\d\d\d)?'/>
</label>
</p>
<p>
<label>
<input type="submit" value="Send data" />
</label>
</p>
</form>
Specify required='required'
on an input element to prevent the form from being submitted without filling in this value.
Redundant with pattern or type that does not allow empty string
<form>
<p>
<label>Card number:
<input type="text" name="cardnumber"
required="required"
pattern='\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d(\d\d\d)?'/>
</label>
</p>
<p>
<label>
<input type="submit" value="Send data" />
</label>
</p>
</form>
Offers the user a list of possible values to input
list
attribute names a datalist
element
datalist
element contains option
elements specifying the possible values
The option element can have a value
attribute or value content
Other values may still be typed manually.
Some tricks are needed for legacy browsers.
<form>
<p><label>Type the species:
<input type="text" name="species" list="species" />
</label></p>
<p><datalist id="species">
<label>
or choose one from the list:
<select name="species">
<option>Double-crested Cormorant</option>
<option>Great Cormorant</option>
<option>Great Blue Heron</option>
<option>Little Blue Heron</option>
<!-- ... -->
</select>
</label>
</datalist></p>
<p><label><input type="submit" value="Send data" /></label></p>
</form>
autocomplete='on'
(the default) means browsers may offer to autocomplete the value using pop-ups or what not
autocomplete='off'
means they should not, usually for security reasons
Applies to the text, password, date-related, time-related, numeric, email, and url controls
<form>
<p><label>Autocompleting E-mail address:
<input type="email" name="addr"/></label></p>
<p><label>Non-autocompleting e-mail address:
<input type="email" name="addr" autocomplete='off'/>
</label></p>
<p><label><input type="submit" value="Send data" /></label></p>
</form>
autofocus='autofocus'
Automatically focus this control when the page is loaded
Shouldn't be more than one of these; if there is, focus the last one loaded
<form>
<p>
<label>E-mail address:
<input type="email" name="addr"
autofocus='autofocus' />
</label>
</p>
<p>
<label><input type="submit" value="Send data" /></label>
</p>
</form>
inputmode='script modifier modifier...'
Indicates how the user may wish to enter text for different scripts.
Same as XForms
<form>
<p><label>Family name:
<input name='family' inputmode='hiragana' />
</label></p>
<p><label>(in kana):
<input name='familykana' inputmode='katakana' />
</label></p>
<p><label>Given name:
<input name='given' inputmode='hiragana' />
</label></p>
<p><label>(in kana):
<input name='givenkana' inputmode='katakana' />
</label></p>
<p><label>Zip code:
<input name='zip' inputmode='latin digits' />
</label></p>
<p><label>Address:
<input name='address' inputmode='hiragana' />
</label></p>
<p><label>(in kana):
<input name='addresskana' inputmode='katakana' />
</label></p>
<p><label>Email:
<input name='email' inputmode='latin lowerCase' />
</label></p>
<p><label>Telephone:
<input name='telephone' inputmode='latin digits' />
</label></p>
<p><label>Comments:
<textarea name='comments' inputmode='user predictOn' />
</label></p>
</form>
inputmode='user' for the user's default input mode
or any Unicode script name:
arabic
armenian
bengali
bopomofo
braille
buhid
canadianAboriginal
cherokee
cyrillic
deseret
devanagari
ethiopic
georgian
greek
gujarati
gurmukhi
han
hangul
hanja
hanunoo
hebrew
hiragana
ipa
kanji
kannada
katakana
khmer
lao
latin
malayalam
math
mongolian
myanmar
oriya
simplifiedHanzi
sinhala
syriac
tagalog
tagbanwa
tamil
telugu
thaana
thai
tibetan
yi
lowerCase
upperCase
titleCase
startUpper
digits
symbols
predictOn
predictOff
Not an exhaustive list
JavaScript used to calculate new value as event responses
Value is shown to user, but not submitted to server
Inline element
<form>
<p>
<label>Name:
<input name="a" value="" />
</label>
</p>
<p>
<output name="greetings"
onforminput='value = "Hello" + a.value'>
Hello
</output>
</p>
</form>
Use the form
attribute to indicate which form they belong to:
<input for="birdreport" type="radio"
name="date" value="today" checked="yes" /> Today
...
<form id="birdreport" action="...">
...
</form>
Hidden fields can go in head????
Fill a select
element with options from an external XML document.
MIME media type of the external document must be application/xml or some XML type.
The document contains a single select element in the XHTML namespace containing option elements.
<form>
<label>Choose the species:
<select name="species" data='examples/species.xhtml'></select>
</label>
<label><input type="submit" value="Send data" /></label></p>
</form>
A data
attribute on the form
element points to an XML document containing the
initial values:
<form data="http://www.example.com/prefill/birddata.xml">
<p><label>Quantity: <input type="number" name="quan"/></label></p>
<p><label>Price: <input type="number" name="price"/></label></p>
</form>
Of course, the URL could point to a database-generated document that grabs the user's current values
The external document is a well-formed formdata
element:
<formdata xmlns='http://n.whatwg.org/formdata'>
<field name="quan">17</field>
<field name="price">23.95</field>
<!-- ... -->
</formdata>
MIME media type of the external document must be application/xml or some XML type.
Template based
Good for shopping carts and the like
Add, remove, move-up, and move-down buttons
Requires server side support or JavaScript to fake in existing browsers
An XHTML element with a repeat
attribute in no namespace
Or a non-XHTML element with an xhtml:repeat
attribute
<div id="observation" repeat="template">
<label>Species:
<input type="text" name="species[observation].name" value="" />
</label>
<label>Count:
<input type="number" min='1' value=""
name="species[observation].number" />
</label>
</div>
<div><button type="add" template="observation">Add Species</button></div>
repeat-start
attribute gives you several repetitions before any buttons are pressed.
<div id="observation" repeat="template" repeat-start="5">
<label>Species:
<input type="text" name="species[observation].name" value="" />
</label>
<label>Count:
<input type="number" min='1' value=""
name="species[observation].number" />
</label>
</div>
<div><button type="add" template="observation">Add Species</button></div>
add
remove
move-up
move-down
<div id="observation" repeat="template" repeat-start="5">
<label>Species:
<input type="text" name="species[observation].name" value="" />
</label>
<label>Count:
<input type="number" min='1' value=""
name="species[observation].number" />
</label>
<button type="remove">Delete</button>
<button type="move-up">Move Up</button>
<button type="move-down">Move Down</button>
</div>
<div><button type="add" template="observation">Add Species</button></div>
repeat-min won't let there be fewer repetitions than this when removing.
repeat-max won't let there be more repetitions than this when adding.
<div id="observation" repeat="template"
repeat-start="5" repeat-min="3" repeat-max="10">
<label>Species:
<input type="text" name="species[observation].name" value="" />
</label>
<label>Count:
<input type="number" min='1' value=""
name="species[observation].number" />
</label>
<button type="remove">Delete Species</button>
</div>
<div><button type="add" template="observation">Add Species</button></div>
method=
GET
POST
PUT
DELETE
application/x-www-form-urlencoded
multipart/form-data
application/x-www-form+xml
text/plain
The default encoding
Only option for GET
Just like today's Web Forms 1.0
The index increments as necessary to handle repeating fields with the same name.
This form:
<form action="http://example.com/formprocessor"
enctype="application/x-www-form+xml"
method="post">
<label>Family name:
<input name='family' />
</label></p>
<p><label>Given name:
<input name='given' />
</label></p>
<p><label>Address:
<input name='address' />
</label></p>
<p><label>Zip code:
<input name='zip' />
</label></p>
<p><label>Email:
<input name='email' />
</label></p>
<p><label>Telephone:
<input name='telephone' />
</label></p>
<p><label>Comments:
<textarea name='comments' />
</label></p>
<p><label><input type="submit" value="Send data" /></label></p>
</form>
Generates this submission:
Content-Type: application/x-www-form+xml
<formdata xmlns="http://n.whatwg.org/formdata">
<field name="family" index="0">Smith</field>
<field name="given" index="0">John</field>
<field name="address" index="0">123 Nowhere Str.</field>
<field name="zip" index="0">10003</field>
<field name="email" index="0">jsmith456@aol.com</field>
<field name="telephone" index="0">212-555-3248</field>
<field name="comments" index="0">Web Forms 2.0 is cool.</field>
</formdata>
The index increments as necessary to handle repeating fields with the same name.
Base-64 encoded
Added in a file element:
<file name="photo" index="0" filename="egret.jpg" type="image/jpg">
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAABGdBTUEAAK
/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwA
AAAGUExURQD/AAAAAG8DfkMAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAA
...
AASUVORK5CYII=
</file>
This form:
<form action="http://example.com/formprocessor"
enctype="text/plain"
method="post">
<label>Family name:
<input name='family' />
</label></p>
<p><label>Given name:
<input name='given' />
</label></p>
<p><label>Address:
<input name='address' />
</label></p>
<p><label>Zip code:
<input name='zip' />
</label></p>
<p><label>Email:
<input name='email' />
</label></p>
<p><label>Telephone:
<input name='telephone' />
</label></p>
<p><label>Comments:
<textarea name='comments' />
</label></p>
<p><label><input type="submit" value="Send data" /></label></p>
</form>
Generates this submission:
Content-Type: text/plain
family=Smith
given=John
address=123 Nowhere Str.
zip=10003
email=jsmith456@aol.com
telephone=212-555-3248
comments=Web Forms 2.0 is cool
ftp:
data:
file:
mailto:
javascript:
action
attribute on form is now optional
If action
attribute is not present, form data is submitted to the page's own URL.
replace="document"
: when the form is submitted, the entire document is replaced by the returned content
replace="values"
: when the form is submitted, the server response contains new values with which to fill the form fields
Old:
change
: field value changed
forminput
:
submit
: submit the form
reset
: reset the form
New:
formchange
:
input
: user input some value into a field (possibly partial, possibly coalesced)
invalid
: fired for each invalid element when the form is submitted
received
:
DOMControlValueChanged
:
Opera 9 handles this pretty damn well.
Safari 2 and Firefox 2 do not support this out of the box.
Microsoft is ignoring this
But most of this can be implemented by adding a JavaScript library.
BTW, the WF2 implementation for IE, although unfinished, does work. It implements all of the <input> types (except datetime), the <datalist> element, the <output> element, validation and ValidityState objects, multiple forms and the new events. The implementation looks and feels exactly like a native Windows implementation. We even mimic the user's current XP theme. Download it and try it. I would appreciate any feedback either privately or on this list.
--Dean Edwards on the WHAT WG List, Monday, 05 Feb 2007 20:30:03
Google's Weston Ruter has created a cross-browser JavaScript implementation of the repetition model.
Many points of overlap: repeating controls, client side validation, output fields, etc.
XForms is a finished spec.
XForms has multiple existing implementations in Flash, JavaScript, server side frameworks, and plug-ins.
XForms uses a model-view-controller architecture.
XForms can generate essentially arbitrary XML.
XForms separates content from presentation better.
XForms is based on XPath; Web Forms 2 on JavaScript (especially for output fields)
XForms validates based on schemas; Web Forms based on simple types.
XForms is much more complex.
XForms is less backwards compatible with existing browsers.
Web Forms is supported by Opera and (to a lesser extent) Apple, KDE, and Mozilla.
XForms is supported by IBM, third party vendors, and (to a lesser extent) Mozilla.
XForms is better for more complex, multidevice (paper, PDA, desktop) forms.
XForms is better for new applications that might otherwise require a thick client GUI or many screens.
XForms requires some changes to how you develop software.
XForms replaces a lot of complex server side toolkits and logic. Web Forms fits more on a single page.
Web Forms is useful for improving existing HTML forms for some users.
Over the course of history, a remarkable number of different groups have jumped up and down and said "*We're* the ones defining HTML!!! Listen to *us*!!!". It's foolish to draw conclusions about any HTML-related spec based either on which group is originating it or what anyone claims the browser engineers are going to do.
--Tim Bray on the atom-syntax mailing list, Tuesday, 28 Nov 2006 15:57:50
a.k.a. HTML 5
"The World Wide Web's markup language has always been HTML. HTML was primarily designed as a language for semantically describing scientific documents, although its general design and adaptations over the years has enabled it to be used to describe a number of other types of documents. The main area that has not been adequately addressed by HTML is a vague subject referred to as Web Applications. This specification attempts to rectify this, while at the same time updating the HTML specifications to address issues raised in the past few years."
"This specification introduces features to HTML and the DOM that ease the authoring of Web-based applications. Additions include the context menus, a direct-mode graphics canvas, inline popup windows, and server-sent events."
Class names
Link types
And lots of new elements
copyright
error
example
issue
note
search
warning
rel
alternate
archives
author
bookmark
contact
external
feed
help
icon
license
nofollow
pingback
prefetch
search
stylesheet
sidebar
tag
first
index
last
next
prev
up
section
aside
header
footer
dialog
m
figure
legend
canvas
details
datalist
datagrid
menu
time
meter
progress
nav
article
Invented by Apple for Safari
Procedural graphics (as opposed to SVG's declarative graphics)
<html><head>
<title>canvas</title>
<script type="text/javascript">
function draw() {
var canvas = document.getElementById('tutorial');
if (canvas.getContext){
var context = canvas.getContext('2d');
context.fillRect(25, 25, 150, 150);
context.clearRect(45, 45, 90, 90);
context.strokeRect(50, 50, 50, 50);
}
}
</script>
</head>
<body onload="draw()">
<canvas style="border: 1px solid black;"
id="tutorial"
width="150" height="150"></canvas>
</body>
</html>
View in Browserdetails
datagrid
command
menu
"interactive representation of tree, list, or tabular data"
Essentially a tree control
Not yet supported anywhere
????
Block level
"represents additional information or controls which the user can obtain on demand."
open='open'
attribute "indicates that the details should be shown to the user. If the attribute is absent, the details should not be shown" until the user asks for them.
Must contain an initial legend
element to summarize details
<p>Josh Gibson holds the all time major
league record for home runs over a career with 962. </p>
<details>
<legend>Gibson's home runs are often not counted because he
played in the Negro Leagues instead of the white
leagues.</legend>
<p>Hank Aaron had only 755. Babe Ruth had 714. Gibson's home
runs are often not counted because he played in the <a
href="http://en.wikipedia.org/wiki/Negro_League_baseball">Negro
Leagues</a> instead of the white leagues. Aaron certainly had to
face tougher pitching in the integrated leagues of his day, but
Ruth faced weaker pitching than Gibson did. In truth, most
records before about 1950 should come with an asterisk.
</p>
</details>
The menu
element is a menu item
The command
element is a menu item
<menu type="popup">
<menu type="toolbar">
<menu>
: plain list
Three types of commands:
command
checkbox
radio
Three descriptions of commands:
label
title
icon
Use JavaScript responses to click events to handle the commands
<menu type="toolbar">
<command icon="/icons/wishlist.png">Add to Wishlist</command>
<command icon="/icons/cart.png">Add to Shopping cart</command>
<command icon="/icons/wallet.png">Buy It Now</command>
</menu>
Block level element for
class=example
, issue
, note
, search
, warning
, etc.
<aside class="warning">
<p>This is still in draft status and may change
before the spoecificaiton is finished.</p>
</aside>
legend
img
embed
object
<figure>
<img src="08fig02.png" width='640' height='480'
alt="That value is not valid"/>
<legend>Figure 8.2
Opera 9 won't allow the user to submit a non-number
for a numeric typed field</legend>
</figure>
Marked or highlighted text
Inline like em
and strong
The Great <m>Egret</m> (also known as the
American <m>Egret</m>) is a large wading bird found worldwide.
The Great <m>Egret</m> flies with slow wing beats. The
scientific name of the Great <m>Egret</m> is <i>Casmerodius
albus</i>.
A generic section (chapter, part, section, whatever) of a document.
Headings (h1
-h6
and header
) implicitly start new sections if they're not the first heading in a section.
<section>
<h1>Validity</h1>
...
<section>
<h2>Add a Transitional DOCTYPE declaration</h2>
...
<section>
<h3>Motivation</h3>
...
</section>
<section>
<h3>Potential Trade-offs</h3>
...
</section>
<section>
<h3>Mechanics</h3>
...
</section>
</section>
<section>
<h2>Eliminate bogons</h2>
...
<section>
<h3>Motivation</h3>
...
</section>
<section>
<h3>Potential Trade-offs</h3>
...
</section>
<section>
<h3>Mechanics</h3>
...
</section>
</section> <section>
<h2>Add alt attributes</h2>
...
<section>
<h3>Motivation</h3>
...
</section>
<section>
<h3>Potential Trade-offs</h3>
...
</section>
<section>
<h3>Mechanics</h3>
...
</section>
</section>
</section>
More than merely a section title
but must contain an h1-h6
<section>
<header>
<p>Chapter 4</p>
<h1>Validity</h1>
<p>Revision information...</p>
<p>Abstract...</p>
<p>Epigraph...</p>
</header>
...
</section>
<footer>
<address>
<a href="mailto:author@somewhere.org">author@somewhere.org</a>
</address>
<p class="copyright">Copyright 2007 Elliotte Rusty Harold</p>
<p class="last_modified">March 5, 2007</p>
</footer>
<nav>
<a href="books/xmljava/">Processing XML with Java</a>
| <a href="books/xian3/">XML in a Nutshell</a>
| <a href="books/effectivexml/">Effective XML</a>
| <a href="books/bible3/">The XML 1.1 Bible</a>
| <a href="books/biblegold/">The XML Bible, Gold Edition</a>
| <a href="books/xml/">XML: Extensible Markup Language</a>
| <a href="reports/">Special Reports</a>
| <a href="books.html">XML Book List</a>
| <a href="examples/">XML Examples</a>
| <a href="slides/">XML Seminar Slides</a>
| <a href="tradeshows.xml">XML Conferences</a>
| <a href="mailinglists.html">XML Mailing Lists</a>
| <a href="quotes2007.html">XML Quotes</a>
| <a href="today.rss">RSS Feed </a>
| <a href="today.atom">Atom Feed </a>
| <a href="http://cafe.elharo.com/">The Cafes</a>
| <a href="http://www.elharo.com/blog/">Mokka mit Schlag</a>
| <a href="http://www.cafeaulait.org">Cafe au Lait</a>
| <a href="http://www.amazon.com/gp/pdp/profile/AYXOSXMBUAT1Y/">Amazon Plog</a>
</nav>
<section title="Monday, March 5, 2007" id="news2007March5">
<article id='March_5_2007_61352' class='2007-03-05T17:03:32Z'>
<p>
<img src="images/newicon.png" alt="" width="90" height="54"
hspace="5" vspace="5" border="0" align="left" /> Stephan Heiss
has released <a
href="http://snowmail.sn.funpic.de/tide/">tIDE</a>, an open
source (GPL) integrated development environment for Java. Java 6
is required. <br clear='all' />
</p>
</article>
<article id='March_5_2007_30410' class='2007-03-05T08:27:50Z'>
<p>
Syncro Soft has released <a
href="http://www.syncrosvnclient.com/">Syncro SVN Client
2.2</a>, a $59 GUI Subversion client written in Java. Version
2.2 "adds as main features support for SVN Annotations,
integration with bug tracking tools and operations on a revision
from the Affected Paths area of History view."
</p>
</article>
</section>
Represents conversation
Uses dt
and dd
elements for speaker and spoken text respectively
<dialog>
<dt>Simplicius </dt>
<dd>According to the straight line AF,
and not according to the curve, such being already excluded
for such a use.</dd>
<dt>Sagredo </dt>
<dd>But I should take neither of them,
seeing that the straight line AF runs obliquely. I should
draw a line perpendicular to CD, for this would seem to me
to be the shortest, as well as being unique among the
infinite number of longer and unequal ones which may be
drawn from the point A to every other point of the opposite
line CD. </dd>
<dt>Salviati </dt>
<dd><p> Your choice and the reason you
adduce for it seem to me most excellent. So now we have it
that the first dimension is determined by a straight line;
the second (namely, breadth) by another straight line, and
not only straight, but at right angles to that which
determines the length. Thus we have defined the two
dimensions of a surface; that is, length and breadth. </p>
<p> But suppose you had to determine a height -- for
example, how high this platform is from the pavement down
below there. Seeing that from any point in the platform we
may draw infinite lines, curved or straight, and all of
different lengths, to the infinite points of the pavement
below, which of all these lines would you make use of? </p>
</dd>
<dt>Sagredo </dt>
<dd>I would fasten a string to the
platform and, by hanging a plummet from it, would let it
freely stretch till it reached very near to the pavement;
the length of such a string being the straightest and
shortest of all the lines that could possibly be drawn from
the same point to the pavement, I should say that it was the
true height in this case.</dd>
<dt>Salviati</dt>
<dd>Very good. And if, from the point on
the pavement indicated by this hanging string (taking the
pavement to be level and not inclined), you should produce
two other straight lines, one for the length and the other
for the breadth of the surface of the pavement, what angles
would they make with the thread?</dd>
<dt>Sagredo </dt>
<dd>They would surely meet at right
angles, since the string faIls perpendicularly and the
pavement is quite flat and level.</dd>
</dialog>
Translated by Stillman Drake
Annotated and Condensed by S. E. Sciortino
http://www.law.umkc.edu/faculty/projects/ftrials/galileo/dialogue.html
Inline element
"represents a scalar measurement within a known range, or a fractional value; for example disk usage, the relevance of a query result, or the fraction of a voting population to have selected a particular candidate."
Six floating point attributes:
value
(text content can stand in for this)
min
low
high
max
optimum
<meter min="0" max="489972528" value="297786952">297786952 blocks used of 489972528, 192185576 available</meter>
Represents a date, a time of day, or a specific time on a specific day
datetime
attribute or value
The Birding BoF leaves the hotel lobby at
<time datetime="2007-03-21 06:00 -8">6:00 A.M. PDT</time>
<p>Progress:
<progress value="32" max="200"><span id="p1">16</span>%</progress>
</p>
<script>
var progressBar = document.getElementById('p1');
function updateProgress(newValue) {
progressBar.textContent = newValue;
}
</script>
"a target for events generated by a remote server"
Empty element:
<event-source
src="http://www.example.com/sensordata/"/>
src attribute points to the event source
Events are sent in application/x-dom-event-stream format.
This is essentially name: value
records with optional values:
All values are given in Celsius Temperature 900: 5.2 Temperature 901: 5.3 Temperature 902: 5.4
Is this server push (at an element level)?
HTMLDocument
HTMLElement
HTMLCollection
HTMLFormControlsCollection
HTMLOptionsCollection
DOMTokenString
impl.hasFeature("HTML", "5.0")
returns true if this is supported
impl.hasFeature("XHTML", "5.0")
returns true if this is supported via XHTML
interface HTMLDocument {
// Resource metadata management
readonly attribute DOMString URL;
attribute DOMString domain;
readonly attribute DOMString referrer;
attribute DOMString cookie;
// DOM tree accessors
attribute DOMString title;
attribute HTMLElement body;
readonly attribute HTMLCollection images;
readonly attribute HTMLCollection links;
readonly attribute HTMLCollection forms;
readonly attribute HTMLCollection anchors;
NodeList getElementsByName(in DOMString elementName);
NodeList getElementsByClassName(in DOMString[] classNames);
// Dynamic markup insertion
attribute DOMString innerHTML;
void open();
void open(in DOMString type);
void open(in DOMString type, in DOMString replace);
void open(in DOMString url, in DOMString name, in DOMString features);
void open(in DOMString url, in DOMString name, in DOMString features, in bool replace);
void close();
void write(in DOMString text);
void writeln(in DOMString text);
// Interaction
readonly attribute Element activeElement;
readonly attribute boolean hasFocus;
// Commands
readonly attribute HTMLCollection commands;
// Editing
attribute boolean designMode;
boolean execCommand(in DOMString commandID);
boolean execCommand(in DOMString commandID, in boolean doShowUI);
boolean execCommand(in DOMString commandID, in boolean doShowUI, in DOMString value);
Selection getSelection();
// Cross-document messaging
void postMessage(in DOMString message);
// lots of other stuff to come
};
Implemented by the nodes representing HTML elements in the DOM
Includes "XHTML elements in XML documents, even when those documents are in another context (e.g. inside an XSLT transform)."
interface HTMLElement : Element {
// DOM tree accessors
NodeList getElementsByClassName(in DOMString[] classNames);
// Dynamic markup insertion
attribute DOMString innerHTML;
// Metadata attributes
attribute DOMString id;
attribute DOMString title;
attribute DOMString lang;
attribute DOMString dir;
attribute DOMTokenString className;
// Interaction
attribute long tabindex;
void click();
void focus();
void blur();
// Commands
attribute HTMLMenuElement contextMenu;
// Editing
attribute boolean draggable;
attribute DOMString contenteditable;
// event handler DOM attributes
attribute EventListener onclick;
...more events...
};
interface HTMLCollection {
readonly attribute unsigned long length;
Element item(in unsigned long index);
Element namedItem(in DOMString name);
};
public interface HTMLCollection {
public int getLength();
public Element item(int index);
public Element namedItem(String name);
};
interface HTMLFormControlsCollection {
readonly attribute unsigned long length;
Element item(in unsigned long index);
Element namedItem(in DOMString name);
};
public interface HTMLFormControlsCollection {
public int getLength();
public HTMLElement item(int index);
public Object namedItem(String name);
};
option
interface HTMLFormControlsCollection {
readonly attribute unsigned long length;
HTMLOptionElement item(in unsigned long index);
Object namedItem(in DOMString name);
};
public interface HTMLFormControlsCollection {
public int getLength();
public HTMLOptionElement item(int index);
public Object namedItem(String name);
};
class
interface DOMTokenString : DOMString {
boolean has(in DOMString token);
void add(in DOMString token);
void remove(in DOMString token);
};
public interface DOMTokenString {
public boolean has(String token);
public void add(String token);
public void remove(String token);
};
document.write
innerHTML
WindowHTML
History
Audio
Client side storage
Web pages acting as protocol and content handlers
interface WindowHTML {
// defined in this section
readonly attribute History history;
readonly attribute ClientInformation navigator;
readonly attribute UndoManager undoManager;
Selection getSelection();
readonly attribute Storage sessionStorage;
readonly attribute StorageList globalStorage;
// defined in other sections
attribute Object onerror;
// more...
};
Audio()
Image()
Image(in unsigned long width)
Image(in unsigned long width, in unsigned long height)
Option()
Option(in DOMString name)
Option(in DOMString name, in DOMString value)
interface History {
readonly attribute long length;
void go(in long delta);
void go();
void back();
void forward();
void pushState(in DOMObject data);
void clearState();
};
interface Location {
readonly attribute DOMString hash;
readonly attribute DOMString host;
readonly attribute DOMString hostname;
readonly attribute DOMString href;
readonly attribute DOMString pathname;
readonly attribute DOMString port;
readonly attribute DOMString protocol;
readonly attribute DOMString search;
void assign(in DOMString url);
void replace(in DOMString url);
void reload();
};
interface ClientInformation {
readonly attribute boolean onLine;
void registerProtocolHandler(in DOMString protocol,
in DOMString uri, in DOMString title);
void registerContentHandler(in DOMString mimeType,
in DOMString uri, in DOMString title);
};
The registerProtocolHandler() method allows Web sites to register themselves as possible handlers for particular protocols. For example, an online fax service could register itself as a handler of the fax: protocol ([RFC2806]), so that if the user clicks on such a link, he is given the opportunity to use that Web site. Analogously, the registerContentHandler() method allows Web sites to register themselves as possible handlers for content in a particular MIME type. For example, the same online fax service could register itself as a handler for image/g3fax files ([RFC1494]), so that if the user has no native application capable of handling G3 Facsimile byte streams, his Web browser can instead suggest he use that site to view the image.
Session and global storage
Keys are strings; values are storage items
Big security issues
interface Storage {
readonly attribute unsigned long length;
DOMString key(in unsigned long index);
StorageItem getItem(in DOMString key);
void setItem(in DOMString key, in DOMString data);
void removeItem(in DOMString key);
};
interface StorageItem {
attribute boolean secure;
attribute DOMString value;
};
interface Audio {
attribute EventListener onload;
attribute EventListener onerror;
void play();
void loop();
void loop(in unsigned long playCount);
void stop();
};
contenteditable="true"
for individual elements
designMode
DOM attribute
Drag and drop events
Undo
HTML 5 adds many more semantic elements. XHTML just XMLizes HTML 4.
HTML 5 expands the DOM.
HTML 5 retains malformed, minimized markup (and defines required error handling).
HTML 5 is much more backwards compatible.
HTML 5 retains malformed, minimized markup (and defines required error handling.
HTML 5 uses Web Forms 2. XHTML 2 uses XForms.
HTML 5 uses canvas
. XHTML 2 uses SVG.
XHTML 2 uses MathML. HTML 5 uses ?
Extremely limited for now. This is for the future.
Many of the new elements are transparent (i.e. depend on must-ignore).
Could use XSLT+CSS to transform an HTML 5 document to classic HTML
with span
s, div
s,
and class
es standing in for the new elements
Spec maybe this year?
Test suite next year?
Fully conformant implementation 2010?
This presentation: http://www.cafeconleche.org/slides/sd2007west/webforms2/
The Web Apps 1.0 spec: http://www.whatwg.org/specs/web-apps/current-work
The Web Forms 2 spec: http://www.whatwg.org/specs/web-forms/current-work/
Canvas tutorial: http://developer.mozilla.org/en/docs/Canvas_tutorial