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:
Martin Robinson 2023-11-30 15:46:14 +01:00 committed by GitHub
parent 53b0fa827d
commit f1c291853e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 13 deletions

View file

@ -382,6 +382,13 @@
]
]
},
"soft-wrap-opportunity-after-replaced-content-crash.html": [
"2f2707f2d5d6039718e5f904a1cdeb05866959a4",
[
null,
{}
]
],
"video-needs-layout-crash.html": [
"b8c52edf8272abc6f7c30372b1d37e9545d08c74",
[

View file

@ -1,2 +0,0 @@
[line-breaking-atomic-002.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[line-breaking-atomic-009.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[line-breaking-replaced-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[line-breaking-replaced-006.html]
expected: FAIL

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<link rel="help" href="https://github.com/servo/servo/issues/30703">
<link rel="author" href="mailto:mrobinson@igalia.com">
<body>
<br><img>&nbsp;
</body>
</html>