mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Implement CSSStyleRule.style
This commit is contained in:
parent
f6163c77b9
commit
4738ce1af5
6 changed files with 175 additions and 123 deletions
|
@ -13,9 +13,9 @@ use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
|||
use dom::bindings::error::{Error, ErrorResult};
|
||||
use dom::bindings::inheritance::{ElementTypeId, HTMLElementTypeId, NodeTypeId};
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::js::{MutNullableJS, Root, RootedReference};
|
||||
use dom::bindings::js::{JS, MutNullableJS, Root, RootedReference};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration};
|
||||
use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration, CSSStyleOwner};
|
||||
use dom::document::{Document, FocusType};
|
||||
use dom::domstringmap::DOMStringMap;
|
||||
use dom::element::{AttributeMutation, Element};
|
||||
|
@ -115,7 +115,10 @@ impl HTMLElementMethods for HTMLElement {
|
|||
fn Style(&self) -> Root<CSSStyleDeclaration> {
|
||||
self.style_decl.or_init(|| {
|
||||
let global = window_from_node(self);
|
||||
CSSStyleDeclaration::new(&global, self.upcast::<Element>(), None, CSSModificationAccess::ReadWrite)
|
||||
CSSStyleDeclaration::new(&global,
|
||||
CSSStyleOwner::Element(JS::from_ref(self.upcast())),
|
||||
None,
|
||||
CSSModificationAccess::ReadWrite)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue