mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-17 20:34:34 +00:00
Bug 1897371 - Handle selectionchange events in screenshots overlay.r=kcochrane
Differential Revision: https://phabricator.services.mozilla.com/D210813
This commit is contained in:
parent
16de0305a2
commit
82745ae4d2
@ -83,8 +83,11 @@ export class ScreenshotsComponentChild extends JSWindowActorChild {
|
||||
|
||||
// Handle overlay events here
|
||||
if (
|
||||
ScreenshotsComponentChild.OVERLAY_EVENTS.includes(event.type) ||
|
||||
ScreenshotsComponentChild.PREVENTABLE_EVENTS.includes(event.type)
|
||||
[
|
||||
...ScreenshotsComponentChild.OVERLAY_EVENTS,
|
||||
...ScreenshotsComponentChild.PREVENTABLE_EVENTS,
|
||||
"selectionchange",
|
||||
].includes(event.type)
|
||||
) {
|
||||
if (!this.overlay?.initialized) {
|
||||
return;
|
||||
|
@ -27,6 +27,15 @@ add_task(async function test_textSelectedDuringScreenshot() {
|
||||
|
||||
await helper.clickTestPageElement("selection");
|
||||
|
||||
// The selection doesn't get cleared in the tests so just manually
|
||||
// remove the selection here.
|
||||
// In real scenarios, the selection is cleared when the page is
|
||||
// interacted with.
|
||||
await ContentTask.spawn(browser, [], async () => {
|
||||
let selection = content.window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
});
|
||||
|
||||
let clipboardChanged = helper.waitForRawClipboardChange(
|
||||
Math.round(rect.width),
|
||||
Math.round(rect.height),
|
||||
|
Loading…
Reference in New Issue
Block a user