mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)
This commit is contained in:
parent
8a7eefefd5
commit
a640a7c5c3
74 changed files with 459 additions and 449 deletions
|
@ -977,10 +977,16 @@ impl BlockFlow {
|
|||
let mut candidate_block_size_iterator = CandidateBSizeIterator::new(
|
||||
self.fragment.style(),
|
||||
self.base.block_container_explicit_block_size);
|
||||
for candidate_block_size in candidate_block_size_iterator {
|
||||
candidate_block_size_iterator.candidate_value = match candidate_block_size {
|
||||
Auto => block_size,
|
||||
Specified(value) => value
|
||||
// Can't use `for` because we assign to candidate_block_size_iterator.candidate_value
|
||||
loop {
|
||||
match candidate_block_size_iterator.next() {
|
||||
Some(candidate_block_size) => {
|
||||
candidate_block_size_iterator.candidate_value = match candidate_block_size {
|
||||
Auto => block_size,
|
||||
Specified(value) => value
|
||||
}
|
||||
}
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1097,10 +1103,16 @@ impl BlockFlow {
|
|||
let mut candidate_block_size_iterator =
|
||||
CandidateBSizeIterator::new(self.fragment.style(),
|
||||
self.base.block_container_explicit_block_size);
|
||||
for candidate_block_size in candidate_block_size_iterator {
|
||||
candidate_block_size_iterator.candidate_value = match candidate_block_size {
|
||||
Auto => content_block_size,
|
||||
Specified(value) => value,
|
||||
// Can't use `for` because we assign to candidate_block_size_iterator.candidate_value
|
||||
loop {
|
||||
match candidate_block_size_iterator.next() {
|
||||
Some(candidate_block_size) => {
|
||||
candidate_block_size_iterator.candidate_value = match candidate_block_size {
|
||||
Auto => content_block_size,
|
||||
Specified(value) => value,
|
||||
}
|
||||
}
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1241,19 +1253,26 @@ impl BlockFlow {
|
|||
let mut candidate_block_size_iterator =
|
||||
CandidateBSizeIterator::new(style, Some(containing_block_block_size));
|
||||
|
||||
for block_size_used_val in candidate_block_size_iterator {
|
||||
solution =
|
||||
Some(BSizeConstraintSolution::solve_vertical_constraints_abs_nonreplaced(
|
||||
block_size_used_val,
|
||||
margin_block_start,
|
||||
margin_block_end,
|
||||
block_start,
|
||||
block_end,
|
||||
content_block_size,
|
||||
available_block_size,
|
||||
static_b_offset));
|
||||
// Can't use `for` because we assign to candidate_block_size_iterator.candidate_value
|
||||
loop {
|
||||
match candidate_block_size_iterator.next() {
|
||||
Some(block_size_used_val) => {
|
||||
solution =
|
||||
Some(BSizeConstraintSolution::solve_vertical_constraints_abs_nonreplaced(
|
||||
block_size_used_val,
|
||||
margin_block_start,
|
||||
margin_block_end,
|
||||
block_start,
|
||||
block_end,
|
||||
content_block_size,
|
||||
available_block_size,
|
||||
static_b_offset));
|
||||
|
||||
candidate_block_size_iterator.candidate_value = solution.unwrap().block_size
|
||||
candidate_block_size_iterator.candidate_value
|
||||
= solution.unwrap().block_size;
|
||||
}
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1773,7 +1792,7 @@ impl Flow for BlockFlow {
|
|||
// FIXME(#2010, pcwalton): This is a hack and is totally bogus in the presence of pseudo-
|
||||
// elements. But until we have incremental reflow we can't do better--we recreate the flow
|
||||
// for every DOM node so otherwise we nuke layers on every reflow.
|
||||
LayerId(self.fragment.node.id(), fragment_index)
|
||||
LayerId(self.fragment.node.id() as uint, fragment_index)
|
||||
}
|
||||
|
||||
fn is_absolute_containing_block(&self) -> bool {
|
||||
|
|
|
@ -67,7 +67,7 @@ use style::computed_values::{clear, float, position, text_align};
|
|||
///
|
||||
/// Note that virtual methods have a cost; we should not overuse them in Servo. Consider adding
|
||||
/// methods to `ImmutableFlowUtils` or `MutableFlowUtils` before adding more methods here.
|
||||
pub trait Flow: fmt::Show + ToString + Share {
|
||||
pub trait Flow: fmt::Show + ToString + Sync {
|
||||
// RTTI
|
||||
//
|
||||
// TODO(pcwalton): Use Rust's RTTI, once that works.
|
||||
|
@ -310,7 +310,7 @@ pub trait Flow: fmt::Show + ToString + Share {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, E, S: Encoder<E>> Encodable<S, E> for &'a Flow {
|
||||
impl<'a, E, S: Encoder<E>> Encodable<S, E> for &'a Flow + 'a {
|
||||
fn encode(&self, e: &mut S) -> Result<(), E> {
|
||||
e.emit_struct("flow", 0, |e| {
|
||||
try!(e.emit_struct_field("class", 0, |e| self.class().encode(e)))
|
||||
|
@ -637,8 +637,8 @@ pub struct DescendantIter<'a> {
|
|||
iter: MutItems<'a, FlowRef>,
|
||||
}
|
||||
|
||||
impl<'a> Iterator<&'a mut Flow> for DescendantIter<'a> {
|
||||
fn next(&mut self) -> Option<&'a mut Flow> {
|
||||
impl<'a> Iterator<&'a mut Flow + 'a> for DescendantIter<'a> {
|
||||
fn next(&mut self) -> Option<&'a mut Flow + 'a> {
|
||||
match self.iter.next() {
|
||||
None => None,
|
||||
Some(ref mut flow) => {
|
||||
|
@ -836,7 +836,7 @@ impl BaseFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> ImmutableFlowUtils for &'a Flow {
|
||||
impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
||||
/// Returns true if this flow is a block or a float flow.
|
||||
fn is_block_like(self) -> bool {
|
||||
match self.class() {
|
||||
|
@ -1004,7 +1004,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> MutableFlowUtils for &'a mut Flow {
|
||||
impl<'a> MutableFlowUtils for &'a mut Flow + 'a {
|
||||
/// Traverses the tree in preorder.
|
||||
fn traverse_preorder<T:PreorderFlowTraversal>(self, traversal: &mut T) -> bool {
|
||||
if traversal.should_prune(self) {
|
||||
|
|
|
@ -23,7 +23,7 @@ impl FlowRef {
|
|||
pub fn new(mut flow: Box<Flow>) -> FlowRef {
|
||||
unsafe {
|
||||
let result = {
|
||||
let flow_ref: &mut Flow = flow;
|
||||
let flow_ref: &mut Flow = &mut *flow;
|
||||
let object = mem::transmute::<&mut Flow, raw::TraitObject>(flow_ref);
|
||||
FlowRef { object: object }
|
||||
};
|
||||
|
@ -56,14 +56,14 @@ impl Drop for FlowRef {
|
|||
}
|
||||
let flow_ref: FlowRef = mem::replace(self, FlowRef {
|
||||
object: raw::TraitObject {
|
||||
vtable: ptr::mut_null(),
|
||||
data: ptr::mut_null(),
|
||||
vtable: ptr::null_mut(),
|
||||
data: ptr::null_mut(),
|
||||
}
|
||||
});
|
||||
drop(mem::transmute::<raw::TraitObject, Box<Flow>>(flow_ref.object));
|
||||
mem::forget(flow_ref);
|
||||
self.object.vtable = ptr::mut_null();
|
||||
self.object.data = ptr::mut_null();
|
||||
self.object.vtable = ptr::null_mut();
|
||||
self.object.data = ptr::null_mut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@ extern crate script_traits;
|
|||
extern crate serialize;
|
||||
extern crate style;
|
||||
#[phase(plugin)]
|
||||
extern crate servo_macros = "macros";
|
||||
extern crate servo_net = "net";
|
||||
extern crate servo_msg = "msg";
|
||||
extern crate "macros" as servo_macros;
|
||||
extern crate "net" as servo_net;
|
||||
extern crate "msg" as servo_msg;
|
||||
#[phase(plugin, link)]
|
||||
extern crate servo_util = "util";
|
||||
extern crate "util" as servo_util;
|
||||
|
||||
extern crate collections;
|
||||
extern crate encoding;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
use fragment::Fragment;
|
||||
|
||||
use computed = style::computed_values;
|
||||
use style::computed_values as computed;
|
||||
use geom::SideOffsets2D;
|
||||
use style::computed_values::{LPA_Auto, LPA_Length, LPA_Percentage, LP_Length, LP_Percentage};
|
||||
use style::ComputedValues;
|
||||
|
|
|
@ -123,7 +123,7 @@ impl OpaqueNodeMethods for OpaqueNode {
|
|||
fn from_thread_safe_layout_node(node: &ThreadSafeLayoutNode) -> OpaqueNode {
|
||||
unsafe {
|
||||
let abstract_node = node.get_jsmanaged();
|
||||
let ptr: uintptr_t = abstract_node.reflector().get_jsobject() as uint;
|
||||
let ptr: uintptr_t = abstract_node.reflector().get_jsobject() as uintptr_t;
|
||||
OpaqueNode(ptr)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue