Closed Bug 452584 Opened 17 years ago Closed 9 years ago

SetSelectionBounds fails to select content of html:input if it contains two text frames

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

(Whiteboard: [auto-closed:inactivity])

Attachments

(1 file)

nsIAccessibleEditText::deleteText doesn't work when end offset equals text length for example, deleteText(0, 5) throws an exception if the input value is "hello".
it seems the problem only after insertText. Also setTextContents() fails after insertText.
Depends on: 452161
actually SetSelectionBounds() fails to select content of html:input if it contains two frames. Eventually several calls of insertText creates two text frames inside html:input. In this case GetPosAndText returns wrong end frame and accessible and therefore HypertextOffsetsToDOMRange creates wrong range so that range->SetEnd(endNode, endOffset) fails.
Assignee: nobody → surkov.alexander
Summary: nsIAccessibleEditText::deleteText doesn't work when end offset equals text length → SetSelectionBounds fails to select content of html:input if it contains two text frames
Attached patch patchSplinter Review
Attachment #335898 - Flags: review?(aaronleventhal)
Attachment #335898 - Flags: review?(marco.zehe)
Status: NEW → ASSIGNED
Attachment #335898 - Flags: review?(marco.zehe) → review+
Did we run tests on this yet, and do we even have tests the try the various ways it's possible to use getTextAtOffset(), getTextBeforeOffset(), getTextAfterOffset(). For example, I think we used to return null for the startFrame on requests that go past the end. Do we still do that? If no I think it will probably break usages some of those methods at or near the end of a paragraph. Did GetPosAndText() return end frame of null, and that caused the problem?
Comment on attachment 335898 [details] [diff] [review] patch Clearing request until questions answered.
Attachment #335898 - Flags: review?(aaronleventhal)
Actually that's I'm afraid of. Since we haven't any tests for this and I'm not sure I know entirely that code then I'm afraid to break something. We don't return empty end frame or accessible, we initialize them by start frame and start accessible (http://mxr.mozilla.org/mozilla-central/source/accessible/src/html/nsHyperTextAccessible.cpp#515). So I'm not sure how it can be used.
Blocks: texta11y
Ping. I wonder about AccessibleEditableText.idl. Are the ranges really supposed to be from 0 .. length? I would have thought 0 .. length-1.
Perhaps, but the problem is methods do not work after several calls of InsertText
Maybe get Roc's thoughts?
In general we shouldn't care how much text nodes are inside. If we'll fix this for html:input then we could easily get similar things for editable div for example. In general this is all related with text offset support which should be primary I think.
AUTO-CLOSED. This bug untouched for over 2000 days. Please reopen if you can confirm the bug and help it progress.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
Whiteboard: [auto-closed:inactivity]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: