mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: Fix assertion verifying that reflow isn't necessary after reflow (#34645)
A reflow might still be necessary if it's necessary for display and the reflow itself wasn't for display. After this happens a display becomes necessary and the page is still dirty for layout purposes. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
b7e528d2ff
commit
6cddb88f64
1 changed files with 12 additions and 13 deletions
|
@ -2023,23 +2023,22 @@ impl Window {
|
|||
let mut issued_reflow = false;
|
||||
let condition = self.Document().needs_reflow();
|
||||
let updating_the_rendering = reflow_goal == ReflowGoal::UpdateTheRendering;
|
||||
let for_display = reflow_goal.needs_display();
|
||||
if !updating_the_rendering || condition.is_some() {
|
||||
debug!("Reflowing document ({:?})", self.pipeline_id());
|
||||
issued_reflow = self.force_reflow(reflow_goal, condition);
|
||||
|
||||
// We shouldn't need a reflow immediately after a
|
||||
// reflow, except if we're waiting for a deferred paint.
|
||||
let condition = self.Document().needs_reflow();
|
||||
assert!(
|
||||
{
|
||||
condition.is_none() ||
|
||||
(!updating_the_rendering &&
|
||||
condition == Some(ReflowTriggerCondition::PaintPostponed)) ||
|
||||
self.layout_blocker.get().layout_blocked()
|
||||
},
|
||||
"condition was {:?}",
|
||||
condition
|
||||
);
|
||||
// We shouldn't need a reflow immediately after a completed reflow, unless the reflow didn't
|
||||
// display anything and it wasn't for display. Queries can cause this to happen.
|
||||
if issued_reflow {
|
||||
let condition = self.Document().needs_reflow();
|
||||
let display_is_pending = condition == Some(ReflowTriggerCondition::PaintPostponed);
|
||||
assert!(
|
||||
condition.is_none() || (display_is_pending && !for_display),
|
||||
"Needed reflow after reflow: {:?}",
|
||||
condition
|
||||
);
|
||||
}
|
||||
} else {
|
||||
debug!(
|
||||
"Document ({:?}) doesn't need reflow - skipping it (goal {reflow_goal:?})",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue