Version: (using KDE KDE 3.2.2) Installed from: Debian testing/unstable Packages OS: Linux In Konqueror 3.2.2, HTML 4.0 Transitional seems to be treated like HTML 4.0 strict docs (doesn't render in quirks mode) Example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html> <head> <title>doctype test</title> </head> <body> <table border='1'><tr><td> <p>Para</p> </td></tr></table> </body> </html> The 'Para' paragraph should have a margin above and below. If you replace the doctype with: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> then Konqueror should go into quirks mode and the margins should collapse. This is the observed behaviour in Mozilla 1.6 and Konqueror 3.2.1 (99% certain) In Konqueror 3.2.2, 4.0 transitional is treated like 4.0 strict. If you remove the doctype altogether, or use an HTML 3.2 doctype, Konq 3.2.2 then goes into quirks mode.
Created an attachment (id=6291) [details] testcase for HTML 4.0 Transitional
Created an attachment (id=6292) [details] Testcase for HTML 4.0 (strict)
CVS commit by coolo: at least KDE 3.3 shouldn't have this regression ;( CCMAIL: 83129-done@bugs.kde.org M +1 -1 dom_docimpl.cpp 1.279 --- kdelibs/khtml/xml/dom_docimpl.cpp #1.278:1.279 @@ -959,5 +959,5 @@ void DocumentImpl::recalcStyle( StyleCha _style->setFontDef(fontDef); _style->htmlFont().update( paintDeviceMetrics() ); - if ( inCompatMode() ) + if ( parseMode() != Strict ) _style->setHtmlHacks(true); // enable html specific rendering tricks
This fix breaks almost-strict mode (HTML 4.01 Transitional). See testcase below.
Created an attachment (id=6341) [details] Testcase for HTML 4.01 Transitional For HTML 4.01 Transitional only, the renderer should resort to almost-strict mode. This is at least what Mozilla and Safari do.
CVS commit by coolo: mergin the doctype sniffing code from Webcore, but reviewed quite some aspects of this - tons of feedback and test cases by David and Germain BUG: 83129 BUG: 79970 A html/doctypes.gperf 1.1 M +6 -0 ChangeLog 1.320 M +3 -6 html/Makefile.am 1.17 M +236 -105 html/html_documentimpl.cpp 1.169 M +2 -2 html/html_headimpl.cpp 1.110 M +1 -1 html/htmlparser.cpp 1.352 M +3 -3 xml/dom_docimpl.cpp 1.301 M +2 -0 xml/dom_docimpl.h 1.138 M +1 -1 xml/dom_elementimpl.cpp 1.202
You need to log in before you can comment on or make changes to this bug.