mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
make test-tidy check that = have space after them
This commit is contained in:
parent
ccb8e46557
commit
17663315dd
23 changed files with 127 additions and 111 deletions
|
@ -39,9 +39,9 @@ extern crate clipboard;
|
|||
extern crate time;
|
||||
extern crate url;
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate core_graphics;
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate core_text;
|
||||
|
||||
pub use compositor_task::{CompositorEventListener, CompositorProxy, CompositorTask};
|
||||
|
|
|
@ -101,13 +101,13 @@ pub struct Font {
|
|||
|
||||
bitflags! {
|
||||
flags ShapingFlags: u8 {
|
||||
#[doc="Set if the text is entirely whitespace."]
|
||||
#[doc = "Set if the text is entirely whitespace."]
|
||||
const IS_WHITESPACE_SHAPING_FLAG = 0x01,
|
||||
#[doc="Set if we are to ignore ligatures."]
|
||||
#[doc = "Set if we are to ignore ligatures."]
|
||||
const IGNORE_LIGATURES_SHAPING_FLAG = 0x02,
|
||||
#[doc="Set if we are to disable kerning."]
|
||||
#[doc = "Set if we are to disable kerning."]
|
||||
const DISABLE_KERNING_SHAPING_FLAG = 0x04,
|
||||
#[doc="Text direction is right-to-left."]
|
||||
#[doc = "Text direction is right-to-left."]
|
||||
const RTL_FLAG = 0x08,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,16 +31,16 @@ use std::sync::Arc;
|
|||
use azure::azure_hl::BackendType;
|
||||
use azure::scaled_font::ScaledFont;
|
||||
|
||||
#[cfg(any(target_os="linux", target_os = "android"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
use azure::scaled_font::FontInfo;
|
||||
|
||||
#[cfg(any(target_os="linux", target_os = "android"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: Au) -> ScaledFont {
|
||||
ScaledFont::new(BackendType::Skia, FontInfo::FontData(&template.bytes),
|
||||
pt_size.to_f32_px())
|
||||
}
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: Au) -> ScaledFont {
|
||||
let cgfont = template.ctfont().as_ref().unwrap().copy_to_CGFont();
|
||||
ScaledFont::new(BackendType::Skia, &cgfont, pt_size.to_f32_px())
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#![feature(arc_weak)]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(box_raw))]
|
||||
#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(box_raw))]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(custom_attribute)]
|
||||
#![feature(custom_derive)]
|
||||
#![feature(hashmap_hasher)]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(heap_api))]
|
||||
#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(heap_api))]
|
||||
#![feature(mpsc_select)]
|
||||
#![feature(plugin)]
|
||||
#![feature(str_char)]
|
||||
|
@ -55,23 +55,23 @@ extern crate canvas_traits;
|
|||
extern crate harfbuzz;
|
||||
|
||||
// Linux and Android-specific library dependencies
|
||||
#[cfg(any(target_os="linux", target_os = "android"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
extern crate fontconfig;
|
||||
|
||||
#[cfg(any(target_os="linux", target_os = "android"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
extern crate freetype;
|
||||
|
||||
// Mac OS-specific library dependencies
|
||||
#[cfg(target_os="macos")] extern crate core_foundation;
|
||||
#[cfg(target_os="macos")] extern crate core_graphics;
|
||||
#[cfg(target_os="macos")] extern crate core_text;
|
||||
#[cfg(target_os = "macos")] extern crate core_foundation;
|
||||
#[cfg(target_os = "macos")] extern crate core_graphics;
|
||||
#[cfg(target_os = "macos")] extern crate core_text;
|
||||
|
||||
pub use paint_context::PaintContext;
|
||||
|
||||
// Private painting modules
|
||||
mod paint_context;
|
||||
|
||||
#[path="display_list/mod.rs"]
|
||||
#[path = "display_list/mod.rs"]
|
||||
pub mod display_list;
|
||||
pub mod paint_task;
|
||||
|
||||
|
@ -85,7 +85,7 @@ pub mod font_template;
|
|||
mod filters;
|
||||
|
||||
// Platform-specific implementations.
|
||||
#[path="platform/mod.rs"]
|
||||
#[path = "platform/mod.rs"]
|
||||
pub mod platform;
|
||||
|
||||
// Text
|
||||
|
|
|
@ -139,7 +139,7 @@ pub fn get_system_default_family(generic_name: &str) -> Option<String> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn get_last_resort_font_families() -> Vec<String> {
|
||||
vec!(
|
||||
"Fira Sans".to_owned(),
|
||||
|
@ -148,7 +148,7 @@ pub fn get_last_resort_font_families() -> Vec<String> {
|
|||
)
|
||||
}
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
#[cfg(target_os = "android")]
|
||||
pub fn get_last_resort_font_families() -> Vec<String> {
|
||||
vec!("Roboto".to_owned())
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
* 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/. */
|
||||
|
||||
#[cfg(any(target_os="linux", target_os = "android"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
pub use platform::freetype::{font, font_context, font_list, font_template};
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
pub use platform::macos::{font, font_context, font_list, font_template};
|
||||
|
||||
#[cfg(any(target_os="linux", target_os = "android"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
pub mod freetype {
|
||||
pub mod font;
|
||||
pub mod font_context;
|
||||
|
@ -16,7 +16,7 @@ pub mod freetype {
|
|||
pub mod font_template;
|
||||
}
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
pub mod macos {
|
||||
pub mod font;
|
||||
pub mod font_context;
|
||||
|
|
|
@ -561,7 +561,7 @@ pub struct BlockFlow {
|
|||
|
||||
bitflags! {
|
||||
flags BlockFlowFlags: u8 {
|
||||
#[doc="If this is set, then this block flow is the root flow."]
|
||||
#[doc = "If this is set, then this block flow is the root flow."]
|
||||
const IS_ROOT = 0x01,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ impl PrivateLayoutData {
|
|||
|
||||
bitflags! {
|
||||
flags LayoutDataFlags: u8 {
|
||||
#[doc="Whether a flow has been newly constructed."]
|
||||
#[doc = "Whether a flow has been newly constructed."]
|
||||
const HAS_NEWLY_CONSTRUCTED_FLOW = 0x01
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2300,10 +2300,10 @@ bitflags! {
|
|||
// Various flags we can use when splitting fragments. See
|
||||
// `calculate_split_position_using_breaking_strategy()`.
|
||||
flags SplitOptions: u8 {
|
||||
#[doc="True if this is the first fragment on the line."]
|
||||
#[doc = "True if this is the first fragment on the line."]
|
||||
const STARTS_LINE = 0x01,
|
||||
#[doc="True if we should attempt to split at character boundaries if this split fails. \
|
||||
This is used to implement `overflow-wrap: break-word`."]
|
||||
#[doc = "True if we should attempt to split at character boundaries if this split fails. \
|
||||
This is used to implement `overflow-wrap: break-word`."]
|
||||
const RETRY_AT_CHARACTER_BOUNDARIES = 0x02,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,8 +42,8 @@ bitflags! {
|
|||
|
||||
bitflags! {
|
||||
flags SpecialRestyleDamage: u8 {
|
||||
#[doc="If this flag is set, we need to reflow the entire document. This is more or less a \
|
||||
temporary hack to deal with cases that we don't handle incrementally yet."]
|
||||
#[doc = "If this flag is set, we need to reflow the entire document. This is more or less a \
|
||||
temporary hack to deal with cases that we don't handle incrementally yet."]
|
||||
const REFLOW_ENTIRE_DOCUMENT = 0x01,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,9 +183,9 @@ int_range_index! {
|
|||
|
||||
bitflags! {
|
||||
flags InlineReflowFlags: u8 {
|
||||
#[doc="The `white-space: nowrap` property from CSS 2.1 § 16.6 is in effect."]
|
||||
#[doc = "The `white-space: nowrap` property from CSS 2.1 § 16.6 is in effect."]
|
||||
const NO_WRAP_INLINE_REFLOW_FLAG = 0x01,
|
||||
#[doc="The `white-space: pre` property from CSS 2.1 § 16.6 is in effect."]
|
||||
#[doc = "The `white-space: pre` property from CSS 2.1 § 16.6 is in effect."]
|
||||
const WRAP_ON_NEWLINE_INLINE_REFLOW_FLAG = 0x02
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ extern crate util;
|
|||
extern crate url;
|
||||
extern crate style;
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate core_foundation;
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate io_surface;
|
||||
|
||||
pub mod compositor_msg;
|
||||
|
|
|
@ -13,9 +13,9 @@ extern crate ipc_channel;
|
|||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate profile_traits;
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
extern crate regex;
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
extern crate task_info;
|
||||
extern crate time as std_time;
|
||||
extern crate util;
|
||||
|
|
|
@ -368,7 +368,7 @@ mod system_reporter {
|
|||
use std::mem::size_of;
|
||||
use std::ptr::null_mut;
|
||||
use super::{JEMALLOC_HEAP_ALLOCATED_STR, SYSTEM_HEAP_ALLOCATED_STR};
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
use task_info::task_basic_info::{virtual_size, resident_size};
|
||||
|
||||
/// Collects global measurements from the OS and heap allocators.
|
||||
|
@ -418,12 +418,12 @@ mod system_reporter {
|
|||
request.reports_channel.send(reports);
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
extern {
|
||||
fn mallinfo() -> struct_mallinfo;
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
#[repr(C)]
|
||||
pub struct struct_mallinfo {
|
||||
arena: c_int,
|
||||
|
@ -438,7 +438,7 @@ mod system_reporter {
|
|||
keepcost: c_int,
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn get_system_heap_allocated() -> Option<usize> {
|
||||
let info: struct_mallinfo = unsafe { mallinfo() };
|
||||
|
||||
|
@ -457,7 +457,7 @@ mod system_reporter {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os="linux"))]
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
fn get_system_heap_allocated() -> Option<usize> {
|
||||
None
|
||||
}
|
||||
|
@ -507,14 +507,14 @@ mod system_reporter {
|
|||
($e:expr) => (match $e { Some(e) => e, None => return None })
|
||||
);
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn page_size() -> usize {
|
||||
unsafe {
|
||||
::libc::sysconf(::libc::_SC_PAGESIZE) as usize
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn get_proc_self_statm_field(field: usize) -> Option<usize> {
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
@ -527,37 +527,37 @@ mod system_reporter {
|
|||
Some(npages * page_size())
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn get_vsize() -> Option<usize> {
|
||||
get_proc_self_statm_field(0)
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn get_resident() -> Option<usize> {
|
||||
get_proc_self_statm_field(1)
|
||||
}
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
fn get_vsize() -> Option<usize> {
|
||||
virtual_size()
|
||||
}
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
fn get_resident() -> Option<usize> {
|
||||
resident_size()
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os="linux", target_os = "macos")))]
|
||||
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
|
||||
fn get_vsize() -> Option<usize> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os="linux", target_os = "macos")))]
|
||||
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
|
||||
fn get_resident() -> Option<usize> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn get_resident_segments() -> Vec<(String, usize)> {
|
||||
use regex::Regex;
|
||||
use std::collections::HashMap;
|
||||
|
@ -658,7 +658,7 @@ mod system_reporter {
|
|||
segs
|
||||
}
|
||||
|
||||
#[cfg(not(target_os="linux"))]
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
fn get_resident_segments() -> Vec<(String, usize)> {
|
||||
vec![]
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use num::Float;
|
|||
use std::ops::Deref;
|
||||
|
||||
/// Encapsulates the IDL restricted float type.
|
||||
#[derive(JSTraceable,Clone,Eq,PartialEq)]
|
||||
#[derive(JSTraceable, Clone, Eq, PartialEq)]
|
||||
pub struct Finite<T: Float>(T);
|
||||
|
||||
unsafe impl<T: Float> Zeroable for Finite<T> {}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#![deny(unsafe_code)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
#![doc="The script crate contains all matters DOM."]
|
||||
#![doc = "The script crate contains all matters DOM."]
|
||||
|
||||
#![plugin(string_cache_plugin)]
|
||||
#![plugin(plugins)]
|
||||
|
@ -103,7 +103,7 @@ mod webdriver_handlers;
|
|||
|
||||
use dom::bindings::codegen::RegisterBindings;
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
#[cfg(target_os = "linux")]
|
||||
#[allow(unsafe_code)]
|
||||
fn perform_platform_specific_initialization() {
|
||||
use std::mem;
|
||||
|
@ -119,7 +119,7 @@ fn perform_platform_specific_initialization() {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os="linux"))]
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
fn perform_platform_specific_initialization() {}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
|
|
|
@ -78,12 +78,12 @@ pub enum Direction {
|
|||
|
||||
/// Was the keyboard event accompanied by the standard control modifier,
|
||||
/// i.e. cmd on Mac OS or ctrl on other platforms.
|
||||
#[cfg(target_os="macos")]
|
||||
#[cfg(target_os = "macos")]
|
||||
fn is_control_key(mods: KeyModifiers) -> bool {
|
||||
mods.contains(SUPER) && !mods.contains(CONTROL | ALT)
|
||||
}
|
||||
|
||||
#[cfg(not(target_os="macos"))]
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
fn is_control_key(mods: KeyModifiers) -> bool {
|
||||
mods.contains(CONTROL) && !mods.contains(SUPER | ALT)
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ extern crate glutin_app as app;
|
|||
extern crate time;
|
||||
extern crate env_logger;
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
#[cfg(target_os = "android")]
|
||||
#[macro_use]
|
||||
extern crate android_glue;
|
||||
|
||||
|
@ -41,7 +41,7 @@ use servo::Browser;
|
|||
use std::rc::Rc;
|
||||
use util::opts;
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
#[cfg(target_os = "android")]
|
||||
use std::borrow::ToOwned;
|
||||
|
||||
fn main() {
|
||||
|
@ -134,16 +134,16 @@ impl app::NestedEventLoopListener for BrowserWrapper {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
#[cfg(target_os = "android")]
|
||||
fn setup_logging() {
|
||||
android::setup_logging();
|
||||
}
|
||||
|
||||
#[cfg(not(target_os="android"))]
|
||||
#[cfg(not(target_os = "android"))]
|
||||
fn setup_logging() {
|
||||
}
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
#[cfg(target_os = "android")]
|
||||
fn get_args() -> Vec<String> {
|
||||
vec![
|
||||
"servo".to_owned(),
|
||||
|
@ -151,7 +151,7 @@ fn get_args() -> Vec<String> {
|
|||
]
|
||||
}
|
||||
|
||||
#[cfg(not(target_os="android"))]
|
||||
#[cfg(not(target_os = "android"))]
|
||||
fn get_args() -> Vec<String> {
|
||||
use std::env;
|
||||
env::args().collect()
|
||||
|
|
|
@ -335,10 +335,10 @@ fn args_fail(msg: &str) -> ! {
|
|||
|
||||
// Always use CPU painting on android.
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
#[cfg(target_os = "android")]
|
||||
static FORCE_CPU_PAINTING: bool = true;
|
||||
|
||||
#[cfg(not(target_os="android"))]
|
||||
#[cfg(not(target_os = "android"))]
|
||||
static FORCE_CPU_PAINTING: bool = false;
|
||||
|
||||
enum UserAgent {
|
||||
|
@ -361,15 +361,15 @@ fn default_user_agent_string(agent: UserAgent) -> String {
|
|||
}.to_owned()
|
||||
}
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
#[cfg(target_os = "android")]
|
||||
const DEFAULT_USER_AGENT: UserAgent = UserAgent::Android;
|
||||
|
||||
// FIXME: This requires https://github.com/servo/servo/issues/7138 to provide the
|
||||
// correct string in Gonk builds (i.e., it will never be chosen today).
|
||||
#[cfg(target_os="gonk")]
|
||||
#[cfg(target_os = "gonk")]
|
||||
const DEFAULT_USER_AGENT: UserAgent = UserAgent::Gonk;
|
||||
|
||||
#[cfg(not(any(target_os="android", target_os="gonk")))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "gonk")))]
|
||||
const DEFAULT_USER_AGENT: UserAgent = UserAgent::Desktop;
|
||||
|
||||
pub fn default_opts() -> Opts {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue