Bug 56219 - [test case] html4.css rules for RTL direction don't apply to CSS-specified direction
Summary: [test case] html4.css rules for RTL direction don't apply to CSS-specified di...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-21 20:40 UTC by Ilya Konstantinov
Modified: 2005-10-13 13:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
test case (183 bytes, text/html)
2004-11-10 21:12 UTC, Stephan Kulow
Details

Note You need to log in before you can comment on or make changes to this bug.
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.