aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/inline.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <ecoal95@gmail.com>2016-07-10 00:53:37 -0700
committerEmilio Cobos Álvarez <ecoal95@gmail.com>2016-07-10 15:34:57 -0700
commit383ba964aba4ef74913a719a4f9cd2c49abc9241 (patch)
treeb84148eff0040b90dcb3845b156690fc4cbc9939 /components/layout/inline.rs
parent8f13bb24f12f21993304713226b39037c5633737 (diff)
downloadservo-383ba964aba4ef74913a719a4f9cd2c49abc9241.tar.gz
servo-383ba964aba4ef74913a719a4f9cd2c49abc9241.zip
layout: text: Don't consider the REQUIRES_LINE_BREAK_AFTERWARD_IF_WRAPPING_ON_NEWLINES if the fragment can wrap text.
This was making us fall in a loop where the start split was empty, but we didn't ignore it because the current fragment had this flag, but then we treated it differently depending on the white_space property. Not totally sure this is the proper fix, but it makes sense to me. In case it is: Fixes #12369.
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r--components/layout/inline.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index 6195024f2ca..5d7cbffb970 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -459,10 +459,12 @@ impl LineBreaker {
kind: FloatKind::Left,
});
+ let fragment_margin_box_inline_size = first_fragment.margin_box_inline_size();
+
// Simple case: if the fragment fits, then we can stop here.
- if line_bounds.size.inline > first_fragment.margin_box_inline_size() {
+ if line_bounds.size.inline > fragment_margin_box_inline_size {
debug!("LineBreaker: fragment fits on line {}", self.lines.len());
- return (line_bounds, first_fragment.margin_box_inline_size());
+ return (line_bounds, fragment_margin_box_inline_size);
}
// If not, but we can't split the fragment, then we'll place the line here and it will
@@ -471,7 +473,7 @@ impl LineBreaker {
debug!("LineBreaker: line doesn't fit, but is unsplittable");
}
- (line_bounds, first_fragment.margin_box_inline_size())
+ (line_bounds, fragment_margin_box_inline_size)
}
/// Performs float collision avoidance. This is called when adding a fragment is going to