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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/display-none-change.html

Issue 2858493002: Rename AXObject to AXObjectImpl in modules/ and web/ (Closed)
Patch Set: Reverted unexpected change to blink rename merge helper Created 3 years, 7 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
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 4
5 <button id="button">Button</button> 5 <button id="button">Button</button>
6 <label id="label" for="button" style="display:none" aria-label="AriaLabel">Label </label> 6 <label id="label" for="button" style="display:none" aria-label="AriaLabel">Label </label>
7 7
8 <script> 8 <script>
9 test(function(t){ 9 test(function(t){
10 var axButton = accessibilityController.accessibleElementById("button"); 10 var axButton = accessibilityController.accessibleElementById("button");
11 11
12 // Get the AXObject for the label indirectly, even though it's display:none. 12 // Get the AXObjectImpl for the label indirectly, even though it's display:n one.
13 // Ensure that it's valid. 13 // Ensure that it's valid.
14 var axLabel = axButton.nameElementAtIndex(0); 14 var axLabel = axButton.nameElementAtIndex(0);
15 assert_equals(axLabel.isValid, true); 15 assert_equals(axLabel.isValid, true);
16 assert_equals(axLabel.role, 'AXRole: AXLabel'); 16 assert_equals(axLabel.role, 'AXRole: AXLabel');
17 17
18 // Now un-hide the label. 18 // Now un-hide the label.
19 var label = document.getElementById('label'); 19 var label = document.getElementById('label');
20 label.style.display = "block"; 20 label.style.display = "block";
21 21
22 // Ensure that the previous AXObject we had for the label is now invalid, bu t if 22 // Ensure that the previous AXObjectImpl we had for the label is now invalid , but if
23 // we fetch an AXObject for it, we get a new valid object. 23 // we fetch an AXObjectImpl for it, we get a new valid object.
24 var axLabel2 = axButton.nameElementAtIndex(0); 24 var axLabel2 = axButton.nameElementAtIndex(0);
25 assert_equals(axLabel.isValid, false); 25 assert_equals(axLabel.isValid, false);
26 assert_equals(axLabel2.isValid, true); 26 assert_equals(axLabel2.isValid, true);
27 assert_equals(axLabel2.name, 'AriaLabel'); 27 assert_equals(axLabel2.name, 'AriaLabel');
28 assert_equals(axLabel.isEqual(axLabel2), false); 28 assert_equals(axLabel.isEqual(axLabel2), false);
29 29
30 // Now hide the label again. 30 // Now hide the label again.
31 label.style.display = "none"; 31 label.style.display = "none";
32 32
33 // Check once more: the second AXObject is now invalid, but if we fetch 33 // Check once more: the second AXObjectImpl is now invalid, but if we fetch
34 // an AXObject for the label a third time, we get a valid object again. 34 // an AXObjectImpl for the label a third time, we get a valid object again.
35 var axLabel3 = axButton.nameElementAtIndex(0); 35 var axLabel3 = axButton.nameElementAtIndex(0);
36 assert_equals(axLabel.isValid, false); 36 assert_equals(axLabel.isValid, false);
37 assert_equals(axLabel2.isValid, false); 37 assert_equals(axLabel2.isValid, false);
38 assert_equals(axLabel3.isValid, true); 38 assert_equals(axLabel3.isValid, true);
39 assert_equals(axLabel3.role, 'AXRole: AXLabel'); 39 assert_equals(axLabel3.role, 'AXRole: AXLabel');
40 assert_equals(axLabel.isEqual(axLabel3), false); 40 assert_equals(axLabel.isEqual(axLabel3), false);
41 assert_equals(axLabel2.isEqual(axLabel3), false); 41 assert_equals(axLabel2.isEqual(axLabel3), false);
42 }, "Accessibility objects for display:none elements"); 42 }, "Accessibility objects for display:none elements");
43 43
44 if (window.testRunner) 44 if (window.testRunner)
45 document.getElementById('button').style.display = 'none'; 45 document.getElementById('button').style.display = 'none';
46 </script> 46 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698