Summary: | createHTMLDocument() should not create a title element if the title argument is left out | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ojan Vafai <ojan> | ||||||
Component: | DOM | Assignee: | Erik Arvidsson <arv> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | abarth, ap, arv, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
URL: | http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument | ||||||||
Attachments: |
|
Description
Ojan Vafai
2012-09-13 14:13:04 PDT
What do actual browsers do? The e-mail linked above is kind of cryptic. The rest of the thread talks about that. From the thread, it sounds like other browsers currently throw an error. Created attachment 166702 [details]
Patch
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. Created attachment 166728 [details]
Patch for landing
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? (In reply to comment #6) > What am I missing? This was resolved over IRC 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. :( Comment on attachment 166728 [details] Patch for landing Clearing flags on attachment: 166728 Committed r130203: <http://trac.webkit.org/changeset/130203> All reviewed patches have been landed. Closing bug. |