aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/main')
-rw-r--r--src/components/main/compositing/compositor_layer.rs2
-rw-r--r--src/components/main/compositing/mod.rs4
-rw-r--r--src/components/main/constellation.rs18
-rw-r--r--src/components/main/css/node_util.rs2
-rw-r--r--src/components/main/css/select.rs7
-rw-r--r--src/components/main/layout/box.rs6
-rw-r--r--src/components/main/layout/box_builder.rs10
-rw-r--r--src/components/main/layout/float_context.rs4
-rw-r--r--src/components/main/layout/inline.rs25
-rw-r--r--src/components/main/layout/layout_task.rs2
-rw-r--r--src/components/main/layout/text.rs2
-rw-r--r--src/components/main/pipeline.rs2
12 files changed, 41 insertions, 43 deletions
diff --git a/src/components/main/compositing/compositor_layer.rs b/src/components/main/compositing/compositor_layer.rs
index 083dc5312c5..61e2b0206a1 100644
--- a/src/components/main/compositing/compositor_layer.rs
+++ b/src/components/main/compositing/compositor_layer.rs
@@ -313,7 +313,7 @@ impl CompositorLayer {
texture_layer.manager = @buffer.draw_target.clone() as @TextureManager;
// Move on to the next sibling.
- do current_layer_child.get().with_common |common| {
+ do current_layer_child.unwrap().with_common |common| {
common.next_sibling
}
}
diff --git a/src/components/main/compositing/mod.rs b/src/components/main/compositing/mod.rs
index b8f4c22ae5d..901354bc011 100644
--- a/src/components/main/compositing/mod.rs
+++ b/src/components/main/compositing/mod.rs
@@ -80,7 +80,7 @@ impl RenderListener for CompositorChan {
port.recv()
}
- fn paint(&self, id: PipelineId, layer_buffer_set: arc::ARC<LayerBufferSet>) {
+ fn paint(&self, id: PipelineId, layer_buffer_set: arc::Arc<LayerBufferSet>) {
self.chan.send(Paint(id, layer_buffer_set))
}
@@ -136,7 +136,7 @@ pub enum Msg {
DeleteLayer(PipelineId),
/// Requests that the compositor paint the given layer buffer set for the given page size.
- Paint(PipelineId, arc::ARC<LayerBufferSet>),
+ Paint(PipelineId, arc::Arc<LayerBufferSet>),
/// Alerts the compositor to the current status of page loading.
ChangeReadyState(ReadyState),
/// Alerts the compositor to the current status of rendering.
diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs
index af036a5f0aa..91ab2317c4f 100644
--- a/src/components/main/constellation.rs
+++ b/src/components/main/constellation.rs
@@ -4,8 +4,6 @@
use compositing::{CompositorChan, SetIds};
-use extra::net::url;
-
use std::cell::Cell;
use std::comm;
use std::comm::Port;
@@ -169,17 +167,17 @@ impl NavigationContext {
* when it is known that there exists either a previous page or a next page. */
pub fn back(&mut self) -> @mut FrameTree {
- self.next.push(self.current.swap_unwrap());
+ self.next.push(self.current.take_unwrap());
self.current = Some(self.previous.pop());
debug!("previous: %? next: %? current: %?", self.previous, self.next, *self.current.get_ref());
- self.current.get()
+ self.current.unwrap()
}
pub fn forward(&mut self) -> @mut FrameTree {
- self.previous.push(self.current.swap_unwrap());
+ self.previous.push(self.current.take_unwrap());
self.current = Some(self.next.pop());
debug!("previous: %? next: %? current: %?", self.previous, self.next, *self.current.get_ref());
- self.current.get()
+ self.current.unwrap()
}
/// Loads a new set of page frames, returning all evicted frame trees
@@ -187,7 +185,7 @@ impl NavigationContext {
debug!("navigating to %?", frame_tree);
let evicted = replace(&mut self.next, ~[]);
if self.current.is_some() {
- self.previous.push(self.current.swap_unwrap());
+ self.previous.push(self.current.take_unwrap());
}
self.current = Some(frame_tree);
evicted
@@ -405,7 +403,7 @@ impl Constellation {
// If there is already a pending page (self.pending_frames), it will not be overridden;
// However, if the id is not encompassed by another change, it will be.
LoadUrlMsg(source_id, url, size_future) => {
- debug!("received message to load %s", url::to_str(&url));
+ debug!("received message to load %s", url.to_str());
// Make sure no pending page would be overridden.
let source_frame = self.current_frame().get_ref().find_mut(source_id).expect(
"Constellation: received a LoadUrlMsg from a pipeline_id associated
@@ -530,13 +528,13 @@ impl Constellation {
// Create the next frame tree that will be given to the compositor
let next_frame_tree = match to_add.parent {
None => to_add, // to_add is the root
- Some(_parent) => @mut (*self.current_frame().get()).clone(),
+ Some(_parent) => @mut (*self.current_frame().unwrap()).clone(),
};
// If there are frames to revoke permission from, do so now.
match frame_change.before {
Some(revoke_id) => {
- let current_frame = self.current_frame().get();
+ let current_frame = self.current_frame().unwrap();
let to_revoke = current_frame.find_mut(revoke_id).expect(
"Constellation: pending frame change refers to an old
diff --git a/src/components/main/css/node_util.rs b/src/components/main/css/node_util.rs
index a63ee695af5..721b8ca9132 100644
--- a/src/components/main/css/node_util.rs
+++ b/src/components/main/css/node_util.rs
@@ -65,7 +65,7 @@ impl<'self> NodeUtil<'self> for AbstractNode<LayoutView> {
if !self.has_layout_data() {
return default;
}
- self.layout_data().restyle_damage.get_or_default(default)
+ self.layout_data().restyle_damage.unwrap_or_default(default)
}
/// Set the restyle damage field.
diff --git a/src/components/main/css/select.rs b/src/components/main/css/select.rs
index b776ade5978..d106c7bc6e9 100644
--- a/src/components/main/css/select.rs
+++ b/src/components/main/css/select.rs
@@ -2,10 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use extra::net::url::Url;
-use url_from_str = extra::net::url::from_str;
+use extra::url::Url;
use std::cell::Cell;
-use std::result;
+use std::FromStr;
use newcss::stylesheet::Stylesheet;
use newcss::select::SelectCtx;
use newcss::types::OriginUA;
@@ -29,7 +28,7 @@ fn servo_default_style() -> Stylesheet {
}
fn default_url(name: &str) -> Url {
- result::unwrap(url_from_str(fmt!("http://%s", name)))
+ FromStr::from_str(fmt!("http://%s", name)).unwrap()
}
fn style_stream(style: &str) -> DataStream {
diff --git a/src/components/main/layout/box.rs b/src/components/main/layout/box.rs
index 38f422a1dff..658b52726c8 100644
--- a/src/components/main/layout/box.rs
+++ b/src/components/main/layout/box.rs
@@ -38,7 +38,7 @@ use script::dom::node::{AbstractNode, LayoutView};
use servo_net::image::holder::ImageHolder;
use servo_net::local_image_cache::LocalImageCache;
use servo_util::range::*;
-use extra::net::url::Url;
+use extra::url::Url;
/// Render boxes (`struct RenderBox`) are the leaves of the layout tree. They cannot position
/// themselves. In general, render boxes do not have a simple correspondence with CSS boxes as in
@@ -433,7 +433,7 @@ impl RenderBox {
ImageRenderBoxClass(image_box) => {
// TODO: Consult the CSS `width` property as well as margins and borders.
// TODO: If the image isn't available, consult `width`.
- Au::from_px(image_box.image.get_size().get_or_default(Size2D(0, 0)).width)
+ Au::from_px(image_box.image.get_size().unwrap_or_default(Size2D(0, 0)).width)
}
TextRenderBoxClass(text_box) => {
@@ -454,7 +454,7 @@ impl RenderBox {
GenericRenderBoxClass(*) => Au(0),
ImageRenderBoxClass(image_box) => {
- Au::from_px(image_box.image.get_size().get_or_default(Size2D(0, 0)).width)
+ Au::from_px(image_box.image.get_size().unwrap_or_default(Size2D(0, 0)).width)
}
TextRenderBoxClass(text_box) => {
diff --git a/src/components/main/layout/box_builder.rs b/src/components/main/layout/box_builder.rs
index cd11e948ed0..5ea78c8a0fe 100644
--- a/src/components/main/layout/box_builder.rs
+++ b/src/components/main/layout/box_builder.rs
@@ -403,22 +403,22 @@ impl LayoutTreeBuilder {
// Floats
(CSSDisplayBlock, BlockFlow(_), _) |
(CSSDisplayBlock, FloatFlow(_), _) if !is_float.is_none() => {
- self.create_child_generator(node, parent_generator, Flow_Float(is_float.get()))
+ self.create_child_generator(node, parent_generator, Flow_Float(is_float.unwrap()))
}
// If we're placing a float after an inline, append the float to the inline flow,
// then continue building from the inline flow in case there are more inlines
// afterward.
(CSSDisplayBlock, _, Some(InlineFlow(_))) if !is_float.is_none() => {
let float_generator = self.create_child_generator(node,
- sibling_generator.get(),
- Flow_Float(is_float.get()));
- return Some((float_generator, sibling_generator.get()));
+ sibling_generator.unwrap(),
+ Flow_Float(is_float.unwrap()));
+ return Some((float_generator, sibling_generator.unwrap()));
}
// This is a catch-all case for when:
// a) sibling_flow is None
// b) sibling_flow is a BlockFlow
(CSSDisplayBlock, InlineFlow(_), _) if !is_float.is_none() => {
- self.create_child_generator(node, parent_generator, Flow_Float(is_float.get()))
+ self.create_child_generator(node, parent_generator, Flow_Float(is_float.unwrap()))
}
(CSSDisplayBlock, BlockFlow(info), _) => match (info.is_root, node.parent_node()) {
diff --git a/src/components/main/layout/float_context.rs b/src/components/main/layout/float_context.rs
index 60bb9595615..c24277465cc 100644
--- a/src/components/main/layout/float_context.rs
+++ b/src/components/main/layout/float_context.rs
@@ -300,7 +300,7 @@ impl FloatContextBase{
f_data.bounds.origin.x + f_data.bounds.size.width > left &&
f_data.bounds.origin.x < left + width {
let new_y = f_data.bounds.origin.y;
- max_height = Some(min(max_height.get_or_default(new_y), new_y));
+ max_height = Some(min(max_height.unwrap_or_default(new_y), new_y));
}
}
}
@@ -340,7 +340,7 @@ impl FloatContextBase{
let height = self.max_height_for_bounds(rect.origin.x,
rect.origin.y,
rect.size.width);
- let height = height.get_or_default(Au(max_value));
+ let height = height.unwrap_or_default(Au(max_value));
return match info.f_type {
FloatLeft => Rect(Point2D(rect.origin.x, float_y),
Size2D(rect.size.width, height)),
diff --git a/src/components/main/layout/inline.rs b/src/components/main/layout/inline.rs
index 3886695c4d3..3a4f8122dfe 100644
--- a/src/components/main/layout/inline.rs
+++ b/src/components/main/layout/inline.rs
@@ -22,7 +22,8 @@ use newcss::units::{Em, Px, Pt};
use newcss::values::{CSSLineHeightNormal, CSSLineHeightNumber, CSSLineHeightLength, CSSLineHeightPercentage};
use servo_util::range::Range;
use servo_util::tree::{TreeNodeRef, TreeUtils};
-use extra::deque::Deque;
+use extra::container::Deque;
+use extra::ringbuf::RingBuf;
/*
Lineboxes are represented as offsets into the child list, rather than
@@ -62,7 +63,7 @@ struct LineboxScanner {
flow: FlowContext,
floats: FloatContext,
new_boxes: ~[RenderBox],
- work_list: @mut Deque<RenderBox>,
+ work_list: @mut RingBuf<RenderBox>,
pending_line: LineBox,
lines: ~[LineBox],
cur_y: Au,
@@ -76,7 +77,7 @@ impl LineboxScanner {
flow: inline,
floats: float_ctx,
new_boxes: ~[],
- work_list: @mut Deque::new(),
+ work_list: @mut RingBuf::new(),
pending_line: LineBox {
range: Range::empty(),
bounds: Rect(Point2D(Au(0), Au(0)), Size2D(Au(0), Au(0))),
@@ -122,7 +123,7 @@ impl LineboxScanner {
debug!("LineboxScanner: Working with box from box list: b%d", box.id());
box
} else {
- let box = self.work_list.pop_front();
+ let box = self.work_list.pop_front().unwrap();
debug!("LineboxScanner: Working with box from work list: b%d", box.id());
box
};
@@ -176,7 +177,7 @@ impl LineboxScanner {
match box {
ImageRenderBoxClass(image_box) => {
let size = image_box.image.get_size();
- let height = Au::from_px(size.get_or_default(Size2D(0, 0)).height);
+ let height = Au::from_px(size.unwrap_or_default(Size2D(0, 0)).height);
image_box.base.position.size.height = height;
debug!("box_height: found image height: %?", height);
height
@@ -360,11 +361,11 @@ impl LineboxScanner {
self.pending_line.green_zone = next_green_zone;
assert!(!line_is_empty, "Non-terminating line breaking");
- self.work_list.add_front(in_box);
+ self.work_list.push_front(in_box);
return true;
} else {
debug!("LineboxScanner: case=adding box collides vertically with floats: breaking line");
- self.work_list.add_front(in_box);
+ self.work_list.push_front(in_box);
return false;
}
}
@@ -407,7 +408,7 @@ impl LineboxScanner {
match (left, right) {
(Some(left_box), Some(right_box)) => {
self.push_box_to_line(left_box);
- self.work_list.add_front(right_box);
+ self.work_list.push_front(right_box);
}
(Some(left_box), None) => self.push_box_to_line(left_box),
(None, Some(right_box)) => self.push_box_to_line(right_box),
@@ -423,7 +424,7 @@ impl LineboxScanner {
match (left, right) {
(Some(left_box), Some(right_box)) => {
self.push_box_to_line(left_box);
- self.work_list.add_front(right_box);
+ self.work_list.push_front(right_box);
}
(Some(left_box), None) => {
self.push_box_to_line(left_box);
@@ -438,7 +439,7 @@ impl LineboxScanner {
return true;
} else {
debug!("LineboxScanner: case=split box didn't fit, not appending and deferring original box.");
- self.work_list.add_front(in_box);
+ self.work_list.push_front(in_box);
return false;
}
}
@@ -553,7 +554,7 @@ impl InlineFlowData {
match box {
ImageRenderBoxClass(image_box) => {
let size = image_box.image.get_size();
- let width = Au::from_px(size.get_or_default(Size2D(0, 0)).width);
+ let width = Au::from_px(size.unwrap_or_default(Size2D(0, 0)).width);
image_box.base.position.size.width = width;
}
TextRenderBoxClass(_) => {
@@ -671,7 +672,7 @@ impl InlineFlowData {
match cur_box {
ImageRenderBoxClass(image_box) => {
let size = image_box.image.get_size();
- let height = Au::from_px(size.get_or_default(Size2D(0, 0)).height);
+ let height = Au::from_px(size.unwrap_or_default(Size2D(0, 0)).height);
image_box.base.position.size.height = height;
image_box.base.position.translate(&Point2D(Au(0), -height))
diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs
index 48c9b347e71..73f9e5c9556 100644
--- a/src/components/main/layout/layout_task.rs
+++ b/src/components/main/layout/layout_task.rs
@@ -44,7 +44,7 @@ use servo_net::local_image_cache::LocalImageCache;
use servo_util::tree::{TreeNodeRef, TreeUtils};
use servo_util::time::{ProfilerChan, profile};
use servo_util::time;
-use extra::net::url::Url;
+use extra::url::Url;
struct LayoutTask {
id: PipelineId,
diff --git a/src/components/main/layout/text.rs b/src/components/main/layout/text.rs
index 525e6239320..d0eb65937d6 100644
--- a/src/components/main/layout/text.rs
+++ b/src/components/main/layout/text.rs
@@ -241,7 +241,7 @@ impl TextRunScanner {
}
do in_boxes[i].with_base |base| {
- let new_box = @mut adapt_textbox_with_range(*base, run.get(), range);
+ let new_box = @mut adapt_textbox_with_range(*base, run.unwrap(), range);
out_boxes.push(TextRenderBoxClass(new_box));
}
}
diff --git a/src/components/main/pipeline.rs b/src/components/main/pipeline.rs
index ef33125efeb..ab12a1f73e0 100644
--- a/src/components/main/pipeline.rs
+++ b/src/components/main/pipeline.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use extra::net::url::Url;
+use extra::url::Url;
use compositing::CompositorChan;
use gfx::render_task::{RenderChan, RenderTask};
use gfx::render_task::{PaintPermissionGranted, PaintPermissionRevoked};