mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Introduce ServoParser::document
This commit is contained in:
parent
ea27f9d5ec
commit
27f245e6ae
4 changed files with 36 additions and 39 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue