mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Address review comments.
This commit is contained in:
parent
9d82e06e64
commit
3cfe8ab53e
10 changed files with 92 additions and 121 deletions
|
@ -72,13 +72,11 @@ impl<'a> PrivateHTMLElementHelpers for JSRef<'a, HTMLElement> {
|
|||
|
||||
impl<'a> HTMLElementMethods for JSRef<'a, HTMLElement> {
|
||||
fn Style(self) -> Temporary<CSSStyleDeclaration> {
|
||||
if self.style_decl.get().is_none() {
|
||||
self.style_decl.or_init(|| {
|
||||
let global = window_from_node(self).root();
|
||||
let style_props = CSS2Properties::new(*global, self).root();
|
||||
let style_decl: JSRef<CSSStyleDeclaration> = CSSStyleDeclarationCast::from_ref(*style_props);
|
||||
self.style_decl.assign(Some(style_decl));
|
||||
}
|
||||
self.style_decl.get().unwrap()
|
||||
let style_props = CSS2Properties::new(*global, self);
|
||||
CSSStyleDeclarationCast::from_temporary(style_props)
|
||||
})
|
||||
}
|
||||
|
||||
make_getter!(Title)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue