mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #26484 - servo:layout-2020-style-prep, r=SimonSapin
Implement concept of dirty root
This commit is contained in:
commit
79b6758cb9
16 changed files with 294 additions and 97 deletions
|
@ -45,11 +45,12 @@ impl<T> DomRefCell<T> {
|
|||
&mut *self.value.as_ptr()
|
||||
}
|
||||
|
||||
/// Version of the above that we use during restyle while the script thread
|
||||
/// is blocked.
|
||||
pub fn borrow_mut_for_layout(&self) -> RefMut<T> {
|
||||
/// Mutably borrow a cell for layout. Ideally this would use
|
||||
/// `RefCell::try_borrow_mut_unguarded` but that doesn't exist yet.
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn borrow_mut_for_layout(&self) -> &mut T {
|
||||
debug_assert!(thread_state::get().is_layout());
|
||||
self.value.borrow_mut()
|
||||
&mut *self.value.as_ptr()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue