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

@ -1885,6 +1885,13 @@ impl Document {
self.current_parser.get()
}
pub fn can_invoke_script(&self) -> bool {
match self.get_current_parser() {
Some(parser) => parser.parser_is_not_active(),
None => true,
}
}
/// Iterate over all iframes in the document.
pub fn iter_iframes(&self) -> impl Iterator<Item=DomRoot<HTMLIFrameElement>> {
self.upcast::<Node>()