Thursday, 29 November 2012

WebVTT Syntax Rules Do Not Apply To Parser

Let's see what the World Wide Web Consortium (W3C) documentation and community say. I'll focus on WebVTT as much as possible. I'm sure I can find more and I've been told this twice on IRC.


When writing something that reads WebVTT files, be very sure to parse it as specified by the parser--*not* by reading the syntax and coming up with your own parsing algorithm.

Glenn Maynard

[Syntax rules] are requirements for writing, not for parsing. Requirements in that section don't apply to you.

Simon Pieters

"It's a bit unusual for a standard to specify the parsing algorithm, but I can understand why."
It's not unusual for modern specs.  It's a much more dependable way of getting to consistent behavior than only specifying a format.

Glenn Maynard

However, when we go to the parsing section of the spec, there is no step in the parser that makes sure that cues that are out of time order are ignored. This means that an implemented parser will pick up such cues and enter them into the list of cues to be used at the time that they are relevant.

(Note: This infers that implementations are independent of syntax requirements)

Silvia Pfeiffer

Conformance requirements phrased as algorithms or specific steps may be implemented in any manner, so long as the end result is equivalent.

No comments:

Post a Comment