Closed Bug 1569613 Opened 5 years ago Closed 5 years ago

Add surrogate pair handling API to nsTextFragment

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

Details

Attachments

(1 file)

We check surrogate pair at specific index in nsTextFragement in a lot of places. That requires range check of the index so that it can be security issue and crash reason with simple mistake, and also it steals your time to understand the code especially when it's a part of if condition.

We should add new API to nsTextFragment and makes the all ones which handle surrogate pairs in nsTextFragment use them.

I think that TSubstring should have same API for surrogate pairs, though.

We check surrogate pair at specific index in nsTextFragement in a lot of
places. This requires boundary check of the index so that it can cause
security issue and crash reason with simple mistake, and also it steals
your time to understand the code what it does especially when it's a
part of an if condition.

Therefore, this patch adds new API to nsTextFragment and makes the all
surrogate pair handlers of nsTextFragument use new API.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/636e6732c822
Add surrogate pair handling API to `nsTextFragment` r=hsivonen
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: