mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Converted serialization methods to implement the to_css trait, writing to string buffers to save string allocations for every result
This commit is contained in:
parent
0985d7563f
commit
51e642e875
4 changed files with 132 additions and 46 deletions
|
@ -10,7 +10,7 @@ use dom::bindings::js::{JS, Root};
|
|||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::element::{Element, StylePriority};
|
||||
use dom::node::{Node, NodeDamage, window_from_node};
|
||||
use dom::node::{Node, window_from_node};
|
||||
use dom::window::Window;
|
||||
use std::ascii::AsciiExt;
|
||||
use string_cache::Atom;
|
||||
|
@ -147,7 +147,8 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
|
|||
|
||||
// Step 2.3
|
||||
let list = list.iter().map(|x| &*x).collect::<Vec<_>>();
|
||||
return DOMString::from(shorthand.serialize_shorthand(&list));
|
||||
let serialized_value = shorthand.serialize_shorthand_to_string(&list);
|
||||
return DOMString::from(serialized_value);
|
||||
}
|
||||
|
||||
// Step 3 & 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue