From 9f74b3bbdb3247d4a89aebc5fa4787bd451ad736 Mon Sep 17 00:00:00 2001 From: Stian Didriksen Date: Sun, 27 May 2018 16:26:46 +0200 Subject: [PATCH 1/5] make tests run in IE and Edge --- tests/web-platform/custom/borders.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/web-platform/custom/borders.html b/tests/web-platform/custom/borders.html index 6f083c96c..c222ed35d 100644 --- a/tests/web-platform/custom/borders.html +++ b/tests/web-platform/custom/borders.html @@ -167,19 +167,21 @@ [8, "end", "end", [{ x: 100, y: 100 }, { x: 145, y: 145 }]], [0, "nearest", "nearest", [{ x: 23, y: 23 }, { x: 0, y: 0 }]], [8, "nearest", undefined, [{ x: 100, y: 100 }, { x: 145, y: 145 }]] -].forEach(([target, block, inline, [outer, inner]]) => { - test(() => { +].forEach(function([target, block, inline, [outer, inner]]) { + test(function() { window.scrollTo(0, 0); - outerContainer.scrollTo(0, 0); - innerContainer.scrollTo(0, 0); - scrollIntoView(tiles[target], {block, inline}); + outerContainer.scrollTop = 0 + outerContainer.scrollLeft = 0 + innerContainer.scrollTop = 0 + innerContainer.scrollLeft = 0 + scrollIntoView(tiles[target], {block: block, inline: inline}); //tiles[target].scrollIntoView({block, inline}); assert_approx_equals(outerContainer.scrollLeft, outer.x, 1, 'outerContainer.scrollLeft'); assert_approx_equals(outerContainer.scrollTop, outer.y, 1, 'outerContainer.scrollTop'); assert_approx_equals(innerContainer.scrollLeft, inner.x, 1, 'innerContainer.scrollLeft'); assert_approx_equals(innerContainer.scrollTop, inner.y, 1, 'innerContainer.scrollTop'); - }, `scrollIntoView(${JSON.stringify({block, inline})})`); + }, 'scrollIntoView('+JSON.stringify({block: block, inline: inline})+')'); }); document.body.classList.remove('running'); From 9e0b4a494d7c3805f9d3342b7cfaa9a4dfa2ad58 Mon Sep 17 00:00:00 2001 From: Stian Didriksen Date: Sun, 27 May 2018 16:34:31 +0200 Subject: [PATCH 2/5] fix identifiers --- tests/web-platform/custom/borders.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/web-platform/custom/borders.html b/tests/web-platform/custom/borders.html index c222ed35d..b2e93a67c 100644 --- a/tests/web-platform/custom/borders.html +++ b/tests/web-platform/custom/borders.html @@ -167,7 +167,12 @@ [8, "end", "end", [{ x: 100, y: 100 }, { x: 145, y: 145 }]], [0, "nearest", "nearest", [{ x: 23, y: 23 }, { x: 0, y: 0 }]], [8, "nearest", undefined, [{ x: 100, y: 100 }, { x: 145, y: 145 }]] -].forEach(function([target, block, inline, [outer, inner]]) { +].forEach(function(test) { + var target = test[0] + var block = test[1] + var inline = test[2] + var outer = test[3][0] + var inner = test[3][1] test(function() { window.scrollTo(0, 0); outerContainer.scrollTop = 0 From a402f7220107e65440ca08e57b29cf49d5443c64 Mon Sep 17 00:00:00 2001 From: Stian Didriksen Date: Sun, 27 May 2018 16:36:28 +0200 Subject: [PATCH 3/5] fix --- tests/web-platform/custom/borders.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/web-platform/custom/borders.html b/tests/web-platform/custom/borders.html index b2e93a67c..55d052f5f 100644 --- a/tests/web-platform/custom/borders.html +++ b/tests/web-platform/custom/borders.html @@ -167,12 +167,12 @@ [8, "end", "end", [{ x: 100, y: 100 }, { x: 145, y: 145 }]], [0, "nearest", "nearest", [{ x: 23, y: 23 }, { x: 0, y: 0 }]], [8, "nearest", undefined, [{ x: 100, y: 100 }, { x: 145, y: 145 }]] -].forEach(function(test) { - var target = test[0] - var block = test[1] - var inline = test[2] - var outer = test[3][0] - var inner = test[3][1] +].forEach(function(suite) { + var target = suite[0]; + var block = suite[1]; + var inline = suite[2]; + var outer = suite[3][0]; + var inner = suite[3][1]; test(function() { window.scrollTo(0, 0); outerContainer.scrollTop = 0 From 3354620f1cef985e7b958c71046bbca85aa61b2d Mon Sep 17 00:00:00 2001 From: Stian Didriksen Date: Sun, 27 May 2018 16:42:33 +0200 Subject: [PATCH 4/5] babel + prettier --- .../css/cssom-view/scrollintoview.html | 78 ++++++++++--------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/tests/web-platform/css/cssom-view/scrollintoview.html b/tests/web-platform/css/cssom-view/scrollintoview.html index 3cc579245..16f739e0b 100644 --- a/tests/web-platform/css/cssom-view/scrollintoview.html +++ b/tests/web-platform/css/cssom-view/scrollintoview.html @@ -22,15 +22,15 @@
\ No newline at end of file From dad8d33e22739368939ffaf7abc909cc97dda167 Mon Sep 17 00:00:00 2001 From: Stian Didriksen Date: Sun, 27 May 2018 16:45:54 +0200 Subject: [PATCH 5/5] grrrr ie --- .../css/cssom-view/scrollintoview.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/web-platform/css/cssom-view/scrollintoview.html b/tests/web-platform/css/cssom-view/scrollintoview.html index 16f739e0b..d6c497ffe 100644 --- a/tests/web-platform/css/cssom-view/scrollintoview.html +++ b/tests/web-platform/css/cssom-view/scrollintoview.html @@ -53,8 +53,8 @@ testScrollIntoView(input); var x = expectedX === "nearest" ? expectedXRight : expectedX; var y = expectedY === "nearest" ? expectedYBottom : expectedY; - assert_approx_equals(window.scrollX, x, 0.5, "scrollX"); - assert_approx_equals(window.scrollY, y, 0.5, "scrollY"); + assert_approx_equals(window.scrollX || window.pageXOffset, x, 0.5, "scrollX"); + assert_approx_equals(window.scrollY || window.pageYOffset, y, 0.5, "scrollY"); }, "scrollIntoView(" + format_input(input) + ") starting at left,top"); test(function() { @@ -62,8 +62,8 @@ testScrollIntoView(input); var x = expectedX === "nearest" ? expectedXRight : expectedX; var y = expectedY === "nearest" ? expectedYTop : expectedY; - assert_approx_equals(window.scrollX, x, 0.5, "scrollX"); - assert_approx_equals(window.scrollY, y, 0.5, "scrollY"); + assert_approx_equals(window.scrollX || window.pageXOffset, x, 0.5, "scrollX"); + assert_approx_equals(window.scrollY || window.pageYOffset, y, 0.5, "scrollY"); }, "scrollIntoView(" + format_input(input) + ") starting at left,bottom"); test(function() { @@ -71,8 +71,8 @@ testScrollIntoView(input); var x = expectedX === "nearest" ? expectedXLeft : expectedX; var y = expectedY === "nearest" ? expectedYBottom : expectedY; - assert_approx_equals(window.scrollX, x, 0.5, "scrollX"); - assert_approx_equals(window.scrollY, y, 0.5, "scrollY"); + assert_approx_equals(window.scrollX || window.pageXOffset, x, 0.5, "scrollX"); + assert_approx_equals(window.scrollY || window.pageYOffset, y, 0.5, "scrollY"); }, "scrollIntoView(" + format_input(input) + ") starting at right,top"); test(function() { @@ -80,8 +80,8 @@ testScrollIntoView(input); var x = expectedX === "nearest" ? expectedXLeft : expectedX; var y = expectedY === "nearest" ? expectedYTop : expectedY; - assert_approx_equals(window.scrollX, x, 0.5, "scrollX"); - assert_approx_equals(window.scrollY, y, 0.5, "scrollY"); + assert_approx_equals(window.scrollX || window.pageXOffset, x, 0.5, "scrollX"); + assert_approx_equals(window.scrollY || window.pageYOffset, y, 0.5, "scrollY"); }, "scrollIntoView(" + format_input(input) + ") starting at right,bottom"); });