aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/servoparser/mod.rs
diff options
context:
space:
mode:
authorddh <dianehosfelt@gmail.com>2017-11-20 23:07:10 +0000
committerddh <dianehosfelt@gmail.com>2017-11-30 16:18:57 +0000
commit79d896d4744c347236fbf6916e3a71ddaa670ccb (patch)
treef8c4ca3255ce386ee12ba23662c3af6a487773d6 /components/script/dom/servoparser/mod.rs
parent462409ada54b002689d01c7c7243f0d9fe90df26 (diff)
downloadservo-79d896d4744c347236fbf6916e3a71ddaa670ccb.tar.gz
servo-79d896d4744c347236fbf6916e3a71ddaa670ccb.zip
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
Diffstat (limited to 'components/script/dom/servoparser/mod.rs')
-rw-r--r--components/script/dom/servoparser/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs
index 6947ba5e837..88dd2a740f5 100644
--- a/components/script/dom/servoparser/mod.rs
+++ b/components/script/dom/servoparser/mod.rs
@@ -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,