Commit ce07f31c authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Reland "Reenable scroll-animations/element-based-offset tests"

The patch fixes the underlying problem in the element-based-offset
tests, whereby a scroll timeline can be created before layout resulting
in a zero scroll range.  This patch adds a forced layout.

Revert CL: https://chromium-review.googlesource.com/c/chromium/src/+/2483585

Bug: 1080609
Change-Id: I44c6186f535e713d49a9ce6cab4d6aa68c302889
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2484267Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818480}
parent 6197b1d2
...@@ -145,7 +145,7 @@ virtual/composite-after-paint/paint/frames/* [ Pass ] ...@@ -145,7 +145,7 @@ virtual/composite-after-paint/paint/frames/* [ Pass ]
virtual/composite-after-paint/scrollingcoordinator/* [ Pass ] virtual/composite-after-paint/scrollingcoordinator/* [ Pass ]
# --- End CompositeAfterPaint Tests -- # --- End CompositeAfterPaint Tests --
# --- BEGIN OOP-R Canvas tests --- # --- BEGIN OOP-R Canvas tests ---
crbug.com/1081534 [ Win7 ] virtual/oopr-canvas2d/fast/canvas/canvas-composite-video-shadow.html [ Pass Failure ] crbug.com/1081534 [ Win7 ] virtual/oopr-canvas2d/fast/canvas/canvas-composite-video-shadow.html [ Pass Failure ]
crbug.com/1081534 [ Win ] virtual/oopr-canvas2d/fast/canvas/canvas-clearRect-first.html [ Failure ] crbug.com/1081534 [ Win ] virtual/oopr-canvas2d/fast/canvas/canvas-clearRect-first.html [ Failure ]
crbug.com/1081534 [ Win ] virtual/oopr-canvas2d/fast/canvas/canvas-clearRect-with-clip.html [ Failure ] crbug.com/1081534 [ Win ] virtual/oopr-canvas2d/fast/canvas/canvas-clearRect-with-clip.html [ Failure ]
...@@ -6118,9 +6118,6 @@ crbug.com/1011811 http/tests/devtools/network/network-xhr-data-received-async-re ...@@ -6118,9 +6118,6 @@ crbug.com/1011811 http/tests/devtools/network/network-xhr-data-received-async-re
crbug.com/1011811 http/tests/devtools/network/download.js [ Pass Failure ] crbug.com/1011811 http/tests/devtools/network/download.js [ Pass Failure ]
crbug.com/1011811 http/tests/devtools/sxg/sxg-disable-cache.js [ Pass Failure ] crbug.com/1011811 http/tests/devtools/sxg/sxg-disable-cache.js [ Pass Failure ]
crbug.com/1080609 virtual/threaded/external/wpt/scroll-animations/element-based-offset.html [ Pass Failure ]
crbug.com/1080609 virtual/threaded/external/wpt/scroll-animations/element-based-offset-clamp.html [ Pass Failure ]
# Fails when test moved to use full compositor pipe. # Fails when test moved to use full compositor pipe.
crbug.com/1085832 [ Fuchsia ] images/size-failure.html [ Timeout ] crbug.com/1085832 [ Fuchsia ] images/size-failure.html [ Timeout ]
......
...@@ -7,25 +7,19 @@ ...@@ -7,25 +7,19 @@
<script src="testcommon.js"></script> <script src="testcommon.js"></script>
<style> <style>
/*
* Overflow hidden prevents user scroll including mouse wheel; however, the
* element is still a scrollable container and can be scrolled programmatically.
* Removing the visible scrollbars in this manner simplifies the position
* calculations in the text.
*/
.scroller { .scroller {
overflow: scroll; overflow: hidden;
height: 500px; height: 500px;
width: 500px; width: 500px;
will-change: transform; will-change: transform;
} }
/* Disable scrollbars to simplify the calculations in the test. */
.scroller {
scrollbar-width: 0;
}
/*
Chrome does not support scrollbar-width so we use this non-standard property
until it does.
*/
.scroller::-webkit-scrollbar {
display: none;
}
.contents { .contents {
height: 1200px; height: 1200px;
width: 1200px; width: 1200px;
...@@ -82,6 +76,10 @@ until it does. ...@@ -82,6 +76,10 @@ until it does.
const target = scroller.querySelector("#target"); const target = scroller.querySelector("#target");
// Force layout before creating the scroll timeline to ensure the correct
// scroll range.
target.offsetHeight;
const timeline = createScrollTimeline(t, { const timeline = createScrollTimeline(t, {
scrollSource: scroller, scrollSource: scroller,
orientation: config.orientation, orientation: config.orientation,
...@@ -212,4 +210,4 @@ until it does. ...@@ -212,4 +210,4 @@ until it does.
createScrollAnimationTest(description, config); createScrollAnimationTest(description, config);
} }
} }
</script> </script>
\ No newline at end of file
...@@ -66,7 +66,11 @@ ...@@ -66,7 +66,11 @@
t.add_cleanup(() => scroller.remove()); t.add_cleanup(() => scroller.remove());
const start = scroller.querySelector("#start"); const start = scroller.querySelector("#start");
const end = scroller.querySelector("#end") const end = scroller.querySelector("#end");
// Force layout to ensure the scroll timeline gets the correct scroll
// range.
start.offsetHeight;
const timeline = createScrollTimeline(t, { const timeline = createScrollTimeline(t, {
scrollSource: scroller, scrollSource: scroller,
...@@ -202,4 +206,4 @@ ...@@ -202,4 +206,4 @@
createScrollAnimationTest(description, config); createScrollAnimationTest(description, config);
} }
} }
</script> </script>
\ No newline at end of file
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