Address review comments.

This commit is contained in:
Josh Matthews 2014-12-12 12:58:42 -05:00
parent 9d82e06e64
commit 3cfe8ab53e
10 changed files with 92 additions and 121 deletions

View file

@ -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)