Initial steps for CSSOM API

This commit is contained in:
Mohamed Albashir 2016-03-18 17:32:48 -04:00 committed by Josh Matthews
parent e551ea7322
commit b7a57ef487
15 changed files with 159 additions and 77 deletions

View file

@ -69,6 +69,7 @@ use dom::nodelist::NodeList;
use dom::processinginstruction::ProcessingInstruction;
use dom::range::Range;
use dom::servohtmlparser::{ParserRoot, ParserRef, MutNullableParserField};
use dom::stylesheetlist::StyleSheetList;
use dom::text::Text;
use dom::touch::Touch;
use dom::touchevent::TouchEvent;
@ -1750,6 +1751,11 @@ impl Element {
}
impl DocumentMethods for Document {
// https://drafts.csswg.org/cssom/#dom-document-stylesheets
fn StyleSheets(&self) -> Root<StyleSheetList> {
StyleSheetList::new(&self.window, JS::from_ref(&self))
}
// https://dom.spec.whatwg.org/#dom-document-implementation
fn Implementation(&self) -> Root<DOMImplementation> {
self.implementation.or_init(|| DOMImplementation::new(self))