Skip to content

Commit

Permalink
[giow] (0) Captions - Stage 15: Define how to express text cues as DO…
Browse files Browse the repository at this point in the history
…M nodes (will be used by the API).

git-svn-id: http://svn.whatwg.org/webapps@5129 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 1, 2010
1 parent 3c949b6 commit 0ce656f
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 82 deletions.
101 changes: 74 additions & 27 deletions complete.html
Expand Up @@ -2745,11 +2745,12 @@ <h4 id=dom-trees><span class=secno>2.1.3 </span>DOM trees</h4>

<p>The <code><a href=#document>Document</a></code> of a <code><a href=#node>Node</a></code> (such as an
element) is the <code><a href=#document>Document</a></code> that the <code><a href=#node>Node</a></code>'s
<code title="">ownerDocument</code> IDL attribute returns. When a
<code><a href=#node>Node</a></code> is <a href=#in-a-document>in a <code>Document</code></a> then
that <code><a href=#document>Document</a></code> is always the <code><a href=#node>Node</a></code>'s
<code><a href=#document>Document</a></code>, and the <code><a href=#node>Node</a></code>'s <code title="">ownerDocument</code> IDL attribute thus always returns that
<code><a href=#document>Document</a></code>.</p>
<code title=dom-Node-ownerDocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> IDL
attribute returns. When a <code><a href=#node>Node</a></code> is <a href=#in-a-document>in a
<code>Document</code></a> then that <code><a href=#document>Document</a></code> is
always the <code><a href=#node>Node</a></code>'s <code><a href=#document>Document</a></code>, and the
<code><a href=#node>Node</a></code>'s <code title=dom-Node-ownerDocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> IDL attribute
thus always returns that <code><a href=#document>Document</a></code>.</p>

<p>The term <dfn id=tree-order>tree order</dfn> means a pre-order, depth-first
traversal of DOM nodes involved (through the <code title=dom-Node-parentNode><a href=#dom-node-parentnode>parentNode</a></code>/<code title=dom-Node-childNodes><a href=#dom-node-childnodes>childNodes</a></code> relationship).</p>
Expand Down Expand Up @@ -3231,11 +3232,13 @@ <h4 id=dependencies><span class=secno>2.2.1 </span>Dependencies</h4>
<li><dfn id=dom-document-getelementbyid title=dom-Document-getElementById><code>getElementById()</code></dfn> method</li>
<li><dfn id=dom-node-insertbefore title=dom-Node-insertBefore><code>insertBefore()</code></dfn> method</li>

<li><dfn id=dom-node-childnodes title=dom-Node-childNodes><code>childNodes</code></dfn> attribute </li>
<li><dfn id=dom-node-localname title=dom-Node-localName><code>localName</code></dfn> attribute </li>
<li><dfn id=dom-node-parentnode title=dom-Node-parentNode><code>parentNode</code></dfn> attribute </li>
<li><dfn id=dom-element-tagname title=dom-Element-tagName><code>tagName</code></dfn> attribute </li>
<li><dfn id=textcontent><code>textContent</code></dfn> attribute </li>
<li><dfn id=dom-node-ownerdocument title=dom-Node-ownerDocument><code>ownerDocument</code></dfn> attribute</li>
<li><dfn id=dom-node-childnodes title=dom-Node-childNodes><code>childNodes</code></dfn> attribute</li>
<li><dfn id=dom-node-localname title=dom-Node-localName><code>localName</code></dfn> attribute</li>
<li><dfn id=dom-node-parentnode title=dom-Node-parentNode><code>parentNode</code></dfn> attribute</li>
<li><dfn id=dom-node-namespaceuri title=dom-Node-namespaceURI><code>namespaceURI</code></dfn> attribute</li>
<li><dfn id=dom-element-tagname title=dom-Element-tagName><code>tagName</code></dfn> attribute</li>
<li><dfn id=textcontent><code>textContent</code></dfn> attribute</li>

</ul><p>The following features are defined in the DOM Events
specification: <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
Expand Down Expand Up @@ -11394,20 +11397,19 @@ <h4 id=innerhtml><span class=secno>3.5.5 </span><code title=dom-innerHTML><a hre

<li>

<p>If the attribute is being set on a <code><a href=#document>Document</a></code>
node, let <var title="">target document</var> be that
<code><a href=#document>Document</a></code> node. Otherwise, the attribute is being
set on an <code><a href=#element>Element</a></code> node; let <var title="">target
document</var> be the <code title="">ownerDocument</code> of
that <code><a href=#element>Element</a></code>.</p>
<p>If the attribute is being set on a <code><a href=#document>Document</a></code> node,
let <var title="">target document</var> be that
<code><a href=#document>Document</a></code> node. Otherwise, the attribute is being set
on an <code><a href=#element>Element</a></code> node; let <var title="">target
document</var> be the <code title=dom-Node-ownerDocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> of that
<code><a href=#element>Element</a></code>.</p>

</li>

<li>

<p>Set the <code title="">ownerDocument</code> of all the nodes in
<var title="">new children</var> to the <var title="">target
document</var>.</p>
<p>Set the <code title=dom-Node-ownerDocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> of all the
nodes in <var title="">new children</var> to the <var title="">target document</var>.</p>

</li>

Expand Down Expand Up @@ -11518,9 +11520,8 @@ <h4 id=outerhtml><span class=secno>3.5.6 </span><code title=dom-outerHTML><a hre

<li>

<p>Set the <code title="">ownerDocument</code> of all the nodes in
<var title="">new children</var> to <var title="">target</var>'s
document.</p>
<p>Set the <code title=dom-Node-ownerDocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> of all the
nodes in <var title="">new children</var> to <var title="">target</var>'s document.</p>

</li>

Expand Down Expand Up @@ -11653,9 +11654,8 @@ <h4 id=insertadjacenthtml()><span class=secno>3.5.7 </span><code title=dom-inser

<li>

<p>Set the <code title="">ownerDocument</code> of all the nodes in
<var title="">new children</var> to <var title="">target</var>'s
document.</p>
<p>Set the <code title=dom-Node-ownerDocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> of all the
nodes in <var title="">new children</var> to <var title="">target</var>'s document.</p>

</li>

Expand Down Expand Up @@ -26782,7 +26782,25 @@ <h6 id=syntax-0><span class=secno>4.8.10.11.1 </span>Syntax</h6>
timestamp</a> must be greater than the start time offset of the
cue.</li>

</ol><p>A <dfn id=websrt-timestamp>WebSRT timestamp</dfn> representing hour <var title="">hours</var>, minutes <var title="">minutes</var>, seconds
</ol><p>A <dfn id=websrt-timestamp>WebSRT timestamp</dfn> representing a time in seconds and
fractions of a second is a <a href=#websrt-timestamp>WebSRT timestamp</a>
representing hours <var title="">hours</var>, minutes <var title="">minutes</var>, seconds
<var title="">seconds</var>, and thousandths of a second <var title="">seconds-frac</var>, calculated as follows:</p>

<ol><li><p>Let <var title="">seconds</var> be the integer part of the
time.</li>

<li><p>Let <var title="">seconds-frac</var> be the fractional
component of the time, expressed as the digits of the decimal
fraction given to three decimal digits.</li>

<li><p>If <var title="">seconds</var> is greater than 59, then let
<var title="">minutes</var> be the integer component of <var title="">seconds</var> divided by sixty, and then let <var title="">seconds</var> be the remainder of dividing <var title="">seconds</var> divided by sixty. Otherwise, let <var title="">minutes</var> be zero.</li>

<li><p>If <var title="">minutes</var> is greater than 59, then let
<var title="">hours</var> be the integer component of <var title="">minutes</var> divided by sixty, and then let <var title="">minutes</var> be the remainder of dividing <var title="">minutes</var> divided by sixty. Otherwise, let <var title="">hours</var> be zero.</li>

</ol><p>A <a href=#websrt-timestamp>WebSRT timestamp</a> representing hours <var title="">hours</var>, minutes <var title="">minutes</var>, seconds
<var title="">seconds</var>, and thousandths of a second <var title="">seconds-frac</var>, consists of the following components,
in the given order:</p>

Expand Down Expand Up @@ -27986,7 +28004,36 @@ <h6 id=parsing-0><span class=secno>4.8.10.11.2 </span>Parsing</h6>

</ol><h6 id=websrt-cue-text-dom-construction-rules><span class=secno>4.8.10.11.4 </span><dfn>WebSRT cue text DOM construction rules</dfn></h6>

<p class=XXX>...</p>
<p>To convert a <a href=#list-of-websrt-node-objects>List of WebSRT Node Objects</a> to a DOM
tree for <code><a href=#document>Document</a></code> <var title="">owner</var>, user
agents must create a tree of DOM nodes that is isomorphous to the
tree of <a href=#websrt-node-object title="WebSRT Node Object">WebSRT Node Objects</a>,
with the following mapping of <a href=#websrt-node-object title="WebSRT Node
Object">WebSRT Node Objects</a> to DOM nodes:</p>

<table><thead><tr><th><a href=#websrt-node-object>WebSRT Node Object</a>
<th>DOM node
<tbody><tr><td><a href=#list-of-websrt-node-objects>List of WebSRT Node Objects</a>
<td><code><a href=#documentfragment>DocumentFragment</a></code> node
<tr><td><a href=#websrt-italic-object>WebSRT Italic Object</a>
<td><code><a href=#htmlelement>HTMLElement</a></code> element node with <code title=dom-Element-localName>localName</code> "<code><a href=#the-i-element>i</a></code>" and the <code title=dom-Node-namespaceURI><a href=#dom-node-namespaceuri>namespaceURI</a></code> set to the <a href=#html-namespace-0>HTML namespace</a>.
<tr><td><a href=#websrt-bold-object>WebSRT Bold Object</a>
<td><code><a href=#htmlelement>HTMLElement</a></code> element node with <code title=dom-Element-localName>localName</code> "<code><a href=#the-b-element>b</a></code>" and the <code title=dom-Node-namespaceURI><a href=#dom-node-namespaceuri>namespaceURI</a></code> set to the <a href=#html-namespace-0>HTML namespace</a>.
<tr><td><a href=#websrt-ruby-object>WebSRT Ruby Object</a>
<td><code><a href=#htmlelement>HTMLElement</a></code> element node with <code title=dom-Element-localName>localName</code> "<code><a href=#the-ruby-element>ruby</a></code>" and the <code title=dom-Node-namespaceURI><a href=#dom-node-namespaceuri>namespaceURI</a></code> set to the <a href=#html-namespace-0>HTML namespace</a>.
<tr><td><a href=#websrt-ruby-text-object>WebSRT Ruby Text Object</a>
<td><code><a href=#htmlelement>HTMLElement</a></code> element node with <code title=dom-Element-localName>localName</code> "<code><a href=#the-rt-element>rt</a></code>" and the <code title=dom-Node-namespaceURI><a href=#dom-node-namespaceuri>namespaceURI</a></code> set to the <a href=#html-namespace-0>HTML namespace</a>.
<tr><td><a href=#websrt-text-object>WebSRT Text Object</a>
<td><code><a href=#text>Text</a></code> node whose character data is the value of the <a href=#websrt-text-object>WebSRT Text Object</a>.
<tr><td><a href=#websrt-timestamp-object>WebSRT Timestamp Object</a>
<td><code><a href=#processinginstruction>ProcessingInstruction</a></code> node whose <code title=dom-ProcessingInstruction-target>target</code> is "<code title="">timestamp</code>" and whose <code title=dom-ProcessingInstruction-data>data</code> is a <a href=#websrt-timestamp>WebSRT timestamp</a> representing the value of the <a href=#websrt-timestamp-object>WebSRT Timestamp Object</a>, with all optional components included and with the seconds separator being a U+002E FULL STOP character (.).
</table><p>The <code title=dom-Node-ownerDocument><a href=#dom-node-ownerdocument>ownerDocument</a></code>
attribute of all nodes in the DOM tree must be set to the given
document <var title="">owner</var>.</p>

<p>All characteristics of the DOM nodes that are not described above
or dependent on characteristics defined above must be left at their
initial values.</p>

</div>

Expand Down

0 comments on commit 0ce656f

Please sign in to comment.