Closed Bug 679220 Opened 9 years ago Closed 6 years ago

Numerical input types should be able to accept Arabic, Persian, and other non-ASCII digits

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

VERIFIED FIXED
mozilla29

People

(Reporter: ehsan, Assigned: jwatt)

References

(Blocks 1 open bug)

Details

See http://www.w3.org/Bugs/Public/show_bug.cgi?id=12915.

We basically need to include the Arabic and Persian digit ranges in the regular expression that we use to see if we should accept those characters, and also make sure that we can parse them for the purpose of internal storage (and form submission).

Mounir, can you please point me to where that regex lives?
OS: Mac OS X → All
Hardware: x86 → All
Blocks: 344616
(In reply to Ehsan Akhgari [:ehsan] from comment #0)
> Mounir, can you please point me to where that regex lives?

There is no code doing that for the moment (if you speak of <input type='number'>).
(In reply to Mounir Lamouri (:volkmar) (:mounir) from comment #1)
> (In reply to Ehsan Akhgari [:ehsan] from comment #0)
> > Mounir, can you please point me to where that regex lives?
> 
> There is no code doing that for the moment (if you speak of <input
> type='number'>).

So, how does <input type=number> work right now?
(In reply to Ehsan Akhgari [:ehsan] from comment #2)
> (In reply to Mounir Lamouri (:volkmar) (:mounir) from comment #1)
> > (In reply to Ehsan Akhgari [:ehsan] from comment #0)
> > > Mounir, can you please point me to where that regex lives?
> > 
> > There is no code doing that for the moment (if you speak of <input
> > type='number'>).
> 
> So, how does <input type=number> work right now?

It's not in the tree... and the WIP implementation I have doesn't handle that but it doesn't handle a lot of other stuff too.
I think we should include as "digits" any codepoints with the Unicode General Category of Decimal_Number (Nd). For the record, there are currently 42 x 10 of these, listed in the last section of http://unicode.org/Public/UNIDATA/extracted/DerivedNumericType.txt.
Summary: Numerical input types should be able to accept Arabic and Persian digits → Numerical input types should be able to accept Arabic, Persian, and other non-ASCII digits
I'm planning on using icu::DecimalFormater for this, but it seems that isn't possible from libxul just yet. I'll need bug 915735 to be fixed first, and that may take some time.
Depends on: 915735
Depends on: 949074
Depends on: 844744
Blocks: number-input
No longer depends on: 949074
Fixed by bug 844744.
Assignee: nobody → jwatt
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Marking as verified by:
- verifying bug 844744 is fixed on Aurora 29.0a2 under Win 7 64-bit, Ubuntu 32-bit and MAC OS X 10.9
- checking en-US, European, Persian and Arabic builds  

data:text/html,<input type=number lang=ar step=any>
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.