tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / dom / HTMLElement / attr-dir-auto-text-form-control.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <script src="../../js/resources/js-test-pre.js"></script>
6 <style>
7 .testElement {-webkit-border-start: 5px solid green; -webkit-border-end: 5px solid red; }
8 </style>
9 </head>
10 <body>
11 <p id="description"></p>
12 <div id="console"></div>
13 <div id="result"></div>
14 <div id="parentDiv">
15 Test that the direction of english text is left-to-right in the text form control.
16 <input type="text" id="left-to-right" dir="auto" class="testElement" value="Test test test">
17 Test that the direction of hebrew text is right-to-left in the text form control.
18 <input type="text" id="right-to-left1" dir="auto" class="testElement" value="מקור השם עברית">
19 <textarea id="right-to-left2" dir="auto" class="testElement">מקור השם עברית</textarea>
20 Test that the direction of hebrew text is right-to-left in the text form control, even if inserted dynamically.
21 <textarea id="right-to-left3" dir="auto" class="testElement"></textarea>
22 </div>
23 <script>
24
25 description('Test that directionality of a text form control with dir=auto set is determined by the value of that form control.');
26
27 var el = document.getElementById("left-to-right");
28 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(255, 0, 0)'");
29 el = document.getElementById("right-to-left1");
30 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
31 el = document.getElementById("right-to-left2");
32 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
33 el = document.getElementById("right-to-left3");
34 el.innerText = "מקור השם עברית";
35 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
36
37 document.getElementById("parentDiv").style.display = "none";
38 </script>
39 <script src="../../js/resources/js-test-post.js"></script>
40 </body>
41 </html>