Bug 56219

Summary: [test case] html4.css rules for RTL direction don't apply to CSS-specified direction
Product: [Applications] konqueror Reporter: Ilya Konstantinov <kde-bug-report>
Component: khtml rendererAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: test case

Description Ilya Konstantinov 2003-03-21 20:40:54 UTC
Version:            (using KDE KDE 3.1.1)
Installed from:    Debian testing/unstable Packages

html4.css specifies rules for handling elements differently when inside elements having RTL direction but, unfortunately, those rules only apply when the direction is set with the DIR attribute (and not apply with 'direction' CSS property).

*[dir="rtl"] UL, 
*[dir="rtl"] OL,  
*[dir="rtl"] DIR, 
*[dir="rtl"] MENU, 
*[dir="rtl"] DD { 
        margin-right:40px; 
        margin-left: auto;
}

would cause this:

<DIV DIR="RTL">
<OL>
<LI> This would be indented to the left.
</OL>
</DIV>

<DIV STYLE="direction:rtl">
<OL>
<LI> This wouldn't be indented to the left.
</OL>
</DIV>

After a chat with Ian Hixie (CSS guru from the Mozilla project), I've realized there are few options:
1. Add a :-konq-rtl pseudo-class. *INVALID* since you can't have a CSS selector sequence dependant on a CSS property (a chicken-and-egg thing; what selector gets parsed and applied first?).
2. Add custom property "-konq-margin-start" (since, unfortunatelly, "margin-start" wasn't accepted into CSS3) which defines the margin relative to the text start (direction-dependant). Along, we should also add "-konq-margin-end", "-konq-padding-start" and "-konq-padding-end", for completeness sake.
3. Define UL,OL,DIR,MENU,DD just as we define BLOCKQUOTE -- with margins on both sides in either case, i.e.:
UL,OL,DIR,MENU,DD
{
	margin-left:40px;
	margin-right:40px;
}

I think that, for now, we should stick to option #3.
Comment 1 Ilya Konstantinov 2003-03-21 21:06:50 UTC
For reference, you can see bug http://bugzilla.mozilla.org/show_bug.cgi?id=74880 
which discusses solution for the same problem in Mozilla. Note that they did consider 
the way we implemented it (via *[dir=RTL]) and rejected it. 
Comment 2 Stephan Kulow 2004-11-10 21:12:12 UTC
Created attachment 8241 [details]
test case
Comment 3 Stephan Kulow 2004-11-10 21:16:06 UTC
well, this will reduce the space a UL would take - just in case. I guess we need something more sophisticated than html4.css for that
Comment 4 Allan Sandfeld 2005-10-13 13:52:38 UTC
I solved this a few months ago in KDE 3.5 branch.