intl needs support for counters

NEW
Assigned to

Status

()

Core
Internationalization
13 years ago
8 years ago

People

(Reporter: sicking, Assigned: smontagu)

Tracking

(Blocks: 2 bugs)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Right now the code for css counters is hardcoded into nsBulletFrame. This means
that it's impossible for XSLT to reuse the code. Instead it should be moved into
intl and generalized so that both css and xslt can use it, and so that we in the
future when more counter-types are added will automatically support them
No longer blocks: 284394
Blocks: 284394
What xslt needs is an interface that gives us some sort of counter-object given
1. A unichar ('a' for western counting, 0x30A2 for Katakana)
2. An nsILocale (or even more convinient, the locale as a string)
3. A bool or string specifying "traditional" or "alphabetic"

The specifics of how this should work is defined here:
http://www.w3.org/TR/xslt#convert
The thing is, the CSS model is very different from the XSLT model (for example,
the CSS model doesn't depend on the locale).  I'm not really sure there is a
decent way to have the two share code....

Comment 3

13 years ago
Some people wanted to make CSS3 list depend on 'lang' as well..... Anyway, it
'might' be possible to map some of CSS3 list styles to counters starting with a
certain Unicode character with lang='en-US' (or null). 
The code to figure out which countertype to use probably couldn't becuase they
use so different mechanisms to choose the counter; xslt is given a char like
0x30A2, css is given a token like 'katakana'.

But once we've figured out which countertype to use we could probably share the
code that does the actual number->string conversion.

Also, by having the code in intl i think we're more likly to get the right set
of eyes on this. I'm in most cases compleatly clueless on how this counting
stuff is supposed to work.
QA Contact: amyy → i18n
You need to log in before you can comment on or make changes to this bug.