Closed
Bug 392818
Opened 18 years ago
Closed 18 years ago
getTextAtOffset() broken for all but the first line in a multi-line entry
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
People
(Reporter: jdiggs, Assigned: surkov)
References
(Blocks 2 open bugs)
Details
(Keywords: access, regression)
Attachments
(1 file, 1 obsolete file)
|
8.52 KB,
patch
|
ginnchen+exoracle
:
review+
damons
:
approval1.9+
|
Details | Diff | Splinter Review |
Steps to reproduce:
1. Type some text into a multi-line entry (e.g. in bugzilla's Description or comments) so that it wraps onto subsequent lines.
2. Launch Accerciser and select the entry in the hierarchy.
3. Move the caret to some location within the entry.
4. In the iPython Console type
text=acc.queryText()
text.getTextAtOffset(text.caretOffset, Accessibility.TEXT_BOUNDARY_LINE_START)
Expected results: Regardless of the location of the caret when you perform step 4, the current line of text would be returned along with the appropriate starting and ending offsets.
Actual results: The current line of text (along with the appropriate offsets) is returned only if you're on the first line of the entry. If you start from subsequent lines, an empty string is returned along with starting and ending offsets of 0.
Notes: It's not just limited to TEXT_BOUNDARY_LINE_START. All of the text boundary types return empty strings and offsets of 0 with the notable exception of TEXT_BOUNDARY_CHAR. That boundary works as expected on the first line of an entry (i.e. returns a single character and appropriate offsets). On subsequent lines it will return the text from your present location to the end of the entry, along with the corresponding offsets.
Comment 1•18 years ago
|
||
Ginn, can you look?
| Assignee | ||
Comment 2•18 years ago
|
||
The problem is GetRelativeOffset() retunrs -1 because the given frame is not primary frame (RenderedToContentOffset fails).
| Assignee | ||
Comment 3•18 years ago
|
||
Assignee: ginn.chen → surkov.alexander
Status: NEW → ASSIGNED
Attachment #277892 -
Flags: review?(aaronleventhal)
Comment 4•18 years ago
|
||
Comment on attachment 277892 [details] [diff] [review]
patch
Ginn, could you review this? I'm currently mostly away until next week.
Attachment #277892 -
Flags: review?(aaronleventhal) → review?(ginn.chen)
| Assignee | ||
Updated•18 years ago
|
OS: Linux → All
Hardware: PC → All
| Assignee | ||
Comment 5•18 years ago
|
||
updated to trunk
Attachment #277892 -
Attachment is obsolete: true
Attachment #278015 -
Flags: review?(ginn.chen)
Attachment #277892 -
Flags: review?(ginn.chen)
+ nsIFrame *endFrame = GetPosAndText(startOffset, endOffset, nsnull, nsnull,
+ nsnull, getter_AddRefs(endAcc));
Is it correct? or missed one nsnull ?
168 nsIFrame* GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
169 nsAString *aText = nsnull,
170 nsIFrame **aEndFrame = nsnull,
171 nsIntRect *aBoundsRect = nsnull,
172 nsIAccessible **aStartAcc = nsnull,
173 nsIAccessible **aEndAcc = nsnull);
| Assignee | ||
Comment 7•18 years ago
|
||
(In reply to comment #6)
> + nsIFrame *endFrame = GetPosAndText(startOffset, endOffset, nsnull, nsnull,
> + nsnull, getter_AddRefs(endAcc));
>
> Is it correct? or missed one nsnull ?
Correct because latest nsnull is not necessary as argument with default value. Did I get you right?
I was confused by giving "endAcc" to "aStartAcc".
I think we intend to do that.
I'm still wondering if it is the best way to solve it.
-- to get primary frame from nsIAccessible
| Assignee | ||
Comment 9•18 years ago
|
||
(In reply to comment #8)
> I was confused by giving "endAcc" to "aStartAcc".
> I think we intend to do that.
It's the same logic like endFrame to startFrame (that is return value).
> I'm still wondering if it is the best way to solve it.
> -- to get primary frame from nsIAccessible
>
Really I don't know. It's probably because I'm not in deep of frames, layout etc.
Attachment #278015 -
Flags: review?(ginn.chen) → review+
| Assignee | ||
Updated•18 years ago
|
Attachment #278015 -
Flags: approval1.9?
Updated•18 years ago
|
Attachment #278015 -
Flags: approval1.9? → approval1.9+
| Assignee | ||
Comment 10•18 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 11•18 years ago
|
||
I can confirm that this is now indeed fixed! I am happily typing and see the text scrolling and am able to review it just fine. Good work!
You need to log in
before you can comment on or make changes to this bug.
Description
•