Skip to content

Commit 0170fbf

Browse files
mfreed7moz-wptsync-bot
authored andcommittedApr 11, 2022
Bug 1762314 [wpt PR 33437] - Migrate focus handling logic from <popup> to Element [popup 7/7], a=testonly
Automatic update from web-platform-tests Migrate focus handling logic from <popup> to Element [popup 7/7] This moves the focus management stuff out of HTMLPopupElement and into Element, to work with both <popup> and <div popup>. With this CL, all of the WPTs now pass, with the exception of the one for the anchor IDL property, which is an open issue [1]. [1] openui/open-ui#382 Bug: 1307772 Change-Id: I0f475b52b1a14a910d267c7b681327f2e08976ac Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3561291 Reviewed-by: David Baron <dbaron@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#988069} -- wpt-commits: 7e58a49e306020dbc50c235ad093356152b1d72b wpt-pr: 33437

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎testing/web-platform/tests/html/semantics/popups/popup-focus.tentative.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
<button>first button</button>
1212
</div>
1313

14-
<div popup=popup data-test='autofocus popup' autofocus class=should-be-focused>
14+
<div popup=popup data-test='autofocus popup' autofocus tabindex=-1 class=should-be-focused>
1515
<p>This is a popup</p>
1616
</div>
1717

18-
<div popup=popup data-test='autofocus empty popup' autofocus class=should-be-focused></div>
18+
<div popup=popup data-test='autofocus empty popup' autofocus tabindex=-1 class=should-be-focused></div>
1919

20-
<div popup=popup data-test='autofocus popup with button' autofocus class=should-be-focused>
20+
<div popup=popup data-test='autofocus popup with button' autofocus tabindex=-1 class=should-be-focused>
2121
<p>This is a popup</p>
2222
<button>button</button>
2323
</div>
@@ -38,7 +38,7 @@
3838
<button autofocus>second autofocus button</button>
3939
</div>
4040

41-
<div popup=popup autofocus data-test='autofocus popup and multiple autofocus children' class=should-be-focused>
41+
<div popup=popup autofocus tabindex=-1 data-test='autofocus popup and multiple autofocus children' class=should-be-focused>
4242
<p>This is a popup</p>
4343
<button autofocus>autofocus button</button>
4444
<button autofocus>second autofocus button</button>
@@ -129,14 +129,14 @@
129129
button.remove();
130130
});
131131
popup.id = popupId;
132-
button.setAttribute('popup', popupId);
132+
button.setAttribute('triggerpopup', popupId);
133133
priorFocus.focus();
134134
button.click();
135135
assert_equals(document.activeElement, expectedFocusedElement, `${testName} activated by button.click()`);
136136

137137
// Make sure we can directly focus the (already open) popup:
138138
popup.focus();
139-
assert_equals(document.activeElement, popup.hasAttribute('delegatesfocus') ? expectedFocusedElement : popup, `${testName} directly focus with popup.focus()`);
139+
assert_equals(document.activeElement, popup.hasAttribute('tabindex') ? popup : expectedFocusedElement, `${testName} directly focus with popup.focus()`);
140140
popup.hidePopup();
141141
}, "Popup focus test: " + testName);
142142
}

0 commit comments

Comments
 (0)
Please sign in to comment.