Skip to content

Commit

Permalink
Bug 1847114 [wpt PR 41330] - Make dialog user-agent styles apply whil…
Browse files Browse the repository at this point in the history
…e in top layer, a=testonly

Automatic update from web-platform-tests
Make dialog user-agent styles apply while in top layer

This makes it so that while the dialog element is doing an exit
animation, its positioning etc. styles from the user-agent stylesheet
still apply so it doesnt jump to a different spot while animating out.
The :modal class is removed during this time which is why it was a
problem before. We also can't just make all dialog elements always have
these styles applied, because then they would also apply to non-modal
dialogs.

Spec: whatwg/html#9387

Fixed: 1451910
Change-Id: I4d2b240ab17879d6cf08f94f32d7c7577e9f53ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4739784
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1179848}

--

wpt-commits: d315170388cc39a79899491733317a74d02e19f1
wpt-pr: 41330
  • Loading branch information
josepharhar authored and moz-wptsync-bot committed Aug 17, 2023
1 parent 3c7c661 commit 357e128
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<dialog>dialog</dialog>
<script>
document.querySelector('dialog').showModal();
document.activeElement.blur();
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://drafts.csswg.org/css-position-4/#overlay">
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1451910">
<link rel=help href="https://github.com/whatwg/html/pull/9387">
<link rel=match href="overlay-transition-dialog-ref.html">

<dialog>dialog</dialog>

<style>
dialog.animate {
transition: overlay 2s allow-discrete, display 2s allow-discrete;
}
</style>

<script>
const dialog = document.querySelector('dialog');
dialog.showModal();
dialog.classList.add('animate');
dialog.close();
requestAnimationFrame(() => {
requestAnimationFrame(() => {
document.documentElement.classList.remove('reftest-wait');
});
});
</script>

0 comments on commit 357e128

Please sign in to comment.