dialog.showModal() has wrong position but dialog.show() works
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox86 | --- | wontfix |
firefox87 | --- | wontfix |
firefox88 | --- | fixed |
People
(Reporter: steffen.weber, Assigned: sefeng)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(5 files, 1 obsolete file)
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
Steps to reproduce:
Alternatively, open the attached file.
Interesting observation: The issue disappears when the dialog is opened using "dialog.show()" instead of "dialog.showModal()".
Actual results:
The dialog is positioned too far up. Parts of it are rendered outside the viewport. See the rendering in Firefox 82 or Chrome for a comparison.
Expected results:
The dialog should not be positioned too far up.
Reporter | ||
Comment 1•4 years ago
|
||
This issue was originally reported by two of our users who were unable to use our consent dialog that we launched today in Firefox 83 Alpha 1: https://www.computerbase.de/forum/threads/in-eigener-sache-auch-wir-kommen-an-einem-consent-dialog-nicht-vorbei.1973328/post-24712583
Comment 2•4 years ago
|
||
Dialog show
and showModal
are only enabled on Nightly. That said I can reproduce this issue in Firefox 81 after enabling dom.dialog_element.enabled
in about:config.
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Comment 3•4 years ago
|
||
Dialog show and showModal are only enabled on Nightly.
Oops, you are right. I must have had the dialog polyfill (https://github.com/GoogleChrome/dialog-polyfill) still active when I tested in older Firefox versions.
Reporter | ||
Comment 4•4 years ago
|
||
Comment 5•4 years ago
|
||
showModal() is still producing invalid position on 85 and 86. Test document attached.
Curiously, also occurs with the polyfill demos.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 6•4 years ago
|
||
I believe this might be due to https://bugzilla.mozilla.org/show_bug.cgi?id=567039
Assignee | ||
Comment 7•4 years ago
|
||
Ah, so the block size is not calculated correctly with max-height?
Er, I don't know if there's a trick to make it work, maybe we need to bring back top
? Thoughts on this emilio?
Assignee | ||
Comment 8•4 years ago
•
|
||
(web platform tests didn't catch this because they set the height and width of the dialog explicitly)
Comment 9•4 years ago
|
||
So <dialog>
has position: fixed; top: 0; bottom: 0;
, which basically means "take all the available space". It seems blink special-cases height: fit-content
here to behave differently from auto
, but if you take the test-case in comment 5 and add dialog { height: auto }
, then Chrome behaves like us.
The fix for this should probably be something like not entering this } else {
branch when the block-size is -moz-fit-content
, and resolve the offsets during layout.
But it's not clear to me what the interactions with margins should be though...
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 11•3 years ago
|
||
In this patch, instead of making the block size as much as possible
for margin:auto, height: -moz-fit-content; width: -moz-fit-content
, we
use the default size.
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 12•3 years ago
|
||
Depends on D106497
Updated•3 years ago
|
Assignee | ||
Comment 13•3 years ago
|
||
Assignee | ||
Comment 14•3 years ago
|
||
This patch creates a new behavior for absolute positioned frames such
that if they have intrinsic BSize keywords (-moz-fit-content, min-content,
max-content) and the margins are auto, instead of taking as much spaces
as possible, use the actual intrinsic BSize as the BSize.
Users can still use auto
keyword to make it to fill the available
space.
Depends on D107872
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 15•3 years ago
|
||
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e52d44308040 Factor out the logic of computing auto margins for abspos frames to its own method r=dholbert,emilio https://hg.mozilla.org/integration/autoland/rev/8083eaa5d432 For abspos frames, resolve intrinsic BSize keywords to the actual intrinsic BSize, instead of stretching to fill the available space r=emilio,dholbert https://hg.mozilla.org/integration/autoland/rev/7436beab77b1 Add tests to test the special layout handling for fit-content, min-content and max-content r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28079 for changes under testing/web-platform/tests
Comment 17•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e52d44308040
https://hg.mozilla.org/mozilla-central/rev/8083eaa5d432
https://hg.mozilla.org/mozilla-central/rev/7436beab77b1
Upstream PR merged by moz-wptsync-bot
Updated•3 years ago
|
Description
•