Remove children of title node before updating

http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#document.title

Extra care must be taken because of mutation events, which may cause
just about anything to happen including m_titleElement to be removed
itself when removing its children (see

LayoutTests/fast/dom/document-set-title-mutation-crash.html

for a good example). So make sure to again check m_titleElement before
actually setting the new title text.

Also update a related code comment that had rotted a bit.

Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=28864

BUG=330140

Review URL: https://codereview.chromium.org/107513013

git-svn-id: svn://svn.chromium.org/blink/trunk@164228 bbb929c8-8fbe-4397-9dbb-9b2b20218538
5 files changed
tree: 3c9332db1ba00a3c1077f3f81dc923950a62fc55
  1. third_party/