From 94d83f96f15fd107ea7f9c9b290b2b864465c844 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Mon, 22 Jul 2013 10:43:02 -0600 Subject: [PATCH 1/2] Fix flow tree debug printing. Nested `debug!()` calls are no-ops, so change it now does a `println`. Also moved to the `debug!()` calls out of the profiled block. --- src/components/main/layout/flow.rs | 2 +- src/components/main/layout/layout_task.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/main/layout/flow.rs b/src/components/main/layout/flow.rs index d0da205275a..765bd47114b 100644 --- a/src/components/main/layout/flow.rs +++ b/src/components/main/layout/flow.rs @@ -414,7 +414,7 @@ impl<'self> FlowContext { } s.push_str(self.debug_str()); - debug!("%s", s); + println(s); // FIXME: this should have a pure/const version? for self.each_child |child| { diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs index 595b37dd879..1943191c89a 100644 --- a/src/components/main/layout/layout_task.rs +++ b/src/components/main/layout/layout_task.rs @@ -210,12 +210,12 @@ impl LayoutTask { Err(*) => fail!(~"Root flow should always exist") }; - debug!("layout: constructed Flow tree"); - debug!("%?", layout_root.dump()); - layout_root }; + debug!("layout: constructed Flow tree"); + debug!("", layout_root.dump()); + // Perform the primary layout passes over the flow tree to compute the locations of all // the boxes. do profile(time::LayoutMainCategory, self.profiler_chan.clone()) { From 82765c2f6b61c9777a9edebb46330e15be1102d0 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Mon, 22 Jul 2013 10:45:19 -0600 Subject: [PATCH 2/2] Float children are now positioned relative to the float's box. --- src/components/main/layout/float.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/main/layout/float.rs b/src/components/main/layout/float.rs index 9681f6e1f64..d51ab0849a0 100644 --- a/src/components/main/layout/float.rs +++ b/src/components/main/layout/float.rs @@ -253,7 +253,7 @@ impl FloatFlowData { let flow = FloatFlow(self); for flow.each_child |child| { do child.with_mut_base |base| { - base.abs_position = offset; + base.abs_position = offset + base.position.origin; } }