Bug 170650 - [testcase] Broken website layout - http://pollycoke.net
Summary: [testcase] Broken website layout - http://pollycoke.net
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.1.0
Platform: Compiled Sources Unspecified
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-08 01:14 UTC by Luigi Toscano
Modified: 2008-09-15 04:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Reduced test case (540 bytes, text/html)
2008-09-10 21:43 UTC, Frank Reininghaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luigi Toscano 2008-09-08 01:14:26 UTC
Version:            (using KDE 4.1.1)
Installed from:    Compiled From Sources

The layout of http://pollycoke.net/, an italian blog wordpress-based, is broken in KDE 4.x while it renders correctly in 3.5.x.
Comment 1 Germain Garand 2008-09-09 00:35:24 UTC
when I disable JS the rendering is fine, so might be a script misbehaving..
not sure why it would not affect 3.5 in the same way though.

Comment 2 Frank Reininghaus 2008-09-10 21:43:54 UTC
Created attachment 27356 [details]
Reduced test case

This reduced test case still shows the strange behaviour for me - some text is shown outside the box in 4.1.1, but not in 3.5.10. I can now reproduce it without JS although I'm pretty sure that removing the links to the ".js" files did not work at an earlier stage in the reduction.

It's also funny that the buggy behaviour depends on the "<!DOCTYPE..." declaration. Remove it or change "XHTML Strict" to "XHTML Transitional", and the bug goes away. Replacing "XHTML Strict" by "HTML Strict" keeps the buggy behaviour though.
Comment 3 Germain Garand 2008-09-11 22:16:24 UTC
thanks for the nice testcase!
so the 'bug' is that we try to do stricter, more standard HTML parsing in 4.x in standard mode.

Apparently, this is way too optimistic for the web.
I'll revert to more loosy parsing in all modes.

Comment 4 Germain Garand 2008-09-15 04:31:20 UTC
SVN commit 861054 by ggarand:

.doing strict dtd checking for inlines in strict mode turns out to be
 too optimistic. It breaks sites.

.no popBlock for dl/dt errors. It doesn't match what other browsers do.

BUG: 170650


 M  +2 -5      dtd.cpp  
 M  +0 -8      htmlparser.cpp  


--- trunk/KDE/kdelibs/khtml/html/dtd.cpp #861053:861054
@@ -474,14 +474,11 @@
     case ID_FONT:
     case ID_LEGEND:
     case ID_Q:
+    case ID_A:
     case ID_NOBR:
     case ID_WBR:
         // %inline *
-        return check_inline(childID, strict) ||
-               (!strict && check_block(childID, strict));
-    case ID_A:
-        // A: %inline * (but even strict sites expect %flow)
-        return check_flow(childID, strict);
+        return check_inline(childID, strict) || check_block(childID, strict);
     case ID_P:
         // P: %inline *
         return check_inline(childID, strict) ||
--- trunk/KDE/kdelibs/khtml/html/htmlparser.cpp #861053:861054
@@ -801,14 +801,6 @@
             insertNode(e);
             handled = true;
             break;
-        case ID_DL:
-            popBlock(ID_DL);
-            handled = true;
-            break;
-        case ID_DT:
-            popBlock(ID_DT);
-            handled = true;
-            break;
         case ID_FORM:
             popBlock(ID_FORM);
             handled = true;