[html5] r5689 - [e] (0) Add a new example for alert()'s bidi implications Fixing http://www.w3.o [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Nov 30 13:21:46 PST 2010


Author: ianh
Date: 2010-11-30 13:21:42 -0800 (Tue, 30 Nov 2010)
New Revision: 5689

Modified:
   complete.html
   index
   source
Log:
[e] (0) Add a new example for alert()'s bidi implications
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10827

Modified: complete.html
===================================================================
--- complete.html	2010-11-30 20:51:36 UTC (rev 5688)
+++ complete.html	2010-11-30 21:21:42 UTC (rev 5689)
@@ -86994,28 +86994,41 @@
 
   <div class=example>
 
-    <p>For example, consider the following script:</p>
+   <p>Thus, the following script:</p>
 
-    <pre>var s;
+   <pre>alert('\u05DC\u05DE\u05D3 HTML \u05D4\u05D9\u05D5\u05DD!')</pre>
+
+   <p>...would always result in a message reading
+        "<bdo dir=rtl lang="" title="">למד LMTH היום!</bdo>"
+   (not "<bdo dir=ltr lang="" title="">דמל HTML םויה!</bdo>"),
+   regardless of the language of the user agent interface or the
+   direction of the page or any of its elements.</p>
+
+  </div>
+
+  <div class=example>
+
+   <p>For a more complex example, consider the following script:</p>
+
+   <pre>var s;
 if (s = prompt('What is your name?')) {
   alert(s + '! Ok, Fred, ' + s + ', and Wilma will get the car.');
 }</pre>
 
-    <p>When the user enters "<kbd>Kitty</kbd>", the user agent would
-    alert "<samp>Kitty! Ok, Fred, Kitty, and Wilma will get the
-    car.</samp>". However, if the user enters "<kbd dir=rtl lang=ar>لا أفهم</kbd>",
-    then the bidirectional algorithm will determine that the direction
-    of the paragraph is right-to-left, and so the output will be
-    "<samp lang=""><bdo dir=rtl>لا أفهم! derF ,kO, لا أفهم, rac eht teg lliw amliW dna.</bdo></samp>"!</p>
+   <p>When the user enters "<kbd>Kitty</kbd>", the user agent would
+   alert "<samp>Kitty! Ok, Fred, Kitty, and Wilma will get the
+   car.</samp>". However, if the user enters "<kbd dir=rtl lang=ar>لا أفهم</kbd>",
+   then the bidirectional algorithm will determine that the direction
+   of the paragraph is right-to-left, and so the output will be "<samp lang=""><bdo dir=rtl>لا أفهم! derF ,kO, لا أفهم, rac eht teg lliw amliW dna.</bdo></samp>"!</p>
 
-    <p>Authors can enforce a particular interpretation by using the
-    Unicode U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK
-    characters.</p>
-
   </div>
 
+  <p>When necessary, authors can enforce a particular direction for a
+  given paragraph by starting it with the Unicode U+200E LEFT-TO-RIGHT
+  MARK or U+200F RIGHT-TO-LEFT MARK characters.</p>
 
 
+
   <h3 id=print-media><span class=secno>14.7 </span>Print media</h3>
 
   <p>User agents are expected to allow the user to request the

Modified: index
===================================================================
--- index	2010-11-30 20:51:36 UTC (rev 5688)
+++ index	2010-11-30 21:21:42 UTC (rev 5689)
@@ -82908,28 +82908,41 @@
 
   <div class=example>
 
-    <p>For example, consider the following script:</p>
+   <p>Thus, the following script:</p>
 
-    <pre>var s;
+   <pre>alert('\u05DC\u05DE\u05D3 HTML \u05D4\u05D9\u05D5\u05DD!')</pre>
+
+   <p>...would always result in a message reading
+        "<bdo dir=rtl lang="" title="">למד LMTH היום!</bdo>"
+   (not "<bdo dir=ltr lang="" title="">דמל HTML םויה!</bdo>"),
+   regardless of the language of the user agent interface or the
+   direction of the page or any of its elements.</p>
+
+  </div>
+
+  <div class=example>
+
+   <p>For a more complex example, consider the following script:</p>
+
+   <pre>var s;
 if (s = prompt('What is your name?')) {
   alert(s + '! Ok, Fred, ' + s + ', and Wilma will get the car.');
 }</pre>
 
-    <p>When the user enters "<kbd>Kitty</kbd>", the user agent would
-    alert "<samp>Kitty! Ok, Fred, Kitty, and Wilma will get the
-    car.</samp>". However, if the user enters "<kbd dir=rtl lang=ar>لا أفهم</kbd>",
-    then the bidirectional algorithm will determine that the direction
-    of the paragraph is right-to-left, and so the output will be
-    "<samp lang=""><bdo dir=rtl>لا أفهم! derF ,kO, لا أفهم, rac eht teg lliw amliW dna.</bdo></samp>"!</p>
+   <p>When the user enters "<kbd>Kitty</kbd>", the user agent would
+   alert "<samp>Kitty! Ok, Fred, Kitty, and Wilma will get the
+   car.</samp>". However, if the user enters "<kbd dir=rtl lang=ar>لا أفهم</kbd>",
+   then the bidirectional algorithm will determine that the direction
+   of the paragraph is right-to-left, and so the output will be "<samp lang=""><bdo dir=rtl>لا أفهم! derF ,kO, لا أفهم, rac eht teg lliw amliW dna.</bdo></samp>"!</p>
 
-    <p>Authors can enforce a particular interpretation by using the
-    Unicode U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK
-    characters.</p>
-
   </div>
 
+  <p>When necessary, authors can enforce a particular direction for a
+  given paragraph by starting it with the Unicode U+200E LEFT-TO-RIGHT
+  MARK or U+200F RIGHT-TO-LEFT MARK characters.</p>
 
 
+
   <h3 id=print-media><span class=secno>12.7 </span>Print media</h3>
 
   <p>User agents are expected to allow the user to request the

Modified: source
===================================================================
--- source	2010-11-30 20:51:36 UTC (rev 5688)
+++ source	2010-11-30 21:21:42 UTC (rev 5689)
@@ -99706,30 +99706,44 @@
 
   <div class="example">
 
-    <p>For example, consider the following script:</p>
+   <p>Thus, the following script:</p>
 
-    <pre>var s;
+   <pre>alert('\u05DC\u05DE\u05D3 HTML \u05D4\u05D9\u05D5\u05DD!')</pre>
+
+   <p>...would always result in a message reading
+        "<bdo lang="" title="" dir=rtl>&#x05DC;&#x05DE;&#x05D3; LMTH &#x05D4;&#x05D9;&#x05D5;&#x05DD;!</bdo>"
+   (not "<bdo lang="" title="" dir=ltr>&#x05D3;&#x05DE;&#x05DC; HTML &#x05DD;&#x05D5;&#x05D9;&#x05D4;!</bdo>"),
+   regardless of the language of the user agent interface or the
+   direction of the page or any of its elements.</p>
+
+  </div>
+
+  <div class="example">
+
+   <p>For a more complex example, consider the following script:</p>
+
+   <pre>var s;
 if (s = prompt('What is your name?')) {
   alert(s + '! Ok, Fred, ' + s + ', and Wilma will get the car.');
 }</pre>
 
-    <p>When the user enters "<kbd>Kitty</kbd>", the user agent would
-    alert "<samp>Kitty! Ok, Fred, Kitty, and Wilma will get the
-    car.</samp>". However, if the user enters "<kbd dir="rtl"
-    lang="ar">&#x644;&#x627; &#x623;&#x641;&#x647;&#x645;</kbd>",
-    then the bidirectional algorithm will determine that the direction
-    of the paragraph is right-to-left, and so the output will be
-    "<samp lang=""><bdo
-    dir="rtl">&#x644;&#x627; &#x623;&#x641;&#x647;&#x645;! derF ,kO, &#x644;&#x627; &#x623;&#x641;&#x647;&#x645;, rac eht teg lliw amliW dna.</bdo></samp>"!</p>
+   <p>When the user enters "<kbd>Kitty</kbd>", the user agent would
+   alert "<samp>Kitty! Ok, Fred, Kitty, and Wilma will get the
+   car.</samp>". However, if the user enters "<kbd dir="rtl"
+   lang="ar">&#x644;&#x627; &#x623;&#x641;&#x647;&#x645;</kbd>",
+   then the bidirectional algorithm will determine that the direction
+   of the paragraph is right-to-left, and so the output will be "<samp
+   lang=""><bdo
+   dir="rtl">&#x644;&#x627; &#x623;&#x641;&#x647;&#x645;! derF ,kO, &#x644;&#x627; &#x623;&#x641;&#x647;&#x645;, rac eht teg lliw amliW dna.</bdo></samp>"!</p>
 
-    <p>Authors can enforce a particular interpretation by using the
-    Unicode U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK
-    characters.</p>
-
   </div>
 
+  <p>When necessary, authors can enforce a particular direction for a
+  given paragraph by starting it with the Unicode U+200E LEFT-TO-RIGHT
+  MARK or U+200F RIGHT-TO-LEFT MARK characters.</p>
 
 
+
   <h3>Print media</h3>
 
   <p>User agents are expected to allow the user to request the




More information about the Commit-Watchers mailing list