mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01: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
|
@ -256,6 +256,8 @@ fn clamp_size(size: Au,
|
|||
pub enum GeneratedContentInfo {
|
||||
ListItem,
|
||||
ContentItem(ContentItem),
|
||||
/// Placeholder for elements with generated content that did not generate any fragments.
|
||||
Empty,
|
||||
}
|
||||
|
||||
/// A hypothetical box (see CSS 2.1 § 10.3.7) for an absolutely-positioned block that was declared
|
||||
|
@ -1291,8 +1293,9 @@ impl Fragment {
|
|||
}
|
||||
|
||||
/// Returns true if and only if this fragment is a generated content fragment.
|
||||
pub fn is_generated_content(&self) -> bool {
|
||||
pub fn is_unscanned_generated_content(&self) -> bool {
|
||||
match self.specific {
|
||||
SpecificFragmentInfo::GeneratedContent(box GeneratedContentInfo::Empty) => false,
|
||||
SpecificFragmentInfo::GeneratedContent(..) => true,
|
||||
_ => false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue