mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Other language changes
This commit is contained in:
parent
4d23ce41af
commit
b451ff3e15
13 changed files with 45 additions and 45 deletions
|
@ -8,7 +8,7 @@
|
|||
url = "http://servo.org/")];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
#[feature(globs)];
|
||||
#[feature(globs, managed_boxes)];
|
||||
|
||||
extern mod azure;
|
||||
extern mod extra;
|
||||
|
|
|
@ -530,24 +530,20 @@ impl FlowContext for InlineFlow {
|
|||
child_base.floats_in = FloatContext::new(child_base.num_floats);
|
||||
}
|
||||
|
||||
{
|
||||
let this = &mut *self;
|
||||
let mut min_width = Au::new(0);
|
||||
let mut pref_width = Au::new(0);
|
||||
|
||||
let mut min_width = Au::new(0);
|
||||
let mut pref_width = Au::new(0);
|
||||
|
||||
for box in this.boxes.iter() {
|
||||
debug!("FlowContext[{:d}]: measuring {:s}", self.base.id, box.debug_str());
|
||||
let (this_minimum_width, this_preferred_width) =
|
||||
box.minimum_and_preferred_widths();
|
||||
min_width = Au::max(min_width, this_minimum_width);
|
||||
pref_width = Au::max(pref_width, this_preferred_width);
|
||||
}
|
||||
|
||||
this.base.min_width = min_width;
|
||||
this.base.pref_width = pref_width;
|
||||
this.base.num_floats = num_floats;
|
||||
for box in self.boxes.iter() {
|
||||
debug!("FlowContext[{:d}]: measuring {:s}", self.base.id, box.debug_str());
|
||||
let (this_minimum_width, this_preferred_width) =
|
||||
box.minimum_and_preferred_widths();
|
||||
min_width = Au::max(min_width, this_minimum_width);
|
||||
pref_width = Au::max(pref_width, this_preferred_width);
|
||||
}
|
||||
|
||||
self.base.min_width = min_width;
|
||||
self.base.pref_width = pref_width;
|
||||
self.base.num_floats = num_floats;
|
||||
}
|
||||
|
||||
/// Recursively (top-down) determines the actual width of child contexts and boxes. When called
|
||||
|
|
|
@ -101,9 +101,8 @@ impl Pipeline {
|
|||
// Wrap task creation within a supervised task so that failure will
|
||||
// only tear down those tasks instead of ours.
|
||||
let failure_chan = constellation_chan.clone();
|
||||
let (task_port, task_chan) = stream::<task::TaskResult>();
|
||||
let mut supervised_task = task::task();
|
||||
supervised_task.opts.notify_chan = Some(task_chan);
|
||||
let task_port = supervised_task.future_result();
|
||||
supervised_task.supervised();
|
||||
|
||||
spawn_with!(supervised_task, [script_port, resource_task, size, render_port,
|
||||
|
@ -138,8 +137,8 @@ impl Pipeline {
|
|||
|
||||
spawn_with!(task::task(), [failure_chan], {
|
||||
match task_port.recv() {
|
||||
task::Success => (),
|
||||
task::Failure => {
|
||||
Ok(*) => (),
|
||||
Err(*) => {
|
||||
failure_chan.send(FailureMsg(id, subpage_id));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#[license = "MPL"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
#[feature(globs, macro_rules)];
|
||||
#[feature(globs, macro_rules, managed_boxes)];
|
||||
|
||||
extern mod alert;
|
||||
extern mod azure;
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use resource_task::{Metadata, Payload, Done, LoaderTask, start_sending};
|
||||
use servo_util::io::ignoring_eof;
|
||||
|
||||
use std::io::{ReaderUtil, file_reader};
|
||||
use std::rt::io;
|
||||
use std::rt::io::Reader;
|
||||
use std::task;
|
||||
|
||||
static READ_SIZE: uint = 1024;
|
||||
|
@ -14,15 +16,17 @@ pub fn factory() -> LoaderTask {
|
|||
assert!("file" == url.scheme);
|
||||
let progress_chan = start_sending(start_chan, Metadata::default(url.clone()));
|
||||
do task::spawn {
|
||||
match file_reader(&from_str(url.path).unwrap()) {
|
||||
Ok(reader) => {
|
||||
match io::file::open(&url.path.as_slice(), io::Open, io::Read) {
|
||||
Some(mut reader) => {
|
||||
while !reader.eof() {
|
||||
let data = reader.read_bytes(READ_SIZE);
|
||||
progress_chan.send(Payload(data));
|
||||
do ignoring_eof {
|
||||
let data = reader.read_bytes(READ_SIZE);
|
||||
progress_chan.send(Payload(data));
|
||||
}
|
||||
}
|
||||
progress_chan.send(Done(Ok(())));
|
||||
}
|
||||
Err(*) => {
|
||||
None => {
|
||||
progress_chan.send(Done(Err(())));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -14,10 +14,10 @@ pub fn Image(width: uint, height: uint, depth: uint, data: ~[u8]) -> Image {
|
|||
stb_image::new_image(width, height, depth, data)
|
||||
}
|
||||
|
||||
static TEST_IMAGE: [u8, ..4962] = include_bin!("test.jpeg");
|
||||
static TEST_IMAGE: &'static [u8] = include_bin!("test.jpeg");
|
||||
|
||||
pub fn test_image_bin() -> ~[u8] {
|
||||
return vec::from_fn(4962, |i| TEST_IMAGE[i]);
|
||||
TEST_IMAGE.into_owned()
|
||||
}
|
||||
|
||||
pub fn load_from_memory(buffer: &[u8]) -> Option<Image> {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
url = "http://servo.org/")];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
#[feature(globs)];
|
||||
#[feature(globs, managed_boxes)];
|
||||
|
||||
extern mod geom;
|
||||
extern mod http;
|
||||
|
|
|
@ -23,7 +23,6 @@ use std::cell::Cell;
|
|||
use std::comm;
|
||||
use std::comm::SharedChan;
|
||||
use std::hashmap::HashSet;
|
||||
use std::io;
|
||||
use std::ptr;
|
||||
use std::int;
|
||||
use std::libc;
|
||||
|
@ -74,7 +73,7 @@ pub struct TimerData {
|
|||
impl Window {
|
||||
pub fn Alert(&self, s: &DOMString) {
|
||||
// Right now, just print to the console
|
||||
io::println(format!("ALERT: {:s}", null_str_as_empty(s)));
|
||||
println(format!("ALERT: {:s}", null_str_as_empty(s)));
|
||||
}
|
||||
|
||||
pub fn Close(&self) {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#[license = "MPL"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
#[feature(globs, macro_rules, struct_variant)];
|
||||
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
|
||||
|
||||
extern mod geom;
|
||||
extern mod gfx (name = "gfx");
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#[license = "MPL"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
#[feature(globs, macro_rules)];
|
||||
#[feature(globs, macro_rules, managed_boxes)];
|
||||
|
||||
extern mod extra;
|
||||
extern mod cssparser;
|
||||
|
|
|
@ -2,24 +2,26 @@
|
|||
* 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 std::io;
|
||||
use std::rt::io;
|
||||
use std::rt::io::Writer;
|
||||
use std::vec::raw::buf_as_slice;
|
||||
use std::cast::transmute;
|
||||
use std::mem::size_of;
|
||||
|
||||
fn hexdump_slice(buf: &[u8]) {
|
||||
let stderr = io::stderr();
|
||||
stderr.write_str(" ");
|
||||
let mut stderr = io::stderr();
|
||||
stderr.write(bytes!(" "));
|
||||
for (i, &v) in buf.iter().enumerate() {
|
||||
stderr.write_str(format!("{:02X} ", v as uint));
|
||||
let output = format!("{:02X} ", v as uint);
|
||||
stderr.write(output.as_bytes());
|
||||
match i % 16 {
|
||||
15 => stderr.write_str("\n "),
|
||||
7 => stderr.write_str(" "),
|
||||
15 => stderr.write(bytes!("\n ")),
|
||||
7 => stderr.write(bytes!(" ")),
|
||||
_ => ()
|
||||
}
|
||||
stderr.flush();
|
||||
}
|
||||
stderr.write_char('\n');
|
||||
stderr.write(bytes!("\n"));
|
||||
}
|
||||
|
||||
pub fn hexdump<T>(obj: &T) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
url = "http://servo.org/")];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
#[feature(macro_rules)];
|
||||
#[feature(macro_rules, managed_boxes)];
|
||||
|
||||
extern mod extra;
|
||||
extern mod geom;
|
||||
|
|
|
@ -12,7 +12,7 @@ extern mod extra;
|
|||
|
||||
use extra::test::{TestOpts, run_tests_console, TestDesc, TestDescAndFn, DynTestFn, DynTestName};
|
||||
use extra::getopts::{getopts, reqopt};
|
||||
use std::{os, run, io, str};
|
||||
use std::{os, run, str};
|
||||
use std::cell::Cell;
|
||||
use std::os::list_dir_path;
|
||||
|
||||
|
@ -89,7 +89,7 @@ fn run_test(file: ~str) {
|
|||
let infile = ~"file://" + path.display().to_str();
|
||||
let res = run::process_output("./servo", [~"-z", infile]);
|
||||
let out = str::from_utf8(res.output);
|
||||
io::print(out);
|
||||
print(out);
|
||||
let lines: ~[&str] = out.split_iter('\n').collect();
|
||||
for &line in lines.iter() {
|
||||
if line.contains("TEST-UNEXPECTED-FAIL") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue