Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout: Fix some particularly bad cases of spurious reflows leading to script thread unresponsiveness. #14418

Merged
merged 5 commits into from Dec 1, 2016

compositing: Only make the compositor responsible for initiating reflow

for CSS transitions and animations, not `requestAnimationFrame()`
callbacks.

In the case of the latter, the script thread will kick off the reflow if
it's necessary, so there's no need for the compositor to do it.

Some pages, like nytimes.com, like to call `requestAnimationFrame()`
without actually mutating the DOM in the callback. We should avoid
reflowing in this case.
  • Loading branch information
pcwalton committed Dec 1, 2016
commit f378f2807e7854ca684a1b959f42426362cbbca0
@@ -1191,10 +1191,13 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}
}

// We still need to tick layout unfortunately, see things like #12749.
let msg = ConstellationMsg::TickAnimation(pipeline_id, AnimationTickType::Layout);
if let Err(e) = self.constellation_chan.send(msg) {
warn!("Sending tick to constellation failed ({}).", e);
// We may need to tick animations in layout. (See #12749.)
let animations_running = self.pipeline_details(pipeline_id).animations_running;
if animations_running {
let msg = ConstellationMsg::TickAnimation(pipeline_id, AnimationTickType::Layout);
if let Err(e) = self.constellation_chan.send(msg) {
warn!("Sending tick to constellation failed ({}).", e);
}
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.