Permalink
Browse files

[c] (0) More useful conformance rules and advice for bidi formatting …

…characters

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11234

git-svn-id: http://svn.whatwg.org/webapps@6487 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent 827d093 commit bd864b24eedf133047dbeda6cc2743dfc217744e @Hixie Hixie committed Aug 17, 2011
Showing with 196 additions and 30 deletions.
  1. +62 −10 complete.html
  2. +62 −10 index
  3. +72 −10 source
View
72 complete.html
@@ -12046,16 +12046,68 @@ <h4 id=requirements-relating-to-bidirectional-algorithm-formatting-characters><s
formatting character ranges</a>, and then imposing a requirement
on such ranges.</p>
- <p>The string resulting from the concatenation of the data of all of
- an <a href=#html-elements title="HTML elements">HTML element</a>'s <a href=#text-node title="text node">text nodes</a>, if any, is a <a href=#bidirectional-algorithm-formatting-character-ranges title="bidirectional-algorithm formatting character
- ranges">bidirectional-algorithm formatting character
- range</a>.</p>
+ <p>The strings resulting from the applying the following algorithm
+ to an <a href=#html-elements title="HTML elements">HTML element</a> <var title="">element</var> are <a href=#bidirectional-algorithm-formatting-character-ranges>bidirectional-algorithm formatting
+ character ranges</a>:</p>
+
+ <ol><li><p>Let <var title="">output</var> be an empty list of strings.</li>
+
+ <li><p>Let <var title="">string</var> be an empty string.</li>
+
+ <li><p>Let <var title="">node</var> be the first child node of <var title="">element</var>, if any, or null otherwise.</li>
+
+ <!-- while node != null do -->
+ <li><p><i>Loop</i>: If <var title="">node</var> is null, jump to
+ the step labeled <i>end</i>.</li>
+
+ <li>
+
+ <p>Process <var title="">node</var> according to the first
+ matching step from the following list:</p>
+
+ <dl class=switch><dt>If <var title="">node</var> is a <a href=#text-node>text node</a></dt>
+
+ <dd><p>Append the text data of <var title="">node</var> to <var title="">string</var>.</dd>
+
+
+ <dt>If <var title="">node</var> is an <a href=#html-elements title="HTML elements">HTML element</a> that is <a href=#flow-content>flow content</a> but that is not also <a href=#phrasing-content>phrasing content</a></dt>
+
+ <dd><p>If <var title="">string</var> is not the empty string,
+ push <var title="">string</var> onto <var title="">output</var>,
+ and let <var title="">string</var> be empty string.</dd>
- <p>The value of a namespace-less attribute of an <a href=#html-elements title="HTML
+
+ <dt>Otherwise</dt>
+
+ <dd>Do nothing.</dd>
+
+ </dl></li>
+
+ <li><p>Let <var title="">node</var> be <var title="">node</var>'s
+ next sibling, if any, or null otherwise.</li>
+
+ <li><p>Jump to the step labeled <i>loop</i>.</li>
+ <!-- end while -->
+
+ <li><p><i>End</i>: If <var title="">string</var> is not the empty
+ string, push <var title="">string</var> onto <var title="">output</var>.</li>
+
+ <li><p>Return <var title="">output</var> as the
+ <a href=#bidirectional-algorithm-formatting-character-ranges>bidirectional-algorithm formatting character
+ ranges</a>.</li>
+
+ </ol><p>The value of a namespace-less attribute of an <a href=#html-elements title="HTML
elements">HTML element</a> is a <a href=#bidirectional-algorithm-formatting-character-ranges title="bidirectional-algorithm formatting character
ranges">bidirectional-algorithm formatting character
range</a>.</p>
+<!--(this is unnecessarily pedantic)
+ <p>The text data of a comment node is a <span
+ title="bidirectional-algorithm formatting character
+ ranges">bidirectional-algorithm formatting character
+ range</span>.</p>
+-->
+
<p>Any strings that, as described above, are
<dfn id=bidirectional-algorithm-formatting-character-ranges>bidirectional-algorithm formatting character ranges</dfn> must
match the <code title="">string</code> production in the following
@@ -12072,11 +12124,11 @@ <h4 id=requirements-relating-to-bidirectional-algorithm-formatting-characters><s
plaintext = *( %x0000-2029 / %x202F-10FFFF )
; any string with no bidirectional-algorithm formatting characters</pre>
- <p class=note>For convenience, where possible authors will likely
- prefer to use the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute, the
- <code><a href=#the-bdo-element>bdo</a></code> element, and the <code><a href=#the-bdi-element>bdi</a></code> element, rather
- than maintaining the bidirectional-algorithm formatting characters
- manually.</p>
+ <p class=note>Authors are encouraged to use the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute, the <code><a href=#the-bdo-element>bdo</a></code> element,
+ and the <code><a href=#the-bdi-element>bdi</a></code> element, rather than maintaining the
+ bidirectional-algorithm formatting characters manually. The
+ bidirectional-algorithm formatting characters interact poorly with
+ CSS.</p>
View
72 index
@@ -11910,16 +11910,68 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
formatting character ranges</a>, and then imposing a requirement
on such ranges.</p>
- <p>The string resulting from the concatenation of the data of all of
- an <a href=#html-elements title="HTML elements">HTML element</a>'s <a href=#text-node title="text node">text nodes</a>, if any, is a <a href=#bidirectional-algorithm-formatting-character-ranges title="bidirectional-algorithm formatting character
- ranges">bidirectional-algorithm formatting character
- range</a>.</p>
+ <p>The strings resulting from the applying the following algorithm
+ to an <a href=#html-elements title="HTML elements">HTML element</a> <var title="">element</var> are <a href=#bidirectional-algorithm-formatting-character-ranges>bidirectional-algorithm formatting
+ character ranges</a>:</p>
+
+ <ol><li><p>Let <var title="">output</var> be an empty list of strings.</li>
+
+ <li><p>Let <var title="">string</var> be an empty string.</li>
+
+ <li><p>Let <var title="">node</var> be the first child node of <var title="">element</var>, if any, or null otherwise.</li>
+
+ <!-- while node != null do -->
+ <li><p><i>Loop</i>: If <var title="">node</var> is null, jump to
+ the step labeled <i>end</i>.</li>
+
+ <li>
+
+ <p>Process <var title="">node</var> according to the first
+ matching step from the following list:</p>
+
+ <dl class=switch><dt>If <var title="">node</var> is a <a href=#text-node>text node</a></dt>
+
+ <dd><p>Append the text data of <var title="">node</var> to <var title="">string</var>.</dd>
+
+
+ <dt>If <var title="">node</var> is an <a href=#html-elements title="HTML elements">HTML element</a> that is <a href=#flow-content>flow content</a> but that is not also <a href=#phrasing-content>phrasing content</a></dt>
+
+ <dd><p>If <var title="">string</var> is not the empty string,
+ push <var title="">string</var> onto <var title="">output</var>,
+ and let <var title="">string</var> be empty string.</dd>
- <p>The value of a namespace-less attribute of an <a href=#html-elements title="HTML
+
+ <dt>Otherwise</dt>
+
+ <dd>Do nothing.</dd>
+
+ </dl></li>
+
+ <li><p>Let <var title="">node</var> be <var title="">node</var>'s
+ next sibling, if any, or null otherwise.</li>
+
+ <li><p>Jump to the step labeled <i>loop</i>.</li>
+ <!-- end while -->
+
+ <li><p><i>End</i>: If <var title="">string</var> is not the empty
+ string, push <var title="">string</var> onto <var title="">output</var>.</li>
+
+ <li><p>Return <var title="">output</var> as the
+ <a href=#bidirectional-algorithm-formatting-character-ranges>bidirectional-algorithm formatting character
+ ranges</a>.</li>
+
+ </ol><p>The value of a namespace-less attribute of an <a href=#html-elements title="HTML
elements">HTML element</a> is a <a href=#bidirectional-algorithm-formatting-character-ranges title="bidirectional-algorithm formatting character
ranges">bidirectional-algorithm formatting character
range</a>.</p>
+<!--(this is unnecessarily pedantic)
+ <p>The text data of a comment node is a <span
+ title="bidirectional-algorithm formatting character
+ ranges">bidirectional-algorithm formatting character
+ range</span>.</p>
+-->
+
<p>Any strings that, as described above, are
<dfn id=bidirectional-algorithm-formatting-character-ranges>bidirectional-algorithm formatting character ranges</dfn> must
match the <code title="">string</code> production in the following
@@ -11936,11 +11988,11 @@ pdf = %x202C ; U+202C POP DIRECTIONAL FORMATTING
plaintext = *( %x0000-2029 / %x202F-10FFFF )
; any string with no bidirectional-algorithm formatting characters</pre>
- <p class=note>For convenience, where possible authors will likely
- prefer to use the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute, the
- <code><a href=#the-bdo-element>bdo</a></code> element, and the <code><a href=#the-bdi-element>bdi</a></code> element, rather
- than maintaining the bidirectional-algorithm formatting characters
- manually.</p>
+ <p class=note>Authors are encouraged to use the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute, the <code><a href=#the-bdo-element>bdo</a></code> element,
+ and the <code><a href=#the-bdi-element>bdi</a></code> element, rather than maintaining the
+ bidirectional-algorithm formatting characters manually. The
+ bidirectional-algorithm formatting characters interact poorly with
+ CSS.</p>
View
82 source
@@ -12415,18 +12415,79 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
formatting character ranges</span>, and then imposing a requirement
on such ranges.</p>
- <p>The string resulting from the concatenation of the data of all of
- an <span title="HTML elements">HTML element</span>'s <span
- title="text node">text nodes</span>, if any, is a <span
+ <p>The strings resulting from the applying the following algorithm
+ to an <span title="HTML elements">HTML element</span> <var
+ title="">element</var> are <span>bidirectional-algorithm formatting
+ character ranges</span>:</p>
+
+ <ol>
+
+ <li><p>Let <var title="">output</var> be an empty list of strings.</p></li>
+
+ <li><p>Let <var title="">string</var> be an empty string.</p></li>
+
+ <li><p>Let <var title="">node</var> be the first child node of <var
+ title="">element</var>, if any, or null otherwise.</p></li>
+
+ <!-- while node != null do -->
+ <li><p><i>Loop</i>: If <var title="">node</var> is null, jump to
+ the step labeled <i>end</i>.</p></li>
+
+ <li>
+
+ <p>Process <var title="">node</var> according to the first
+ matching step from the following list:</p>
+
+ <dl class="switch">
+
+ <dt>If <var title="">node</var> is a <span>text node</span></dt>
+
+ <dd><p>Append the text data of <var title="">node</var> to <var title="">string</var>.</p></dd>
+
+
+ <dt>If <var title="">node</var> is an <span title="HTML elements">HTML element</span> that is <span>flow content</span> but that is not also <span>phrasing content</span></dt>
+
+ <dd><p>If <var title="">string</var> is not the empty string,
+ push <var title="">string</var> onto <var title="">output</var>,
+ and let <var title="">string</var> be empty string.</p></dd>
+
+
+ <dt>Otherwise</dt>
+
+ <dd>Do nothing.</dd>
+
+ </dl>
+
+ </li>
+
+ <li><p>Let <var title="">node</var> be <var title="">node</var>'s
+ next sibling, if any, or null otherwise.</p></li>
+
+ <li><p>Jump to the step labeled <i>loop</i>.</p></li>
+ <!-- end while -->
+
+ <li><p><i>End</i>: If <var title="">string</var> is not the empty
+ string, push <var title="">string</var> onto <var
+ title="">output</var>.</p></li>
+
+ <li><p>Return <var title="">output</var> as the
+ <span>bidirectional-algorithm formatting character
+ ranges</span>.</p></li>
+
+ </ol>
+
+ <p>The value of a namespace-less attribute of an <span title="HTML
+ elements">HTML element</span> is a <span
title="bidirectional-algorithm formatting character
ranges">bidirectional-algorithm formatting character
range</span>.</p>
- <p>The value of a namespace-less attribute of an <span title="HTML
- elements">HTML element</span> is a <span
+<!--(this is unnecessarily pedantic)
+ <p>The text data of a comment node is a <span
title="bidirectional-algorithm formatting character
ranges">bidirectional-algorithm formatting character
range</span>.</p>
+-->
<p>Any strings that, as described above, are
<dfn>bidirectional-algorithm formatting character ranges</dfn> must
@@ -12445,11 +12506,12 @@ pdf = %x202C ; U+202C POP DIRECTIONAL FORMATTING
plaintext = *( %x0000-2029 / %x202F-10FFFF )
; any string with no bidirectional-algorithm formatting characters</pre>
- <p class="note">For convenience, where possible authors will likely
- prefer to use the <code title="attr-dir">dir</code> attribute, the
- <code>bdo</code> element, and the <code>bdi</code> element, rather
- than maintaining the bidirectional-algorithm formatting characters
- manually.</p>
+ <p class="note">Authors are encouraged to use the <code
+ title="attr-dir">dir</code> attribute, the <code>bdo</code> element,
+ and the <code>bdi</code> element, rather than maintaining the
+ bidirectional-algorithm formatting characters manually. The
+ bidirectional-algorithm formatting characters interact poorly with
+ CSS.</p>

0 comments on commit bd864b2

Please sign in to comment.