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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/aria-modal.html

Issue 2666873005: Implement aria-modal (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4
5 <dialog id="modal-1">
6 <div id="aria-modal-1" role="button" aria-modal="true">
7 </div>
8 <div id="aria-modal-2" role="dialog" aria-modal="false">
9 </div>
10 <div id="aria-modal-3" role="dialog" aria-modal="true">
11 </div>
12 <div id="aria-modal-4" role="alertdialog" aria-modal="true">
13 </div>
14 <dialog id="modal-2">Closed Dialog</dialog>
15 <dialog open id="modal-3">Open Dialog</dialog>
16 <dialog open id="modal-4" aria-modal="true">Open with aria-modal</dialog>
17 </dialog>
18
19 <script>
20 document.getElementById('modal-1').showModal();
21
22 function axElementById(id) {
23 return accessibilityController.accessibleElementById(id);
24 }
25
26 test(function(t) {
27 var axAriaModal1 = axElementById("aria-modal-1");
28 assert_equals(axAriaModal1.isModal, false);
29 }, "A button can't be modal");
30
31 test(function(t) {
32 var axAriaModal2 = axElementById("aria-modal-2");
33 assert_equals(axAriaModal2.isModal, false);
34 }, "An ARIA dialog with aria-modal false is not modal");
35
36 test(function(t) {
37 var axAriaModal3 = axElementById("aria-modal-3");
38 assert_equals(axAriaModal3.isModal, true);
39 }, "An ARIA dialog with aria-modal true is modal");
40
41 test(function(t) {
42 var axAriaModal4 = axElementById("aria-modal-4");
43 assert_equals(axAriaModal4.isModal, true);
44 }, "An ARIA alertdialog with aria-modal true is modal");
45
46 test(function(t) {
47 var axModal1 = axElementById("modal-1");
48 assert_equals(axModal1.isModal, true);
49 }, "An HTML dialog is modal after calling showModal() on it");
50
51 test(function(t) {
52 var axModal2 = axElementById("modal-2");
53 assert_equals(axModal2, undefined);
54 }, "A closed HTML dialog has no accessibility node");
55
56 test(function(t) {
57 var axModal3 = axElementById("modal-3");
58 assert_equals(axModal3.isModal, false);
59 }, "An open HTML dialog is not modal");
60
61 test(function(t) {
62 var axModal4 = axElementById("modal-4");
63 assert_equals(axModal4.isModal, true);
64 }, "An open HTML dialog with aria-modal=true is modal");
65
66 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698