Bug 42906 - [test case] <div align=center><pre> not centered (http://www.chessbase.com)
Summary: [test case] <div align=center><pre> not centered (http://www.chessbase.com)
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: 3.0.5
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 84704 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-21 21:48 UTC by Eyal Bd
Modified: 2005-07-11 15:27 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
testcase (229 bytes, text/html)
2002-10-06 19:50 UTC, Georg Robbers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Bd 2002-05-21 21:45:58 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           khtml
Version:           3.0.5 (CVS >= 20020327) (using KDE 3.0.5 (CVS HEAD >= 20020427))
Severity:          normal
Installed from:    compiled sources
Compiler:          gcc version 3.1 (Mandrake Linux 8.3 3.1-0.11mdk)
OS:                Linux (i686) release 2.4.18aa1
OS/Compiler notes: 

See for example the page:
http://www.chessbase.com/puzzle/tactics/tac0521.htm

My configuration:
Compiled source code with gcc 3.1
enabled objprelink.

The text is shifted too much to the right
It should be under the diagram.

Thanks
Eyal

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 John Firebaugh 2002-09-22 03:32:36 UTC
Rather the diagram should also be centered.  
Comment 2 Georg Robbers 2002-10-06 19:50:15 UTC
Created attachment 156 [details]
testcase

problem is this:

<DIV ALIGN="center">
  <PRE>centered or not centered?</PRE>
</DIV>

Mozilla puts it in the center, Konqi does not.
Comment 3 Eyal Bd 2003-10-31 23:19:20 UTC
Testcase still fail and diagrams are still not centered.
(I have kde 3.1.3 from Mandrake 9.2)
Comment 4 Stephan Kulow 2003-11-01 11:57:33 UTC
IE centers too.
Comment 5 Mathieu Jobin 2004-02-03 01:16:27 UTC
still valid in KDE 3.2 rc1
Comment 6 Stephan Kulow 2004-10-20 10:40:13 UTC
*** Bug 84704 has been marked as a duplicate of this bug. ***
Comment 7 Allan Sandfeld 2005-02-21 23:18:20 UTC
Actually the DIV _is_ centered. It is just the PRE-block that takes up an entire line.. I wonder why
Comment 8 Maksim Orlovich 2005-07-10 03:41:17 UTC
Probably the text-align: khtml-auto thing for pre in html4.css
Allan?
Comment 9 Allan Sandfeld 2005-07-11 13:13:30 UTC
Seems like it. 

Removing it fixes the bug.  I guess we need a better way to do the same
Comment 10 Allan Sandfeld 2005-07-11 15:27:03 UTC
SVN commit 433700 by carewolf:

PRE should not start its own alignment, and TH should only CENTER if not inheriting.
BUG: 79498
BUG: 42906


 M  +4 -0      cssstyleselector.cpp  
 M  +0 -2      html4.css  


--- trunk/KDE/kdelibs/khtml/css/cssstyleselector.cpp #433699:433700
@@ -564,6 +564,10 @@
 //                 style->setDisplay(style->isDisplayInlineType() ? INLINE_TABLE : TABLE);
         }
 
+        // Table headers with a text-align of auto will change the text-align to center.
+        if (e && e->id() == ID_TH && style->textAlign() == TAAUTO)
+            style->setTextAlign(CENTER);
+
         // Mutate the display to BLOCK or TABLE for certain cases, e.g., if someone attempts to
         // position or float an inline, compact, or run-in.  Cache the original display, since it
         // may be needed for positioned elements that have to compute their static normal flow
--- trunk/KDE/kdelibs/khtml/css/html4.css #433699:433700
@@ -220,7 +220,6 @@
 
 TH {
 	font-weight: bolder;
-	text-align: center;
 }
 
 CAPTION {
@@ -454,7 +453,6 @@
 	display: block;
 	font-family: monospace;
 	white-space: pre;
-	text-align: -khtml-auto;
 	margin: 1__qem 0;
 }