From 6b42a7366afd89cb8949c737019a98610ab34c9f Mon Sep 17 00:00:00 2001 From: Rohan Prinja Date: Tue, 27 Oct 2015 10:24:37 +0900 Subject: [PATCH] remove DocumentProgressTask enum --- components/script/dom/document.rs | 21 +++++---------------- components/script/script_task.rs | 4 ++-- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 42620fa98fc..a05679086e9 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2039,21 +2039,14 @@ fn is_scheme_host_port_tuple(url: &Url) -> bool { url.host().is_some() && url.port_or_default().is_some() } -#[derive(HeapSizeOf)] -pub enum DocumentProgressTask { - Load, -} - pub struct DocumentProgressHandler { - addr: Trusted, - task: DocumentProgressTask, + addr: Trusted } impl DocumentProgressHandler { - pub fn new(addr: Trusted, task: DocumentProgressTask) -> DocumentProgressHandler { + pub fn new(addr: Trusted) -> DocumentProgressHandler { DocumentProgressHandler { - addr: addr, - task: task, + addr: addr } } @@ -2099,12 +2092,8 @@ impl Runnable for DocumentProgressHandler { let document = self.addr.root(); let window = document.r().window(); if window.is_alive() { - match self.task { - DocumentProgressTask::Load => { - self.set_ready_state_complete(); - self.dispatch_load(); - } - } + self.set_ready_state_complete(); + self.dispatch_load(); } } } diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 26446af7f9d..30bb371667b 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -31,7 +31,7 @@ use dom::bindings::refcounted::{LiveDOMReferences, Trusted, TrustedReference, tr use dom::bindings::trace::{JSTraceable, RootedVec, trace_traceables}; use dom::bindings::utils::{DOM_CALLBACKS, WRAP_CALLBACKS}; use dom::document::{Document, DocumentProgressHandler, IsHTMLDocument}; -use dom::document::{DocumentProgressTask, DocumentSource, MouseEventType}; +use dom::document::{DocumentSource, MouseEventType}; use dom::element::Element; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::node::{Node, NodeDamage, window_from_node}; @@ -1220,7 +1220,7 @@ impl ScriptTask { // https://html.spec.whatwg.org/multipage/#the-end step 7 let addr: Trusted = 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(); let ConstellationChan(ref chan) = self.constellation_chan;