Animate panels with the dropdown panel Nova motion design tokens
Categories
(Firefox :: Menus, enhancement, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox161 | --- | fixed |
People
(Reporter: nsharpley, Assigned: nsharpley)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidefe-sidebar])
Attachments
(1 external file, 1 obsolete file)
Using the new design tokens in the Nova motion prototype, update the animations for dropdown panels in the toolbar upon opening and closing with an opacity, scale and translate.
Prototype: https://nova-motion-spec.netlify.app/
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
•
|
||
NOTE:
- Why not use View transitions? After some research, it appears View transitions are not an option here as the snapshot is rooted in the wrong window. The whole
::view-transitionpseudo tree gets attached under the document's root element, and the snapshot containing block is the pres context's visible area - i.e. the main browser window's viewport. A XUL<panel>renders into its own OS widget (NSWindow/HWND) outside that viewport. So a snapshot of#appMenu-popupwould be painted inside the browser window, in document coordinates, clipped to it - while the real popup still pops in instantly in its own window. Among other blockers... - Big hurdle - macOS requires
moz-window-transformin order to properly handle the native shadow, which we need as a hittable area (?). However using this property with scale makes the whole animation jumpy. I slowed the animation down and through process of elimination discovered the scale transform is causing the jumpiness - remove the scale animation and its not jumpy. This works fine on Linux and Windows though. It would seem the only fix is moving this animation offmoz-window-transformin macOS using the same CSS as non-mac, removingmoz-window-shadowand adding a CSS box shadow instead of the native shadow. Big no no though as the fake window shadow won't work because we can't make that shadow transparent to mouse events and hence hitting the shadow won't close the popup.
Hoping :mstange and :emilio might have some ideas on how to get around point 2?
| Assignee | ||
Comment 2•1 month ago
|
||
Panels now drop 4px and scale out of the corner they hang from, rather than
sliding 70px. macOS animates the -moz-window-* properties as before, so the
native window shadow comes along and the system is not asked to recompute the
window's shape mid-animation; since bug 2080204 those honour transform-origin,
so a single declaration pivots both paths on the same corner.
TO DO: use --motion-ease-emphasized`` and --motion-ease-standard` (see bug 2083138)
Comment 3•1 month ago
|
||
However using this property with scale makes the whole animation jumpy
So, just checking... What does "jumpy" here mean? What I see is that the scale animation causes the text to flicker quite a bit (on the app menu for example), specially once you're at scales close to 1, but mostly if the transition is slow. Is that what you mean? Or something else?
The patch as-is looks acceptable to me on macOS but maybe I don't have a great eye?
It would seem the only fix is moving this animation off moz-window-transform in macOS using the same CSS as non-mac, removing moz-window-shadow and adding a CSS box shadow instead of the native shadow.
Well, might not be the only fix. I see that for example NSWindow has a setFrame with animate: bool here. Maybe we could use that? That'd leave the easing function to the OS.
Big no no though as the fake window shadow won't work because we can't make that shadow transparent to mouse events and hence hitting the shadow won't close the popup.
This is the main issue that has prevented us from using custom borders / shadows in the past, yeah.
(Tangential but if you rebase it'd make it easier to apply to trunk :))
Comment 4•1 month ago
|
||
FWIW I checked and CGSSetWindowEventShape might be a private API we might be able to use to implement our own shadows, if we wanted to go that route. There might be other edge cases like "what happens with windows that are near the edge of the monitor" and so on.
Comment 5•1 month ago
|
||
Also, this is relevant, it seems we should probably snap the translations regardless as long as the window is axis-aligned?
Comment 6•1 month ago
|
||
| Assignee | ||
Updated•1 month ago
|
Updated•1 month ago
|
Comment 9•1 month ago
|
||
Comment on attachment 9664018 [details]
Bug 2083140 - Snap cocoa widget transform accounting for scale. r=#mac-reviewers
Revision D334919 was moved to bug 2083740. Setting attachment 9664018 [details] to obsolete.
Updated•1 month ago
|
Updated•1 month ago
|
Comment 10•1 month ago
|
||
Comment 11•1 month ago
|
||
Comment 12•1 month ago
|
||
Backed out for causing bc failures @browser_parsable_css.js.
Comment 13•1 month ago
|
||
Comment 14•1 month ago
|
||
| bugherder | ||
| Assignee | ||
Updated•1 month ago
|
Description
•