<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Setting document.title reuses &lt;title&gt;'s textnode child"
   href="https://bugs.webkit.org/show_bug.cgi?id=28864#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Setting document.title reuses &lt;title&gt;'s textnode child"
   href="https://bugs.webkit.org/show_bug.cgi?id=28864">bug 28864</a>
              from <span class="vcard"><a class="email" href="mailto:cdumez&#64;apple.com" title="Chris Dumez &lt;cdumez&#64;apple.com&gt;"> <span class="fn">Chris Dumez</span></a>
</span></b>
        <pre>Looks like this still applies according to the latest specification:
- <a href="https://html.spec.whatwg.org/multipage/dom.html#document.title">https://html.spec.whatwg.org/multipage/dom.html#document.title</a>
- <a href="https://dom.spec.whatwg.org/#dom-node-textcontent">https://dom.spec.whatwg.org/#dom-node-textcontent</a>

This is caused by the following &quot;optimization&quot; in HTMLTitleElement::setText():
    if (!value.isEmpty() &amp;&amp; hasOneChild() &amp;&amp; is&lt;Text&gt;(*firstChild())) {
        downcast&lt;Text&gt;(*firstChild()).setData(value);
        return;
    }</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>