aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/context.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-05-15 15:00:19 -0500
committerGitHub <noreply@github.com>2017-05-15 15:00:19 -0500
commitfa251ec96b445b9ba8439d76e05870a88c2caa0f (patch)
treed4fe49b542c7585a7f9acec508082c8e82f391ef /components/layout/context.rs
parentdfb939629616490af4248c58ec3675244dc10e27 (diff)
parentb0bf2b4bad636acfba66d55571b417ebae795408 (diff)
downloadservo-fa251ec96b445b9ba8439d76e05870a88c2caa0f.tar.gz
servo-fa251ec96b445b9ba8439d76e05870a88c2caa0f.zip
Auto merge of #16295 - jdm:transition-safety, r=nox
Root nodes for the duration of their CSS transitions This ensures that we can pass a node address as part of the asynchronous transition end notification, making it safe to fire the corresponding DOM event on the node from the script thread. Without explicitly rooting this node when the transition starts, we risk the node being GCed before the transition is complete. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14972 - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16295) <!-- Reviewable:end -->
Diffstat (limited to 'components/layout/context.rs')
-rw-r--r--components/layout/context.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/components/layout/context.rs b/components/layout/context.rs
index 214061e276f..8acbc3b254a 100644
--- a/components/layout/context.rs
+++ b/components/layout/context.rs
@@ -15,6 +15,7 @@ use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
use opaque_node::OpaqueNodeMethods;
use parking_lot::RwLock;
use script_layout_interface::{PendingImage, PendingImageState};
+use script_traits::UntrustedNodeAddress;
use servo_url::ServoUrl;
use std::borrow::{Borrow, BorrowMut};
use std::cell::{RefCell, RefMut};
@@ -96,7 +97,11 @@ pub struct LayoutContext<'a> {
/// A list of in-progress image loads to be shared with the script thread.
/// A None value means that this layout was not initiated by the script thread.
- pub pending_images: Option<Mutex<Vec<PendingImage>>>
+ pub pending_images: Option<Mutex<Vec<PendingImage>>>,
+
+ /// A list of nodes that have just initiated a CSS transition.
+ /// A None value means that this layout was not initiated by the script thread.
+ pub newly_transitioning_nodes: Option<Mutex<Vec<UntrustedNodeAddress>>>,
}
impl<'a> Drop for LayoutContext<'a> {