Skip to content

Commit

Permalink
[ac] (0) Define conformance criteria around bidi formatting characters
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11234

git-svn-id: http://svn.whatwg.org/webapps@5754 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 10, 2011
1 parent 63a8c4d commit 4cbbefd
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 16 deletions.
70 changes: 64 additions & 6 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Living Standard &mdash; 9 January 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; 10 January 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -420,7 +420,9 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
<li><a href=#interactive-content-0><span class=secno>3.2.5.1.7 </span>Interactive content</a></ol></li>
<li><a href=#transparent-content-models><span class=secno>3.2.5.2 </span>Transparent content models</a></li>
<li><a href=#paragraphs><span class=secno>3.2.5.3 </span>Paragraphs</a></ol></li>
<li><a href=#annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.6 </span>Annotations for assistive technology products (ARIA)</a></ol></li>
<li><a href=#requirements-relating-to-bidirectional-algorithm-formatting-characters><span class=secno>3.2.6 </span>Requirements relating to bidirectional-algorithm formatting
characters</a></li>
<li><a href=#annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.7 </span>Annotations for assistive technology products (ARIA)</a></ol></li>
<li><a href=#apis-in-html-documents><span class=secno>3.3 </span>APIs in HTML documents</a></li>
<li><a href=#interactions-with-xpath-and-xslt><span class=secno>3.4 </span>Interactions with XPath and XSLT</a></li>
<li><a href=#dynamic-markup-insertion><span class=secno>3.5 </span>Dynamic markup insertion</a>
Expand Down Expand Up @@ -10806,6 +10808,7 @@ <h6 id=heading-content-0><span class=secno>3.2.5.1.4 </span>Heading content</h6>
character">space characters</a>).</p>



<h6 id=embedded-content-0><span class=secno>3.2.5.1.6 </span>Embedded content</h6>

<p><dfn id=embedded-content>Embedded content</dfn> is content that imports another
Expand Down Expand Up @@ -11206,7 +11209,62 @@ <h5 id=paragraphs><span class=secno>3.2.5.3 </span>Paragraphs</h5>



<h4 id=annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.6 </span><dfn>Annotations for assistive technology products</dfn> (ARIA)</h4>
<h4 id=requirements-relating-to-bidirectional-algorithm-formatting-characters><span class=secno>3.2.6 </span>Requirements relating to bidirectional-algorithm formatting
characters</h4>

<p><a href=#text-content>Text content</a> in <a href=#html-elements>HTML elements</a> with
child <a href=#text-node title="text node">text nodes</a>, and text in
attributes of <a href=#html-elements>HTML elements</a> that allow free-form text,
may contain characters in the range U+202A to U+202E (the
bidirectional-algorithm formatting characters). However, the use of
these characters is restricted so that any embedding or overrides
generated by these characters do not start and end with different
parent elements, and so that all such embeddings and overrides are
explicitly terminated by a U+202C POP DIRECTIONAL FORMATTING
character. This helps reduces incidences of text being reused in a
manner that has unforseen effects on the bidirectional
algorithm.</p>

<p>The aforementioned restrictions are defined by specifying that
certain parts of documents form <a href=#bidirectional-algorithm-formatting-character-ranges>bidirectional-algorithm
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 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>

<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
ABNF, the character set for which is Unicode. <a href=#refsABNF>[ABNF]</a></p>

<pre>string = *( plaintext ( embedding / override ) ) plaintext
embedding = ( lre / rle ) string pdf
override = ( lro / rlo ) string pdf
lre = %x202A ; U+202A LEFT-TO-RIGHT EMBEDDING
rle = %x202B ; U+202B RIGHT-TO-LEFT EMBEDDING
lro = %x202D ; U+202D LEFT-TO-RIGHT OVERRIDE
rlo = %x202E ; U+202E RIGHT-TO-LEFT OVERRIDE
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>



<h4 id=annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.7 </span><dfn>Annotations for assistive technology products</dfn> (ARIA)</h4>

<p>Authors may use the ARIA <code title=attr-aria-role>role</code>
and <code title=attr-aria-*>aria-*</code> attributes on <a href=#html-elements>HTML
Expand Down Expand Up @@ -15425,9 +15483,9 @@ <h5 id=scriptingLanguages><span class=secno>4.3.1.1 </span>Scripting languages</

