[whatwg] [mimesniff] An alternative approach to section 9 of Mime Sniffing

Peter Occil poccil14 at gmail.com
Fri May 24 22:58:11 PDT 2013

What I think is that even if an ABNF won't be the normative definition of a 
syntax format, it can help put the format's syntax into a higher-level 
perspective and aid understanding of its syntax: once we understand, for 
example, what the Content-Type header field value ought to contain, in the 
form of an ABNF or in some other way, it will be easier to write processing 
rules for that field value in the spec.  (Right now I'm in the process of 
rewriting section 5 of the MIME sniffing spec.)

Take the WebVTT spec for example.  For each part of the WebVTT format 
there's a definition of what that part contains in terms of characters, and 
the actual processing rules for parsing that part.  For example, the 
definition for "WebVTT cue timings" and the algorithm to "collect WebVTT cue 
timings and settings." The definition aids understanding of the syntax for 
WebVTT cue timings and informs how the rules for collecting WebVTT cue 
timings are written in the WebVTT spec.


-----Original Message----- 
From: Anne van Kesteren
Sent: Friday, May 24, 2013 1:28 AM
To: Peter Occil
Subject: Re: [whatwg] An alternative approach to section 9 of Mime Sniffing

On Thu, May 23, 2013 at 2:49 PM, Peter Occil <poccil14 at gmail.com> wrote:
> Explain further why you don't recommend ABNF for this case.

We don't recommend ABNF in general because often ABNF results in a
mismatch between prescribed and actual processing. E.g. Content-Type
is defined as an ABNF and technically "text/html;" does not match that
ABNF, but everyone (logically) processes that as "text/html" without

It's much better to define the actual processing so implementers are
less inclined to take shortcuts when implementing (test suites also
help, but they're typically written way-after-the-fact).

> You should also explain whether another change to make section 9 more 
> readable is
> appropriate (though it currently is relatively readable as is).

I'll leave that to Gordon.


More information about the whatwg mailing list