Closed Bug 957332 Opened 10 years ago Closed 10 years ago

atk_text_set_caret_offset() should clear visual selection/highlighting

Categories

(Core :: Disability Access APIs, defect)

x86_64
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: jdiggs, Assigned: surkov)

Details

Attachments

(4 files, 1 obsolete file)

Steps to reproduce:
1. Launch the attached accessible-event listener in a terminal
2. Launch Firefox and enable caret-navigation (F7)
3. (Re)load the attached test case

Expected results: Setting the caret via atk_text_set_caret_offset() would clear the visual selection/highlighting -- just like pressing an arrow key or clicking with the mouse does [*].

Actual results: Setting the caret via atk_text_set_caret_offset() doesn't clear the visual selection/highlighting; the middle of the second paragraph still visually appears to be selected.

Note: As the listener output illustrates, asking for the selected text via ATK results in a zero-length range (which is correct). And pressing Ctrl+C to copy the selected text results in nothing being copied (also correct). But for users with low vision -- and sighted Orca developers trying to implement support for Gecko text selection ;) -- the on-screen rendering is confusing. Hopefully this is a quick fix.

[*] If the attached accessible-event listener were not used. If, after performing steps 1-3 you arrow, click with the mouse, etc., the highlighting remains on screen.
Neil, do you have ideas? It seems that visual selection is just an artifact. On accessibility layer we just change the range and then remove/add it from selection (refer to HyperTextAccessible::SetSelectionRange for details).
Flags: needinfo?(enndeakin)
Don't know. After loading the testcase and pressing right the selection disappearsand the caret moves to the end of the selection properly. But after pressing right a second time, the caret jumps back to where the beginning was.

Should ask someone who knows more about selection. I think Mats has worked on it in the past.
Flags: needinfo?(enndeakin) → needinfo?(matspal)
Can you try a debug build and let me know if you see any error messages in the console?
I tried the STR - I don't get any messages at all from the attached python script
(using a Nightly on Linux64).
Neil's reported issue might be an unrelated problem.
Flags: needinfo?(matspal) → needinfo?(jdiggs)
Does it work if you move the SetSelectionBoundsAt(0, aStartPos, aEndPos);
after the RemoveRange loop?
(In reply to Neil Deakin from comment #3)
> Don't know. After loading the testcase and pressing right the selection

Just to be sure.... The test case *and* the accessibility event listener? The event listener needs to be running too as per the steps in the OR.
Here you go.
Flags: needinfo?(jdiggs)
Flags: needinfo?(matspal)
Does the workaround suggestion in comment 5 work for now?
Flags: needinfo?(matspal)
(In reply to Mats Palmgren (:mats) from comment #8)
> Does the workaround suggestion in comment 5 work for now?

yes it works, I can put an a11y fix but are you interested to have another bug since something strange happens on DOM selection side?
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → surkov.alexander
Attachment #8370993 - Flags: review?(trev.saunders)
Yes, please file a followup bug in Core/Selection and CC me.  Thanks.
(In reply to Mats Palmgren (:mats) from comment #11)
> Yes, please file a followup bug in Core/Selection and CC me.  Thanks.

done bug 968430
Attached patch patch2Splinter Review
a minimum changes (previous one had editable/test_1.html has failed)
Attachment #8370993 - Attachment is obsolete: true
Attachment #8370993 - Flags: review?(trev.saunders)
Attachment #8371734 - Flags: review?(trev.saunders)
Attachment #8371734 - Flags: review?(trev.saunders) → review+
https://hg.mozilla.org/mozilla-central/rev/72200733e8e7
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: