aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/message.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2017-04-10 17:47:20 +1000
committerJosh Matthews <josh@joshmatthews.net>2017-05-15 14:12:08 -0400
commit913491884431b9030db9a8a0a10011fa03aa2db6 (patch)
tree28e3c549fe542a79cb2c74edd5b28b928a4c1683 /components/script_layout_interface/message.rs
parentc3b9714ab79a8230162605236f7c2f5e247707a7 (diff)
downloadservo-913491884431b9030db9a8a0a10011fa03aa2db6.tar.gz
servo-913491884431b9030db9a8a0a10011fa03aa2db6.zip
Send information to script as part of finishing layout.
This avoids the need for multiple layout RPC operations immediately following return of control to script. This means that layout and script can continue to operate in parallel at this point, rather than one potentially waiting on the shared mutex to be unlocked.
Diffstat (limited to 'components/script_layout_interface/message.rs')
-rw-r--r--components/script_layout_interface/message.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs
index 8b04a131404..9c2f94b0dc0 100644
--- a/components/script_layout_interface/message.rs
+++ b/components/script_layout_interface/message.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use {OpaqueStyleAndLayoutData, TrustedNodeAddress};
+use {OpaqueStyleAndLayoutData, TrustedNodeAddress, PendingImage};
use app_units::Au;
use euclid::point::Point2D;
use euclid::rect::Rect;
@@ -12,7 +12,7 @@ use msg::constellation_msg::PipelineId;
use net_traits::image_cache::ImageCache;
use profile_traits::mem::ReportsChan;
use rpc::LayoutRPC;
-use script_traits::{ConstellationControlMsg, LayoutControlMsg};
+use script_traits::{ConstellationControlMsg, LayoutControlMsg, UntrustedNodeAddress};
use script_traits::{LayoutMsg as ConstellationMsg, StackingContextScrollState, WindowSizeData};
use servo_url::ServoUrl;
use std::sync::Arc;
@@ -109,6 +109,15 @@ pub struct Reflow {
pub page_clip_rect: Rect<Au>,
}
+/// Information derived from a layout pass that needs to be returned to the script thread.
+#[derive(Default)]
+pub struct ReflowComplete {
+ /// The list of images that were encountered that are in progress.
+ pub pending_images: Vec<PendingImage>,
+ /// The list of nodes that initiated a CSS transition.
+ pub newly_transitioning_nodes: Vec<UntrustedNodeAddress>,
+}
+
/// Information needed for a script-initiated reflow.
pub struct ScriptReflow {
/// General reflow data.
@@ -122,19 +131,13 @@ pub struct ScriptReflow {
/// The current window size.
pub window_size: WindowSizeData,
/// The channel that we send a notification to.
- pub script_join_chan: Sender<()>,
+ pub script_join_chan: Sender<ReflowComplete>,
/// The type of query if any to perform during this reflow.
pub query_type: ReflowQueryType,
/// The number of objects in the dom #10110
pub dom_count: u32,
}
-impl Drop for ScriptReflow {
- fn drop(&mut self) {
- self.script_join_chan.send(()).unwrap();
- }
-}
-
pub struct NewLayoutThreadInfo {
pub id: PipelineId,
pub url: ServoUrl,