mirror of
https://github.com/servo/servo.git
synced 2025-06-20 07:08:59 +01:00
auto merge of #4902 : servo/servo/warnings, r=jdm
This commit is contained in:
commit
fab8092581
9 changed files with 38 additions and 30 deletions
|
@ -63,7 +63,7 @@ use style::computed_values::{overflow, position, box_sizing, display, float};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
/// Information specific to floated blocks.
|
/// Information specific to floated blocks.
|
||||||
#[derive(Clone, Encodable)]
|
#[derive(Clone, RustcEncodable)]
|
||||||
pub struct FloatedBlockInfo {
|
pub struct FloatedBlockInfo {
|
||||||
/// The amount of inline size that is available for the float.
|
/// The amount of inline size that is available for the float.
|
||||||
pub containing_inline_size: Au,
|
pub containing_inline_size: Au,
|
||||||
|
@ -735,7 +735,7 @@ impl BlockFlow {
|
||||||
traversal.process(flow);
|
traversal.process(flow);
|
||||||
|
|
||||||
let cb_block_start_edge_offset = flow.generated_containing_block_rect().start.b;
|
let cb_block_start_edge_offset = flow.generated_containing_block_rect().start.b;
|
||||||
let mut descendant_offset_iter = mut_base(flow).abs_descendants.iter_with_offset();
|
let descendant_offset_iter = mut_base(flow).abs_descendants.iter_with_offset();
|
||||||
// Pass in the respective static y offset for each descendant.
|
// Pass in the respective static y offset for each descendant.
|
||||||
for (ref mut descendant_link, ref y_offset) in descendant_offset_iter {
|
for (ref mut descendant_link, ref y_offset) in descendant_offset_iter {
|
||||||
let block = descendant_link.as_block();
|
let block = descendant_link.as_block();
|
||||||
|
|
|
@ -71,7 +71,7 @@ impl ApplicableDeclarationsCacheEntry {
|
||||||
|
|
||||||
impl PartialEq for ApplicableDeclarationsCacheEntry {
|
impl PartialEq for ApplicableDeclarationsCacheEntry {
|
||||||
fn eq(&self, other: &ApplicableDeclarationsCacheEntry) -> bool {
|
fn eq(&self, other: &ApplicableDeclarationsCacheEntry) -> bool {
|
||||||
let this_as_query = ApplicableDeclarationsCacheQuery::new(self.declarations.as_slice());
|
let this_as_query = ApplicableDeclarationsCacheQuery::new(&*self.declarations);
|
||||||
this_as_query.eq(other)
|
this_as_query.eq(other)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ impl Eq for ApplicableDeclarationsCacheEntry {}
|
||||||
|
|
||||||
impl<H: Hasher+Writer> Hash<H> for ApplicableDeclarationsCacheEntry {
|
impl<H: Hasher+Writer> Hash<H> for ApplicableDeclarationsCacheEntry {
|
||||||
fn hash(&self, state: &mut H) {
|
fn hash(&self, state: &mut H) {
|
||||||
let tmp = ApplicableDeclarationsCacheQuery::new(self.declarations.as_slice());
|
let tmp = ApplicableDeclarationsCacheQuery::new(&*self.declarations);
|
||||||
tmp.hash(state);
|
tmp.hash(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -643,7 +643,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
||||||
if applicable_declarations.before.len() > 0 {
|
if applicable_declarations.before.len() > 0 {
|
||||||
damage = damage | self.cascade_node_pseudo_element(
|
damage = damage | self.cascade_node_pseudo_element(
|
||||||
Some(layout_data.shared_data.style.as_ref().unwrap()),
|
Some(layout_data.shared_data.style.as_ref().unwrap()),
|
||||||
applicable_declarations.before.as_slice(),
|
&*applicable_declarations.before,
|
||||||
&mut layout_data.data.before_style,
|
&mut layout_data.data.before_style,
|
||||||
applicable_declarations_cache,
|
applicable_declarations_cache,
|
||||||
false);
|
false);
|
||||||
|
@ -651,7 +651,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
||||||
if applicable_declarations.after.len() > 0 {
|
if applicable_declarations.after.len() > 0 {
|
||||||
damage = damage | self.cascade_node_pseudo_element(
|
damage = damage | self.cascade_node_pseudo_element(
|
||||||
Some(layout_data.shared_data.style.as_ref().unwrap()),
|
Some(layout_data.shared_data.style.as_ref().unwrap()),
|
||||||
applicable_declarations.after.as_slice(),
|
&*applicable_declarations.after,
|
||||||
&mut layout_data.data.after_style,
|
&mut layout_data.data.after_style,
|
||||||
applicable_declarations_cache,
|
applicable_declarations_cache,
|
||||||
false);
|
false);
|
||||||
|
|
|
@ -468,9 +468,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
position_to_offset(gradient.stops[i - 1].position.unwrap(), length)
|
position_to_offset(gradient.stops[i - 1].position.unwrap(), length)
|
||||||
};
|
};
|
||||||
let (end_index, end_offset) =
|
let (end_index, end_offset) =
|
||||||
match gradient.stops
|
match gradient.stops[i..]
|
||||||
.as_slice()
|
|
||||||
.slice_from(i)
|
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.find(|&(_, ref stop)| stop.position.is_some()) {
|
.find(|&(_, ref stop)| stop.position.is_some()) {
|
||||||
|
|
|
@ -638,16 +638,16 @@ impl Descendants {
|
||||||
/// Return an iterator over the descendant flows.
|
/// Return an iterator over the descendant flows.
|
||||||
pub fn iter<'a>(&'a mut self) -> DescendantIter<'a> {
|
pub fn iter<'a>(&'a mut self) -> DescendantIter<'a> {
|
||||||
DescendantIter {
|
DescendantIter {
|
||||||
iter: self.descendant_links.slice_from_mut(0).iter_mut(),
|
iter: self.descendant_links.iter_mut(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return an iterator over (descendant, static y offset).
|
/// Return an iterator over (descendant, static y offset).
|
||||||
pub fn iter_with_offset<'a>(&'a mut self) -> DescendantOffsetIter<'a> {
|
pub fn iter_with_offset<'a>(&'a mut self) -> DescendantOffsetIter<'a> {
|
||||||
let descendant_iter = DescendantIter {
|
let descendant_iter = DescendantIter {
|
||||||
iter: self.descendant_links.slice_from_mut(0).iter_mut(),
|
iter: self.descendant_links.iter_mut(),
|
||||||
};
|
};
|
||||||
descendant_iter.zip(self.static_block_offsets.slice_from_mut(0).iter_mut())
|
descendant_iter.zip(self.static_block_offsets.iter_mut())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1484,7 +1484,7 @@ impl Fragment {
|
||||||
/// A helper method that uses the breaking strategy described by `slice_iterator` (at present,
|
/// A helper method that uses the breaking strategy described by `slice_iterator` (at present,
|
||||||
/// either natural word breaking or character breaking) to split this fragment.
|
/// either natural word breaking or character breaking) to split this fragment.
|
||||||
fn calculate_split_position_using_breaking_strategy<'a,I>(&self,
|
fn calculate_split_position_using_breaking_strategy<'a,I>(&self,
|
||||||
mut slice_iterator: I,
|
slice_iterator: I,
|
||||||
max_inline_size: Au,
|
max_inline_size: Au,
|
||||||
flags: SplitOptions)
|
flags: SplitOptions)
|
||||||
-> Option<SplitResult>
|
-> Option<SplitResult>
|
||||||
|
|
|
@ -14,11 +14,11 @@ use serialize::json;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::old_io::File;
|
use std::old_io::File;
|
||||||
use std::sync::atomic::{AtomicUint, Ordering, ATOMIC_UINT_INIT};
|
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
|
||||||
|
|
||||||
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
|
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
|
||||||
|
|
||||||
static mut DEBUG_ID_COUNTER: AtomicUint = ATOMIC_UINT_INIT;
|
static mut DEBUG_ID_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
|
||||||
|
|
||||||
pub struct Scope;
|
pub struct Scope;
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,25 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#![feature(thread_local, unsafe_destructor, box_syntax, plugin, int_uint)]
|
#![feature(alloc)]
|
||||||
|
#![feature(box_syntax)]
|
||||||
|
#![feature(collections)]
|
||||||
|
#![feature(core)]
|
||||||
|
#![feature(hash)]
|
||||||
|
#![feature(int_uint)]
|
||||||
|
#![feature(io)]
|
||||||
|
#![feature(libc)]
|
||||||
|
#![feature(path)]
|
||||||
|
#![feature(plugin)]
|
||||||
|
#![feature(rustc_private)]
|
||||||
|
#![feature(std_misc)]
|
||||||
|
#![feature(thread_local)]
|
||||||
|
#![feature(unicode)]
|
||||||
|
#![feature(unsafe_destructor)]
|
||||||
|
|
||||||
#![deny(unsafe_blocks)]
|
#![deny(unsafe_blocks)]
|
||||||
#![allow(unrooted_must_root)]
|
#![allow(unrooted_must_root)]
|
||||||
#![allow(missing_copy_implementations)]
|
#![allow(missing_copy_implementations)]
|
||||||
#![allow(unstable)]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#![feature(thread_local)]
|
#![feature(core, env, libc, path, rustc_private, std_misc, thread_local)]
|
||||||
|
|
||||||
#![allow(missing_copy_implementations)]
|
#![allow(missing_copy_implementations)]
|
||||||
#![allow(unstable)]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
@ -51,8 +50,6 @@ use util::opts;
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
use util::taskpool::TaskPool;
|
use util::taskpool::TaskPool;
|
||||||
|
|
||||||
#[cfg(not(test))]
|
|
||||||
use std::os;
|
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
|
@ -67,6 +64,8 @@ pub struct Browser<Window> {
|
||||||
impl<Window> Browser<Window> where Window: WindowMethods + 'static {
|
impl<Window> Browser<Window> where Window: WindowMethods + 'static {
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
pub fn new(window: Option<Rc<Window>>) -> Browser<Window> {
|
pub fn new(window: Option<Rc<Window>>) -> Browser<Window> {
|
||||||
|
use std::env;
|
||||||
|
|
||||||
::util::opts::set_experimental_enabled(opts::get().enable_experimental);
|
::util::opts::set_experimental_enabled(opts::get().enable_experimental);
|
||||||
let opts = opts::get();
|
let opts = opts::get();
|
||||||
RegisterBindings::RegisterProxyHandlers();
|
RegisterBindings::RegisterProxyHandlers();
|
||||||
|
@ -112,12 +111,12 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
|
||||||
storage_task);
|
storage_task);
|
||||||
|
|
||||||
// Send the URL command to the constellation.
|
// Send the URL command to the constellation.
|
||||||
let cwd = os::getcwd().unwrap();
|
let cwd = env::current_dir().unwrap();
|
||||||
for url in opts.urls.iter() {
|
for url in opts.urls.iter() {
|
||||||
let url = match url::Url::parse(url.as_slice()) {
|
let url = match url::Url::parse(&*url) {
|
||||||
Ok(url) => url,
|
Ok(url) => url,
|
||||||
Err(url::ParseError::RelativeUrlWithoutBase)
|
Err(url::ParseError::RelativeUrlWithoutBase)
|
||||||
=> url::Url::from_file_path(&cwd.join(url.as_slice())).unwrap(),
|
=> url::Url::from_file_path(&cwd.join(&*url)).unwrap(),
|
||||||
Err(_) => panic!("URL parsing failed"),
|
Err(_) => panic!("URL parsing failed"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#![allow(unstable)]
|
#![feature(env, os)]
|
||||||
|
|
||||||
#[cfg(target_os="android")]
|
#[cfg(target_os="android")]
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
@ -39,9 +39,6 @@ use compositing::windowing::WindowEvent;
|
||||||
#[cfg(target_os="android")]
|
#[cfg(target_os="android")]
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
|
|
||||||
#[cfg(not(any(test,target_os="android")))]
|
|
||||||
use std::os;
|
|
||||||
|
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
struct BrowserWrapper {
|
struct BrowserWrapper {
|
||||||
browser: Browser<app::window::Window>,
|
browser: Browser<app::window::Window>,
|
||||||
|
@ -60,7 +57,8 @@ fn get_args() -> Vec<String> {
|
||||||
|
|
||||||
#[cfg(not(target_os="android"))]
|
#[cfg(not(target_os="android"))]
|
||||||
fn get_args() -> Vec<String> {
|
fn get_args() -> Vec<String> {
|
||||||
os::args()
|
use std::env;
|
||||||
|
env::args().map(|s| s.into_string().unwrap()).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os="android")]
|
#[cfg(target_os="android")]
|
||||||
|
@ -113,7 +111,7 @@ fn setup_logging() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
if opts::from_cmdline_args(get_args().as_slice()) {
|
if opts::from_cmdline_args(&*get_args()) {
|
||||||
setup_logging();
|
setup_logging();
|
||||||
resource_task::global_init();
|
resource_task::global_init();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue