Closed Bug 356369 Opened 18 years ago Closed 18 years ago

GetTextAtOffset gets wrong characters amount

Categories

(Core :: Disability Access APIs, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 348901

People

(Reporter: gaomingcn, Assigned: gaomingcn)

References

()

Details

(Keywords: access)

1. Reference the above URL for the testcase.
2. Use word start or word end
3. check on "Track mouse clicks"
4. use "Character", "Word start", "Word end", "Line start" or "Line end"
5. click on 
"abc
123"

We can see the amount of characters according to the offset is not right.
Assignee: aaronleventhal → gaomingcn
I found there is one whitespace before "abc" and one whitespace after "123" while debugging.
<span>
abc<br>
123
</span>

The "cr" in HTML source introduced a space in AccessibleHyperText.
So it's (I use $ for space, # for \000A)

$abc#
$123$
Keywords: access
In case of Character, we get:

Text:  a [0,2] b [2,3] c [3,4] [4,5] 1 [5,7] 2 [7,8] 3 [8,9] [9,10]

[0,2] is "\na", [5,7] is "\n1" and [9,10] is "\n" at first, but "\n"s are replaced by " " in nsHyperTextAccessible::GetPosAndText().
I think this is a duplicate of bug 348901. Is it?

*** This bug has been marked as a duplicate of 348901 ***
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.