File: pop-up-alignment-and-direction.html

package info (click to toggle)
qtwebkit 2.3.4.dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 290,116 kB
  • ctags: 272,544
  • sloc: cpp: 1,417,496; python: 85,048; ansic: 39,353; perl: 38,858; ruby: 10,313; objc: 9,505; xml: 8,679; asm: 3,864; yacc: 2,458; sh: 1,237; lex: 813; makefile: 592; java: 228; php: 79
file content (65 lines) | stat: -rw-r--r-- 4,730 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<style>
    select { display: block; font-size: 16px; }
    label { display: block; font: 13px "Lucida Grande"; }
    #reflection { font: 13px "Lucida Grande"; padding: 10px; width: 245px; }
</style>

<p>
    For each of the direction settings below, and for each item in the pop-up menu below, verify that
    the alignment and content match between the pop-up button, the menu item, and the value as it is
    reflected below the pop-up button, and that the checkmarks appear on the start side of the item.
</p>

<label><input type="radio" name="direction" value="ltr" checked onchange="directionChanged(event)"> Left to right</label>
<label><input type="radio" name="direction" value="rtl" onchange="directionChanged(event)"> Right to left</label>

<select id="menu">
    <option style="direction: ltr;">
        First  (03)  fifth
    </option>
    <option style="direction: rtl;">
        First  (03)  fifth
    </option>
    <option style="direction: ltr; unicode-bidi: bidi-override;">
        First  (03)  fifth
    </option>
    <option style="direction: rtl; unicode-bidi: bidi-override;">
        First  (03)  fifth
    </option>
    <option>
          
    </option>
    <option>
        'DD:) 'D91(J)
    </option>
    <option>
        Et volia&#x0300: ATSUI!
    </option>
    <option>
        Directional &#x202e;overrides&#x202c; are confusing.
    </option>
    <option>
        She said &ldquo;&#x202b; TNT !&#x202c;&rdquo; and ran off
    </option>
</select>
<div id="reflection">
    First  (03)  fifth
</div>
<script>
    var reflection = document.getElementById("reflection");

    document.getElementById("menu").onchange = function(event) {
        var option = event.target.item(event.target.selectedIndex);
        reflection.innerHTML = option.innerHTML;
        optionStyle = getComputedStyle(option);
        reflection.style.direction = optionStyle.direction;
        reflection.style.unicodeBidi = optionStyle.unicodeBidi;
        reflection.style.textAlign = getComputedStyle(event.target).direction === "ltr" ? "left" : "right";
    }

    function directionChanged(event)
    {
        document.getElementById('menu').style.direction = event.target.value;
        reflection.style.textAlign = event.target.value === "ltr" ? "left" : "right";
    }
</script>