blob: 359c2813c311f5ceaee8be6e16692adcfe5c073b [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="../../../resources/js-test-pre.js"></script>
<style>
.testElement {-webkit-border-start: 5px solid green; -webkit-border-end: 5px solid red; }
</style>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<div id="result"></div>
<div id="parentDiv">
<input type="text" id="text1" dir="auto" class="testElement" value="מקור השם עברית">
<textarea id="text2" dir="auto" class="testElement">מקור השם עברית</textarea>
</div>
<script>
description('Test that directionality is re-evaluated when dir attribute changes.');
var el = document.getElementById("text1");
shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
el.setAttribute("dir", "ltr");
shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(255, 0, 0)'");
el = document.getElementById("text2");
shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
el.setAttribute("dir", "ltr");
shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(255, 0, 0)'");
el = document.getElementById("parentDiv");
el.style.display = "none";
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>