mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1640336 - Use descriptive error messages for dialog.showModal() r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D77126
This commit is contained in:
parent
f3489ed171
commit
7c966cd62c
@ -83,8 +83,13 @@ void HTMLDialogElement::UnbindFromTree(bool aNullParent) {
|
||||
}
|
||||
|
||||
void HTMLDialogElement::ShowModal(ErrorResult& aError) {
|
||||
if (!IsInComposedDoc() || Open()) {
|
||||
aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
if (!IsInComposedDoc()) {
|
||||
aError.ThrowInvalidStateError("Dialog element is not connected");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Open()) {
|
||||
aError.ThrowInvalidStateError("Dialog element already has an 'open' attribute");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user