aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/layout_interface.rs
diff options
context:
space:
mode:
authorTim Kuehn <tkuehn@cmu.edu>2013-06-26 22:42:01 -0700
committerTim Kuehn <tkuehn@cmu.edu>2013-07-01 11:03:31 -0700
commitfba7ec423c99a63bdcbe16029740e7ab4e38c088 (patch)
tree0e8a15014ee5bbf912153e8072c0a5505d3b4ecc /src/components/script/layout_interface.rs
parentfdb0d820a49fac9ae2df623751912adcbe7a119d (diff)
downloadservo-fba7ec423c99a63bdcbe16029740e7ab4e38c088.tar.gz
servo-fba7ec423c99a63bdcbe16029740e7ab4e38c088.zip
add pipeline.rs, modularized pipelines communicating with constellation
Diffstat (limited to 'src/components/script/layout_interface.rs')
-rw-r--r--src/components/script/layout_interface.rs23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/components/script/layout_interface.rs b/src/components/script/layout_interface.rs
index 3a1531b83e6..766c728067b 100644
--- a/src/components/script/layout_interface.rs
+++ b/src/components/script/layout_interface.rs
@@ -30,7 +30,7 @@ pub enum Msg {
/// Performs a synchronous layout request.
///
/// FIXME(pcwalton): As noted below, this isn't very type safe.
- QueryMsg(LayoutQuery, Chan<Result<LayoutResponse,()>>),
+ QueryMsg(LayoutQuery),
/// Routes a message (usually from the compositor) to the appropriate script task
RouteScriptMsg(ScriptMsg),
@@ -42,25 +42,16 @@ pub enum Msg {
/// Synchronous messages that script can send to layout.
pub enum LayoutQuery {
/// Requests the dimensions of the content box, as in the `getBoundingClientRect()` call.
- ContentBoxQuery(AbstractNode<ScriptView>),
+ ContentBoxQuery(AbstractNode<ScriptView>, Chan<Result<ContentBoxResponse, ()>>),
/// Requests the dimensions of all the content boxes, as in the `getClientRects()` call.
- ContentBoxesQuery(AbstractNode<ScriptView>),
+ ContentBoxesQuery(AbstractNode<ScriptView>, Chan<Result<ContentBoxesResponse, ()>>),
/// Requests the node containing the point of interest
- HitTestQuery(AbstractNode<ScriptView>, Point2D<f32>),
+ HitTestQuery(AbstractNode<ScriptView>, Point2D<f32>, Chan<Result<HitTestResponse, ()>>),
}
-/// The reply of a synchronous message from script to layout.
-///
-/// FIXME(pcwalton): This isn't very type safe. Maybe `LayoutQuery` objects should include
-/// response channels?
-pub enum LayoutResponse {
- /// A response to the `ContentBoxQuery` message.
- ContentBoxResponse(Rect<Au>),
- /// A response to the `ContentBoxesQuery` message.
- ContentBoxesResponse(~[Rect<Au>]),
- /// A response to the `HitTestQuery` message.
- HitTestResponse(AbstractNode<LayoutView>),
-}
+pub struct ContentBoxResponse(Rect<Au>);
+pub struct ContentBoxesResponse(~[Rect<Au>]);
+pub struct HitTestResponse(AbstractNode<LayoutView>);
/// Determines which part of the
pub enum DocumentDamageLevel {