The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla24

Status

()

Core
Disability Access APIs
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: surkov, Assigned: surkov)

Tracking

({access})

unspecified
mozilla24
access
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Created attachment 750351 [details] [diff] [review]
patch

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+
(Assignee)

Comment 2

4 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/3a447f55a848
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/3a447f55a848
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.