Skip to content

Commit a7738d7

Browse files
committed
Bug 1834519 - Don't throw when popovers/dialogs are in requested state. r=emilio
Update to be in line with spec discussions at whatwg/html#9142 Differential Revision: https://phabricator.services.mozilla.com/D178782 UltraBlame original commit: 39007d3d4f3eee8382115fb59e595de006ceca70
1 parent 166adf9 commit a7738d7

File tree

2 files changed

+58
-42
lines changed

2 files changed

+58
-42
lines changed

dom/html/HTMLDialogElement.cpp

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,36 @@ Open
412412
)
413413
)
414414
{
415+
if
416+
(
417+
!
418+
IsInTopLayer
419+
(
420+
)
421+
)
422+
{
423+
return
424+
;
425+
}
415426
return
427+
aError
428+
.
429+
ThrowInvalidStateError
430+
(
431+
"
432+
Cannot
433+
call
434+
show
435+
(
436+
)
437+
on
438+
an
439+
open
440+
modal
441+
dialog
442+
.
443+
"
444+
)
416445
;
417446
}
418447
if
@@ -632,30 +661,48 @@ aError
632661
{
633662
if
634663
(
635-
!
636-
IsInComposedDoc
664+
Open
665+
(
666+
)
667+
)
668+
{
669+
if
670+
(
671+
IsInTopLayer
637672
(
638673
)
639674
)
640675
{
641676
return
677+
;
678+
}
679+
return
642680
aError
643681
.
644682
ThrowInvalidStateError
645683
(
646684
"
647-
Dialog
648-
element
649-
is
650-
not
651-
connected
685+
Cannot
686+
call
687+
showModal
688+
(
689+
)
690+
on
691+
an
692+
open
693+
non
694+
-
695+
modal
696+
dialog
697+
.
652698
"
653699
)
654700
;
655701
}
656702
if
657703
(
658-
Open
704+
!
705+
IsInComposedDoc
659706
(
660707
)
661708
)
@@ -668,13 +715,9 @@ ThrowInvalidStateError
668715
"
669716
Dialog
670717
element
671-
already
672-
has
673-
an
674-
'
675-
open
676-
'
677-
attribute
718+
is
719+
not
720+
connected
678721
"
679722
)
680723
;

testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-no-throw-requested-state.html.ini

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)