Skip to content

Comments

Remove unsupported Window.dialogArguments#12704

Merged
queengooborg merged 3 commits intomdn:mainfrom
saschanaz:window-nosupport
May 7, 2022
Merged

Remove unsupported Window.dialogArguments#12704
queengooborg merged 3 commits intomdn:mainfrom
saschanaz:window-nosupport

Conversation

@saschanaz
Copy link
Contributor

Summary

Test results and supporting details

Related issues

#6854

@github-actions github-actions bot added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Oct 4, 2021
}
}
},
"dialogArguments": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IE, Safari and Firefox had window.dialogArguments

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@Mouvedia Mouvedia Nov 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the removal of showModalDialog was accompanied by the removal of dialogArguments, maybe yes.
But like I said Firefox supported dialogArguments hence the table would be erroneous.
e.g. Firefox 3.6 does

Someone with access to a browser farm will have to test it out.

@queengooborg queengooborg added needs content update This PR needs a corresponding update to mdn/content to update the documentation needs-release-note 📰 labels Oct 8, 2021
@Elchi3
Copy link
Member

Elchi3 commented Nov 22, 2021

I opened mdn/content#10694 for Window.setCursor removal.

@Mouvedia
Copy link

If dialogArguments gets fixed, follow it up with a revert of #10449.

@foolip
Copy link
Contributor

foolip commented Apr 20, 2022

Only the dialogArguments removal remains here now. I'll update the title.

@foolip foolip changed the title Remove unsupported Window members Remove unsupported Window.dialogArguments Apr 20, 2022
@foolip
Copy link
Contributor

foolip commented Apr 20, 2022

I've dug into dialogArguments. Here's an example of showModalDialog() exercising both dialogArguments and returnValue:

main.html:

<!doctype html>
<button>open dialog</button>
<script>
document.querySelector('button').onclick = function() {
  var value = window.showModalDialog('dialog.html', ['hello', 'world']);
  alert('returned value: ' + value);
};
</script>

dialog.html:

<!doctype html>
<div></div>
<script>
document.querySelector('div').textContent = JSON.stringify(window.dialogArguments);
</script>
<button>close me</button>
<script>
document.querySelector('button').onclick = function() {
  window.returnValue = 42;
  window.close();
};
</script>

Running this in Safari 15.4 shows that it still works, both dialogArguments and returnValue.

However, these are not normal properties of window that always exist, rather the dialogArguments property is set on the window object opened by showModalDialog(), and the returnValue property is read from the window object when it closes. The code for it is here:

https://github.com/WebKit/WebKit/blob/main/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp#L466-L489

I think we should either have MDN pages + compat data for both dialogArguments and returnValue, or none of them. In this case, I think the pragmatic thing is to remove https://developer.mozilla.org/en-US/docs/Web/API/Window/dialogArguments and document everything in https://developer.mozilla.org/en-US/docs/Web/API/Window/showModalDialog instead. @Elchi3 WDYT?

@Elchi3
Copy link
Member

Elchi3 commented Apr 20, 2022

@queengooborg queengooborg removed the needs content update This PR needs a corresponding update to mdn/content to update the documentation label May 7, 2022
Copy link
Contributor

@queengooborg queengooborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MDN content updates have been merged now, so this PR is ready to go!

@queengooborg queengooborg merged commit 577ee31 into mdn:main May 7, 2022
@saschanaz saschanaz deleted the window-nosupport branch May 7, 2022 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants