diff --git a/html/semantics/interactive-elements/the-dialog-element/inert-focus-in-frames.html b/html/semantics/interactive-elements/the-dialog-element/inert-focus-in-frames.html
index 12fa96abc2d03b..2ccc13328572c1 100644
--- a/html/semantics/interactive-elements/the-dialog-element/inert-focus-in-frames.html
+++ b/html/semantics/interactive-elements/the-dialog-element/inert-focus-in-frames.html
@@ -37,7 +37,11 @@
let focusedElement = null;
element.addEventListener('focus', function() { focusedElement = element; }, false);
element.focus();
- assert_equals(focusedElement === element, expectFocus, element.id);
+ if (expectFocus) {
+ assert_equals(focusedElement, element, element.id);
+ } else {
+ assert_not_equals(focusedElement, element, element.id);
+ }
}
// Opening a modal dialog in frame1. It blocks other nodes in its document.
@@ -46,7 +50,7 @@
testFocus(frame1.querySelector('.target'), false);
const iframe = frame1.querySelector('#iframe1').contentDocument;
- testFocus(iframe.querySelector('.target'), false);
+ testFocus(iframe.querySelector('.target'), true);
// Even a modal dialog in the iframe is blocked by the modal dialog in the parent frame1.
iframe.querySelector('dialog').showModal();
diff --git a/html/semantics/interactive-elements/the-dialog-element/inertness-with-modal-dialogs-and-iframes.html b/html/semantics/interactive-elements/the-dialog-element/inertness-with-modal-dialogs-and-iframes.html
index ea7d46f98db86c..1a509f7f36579f 100644
--- a/html/semantics/interactive-elements/the-dialog-element/inertness-with-modal-dialogs-and-iframes.html
+++ b/html/semantics/interactive-elements/the-dialog-element/inertness-with-modal-dialogs-and-iframes.html
@@ -4,9 +4,8 @@
+ but only in its document, not in the parent browsing context,
+ nor in nested browsing contexts.">
(main document: outer text)
@@ -103,30 +102,30 @@
checkSelection(window, "(main document: dialog)");
checkSelection(innerIframeWindow, "(inner iframe: outer text)(inner iframe: dialog)");
- checkSelection(outerIframeWindow, "");
-}, "Modal dialog in the main document marks outer nodes as inert. All contents of the outer iframe are also marked as inert.");
+ checkSelection(outerIframeWindow, "(outer iframe: outer text)(outer iframe: dialog)");
+}, "Modal dialog in the main document marks outer nodes as inert. Contents of the outer iframe aren't marked as inert.");
promise_test(async function() {
showModals(this, [innerIframeWindow, window]);
checkSelection(window, "(main document: dialog)");
checkSelection(innerIframeWindow, "(inner iframe: dialog)");
- checkSelection(outerIframeWindow, "");
-}, "Modal dialogs in the main document and inner iframe mark outer nodes as inert. All contents of the outer iframe are also marked as inert.");
+ checkSelection(outerIframeWindow, "(outer iframe: outer text)(outer iframe: dialog)");
+}, "Modal dialogs in the main document and inner iframe mark outer nodes as inert. Contents of the outer iframe aren't marked as inert.");
promise_test(async function() {
showModals(this, [outerIframeWindow, window]);
checkSelection(window, "(main document: dialog)");
checkSelection(innerIframeWindow, "(inner iframe: outer text)(inner iframe: dialog)");
- checkSelection(outerIframeWindow, "");
-}, "Modal dialogs in the main document and outer iframe mark outer nodes as inert. All contents of the outer iframe are also marked as inert.");
+ checkSelection(outerIframeWindow, "(outer iframe: dialog)");
+}, "Modal dialogs in the main document and outer iframe mark outer nodes as inert. Contents of the outer iframe aren't marked as inert.");
promise_test(async function() {
showModals(this, [innerIframeWindow, outerIframeWindow, window]);
checkSelection(window, "(main document: dialog)");
checkSelection(innerIframeWindow, "(inner iframe: dialog)");
- checkSelection(outerIframeWindow, "");
-}, "Modal dialogs in the main document and both iframes mark outer nodes as inert. All contents of the outer iframe are also marked as inert.");
+ checkSelection(outerIframeWindow, "(outer iframe: dialog)");
+}, "Modal dialogs in the main document and both iframes mark outer nodes as inert. Contents of the outer iframe aren't marked as inert.");