Bug 149005

Summary: Setting document.title when there is no title and no head element should no nothing
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, commit-queue, esprehn+autocc, kangil.han, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
URL: https://html.spec.whatwg.org/multipage/dom.html#document.title
Attachments:
Description Flags
Patch none

Description Chris Dumez 2015-09-09 10:59:20 PDT
Setting document.title when there is no title and no head element should no nothing:
https://html.spec.whatwg.org/multipage/dom.html#document.title

Firefox and Chrome comply with the specification. However, WebKit returns the updated title when querying document.title after setting it.
Comment 1 Chris Dumez 2015-09-09 10:59:54 PDT
rdar://problem/22567524
Comment 2 Chris Dumez 2015-09-09 11:30:03 PDT
Created attachment 260865 [details]
Patch
Comment 3 Ryosuke Niwa 2015-09-09 14:25:51 PDT
Comment on attachment 260865 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=260865&action=review

> Source/WebCore/dom/Document.cpp:1541
> +        m_titleElement = createElement(titleTag, false);

This boolean argument sucks :(  We should replace it with enum class in the future.
Comment 4 WebKit Commit Bot 2015-09-09 15:11:55 PDT
Comment on attachment 260865 [details]
Patch

Clearing flags on attachment: 260865

Committed r189555: <http://trac.webkit.org/changeset/189555>
Comment 5 WebKit Commit Bot 2015-09-09 15:12:01 PDT
All reviewed patches have been landed.  Closing bug.