Auto merge of #10292 - jdm:cssom, r=jdm

Initial steps for CSSOM

Squashed and rebased #10133.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10292)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-01 04:29:08 +05:30
commit f335586ff5
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;
@ -1724,6 +1725,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))