Closed Bug 399159 Opened 17 years ago Closed 17 years ago

left edge is not aligned when text-align: justify; in Japanese paragraph

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: masayuki, Assigned: masayuki)

References

()

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

Attached patch Patch rv1.0 (obsolete) — Splinter Review
See the URL. It is a Japanese text justification, but the left edges are not aligned to a line. This might be a regression of new textframe.

We should drop the characters at start of lines from justifiable character.
Flags: blocking1.9?
Attachment #284142 - Flags: superreview?(roc)
Attachment #284142 - Flags: review?(roc)
Attachment #284142 - Flags: approval1.9?
+  aIter->SetOriginalOffset(mStart.GetOriginalOffset());

You can just write *aIter = mStart.

+  // Ignore trailing cluster at end of line for justification purposes

This comment is wrong.

+  while (aIter->GetOriginalOffset() < mStart.GetOriginalOffset() + mLength-1) {

This could allow the start of the range to go past the end of the range. You probably should combine the two methods into FindJustificationRange and set up both iterators at the same time, and use the result of one iterator as the end-condition for the other.
Attached patch Patch rv2.0 (obsolete) — Splinter Review
Thanks.

But I found another bug. If there are two Japanese characters in a line, the both characters are aligned to left. (Both characters are not in justifiable range...) However, it's very minor case, we should ignore it now...
Attachment #284142 - Attachment is obsolete: true
Attachment #284189 - Flags: superreview?(roc)
Attachment #284189 - Flags: review?(roc)
Attachment #284189 - Flags: approval1.9?
Attachment #284142 - Flags: superreview?(roc)
Attachment #284142 - Flags: review?(roc)
Attachment #284142 - Flags: approval1.9?
+  *aStart = mStart;
+  *aEnd = mStart;

Don't do this. Just assume that aStart and aEnd are set up to point to the right sort of iterator, and call SetOriginalOffset on them to set the right offsets. Then document that aStart and aEnd should be "near" the start and end of the frame's text in the textrun. It's more efficient this way, and it's what FindEndOfJustificationRange already does.
Attached patch Patch rv2.1Splinter Review
Attachment #284189 - Attachment is obsolete: true
Attachment #284844 - Flags: superreview?(roc)
Attachment #284844 - Flags: review?(roc)
Attachment #284844 - Flags: approval1.9?
Attachment #284189 - Flags: superreview?(roc)
Attachment #284189 - Flags: review?(roc)
Attachment #284189 - Flags: approval1.9?
Attachment #284844 - Flags: superreview?(roc)
Attachment #284844 - Flags: superreview+
Attachment #284844 - Flags: review?(roc)
Attachment #284844 - Flags: review+
Attachment #284844 - Flags: approval1.9?
Attachment #284844 - Flags: approval1.9+
checked-in.

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
I backed this out because it was suspected of having caused the Tp regression that's been keeping the tree closed. See bug 400045 comment 9.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This could only affect pages that use text-align:justify a lot, and those very little. But it's worth a try I guess.
Numbers seem to show this was not the cause of any regression. We can reland this when the tree opens.
Masayuki, please reland this before Monday.
checked-in.
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: