blob: 90ec1b3b7d0f5f64acbe3a9f62fec83be935af98 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<select>
<option id="o1"> text with extra while spaces </option>
<option id="o2"> text </option>
<option id="o3">&nbsp;test&nbsp;text&nbsp;</option>
<option id="o4"> test&nbsp;&nbsp;text </option>
</select>
<script>
description('Test for space striping .value attribute of OPTION element');
var o1 = document.getElementById('o1');
shouldBe('o1.value', '"text with extra while spaces"');
var o2 = document.getElementById('o2');
shouldBe('o2.value', '"text"');
var o3 = document.getElementById('o3');
var expected = '\u00A0'+'test'+'\u00A0'+ 'text'+'\u00A0';
shouldBe('o3.value','"'+expected+'"');
var o4 = document.getElementById('o4');
var expected = 'test'+'\u00A0\u00A0'+ 'text';
shouldBe('o4.value', '"'+expected+'"');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>