Closed Bug 872964 Opened 11 years ago Closed 11 years ago

wrong result for getTextBeforeOffset for start word boundary at text length offset

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: surkov, Assigned: surkov)

References

Details

(Keywords: access)

Attachments

(1 file)

Attached patch patchSplinter Review
follow up of bug 855732. Discussed in bug 860013. Described at http://asurkov.blogspot.ru/2013/04/atx-text-pitfalls.html
Attachment #750351 - Flags: review?(trev.saunders)
Comment on attachment 750351 [details] [diff] [review]
patch

>+      } else {
>+        *aStartOffset = FindWordBoundary(offset, eDirPrevious, eStartWord);
>+        *aEndOffset = FindWordBoundary(*aStartOffset, eDirNext, eStartWord);
>+        if (*aEndOffset != offset) {
>+          *aEndOffset = *aStartOffset;
>+          *aStartOffset = FindWordBoundary(*aEndOffset, eDirPrevious, eStartWord);

it might be faster to use a local var for the start offset so the compiler doesn't need to worry about aliasing, but I really doubt it matters.
Attachment #750351 - Flags: review?(trev.saunders) → review+
https://hg.mozilla.org/mozilla-central/rev/3a447f55a848
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: