64 Commits

Author SHA1 Message Date
Florian Quèze
cd093f0a88 Bug 1918702 - Migrate telemetry events to use Glean APIs for screenshots, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D222607
2024-09-20 13:58:19 +00:00
Noemi Erli
90b5fb50ca Backed out changeset 10ac3f66133d (bug 1896232) for causing bug 1915806 CLOSED TREE 2024-08-30 16:33:37 +03:00
Niklas Baumgardner
0fc89881f5 Bug 1896232 - Wait for screenshot to download before closing overlay. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D216083
2024-08-29 03:21:44 +00:00
Iulian Moraru
6faba7e3b9 Backed out 2 changesets (bug 1908205, bug 1896232) for causing bc assertion failures on nsUrlClassifierDBService.cpp. CLOSED TREE
Backed out changeset 859b4c639883 (bug 1908205)
Backed out changeset 519e88d21955 (bug 1896232)
2024-08-22 22:20:42 +03:00
Niklas Baumgardner
b0381f7136 Bug 1896232 - Wait for screenshot to download before closing overlay. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D216083
2024-08-22 18:36:48 +00:00
Narcis Beleuzu
073a988929 Backed out 2 changesets (bug 1908205, bug 1896232) for causing mochitests failures . CLOSED TREE
Backed out changeset 873bbe70aa8c (bug 1908205)
Backed out changeset 0385fdac5693 (bug 1896232)
2024-08-19 19:04:38 +03:00
Niklas Baumgardner
ee55b5699a Bug 1896232 - Wait for screenshot to download before closing overlay. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D216083
2024-08-19 14:40:42 +00:00
Niklas Baumgardner
0e39bf8f0c Bug 1894516 - Make screenshots face focusable via the keyboard. r=sfoster,desktop-theme-reviewers,fluent-reviewers,bolsson,ayeddi
Differential Revision: https://phabricator.services.mozilla.com/D213100
2024-07-29 16:59:14 +00:00
Norisz Fay
57a529f668 Backed out changeset 41d7f0b670ae (bug 1894516) for causing bc failures on browser_screenshots_focus_test.js CLOSED TREE 2024-07-25 23:50:34 +03:00
Niklas Baumgardner
68f4030f56 Bug 1894516 - Make screenshots face focusable via the keyboard. r=sfoster,desktop-theme-reviewers,fluent-reviewers,bolsson,ayeddi
Differential Revision: https://phabricator.services.mozilla.com/D213100
2024-07-25 14:32:27 +00:00
Niklas Baumgardner
456cea1645 Bug 1905468 - Prevent some more mouse events from reaching the content page. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D215515
2024-07-08 14:41:02 +00:00
Niklas Baumgardner
132d9f5905 Bug 1897371 - Handle selectionchange events in screenshots overlay.r=kcochrane
Differential Revision: https://phabricator.services.mozilla.com/D210813
2024-05-27 16:38:53 +00:00
Niklas Baumgardner
8e50aa4937 Bug 1890721 - Prevent events from reaching the content page. r=sfoster,smaug
Differential Revision: https://phabricator.services.mozilla.com/D207749
2024-05-15 20:17:21 +00:00
Sandor Molnar
a211f263b8 Backed out changeset cc14c4f9f46e (bug 1890721) for causing bc failures @ browser/components/screenshots/tests/browser/browser_screenshots_page_unload.js CLOSED TREE 2024-05-15 21:03:34 +03:00
Niklas Baumgardner
15944c851d Bug 1890721 - Prevent events from reaching the content page. r=sfoster,smaug
Differential Revision: https://phabricator.services.mozilla.com/D207749
2024-05-15 13:45:25 +00:00
Niklas Baumgardner
e0f484f1b4 Bug 1893680 - Offset screenshots overlay when scrollMin is negative. r=sfoster,desktop-theme-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208769
2024-05-04 19:41:59 +00:00
Niklas Baumgardner
9bcd4d4100 Bug 1801957 - Create region with keyboard for screenshots. r=sfoster,firefox-desktop-core-reviewers ,accessibility-frontend-reviewers,Gijs,morgan
The problem I'm trying to solve: There is currently no way to create a selected region in the screenshots overlay with the keyboard.
I recently added support for resizing a selected region in bug 1801954, but a user still needs to create a region with the mouse before the keyboard can be used.

I tried to look at what other browsers are doing in this scenario. Unfortunately there isn't much to go off. Most browsers, I can't even take a screenshot and the only browser that I found to have keyboard support for screenshots is MS Edge. In Edge, when you open screenshots, if your mouse isn't over the content area it will immediately move your mouse to the center of the page. If your mouse is over the content, it remains in place. Then, arrow keys will move the cursor around and you can hit space/enter to start creating a region.

I didn't like that Edge moved the mouse immediately after opening screenshots so I took a different approach.

My approach:
Screenshots will not move the mouse until an arrow key is pressed.
How it works:
If your cursor is above the content and an arrow key is pressed, the cursor will move in the direction of the arrow key that was pressed.
If your cursor is not above the content and a arrow key is pressed, the cursor will be moved to the middle of the content. Screenshots will not move the cursor until an arrow key is pressed.

When moving around the overlay with the keyboard: only hitting an arrow key will move the cursor around by 1px. If shift + arrow key, the cursor will move around by 10px.
When space is clicked while moving the cursor, it will start a region. Moving the arrow keys allows the region to sized.
When the cursor is above an element and the hover element rect is visible, hitting enter will select that region. If no hover element region exists, enter will behave the same as space.

I am also keeping the screenshots UI focused in this patch. Tab/shift + tab will keep focus to screenshots UI. Shift + F6 will escape the focus loop I've made in this patch if needed. Although, if a user has entered screenshots, it makes sense that for the current time, only screenshots UI is focusable.

Differential Revision: https://phabricator.services.mozilla.com/D197703
2024-05-03 22:05:52 +00:00
Cristian Tuns
f3f0feda63 Backed out changeset 91e7087aef18 (bug 1801957) for causing bc failures in browser_keyboard_tests.js CLOSED TREE 2024-05-02 12:14:10 -04:00
Niklas Baumgardner
f00889c4fc Bug 1801957 - Create region with keyboard for screenshots. r=sfoster,firefox-desktop-core-reviewers ,accessibility-frontend-reviewers,Gijs,morgan
The problem I'm trying to solve: There is currently no way to create a selected region in the screenshots overlay with the keyboard.
I recently added support for resizing a selected region in bug 1801954, but a user still needs to create a region with the mouse before the keyboard can be used.

I tried to look at what other browsers are doing in this scenario. Unfortunately there isn't much to go off. Most browsers, I can't even take a screenshot and the only browser that I found to have keyboard support for screenshots is MS Edge. In Edge, when you open screenshots, if your mouse isn't over the content area it will immediately move your mouse to the center of the page. If your mouse is over the content, it remains in place. Then, arrow keys will move the cursor around and you can hit space/enter to start creating a region.

I didn't like that Edge moved the mouse immediately after opening screenshots so I took a different approach.

My approach:
Screenshots will not move the mouse until an arrow key is pressed.
How it works:
If your cursor is above the content and an arrow key is pressed, the cursor will move in the direction of the arrow key that was pressed.
If your cursor is not above the content and a arrow key is pressed, the cursor will be moved to the middle of the content. Screenshots will not move the cursor until an arrow key is pressed.

When moving around the overlay with the keyboard: only hitting an arrow key will move the cursor around by 1px. If shift + arrow key, the cursor will move around by 10px.
When space is clicked while moving the cursor, it will start a region. Moving the arrow keys allows the region to sized.
When the cursor is above an element and the hover element rect is visible, hitting enter will select that region. If no hover element region exists, enter will behave the same as space.

I am also keeping the screenshots UI focused in this patch. Tab/shift + tab will keep focus to screenshots UI. Shift + F6 will escape the focus loop I've made in this patch if needed. Although, if a user has entered screenshots, it makes sense that for the current time, only screenshots UI is focusable.

Differential Revision: https://phabricator.services.mozilla.com/D197703
2024-05-02 15:34:39 +00:00
Niklas Baumgardner
1dd7d9353d Bug 1887093 - Remember text selection regions during screenshots interactions. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D206696
2024-04-17 19:49:50 +00:00
Niklas Baumgardner
7515009d91 Bug 1884172 - Use x-moz-nativeimage when copying screenshots to clipboard. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D204256
2024-03-12 19:03:33 +00:00
Stanca Serban
fe83932e94 Backed out changeset 1e8ffb360c27 (bug 1884172) for causing OSX mochitests failures in browser_screenshots_test_visible.js. CLOSED TREE 2024-03-12 19:10:04 +02:00
Niklas Baumgardner
1993607fe7 Bug 1884172 - Use x-moz-nativeimage when copying screenshots to clipboard. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D204256
2024-03-12 14:22:34 +00:00
Sandor Molnar
6b82cd2685 Backed out changeset a24a00e9a529 (bug 1884172) for causing bc failures @ browser/components/screenshots/tests/browser/browser_screenshots_test_full_page.js CLOSED TREE 2024-03-12 01:03:08 +02:00
Niklas Baumgardner
5b22671ddc Bug 1884172 - Use x-moz-nativeimage when copying screenshots to clipboard. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D204256
2024-03-11 16:18:31 +00:00
Niklas Baumgardner
d918992b35 Bug 1873947 - Fix dragging screenshots tab to new window. r=sfoster,mconley
Differential Revision: https://phabricator.services.mozilla.com/D198470
2024-03-07 13:32:00 +00:00
Niklas Baumgardner
33c3a923a1 Bug 1883678 - Dispatch screenshots events to chrome only. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D203631
2024-03-05 18:52:34 +00:00
Niklas Baumgardner
92d29713f0 Bug 1873882 - Canceling screenshots selected state should go to crosshairs state. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D198468
2024-01-17 01:18:08 +00:00
Niklas Baumgardner
929276bfad Bug 1872764 - Screenshots should always get events. r=sfoster,emilio
Differential Revision: https://phabricator.services.mozilla.com/D197802
2024-01-12 02:24:43 +00:00
Niklas Baumgardner
59a1e1e591 Bug 1842037 - Update screenshots telemetry. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D191679
2023-11-14 15:57:46 +00:00
Norisz Fay
1b95461566 Backed out changeset 9ec09eb75c9f (bug 1842037) for causing bc failures on browser_screenshots_drag_test.js CLOSED TREE 2023-11-14 04:06:58 +02:00
Niklas Baumgardner
80c28a9bea Bug 1842037 - Update screenshots telemetry. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D191679
2023-11-13 23:57:17 +00:00
Niklas Baumgardner
8331e6faf7 Bug 1855313 - Show current selection size in screenshots overlay. r=sfoster,fluent-reviewers,desktop-theme-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D189312
2023-10-20 23:25:37 +00:00
Niklas Baumgardner
5764e40cb8 Bug 1854953 - Improve performance when taking large screenshots. r=sfoster,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189158
2023-10-12 16:15:41 +00:00
Cristina Horotan
29fed10407 Backed out changeset 919bb91f27bb (bug 1854953) for causing bc failures on browser_screenshots_drag_test.js CLOSED TREE 2023-10-11 00:38:25 +03:00
Niklas Baumgardner
6f5f28c5bf Bug 1854953 - Improve performance when taking large screenshots. r=sfoster,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189158
2023-10-10 16:39:02 +00:00
Sam Foster
c20c018e69 Bug 1845796 - Rework the flow in ScreenshotsUtils to make exit an explicit outcome rather than a side-effect. r=niklas
* Add a UIPhases / getUIPhase to figure out where we are in the flow, and get the UI into the right state
* Refactor to get rid of a bunch of implicit side-effects:
  - Separate out getting the panel from creating it
  - closePanel only closes the buttons panel
  - Add a closeOverlay so we do that and only that when needed
* When the preview dialog closes, we expect to exit unless exitOnPreviewClose was set false
* Keep some state for each browser using a weakmap so we can better handle re-entry (and later, re-focusing)

Differential Revision: https://phabricator.services.mozilla.com/D185379
2023-09-19 00:14:27 +00:00
Niklas Baumgardner
8464bcdbb9 Bug 1844171 - Refactor screenshots component. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D183313
2023-07-27 16:15:02 +00:00
Sebastian Hengst
945cff3a90 Backed out 2 changesets (bug 1844171) for causing mochitest failures on browser_quickactions.js. Complete backout. CLOSED TREE
Backed out changeset 2989a10ac4e6 (bug 1844171)
Backed out changeset 9bc360cfb992 (bug 1844171)
2023-07-26 21:24:18 +02:00
Niklas Baumgardner
51b2d1bafb Bug 1844171 - Refactor screenshots component. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D183313
2023-07-26 15:37:45 +00:00
Niklas Baumgardner
1e559272b1 Bug 1811953 - Scroll when resizing near the edge. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D167614
2023-03-22 21:02:49 +00:00
Niklas Baumgardner
8d87e40736 Bug 1801019 - Add telemetry for screenshots component. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D164948
2023-02-25 17:26:34 +00:00
Marian-Vasile Laza
ac8ed92c6a Backed out changeset d853ddfd853e (bug 1801019) for bc failures on browser_screenshots_telemetry_tests.js. CLOSED TREE 2023-02-23 21:11:16 +02:00
Niklas Baumgardner
4a2f7b7309 Bug 1801019 - Add telemetry for screenshots component. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D164948
2023-02-23 17:37:01 +00:00
Butkovits Atila
0cf8d92417 Backed out changeset aaf82d1483ad (bug 1801019) for causing failures at browser_screenshots_telemetry_tests.js. CLOSED TREE 2023-02-21 23:04:05 +02:00
Niklas Baumgardner
3b1f991f19 Bug 1801019 - Add telemetry for screenshots component. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D164948
2023-02-21 19:59:09 +00:00
Csoregi Natalia
599fee9609 Backed out changeset 13175567352f (bug 1811953) for failures on browser_screenshots_drag_scroll_test.js. CLOSED TREE 2023-01-26 19:21:30 +02:00
Niklas Baumgardner
8653b6d130 Bug 1811953 - Scroll when resizing near the edge. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D167614
2023-01-26 15:55:32 +00:00
Niklas Baumgardner
ad90b95338 Bug 1785293 - Downloading screenshot respects 'Always ask you where to save files'. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D158678
2022-12-06 00:06:20 +00:00
Stanca Serban
7d855ec985 Backed out changeset b080b41aecf4 (bug 1785293) for causing bc failures on browser_screenshots_test_escape.js. CLOSED TREE 2022-12-02 16:39:01 +02:00