[DOMHTMLDocument doctype] always returning nil.
Sometime since 418, the implementation of HTMLDocument::doctype was changed to: DocumentType *HTMLDocument::doctype() const { // According to a comment in dom_doc.cpp, doctype is null for HTML documents. return 0; } Firstly, where is dom_doc.cpp? It doesn't seem a part of WebKit/Core. What is the comment and why is it deemed correct that doctype should be null for HTML documents? Why do I care: Well, I am writing some code to take a DOM (or portions thereof) and convert it back into a fairly self-contained HTML file. Without being able to reconstitute the correct <!DOCTYPE ...> I have no way of ensuring that quirks mode is set correctly when displaying the resulting html. Is there any other way to determine this? Matt Gough
On Apr 21, 2006, at 8:10 AM, Matt Gough wrote:
Sometime since 418, the implementation of HTMLDocument::doctype was changed to:
DocumentType *HTMLDocument::doctype() const { // According to a comment in dom_doc.cpp, doctype is null for HTML documents. return 0; }
Firstly, where is dom_doc.cpp? It doesn't seem a part of WebKit/Core.
It's been renamed to Document.cpp. I think this comment is actually wrong. I see nothing in the spec or other implementations that says doctype should be null for HTML documents. I'd love to see a patch to fix this. Regards, Maciej
On 21 Apr 2006, at 20:10, Maciej Stachowiak wrote:
It's been renamed to Document.cpp. I think this comment is actually wrong. I see nothing in the spec or other implementations that says doctype should be null for HTML documents. I'd love to see a patch to fix this.
Where presumably that patch would just involve removing HTMLDocument::doctype and letting the default implementation do what its stuff. Matt
On Apr 21, 2006, at 3:41 PM, Matt Gough wrote:
On 21 Apr 2006, at 20:10, Maciej Stachowiak wrote:
It's been renamed to Document.cpp. I think this comment is actually wrong. I see nothing in the spec or other implementations that says doctype should be null for HTML documents. I'd love to see a patch to fix this.
Where presumably that patch would just involve removing HTMLDocument::doctype and letting the default implementation do what its stuff.
Yep, that plus some test cases that verify we match other browsers both when there is a doctype declaration and there isn't. Should be a very easy fix. Please at least file the bug. Thanks, Maciej
On 22 Apr 2006, at 00:14, Maciej Stachowiak wrote:
Yep, that plus some test cases that verify we match other browsers both when there is a doctype declaration and there isn't. Should be a very easy fix. Please at least file the bug.
participants (2)
-
Maciej Stachowiak
-
Matt Gough