| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/Strict.dtd"> |
| <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <title>XHTML innerHTML null byte test</title> |
| <script><![CDATA[ |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| ]]></script> |
| </head> |
| <body> |
| <p id="p0">FAIL: No exception raised.</p> |
| <script><![CDATA[ |
| try { |
| document.getElementById("p0").innerHTML = "\x00FAIL: Nulls mishandled."; |
| } catch(e) { |
| document.getElementById("p0").innerHTML = "PASS: An exception was raised, no crashing."; |
| if (e.code != DOMException.SYNTAX_ERR) |
| console.log("Unexpected error thrown: " + e.name + ": " + e.message); |
| } |
| ]]></script> |
| </body> |
| </html> |