4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <script src="../../js/resources/js-test-pre.js"></script>
7 .testDiv {-webkit-border-start: 5px solid green; -webkit-border-end: 5px solid red; }
11 <p id="description"></p>
12 <div id="console"></div>
13 <div id="result"></div>
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>
24 description('Test that directionality of an element with dir=auto set is determined by the first child text node of that element.');
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";
34 <script src="../../js/resources/js-test-post.js"></script>