get text at offset for line boundary fails on last empty line

RESOLVED FIXED in mozilla25

Status

()

Core
Disability Access APIs
--
major
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: MarcoZ, Assigned: surkov)

Tracking

({regression})

Trunk
mozilla25
x86
Windows 7
regression
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
STR:
1. With NVDA running, either connect a braille display.
2. Find any textarea.
3. Type something.
4. press Enter.

Expected: Braille display should be blank, with cursor blinking on first cell of the line.
Actual: Text remains on the display, and the cursor blinks after the last character, as if no newline was inserted.

This is a regression from bug 873358 and first appears in 24.0a1 (2013-05-24).
(Assignee)

Comment 1

5 years ago
Jamie, could you take a look what's broken? Presumably it is something wrong with text interface line boundary?
Flags: needinfo?(jamie)

Comment 2

4 years ago
Consider a textarea where you type "test" and then press enter, so the entire text is "test\n". IAccessibleText::textAtOffset(4, IA2_TEXT_BOUNDARY_LINE) (4 is the line feed) returns offsets of (0, 5), which is correct. However, IAccessibleText::textAtOffset(5, IA2_TEXT_BOUNDARY_LINE) (5 is where the caret lands after pressing enter) returns offset of (0, 4). Aside from being oddly inconsistent (why 4 instead of 5?), this is incorrect, since we're on the new line, so it should be at least (5, 5).

The tricky part is that there's actually no character there yet, which makes bounds checking a bit weird. Essentially, we have to pretend there's a character there.
Flags: needinfo?(jamie)
(Assignee)

Comment 3

4 years ago
(In reply to James Teh [:Jamie] from comment #2)
> Consider a textarea where you type "test" and then press enter, so the
> entire text is "test\n". IAccessibleText::textAtOffset(4,
> IA2_TEXT_BOUNDARY_LINE) (4 is the line feed) returns offsets of (0, 5),
> which is correct. However, IAccessibleText::textAtOffset(5,
> IA2_TEXT_BOUNDARY_LINE) (5 is where the caret lands after pressing enter)
> returns offset of (0, 4). Aside from being oddly inconsistent (why 4 instead
> of 5?), this is incorrect, since we're on the new line, so it should be at
> least (5, 5).

yep (5,5) seems correct here (I'm pretty sure we have todo in our test suite for this)

> The tricky part is that there's actually no character there yet, which makes
> bounds checking a bit weird. Essentially, we have to pretend there's a
> character there.

so if we return (5, 5, "") then it is still a problem for NVDA?
(Assignee)

Updated

4 years ago
Blocks: 613857

Comment 4

4 years ago
(In reply to alexander :surkov from comment #3)
> > The tricky part is that there's actually no character there yet, which makes
> > bounds checking a bit weird. Essentially, we have to pretend there's a
> > character there.
> so if we return (5, 5, "") then it is still a problem for NVDA?
Not at all. I was just making an observation about why the regression probably crept in.
(Assignee)

Comment 5

4 years ago
ok, thanks. renaming bug
Summary: After bug 873358, when inserting a newline at the end of a textarea, the braille display does no longer get blank → get text at offset for line_start boundary fails on last empty line
(Assignee)

Comment 6

4 years ago
Created attachment 756398 [details] [diff] [review]
part1: line start case
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #756398 - Flags: review?(trev.saunders)
(Assignee)

Comment 7

4 years ago
Created attachment 756990 [details] [diff] [review]
part2: line end case
Attachment #756990 - Flags: review?(trev.saunders)
(Assignee)

Updated

4 years ago
Summary: get text at offset for line_start boundary fails on last empty line → get text at offset for line boundary fails on last empty line
(Assignee)

Updated

4 years ago
Attachment #756398 - Attachment description: patch → part1: line start case
(Assignee)

Updated

4 years ago
Blocks: 882281
(Assignee)

Updated

4 years ago
No longer blocks: 613857
(Assignee)

Comment 8

4 years ago
Comment on attachment 756398 [details] [diff] [review]
part1: line start case

canceling review, replaced by bug 882281
Attachment #756398 - Flags: review?(trev.saunders)
(Assignee)

Updated

4 years ago
Attachment #756990 - Flags: review?(trev.saunders)
(Assignee)

Comment 9

4 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/f2e3ec8e72ab
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/f2e3ec8e72ab
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
(Assignee)

Comment 11

4 years ago
part2: http://hg.mozilla.org/integration/mozilla-inbound/rev/29139ed969a5 (pulls r+ from bug 882281)
https://hg.mozilla.org/mozilla-central/rev/29139ed969a5
You need to log in before you can comment on or make changes to this bug.