m_isModal triggers the :-internal-modal-dialog pseudo class, which changes position from absolute to fixed. When removing a modal <dialog> from the document, it is also removed from the top layer, it makes sense to reset the modal dialog flag as well as a result.
Created attachment 440366 [details] Patch
<rdar://problem/83934967>
Committed r283631 (242582@main): <https://commits.webkit.org/242582@main>