aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/fragment.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-12-14 08:31:30 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-12-28 13:17:47 +0100
commitbe69f9c3e6a6f5efb5ba1edd50955cb12c111bf8 (patch)
treedb8be2dfee5cff6ef0c42e8d46c623eb87529e5a /components/layout/fragment.rs
parent82fc6d9f49a657e2857da3f1b22140e3b6efdf09 (diff)
downloadservo-be69f9c3e6a6f5efb5ba1edd50955cb12c111bf8.tar.gz
servo-be69f9c3e6a6f5efb5ba1edd50955cb12c111bf8.zip
Rustfmt has changed its default style :/
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r--components/layout/fragment.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index e95d0293894..3e84a36c595 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -4,8 +4,6 @@
//! The `Fragment` type, which represents the leaves of the layout tree.
-use app_units::Au;
-use canvas_traits::canvas::{CanvasId, CanvasMsg};
use crate::context::{with_thread_local_font_context, LayoutContext};
use crate::display_list::items::{ClipScrollNodeIndex, OpaqueNode, BLUR_INFLATION_FACTOR};
use crate::display_list::ToLayout;
@@ -22,6 +20,8 @@ use crate::text;
use crate::text::TextRunScanner;
use crate::wrapper::ThreadSafeLayoutNodeHelpers;
use crate::ServoArc;
+use app_units::Au;
+use canvas_traits::canvas::{CanvasId, CanvasMsg};
use euclid::{Point2D, Rect, Size2D, Vector2D};
use gfx::text::glyph::ByteIndex;
use gfx::text::text_run::{TextRun, TextRunSlice};
@@ -849,10 +849,10 @@ impl Fragment {
}
pub fn contains_node(&self, node_address: OpaqueNode) -> bool {
- node_address == self.node || self
- .inline_context
- .as_ref()
- .map_or(false, |ctx| ctx.contains_node(node_address))
+ node_address == self.node ||
+ self.inline_context
+ .as_ref()
+ .map_or(false, |ctx| ctx.contains_node(node_address))
}
/// Adds a style to the inline context for this fragment. If the inline context doesn't exist
@@ -1939,9 +1939,9 @@ impl Fragment {
// The advance is more than the remaining inline-size, so split here. First, check to
// see if we're going to overflow the line. If so, perform a best-effort split.
let mut remaining_range = slice.text_run_range();
- let split_is_empty = inline_start_range.is_empty() && !(self
- .requires_line_break_afterward_if_wrapping_on_newlines() &&
- !self.white_space().allow_wrap());
+ let split_is_empty = inline_start_range.is_empty() &&
+ !(self.requires_line_break_afterward_if_wrapping_on_newlines() &&
+ !self.white_space().allow_wrap());
if split_is_empty {
// We're going to overflow the line.
overflowing = true;
@@ -2416,9 +2416,9 @@ impl Fragment {
minimum_line_metrics.space_above_baseline
},
VerticalAlign::TextBottom => {
- offset = minimum_line_metrics.space_below_baseline - self
- .content_inline_metrics(layout_context)
- .space_below_baseline
+ offset = minimum_line_metrics.space_below_baseline -
+ self.content_inline_metrics(layout_context)
+ .space_below_baseline
},
VerticalAlign::Top => {
if let Some(actual_line_metrics) = actual_line_metrics {