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

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

Issue 2532983004: Re-work <dialog>#show*() focus algorithm (Closed)
Patch Set: starting to mess with tests Created 4 years 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/inert-node-is-unfocusable.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <script src="../../../resources/js-test.js"></script> 3 <script src="../../../resources/js-test.js"></script>
4 <label for="submit">Label for Submit</label> 4 <label for="submit">Label for Submit</label>
5 <dialog> 5 <dialog>
6 <input id="text" type="text"> 6 <input id="text" type="text">
7 <input id="submit" type="submit"> 7 <input id="submit" type="submit">
8 </dialog> 8 </dialog>
9 <script> 9 <script>
10 function clickOn(element) { 10 function clickOn(element) {
(...skipping 20 matching lines...) Expand all
31 31
32 document.querySelector('dialog').showModal(); 32 document.querySelector('dialog').showModal();
33 document.querySelector('#text').focus(); 33 document.querySelector('#text').focus();
34 34
35 debug('Testing that calling focus() on label sends focus to its target.'); 35 debug('Testing that calling focus() on label sends focus to its target.');
36 label = document.querySelector('label'); 36 label = document.querySelector('label');
37 label.focus(); 37 label.focus();
38 shouldBe('document.activeElement', "document.querySelector('#submit')"); 38 shouldBe('document.activeElement', "document.querySelector('#submit')");
39 39
40 debug('Testing that clicking on the label sends focus to document.body.'); 40 debug('Testing that clicking on the label sends focus to document.body.');
41 clickOn(label); 41 clickOn(label); // this now focuses the dialog instead
42 shouldBe('document.activeElement', 'document.body'); 42 shouldBe('document.activeElement', 'document.body');
43 </script> 43 </script>
44 </html> 44 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698