<h5 id=restrictions-for-contents-of-script-elements><span class=secno>4.3.1.2 </span><dfn title="script content restrictions">Restrictions for contents of <code>script</code> elements</dfn></h5>

<p>The <code><a href=#textcontent>textContent</a></code> of a <code><a href=#script>script</a></code> element must match the
<code title="">script</code> production in the following ABNF, the
character set for which is Unicode. <a href=#refsABNF>[ABNF]</a></p>
<p>The <code><a href=#textcontent>textContent</a></code> of a <code><a href=#script>script</a></code> element
must match the <code title="">script</code> production in the
following ABNF, the character set for which is Unicode. <a href=#refsABNF>[ABNF]</a></p>

<pre>script = data1 *( escape [ script-start data3 ] "--&gt;" data1 ) [ escape ]
escape = "&lt;!--" data2 *( script-start data3 script-end data2 )
Expand Down
70 changes: 64 additions & 6 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>HTML5 (including next generation additions still in development)</h1>
<h2 class="no-num no-toc">Living Standard &mdash; 9 January 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; 10 January 2011</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
Expand Down Expand Up @@ -428,7 +428,9 @@
<li><a href=#interactive-content-0><span class=secno>3.2.5.1.7 </span>Interactive content</a></ol></li>
<li><a href=#transparent-content-models><span class=secno>3.2.5.2 </span>Transparent content models</a></li>
<li><a href=#paragraphs><span class=secno>3.2.5.3 </span>Paragraphs</a></ol></li>
<li><a href=#annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.6 </span>Annotations for assistive technology products (ARIA)</a></ol></li>
<li><a href=#requirements-relating-to-bidirectional-algorithm-formatting-characters><span class=secno>3.2.6 </span>Requirements relating to bidirectional-algorithm formatting
characters</a></li>
<li><a href=#annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.7 </span>Annotations for assistive technology products (ARIA)</a></ol></li>
<li><a href=#apis-in-html-documents><span class=secno>3.3 </span>APIs in HTML documents</a></li>
<li><a href=#interactions-with-xpath-and-xslt><span class=secno>3.4 </span>Interactions with XPath and XSLT</a></li>
<li><a href=#dynamic-markup-insertion><span class=secno>3.5 </span>Dynamic markup insertion</a>
Expand Down Expand Up @@ -10785,6 +10787,7 @@ background: transparent"&gt;blue&lt;/span&gt;.&lt;/p&gt;</pre>
character">space characters</a>).</p>



<h6 id=embedded-content-0><span class=secno>3.2.5.1.6 </span>Embedded content</h6>

<p><dfn id=embedded-content>Embedded content</dfn> is content that imports another
Expand Down Expand Up @@ -11185,7 +11188,62 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0



<h4 id=annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.6 </span><dfn>Annotations for assistive technology products</dfn> (ARIA)</h4>
<h4 id=requirements-relating-to-bidirectional-algorithm-formatting-characters><span class=secno>3.2.6 </span>Requirements relating to bidirectional-algorithm formatting
characters</h4>

<p><a href=#text-content>Text content</a> in <a href=#html-elements>HTML elements</a> with
child <a href=#text-node title="text node">text nodes</a>, and text in
attributes of <a href=#html-elements>HTML elements</a> that allow free-form text,
may contain characters in the range U+202A to U+202E (the
bidirectional-algorithm formatting characters). However, the use of
these characters is restricted so that any embedding or overrides
generated by these characters do not start and end with different
parent elements, and so that all such embeddings and overrides are
explicitly terminated by a U+202C POP DIRECTIONAL FORMATTING
character. This helps reduces incidences of text being reused in a
manner that has unforseen effects on the bidirectional
algorithm.</p>

<p>The aforementioned restrictions are defined by specifying that
certain parts of documents form <a href=#bidirectional-algorithm-formatting-character-ranges>bidirectional-algorithm
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 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>

<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
ABNF, the character set for which is Unicode. <a href=#refsABNF>[ABNF]</a></p>

<pre>string = *( plaintext ( embedding / override ) ) plaintext
embedding = ( lre / rle ) string pdf
override = ( lro / rlo ) string pdf
lre = %x202A ; U+202A LEFT-TO-RIGHT EMBEDDING
rle = %x202B ; U+202B RIGHT-TO-LEFT EMBEDDING
lro = %x202D ; U+202D LEFT-TO-RIGHT OVERRIDE
rlo = %x202E ; U+202E RIGHT-TO-LEFT OVERRIDE
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>



