Commit 06cf1d55 authored by Stefan Zager's avatar Stefan Zager Committed by Commit Bot

Fix invalidation when render throttling status changes

For same-process iframes, the render throttling status gets updated
immediately after a lifecycle update, in
LocalFrameView::UpdateViewportIntersectionsForSubtree. That method
does a frame tree walk, so that all descendant frames also get
updated. However, for an OOPIF, throttling status changes happen via
IPC from the embedding page. When that happens, we need to propagate
the change to any same-process descendant frames.

BUG=962382

Change-Id: I30c2c0846d16dadccca4b02056ac696c34594fd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635869Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664582}
parent ac501ccb
......@@ -664,7 +664,7 @@ void WebFrameWidgetImpl::UpdateRenderThrottlingStatus(bool is_throttled,
DCHECK(LocalRootImpl()->Parent());
DCHECK(LocalRootImpl()->Parent()->IsWebRemoteFrame());
LocalRootImpl()->GetFrameView()->UpdateRenderThrottlingStatus(
is_throttled, subtree_throttled);
is_throttled, subtree_throttled, true);
}
WebURL WebFrameWidgetImpl::GetURLForDebugTrace() {
......
<!DOCTYPE html>
<iframe srcdoc="<div>Hello, world!</div>"></iframe>
<script>
self.addEventListener("message", evt => {
let timeout_id = setTimeout(() => {
timeout_id = 0;
evt.source.postMessage("TIMEOUT", "*");
}, 1000);
requestAnimationFrame(() => {
if (timeout_id)
clearTimeout(timeout_id);
evt.source.postMessage("SUCCESS", "*");
});
});
</script>
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>
.spacer {
height: 2000px;
}
</style>
<div class="spacer"></div>
<iframe id="iframe" src="http://localhost:8000/dom/resources/unthrottling-oopif-dirties-subframe-frame.html"></iframe>
<script>
async_test(t => {
let iframe = document.getElementById("iframe");
iframe.addEventListener("load", evt => {
// rAF+timeout to make sure the iframe has been notified that it's throttled.
requestAnimationFrame(() => {
setTimeout(() => {
document.scrollingElement.scrollTop = 10000;
// rAF+timeout to wait for the unthrottling notification to be sent to the iframe.
requestAnimationFrame(() => {
setTimeout(() => {
// Ask the iframe to rAF and respond.
iframe.contentWindow.postMessage("", "*");
});
});
});
});
});
self.addEventListener("message", evt => {
t.step(() => {
assert_not_equals(evt.data, "TIMEOUT", "rAF never ran in iframe; did it get unthrottled?");
assert_equals(evt.data, "SUCCESS", "Unknown failure.");
});
t.done();
});
});
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment