mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
layout: Load Web fonts asynchronously.
Improves page load times significantly. Closes #7343.
This commit is contained in:
parent
9523283c14
commit
9bb6acd690
8 changed files with 216 additions and 35 deletions
|
@ -1219,6 +1219,15 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Synchronously query the layout task for this pipeline
|
||||
// to see if it is idle.
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
let msg = LayoutControlMsg::GetWebFontLoadState(sender);
|
||||
pipeline.layout_chan.0.send(msg).unwrap();
|
||||
if receiver.recv().unwrap() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check the visible rectangle for this pipeline. If the constellation
|
||||
// hasn't received a rectangle for this pipeline yet, then assume
|
||||
// that the output image isn't stable yet.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue