RESOLVED FIXED Bug 169600
innerText setter inserts empty text node if value starts with newline
https://bugs.webkit.org/show_bug.cgi?id=169600
Summary innerText setter inserts empty text node if value starts with newline
Simon Pieters (:zcorpan)
Reported 2017-03-14 06:53:07 PDT
+++ This bug was initially created as a clone of Bug #160971 +++ <!DOCTYPE html> <body> <script>document.body.innerText = '\nfoo'</script> The body will have 3 children (empty text node, <br>, text node "foo"), expect 2 (<br>, text node "foo"). If the assigned value starts with a newline, WebKit/Chromium inserts an empty text node, the spec/Gecko/IE don't. Spec at https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute Tests: https://github.com/w3c/web-platform-tests/pull/3492 Fail Start with CR assert_not_equals: Should not have empty text nodes got disallowed value "" Fail Start with LF assert_not_equals: Should not have empty text nodes got disallowed value "" Fail Start with CRLF assert_not_equals: Should not have empty text nodes got disallowed value ""
Attachments
WIP patch (3.96 KB, patch)
2017-03-17 12:09 PDT, Chris Dumez
no flags
Patch (6.99 KB, patch)
2017-03-17 12:43 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-03-17 10:47:34 PDT
Chris Dumez
Comment 2 2017-03-17 12:09:55 PDT
Created attachment 304806 [details] WIP patch
Chris Dumez
Comment 3 2017-03-17 12:43:35 PDT
WebKit Commit Bot
Comment 4 2017-03-18 12:51:51 PDT
Comment on attachment 304810 [details] Patch Clearing flags on attachment: 304810 Committed r214136: <http://trac.webkit.org/changeset/214136>
WebKit Commit Bot
Comment 5 2017-03-18 12:51:59 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.