Open Bug 984005 Opened 10 years ago Updated 2 years ago

Ordered lists and CSS counters should use language-dependent digits

Categories

(Core :: Layout, enhancement)

30 Branch
enhancement

Tracking

()

People

(Reporter: ebrahim, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140313040202

Steps to reproduce:

Ordered list:
data:text/html;charset=utf8,<div lang="fa"><ol><li>%DB%B1</li><li>%DB%B2</li></ol><ol style="list-style-type: -moz-persian; list-style-type: persian;"><li>%DB%B1</li><li>%DB%B2</li></ol></div>

CSS Counters:
data:text/html;charset=utf8,<style>#a, #b { counter-reset: section; } #a h2:before { counter-increment: section; content: counter(section); } #b h2:before { counter-increment: section;content: counter(section); content: counter(section, -moz-persian); content: counter(section, persian); }</style><div lang="fa"><div id="a"><h2></h2><h2></h2></div><div id="b"><h2></h2><h2></h2></div></div>
(if this will show nothing, first open it on Chrome, save it as a HTML file then open it on Firefox)



Expected results:

Both part of both testcase should be same IMO.

lang="fa" on <ol> or when CSS counter is used should use Persian digits, just like the thing done for <input type="number"> on Bug 844744.

I put the current workaround on below of every test but almost all web developers just don't know about them and will not use them ever, why not just doing the same thing that is done for input type="number" here also?

It may needs filing bug on W3 to define language independent digit type and using it on useragent stylesheet as default state of CSS counter and list-style-type or may not and or is a won'tfix bug.
Component: Untriaged → Localization
Product: Firefox → Core
(In reply to ebrahim from comment #0)
> CSS Counters:
> data:text/html;charset=utf8,<style>#a, #b { counter-reset: section; } #a
> h2:before { counter-increment: section; content: counter(section); } #b
> h2:before { counter-increment: section;content: counter(section); content:
> counter(section, -moz-persian); content: counter(section, persian);
> }</style><div lang="fa"><div id="a"><h2></h2><h2></h2></div><div
> id="b"><h2></h2><h2></h2></div></div>
> (if this will show nothing, first open it on Chrome, save it as a HTML file
> then open it on Firefox)

Hashes need to be escaped in data: URLs:

data:text/html;charset=utf8,<style>%23a, %23b { counter-reset: section; } %23a h2:before { counter-increment: section; content: counter(section); } %23b h2:before { counter-increment: section;content: counter(section); content: counter(section, -moz-persian); content: counter(section, persian); }</style><div lang="fa"><div id="a"><h2></h2><h2></h2></div><div id="b"><h2></h2><h2></h2></div></div>
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Component: Localization → Layout
Ever confirmed: true
OS: Windows 8.1 → All
Hardware: x86_64 → All
(In reply to ebrahim from comment #0)
> It may needs filing bug on W3 to define language independent digit type and
> using it on useragent stylesheet as default state of CSS counter and
> list-style-type

Yes, I think this is the direction to go, rather than implementing it in the browser without any basis in the specs. Maybe suggest it on www-style?

Mapping from language codes to digit types isn't going to be trivial, either ;-)
(In reply to Simon Montagu :smontagu from comment #2)
> Maybe suggest it on www-style?
I don't know anything about w3 processes, would you please make it?

> Mapping from language codes to digit types isn't going to be trivial, either
> ;-)
Isn't possible to just assign that mapping also to ICU?

I know some language just do not prefer use localized digits (for example on Arabic Wikipedia, they disabled Eastern Arabic digits just on Arabic Wikipedia, that is may perhaps because most and not all of ar-* locales prefer to not using it) but as if Bug 844744 took cared of that well, IMO here is also possible to use ICU to take care of locales prefers.
The summary of this bug makes me think you're talking about using the locale of the user rather than the language of the Web page; maybe "language-dependent digits" would be better here?  Or maybe my terminology is wrong?  (Making Web page handling depend on the locale of the user is bad for worldwide interoperability of Web content; we try to avoid adding more such cases.)
I meant document language dependent digits.

May #3 is a bit misleading, forget about it, I just wanted to say it should be configurable like current state of CSS lists and counters but also by default dependent to document language.
Summary: Ordered list and CSS counter should use localized digits → Ordered lists and CSS counters should use language-dependent digits
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.