Closed Bug 875794 Opened 12 years ago Closed 12 years ago

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

Categories

(Core :: Disability Access APIs, defect)

x86
Windows 7
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: MarcoZ, Assigned: surkov)

References

Details

(Keywords: regression)

Attachments

(2 files)

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).
Jamie, could you take a look what's broken? Presumably it is something wrong with text interface line boundary?
Flags: needinfo?(jamie)
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)
(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?
Blocks: getText*a11y
(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.
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: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #756398 - Flags: review?(trev.saunders)
Attachment #756990 - Flags: review?(trev.saunders)
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
Attachment #756398 - Attachment description: patch → part1: line start case
Blocks: 882281
No longer blocks: getText*a11y
Comment on attachment 756398 [details] [diff] [review] part1: line start case canceling review, replaced by bug 882281
Attachment #756398 - Flags: review?(trev.saunders)
Attachment #756990 - Flags: review?(trev.saunders)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: