|
11 | 11 | <button>first button</button>
|
12 | 12 | </div>
|
13 | 13 |
|
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> |
15 | 15 | <p>This is a popup</p>
|
16 | 16 | </div>
|
17 | 17 |
|
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> |
19 | 19 |
|
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> |
21 | 21 | <p>This is a popup</p>
|
22 | 22 | <button>button</button>
|
23 | 23 | </div>
|
|
38 | 38 | <button autofocus>second autofocus button</button>
|
39 | 39 | </div>
|
40 | 40 |
|
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> |
42 | 42 | <p>This is a popup</p>
|
43 | 43 | <button autofocus>autofocus button</button>
|
44 | 44 | <button autofocus>second autofocus button</button>
|
|
129 | 129 | button.remove();
|
130 | 130 | });
|
131 | 131 | popup.id = popupId;
|
132 |
| - button.setAttribute('popup', popupId); |
| 132 | + button.setAttribute('triggerpopup', popupId); |
133 | 133 | priorFocus.focus();
|
134 | 134 | button.click();
|
135 | 135 | assert_equals(document.activeElement, expectedFocusedElement, `${testName} activated by button.click()`);
|
136 | 136 |
|
137 | 137 | // Make sure we can directly focus the (already open) popup:
|
138 | 138 | 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()`); |
140 | 140 | popup.hidePopup();
|
141 | 141 | }, "Popup focus test: " + testName);
|
142 | 142 | }
|
|
0 commit comments