mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Implement a DocumentLoader type that tracks pending loads and notifies the script task when the queue is empty. Dispatch the document load event based on the DocumentLoader's notification.
This commit is contained in:
parent
29a43a00b3
commit
7f0706ed42
11 changed files with 243 additions and 38 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
//! The core DOM types. Defines the basic DOM hierarchy as well as all the HTML elements.
|
||||
|
||||
use document_loader::DocumentLoader;
|
||||
use dom::attr::{Attr, AttrHelpers};
|
||||
use dom::bindings::cell::DOMRefCell;
|
||||
use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
|
||||
|
@ -1711,9 +1712,10 @@ impl Node {
|
|||
false => IsHTMLDocument::NonHTMLDocument,
|
||||
};
|
||||
let window = document.window().root();
|
||||
let loader = DocumentLoader::new(&*document.loader());
|
||||
let document = Document::new(window.r(), Some(document.url()),
|
||||
is_html_doc, None,
|
||||
None, DocumentSource::NotFromParser);
|
||||
None, DocumentSource::NotFromParser, loader);
|
||||
NodeCast::from_temporary(document)
|
||||
},
|
||||
NodeTypeId::Element(..) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue