OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
3 | 3 |
4 <title>Geometry Interfaces: DOMRect</title> | 4 <title>Geometry Interfaces: DOMRect</title> |
5 <link rel="help" href="https://drafts.fxtf.org/geometry/#domrect"> | 5 <link rel="help" href="https://drafts.fxtf.org/geometry/#domrect"> |
6 <script src="../../resources/testharness.js"></script> | 6 <script src="../../resources/testharness.js"></script> |
7 <script src="../../resources/testharnessreport.js"></script> | 7 <script src="../../resources/testharnessreport.js"></script> |
8 <script src="./resources/geometry-interfaces-test-helpers.js"></script> | 8 <script src="./resources/geometry-interfaces-test-helpers.js"></script> |
9 <script> | 9 <script> |
10 'use strict'; | 10 'use strict'; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 assert_dom_rect_equals(rect, [30, 20, 80, 50, 20, 110, 70, 30]); | 45 assert_dom_rect_equals(rect, [30, 20, 80, 50, 20, 110, 70, 30]); |
46 rect.y = -10; | 46 rect.y = -10; |
47 assert_dom_rect_equals(rect, [30, -10, 80, 50, -10, 110, 40, 30]); | 47 assert_dom_rect_equals(rect, [30, -10, 80, 50, -10, 110, 40, 30]); |
48 rect.width = 20; | 48 rect.width = 20; |
49 assert_dom_rect_equals(rect, [30, -10, 20, 50, -10, 50, 40, 30]); | 49 assert_dom_rect_equals(rect, [30, -10, 20, 50, -10, 50, 40, 30]); |
50 rect.height = 40; | 50 rect.height = 40; |
51 assert_dom_rect_equals(rect, [30, -10, 20, 40, -10, 50, 30, 30]); | 51 assert_dom_rect_equals(rect, [30, -10, 20, 40, -10, 50, 30, 30]); |
52 }, 'DOMRect setter'); | 52 }, 'DOMRect setter'); |
53 | 53 |
54 test(() => { | 54 test(() => { |
| 55 var rect = new DOMRectReadOnly(); |
| 56 assert_dom_rect_equals(rect, [0, 0, 0, 0, 0, 0, 0, 0]); |
| 57 }, 'DOMRectReadOnly constructor without parameter'); |
| 58 |
| 59 test(() => { |
| 60 var rect = new DOMRectReadOnly(10); |
| 61 assert_dom_rect_equals(rect, [10, 0, 0, 0, 0, 10, 0, 10]); |
| 62 }, 'DOMRectReadOnly constructor with x parameter'); |
| 63 |
| 64 test(() => { |
| 65 var rect = new DOMRectReadOnly(10, 20); |
| 66 assert_dom_rect_equals(rect, [10, 20, 0, 0, 20, 10, 20, 10]); |
| 67 }, 'DOMRectReadOnly constructor with x, y parameters'); |
| 68 |
| 69 test(() => { |
| 70 var rect = new DOMRectReadOnly(10, 20, 80); |
| 71 assert_dom_rect_equals(rect, [10, 20, 80, 0, 20, 90, 20, 10]); |
| 72 }, 'DOMRectReadOnly constructor with x, y, width parameters'); |
| 73 |
| 74 test(() => { |
55 var rect = new DOMRectReadOnly(10, 20, 80, 50); | 75 var rect = new DOMRectReadOnly(10, 20, 80, 50); |
56 assert_dom_rect_equals(rect, [10, 20, 80, 50, 20, 90, 70, 10]); | 76 assert_dom_rect_equals(rect, [10, 20, 80, 50, 20, 90, 70, 10]); |
57 }, 'DOMRectReadOnly constructor with x, y, width, height parameters'); | 77 }, 'DOMRectReadOnly constructor with x, y, width, height parameters'); |
58 | 78 |
59 test(() => { | 79 test(() => { |
60 var rect = new DOMRectReadOnly(10, 20, 80, 50); | 80 var rect = new DOMRectReadOnly(10, 20, 80, 50); |
61 assert_readonly(rect, 'x'); | 81 assert_readonly(rect, 'x'); |
62 assert_readonly(rect, 'y'); | 82 assert_readonly(rect, 'y'); |
63 assert_readonly(rect, 'width'); | 83 assert_readonly(rect, 'width'); |
64 assert_readonly(rect, 'height'); | 84 assert_readonly(rect, 'height'); |
65 }, 'DOMRectReadOnly readonly test'); | 85 }, 'DOMRectReadOnly readonly test'); |
66 | 86 |
67 </script> | 87 </script> |
OLD | NEW |