Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing whitespace. #2055

Merged
merged 1 commit into from Apr 7, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/gfx/buffer_map.rs
Expand Up @@ -74,7 +74,7 @@ impl<T: Tile> BufferMap<T> {
counter: 0u,
}
}

/// Insert a new buffer into the map.
pub fn insert(&mut self, graphics_context: &NativePaintingGraphicsContext, new_buffer: T) {
let new_key = BufferKey::get(new_buffer.get_size_2d());
Expand Down Expand Up @@ -129,7 +129,7 @@ impl<T: Tile> BufferMap<T> {
Some(ref mut buffer_val) => {
buffer_val.last_action = self.counter;
self.counter += 1;

let buffer = buffer_val.buffers.pop().take_unwrap();
self.mem -= buffer.get_mem();
if buffer_val.buffers.is_empty() {
Expand All @@ -139,7 +139,7 @@ impl<T: Tile> BufferMap<T> {
}
None => None,
};

if flag {
self.map.pop(&key); // Don't store empty vectors!
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/gfx/font.rs
Expand Up @@ -273,9 +273,9 @@ impl<'a> Font {
fn make_shaper(&'a mut self) -> &'a Shaper {
// fast path: already created a shaper
match self.shaper {
Some(ref shaper) => {
Some(ref shaper) => {
let s: &'a Shaper = shaper;
return s;
return s;
},
None => {}
}
Expand Down Expand Up @@ -385,7 +385,7 @@ impl Font {

let glyphbuf = struct__AzGlyphBuffer {
mGlyphs: azglyphs.as_ptr(),
mNumGlyphs: azglyph_buf_len as uint32_t
mNumGlyphs: azglyph_buf_len as uint32_t
};

unsafe {
Expand Down
4 changes: 2 additions & 2 deletions src/components/gfx/font_list.rs
Expand Up @@ -53,7 +53,7 @@ impl FontList {
}

pub fn find_font_in_family<'a>(&'a mut self,
family_name: &~str,
family_name: &~str,
style: &SpecifiedFontStyle) -> Option<&'a FontEntry> {
// TODO(Issue #188): look up localized font family names if canonical name not found
// look up canonical name
Expand Down Expand Up @@ -81,7 +81,7 @@ impl FontList {
}
}

// Holds a specific font family, and the various
// Holds a specific font family, and the various
pub struct FontFamily {
family_name: ~str,
entries: ~[FontEntry],
Expand Down
4 changes: 2 additions & 2 deletions src/components/gfx/freetype_impl/font_context.rs
Expand Up @@ -10,7 +10,7 @@ use self::freetype::freetype::{
FT_Library,
};
use self::freetype::freetype::bindgen::{
FT_Init_FreeType,
FT_Init_FreeType,
FT_Done_FreeType
};
use fontconfig::font_list::path_from_identifier;
Expand Down Expand Up @@ -43,7 +43,7 @@ pub impl FreeTypeFontContextHandle {
let result = FT_Init_FreeType(ptr::to_unsafe_ptr(&ctx));
if !result.succeeded() { fail!(); }

FreeTypeFontContextHandle {
FreeTypeFontContextHandle {
ctx: @FreeTypeLibraryHandle { ctx: ctx },
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/gfx/platform/macos/font.rs
Expand Up @@ -94,7 +94,7 @@ impl FontHandleMethods for FontHandle {
fn family_name(&self) -> ~str {
self.ctfont.family_name()
}

fn face_name(&self) -> ~str {
self.ctfont.face_name()
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/gfx/render_context.rs
Expand Up @@ -87,11 +87,11 @@ impl<'a> RenderContext<'a> {

let path = path_builder.finish();
self.draw_target.push_clip(&path);
}
}

pub fn draw_pop_clip(&self) {
self.draw_target.pop_clip();
}
}

pub fn draw_image(&self, bounds: Rect<Au>, image: Arc<~Image>) {
let image = image.get();
Expand Down
2 changes: 1 addition & 1 deletion src/components/gfx/render_task.rs
Expand Up @@ -61,7 +61,7 @@ pub enum Msg {
pub struct BufferRequest {
// The rect in pixels that will be drawn to the screen
screen_rect: Rect<uint>,

// The rect in page coordinates that this tile represents
page_rect: Rect<f32>,
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/gfx/text/glyph.rs
Expand Up @@ -146,7 +146,7 @@ static GLYPH_COUNT_SHIFT: u32 = 8;
static FLAG_NOT_MISSING: u32 = 0x00000001;
static FLAG_NOT_CLUSTER_START: u32 = 0x00000002;
static FLAG_NOT_LIGATURE_GROUP_START: u32 = 0x00000004;

static FLAG_CHAR_IS_TAB: u32 = 0x00000008;
static FLAG_CHAR_IS_NEWLINE: u32 = 0x00000010;
//static FLAG_CHAR_IS_LOW_SURROGATE: u32 = 0x00000020;
Expand Down Expand Up @@ -183,7 +183,7 @@ impl GlyphEntry {
fn is_cluster_start(&self) -> bool {
self.has_flag(!FLAG_NOT_CLUSTER_START)
}

// True if original char was normal (U+0020) space. Other chars may
// map to space glyph, but this does not account for them.
fn char_is_space(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/components/gfx/text/mod.rs
Expand Up @@ -4,7 +4,7 @@

/* This file exists just to make it easier to import things inside of
./text/ without specifying the file they came out of imports.

Note that you still must define each of the files as a module in
servo.rc. This is not ideal and may be changed in the future. */

Expand Down
2 changes: 1 addition & 1 deletion src/components/gfx/text/shaping/mod.rs
Expand Up @@ -2,7 +2,7 @@
* 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/. */

//! Shaper encapsulates a specific shaper, such as Harfbuzz,
//! Shaper encapsulates a specific shaper, such as Harfbuzz,
/// Uniscribe, Pango, or Coretext.
///
/// Currently, only harfbuzz bindings are implemented.
Expand Down
12 changes: 6 additions & 6 deletions src/components/gfx/text/util.rs
Expand Up @@ -10,12 +10,12 @@ enum CompressionMode {
DiscardNewline
}

// ported from Gecko's nsTextFrameUtils::TransformText.
//
// ported from Gecko's nsTextFrameUtils::TransformText.
//
// High level TODOs:
//
// * Issue #113: consider incoming text state (arabic, etc)
// and propogate outgoing text state (dual of above)
// and propogate outgoing text state (dual of above)
//
// * Issue #114: record skipped and kept chars for mapping original to new text
//
Expand All @@ -42,7 +42,7 @@ pub fn transform_text(text: &str, mode: CompressionMode, incoming_whitespace: bo
if ch != '\n' {
new_line_index += 1;
}
out_str.push_char(ch);
out_str.push_char(ch);
}
}
text.len() > 0 && is_in_whitespace(text.char_at_reverse(0), mode)
Expand All @@ -53,7 +53,7 @@ pub fn transform_text(text: &str, mode: CompressionMode, incoming_whitespace: bo
for ch in text.chars() {
// TODO: discard newlines between CJK chars
let mut next_in_whitespace: bool = is_in_whitespace(ch, mode);

if !next_in_whitespace {
if is_always_discardable_char(ch) {
// revert whitespace setting, since this char was discarded
Expand All @@ -75,7 +75,7 @@ pub fn transform_text(text: &str, mode: CompressionMode, incoming_whitespace: bo
in_whitespace = next_in_whitespace;
} /* /for str::each_char */
in_whitespace
}
}
};

return (out_str, out_whitespace);
Expand Down
4 changes: 2 additions & 2 deletions src/components/main/compositing/compositor.rs
Expand Up @@ -107,7 +107,7 @@ pub struct IOCompositor {
/// The channel on which messages can be sent to the profiler.
profiler_chan: ProfilerChan,

/// Pending scroll to fragment event, if any
/// Pending scroll to fragment event, if any
fragment_point: Option<Point2D<f32>>
}

Expand Down Expand Up @@ -751,7 +751,7 @@ impl IOCompositor {

// Render to PNG. We must read from the back buffer (ie, before
// self.window.present()) as OpenGL ES 2 does not have glReadBuffer().
if self.load_complete && self.ready_state == FinishedLoading
if self.load_complete && self.ready_state == FinishedLoading
&& self.opts.output_file.is_some() {
let (width, height) = (self.window_size.width as uint, self.window_size.height as uint);
let path = from_str::<Path>(*self.opts.output_file.get_ref()).unwrap();
Expand Down
20 changes: 10 additions & 10 deletions src/components/main/compositing/compositor_layer.rs
Expand Up @@ -82,7 +82,7 @@ pub struct CompositorLayer {
/// add_buffer() calls that don't match the current epoch will be ignored.
epoch: Epoch,

/// The behavior of this layer when a scroll message is received.
/// The behavior of this layer when a scroll message is received.
wants_scroll_events: WantsScrollEventsFlag,

/// Whether an ancestor layer that receives scroll events moves this layer.
Expand Down Expand Up @@ -188,7 +188,7 @@ impl CompositorLayer {
unrendered_color: gfx::color::rgba(0.0, 0.0, 0.0, 0.0),
}
}

/// Creates a new root `CompositorLayer` bound to a composition pipeline with an optional page
/// size. If no page size is given, the layer is initially hidden and initialized without a
/// quadtree.
Expand Down Expand Up @@ -379,7 +379,7 @@ impl CompositorLayer {
result
}

// Takes in a MouseWindowEvent, determines if it should be passed to children, and
// Takes in a MouseWindowEvent, determines if it should be passed to children, and
// sends the event off to the appropriate pipeline. NB: the cursor position is in
// page coordinates.
pub fn send_mouse_event(&self, event: MouseWindowEvent, cursor: Point2D<f32>) {
Expand All @@ -398,7 +398,7 @@ impl CompositorLayer {
}
}
}

// This mouse event is mine!
let message = match event {
MouseWindowClickEvent(button, _) => ClickEvent(button, cursor),
Expand Down Expand Up @@ -518,7 +518,7 @@ impl CompositorLayer {
true
}
None => {
// ID does not match any of our immediate children, so recurse on
// ID does not match any of our immediate children, so recurse on
// descendents (including hidden children)
self.children
.mut_iter()
Expand Down Expand Up @@ -634,7 +634,7 @@ impl CompositorLayer {
fn texture_flip_and_target(_: bool, _: Size2D<uint>) -> (Flip, TextureTarget) {
(NoFlip, TextureTarget2D)
}

// A helper method to resize sublayers.
fn resize_helper(&mut self,
pipeline_id: PipelineId,
Expand Down Expand Up @@ -679,8 +679,8 @@ impl CompositorLayer {
true
}
None => false,
};
};

if found { // Boolean flag to get around double borrow of self
self.set_occlusions();
return true
Expand Down Expand Up @@ -790,7 +790,7 @@ impl CompositorLayer {
};
}
}

// Add LayerBuffers to the specified layer. Returns the layer buffer set back if the layer that
// matches the given pipeline ID was not found; otherwise returns None and consumes the layer
// buffer set.
Expand Down Expand Up @@ -910,7 +910,7 @@ impl CompositorLayer {
.any(|kid| kid.invalidate_rect(pipeline_id, layer_id, rect))
}
}

// Recursively sets occluded portions of quadtrees to Hidden, so that they do not ask for
// tile requests. If layers are moved, resized, or deleted, these portions may be updated.
fn set_occlusions(&mut self) {
Expand Down