-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shouldn't modal dialog dialog.offsetParent
returns <body> ?
#5520
Comments
The only way I could think of that this would make sense would be if all top layer elements gave So our choices are to either update the |
I'm not very familiar with <dialog id=dialog>
<button onclick="output.textContent = String(dialog.offsetParent)">get dialog.offsetParent</button>
<div id=output></div>
</dialog>
<button id=opendialog onclick="dialog.showModal()">open dialog</button>
Could you show me an example of a fullscreen element so I can find out why |
Ah, okay, thanks! I see there's a bug in the test file I used, so I didn't test the fullscreen mode correctly. I used this file. Redoing the test, I see Chrome returned Does this still look like a bug on Chrome? |
Interesting. Well, now it looks like an interop problem with the definition of top layer. Is anyone able to test in Safari? I'm inclined to just go with the majority behavior. I.e. if Safari matches Chrome, then update the offsetParent spec to handle top layer like 2/3 browsers do, and align Firefox to match. Whereas if Safari matches Firefox, then we should consider this a Chrome bug (for both fullscreen and modal dialogs). /cc @emilio @zcorpan @tabatkins since this is probably going to end up in CSSWG territory soon, given that it's about https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent |
It should return However it should behave consistently with fixed-pos elements and such, and I expect stuff to be interoperable there. |
Hmm. I think it should be consistent with fullscreened elements, and things are not interoperable there. Or are you saying that fullscreened elements should also be consistent with fixed-pos elements? |
Yes, quite probably. Anything whose containing block is the viewport should behave the same I think. |
Safari also returns |
Great! OK, then combined with @emilio's assessment, I'm going to say the spec is correct as-is, and Chrome has a bug. @sefeng211, can you help make sure that both fullscreen and modal dialog are covered by web platform tests (fixing any broken ones you find), and add links to them here? Then I can take care of filing a Chromium bug, and we can close this spec issue. |
Changing to As for painting/stacking behavior, that does matter but that is something else. See also whatwg/fullscreen#165. |
In Chrome, when executing
dialog.offsetParent
on a modal dialog, it returnsnull
. Shouldn't it return<body>
?I tested this on fullscreen elements, and it would return
<body>
in both Chrome and Firefox.The text was updated successfully, but these errors were encountered: