layout: Load Web fonts asynchronously.

Improves page load times significantly.

Closes #7343.
This commit is contained in:
Patrick Walton 2015-09-10 14:16:50 -07:00
parent 9523283c14
commit 9bb6acd690
8 changed files with 216 additions and 35 deletions

View file

@ -51,6 +51,9 @@ pub enum Msg {
/// Requests that the layout task render the next frame of all animations.
TickAnimations,
/// Requests that the layout task reflow with a newly-loaded Web font.
ReflowWithNewlyLoadedWebFont,
/// Updates the layout visible rects, affecting the area that display lists will be constructed
/// for.
SetVisibleRects(Vec<(LayerId, Rect<Au>)>),
@ -76,6 +79,10 @@ pub enum Msg {
/// Get the last epoch counter for this layout task.
GetCurrentEpoch(IpcSender<Epoch>),
/// Asks the layout task whether any Web fonts have yet to load (if true, loads are pending;
/// false otherwise).
GetWebFontLoadState(IpcSender<bool>),
/// Creates a new layout task.
///
/// This basically exists to keep the script-layout dependency one-way.