<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="../../../resources/js-test.js"></script>
<style>
.testElement {border-inline-start: 5px solid green; border-inline-end: 5px solid red; }
</style>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<div id="result"></div>
<div id="parentDiv">
Test that the direction of the div is left-to-right, ignoring its child that is a text form control.
<div id="left-to-right" dir="auto" class="testElement">
<input type="text" value="מקור השם עברית">Test test test
</div>
Test that the direction of the div is right-to-left, ignoring its child that is a text form control.
<div id="right-to-left1" dir="auto" class="testElement">
<input type="text" value="Test test test">מקור השם עברית
</div>
<div id="right-to-left2" dir="auto" class="testElement">
<textarea>Test test test</textarea>מקור השם עברית
</div>
</div>
<script>
description('Test that directionality of an element with dir=auto set is not determined by the value of its child text form control.');
var el = document.getElementById("left-to-right");
shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(255, 0, 0)'");
el = document.getElementById("right-to-left1");
shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
el = document.getElementById("right-to-left2");
shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color')", "'rgb(0, 128, 0)'");
document.getElementById("parentDiv").style.display = "none";
</script>
</body>
</html>