diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2013-11-09 21:39:39 -0800 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2013-11-18 11:24:11 -0800 |
commit | 155befe10dc56cfb2dfbf0cca7b652293dba9753 (patch) | |
tree | 43c3e51689cd42a3fb623eda84740f49dd667f5e /src/components/script/layout_interface.rs | |
parent | 37f9427b6c53b90234e82d219217a97c10811243 (diff) | |
download | servo-155befe10dc56cfb2dfbf0cca7b652293dba9753.tar.gz servo-155befe10dc56cfb2dfbf0cca7b652293dba9753.zip |
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.
Diffstat (limited to 'src/components/script/layout_interface.rs')
-rw-r--r-- | src/components/script/layout_interface.rs | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/components/script/layout_interface.rs b/src/components/script/layout_interface.rs index 348594ca162..3d9cc5e96e2 100644 --- a/src/components/script/layout_interface.rs +++ b/src/components/script/layout_interface.rs @@ -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. |