<h4 id=annotations-for-assistive-technology-products-(aria)><span class=secno>3.2.7 </span><dfn>Annotations for assistive technology products</dfn> (ARIA)</h4>

<p>Authors may use the ARIA <code title=attr-aria-role>role</code>
and <code title=attr-aria-*>aria-*</code> attributes on <a href=#html-elements>HTML
Expand Down Expand Up @@ -15404,9 +15462,9 @@ o............A....e

<h5 id=restrictions-for-contents-of-script-elements><span class=secno>4.3.1.2 </span><dfn title="script content restrictions">Restrictions for contents of <code>script</code> elements</dfn></h5>

<p>The <code><a href=#textcontent>textContent</a></code> of a <code><a href=#script>script</a></code> element must match the
<code title="">script</code> production in the following ABNF, the
character set for which is Unicode. <a href=#refsABNF>[ABNF]</a></p>
<p>The <code><a href=#textcontent>textContent</a></code> of a <code><a href=#script>script</a></code> element
must match the <code title="">script</code> production in the
following ABNF, the character set for which is Unicode. <a href=#refsABNF>[ABNF]</a></p>

<pre>script = data1 *( escape [ script-start data3 ] "--&gt;" data1 ) [ escape ]
escape = "&lt;!--" data2 *( script-start data3 script-end data2 )
Expand Down
68 changes: 64 additions & 4 deletions source
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
a<!-- EDITOR NOTES
<!-- EDITOR NOTES
!
! Adding a new element involves editing the following sections:
! - description of the element's categories
Expand Down Expand Up @@ -11093,6 +11093,7 @@ background: transparent">blue&lt;/span>.&lt;/p></pre>
character">space characters</span>).</p>



<h6>Embedded content</h6>

<p><dfn>Embedded content</dfn> is content that imports another
Expand Down Expand Up @@ -11518,6 +11519,65 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0



<h4>Requirements relating to bidirectional-algorithm formatting
characters</h4>

<p><span>Text content</span> in <span>HTML elements</span> with
child <span title="text node">text nodes</span>, and text in
attributes of <span>HTML elements</span> that allow free-form text,
may contain characters in the range U+202A to U+202E (the
bidirectional-algorithm formatting characters). However, the use of
these characters is restricted so that any embedding or overrides
generated by these characters do not start and end with different
parent elements, and so that all such embeddings and overrides are
explicitly terminated by a U+202C POP DIRECTIONAL FORMATTING
character. This helps reduces incidences of text being reused in a
manner that has unforseen effects on the bidirectional
algorithm.</p>

<p>The aforementioned restrictions are defined by specifying that
certain parts of documents form <span>bidirectional-algorithm
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
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
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
match the <code title="">string</code> production in the following
ABNF, the character set for which is Unicode. <a
href="#refsABNF">[ABNF]</a></p>

<pre>string = *( plaintext ( embedding / override ) ) plaintext
embedding = ( lre / rle ) string pdf
override = ( lro / rlo ) string pdf
lre = %x202A ; U+202A LEFT-TO-RIGHT EMBEDDING
rle = %x202B ; U+202B RIGHT-TO-LEFT EMBEDDING
lro = %x202D ; U+202D LEFT-TO-RIGHT OVERRIDE
rlo = %x202E ; U+202E RIGHT-TO-LEFT OVERRIDE
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>



<h4><dfn>Annotations for assistive technology products</dfn> (ARIA)</h4>

<p>Authors may use the ARIA <code title="attr-aria-role">role</code>
Expand Down Expand Up @@ -16415,9 +16475,9 @@ o............A....e

<h5><dfn title="script content restrictions">Restrictions for contents of <code>script</code> elements</dfn></h5>

<p>The <code>textContent</code> of a <code>script</code> element must match the
<code title="">script</code> production in the following ABNF, the
character set for which is Unicode. <a
<p>The <code>textContent</code> of a <code>script</code> element
must match the <code title="">script</code> production in the
following ABNF, the character set for which is Unicode. <a
href="#refsABNF">[ABNF]</a></p>

<pre>script = data1 *( escape [ script-start data3 ] "-->" data1 ) [ escape ]
Expand Down

0 comments on commit 4cbbefd

Please sign in to comment.