The WHATWG Blog

Please leave your sense of logic at the door, thanks!

Proposing URI Templates for WebForms 2.0

I recently had an off-list email conversation with Ian Hickson about the possibility of adding URI Template support to the FORM element in WebForms 2.0. I've documented our conversation and my response to his suggestion to use server-side direct or Javascript instead over at the Well Designed URL Initiative blog. However, I've provided some examples of what I'm proposing below:

<form 
  action="http://foo.com/model"
  template="http://foo.com/{make}/{model}/"
  method="get">
  <input type="text" name="make" />
  <input type="text" name="mode" />
  <input type="submit" />
</form>
<form
  action="http://www.myblog.com/topic"
  template="http://www.myblog.com/{topic}/"
  method="post">
  <select name="topic">
    <option value="first">My 1st Post</option>
    <option value="second">My 2nd Post</option>
    <option value="third">My 3d Post</option>
  </select>
  <input type="text" name="comment">
  <input type="submit">
</form>
<form 
  action="http://blog.whatwg.org/topic"
  template="http://blog.whatwg.org/{topic}"
  method="post">
  <select name="topic">
    <option value="feed-autodiscovery">
       Feed Autodiscovery
    </option>
    <option
value="text-content-checking">
        textContent Checking
    </option>
    <option value="checker-bug-fixes">
        Bug Fixes
    </option>
    <option
        value="significant-inline-checking">
        Significant Inline Checking
    </option>
    <option value="charmod-norm-checking">
        Charmod Norm Checking
    </option>
    <option
value="proposing-features">
        Proposing features
    </option>
  </select>
  <input type="submit">
</form>

One point I made on the WDUI blog that I also I want to make here is that is seems from my time on the REST-discuss list that many of the REST experts tend toward using (what I call well-designed URLs, i.e. URLs where the resource is identified by path instead of query string. With WebForm 2.0's pending support of PUT and DELETE, it would be just short of a crime not to include support for posting to clean URLs in WebForms 2.0.

So I really hope that Ian and the WHATWG can see their way clear to consider adding this feature to WebForms 2.0. And if the main issue with it is needing to have it written up for inclusion in the spec, I'm more than happy to help.

Posted in Forms | 9 Comments »

Feed Autodiscovery

We’ve recently added link types to HTML 5. In particular we defined the mechanism for syndication feed autodiscovery. Autodiscovery has become widely deployed and implemented already since its inception in 2002, using the link element with the alternate relationship and a type attribute indicating the format of the feed.

<link rel="alternate" type="application/atom+xml"
      href="/feed.atom" title="Atom Feed">
<link rel="alternate" type="application/rss+xml"
      href="/feed.rss" title="RSS Feed">

For backwards compatibility, we must retain support for, and explicitly define, that method. However, there are two main issues with using the alternate relationship:

To address this issue, we have introduced a new feed relationship which indicates that the referenced document is a syndication feed. This now allows you to link to several different feeds containing different content which are not necessarily alternate versions of the page.

<link rel="feed" type="application/atom+xml"
      href="/feed/comments" title="All comments">
<link rel="feed" type="application/atom+xml"
      href="/feed/summaries" title="Article Summaries">

It also means that you do not need to specify the type attribute to have the link recognised as a syndication feed and browsers can still show it in the subscription list.

<link rel="feed" href="/feed" title="Articles">

Another benefit of this is that if there is ever a new syndication feed format, you don’t have to wait for browsers to be updated with the new MIME type to recognise it as a feed. For instance, if your feed reader supports the hAtom microformat, you could subscribe to an HTML document that has been linked to as a feed.

<link rel="feed" type="text/html"
      href="/feed.html" title="All comments">

In order to retain backwards compatibility, the definition for alternate says that when used in combination with a type attribute with the value of either application/rss+xml or application/atom+xml.then it implies the feed keyword as well.

The feed keyword can also be used in combination with alternate to say that it is specifically the feed for the current document.

<link rel="feed alternate" type="application/atom+xml"
      href="/feed.atom" title="Atom Feed">

However, it’s important not to confuse this with the way alternate stylesheets works. The behaviour of rel="alternate stylesheet" is a special case where the use of alternate doesn’t mean an alternate representation of the document itself. In fact, if when used together with stylesheet, that is the one case where the type value cannot imply the feed value.

<link rel="alternate stylesheet" type="application/atom+xml"
      href="/feed.atom" title="This is not a feed!">

Mozilla already has bugs filed for implementing the new feed relationship and fixing its bug with with rel="alternate stylesheet" which are planned for inclusion in Firefox 3.0.

Posted in Browsers, Elements | 16 Comments »

textContent Checking

I have added checking of the textContent of the meter, progress and t elements to the conformance checking service technology preview. The textContent is checked if meter or progress does not have an attribute called value or if t does not have an attribute called datetime.

I took liberties with date formats. Also, I am assuming that it is an error if the algorithm for finding a ratio fails.

I have also made the error messages prettier. Additionally, there is now a pseudo-schema called http://hsivonen.iki.fi/checkers/debug/ which dumps the parse events as warnings. (It makes the most sense when used as the first schema URI on the list of schema URIs.)

Posted in Conformance Checking, Syntax | 1 Comment »

Bug Fixes

Recently, I was informed that the XHTML5 facet of the (X)HTML5-specific interface was crashing due to a null dereference. When I fixed it, I somehow managed to disconnect the back end from the parser for the HTML5 facet. That one is now fixed, too.

On the generic side, the XSLT schema kept crashing the engine. The problem was infinite recursion in the JDK regular expression engine that caused the runtime stack to overflow. I have now changed the system so that regular expressions in the XSD datatype library for RELAX NG are backed by the Xerces 2 regular expression engine rather than the JDK regular expression engine.

The nice thing about a managed runtime is that stack overflows and null dereferences don’t bring the whole app down. In fact, they don’t even crash the thread; the front end can still show an error to the user. The problem is that previously the errors were logged to a file that I didn’t read until someone reported a problem and most of the time people don’t report the problems when they are told that the error was logged. Now the system sends me the stack trace by email if the back end crashes. (And I have fixed all known crashers in advertised features.)

I have also polished the Jing error messages a bit.

Posted in Conformance Checking | Comments Off on Bug Fixes

Significant Inline Checking

The conformance checking service technology preview now can now check for the lack of significant inline content.

Posted in Conformance Checking, Syntax | Comments Off on Significant Inline Checking