Closed Bug 382490 Opened 17 years ago Closed 17 years ago

BreakAndMeasureText trimming sometimes trims more characters than it should

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

References

Details

Attachments

(1 file)

Attached patch fixSplinter Review
The trimming code I added to BreakAndMeasureText has a bug. When BreakAndMeasureText runs out of space and backs up to the last break opportunity, we need to restore the trimming state (number of trimmable characters at the end of the string, and the width of those characters) to the values it had at the last break opportunity. Otherwise bad things happen; for example we can return a number of trimmable characters that's greater than the value we return for the number of characters that fit. Hilarity ensues. (I think this may fix the Washington Post crashes.)
Attachment #266651 - Flags: review?(pavlov)
Attachment #266651 - Attachment is patch: true
Attachment #266651 - Attachment mime type: application/text → text/plain
I've spent over 30 minutes browsing washingtonpost.com, dailylocal.com, 6abc.com, and some other sites that caused crashing for me and they're all behaving very nicely now with this patch applied.
Attachment #266651 - Flags: review?(pavlov) → review+
checked in
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: