When called with isLink=true, _getDragTargetTab returns null if the
pointer is around the edges of the tab. This is useful to decide whether
drag-and-drop should create a new tab, or reuse an existing one.
The problem was that _getDropIndex, used when creating a new tab, would
therefore always get a null tab on dragover events, and then fall back
to iterating all tabs sequentially until it would find the right index,
with an expensive getBoundingClientRect() for each tab.
So this patch:
- Renames unclear isLink to a more meaningful ignoreTabSides
- Makes _getDragTargetTab use the native Element#closest instead of
iterating the ancestors manually in JS.
- Makes _getDropIndex always pass ignoreTabSides=false
- Refactors _getDropIndex to never iterate tabs.
- Adds .tab-drop-indicator{pointer-events:none}. This is needed so that
the indicator doesn't become the event target, we want to get the tab
behind it.
Differential Revision: https://phabricator.services.mozilla.com/D166125
* Keep track of the tab-pickup-container views in TabsSetupFlowManager and their visibility
* Fix visibilitychange handling in tab-pickup-container and add some tests
* Capture a timestamp when a device has been added and there are 0 tabs to show, with at least one visible tab-pickup-container view
* Record telemetry when there are > 0 tabs in these conditions
Differential Revision: https://phabricator.services.mozilla.com/D170526
Set up event handlers so that pressing Escape dismisses Feature
Callouts. If an interactive element outside of the Callout is focused,
then the Escape key will not be consumed. Also consolidate all the event
handlers into a single switch statement so we won't need to continue
adding more callback bindings (they were only necessary before
encapsulation was implemented). Also change the names of a couple
formerly pseudo-private methods that we're now referencing externally.
Differential Revision: https://phabricator.services.mozilla.com/D168307
* And synthesize clicks on the fxview button to ensure we're getting the correct window focus and visibility while asserting on the state
* Ensure the lastTabFetch pref is reset at the top of the tests, and in each test
Differential Revision: https://phabricator.services.mozilla.com/D167623
* Create a sharable module for the core Firefox-View test helpers
* Adjust firefoxview's tests (head.js) to use the helper module
* Adjust messaging-system tests to use the helper module where these helpers were temporarily duplicated
* Adjust newtab tests to use the helper module
Differential Revision: https://phabricator.services.mozilla.com/D167589
Unify the values of "source" and "page" as used in FeatureCallout.sys.mjs:
- Explicitly pass in a value for "page" when instantiating a Feature Callout and use this for the value of "page" when sending Feature Callout telemetry and as the "source" when making calls to `sendTriggerMessage`. This avoids the risk of including non-about: page URLs or PDF file extensions in our telemetry.
- Set the value of "page" in an HTML data attribute that can be accessed for use in about:welcome telemetry for Spotlight and Feature Callouts.
- Update references to the page value previously used as the page/source for telemetry from `about:firefoxview` Feature Callouts from "firefoxview" to "about:firefoxview"
- Pass the token "chrome" when creating a callout from the browser chrome and update references to the source in PDF.js messages' targeting
- Update the page value expected in automated tests as needed
Differential Revision: https://phabricator.services.mozilla.com/D165910
Changed the the section subtitles to heading tags so that VO will recognize them as part of the heading and not a separate clickable element.
Differential Revision: https://phabricator.services.mozilla.com/D165217
There are two things I've added here:
- The observers for when FxA devices are connected/disconnected were not added/removed as part of this update: https://phabricator.services.mozilla.com/D153069.
- When a mobile device is the only synced device beyond the current one (desktop) and you remove the current device (desktop), then sign back in from Fx View Tab Pickup banner, `fxAccounts.device.recentDeviceList` only returns the mobile device for some reason (possibly due to device cache). This causes our checks for a secondary device to fail (as we now only have access to the mobile device from `recentDeviceList`, and we're assuming the one device we DO have access to is our current device - which is not the case). This is why Tab Pickup was incorrectly displaying the "Connect a mobile device" message. I've added a check at the start of `refreshDevices()` to manually refresh the device list (ignoring device cache) if the `recentDeviceList` doesn't contain a device with `isCurrentDevice` set to `true`. This is really a workaround for the caching stuff going on behind the scenes, but this does seem to fix things from our end.
Differential Revision: https://phabricator.services.mozilla.com/D165960
Updated the tab closing prompt logic to use the number of visible tabs open to determine if the prompt should show in Windows and Linux.
Differential Revision: https://phabricator.services.mozilla.com/D162627
* Adds a promise that resolves when the tab-pickup-list is ready
* Use that promise to trigger tab data request for the list when we enter the setup-complete state
* Remove the workarounds for overlapping setup and tabs requests
Differential Revision: https://phabricator.services.mozilla.com/D163750
Cleanup patch to set the default value of the PDF.js feature tour pref to an empty string - this screen ID will be updated via Nimbus for treatment branches in the PDF.js annotation experiment
Bonus - updating a check that currently compares two objects rather than their ids. This update should not effect behavior for users but will ensure we don't bother with rerendering the callout with the same message.
Differential Revision: https://phabricator.services.mozilla.com/D163980