tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / dom / HTMLElement / attr-dir-auto.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 .testDiv {-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.
16 <div id="left-to-right" dir="auto" class="testDiv">Test test test</div>
17 Test that the direction of hebrew text is right-to-left.
18 <div id="right-to-left1" dir="auto" class="testDiv">מקור השם עברית</div>
19 Test that '?' does not affect the directionality.
20 <div id="right-to-left2" dir="auto" class="testDiv"><span>??</span>מקור השם עברית<span>??</span></div>
21 </div>
22 <script>
23
24 description('Test that directionality of an element with dir=auto set is determined by the first child text node of that element.');
25
26 var el = document.getElementById("left-to-right");
27 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(255, 0, 0)'");
28 el = document.getElementById("right-to-left1");
29 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
30 el = document.getElementById("right-to-left2");
31 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
32 document.getElementById("parentDiv").style.display = "none";
33 </script>
34 <script src="../../js/resources/js-test-post.js"></script>
35 </body>
36 </html>