mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Less cloning and dynamic dispatch.
This commit is contained in:
parent
7d7aac212b
commit
dc829da07e
3 changed files with 63 additions and 40 deletions
|
@ -699,10 +699,11 @@ impl Element {
|
|||
}
|
||||
|
||||
fn sync_property_with_attrs_style(&self) {
|
||||
let mut style_str = String::new();
|
||||
if let &Some(ref declarations) = &*self.style_attribute().borrow() {
|
||||
declarations.to_css(&mut style_str).unwrap();
|
||||
}
|
||||
let style_str = if let &Some(ref declarations) = &*self.style_attribute().borrow() {
|
||||
declarations.to_css_string()
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
|
||||
let new_style = AttrValue::String(style_str);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue