Bug 103039 - [site-issue] does not render site correctly http://www.di.se/Avdelningar/Ettan.aspx
Summary: [site-issue] does not render site correctly http://www.di.se/Avdelningar/Etta...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-02 00:15 UTC by kek had
Modified: 2007-01-07 08:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
testcase (208 bytes, text/html)
2007-01-07 07:54 UTC, Germain Garand
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kek had 2005-04-02 00:15:58 UTC
Version:           3.4.0 (using KDE 3.4.0, Gentoo)
Compiler:          gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)
OS:                Linux (i686) release 2.6.10-gentoo-r6

The texts lines next to pictures are seperated too much from each other.

If there are no pictures the alignment looks allright.
Comment 1 Thiago Macieira 2005-04-03 18:18:11 UTC
I can see it.
Comment 2 Philip Rodrigues 2006-09-02 13:18:52 UTC
Same with SVN r575787
Comment 3 Germain Garand 2007-01-07 07:54:32 UTC
Created attachment 19150 [details]
testcase
Comment 4 Germain Garand 2007-01-07 08:05:42 UTC
SVN commit 620738 by ggarand:

Make vertical-align text-top/bottom more CSS 2.1 compliant: we are 
looking for the parent's font or font strut's *content area* 
(as per 10.6.1) so do not use its baselinePosition.

Add the missing half-leading for both text-top and text-bottom
(mozilla/css_1/vertical_align_texttop.html): that's also part of
content area.

Using baselinePosition on parent was even more bogus because of the
major semantic differences in CSS between baseline in table
context and other baselines. A mess that was the origin of #103039

BUG: 103039



 M  +2 -10     render_object.cpp  


--- trunk/KDE/kdelibs/khtml/rendering/render_object.cpp #620737:620738
@@ -1864,27 +1864,19 @@
                 return vpos - style()->verticalAlignLength().width( lineHeight( firstLine ) );
 
             const QFont &f = ref->font( firstLine );
-            int fontheight = ref->lineHeight( firstLine );
             int fontsize = f.pixelSize();
-            int halfleading = ( fontheight - fontsize ) / 2;
 
             if ( va == SUB )
                 vpos += fontsize/5 + 1;
             else if ( va == SUPER )
                 vpos -= fontsize/3 + 1;
             else if ( va == TEXT_TOP ) {
-//                 qDebug( "got TEXT_TOP vertical pos hint" );
-//                 qDebug( "parent:" );
-//                 qDebug( "CSSLH: %d, CSS_FS: %d, basepos: %d", fontheight, fontsize, ref->baselinePosition( firstLine ) );
-//                 qDebug( "this:" );
-//                 qDebug( "CSSLH: %d, CSS_FS: %d, basepos: %d", lineHeight( firstLine ), style()->font().pixelSize(), baselinePosition( firstLine ) );
-                vpos += ( baselinePosition( firstLine ) - ref->baselinePosition( firstLine ) +
-                        halfleading );
+                vpos += baselinePosition( firstLine ) - (QFontMetrics(f).ascent() + QFontMetrics(f).leading()/2);
             } else if ( va == MIDDLE ) {
                 QRect b = QFontMetrics(f).boundingRect('x');
                 vpos += -b.height()/2 - lineHeight( firstLine )/2 + baselinePosition( firstLine );
             } else if ( va == TEXT_BOTTOM ) {
-                vpos += QFontMetrics(f).descent();
+                vpos += QFontMetrics(f).descent() + QFontMetrics(f).leading()/2;
                 if ( !isReplaced() )
                     vpos -= fontMetrics(firstLine).descent();
             } else if ( va == BASELINE_MIDDLE )