From c4adbd47f2a4d449464e2ccaafc197a70416487e Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 24 Jul 2013 14:52:43 -0700 Subject: [PATCH 1/3] debug: Send flow tree dump to stderr for consistency --- src/components/main/layout/flow.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/main/layout/flow.rs b/src/components/main/layout/flow.rs index 765bd47114b..38fd16974b3 100644 --- a/src/components/main/layout/flow.rs +++ b/src/components/main/layout/flow.rs @@ -35,6 +35,7 @@ use layout::float_context::{FloatContext, Invalid, FloatType}; use std::cell::Cell; use std::uint; +use std::io::stderr; use geom::point::Point2D; use geom::rect::Rect; use gfx::display_list::DisplayList; @@ -414,7 +415,7 @@ impl<'self> FlowContext { } s.push_str(self.debug_str()); - println(s); + stderr().write_line(s); // FIXME: this should have a pure/const version? for self.each_child |child| { From de65ac7127ad1583d89af994e330473052a24052 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 24 Jul 2013 16:31:04 -0700 Subject: [PATCH 2/3] Fail the script task when page URL load fails It's confusing that specifying a nonexistent file on the command line just gives me a blank page. Until we have a real 404 page let's just crash. --- src/components/script/html/hubbub_html_parser.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index ab8a8956314..2f5591464cf 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -481,6 +481,9 @@ pub fn parse_html(url: Url, debug!("received data"); parser.parse_chunk(data); } + Done(Err(*)) => { + fail!("Failed to load page URL %s", url.to_str()); + } Done(*) => { break; } From dc9f7560b058e1cb5acc8122c43f0ee9632b8608 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 24 Jul 2013 14:57:59 -0700 Subject: [PATCH 3/3] Reflow and redisplay after script timers fire We don't know what the script changed. This will be less painful with incremental layout. Fixes a crash from calling reflow() with self.damage = None. --- src/components/script/script_task.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index c3b574413c9..b0d9af20cfc 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -16,7 +16,7 @@ use dom::window::Window; use layout_interface::{AddStylesheetMsg, DocumentDamage}; use layout_interface::{DocumentDamageLevel, HitTestQuery, HitTestResponse, LayoutQuery}; use layout_interface::{LayoutChan, MatchSelectorsDocumentDamage, QueryMsg, Reflow}; -use layout_interface::{ReflowDocumentDamage, ReflowForDisplay, ReflowForScriptQuery, ReflowGoal}; +use layout_interface::{ReflowDocumentDamage, ReflowForDisplay, ReflowGoal}; use layout_interface::ReflowMsg; use layout_interface; use servo_msg::constellation_msg::{ConstellationChan, LoadUrlMsg, NavigationDirection}; @@ -321,7 +321,8 @@ impl ScriptTask { null(), &rval); - self.reflow(ReflowForScriptQuery) + // We don't know what the script changed, so for now we will do a total redisplay. + self.reflow_all(ReflowForDisplay) } }