blob: 2e621d6ef69d145ca23d8f3a85745611018a65a2 [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>.
To match other browsers, the attribute value is the text as displayed
in the list box or popup, rather than strictly &ldquo;the text contained within the option element&rdquo;
as <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-48154426">specified</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 ">ignored</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", "label");
</script>
</body>
</html>