Auto merge of #8217 - wenderen:8211-remove-documentprogresstask, r=Manishearth

remove DocumentProgressTask enum

for #8211

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8217)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-10-27 00:12:02 -05:00
commit a6e2c138db
2 changed files with 7 additions and 18 deletions

View file

@ -2039,21 +2039,14 @@ fn is_scheme_host_port_tuple(url: &Url) -> bool {
url.host().is_some() && url.port_or_default().is_some() url.host().is_some() && url.port_or_default().is_some()
} }
#[derive(HeapSizeOf)]
pub enum DocumentProgressTask {
Load,
}
pub struct DocumentProgressHandler { pub struct DocumentProgressHandler {
addr: Trusted<Document>, addr: Trusted<Document>
task: DocumentProgressTask,
} }
impl DocumentProgressHandler { impl DocumentProgressHandler {
pub fn new(addr: Trusted<Document>, task: DocumentProgressTask) -> DocumentProgressHandler { pub fn new(addr: Trusted<Document>) -> DocumentProgressHandler {
DocumentProgressHandler { DocumentProgressHandler {
addr: addr, addr: addr
task: task,
} }
} }
@ -2099,12 +2092,8 @@ impl Runnable for DocumentProgressHandler {
let document = self.addr.root(); let document = self.addr.root();
let window = document.r().window(); let window = document.r().window();
if window.is_alive() { if window.is_alive() {
match self.task { self.set_ready_state_complete();
DocumentProgressTask::Load => { self.dispatch_load();
self.set_ready_state_complete();
self.dispatch_load();
}
}
} }
} }
} }

View file

@ -31,7 +31,7 @@ use dom::bindings::refcounted::{LiveDOMReferences, Trusted, TrustedReference, tr
use dom::bindings::trace::{JSTraceable, RootedVec, trace_traceables}; use dom::bindings::trace::{JSTraceable, RootedVec, trace_traceables};
use dom::bindings::utils::{DOM_CALLBACKS, WRAP_CALLBACKS}; use dom::bindings::utils::{DOM_CALLBACKS, WRAP_CALLBACKS};
use dom::document::{Document, DocumentProgressHandler, IsHTMLDocument}; use dom::document::{Document, DocumentProgressHandler, IsHTMLDocument};
use dom::document::{DocumentProgressTask, DocumentSource, MouseEventType}; use dom::document::{DocumentSource, MouseEventType};
use dom::element::Element; use dom::element::Element;
use dom::event::{Event, EventBubbles, EventCancelable}; use dom::event::{Event, EventBubbles, EventCancelable};
use dom::node::{Node, NodeDamage, window_from_node}; use dom::node::{Node, NodeDamage, window_from_node};
@ -1220,7 +1220,7 @@ impl ScriptTask {
// https://html.spec.whatwg.org/multipage/#the-end step 7 // https://html.spec.whatwg.org/multipage/#the-end step 7
let addr: Trusted<Document> = Trusted::new(self.get_cx(), doc, self.chan.clone()); let addr: Trusted<Document> = Trusted::new(self.get_cx(), doc, self.chan.clone());
let handler = box DocumentProgressHandler::new(addr.clone(), DocumentProgressTask::Load); let handler = box DocumentProgressHandler::new(addr.clone());
self.chan.send(CommonScriptMsg::RunnableMsg(ScriptTaskEventCategory::DocumentEvent, handler)).unwrap(); self.chan.send(CommonScriptMsg::RunnableMsg(ScriptTaskEventCategory::DocumentEvent, handler)).unwrap();
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;