If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

IAccessibleText::attributes provides incorrect info after a mis-spelled word

RESOLVED FIXED

Status

()

Core
Disability Access APIs
--
major
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Michael Curran, Assigned: surkov)

Tracking

(Blocks: 1 bug, {access})

Trunk
x86
Windows Vista
access
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

6.60 KB, patch
Details | Diff | Splinter Review
(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1a2pre) Gecko/20080819034536 Minefield/3.1a2pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1a2pre) Gecko/20080819034536 Minefield/3.1a2pre ID:20080819034536

IAccessibleText::attributes returns the attribute run representing a mis-spelled word, if you give it an offset which is the offset after that attribute run. i.e. its the endOffset of the attribute run.

Reproducible: Always

Steps to Reproduce:
1. In a new thunderbird message, type "This iss a test".
2. call IAccessibleText::attributes for that node of text giving it an offset of 0, to get the "This " attribute run.
3. Give it an offset of 5, to get the "iss " attribute run [the mis-spelling] 
4. Give it an offset of 8, the start of the final attribute run [after the mis-spelling].
5. Give it an offset of 9.
Actual Results:  
*Giving 0 gives back startOffset: 0, endOffset: 5, and the appropriate attributes.
*Giving 5 gives back startOffset: 5, endOffset:8, and the attributes for that run.
*Giving 8 gives back StartOffset: 5, endOffset: 8, and attributes for that run.
*Giving 9 gives back startOffset: 8, endOffset: 15, and the attributes for that run.

Expected Results:  
*Giving 8 should give back startOffset: 8, endOffset: 15.

It seems that this bug is only related to the attribute runs of mis-spellings. The tests I have done seem to show that other attribute runs for bold, italic etc, do not cause this problem. 
This issue is very important as it can cause any AT using IAccessibleText::attributes to possibly go in to an infinite loop as the relationship between the given offset, and the resulting start and end offsets is not correct.
(Reporter)

Updated

9 years ago
Keywords: access

Updated

9 years ago
Blocks: 345759
Version: unspecified → Trunk

Updated

9 years ago
Blocks: 340809
(Assignee)

Comment 1

9 years ago
What kind of intervals should we use [a, b) or [a, b]? Iirc, we talked with Marco and we bend to use closed intervals like [a,b]. But what do you thing?
Assignee: nobody → surkov.alexander
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

9 years ago
(In reply to comment #1)
> What kind of intervals should we use [a, b) or [a, b]? Iirc, we talked with
> Marco and we bend to use closed intervals like [a,b]. But what do you thing?
> 

by the way, ranges don't use closed intervals http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/ranges.html, possibly we should follow it too
(Assignee)

Comment 3

9 years ago
Created attachment 334851 [details] [diff] [review]
patch

nsIDOMNSRange::ComparePoint should return 1 (the point is after range) if the given node and offset are equal to end node and end offset of the range because end bound isn't included into range
Attachment #334851 - Flags: superreview?(neil)
Attachment #334851 - Flags: review?(Olli.Pettay)
(Assignee)

Updated

9 years ago
Attachment #334851 - Flags: review?(marco.zehe)

Updated

9 years ago
Attachment #334851 - Flags: superreview?(neil) → superreview+

Comment 4

9 years ago
Comment on attachment 334851 [details] [diff] [review]
patch

1.8 seems to have the same bug. Please write some mochitest to test range.comparePoint() and maybe also .isPointInRange(). If you do that, r=me :)
Attachment #334851 - Flags: review?(Olli.Pettay) → review+

Comment 5

9 years ago
Comment on attachment 334851 [details] [diff] [review]
patch

r=me for the test part. Thanks!
Attachment #334851 - Flags: review?(marco.zehe) → review+
(Assignee)

Comment 6

9 years ago
Created attachment 334870 [details] [diff] [review]
patch2

+ content mochitest
Attachment #334851 - Attachment is obsolete: true
(Assignee)

Updated

9 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 7

9 years ago
http://hg.mozilla.org/mozilla-central/index.cgi/rev/3b707bbddf47
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

9 years ago
Depends on: 460156
You need to log in before you can comment on or make changes to this bug.