Commit 6ebf5965 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@6e56893172d7f8bc833e9859c97ad5e52e9eb937

Using wpt-import in Chromium 91795f43.
With Chromium commits locally applied on WPT:
c19433ef "Reland "[ChromeDriver] Stop using --ignore-certificate-errors""
23748e60 "Change text directive to text="
2f7c5562 "Fetch Metadata: Split `sec-fetch-dest` out from other headers' tests."


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
skobes@chromium.org:
  external/wpt/css/css-scroll-anchoring

NOAUTOREVERT=true
TBR=robertma

No-Export: true
Change-Id: Ic85b734226ce1ce879947a28b9342d63dfbcdcc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847731Reviewed-by: default avatarWPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#703756}
parent 70e0cba3
<!doctype html>
<meta charset="utf-8">
<link rel="help" href="https://drafts.csswg.org/css-scroll-anchoring-1/">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1586909">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#scroller {
overflow: scroll;
height: 500px;
height: 500px;
}
#before {
height: 200px;
}
#anchor {
position: relative;
width: 200px;
height: 200px;
margin-bottom: 500px;
background-color: blue;
top: 0px;
}
</style>
<div id="scroller">
<div id="before">
</div>
<div id="anchor">
</div>
</div>
<script>
async_test(t => {
let scroller = document.querySelector('#scroller');
let before = document.querySelector('#before');
let anchor = document.querySelector('#anchor');
scroller.onscroll = t.step_func(function() {
// Adjust the 'top' of #anchor, which should trigger a suppression
anchor.style.top = '10px';
// Expand #before and make sure we don't apply an adjustment
before.style.height = '300px';
assert_equals(scroller.scrollTop, 200);
t.step_timeout(t.step_func_done(function() {
// Expand #before again and make sure we don't keep #anchor as
// an anchor from the last time.
before.style.height = '600px';
assert_equals(scroller.scrollTop, 200);
}), 0);
});
// Scroll down to select #anchor as a scroll anchor
scroller.scrollTop = 200;
}, 'Positioned ancestors with dynamic changes to offsets trigger scroll suppressions.');
</script>
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