layout/reftests/bidi/dirAuto/dir_auto-set-contained-invalid-dir-R.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE html>
     2 <html>
     3   <head>
     4     <meta charset="utf-8" />
     5     <title>HTML Test: dir=auto, start with dir, then R</title>
     6     <link rel="reference" href="dir_auto-contained-dir-R-ref.html" />
     7     <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" />
     8     <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" />
     9     <link rel="author" title="Simon Montagu" href="mailto:smontagu@smontagu.org" />
    10     <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" />
    11     <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute" />
    12     <meta name="assert" content="
    13       When dir='auto', the direction is set according to the first strong character
    14       of the text while ignoring contained elements with an explicit dir of their own.
    15       In this test, it is the Hebrew letter Alef, thus the direction must be
    16       resolved as RTL.
    17       This is a variation of the original dir_auto-contained-dir-R.html in which
    18        an element with an invalid dir attribute has the dir attribute set by
    19        script after loading the page" />
    20     <style>
    21       input, textarea {
    22         font-size:1em;
    23       }
    24       body {
    25         font-size:2em;
    26       }
    27       .test, .ref {
    28         border: medium solid gray;
    29         width: 400px;
    30         margin: 20px;
    31       }
    32       .comments {
    33         display: none;
    34       }
    35     </style>
    36     <script type="text/javascript">
    37 function setDirs(value)
    38 {
    39   var p1 = document.getElementById("p1");
    40   p1.dir = value;
    42   var p1 = document.getElementById("p2");
    43   p2.dir = value;
    44 }
    45    </script>
    46   </head>
    47   <body onload="setDirs('ltr')">
    48     <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div>
    49     <div class="comments">
    50       Key to entities used below:
    51       &#x05D0; - The Hebrew letter Alef (strongly RTL).
    52       &#x05D1; - The Hebrew letter Bet (strongly RTL).
    53       &#x05D2; - The Hebrew letter Gimel (strongly RTL).
    54     </div>
    55     <div class="test">
    56       <div dir="ltr">
    57         <div dir="auto"><p id="p1" dir="foopy">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
    58       </div>
    59       <div dir="rtl">
    60         <div dir="auto"><p id="p2" dir="foopy">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
    61       </div>
    62     </div>
    63     <div class="ref">
    64       <div dir="ltr">
    65         <div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
    66       </div>
    67       <div dir="rtl">
    68         <div dir="rtl"><p dir="ltr">DEF</p>&#x05D0;&#x05D1;&#x05D2;ABC.</div>
    69       </div>
    70     </div>
    71   </body>
    72 </html>

mercurial