forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow hide animations to be started from pop up hide event
See [1] for the origin of this change, which makes it possible to trigger pop up hide animations from within the `hide` event handler. For example: popup.addEventListener('hide', () => { popup.animate({ transform: 'translateY(-50px)', opacity: 0, }, 200); }); To accomplish that, the hide process now looks like this: 1. Capture any already-running animations via getAnimations(), including animations on descendent elements. 2. Remove the :top-layer pseudo class. 3. Fire the 'hide' event. 4. If the hidePopup() call is *not* the result of the pop-up being "forced out" of the top layer, e.g. by a modal dialog or fullscreen element: a. Restore focus to the previously-focused element. b. Update style. (Animations/transitions start here.) c. Call getAnimations() again, remove any from step chromium#1, and then wait until all of them finish or are cancelled. 5. Remove the pop-up from the top layer, and add the UA display:none style. 6. Update style. [1] https://chromium-review.googlesource.com/c/chromium/src/+/3688871/9/third_party/blink/renderer/core/dom/element.cc#2660 Bug: 1307772 Change-Id: I910535b13cfc3c8f8498ed64dae73caa75dd7317 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3708419 Reviewed-by: Robert Flack <flackr@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Commit-Queue: Robert Flack <flackr@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1018685}
- Loading branch information
Mason Freed
authored and
Chromium LUCI CQ
committed
Jun 28, 2022
1 parent
28b51cf
commit c58a6b9
Showing
10 changed files
with
216 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.