blob: 74e321e5be25aa36b75a7fc450e18559d7f9df14 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=EUC-JP">
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<p>
Test for the <code>text</code> attribute of <code>HTMLOptionElement</code>.
<a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-48154426">Specification</a>.
</p>
<select multiple>
<option id="o1">foo </option>
<option id="o2"> foo</option>
<option id="o3">\</option>
<option id="o4">foo bar</option>
<option id="o5" label=" label ">text</option>
</select>
<pre id="console"></pre>
<script>
function log(message)
{
document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
}
function test(id, expect)
{
var text = document.getElementById(id).text;
if (text == expect)
log("PASS: got \"" + expect + "\" as expected.");
else
log("FAIL: expected \"" + expect + "\" but got \"" + text + "\" instead.");
}
test("o1", "foo");
test("o2", "foo");
test("o3", "\u00a5");
test("o4", "foo bar");
test("o5", "text");
</script>
</body>
</html>