Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-focus.html

Issue 2428333002: <dialog>: don't focus non-form elements with tabindex < 0 when showModal() is called (Closed)
Patch Set: asdf Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-focus-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../../forms/resources/common.js"></script>
6 <script>
7 description('Tests focus when a modal dialog is opened.');
8
9 function test() {
10 document.getElementById('dialog').showModal();
11 shouldBe('document.activeElement', 'document.querySelector("[tabindex=\'0\'] ")')
12 finishJSTest();
13 }
14
15 jsTestIsAsync = true;
16 window.onload = test;
17 </script>
18 </head>
19 <body>
20 <dialog id="dialog">
21 <div tabindex="-1">Negative tabindex shouldn't be focused</div>
22
23 <!-- TODO(dbeam): add form controls and anchors with negative tabindex.
falken 2016/10/19 06:15:30 Can the TODO include information about when it is
24 <button tabindex="-1">button</button>
25 <a href="#" tabindex="-1">anchor</a>
26 -->
27
28 <dialog>
29 <button autofocus>Focus controls with [autofocus] should be ignored if i nert</button>
30 </dialog>
31
32 <div tabindex="0">A div or custom element with tabindex >= 0 should be focus ed</div>
33
34 <button>Form controls without [autofocus] shouldn't have higher precendence< /button>
35 </dialog>
36 </body>
37 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698