Introduce ServoParser::document

This commit is contained in:
Anthony Ramine 2016-10-08 14:02:41 +02:00
parent ea27f9d5ec
commit 27f245e6ae
4 changed files with 36 additions and 39 deletions

View file

@ -3,16 +3,25 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::reflector::Reflector;
use dom::bindings::js::JS;
use dom::document::Document;
#[dom_struct]
pub struct ServoParser {
reflector: Reflector,
/// The document associated with this parser.
document: JS<Document>,
}
impl ServoParser {
pub fn new_inherited() -> Self {
pub fn new_inherited(document: &Document) -> Self {
ServoParser {
reflector: Reflector::new(),
document: JS::from_ref(document),
}
}
pub fn document(&self) -> &Document {
&self.document
}
}