mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal.
MozReview-Commit-ID: 7wH5XcILVmX
This commit is contained in:
parent
e1eff691f8
commit
992f7dddf4
35 changed files with 1465 additions and 901 deletions
|
@ -6,6 +6,8 @@
|
|||
|
||||
use owning_ref::{OwningRef, StableAddress};
|
||||
use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
|
||||
use std::fmt;
|
||||
use std::fmt::Debug;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
/// Container type providing RefCell-like semantics for objects shared across
|
||||
|
@ -50,6 +52,18 @@ impl<'a, T> DerefMut for AtomicRefMut<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, T: 'a + Debug> Debug for AtomicRef<'a, T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:?}", self.0.deref())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: 'a + Debug> Debug for AtomicRefMut<'a, T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:?}", self.0.deref())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> AtomicRefCell<T> {
|
||||
pub fn new(value: T) -> Self {
|
||||
AtomicRefCell(RwLock::new(value))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue