Bug 182164 - Poor rendering in http://www.linuxtoday.com
Summary: Poor rendering in http://www.linuxtoday.com
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.6.5
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords: triaged
: 182259 182598 182661 183157 183501 183931 225247 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-28 14:35 UTC by Allen Winter
Modified: 2019-07-30 21:06 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
My proposed patch (2.34 KB, patch)
2009-04-11 14:28 UTC, Allan Sandfeld
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Allen Winter 2009-01-28 14:35:03 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Some pages on linuxtoday.com render very poorly.
For example:
http://www.linuxtoday.com/news_story.php3?ltsn=2009-01-27-015-35-IN-KE

Maksim and I were working on this today and he boiled the problem down to an extra "</li>" in their html. The following snippet is what Maskim reduced the problem to:

<ul>
    <li>
        <a href="http://www.internet.com/it/">IT</a>
        <ul id="listMenu-id-1">
          <li><a href="http://www.internet.com/it">internet.com/IT</a></li>
          <li><a href="http://www.voipplanet.com/">VoIP Planet</a></li></li> <!-- extra /li closes the ul, too -->
          <li><a href="http://www.wi-fiplanet.com/">Wi-Fi Planet</a></li>
          <li><a href="http://www.windrivers.com/">WinDrivers.com</a></li>
          <li><a href="http://www.internet.com/sections/">Network Map</a></li><ul>
    <li>
        <a href="http://www.internet.com/it/">IT</a>
        <ul id="listMenu-id-1">
          <li><a href="http://www.internet.com/it">internet.com/IT</a></li>
          <li><a href="http://www.voipplanet.com/">VoIP Planet</a></li></li> <!-- extra /li closes the ul, too -->
          <li><a href="http://www.wi-fiplanet.com/">Wi-Fi Planet</a></li>
          <li><a href="http://www.windrivers.com/">WinDrivers.com</a></li>
          <li><a href="http://www.internet.com/sections/">Network Map</a></li>
       </ul>
    </li>
</ul>
       </ul>
    </li>
</ul>
Comment 1 Allen Winter 2009-01-28 14:36:33 UTC
sorry. I pasted Maskim's analysis twice.  should simply be:

<ul>
    <li>
        <a href="http://www.internet.com/it/">IT</a>
        <ul id="listMenu-id-1">
          <li><a href="http://www.internet.com/it">internet.com/IT</a></li>
          <li><a href="http://www.voipplanet.com/">VoIP Planet</a></li></li> <!-- extra /li closes the ul, too -->
          <li><a href="http://www.wi-fiplanet.com/">Wi-Fi Planet</a></li>
          <li><a href="http://www.windrivers.com/">WinDrivers.com</a></li>
          <li><a href="http://www.internet.com/sections/">Network Map</a></li>
       </ul>
    </li>
</ul>
Comment 2 Maksim Orlovich 2009-01-28 16:21:11 UTC
Allan, this was regressed by your html5-style parsing commit (http://lists.kde.org/?l=kde-commits&m=119227301919656&w=2), which made 
LI and OL/UL have the same priority, meaning the popBlock for the extra </li>
will pop right through the ol; e.g. the following makes it work:

--- html/dtd.cpp        (revision 913050)
+++ html/dtd.cpp        (working copy)
@@ -105,7 +105,7 @@
     1, // ID_LABEL
     1, // ID_LAYER
     1, // ID_LEGEND
-    5, // ID_LI
+    4, // ID_LI
     0, // ID_LINK
     5, // ID_LISTING
     1, // ID_MAP

...Thoughts?
Comment 3 Maksim Orlovich 2009-01-29 07:45:31 UTC
*** Bug 182259 has been marked as a duplicate of this bug. ***
Comment 4 Tommi Tervo 2009-01-31 16:25:46 UTC
*** Bug 182598 has been marked as a duplicate of this bug. ***
Comment 5 Maksim Orlovich 2009-02-01 03:50:58 UTC
*** Bug 182661 has been marked as a duplicate of this bug. ***
Comment 6 Allan Sandfeld 2009-02-01 20:39:29 UTC
The proposed change is going to regress various cases where </li> needs to close other block elements such as <div> etc.
Comment 7 Allan Sandfeld 2009-02-01 21:33:48 UTC
It seems what iceweasel's htmlparser does is that is forbids <LI> from containing <UL> and <OL> elements (they autoclose unclosed <li>).

Secondly where we check levels to see if a close tag is allowed to close unclosed elements, they use the equivalent of "checkChild" in dtd.cpp. 

If we forbid LI from containing OL and UL, and replace the level-comparison with checkChild, we should match Gecko parsing. Though the current parsing HTML5, and Gecko is not.
Comment 8 Maksim Orlovich 2009-02-04 19:34:13 UTC
Any chance you could do that? It's quite a bit beyond my familiarity/comfort level with the parser.
Comment 9 Tommi Tervo 2009-02-07 11:14:07 UTC
*** Bug 183501 has been marked as a duplicate of this bug. ***
Comment 10 Germain Garand 2009-02-10 15:36:40 UTC
*** Bug 183157 has been marked as a duplicate of this bug. ***
Comment 11 A. Spehr 2009-02-10 20:00:55 UTC
*** Bug 183931 has been marked as a duplicate of this bug. ***
Comment 12 A. Spehr 2009-02-10 20:02:27 UTC
Bug report #183931 says that the webkit kpart doesn't have this problem. And gives a picture.
Comment 13 Allan Sandfeld 2009-04-11 14:28:57 UTC
Created attachment 32759 [details]
My proposed patch

Here is a patch that should fix the problem. 
I has not been regression-tested or compared with other browsers.
It adds a similar quirk to <DL> vs </DD> and </dt> which may be wrong, and should be compared with other browsers.
Comment 14 Allen Winter 2009-04-11 16:53:47 UTC
I'll apply it locally and see how it goes.
thanks carewolf!
Comment 15 Allen Winter 2009-04-23 00:54:44 UTC
I've been using carewolf's patch for 10 days now and I haven't noticed any problems. seems to help.

I think it should be committed.
Comment 16 Maksim Orlovich 2009-04-29 17:42:25 UTC
parser/list_dt.html seems the only regression test affected by this change.
Comment 17 Andrea Iacovitti 2011-07-23 21:36:29 UTC
Allan's patch in comment #13 fixes bugs #225247 and #186495 too.
Are they duplicates of this?
Comment 18 Andrea Iacovitti 2011-11-18 15:37:40 UTC
*** Bug 225247 has been marked as a duplicate of this bug. ***
Comment 19 Allen Winter 2019-07-30 21:06:45 UTC
this is ancient .  too ancient.  closing