mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Upgrade to rustc ba2f13ef0 2015-02-04
This commit is contained in:
parent
bc6882bdef
commit
d5dd1d658e
136 changed files with 1091 additions and 878 deletions
|
@ -13,6 +13,9 @@ path = "../canvas"
|
|||
[dependencies.gfx]
|
||||
path = "../gfx"
|
||||
|
||||
[dependencies.msg]
|
||||
path = "../msg"
|
||||
|
||||
[dependencies.script]
|
||||
path = "../script"
|
||||
|
||||
|
@ -46,6 +49,10 @@ git = "https://github.com/servo/string-cache"
|
|||
[dependencies.string_cache_macros]
|
||||
git = "https://github.com/servo/string-cache"
|
||||
|
||||
[dependencies.png]
|
||||
git = "https://github.com/servo/rust-png"
|
||||
|
||||
[dependencies]
|
||||
encoding = "0.2"
|
||||
url = "0.2.16"
|
||||
url = "0.2.16"
|
||||
bitflags = "*"
|
||||
|
|
|
@ -1902,7 +1902,7 @@ impl Flow for BlockFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for BlockFlow {
|
||||
impl fmt::Debug for BlockFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f,
|
||||
"{:?} - {:x}: frag={:?} ({:?})",
|
||||
|
@ -1914,7 +1914,7 @@ impl fmt::Show for BlockFlow {
|
|||
}
|
||||
|
||||
/// The inputs for the inline-sizes-and-margins constraint equation.
|
||||
#[derive(Show, Copy)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct ISizeConstraintInput {
|
||||
pub computed_inline_size: MaybeAuto,
|
||||
pub inline_start_margin: MaybeAuto,
|
||||
|
@ -1947,7 +1947,7 @@ impl ISizeConstraintInput {
|
|||
}
|
||||
|
||||
/// The solutions for the inline-size-and-margins constraint equation.
|
||||
#[derive(Copy, Show)]
|
||||
#[derive(Copy, Debug)]
|
||||
pub struct ISizeConstraintSolution {
|
||||
pub inline_start: Au,
|
||||
pub inline_end: Au,
|
||||
|
|
|
@ -182,12 +182,12 @@ impl InlineFragmentsAccumulator {
|
|||
}
|
||||
}
|
||||
|
||||
fn push_all(&mut self, fragments: DList<Fragment>) {
|
||||
fn push_all(&mut self, mut fragments: DList<Fragment>) {
|
||||
if fragments.len() == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
self.fragments.append(fragments)
|
||||
self.fragments.append(&mut fragments)
|
||||
}
|
||||
|
||||
fn to_dlist(self) -> DList<Fragment> {
|
||||
|
|
|
@ -1333,7 +1333,7 @@ fn position_to_offset(position: LengthOrPercentage, Au(total_length): Au) -> f32
|
|||
}
|
||||
|
||||
/// "Steps" as defined by CSS 2.1 § E.2.
|
||||
#[derive(Clone, PartialEq, Show, Copy)]
|
||||
#[derive(Clone, PartialEq, Debug, Copy)]
|
||||
pub enum StackingLevel {
|
||||
/// The border and backgrounds for the root of this stacking context: steps 1 and 2.
|
||||
BackgroundAndBorders,
|
||||
|
|
|
@ -12,7 +12,7 @@ use std::fmt;
|
|||
use style::computed_values::float;
|
||||
|
||||
/// The kind of float: left or right.
|
||||
#[derive(Clone, RustcEncodable, Show, Copy)]
|
||||
#[derive(Clone, RustcEncodable, Debug, Copy)]
|
||||
pub enum FloatKind {
|
||||
Left,
|
||||
Right
|
||||
|
@ -45,7 +45,7 @@ struct Float {
|
|||
kind: FloatKind,
|
||||
}
|
||||
|
||||
impl fmt::Show for Float {
|
||||
impl fmt::Debug for Float {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "bounds={:?} kind={:?}", self.bounds, self.kind)
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ impl FloatList {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for FloatList {
|
||||
impl fmt::Debug for FloatList {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "max_block_start={:?} floats={}", self.max_block_start, self.floats.len())
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ pub struct PlacementInfo {
|
|||
pub kind: FloatKind
|
||||
}
|
||||
|
||||
impl fmt::Show for PlacementInfo {
|
||||
impl fmt::Debug for PlacementInfo {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f,
|
||||
"size={:?} ceiling={:?} max_inline_size={:?} kind={:?}",
|
||||
|
@ -120,7 +120,7 @@ pub struct Floats {
|
|||
pub writing_mode: WritingMode,
|
||||
}
|
||||
|
||||
impl fmt::Show for Floats {
|
||||
impl fmt::Debug for Floats {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if !self.list.is_present() {
|
||||
write!(f, "[empty]")
|
||||
|
|
|
@ -67,7 +67,7 @@ use std::sync::Arc;
|
|||
///
|
||||
/// 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 + Sync {
|
||||
pub trait Flow: fmt::Debug + Sync {
|
||||
// RTTI
|
||||
//
|
||||
// TODO(pcwalton): Use Rust's RTTI, once that works.
|
||||
|
@ -428,7 +428,7 @@ pub trait MutableOwnedFlowUtils {
|
|||
fn set_absolute_descendants(&mut self, abs_descendants: AbsDescendants);
|
||||
}
|
||||
|
||||
#[derive(RustcEncodable, PartialEq, Show)]
|
||||
#[derive(RustcEncodable, PartialEq, Debug)]
|
||||
pub enum FlowClass {
|
||||
Block,
|
||||
Inline,
|
||||
|
@ -784,7 +784,7 @@ pub struct BaseFlow {
|
|||
unsafe impl Send for BaseFlow {}
|
||||
unsafe impl Sync for BaseFlow {}
|
||||
|
||||
impl fmt::Show for BaseFlow {
|
||||
impl fmt::Debug for BaseFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f,
|
||||
"@ {:?}, CC {}, ADC {}",
|
||||
|
|
|
@ -290,7 +290,7 @@ impl ImageFragmentInfo {
|
|||
fn convert_length(node: &ThreadSafeLayoutNode, name: &Atom) -> Option<Au> {
|
||||
let element = node.as_element();
|
||||
element.get_attr(&ns!(""), name).and_then(|string| {
|
||||
let n: Option<int> = FromStr::from_str(string);
|
||||
let n: Option<int> = FromStr::from_str(string).ok();
|
||||
n
|
||||
}).and_then(|pixels| Some(Au::from_px(pixels)))
|
||||
}
|
||||
|
@ -589,7 +589,7 @@ impl ScannedTextFragmentInfo {
|
|||
|
||||
/// Describes how to split a fragment. This is used during line breaking as part of the return
|
||||
/// value of `find_split_info_for_inline_size()`.
|
||||
#[derive(Show, Clone)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct SplitInfo {
|
||||
// TODO(bjz): this should only need to be a single character index, but both values are
|
||||
// currently needed for splitting in the `inline::try_append_*` functions.
|
||||
|
@ -667,7 +667,7 @@ impl TableColumnFragmentInfo {
|
|||
let span = {
|
||||
let element = node.as_element();
|
||||
element.get_attr(&ns!(""), &atom!("span")).and_then(|string| {
|
||||
let n: Option<int> = FromStr::from_str(string);
|
||||
let n: Option<int> = FromStr::from_str(string).ok();
|
||||
n
|
||||
}).unwrap_or(0)
|
||||
};
|
||||
|
@ -2016,7 +2016,7 @@ impl Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for Fragment {
|
||||
impl fmt::Debug for Fragment {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
try!(write!(f, "({} {} ", self.debug_id(), self.specific.get_type()));
|
||||
try!(write!(f, "bp {:?}", self.border_padding));
|
||||
|
@ -2059,7 +2059,7 @@ pub trait FragmentBorderBoxIterator {
|
|||
|
||||
/// The coordinate system used in `stacking_relative_border_box()`. See the documentation of that
|
||||
/// method for details.
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum CoordinateSystem {
|
||||
/// The border box returned is relative to the fragment's parent stacking context.
|
||||
Parent,
|
||||
|
|
|
@ -86,7 +86,7 @@ impl RestyleDamage {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for RestyleDamage {
|
||||
impl fmt::Debug for RestyleDamage {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
let mut first_elem = true;
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ static FONT_SUPERSCRIPT_OFFSET_RATIO: f64 = 0.34;
|
|||
/// with a float or a horizontal wall of the containing block. The block-start
|
||||
/// inline-start corner of the green zone is the same as that of the line, but
|
||||
/// the green zone can be taller and wider than the line itself.
|
||||
#[derive(RustcEncodable, Show, Copy)]
|
||||
#[derive(RustcEncodable, Debug, Copy)]
|
||||
pub struct Line {
|
||||
/// A range of line indices that describe line breaks.
|
||||
///
|
||||
|
@ -712,7 +712,7 @@ pub struct InlineFragments {
|
|||
pub fragments: Vec<Fragment>,
|
||||
}
|
||||
|
||||
impl fmt::Show for InlineFragments {
|
||||
impl fmt::Debug for InlineFragments {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:?}", self.fragments)
|
||||
}
|
||||
|
@ -1392,7 +1392,7 @@ impl Flow for InlineFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for InlineFlow {
|
||||
impl fmt::Debug for InlineFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:?} - {:x} - {:?}", self.class(), self.base.debug_id(), self.fragments)
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ use serialize::json;
|
|||
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::RefCell;
|
||||
use std::io::File;
|
||||
use std::old_io::File;
|
||||
use std::sync::atomic::{AtomicUint, Ordering, ATOMIC_UINT_INIT};
|
||||
|
||||
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
|
||||
|
@ -64,7 +64,7 @@ impl Scope {
|
|||
STATE_KEY.with(|ref r| {
|
||||
match &mut *r.borrow_mut() {
|
||||
&mut Some(ref mut state) => {
|
||||
let flow_trace = json::encode(&flow::base(&*state.flow_root));
|
||||
let flow_trace = json::encode(&flow::base(&*state.flow_root)).unwrap();
|
||||
let data = box ScopeData::new(name.clone(), flow_trace);
|
||||
state.scope_stack.push(data);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ impl Drop for Scope {
|
|||
match &mut *r.borrow_mut() {
|
||||
&mut Some(ref mut state) => {
|
||||
let mut current_scope = state.scope_stack.pop().unwrap();
|
||||
current_scope.post = json::encode(&flow::base(&*state.flow_root));
|
||||
current_scope.post = json::encode(&flow::base(&*state.flow_root)).unwrap();
|
||||
let previous_scope = state.scope_stack.last_mut().unwrap();
|
||||
previous_scope.children.push(current_scope);
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ pub fn begin_trace(flow_root: FlowRef) {
|
|||
assert!(STATE_KEY.with(|ref r| r.borrow().is_none()));
|
||||
|
||||
STATE_KEY.with(|ref r| {
|
||||
let flow_trace = json::encode(&flow::base(&*flow_root));
|
||||
let flow_trace = json::encode(&flow::base(&*flow_root)).unwrap();
|
||||
let state = State {
|
||||
scope_stack: vec![box ScopeData::new("root".to_owned(), flow_trace)],
|
||||
flow_root: flow_root.clone(),
|
||||
|
@ -122,9 +122,9 @@ pub fn end_trace() {
|
|||
let mut task_state = STATE_KEY.with(|ref r| r.borrow_mut().take().unwrap());
|
||||
assert!(task_state.scope_stack.len() == 1);
|
||||
let mut root_scope = task_state.scope_stack.pop().unwrap();
|
||||
root_scope.post = json::encode(&flow::base(&*task_state.flow_root));
|
||||
root_scope.post = json::encode(&flow::base(&*task_state.flow_root)).unwrap();
|
||||
|
||||
let result = json::encode(&root_scope);
|
||||
let result = json::encode(&root_scope).unwrap();
|
||||
let path = Path::new("layout_trace.json");
|
||||
let mut file = File::create(&path).unwrap();
|
||||
file.write_str(result.as_slice()).unwrap();
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
#[macro_use] extern crate bitflags;
|
||||
extern crate cssparser;
|
||||
extern crate canvas;
|
||||
extern crate geom;
|
||||
|
|
|
@ -26,7 +26,7 @@ use style::computed_values::list_style_type;
|
|||
use std::sync::Arc;
|
||||
|
||||
/// A block with the CSS `display` property equal to `list-item`.
|
||||
#[derive(Show)]
|
||||
#[derive(Debug)]
|
||||
pub struct ListItemFlow {
|
||||
/// Data common to all block flows.
|
||||
pub block_flow: BlockFlow,
|
||||
|
|
|
@ -253,7 +253,7 @@ pub struct IntrinsicISizes {
|
|||
pub preferred_inline_size: Au,
|
||||
}
|
||||
|
||||
impl fmt::Show for IntrinsicISizes {
|
||||
impl fmt::Debug for IntrinsicISizes {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "min={:?}, pref={:?}", self.minimum_inline_size, self.preferred_inline_size)
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ impl IntrinsicISizesContribution {
|
|||
}
|
||||
|
||||
/// Useful helper data type when computing values for blocks and positioned elements.
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
pub enum MaybeAuto {
|
||||
Auto,
|
||||
Specified(Au),
|
||||
|
|
|
@ -398,7 +398,7 @@ impl Flow for TableFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for TableFlow {
|
||||
impl fmt::Debug for TableFlow {
|
||||
/// Outputs a debugging string describing this table flow.
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "TableFlow: {:?}", self.block_flow)
|
||||
|
@ -443,7 +443,7 @@ impl ISizeAndMarginsComputer for InternalTable {
|
|||
/// maximum of 100 pixels and 20% of the table), the preceding constraint means that we must
|
||||
/// potentially store both a specified width *and* a specified percentage, so that the inline-size
|
||||
/// assignment phase of layout will know which one to pick.
|
||||
#[derive(Clone, RustcEncodable, Show, Copy)]
|
||||
#[derive(Clone, RustcEncodable, Debug, Copy)]
|
||||
pub struct ColumnIntrinsicInlineSize {
|
||||
/// The preferred intrinsic inline size.
|
||||
pub preferred: Au,
|
||||
|
|
|
@ -98,7 +98,7 @@ impl Flow for TableCaptionFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for TableCaptionFlow {
|
||||
impl fmt::Debug for TableCaptionFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "TableCaptionFlow: {:?}", self.block_flow)
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ impl Flow for TableCellFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for TableCellFlow {
|
||||
impl fmt::Debug for TableCellFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "TableCellFlow: {:?}", self.block_flow)
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ impl Flow for TableColGroupFlow {
|
|||
_: &Point2D<Au>) {}
|
||||
}
|
||||
|
||||
impl fmt::Show for TableColGroupFlow {
|
||||
impl fmt::Debug for TableColGroupFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self.fragment {
|
||||
Some(ref rb) => write!(f, "TableColGroupFlow: {:?}", rb),
|
||||
|
|
|
@ -332,7 +332,7 @@ impl Flow for TableRowFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for TableRowFlow {
|
||||
impl fmt::Debug for TableRowFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "TableRowFlow: {:?}", self.block_flow.fragment)
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ impl Flow for TableRowGroupFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for TableRowGroupFlow {
|
||||
impl fmt::Debug for TableRowGroupFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "TableRowGroupFlow: {:?}", self.block_flow.fragment)
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ use style::values::CSSFloat;
|
|||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Copy, RustcEncodable, Show)]
|
||||
#[derive(Copy, RustcEncodable, Debug)]
|
||||
pub enum TableLayout {
|
||||
Fixed,
|
||||
Auto
|
||||
|
@ -147,7 +147,7 @@ impl TableWrapperFlow {
|
|||
// Compute all the guesses for the column sizes, and sum them.
|
||||
let mut total_guess = AutoLayoutCandidateGuess::new();
|
||||
let guesses: Vec<AutoLayoutCandidateGuess> =
|
||||
self.column_intrinsic_inline_sizes.iter().map(|&mut:column_intrinsic_inline_size| {
|
||||
self.column_intrinsic_inline_sizes.iter().map(|column_intrinsic_inline_size| {
|
||||
let guess = AutoLayoutCandidateGuess::from_column_intrinsic_inline_size(
|
||||
column_intrinsic_inline_size,
|
||||
available_inline_size);
|
||||
|
@ -383,7 +383,7 @@ impl Flow for TableWrapperFlow {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for TableWrapperFlow {
|
||||
impl fmt::Debug for TableWrapperFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if self.block_flow.base.flags.is_float() {
|
||||
write!(f, "TableWrapperFlow(Float): {:?}", self.block_flow.fragment)
|
||||
|
@ -501,7 +501,7 @@ impl<'a> Add for &'a AutoLayoutCandidateGuess {
|
|||
|
||||
/// The `CSSFloat` member specifies the weight of the smaller of the two guesses, on a scale from
|
||||
/// 0.0 to 1.0.
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
enum SelectedAutoLayoutCandidateGuess {
|
||||
UseMinimumGuess,
|
||||
InterpolateBetweenMinimumGuessAndMinimumPercentageGuess(CSSFloat),
|
||||
|
|
|
@ -50,13 +50,13 @@ impl TextRunScanner {
|
|||
let mut last_whitespace = true;
|
||||
while !fragments.is_empty() {
|
||||
// Create a clump.
|
||||
self.clump.append(dlist::split(&mut fragments));
|
||||
self.clump.append(&mut dlist::split(&mut fragments));
|
||||
while !fragments.is_empty() && self.clump
|
||||
.back()
|
||||
.unwrap()
|
||||
.can_merge_with_fragment(fragments.front()
|
||||
.unwrap()) {
|
||||
self.clump.append(dlist::split(&mut fragments));
|
||||
self.clump.append(&mut dlist::split(&mut fragments));
|
||||
}
|
||||
|
||||
// Flush that clump to the list of fragments we're building up.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue