0
Files
src/third_party/blink/web_tests/resize-observer/get-computed-style-in-callback.html
Rakina Zata Amni bbce3cdcdc Change DCHECK in UpdateStyleAndLayoutTreeForNode to check !InStyleRecalc()
UpdateStyleAndLayoutTreeForNode should not be called from within a
normal lifecycle update because it also updates things in display locked
subtrees - it should only be called for forced style calculations.

However, scripts that do forced style calculations might actually run
from within a lifecycle update (for example, in a ResizeObserver callback),
hitting the DCHECK. As there's no easy way to differentiate the cases,
we're changing DCHECK in this CL to just check that we're not in style
recalc phase of the lifecycle update.

Bug: 963062
Change-Id: Ib3692960b008043057b27180f57447966e6127e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614337
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660729}
2019-05-17 04:43:30 +00:00

16 lines
517 B
HTML

<!doctype HTML>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="sizeChangingDiv"></div>
<script>
test(() => {
document.body.offsetTop;
const resizeObserver = new ResizeObserver(() => assert_equals(getComputedStyle(document.body).height, "123px"));
resizeObserver.observe(sizeChangingDiv);
sizeChangingDiv.style.height = "123px";
}, "getComputedStyle gets up-to-date style when called from within a ResizeObserver callback");
</script>