author | Stefan Zager <szager@chromium.org> |
Fri, 05 Oct 2018 14:21:12 +0000 | |
changeset 440065 | 8efa34f3f13352d1a6be479da05fe49810319a16 |
parent 440064 | 045dc67ac4567604c0b05d1cf285a1ebce2ff83f |
child 440066 | 4248f5d3fc599f024dde8c705fe9d809dc40e256 |
push id | 34806 |
push user | nerli@mozilla.com |
push date | Tue, 09 Oct 2018 04:03:56 +0000 |
treeherder | mozilla-central@6a6c984745ef [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | testonly |
bugs | 1495082, 13264, 887974, 1250121, 595190 |
milestone | 64.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
testing/web-platform/tests/intersection-observer/bounding-box.html | file | annotate | diff | comparison | revisions |
--- a/testing/web-platform/tests/intersection-observer/bounding-box.html +++ b/testing/web-platform/tests/intersection-observer/bounding-box.html @@ -8,17 +8,17 @@ pre, #log { position: absolute; top: 0; left: 200px; } #root { overflow: visible; height: 200px; width: 160px; - border: 7px solid black; + border: 8px solid black; } #target { margin: 10px; width: 100px; height: 100px; padding: 10px; background-color: green; } @@ -45,17 +45,40 @@ runTestCycle(function() { assert_equals(entries.length, 0, "No initial notifications."); runTestCycle(step0, "First rAF."); }, "Test that the target's border bounding box is used to calculate intersection."); function step0() { var targetBounds = clientBounds(target); target.style.transform = "translateY(195px)"; runTestCycle(step1, "target.style.transform = 'translateY(195px)'"); - checkLastEntry(entries, 0, targetBounds.concat(0, 0, 0, 0, 8, 182, 8, 222, false)); + checkLastEntry(entries, 0, targetBounds.concat(0, 0, 0, 0, 8, 184, 8, 224, false)); } function step1() { var targetBounds = clientBounds(target); + target.style.transform = "translateY(300px)"; + runTestCycle(step2, "target.style.transform = 'translateY(300px)'"); + checkLastEntry(entries, 1, targetBounds.concat(26, 146, 221, 224, 8, 184, 8, 224, true)); +} + +function step2() { + var targetBounds = clientBounds(target); target.style.transform = ""; - checkLastEntry(entries, 1, targetBounds.concat(25, 145, 220, 222, 8, 182, 8, 222, true)); + target.style.zoom = "2"; + runTestCycle(step3, "target.style.zoom = 2"); + checkLastEntry(entries, 2, targetBounds.concat(0, 0, 0, 0, 8, 184, 8, 224, false)); } + +function step3() { + var targetBounds = clientBounds(target); + var intersectionWidth = ( + 176 // root width including border + -8 // root left border + -20 // target left margin * target zoom + ) / 2; // convert to target's zoom factor. + var intersectionHeight = (216 - 8 - 20) / 2; + var intersectionRect = [targetBounds[0], targetBounds[0] + intersectionWidth, + targetBounds[2], targetBounds[2] + intersectionHeight]; + checkLastEntry(entries, 3, targetBounds.concat(intersectionRect).concat(8, 184, 8, 224, true)); +} + </script>