RESOLVED CONFIGURATION CHANGED 13962
trElement.innerHTML = "<td>foo</td>" throws DOM Exception 7
https://bugs.webkit.org/show_bug.cgi?id=13962
Summary trElement.innerHTML = "<td>foo</td>" throws DOM Exception 7
Eric Seidel (no email)
Reported 2007-06-01 01:28:36 PDT
trElement.innerHTML = "<td>foo</td>" throws DOM Exception 7 Hyatt believes this was done to mimic IE, but is probably unnecessary (and limiting to web authors).
Attachments
xhtml test case (224 bytes, application/xhtml+xml)
2007-06-01 01:29 PDT, Eric Seidel (no email)
no flags
Eric Seidel (no email)
Comment 1 2007-06-01 01:29:04 PDT
Created attachment 14822 [details] xhtml test case
Eric Seidel (no email)
Comment 2 2007-06-01 01:58:12 PDT
It seems to be entirely related to the <td> part. the XML parser seems to choke on that. Same is true of a <p> element with pElement.innerHTML = '<b>this should be bold</b>'.
Ahmad Saleem
Comment 3 2022-07-19 10:54:26 PDT
I am unable to reproduce this bug using attached test case in Safari 15.5 on macOS 12.4, all browsers (Chrome Canary 105 and Firefox Nightly 104) renders this as empty web page and does not have any table row or data showing up. I think it was to align with IE behavior / quirks but now since all browsers are aligned (major browser engines), this can be closed or marked as "RESOLVED WONTFIX" or "RESOLVED INVALID". Thanks!
Ryosuke Niwa
Comment 4 2022-07-19 11:31:00 PDT
All browsers agree in behavior now.
Alexey Proskuryakov
Comment 5 2022-07-20 17:33:59 PDT
The test as attached is incorrect, it needs some CDATA magic added: <html xmlns="http://www.w3.org/1999/xhtml"> <body> <table> <tr id="tr"> <td>FAIL</td> </tr> </table> <script> <![CDATA[ document.getElementById('tr').innerHTML = "<td>PASS</td>"; console.log("my script"); ]]> </script> </body> </html> But then we do behave the same as Chrome and Firefox, so yay.
Note You need to log in before you can comment on or make changes to this bug.