queue event instead of immediately fire

created checks to see if parser is in use before event dispatch

changed tests to expect crash and added async style test
This commit is contained in:
ddh 2017-11-20 23:07:10 +00:00
parent 462409ada5
commit 79d896d474
9 changed files with 72 additions and 3 deletions

View file

@ -102,6 +102,10 @@ enum LastChunkState {
}
impl ServoParser {
pub fn parser_is_not_active(&self) -> bool {
self.can_write() || self.tokenizer.try_borrow_mut().is_ok()
}
pub fn parse_html_document(document: &Document, input: DOMString, url: ServoUrl) {
let parser = if PREFS.get("dom.servoparser.async_html_tokenizer.enabled").as_boolean().unwrap() {
ServoParser::new(document,