Closed
Bug 255405
Opened 21 years ago
Closed 21 years ago
BinarySearchForPosition can generate invalid unicode for text measurement
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: blizzard, Assigned: blizzard)
References
()
Details
Attachments
(1 file)
1.44 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
BinarySearchForPosition breaks strings into halves for text measurement
purposes, but doesn't take into account UTF-16 surrogates when doing so. So
from time to time if you're selecting through a string that's built from
surrogates, it dumps an unpaired surrogate down to the font layer. Bad
behaviour, which prevents selection from working properly.
If you have the CODE2000 fonts from the url above and you try to select some of
the strings above, it will crash a pango-enabled browser and probably cause pain
on others. Patch coming up.
Assignee | ||
Comment 1•21 years ago
|
||
This patch makes sure that you never pass down an unpaired high surrogate and
also terminates the binary search in the case where the remainder is a
surrogate pair. Also, the measurement of the final character can be a
surrogate pair as well.
Assignee | ||
Updated•21 years ago
|
Attachment #155950 -
Flags: superreview?(roc)
Attachment #155950 -
Flags: review?(roc)
Attachment #155950 -
Flags: superreview?(roc)
Attachment #155950 -
Flags: superreview+
Attachment #155950 -
Flags: review?(roc)
Attachment #155950 -
Flags: review+
Assignee | ||
Comment 2•21 years ago
|
||
Checked into the trunk.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•