mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -1541,12 +1541,11 @@ impl Fragment {
|
|||
/// information are both optional due to the possibility of them being whitespace.
|
||||
pub fn calculate_split_position(&self, max_inline_size: Au, starts_line: bool)
|
||||
-> Option<SplitResult> {
|
||||
let text_fragment_info =
|
||||
if let SpecificFragmentInfo::ScannedText(ref text_fragment_info) = self.specific {
|
||||
text_fragment_info
|
||||
} else {
|
||||
return None
|
||||
};
|
||||
let text_fragment_info = match self.specific {
|
||||
SpecificFragmentInfo::ScannedText(ref text_fragment_info)
|
||||
=> text_fragment_info,
|
||||
_ => return None,
|
||||
};
|
||||
|
||||
let mut flags = SplitOptions::empty();
|
||||
if starts_line {
|
||||
|
@ -1618,12 +1617,11 @@ impl Fragment {
|
|||
flags: SplitOptions)
|
||||
-> Option<SplitResult>
|
||||
where I: Iterator<Item=TextRunSlice<'a>> {
|
||||
let text_fragment_info =
|
||||
if let SpecificFragmentInfo::ScannedText(ref text_fragment_info) = self.specific {
|
||||
text_fragment_info
|
||||
} else {
|
||||
return None
|
||||
};
|
||||
let text_fragment_info = match self.specific {
|
||||
SpecificFragmentInfo::ScannedText(ref text_fragment_info)
|
||||
=> text_fragment_info,
|
||||
_ => return None,
|
||||
};
|
||||
|
||||
let mut remaining_inline_size = max_inline_size;
|
||||
let mut inline_start_range = Range::new(text_fragment_info.range.begin(), ByteIndex(0));
|
||||
|
@ -1661,7 +1659,8 @@ impl Fragment {
|
|||
// 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.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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue