aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/cell.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/cell.rs')
-rw-r--r--components/script/dom/bindings/cell.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs
index 9ec04e358e5..dabc88284b6 100644
--- a/components/script/dom/bindings/cell.rs
+++ b/components/script/dom/bindings/cell.rs
@@ -94,6 +94,13 @@ impl<T> DOMRefCell<T> {
_ => None,
}
}
+
+ /// Version of the above that we use during restyle while the script task
+ /// is blocked.
+ pub fn borrow_mut_for_layout(&self) -> RefMut<T> {
+ debug_assert!(task_state::get().is_layout());
+ self.value.borrow_mut()
+ }
}
impl<T: JSTraceable> JSTraceable for DOMRefCell<T> {