mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Don't re-resolve already-resolved generated content
This fixes #7846, a failure in the "quotes-036.htm" test. Servo lays out this test correctly in its initial layout, but then messes it up in any relayout (whether it's an incremental or full layout). The problem is that the ResolveGeneratedContent traversal is not safe to run more than once on the same flow. It mutates some GeneratedContent fragments into ScannedText fragments, but leaves others unmodified (in particular, those that generate empty content). The next time layout runs, these remaining GeneratedContent fragments are processed *again* but with an incorrect correct quote nesting level (because some of the surrounding GeneratedContent fragments are gone). This patch ensures that each GeneratedContent fragment is resolved only once.
This commit is contained in:
parent
53aca4b80e
commit
5104d8244f
5 changed files with 16 additions and 11 deletions
|
@ -846,10 +846,8 @@ impl InlineFlow {
|
|||
first_line_indentation: Au(0),
|
||||
};
|
||||
|
||||
for fragment in &flow.fragments.fragments {
|
||||
if fragment.is_generated_content() {
|
||||
flow.base.restyle_damage.insert(RESOLVE_GENERATED_CONTENT)
|
||||
}
|
||||
if flow.fragments.fragments.iter().any(Fragment::is_unscanned_generated_content) {
|
||||
flow.base.restyle_damage.insert(RESOLVE_GENERATED_CONTENT);
|
||||
}
|
||||
|
||||
flow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue