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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/spin-button-bounds.html

Issue 2287433003: Get rid of remaining uses of AXObject::elementRect (Closed)
Patch Set: Rebase Created 4 years, 3 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 <input id="spin" type="number" min=0 max=10 value=0 style="position: absolute; l eft: 100px; top: 50px; width: 300px; height: 20px;">
6
7 <script>
8 test(function(t) {
9 var axSpin = accessibilityController.accessibleElementById("spin");
10 assert_equals(axSpin.role, "AXRole: AXSpinButton");
11
12 var axSpinUp = axSpin.childAtIndex(1).childAtIndex(0);
13 assert_equals(axSpinUp.role, "AXRole: AXButton");
14
15 var axSpinDown = axSpin.childAtIndex(1).childAtIndex(1);
16 assert_equals(axSpinDown.role, "AXRole: AXButton");
17
18 // The buttons should be near the right edge of the parent.
19 assert_true(Math.abs(axSpinUp.x + axSpinUp.width - (axSpin.x + axSpin.width)) < 5);
20 assert_true(Math.abs(axSpinDown.x + axSpinDown.width - (axSpin.x + axSpin.widt h)) < 5);
21
22 // The buttons should be small.
23 assert_true(axSpinUp.width < 30);
24 assert_true(axSpinUp.height < 30);
25 assert_true(axSpinDown.width < 30);
26 assert_true(axSpinDown.height < 30);
27 }, "Test bounds of spin thumb");
28 </script>
29
30 </body>
31 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698