Skip to content

Commit

Permalink
Remove document conformance requirements for bidi characters
Browse files Browse the repository at this point in the history
These requirements were bogus and had no known implementations. Getting
the details right seems non-trivial and the benefit of checking this
also seems marginal.

Fixes #709.
  • Loading branch information
zcorpan authored and domenic committed Aug 10, 2016
1 parent 1a45ade commit fe9dce3
Showing 1 changed file with 1 addition and 102 deletions.
103 changes: 1 addition & 102 deletions source
Expand Up @@ -11967,108 +11967,7 @@ interface <dfn>DOMStringMap</dfn> {
<p><span>Text content</span> in <span>HTML elements</span> with <code>Text</code> nodes in their
<span data-x="concept-html-contents">contents</span>, and text in attributes of <span>HTML
elements</span> that allow free-form text, may contain characters in the ranges U+202A to U+202E
and U+2066 to U+2069 (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 reduce
incidences of text being reused in a manner that has unforeseen effects on the bidirectional
algorithm. <ref spec=BIDI></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 strings resulting from applying the following algorithm to an <span data-x="HTML
elements">HTML element</span> <var>element</var> are <span>bidirectional-algorithm
formatting character ranges</span>:</p>

<ol>

<li><p>Let <var>output</var> be an empty list of strings.</p></li>

<li><p>Let <var>string</var> be an empty string.</p></li>

<li><p>Let <var>node</var> be the first child node of <var>element</var>, if
any, or null otherwise.</p></li>

<!-- while node != null do -->
<li><p><i>Loop</i>: If <var>node</var> is null, jump to the step labeled
<i>end</i>.</p></li>

<li>

<p>Process <var>node</var> according to the first matching step from the following
list:</p>

<dl class="switch">

<dt>If <var>node</var> is a <code>Text</code> node</dt>

<dd><p>Append the text data of <var>node</var> to <var>string</var>.</p></dd>


<dt>If <var>node</var> is a <code>br</code> element</dt>
<dt>If <var>node</var> is an <span data-x="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>string</var> is not the empty string, push <var>string</var>
onto <var>output</var>, and let <var>string</var> be empty string.</p></dd>


<dt>Otherwise</dt>

<dd>Do nothing.</dd>

</dl>

</li>

<li><p>Let <var>node</var> be <var>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>string</var> is not the empty string, push <var>string</var> onto <var>output</var>.</p></li>

<li><p>Return <var>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 data-x="HTML elements">HTML element</span>
is a <span data-x="bidirectional-algorithm formatting character ranges">bidirectional-algorithm
formatting character range</span>.</p>

<!--(this is unnecessarily pedantic)
<p>The text data of a comment node is a <span data-x="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 data-x="">string</code> production in the following ABNF, the
character set for which is Unicode. <ref spec=ABNF></p>

<pre>string = *( plaintext ( embedding / override / isolation ) ) plaintext
embedding = ( lre / rle ) string pdf
override = ( lro / rlo ) string pdf
isolation = ( lri / rli / fsi ) string pdi
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
lri = %x2066 ; U+2066 LEFT-TO-RIGHT ISOLATE
rli = %x2067 ; U+2067 RIGHT-TO-LEFT ISOLATE
fsi = %x2068 ; U+2068 FIRST STRONG ISOLATE
pdi = %x2069 ; U+2069 POP DIRECTIONAL ISOLATE
plaintext = *( %x0000-2029 / %x202F-2065 / %x206A-10FFFF )
; any string with no bidirectional-algorithm formatting characters</pre>

<p class="note">While the U+2069 POP DIRECTIONAL ISOLATE character implicitly also ends open
embeddings and overrides, text that relies on this implicit scope closure is not conforming to
this specification. All strings of embeddings, overrides, and isolations need to be explicitly
terminated to conform to this section's requirements.</p>
and U+2066 to U+2069 (the bidirectional-algorithm formatting characters). <ref spec=BIDI></p>

<p class="note">Authors are encouraged to use the <code data-x="attr-dir">dir</code> attribute, the
<code>bdo</code> element, and the <code>bdi</code> element, rather than maintaining the
Expand Down

0 comments on commit fe9dce3

Please sign in to comment.