selection.addRange() fails to highlight text or make it copyable when triggered by a return to page focus after previously being in a textbox
Categories
(Core :: DOM: Selection, defect)
Tracking
()
People
(Reporter: ke5trel, Assigned: emilio)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files)
STR:
- Open the attached test page (based on MDN addRange() example).
- Click the textbox to focus it.
- Press Ctrl+F to move keyboard focus outside the page.
- Click the button "Select strong words".
- Copy selection with Ctrl+C or context menu.
- Paste in find bar.
- Click in the page.
- Repeat steps 2-4.
Expected:
The bold text is selected and can be copied and pasted.
Actual:
Selection appears to work but copying fails and after clicking in the page, the button no longer selects text when STR repeated until the page is refreshed.
Only the first click event that triggers selection.addRange() when returning focus to a page where a textbox previously had focus is affected.
First regression window (copy failure):
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=737aba43bfa1685fa15a9b542636b959397603a8&tochange=018964cefa63a14d1e43b31be1b91526a9d708fc
Most likely by regressed by Bug 253870.
Second regression window (selection failure):
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=9f3f88599fffa54ddf0c744b98cc02df99f8d0b8&tochange=01b9bdb6e5ef2a19e1c3311a47569d62f275db1f
Most likely by regressed by Bug 1623837.
Updated•3 years ago
|
| Assignee | ||
Comment 3•3 years ago
|
||
Needs a test (though it might be hard to construct).
Updated•3 years ago
|
| Assignee | ||
Comment 4•3 years ago
|
||
Bug 582459 made testing this a lot harder :(
Comment 6•2 years ago
|
||
| bugherder | ||
Updated•2 years ago
|
Reproducible on Firefox 104.0.1(build ID: 20230608214645) on Ubuntu 22.
Verified as fixed on Firefox 115.0b4(build ID: 20230611180300) and Nightly 116.0a1(build ID: 20230612211509) on Ubuntu 22, macOS 12, Windows 10.
Description
•