Add stub CSS2Properties type.

This commit is contained in:
Josh Matthews 2014-09-18 12:53:04 -04:00
parent 1c5d58180d
commit 4da0ca8ace
4 changed files with 82 additions and 1 deletions

View file

@ -0,0 +1,64 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::CSS2PropertiesBinding::CSS2PropertiesMethods;
use dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
use dom::bindings::codegen::InheritTypes::CSSStyleDeclarationCast;
use dom::bindings::utils::{Reflectable, Reflector};
use dom::bindings::js::JSRef;
use dom::cssstyledeclaration::CSSStyleDeclaration;
use servo_util::str::DOMString;
#[dom_struct]
pub struct CSS2Properties {
declaration: CSSStyleDeclaration,
}
impl<'a> CSS2PropertiesMethods for JSRef<'a, CSS2Properties> {
fn Color(self) -> DOMString {
"".to_string()
}
fn SetColor(self, _value: DOMString) {
}
fn Background(self) -> DOMString {
"".to_string()
}
fn SetBackground(self, _value: DOMString) {
}
fn Display(self) -> DOMString {
"".to_string()
}
fn SetDisplay(self, _value: DOMString) {
}
fn Width(self) -> DOMString {
"".to_string()
}
fn SetWidth(self, _value: DOMString) {
}
fn Height(self) -> DOMString {
"".to_string()
}
fn SetHeight(self, _value: DOMString) {
}
fn IndexedGetter(self, index: u32, found: &mut bool) -> DOMString {
let decl: JSRef<CSSStyleDeclaration> = CSSStyleDeclarationCast::from_ref(self);
decl.IndexedGetter(index, found)
}
}
impl Reflectable for CSS2Properties {
fn reflector<'a>(&'a self) -> &'a Reflector {
self.declaration.reflector()
}
}

View file

@ -65,4 +65,3 @@ impl Reflectable for CSSStyleDeclaration {
&self.reflector_
}
}

View file

@ -0,0 +1,17 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://dev.w3.org/csswg/cssom/
*
*/
interface CSS2Properties : CSSStyleDeclaration {
[TreatNullAs=EmptyString] attribute DOMString color;
[TreatNullAs=EmptyString] attribute DOMString display;
[TreatNullAs=EmptyString] attribute DOMString background;
[TreatNullAs=EmptyString] attribute DOMString width;
[TreatNullAs=EmptyString] attribute DOMString height;
};

View file

@ -88,6 +88,7 @@ pub mod dom {
pub mod browsercontext;
pub mod canvasrenderingcontext2d;
pub mod characterdata;
pub mod css2properties;
pub mod cssstyledeclaration;
pub mod domrect;
pub mod domrectlist;