aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r--components/layout/layout_task.rs35
1 files changed, 17 insertions, 18 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index e1e918251cd..15d9daccbc8 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -11,7 +11,7 @@ use context::SharedLayoutContext;
use flow::{mod, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUtils};
use flow_ref::FlowRef;
use fragment::{Fragment, FragmentBoundsIterator};
-use incremental::{LayoutDamageComputation, Reflow, ReflowEntireDocument, Repaint};
+use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT};
use layout_debug;
use parallel::UnsafeFlow;
use parallel;
@@ -183,7 +183,7 @@ impl LayoutTaskFactory for LayoutTask {
time_profiler_chan: TimeProfilerChan,
shutdown_chan: Sender<()>) {
let ConstellationChan(con_chan) = constellation_chan.clone();
- spawn_named_with_send_on_failure("LayoutTask", task_state::Layout, proc() {
+ spawn_named_with_send_on_failure("LayoutTask", task_state::LAYOUT, proc() {
{ // Ensures layout task is destroyed before we send shutdown message
let sender = chan.sender();
let layout =
@@ -254,7 +254,7 @@ impl LayoutTask {
let screen_size = Size2D(Au(0), Au(0));
let device = Device::new(Screen, opts::get().initial_window_size.as_f32() * ScaleFactor(1.0));
let parallel_traversal = if opts::get().layout_threads != 1 {
- Some(WorkQueue::new("LayoutWorker", task_state::Layout,
+ Some(WorkQueue::new("LayoutWorker", task_state::LAYOUT,
opts::get().layout_threads, ptr::null()))
} else {
None
@@ -339,7 +339,7 @@ impl LayoutTask {
} else if ret == port2.id() {
Pipeline
} else {
- fail!("invalid select result");
+ panic!("invalid select result");
}
};
@@ -443,7 +443,7 @@ impl LayoutTask {
break
}
_ => {
- fail!("layout: message that wasn't `ExitNowMsg` received after \
+ panic!("layout: message that wasn't `ExitNowMsg` received after \
`PrepareToExitMsg`")
}
}
@@ -559,7 +559,7 @@ impl LayoutTask {
let _scope = layout_debug_scope!("solve_constraints_parallel");
match rw_data.parallel_traversal {
- None => fail!("solve_contraints_parallel() called with no parallel traversal ready"),
+ None => panic!("solve_contraints_parallel() called with no parallel traversal ready"),
Some(ref mut traversal) => {
// NOTE: this currently computes borders, so any pruning should separate that
// operation out.
@@ -665,12 +665,11 @@ impl LayoutTask {
.background_color)
.to_gfx_color()
};
- match element_bg_color {
- color::rgba(0., 0., 0., 0.) => {}
- _ => {
- color = element_bg_color;
- break;
- }
+ // FIXME: Add equality operators for azure color type.
+ if element_bg_color.r != 0.0 || element_bg_color.g != 0.0 ||
+ element_bg_color.b != 0.0 || element_bg_color.a != 0.0 {
+ color = element_bg_color;
+ break;
}
}
}
@@ -798,8 +797,8 @@ impl LayoutTask {
self.time_profiler_chan.clone(),
|| {
if opts::get().nonincremental_layout ||
- layout_root.compute_layout_damage().contains(ReflowEntireDocument) {
- layout_root.reflow_entire_document()
+ layout_root.deref_mut().compute_layout_damage().contains(REFLOW_ENTIRE_DOCUMENT) {
+ layout_root.deref_mut().reflow_entire_document()
}
});
@@ -884,7 +883,7 @@ impl LayoutTask {
}
fn reflow_all_nodes(flow: &mut Flow) {
- flow::mut_base(flow).restyle_damage.insert(Reflow | Repaint);
+ flow::mut_base(flow).restyle_damage.insert(REFLOW | REPAINT);
for child in flow::child_iter(flow) {
LayoutTask::reflow_all_nodes(child);
@@ -930,7 +929,7 @@ impl LayoutRPC for LayoutRPCImpl {
/// Requests the dimensions of all the content boxes, as in the `getClientRects()` call.
fn content_boxes(&self) -> ContentBoxesResponse {
let &LayoutRPCImpl(ref rw_data) = self;
- let mut rw_data = rw_data.lock();
+ let rw_data = rw_data.lock();
ContentBoxesResponse(rw_data.content_boxes_response.clone())
}
@@ -953,7 +952,7 @@ impl LayoutRPC for LayoutRPCImpl {
let &LayoutRPCImpl(ref rw_data) = self;
let rw_data = rw_data.lock();
match rw_data.display_list {
- None => fail!("no display list!"),
+ None => panic!("no display list!"),
Some(ref display_list) => hit_test(point, display_list.list.iter().rev()),
}
};
@@ -984,7 +983,7 @@ impl LayoutRPC for LayoutRPCImpl {
let &LayoutRPCImpl(ref rw_data) = self;
let rw_data = rw_data.lock();
match rw_data.display_list {
- None => fail!("no display list!"),
+ None => panic!("no display list!"),
Some(ref display_list) => {
mouse_over_test(point, display_list.list.iter().rev(), &mut mouse_over_list);
}