mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Stop sending " " to linebreaker for replaced content (#30740)
We previously sent a " " to the linebreaker in order to ensure that the next text had a soft wrap opportunity at the start. Calling `next(" ")` without waiting until the returned index was 1, violated some invariants of linebreaker ultimately causing a panic. Instead of using the linebreaker for this, simply keep a flag in the IFC layout state, which avoids the problem entirely. Fixes #30703.
This commit is contained in:
parent
53b0fa827d
commit
f1c291853e
8 changed files with 57 additions and 13 deletions
|
@ -220,7 +220,7 @@ impl<'a> TextRun {
|
|||
if text.len() == 0 {
|
||||
return (glyphs, true);
|
||||
}
|
||||
*breaker = Some(LineBreakLeafIter::new(&text, 0));
|
||||
*breaker = Some(LineBreakLeafIter::new(text, 0));
|
||||
}
|
||||
|
||||
let breaker = breaker.as_mut().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue