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:
bors-servo 2014-10-29 14:36:45 -06:00
commit 5858fccf87
4 changed files with 26 additions and 7 deletions

View file

@ -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>)