Commit ec64ebb5 authored by Kaan Alsan's avatar Kaan Alsan Committed by Commit Bot

Update scroll-margin WPT to stop flakiness

Updates test 'external/wpt/css/css-scroll-snap/scroll-margin.html' such
that the expected result is consistent. Originally the test's snap
areas were equally distant from the scroll position and therefore the
area chosen was not consistent.

Bug: 964239
Change-Id: I7e8b09719bd526c4e2fb7049131d585ef5e47d8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1799387Reviewed-by: default avatarYi Gu <yigu@chromium.org>
Commit-Queue: Kaan Alsan <alsan@google.com>
Cr-Commit-Position: refs/heads/master@{#698951}
parent c622c006
...@@ -5912,9 +5912,6 @@ crbug.com/963141 [ Mac ] virtual/audio-service/media/video-aspect-ratio.html [ P ...@@ -5912,9 +5912,6 @@ crbug.com/963141 [ Mac ] virtual/audio-service/media/video-aspect-ratio.html [ P
crbug.com/963141 [ Linux ] media/video-object-fit.html [ Pass Failure ] crbug.com/963141 [ Linux ] media/video-object-fit.html [ Pass Failure ]
crbug.com/963141 [ Linux ] virtual/audio-service/media/video-object-fit.html [ Pass Failure ] crbug.com/963141 [ Linux ] virtual/audio-service/media/video-object-fit.html [ Pass Failure ]
# Sheriff 2019-05-17
crbug.com/964239 virtual/threaded/external/wpt/css/css-scroll-snap/scroll-margin.html [ Pass Failure ]
# Workaround for bug; should be removed soon. # Workaround for bug; should be removed soon.
crbug.com/959693 external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.html [ Timeout ] crbug.com/959693 external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.html [ Timeout ]
...@@ -5923,7 +5920,6 @@ crbug.com/972476 std-switch/switch-appearance.html [ Failure ] ...@@ -5923,7 +5920,6 @@ crbug.com/972476 std-switch/switch-appearance.html [ Failure ]
crbug.com/972476 std-switch/switch-appearance-customization.html [ Failure ] crbug.com/972476 std-switch/switch-appearance-customization.html [ Failure ]
# Sheriff 2019-05-20 # Sheriff 2019-05-20
crbug.com/964239 external/wpt/css/css-scroll-snap/scroll-margin.html [ Pass Failure ]
crbug.com/965389 [ Mac ] media/track/track-cue-rendering-position-auto.html [ Pass Failure ] crbug.com/965389 [ Mac ] media/track/track-cue-rendering-position-auto.html [ Pass Failure ]
crbug.com/965389 [ Mac ] virtual/audio-service/media/track/track-cue-rendering-position-auto.html [ Pass Failure ] crbug.com/965389 [ Mac ] virtual/audio-service/media/track/track-cue-rendering-position-auto.html [ Pass Failure ]
......
...@@ -58,14 +58,31 @@ test(() => { ...@@ -58,14 +58,31 @@ test(() => {
test(() => { test(() => {
target.style.left = "0px"; target.style.left = "0px";
target.style.top = "0px"; target.style.top = "0px";
target.style.scrollSnapAlign = "start"; target.style.scrollSnapAlign = "start";
target.style.scrollMargin = "100px";
// Scroll to the position between #target and #another-target elements but // Since the target is at (0px, 0px) in the scroll port, the added margin
// if the scroll-margin 100px contributed to the snap start-aligned snap // should not be considered, and the snap points for this snap area should be
// position it will be farther than #another-target. // the closest points in the scroll port (i.e x=0 or y=0).
scroller.scrollTo(200, 200); target.style.scrollMargin = "200px";
// Distance from target without margin:
// `scroll position (150px, 150px)` - `target position (0px, 0px)`
// = (150px, 150px)
//
// Distance from target with margin:
// `scroll position (150px, 150px)` - [`target position (0px, 0px)` -
// `target margin (200px, 200px)`]
// = (350px, 350px)
//
// Distance from other target:
// `other target position (400px, 400px)` - `scroll position (150px, 150px)`
// = (250px, 250px)
//
// Therefore if the "out-of-scrollport" scroll-margin contributes to the
// calculation, then the other target would be snapped to. However if the
// scroll-margin is not considered, then the (0px, 0px) target should be
// snapped to.
scroller.scrollTo(150, 150);
assert_equals(scroller.scrollLeft, 0); assert_equals(scroller.scrollLeft, 0);
assert_equals(scroller.scrollTop, 0); assert_equals(scroller.scrollTop, 0);
}, "scroll-margin doesn't contribute to the snap position of the element " + }, "scroll-margin doesn't contribute to the snap position of the element " +
......
This is a testharness.js-based test.
PASS Snaps to the positions adjusted by scroll-margin
FAIL scroll-margin doesn't contribute to the snap position of the element if it's outside of the scroll port assert_equals: expected 0 but got 400
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment