Open Bug 570378 Opened 10 years ago Updated 2 months ago

Add tests for numeric substitution (e.g. in Arabic) in text not in text frames

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set

Tracking

()

mozilla1.9.3a5

People

(Reporter: smontagu, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

It would be good to have tests for Arabic/Indic/Persian numeric substitution that test the RenderText and ProcessText code paths in nsBidiPresUtils.cpp. RenderText is used by XUL text, image ALT text, print headers and footers; and ProcessText is used by canvas text-drawing methods.
I think testing them in img alt tags is enough (don't know how to trigger print preview headers and footers in mochitests anyway!).

Note to self: the tests here need to land on 1.9.1 and 1.9.2 as well.
Attached patch Patch (v1)Splinter Review
This patch adds the exact same logic that we have in bidi.numeral tests for text inside textframes to image alt tests, which are not rendered using text frames.
Attachment #449507 - Flags: review?(roc)
There's a problem here... the tests are all passing for me locally, but when I check them manually I can see bugs. For example, with bidi.numeral=1 or 2, bug570378-arabic-2.html and bug570378-arabic-2-ref.html both display the numbers as 123, so the test passes, but they should both be displaying ١٢٣.

Is there any way that we can load the test pages with the specified value of bidi.numeral and reset bidi.numeral to 0 before loading the reference page (which of course would mean changing some of the "expected" results here and in the existing tests has well)? I think that that would make the tests more robust, because then the reference rendering wouldn't be affected by bugs in numeral substitution.
Oh, I pushed this without seeing comment 3...

http://hg.mozilla.org/mozilla-central/rev/0e1c7c4f51cd
Flags: in-testsuite+
Target Milestone: --- → mozilla1.9.3a5
(In reply to comment #3)
> There's a problem here... the tests are all passing for me locally, but when I
> check them manually I can see bugs. For example, with bidi.numeral=1 or 2,
> bug570378-arabic-2.html and bug570378-arabic-2-ref.html both display the
> numbers as 123, so the test passes, but they should both be displaying ١٢٣.

Hmm, maybe I'm missing something, but why do you think that should happen?

> Is there any way that we can load the test pages with the specified value of
> bidi.numeral and reset bidi.numeral to 0 before loading the reference page
> (which of course would mean changing some of the "expected" results here and in
> the existing tests has well)? I think that that would make the tests more
> robust, because then the reference rendering wouldn't be affected by bugs in
> numeral substitution.

That's a test strategy which I think might be worthwhile to experiment with.  It's kind of a pain though because I need to edit a few thousand test files! ;-)  I'll work on it in you file the bug.  :-)

Not marking this as FIXED pending your answer to my earlier question.
(In reply to comment #5)
> (In reply to comment #3)
> > with bidi.numeral=1 or 2,
> > bug570378-arabic-2.html and bug570378-arabic-2-ref.html both display the
> > numbers as 123, so the test passes, but they should both be displaying ١٢٣.
> 
> Hmm, maybe I'm missing something, but why do you think that should happen?

1 and 2 for bidi.numeral mean contextual numeric substitution, so the numerals after Arabic text should become Hindi numerals, no? It's also what happens with bug441782-2.html.
Blocks: 399850
Assignee: ehsan → nobody
You need to log in before you can comment on or make changes to this bug.