W3C home > Mailing lists > Public > public-html@w3.org > August 2013

Re: TextTrackCue discussions

From: Brendan Long <self@brendanlong.com>
Date: Mon, 26 Aug 2013 15:36:27 -0600
Message-ID: <521BCA5B.8040305@brendanlong.com>
To: Silvia Pfeiffer <silviapfeiffer1@gmail.com>
CC: "HTML WG (public-html@w3.org)" <public-html@w3.org>
On 08/23/2013 03:21 PM, Silvia Pfeiffer wrote:
> You can't define a conversion to HTML for something for which you
> don't know the format. That's too much magic. For example, if somebody
> provides some JSON text in the text attribute of the TextTrackCue, how
> is the browser to know how to convert this to HTML?
It just wouldn't. getTextAsHTML() would return null.

Maybe a better option though, would be to have two different interfaces,
since not all cues are going to be fully parsed:

// For a cue that the browser doesn't understand
interface TextTrackCue : EventTarget {
    attribute DOMString text;
};

// For a cue that the browser does understand
interface ParsedTextTrackCue : TextTrackCue {
    attribute DOMString id <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-id>;
    attribute double startTime <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-starttime>;
    attribute double endTime <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-endtime>;
    attribute boolean pauseOnExit <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-pauseonexit>;
    attribute DOMString text <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-text>;
    DocumentFragment <http://www.w3.org/TR/2012/CR-html5-20121217/infrastructure.html#documentfragment> getCueAsHTML <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-getcueashtml>();

    attribute EventHandler <http://www.w3.org/TR/2012/CR-html5-20121217/webappapis.html#eventhandler> onenter <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#handler-texttrackcue-onenter>;
    attribute EventHandler <http://www.w3.org/TR/2012/CR-html5-20121217/webappapis.html#eventhandler> onexit <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#handler-texttrackcue-onexit>; ...
};

// And then if you want this..
interface WebVTTCue : ParsedTextTrackCue {
    attribute DOMString regionId <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-regionid>;
    attribute DirectionSetting <http://dev.w3.org/html5/webvtt/#dfn-directionsetting> vertical <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical>;
    attribute boolean snapToLines <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-snaptolines>;
    attribute (long or AutoKeyword <http://dev.w3.org/html5/webvtt/#dfn-autokeyword>) line <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-line>;
    attribute long position <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-position>;
    attribute long size <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-size>;
    attribute AlignSetting <http://dev.w3.org/html5/webvtt/#dfn-alignsetting> align <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align>;
};

interface TTMLCue : ParsedTextTrackCue {
    ...
};

interface CEA708Cue: ParsedTextTrackCue {
    ...
};

This way, all of the most important information is guaranteed to be
present in the same form, and developers don't need to know about the
various formats unless they want format-specific information.
Received on Monday, 26 August 2013 21:36:57 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:34 UTC