Rewrite flow construction to be incrementalizable and parallelizable.

This replaces flow construction with a strict bottom-up tree traversal,
allowing for parallelism. Each step of the traversal creates a flow or
a `ConstructionItem`, similar to how Gecko works. {ib} splits are
handled by not creating `InlineFlow`s until the containing block is
reached.

This should be able to be incrementalized by storing the `Flow` from
layout to layout, and performing fixups during flow construction
and/or wiping containing blocks in a previous pass.
This commit is contained in:
Patrick Walton 2013-11-09 21:39:39 -08:00
parent 37f9427b6c
commit 155befe10d
24 changed files with 1259 additions and 889 deletions

View file

@ -6,15 +6,16 @@
/// coupling between these two components, and enables the DOM to be placed in a separate crate
/// from layout.
use dom::node::{AbstractNode, ScriptView, LayoutView};
use script_task::{ScriptChan};
use std::comm::{Chan, SharedChan};
use dom::node::{AbstractNode, LayoutDataRef, LayoutView, ScriptView};
use extra::url::Url;
use geom::point::Point2D;
use geom::rect::Rect;
use geom::size::Size2D;
use geom::point::Point2D;
use script_task::{ScriptChan};
use servo_util::geometry::Au;
use std::comm::{Chan, SharedChan};
use style::Stylesheet;
use extra::url::Url;
/// Asynchronous messages that script can send to layout.
///
@ -31,8 +32,19 @@ pub enum Msg {
/// FIXME(pcwalton): As noted below, this isn't very type safe.
QueryMsg(LayoutQuery),
/// Requests that the layout task shut down and exit.
ExitMsg,
/// Destroys layout data associated with a DOM node.
///
/// TODO(pcwalton): Maybe think about batching to avoid message traffic.
ReapLayoutDataMsg(LayoutDataRef),
/// Requests that the layout task enter a quiescent state in which no more messages are
/// accepted except `ExitMsg`. A response message will be sent on the supplied channel when
/// this happens.
PrepareToExitMsg(Chan<()>),
/// Requests that the layout task immediately shut down. There must be no more nodes left after
/// this, or layout will crash.
ExitNowMsg,
}
/// Synchronous messages that script can send to layout.