Closed Bug 380062 Opened 17 years ago Closed 17 years ago

Uneven justification with new textframe when multiple text runs on one line

Categories

(Core :: Graphics, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: smontagu, Assigned: smontagu)

References

Details

Attachments

(3 files)

This is hard to describe in words, but I hope the attached screenshot will make it clear. When there is only one text run on a line, justification spaces are added evenly across the line, but when there is more than one (because of a font change or a change of direction in bidirectional text) all the justification spaces are added between text runs creating an uneven effect.
Attached file Testcase
This is caused by the condition 
  if (!(mFrame->GetStateBits() & TEXT_END_OF_LINE))
    return;
at the beginning of PropertyProvider::FindEndOfJustificationRange() http://mxr.mozilla.org/seamonkey/source/layout/generic/nsTextFrameThebes.cpp#2135

As it stands, that is clearly wrong, but I don't know if we want to just remove it or add some other condition to cover the case that is failing here (e.g. the first frame on the second and fourth lines in the screenshot). Roc, can you advise?
FindEndOfJustificationRange should return the end of the text when the frame is not at the end of the line. So that END_OF_LINE check should move below the call to SetOriginalOffset that's setting aIter to the end of the text.
Attached patch PatchSplinter Review
Yeah, that works.
Assignee: nobody → smontagu
Status: NEW → ASSIGNED
Attachment #264161 - Flags: superreview?(roc)
Attachment #264161 - Flags: review?(roc)
Attachment #264161 - Flags: superreview?(roc)
Attachment #264161 - Flags: superreview+
Attachment #264161 - Flags: review?(roc)
Attachment #264161 - Flags: review+
You seem to have checked this in ... thanks!
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
An idea for how to test this would be to do a not-equals test between:

- a single justified line of text with two different text runs, each
  containing whitespace
- the same two text runs, except floated left and floated right

If the floating is done correctly, I *think* this would produce the same rendering with the bug in effect but would not if the bug were not in effect.
Flags: in-testsuite?
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: