<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - innerText setter inserts empty text node if value starts with newline"
href="https://bugs.webkit.org/show_bug.cgi?id=169600">169600</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>innerText setter inserts empty text node if value starts with newline
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>WebKit Nightly Build
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>HTML DOM
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zcorpan@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>buildbot@hotmail.com, cdumez@apple.com, commit-queue@webkit.org, darin@apple.com, d@domenic.me, rniwa@webkit.org, sam@webkit.org
</td>
</tr></table>
<p>
<div>
<pre>+++ This bug was initially created as a clone of <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Align the innerText setter with the HTML spec and Gecko"
href="show_bug.cgi?id=160971">Bug #160971</a> +++
<!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 <a href="https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute">https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute</a>
Tests: <a href="https://github.com/w3c/web-platform-tests/pull/3492">https://github.com/w3c/web-platform-tests/pull/3492</a>
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 ""</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>