mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Take throw-on-dynamic-markup-insertion-counter into account when check script safety.
This commit is contained in:
parent
4593195b49
commit
c55f25b3aa
3 changed files with 6 additions and 7 deletions
|
@ -1896,7 +1896,12 @@ impl Document {
|
|||
|
||||
pub fn can_invoke_script(&self) -> bool {
|
||||
match self.get_current_parser() {
|
||||
Some(parser) => parser.parser_is_not_active(),
|
||||
Some(parser) => {
|
||||
// It is safe to run script if the parser is not actively parsing,
|
||||
// or if it is impossible to interact with the token stream.
|
||||
parser.parser_is_not_active() ||
|
||||
self.throw_on_dynamic_markup_insertion_counter.get() > 0
|
||||
}
|
||||
None => true,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue