| Index: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-rect.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-rect.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-rect.html
|
| index 611e2b774797af65c7648d88ac0252efd2fd7604..78e9871a05c686342ed23d02aa099a7e8a04b68a 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-rect.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-rect.html
|
| @@ -57,6 +57,35 @@ test(() => {
|
| }, 'DOMRect setter');
|
|
|
| test(() => {
|
| + var rect = DOMRect.fromRect({x: 10, y: 20, width: 80, height: 50});
|
| + assert_dom_rect_equals(rect, [10, 20, 80, 50, 20, 90, 70, 10]);
|
| +}, 'DOMRect.fromRect({x: 10, y: 20, width: 80, height: 50}) should create a DOMRect');
|
| +
|
| +test(() => {
|
| + var rect = DOMRect.fromRect();
|
| + assert_dom_rect_equals(rect, [0, 0, 0, 0, 0, 0, 0, 0]);
|
| +}, 'DOMRect.fromRect({x: 0, y: 0, width: 0, height: 0}) should create a DOMRect');
|
| +
|
| +test(() => {
|
| + var rect = DOMRect.fromRect({x: 10, y: 20, width: 80, height: 50});
|
| + rect.x = 30;
|
| + assert_dom_rect_equals(rect, [30, 20, 80, 50, 20, 110, 70, 30]);
|
| + rect.y = -10;
|
| + assert_dom_rect_equals(rect, [30, -10, 80, 50, -10, 110, 40, 30]);
|
| + rect.width = 20;
|
| + assert_dom_rect_equals(rect, [30, -10, 20, 50, -10, 50, 40, 30]);
|
| + rect.height = 40;
|
| + assert_dom_rect_equals(rect, [30, -10, 20, 40, -10, 50, 30, 30]);
|
| +}, 'DOMRect.fromRect({x: 10, y: 20, width: 80, height: 50}) should create a DOMRect and the values can be changed');
|
| +
|
| +test(() => {
|
| + var rect1 = DOMRect.fromRect();
|
| + var rect2 = DOMRect.fromRect();
|
| + assert_false(rect1 == rect2);
|
| + assert_dom_rect_equals(rect1, rect2);
|
| +}, 'DOMRect.fromRect() should create a new DOMRect');
|
| +
|
| +test(() => {
|
| var rect = new DOMRectReadOnly();
|
| assert_dom_rect_equals(rect, [0, 0, 0, 0, 0, 0, 0, 0]);
|
| }, 'DOMRectReadOnly constructor without parameter');
|
| @@ -94,4 +123,29 @@ test(() => {
|
| assert_object_equals(rect.toJSON(), {x: 10, y: 20, width: 80, height: 50, top: 20, right: 90, bottom: 70, left: 10});
|
| }, 'DOMRectReadOnly toJSON');
|
|
|
| +test(() => {
|
| + var rect = DOMRectReadOnly.fromRect({x: 10, y: 20, width: 80, height: 50});
|
| + assert_dom_rect_equals(rect, [10, 20, 80, 50, 20, 90, 70, 10]);
|
| +}, 'DOMRectReadOnly.fromRect({x: 10, y: 20, width: 80, height: 50}) should create a DOMRectReadOnly');
|
| +
|
| +test(() => {
|
| + var rect = DOMRectReadOnly.fromRect();
|
| + assert_dom_rect_equals(rect, [0, 0, 0, 0, 0, 0, 0, 0]);
|
| +}, 'DOMRectReadOnly.fromRect({x: 0, y: 0, width: 0, height: 0}) should create a DOMRectReadOnly');
|
| +
|
| +test(() => {
|
| + var rect1 = DOMRectReadOnly.fromRect();
|
| + var rect2 = DOMRectReadOnly.fromRect();
|
| + assert_false(rect1 == rect2);
|
| + assert_dom_rect_equals(rect1, rect2);
|
| +}, 'DOMRectReadOnly.fromRect() should create a new DOMRectReadOnly');
|
| +
|
| +test(() => {
|
| + var rect = DOMRectReadOnly.fromRect();
|
| + assert_readonly(rect, 'x');
|
| + assert_readonly(rect, 'y');
|
| + assert_readonly(rect, 'width');
|
| + assert_readonly(rect, 'height');
|
| +}, "DOMRectReadOnly.fromRect() should create DOMRectReadOnly");
|
| +
|
| </script>
|
|
|