Bug 44092 - CSS: line rendering bug in KHTML (border/padding, nesting)
Summary: CSS: line rendering bug in KHTML (border/padding, nesting)
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: 4.0
Platform: unspecified Other
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 73090 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-19 07:33 UTC by Vadim Plessky
Modified: 2004-02-11 22:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to fix the width (634 bytes, patch)
2003-11-14 21:17 UTC, James Ots
Details
A better patch (2.15 KB, patch)
2003-11-26 13:41 UTC, James Ots
Details
Testcase for nesting (649 bytes, text/html)
2003-11-26 13:50 UTC, James Ots
Details
Testcase for nesting (650 bytes, text/html)
2003-11-26 13:52 UTC, James Ots
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Plessky 2002-06-19 07:20:57 UTC
(*** This bug was imported into bugs.kde.org ***)

Package: khtml
Version: 4.0 (using KDE 3.0.1)
Severity: normal

Trescase extracted (and slightly enhanced) from WWW-Style mailing list.
In my opinion Konqueror's rendering is wrong
It doesn't nest <b> and <em> tags (Mozilla respects nesting) plus 
border/padding rendering is wrong.

<html>
  <head>
    <style type="text/css">
    p { line-height: 100px; }

     b {
        padding: 2px;
        margin: 8px;
        border-width: 6px;
        border-style: solid;
 line-height: 100px;
 }
      em {
        padding: 2px;
        margin: 8px;
        border-width: 6px;
        border-style: dashed;
border-color: navy;
 line-height: 40px;
      }
    </style>
  </head>
  <body>
    <p>Several Several <b> Several Several <em>emphasized
words</em></b> appear here appear here.</p>
  </body>
</html>

----------  Forwarded Message  ----------

Subject: which is correct IE or Opera?
Date: Sat 15 Jun 2002 00:19:49 -0700
From: "Sigurd Lerstad" <sigler@bredband.no>
To: <www-style@w3.org>

Hello

Can someone try this code in IE and Opera and tell me which is correct?

thanks

--
Sigurd Lerstad

<html>
  <head>
    <style type="text/css">
     b {
        padding: 2px;
        margin: 8px;
        border-width: 6px;
        border-style: solid;
 line-height: 100px;
 }
      em {
        padding: 2px;
        margin: 8px;
        border-width: 6px;
        border-style: dashed;
 line-height: 40px;
      }
    </style>
  </head>
  <body>
    <p>Several Several <b> Several <b> Several <em>emphasized
words</em></b></b> appear here appear here.</p>
  </body>
</html>

-------------------------------------------------------

-- 

Vadim Plessky
http://kde2.newmail.ru  (English)
33 Window Decorations and 6 Widget Styles for KDE
http://kde2.newmail.ru/kde_themes.html
KDE mini-Themes
http://kde2.newmail.ru/themes/
Comment 1 Vadim Plessky 2002-06-19 21:32:02 UTC
On Wednesday 19 June 2002 11:20 am Vadim Plessky wrote:
|  Package: khtml
|  Version: 4.0 (using KDE 3.0.1)
|  Severity: normal
|
|  Trescase extracted (and slightly enhanced) from WWW-Style mailing list.
|  In my opinion Konqueror's rendering is wrong
|  It doesn't nest <b> and <em> tags (Mozilla respects nesting) plus
|  border/padding rendering is wrong.
|

Here is updated testcase which demonstrates wrong Konqueror rendering.
I increased padding for inline (SPAN) elements to make example more visible.
Mozilla renders example correctly.

--------------------------------------------------------------------
<html>
  <head>
    <style type="text/css">
    p { line-height: 100px; }

     .aa {
        padding: 20px;
        margin: 8px;
        border-width: 6px;
        border-style: solid;
 line-height: 100px;
 }
      .bb {
        padding: 10px;
        margin: 8px;
        border-width: 6px;
        border-style: dashed;
border-color: navy;
 line-height: 40px;
      }
    </style>
  </head>
  <body>
    <p>Text inside first P tag <span class="aa"> class aa applied <span 
class="bb">class bb </span>
    </span> test outside SPAN aa and SPAN bb inside P tag</p>
  </body>
</html>
--------------------------------------------------------------------

-- 

Vadim Plessky
http://kde2.newmail.ru  (English)
33 Window Decorations and 6 Widget Styles for KDE
http://kde2.newmail.ru/kde_themes.html
KDE mini-Themes
http://kde2.newmail.ru/themes/
Comment 2 Stephan Kulow 2003-10-24 21:00:53 UTC
ugly one
Comment 3 Jesse 2003-11-03 23:05:01 UTC
Happens with the CIA bot statistics page too. Was about to file a bug for it and the dup catcher caught me :)

The problem on http://navi.picogui.org/cgi-bin/cia_stats.cgi is exactly the same as above.

What's worse ... I swear Konq rendered the stats page correctly sometime in the September timeframe and before that :( ... I had thought it was the problem with 'strong' tags but now that that's fixed (??) ...
Comment 4 James Ots 2003-11-07 01:44:02 UTC
Here's another example of, I think, the same error. Also note that the spans containing anchors don't seem to get the style.

----------------------------------

<html>
<head>
<title>Style Test</title>
<style type="text/css">
.item {
	border-style:solid;
	border-width:15px;
	border-color:#C2CCDF;
	
	padding:15px;
}
</style>
</head>
<body>
<span class="item">000000000000000</span>
<span class="item">111111111111111</span>
<span class="item"><a href="2.php">222222222222222</a></span>
<span class="item"><a href="3.php">333333333333333</a></span>
</body>
</html>
Comment 5 James Ots 2003-11-14 21:17:34 UTC
Created attachment 3230 [details]
Patch to fix the width

This patch fixes the width, but doesn't fix the problem with embedding anchors
in spans.

It is probably the wrong place to fix the bug, since a few lines earlier
there's a comment saying m_maxWidth contains the padding and borders, but it
works for me, and I'm pretty pleased because I've never hacked KDE before!
Comment 6 James Ots 2003-11-26 13:41:33 UTC
Created attachment 3415 [details]
A better patch

This is an improved patch for the padding problem. Still doesn't touch the
nesting problem.
Comment 7 James Ots 2003-11-26 13:50:31 UTC
Created attachment 3416 [details]
Testcase for nesting

Here's a testcase demonstrating the nested tags which still don't work. Note
how the anchors are displaying different behaviour from the spans.
Comment 8 James Ots 2003-11-26 13:52:18 UTC
Created attachment 3417 [details]
Testcase for nesting

Sorry about the bugspam, but I should have kept the style the same in the
testcase.
Comment 9 Kai Lahmann 2004-01-21 16:09:40 UTC
*** Bug 73090 has been marked as a duplicate of this bug. ***
Comment 10 James Ots 2004-01-21 16:13:05 UTC
Comment on attachment 3415 [details]
A better patch

The padding has been fixed in bug 68394 (or very nearly fixed). And my patch
was all wrong anyway.
Comment 11 Germain Garand 2004-02-11 14:43:53 UTC
CVS commit by ggarand: 

Activate/merge alternate code path for inline boxes
 construction and painting. 
Whitespace count consistency (justification).

CCMAIL: 44092-done@bugs.kde.org,51163-done@bugs.kde.org
CCMAIL: 73965-done@bugs.kde.org,73823-done@bugs.kde.org,62283-done@bugs.kde.org


  M +29 -0     ChangeLog   1.203
  M +168 -194  rendering/bidi.cpp   1.180
  M +6 -6      rendering/font.cpp   1.25
  M +1 -1      rendering/render_block.h   1.14
  M +28 -5     rendering/render_box.cpp   1.226
  M +2 -2      rendering/render_box.h   1.73
  M +32 -11    rendering/render_line.cpp   1.12
  M +12 -8     rendering/render_object.cpp   1.249
  M +7 -2      rendering/render_object.h   1.177
  M +3 -3      rendering/render_replaced.cpp   1.160
  M +2 -2      rendering/render_replaced.h   1.70
  M +5 -5      rendering/render_table.h   1.101
  M +22 -127   rendering/render_text.cpp   1.237
  M +7 -6      rendering/render_text.h   1.105



Comment 12 James Ots 2004-02-11 22:59:36 UTC
Hooray! Now konqueror is the best browser in the world!