mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
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.
This commit is contained in:
parent
8f13bb24f1
commit
383ba964ab
3 changed files with 22 additions and 22 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue