mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Support HTML parser reentrancy (#32820)
* Update parser interface for reentrancy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove assertions around invoking scripts with active parser. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Add regression test. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Run test with normal and async html parser. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
d44c0f7e5d
commit
4df7a1af25
13 changed files with 248 additions and 211 deletions
|
@ -2670,18 +2670,6 @@ impl Document {
|
|||
self.current_parser.get()
|
||||
}
|
||||
|
||||
pub fn can_invoke_script(&self) -> bool {
|
||||
match self.get_current_parser() {
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
||||
/// Iterate over all iframes in the document.
|
||||
pub fn iter_iframes(&self) -> impl Iterator<Item = DomRoot<HTMLIFrameElement>> {
|
||||
self.upcast::<Node>()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue