mirror of
https://github.com/servo/servo.git
synced 2025-09-10 15:08:21 +01:00
Update web-platform-tests to revision e1942ace5be3a3962f204e630e9969acd70e3952
This commit is contained in:
parent
e6cf68704e
commit
69d6c85949
108 changed files with 3217 additions and 530 deletions
|
@ -0,0 +1,31 @@
|
|||
<!doctype html>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<link rel="author" title="Mozilla" href="https://mozilla.org">
|
||||
<link rel="help" href="https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-rootmargin">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1553673">
|
||||
<style>
|
||||
html { width: 100vw; height: 100vh }
|
||||
</style>
|
||||
<script>
|
||||
const t = async_test("IntersectionObserver root margin cannot end up with negative rect (and thus non-intersecting) due to rounding");
|
||||
|
||||
let remainingTests = 100;
|
||||
|
||||
// This is just a best-effort test to catch issues.
|
||||
for (let i = 0; i < 100; ++i) {
|
||||
let offset = i / 100;
|
||||
let observer;
|
||||
observer = new IntersectionObserver(t.step_func(function(entries) {
|
||||
assert_equals(entries.length, 1);
|
||||
assert_equals(entries[0].target, document.documentElement);
|
||||
assert_true(entries[0].isIntersecting, "should be intersecting at " + offset);
|
||||
if (!--remainingTests)
|
||||
t.done();
|
||||
observer.disconnect();
|
||||
}), { rootMargin: `${-100 * (1 - offset)}% 0px ${-100 * offset}%` });
|
||||
observer.observe(document.documentElement);
|
||||
}
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue