mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Replace RwLock<StyleRule> with Locked<StyleRule>
This commit is contained in:
parent
57724e5a37
commit
aeffca2a59
33 changed files with 279 additions and 334 deletions
|
@ -177,3 +177,23 @@ pub trait ToCssWithGuard {
|
|||
s
|
||||
}
|
||||
}
|
||||
|
||||
/// Guards for a document
|
||||
#[derive(Clone)]
|
||||
pub struct ReadGuards<'a> {
|
||||
/// For author-origin stylesheets
|
||||
pub author: &'a SharedRwLockReadGuard<'a>,
|
||||
|
||||
/// For user-agent-origin and user-origin stylesheets
|
||||
pub ua_or_user: &'a SharedRwLockReadGuard<'a>,
|
||||
}
|
||||
|
||||
impl<'a> ReadGuards<'a> {
|
||||
/// Same guard for all origins
|
||||
pub fn same(guard: &'a SharedRwLockReadGuard<'a>) -> Self {
|
||||
ReadGuards {
|
||||
author: guard,
|
||||
ua_or_user: guard,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue