mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement something like CSS value serialization. Fetch actual inline style declarations from owning elements.
This commit is contained in:
parent
2e14b653bf
commit
505e1855a3
8 changed files with 375 additions and 55 deletions
|
@ -10,6 +10,7 @@ use dom::bindings::global;
|
|||
use dom::bindings::js::{JSRef, Temporary};
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::cssstyledeclaration::CSSStyleDeclaration;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::window::Window;
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
|
@ -37,15 +38,15 @@ macro_rules! css_setter(
|
|||
)
|
||||
|
||||
impl CSS2Properties {
|
||||
fn new_inherited() -> CSS2Properties {
|
||||
fn new_inherited(owner: JSRef<HTMLElement>) -> CSS2Properties {
|
||||
CSS2Properties {
|
||||
cssstyledeclaration: CSSStyleDeclaration::new_inherited(),
|
||||
cssstyledeclaration: CSSStyleDeclaration::new_inherited(Some(owner)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(global: &JSRef<Window>) -> Temporary<CSS2Properties> {
|
||||
reflect_dom_object(box CSS2Properties::new_inherited(),
|
||||
global::Window(*global),
|
||||
pub fn new(global: JSRef<Window>, owner: JSRef<HTMLElement>) -> Temporary<CSS2Properties> {
|
||||
reflect_dom_object(box CSS2Properties::new_inherited(owner),
|
||||
global::Window(global),
|
||||
CSS2PropertiesBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue