Bug 112073

Summary: Text alignment is wrong in http://www.juniper.net/customers/support/
Product: [Applications] konqueror Reporter: Hasso Tepper <hasso>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Minimal testcase

Description Hasso Tepper 2005-09-05 13:19:59 UTC
Version:           3.4.90 (using KDE 3.4.90 (alpha1, >= 20050806), compiled sources)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.13-rc6-git9-rt9

http://www.juniper.net/customers/support/ right column, Login box. Alignment of text "User ID (ex. bob@abc.net)" is wrong.
Comment 1 Hasso Tepper 2005-12-07 18:57:03 UTC
Created attachment 13812 [details]
Minimal testcase

Note, that problem appears with label only, if label tags are removed, it's
rendered correctly.
Comment 2 Germain Garand 2007-01-28 21:06:39 UTC
SVN commit 627993 by ggarand:

only allow spilling of line boxes if it's consistent with current 
directionality.
(cherry picked in Webcore's r7692 from David Hyatt <hyatt@apple.com>)

BUG: 112073



 M  +4 -1      bidi.cpp  


--- trunk/KDE/kdelibs/khtml/rendering/bidi.cpp #627992:627993
@@ -729,6 +729,8 @@
     switch(style()->textAlign()) {
         case LEFT:
         case KHTML_LEFT:
+            if (style()->direction() == RTL && totWidth > availableWidth)
+                x -= (totWidth - availableWidth);
             numSpaces = 0;
             break;
         case JUSTIFY:
@@ -742,7 +744,8 @@
                 break;
         case RIGHT:
         case KHTML_RIGHT:
-            x += availableWidth - totWidth;
+            if (style()->direction() == RTL || totWidth < availableWidth)
+                x += availableWidth - totWidth;
             numSpaces = 0;
             break;
         case CENTER:
Comment 3 Hasso Tepper 2007-04-12 08:32:57 UTC
Any chance to get it backported into branch as well?