mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Introduce PendingScript
This moves scripts' loading results in Document, instead of maintaining them behind a DOMRefCell in each HTMLScriptElement.
This commit is contained in:
parent
965370c0bf
commit
30f0553ac7
8 changed files with 193 additions and 82 deletions
|
@ -19,7 +19,7 @@ use dom::element::Element;
|
|||
use dom::globalscope::GlobalScope;
|
||||
use dom::htmlformelement::HTMLFormElement;
|
||||
use dom::htmlimageelement::HTMLImageElement;
|
||||
use dom::htmlscriptelement::HTMLScriptElement;
|
||||
use dom::htmlscriptelement::{HTMLScriptElement, ScriptResult};
|
||||
use dom::node::{Node, NodeSiblingIterator};
|
||||
use dom::text::Text;
|
||||
use encoding::all::UTF_8;
|
||||
|
@ -171,7 +171,7 @@ impl ServoParser {
|
|||
/// ^
|
||||
/// insertion point
|
||||
/// ```
|
||||
pub fn resume_with_pending_parsing_blocking_script(&self, script: &HTMLScriptElement) {
|
||||
pub fn resume_with_pending_parsing_blocking_script(&self, script: &HTMLScriptElement, result: ScriptResult) {
|
||||
assert!(self.suspended.get());
|
||||
self.suspended.set(false);
|
||||
|
||||
|
@ -184,7 +184,7 @@ impl ServoParser {
|
|||
assert_eq!(script_nesting_level, 0);
|
||||
|
||||
self.script_nesting_level.set(script_nesting_level + 1);
|
||||
script.execute();
|
||||
script.execute(result);
|
||||
self.script_nesting_level.set(script_nesting_level);
|
||||
|
||||
if !self.suspended.get() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue