mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
auto merge of #3718 : juzer10/servo/master, r=jdm
We have created parser trait and declared parse_chunk function in this trait. We are yet to implement this parse_chunk for ServoHTMLParser struct.
This commit is contained in:
commit
5858fccf87
4 changed files with 26 additions and 7 deletions
|
@ -14,6 +14,7 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
|||
use dom::node::TrustedNodeAddress;
|
||||
use dom::document::{Document, DocumentHelpers};
|
||||
use parse::html::JSMessage;
|
||||
use parse::Parser;
|
||||
|
||||
use servo_util::task_state;
|
||||
|
||||
|
@ -43,6 +44,15 @@ pub struct ServoHTMLParser {
|
|||
tokenizer: DOMRefCell<Tokenizer>,
|
||||
}
|
||||
|
||||
impl Parser for ServoHTMLParser{
|
||||
fn parse_chunk(&self, input: String) {
|
||||
self.tokenizer().borrow_mut().feed(input);
|
||||
}
|
||||
fn finish(&self){
|
||||
self.tokenizer().borrow_mut().end();
|
||||
}
|
||||
}
|
||||
|
||||
impl ServoHTMLParser {
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(js_chan: Sender<JSMessage>, base_url: Option<Url>, document: JSRef<Document>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue