mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +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 {
|
pub fn can_invoke_script(&self) -> bool {
|
||||||
match self.get_current_parser() {
|
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,
|
None => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[microtasks-and-constructors.html]
|
|
||||||
expected: CRASH
|
|
||||||
bug: https://github.com/servo/servo/issues/19392
|
|
|
@ -1,3 +0,0 @@
|
||||||
[parser-fallsback-to-unknown-element.html]
|
|
||||||
expected: CRASH
|
|
||||||
bug: https://github.com/servo/servo/issues/19392
|
|
Loading…
Add table
Add a link
Reference in a new issue