mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1609733 [wpt PR 21222] - [IntersectionObserver] Allow Document argument to constructor, a=testonly
Automatic update from web-platform-tests [IntersectionObserver] Allow Document argument to constructor This implements a behavioral change as described in: https://github.com/w3c/IntersectionObserver/issues/372 If the 'root' argument to the IntersectionObserver constructor is a Document, then the observer will clip to the Document's root scroller. For the top Document, this is the same behavior as the implicit root. For an iframe Document, this is new behavior which is unobtainable by other means. BUG=1015183 Change-Id: I234bfce28ab954bb15b8d157bc22ee2d2469d5e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003750 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: vmpstr <vmpstr@chromium.org> Commit-Queue: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/master@{#734268} -- wpt-commits: aebf5e72a429c448637c388512bcadd4d4e3fa65 wpt-pr: 21222
This commit is contained in:
parent
a3a41fba12
commit
e0608393f7
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<title>A height: 100% descendant should trigger a relayout when stretching.</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#definite-sizes" />
|
||||
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1043071" />
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div style="display: flex; width: 100px;">
|
||||
<div style="display: flex; flex-direction: column; flex: 1; min-height: 100px;">
|
||||
<div style="flex: 1; background: red;">
|
||||
<div style="height: 100%; background-color: green;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -28,18 +28,16 @@ iframe.onload = function() {
|
||||
runTestCycle(function() {
|
||||
assert_true(!!iframe, "iframe exists");
|
||||
|
||||
root = iframe.contentDocument.scrollingElement;
|
||||
assert_true(!!root, "Root element exists.");
|
||||
target = iframe.contentDocument.getElementById("target");
|
||||
assert_true(!!target, "Target element exists.");
|
||||
var observer = new IntersectionObserver(function(changes) {
|
||||
entries = entries.concat(changes)
|
||||
}, { root: root });
|
||||
}, { root: iframe.contentDocument });
|
||||
observer.observe(target);
|
||||
entries = entries.concat(observer.takeRecords());
|
||||
assert_equals(entries.length, 0, "No initial notifications.");
|
||||
runTestCycle(step0, "First rAF.");
|
||||
}, "Observer with explicit root which is the document's scrolling element.");
|
||||
}, "Observer with explicit root which is the document.");
|
||||
};
|
||||
|
||||
function step0() {
|
||||
|
Loading…
Reference in New Issue
Block a user