Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Make ResizeObserver and IntersectionObserver timing match other browsers
https://bugs.webkit.org/show_bug.cgi?id=245946 Reviewed by Simon Fraser. Run IntersectionObservers after ResizeObservers to match Blink and Gecko. Imported the test from web-platform-tests/wpt#36216 * LayoutTests/imported/w3c/web-platform-tests/resize-observer/ordering-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/resize-observer/ordering.html: Added. * Source/WebCore/page/Page.cpp: (WebCore::Page::updateRendering): Canonical link: https://commits.webkit.org/255132@main
- Loading branch information
Showing
3 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS ResizeObserver and IntersectionObserver ordering | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!doctype html> | ||
<title>ResizeObserver and IntersectionObserver ordering</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
async_test(function(t) { | ||
let sawResize = false; | ||
let sawIo = false; | ||
let resizeObserver = new ResizeObserver(t.step_func(function() { | ||
assert_false(sawIo, "ResizeObserver notification should be delivered before IntersectionObserver notification"); | ||
sawResize = true; | ||
resizeObserver.disconnect(); | ||
})); | ||
|
||
let io = new IntersectionObserver(t.step_func_done(function() { | ||
assert_true(sawResize, "IntersectionObserver notification should be delivered after ResizeObserver notification"); | ||
sawIo = true; | ||
io.disconnect(); | ||
})); | ||
|
||
resizeObserver.observe(document.documentElement); | ||
io.observe(document.documentElement); | ||
}); | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters