aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/scroll-animations/testcommon.js
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-06-09 23:51:15 -0400
committerGitHub <noreply@github.com>2020-06-09 23:51:15 -0400
commit1a561242cfca27b51d31bf63509cbc95044b69d4 (patch)
treed90b9d6b03ca1b4c218b3aa1163fad84ee311cad /tests/wpt/web-platform-tests/scroll-animations/testcommon.js
parent0b0ea17dca72d867b56ddf518240e25f30d93f3e (diff)
parent4c6f01b60a3093071a9b39cb92db303d280d28dc (diff)
downloadservo-1a561242cfca27b51d31bf63509cbc95044b69d4.tar.gz
servo-1a561242cfca27b51d31bf63509cbc95044b69d4.zip
Auto merge of #26831 - servo-wpt-sync:wpt_update_09-06-2020, r=jdm
Sync WPT with upstream (09-06-2020) Automated downstream sync of changes from upstream as of 09-06-2020. [no-wpt-sync] r? @servo-wpt-sync
Diffstat (limited to 'tests/wpt/web-platform-tests/scroll-animations/testcommon.js')
-rw-r--r--tests/wpt/web-platform-tests/scroll-animations/testcommon.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/scroll-animations/testcommon.js b/tests/wpt/web-platform-tests/scroll-animations/testcommon.js
index 96bafdb396b..d9fc153887c 100644
--- a/tests/wpt/web-platform-tests/scroll-animations/testcommon.js
+++ b/tests/wpt/web-platform-tests/scroll-animations/testcommon.js
@@ -7,6 +7,19 @@ function createScroller(test) {
return scroller;
}
+function createScrollerWithStartAndEnd(test, orientationClass = 'vertical') {
+ var scroller = createDiv(test);
+ scroller.innerHTML =
+ `<div class='contents'>
+ <div id='start'></div>
+ <div id='end'></div>
+ </div>`;
+ scroller.classList.add('scroller');
+ scroller.classList.add(orientationClass);
+
+ return scroller;
+}
+
function createScrollTimeline(test, options) {
options = options || {
scrollSource: createScroller(test),
@@ -33,3 +46,12 @@ function createScrollLinkedAnimation(test, timeline) {
return new Animation(
new KeyframeEffect(createDiv(test), KEYFRAMES, DURATION), timeline);
}
+
+function assert_approx_equals_or_null(actual, expected, tolerance, name){
+ if (actual === null || expected === null){
+ assert_equals(actual, expected, name);
+ }
+ else {
+ assert_approx_equals(actual, expected, tolerance, name);
+ }
+}