зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1637090 [wpt PR 23514] - Add state to check if Resize Observer Loop Limit error was dispatched, a=testonly
Automatic update from web-platform-tests Add state to check if Resize Observer Loop Limit error was dispatched Currently, if the resize observer loop limit error is dispatched and the error callback affects layout causing lifecycle state to be < kPrePaintClean, an infinite loop may occur causing unexpected behaviour. To fix this, state is added to the resize observer controller in order to achieve the following flow: - Loop limit error is reached - Error callback causes lifecycle state to be < kPrePaintClean - Lifecycle steps including resize observer steps are run again to move state to kPrePaintClean - Error is not dispatched a second time - Proceed to the paint step Bug: 1076205 Change-Id: I904392d1dc73caf874f3d7ecf572a74422f0ab11 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2189352 Reviewed-by: Philip Rogers <pdr@chromium.org> Reviewed-by: Daniel Libby <dlibby@microsoft.com> Commit-Queue: Sahir Vellani <sahir.vellani@microsoft.com> Cr-Commit-Position: refs/heads/master@{#767841} -- wpt-commits: 166ced72a2f9487dfa477ab79e6616b4fc890fbf wpt-pr: 23514
This commit is contained in:
Родитель
d98a1e674f
Коммит
d570d2f7b9
|
@ -0,0 +1,33 @@
|
|||
<!doctype HTML>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
<div id="observeme"></div>
|
||||
|
||||
<script>
|
||||
setup({allow_uncaught_exception: true});
|
||||
|
||||
async_test(a => {
|
||||
let t = document.querySelector("#observeme");
|
||||
let i = 0;
|
||||
window.onerror = function (err) {
|
||||
t.style.height = "112px";
|
||||
i++;
|
||||
requestAnimationFrame(a.step_func_done(() => {
|
||||
assert_equals(i, 1);
|
||||
}), 0);
|
||||
};
|
||||
|
||||
new ResizeObserver(function() {
|
||||
t.style.height = "111px";
|
||||
}).observe(observeme);
|
||||
observeme.style.height = "110px";
|
||||
|
||||
}, "Changing layout in window error handler should not result in lifecyle loop when resize observer loop limit is reached.");
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче