RESOLVED FIXED 149098
Document.title does not behave according to specification
https://bugs.webkit.org/show_bug.cgi?id=149098
Summary Document.title does not behave according to specification
Chris Dumez
Reported 2015-09-12 15:31:05 PDT
Document.title does not behave according to specification: https://html.spec.whatwg.org/multipage/dom.html#document.title In particular, 1. Adding a title element to the Document does not always update the value returned by document.title even if the element if the first title element in the document. 2. The *first* title element in tree order is supposed to update the document title. However, in WebKit, it is the first title *added* to the document, even if it is not the first in tree order.
Attachments
Patch (17.28 KB, patch)
2015-09-12 18:16 PDT, Chris Dumez
rniwa: review+
Chris Dumez
Comment 1 2015-09-12 18:16:12 PDT
Ryosuke Niwa
Comment 2 2015-09-13 21:26:22 PDT
Comment on attachment 261070 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=261070&action=review > Source/WebCore/dom/Document.cpp:1579 > + if (isHTMLDocument() || isXHTMLDocument()) { > + m_titleElement = descendantsOfType<HTMLTitleElement>(*this).first(); > + } else if (isSVGDocument()) { Nit: we shouldn't have curly brackets around a single line statement.
Chris Dumez
Comment 3 2015-09-13 22:03:41 PDT
Note You need to log in before you can comment on or make changes to this bug.