Closed Bug 1428774 Opened 8 years ago Closed 8 years ago

nsBidiUtils::HasRTLChars() does unnecessary surrogate handling

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

Attachments

(1 file)

The supplementary RTL ranges have the property that it's sufficient to examine the high surrogate to determine if an astral character is RTL. Once 1428771 is fixed, nsBidiUtils::HasRTLChars() should, therefore, use loop by code unit and check each code unit using UCS2_CHAR_IS_BIDI instead of checking for surrogate pairs. Downside: Certain unpaired high surrogates will be classified as RTL. This should not be a practical problem.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Aside: I intend to SIMD-accelerate this in Rust as part of bug 1402247.
Summary: nsBidiUtils::HasRTLChars() does useless surrogate handling → nsBidiUtils::HasRTLChars() does unnecessary surrogate handling
Blocks: 1431025
Comment on attachment 8940990 [details] Bug 1428774 - Avoid surrogate math in HasRTLChars(). https://reviewboard.mozilla.org/r/211268/#review220458 Seems OK -- the potential change in behavior for certain unpaired surrogates might seem a bit fishy, but I can't think of any reason it actually matters here.
Attachment #8940990 - Flags: review?(jfkthame) → review+
Depends on: 1432728
Pushed by hsivonen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1e903401fe83 Avoid surrogate math in HasRTLChars(). r=jfkthame
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: