| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML> | |
| 2 <html> | |
| 3 <head> | |
| 4 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=EUC-JP"> | |
| 5 <script> | |
| 6 if (window.testRunner) | |
| 7 testRunner.dumpAsText(); | |
| 8 </script> | |
| 9 </head> | |
| 10 <body> | |
| 11 <p> | |
| 12 Test for the <code>text</code> attribute of <code>HTMLOptionElement</cod
e>. | |
| 13 To match other browsers, the attribute value is the text as displayed | |
| 14 in the list box or popup, rather than strictly “the text contained
within the option element” | |
| 15 as <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html
.html#ID-48154426">specified</a>. | |
| 16 </p> | |
| 17 <select multiple> | |
| 18 <option id="o1">foo </option> | |
| 19 <option id="o2"> foo</option> | |
| 20 <option id="o3">\</option> | |
| 21 <option id="o4">foo bar</option> | |
| 22 <option id="o5" label=" label ">ignored</option> | |
| 23 </select> | |
| 24 <pre id="console"></pre> | |
| 25 <script> | |
| 26 function log(message) | |
| 27 { | |
| 28 document.getElementById("console").appendChild(document.createTextNo
de(message + "\n")); | |
| 29 } | |
| 30 | |
| 31 function test(id, expect) | |
| 32 { | |
| 33 var text = document.getElementById(id).text; | |
| 34 if (text == expect) | |
| 35 log("PASS: got \"" + expect + "\" as expected."); | |
| 36 else | |
| 37 log("FAIL: expected \"" + expect + "\" but got \"" + text + "\"
instead."); | |
| 38 } | |
| 39 | |
| 40 test("o1", "foo"); | |
| 41 test("o2", "foo"); | |
| 42 test("o3", "\u00a5"); | |
| 43 test("o4", "foo bar"); | |
| 44 test("o5", "label"); | |
| 45 </script> | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |