abort parser, if any, when pipeline exits

This commit is contained in:
Gregory Terzian 2019-11-21 23:55:34 +08:00
parent d553158e95
commit 1fab2416d7

View file

@ -2876,6 +2876,12 @@ impl ScriptThread {
}
}
// Abort the parser, if any,
// to prevent any further incoming networking messages from being handled.
if let Some(parser) = document.get_current_parser() {
parser.abort();
}
// We discard the browsing context after requesting layout shut down,
// to avoid running layout on detached iframes.
let window = document.window();