mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Use Arc<PropertyDeclarationBlock> everwhere it’s appropriate.
This commit is contained in:
parent
c50e6add4a
commit
acc38aa8c2
13 changed files with 85 additions and 68 deletions
|
@ -356,7 +356,7 @@ pub extern "C" fn Servo_StyleSet_Drop(data: *mut RawServoStyleSet) -> () {
|
|||
}
|
||||
|
||||
pub struct GeckoDeclarationBlock {
|
||||
pub declarations: Option<PropertyDeclarationBlock>,
|
||||
pub declarations: Option<Arc<PropertyDeclarationBlock>>,
|
||||
// XXX The following two fields are made atomic to work around the
|
||||
// ownership system so that they can be changed inside a shared
|
||||
// instance. It wouldn't provide safety as Rust usually promises,
|
||||
|
@ -377,7 +377,7 @@ pub extern "C" fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32,
|
|||
-> ServoDeclarationBlockStrong {
|
||||
let value = unsafe { from_utf8_unchecked(slice::from_raw_parts(bytes, length as usize)) };
|
||||
GeckoDeclarationBlock::from_arc(Arc::new(GeckoDeclarationBlock {
|
||||
declarations: GeckoElement::parse_style_attribute(value),
|
||||
declarations: GeckoElement::parse_style_attribute(value).map(Arc::new),
|
||||
cache: AtomicPtr::new(cache),
|
||||
immutable: AtomicBool::new(false),
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue