RESOLVED FIXED 96694
createHTMLDocument() should not create a title element if the title argument is left out
https://bugs.webkit.org/show_bug.cgi?id=96694
Summary createHTMLDocument() should not create a title element if the title argument ...
Attachments
Patch (5.30 KB, patch)
2012-10-02 09:46 PDT, Erik Arvidsson
no flags
Patch for landing (5.44 KB, patch)
2012-10-02 12:13 PDT, Erik Arvidsson
no flags
Alexey Proskuryakov
Comment 1 2012-09-14 13:17:45 PDT
What do actual browsers do? The e-mail linked above is kind of cryptic.
Ojan Vafai
Comment 2 2012-09-14 13:23:03 PDT
The rest of the thread talks about that. From the thread, it sounds like other browsers currently throw an error.
Erik Arvidsson
Comment 3 2012-10-02 09:46:23 PDT
Darin Adler
Comment 4 2012-10-02 09:49:54 PDT
Comment on attachment 166702 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166702&action=review Looks fine. The risk of compatibility problems seems small. > LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title.html:7 > +var doc = document.implementation.createHTMLDocument(); > +shouldBeNull('doc.querySelector("title")'); Way better to write these as one-liner tests: shouldBeNull('document.implementation.createHTMLDocument().querySelector("title")'); shouldBeEqualToString('document.implementation.createHTMLDocument(null).querySelector("title").textContent', 'null'); That way the test output will show what we’re testing.
Erik Arvidsson
Comment 5 2012-10-02 12:13:45 PDT
Created attachment 166728 [details] Patch for landing
Ojan Vafai
Comment 6 2012-10-02 12:20:56 PDT
Comment on attachment 166728 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=166728&action=review > LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title.html:10 > +shouldBeEqualToString('document.implementation.createHTMLDocument(undefined).querySelector("title").textContent', 'undefined'); > +shouldBeEqualToString('document.implementation.createHTMLDocument("").querySelector("title").textContent', ''); This doesn't seem to match http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument. I'd expect leaving the argument out being the same as passing in undefined and passing the empty string to create an empty title element. What am I missing?
Erik Arvidsson
Comment 7 2012-10-02 12:31:48 PDT
(In reply to comment #6) > What am I missing? This was resolved over IRC
Ojan Vafai
Comment 8 2012-10-02 12:31:55 PDT
Comment on attachment 166728 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=166728&action=review >> LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title.html:10 >> +shouldBeEqualToString('document.implementation.createHTMLDocument("").querySelector("title").textContent', ''); > > This doesn't seem to match http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument. I'd expect leaving the argument out being the same as passing in undefined and passing the empty string to create an empty title element. > > What am I missing? Oh, nevermind. I misread. Doing too many things at once. :(
WebKit Review Bot
Comment 9 2012-10-02 13:35:36 PDT
Comment on attachment 166728 [details] Patch for landing Clearing flags on attachment: 166728 Committed r130203: <http://trac.webkit.org/changeset/130203>
WebKit Review Bot
Comment 10 2012-10-02 13:35:40 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.