mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +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 mut issued_reflow = false;
|
||||||
let condition = self.Document().needs_reflow();
|
let condition = self.Document().needs_reflow();
|
||||||
let updating_the_rendering = reflow_goal == ReflowGoal::UpdateTheRendering;
|
let updating_the_rendering = reflow_goal == ReflowGoal::UpdateTheRendering;
|
||||||
|
let for_display = reflow_goal.needs_display();
|
||||||
if !updating_the_rendering || condition.is_some() {
|
if !updating_the_rendering || condition.is_some() {
|
||||||
debug!("Reflowing document ({:?})", self.pipeline_id());
|
debug!("Reflowing document ({:?})", self.pipeline_id());
|
||||||
issued_reflow = self.force_reflow(reflow_goal, condition);
|
issued_reflow = self.force_reflow(reflow_goal, condition);
|
||||||
|
|
||||||
// We shouldn't need a reflow immediately after a
|
// We shouldn't need a reflow immediately after a completed reflow, unless the reflow didn't
|
||||||
// reflow, except if we're waiting for a deferred paint.
|
// display anything and it wasn't for display. Queries can cause this to happen.
|
||||||
|
if issued_reflow {
|
||||||
let condition = self.Document().needs_reflow();
|
let condition = self.Document().needs_reflow();
|
||||||
|
let display_is_pending = condition == Some(ReflowTriggerCondition::PaintPostponed);
|
||||||
assert!(
|
assert!(
|
||||||
{
|
condition.is_none() || (display_is_pending && !for_display),
|
||||||
condition.is_none() ||
|
"Needed reflow after reflow: {:?}",
|
||||||
(!updating_the_rendering &&
|
|
||||||
condition == Some(ReflowTriggerCondition::PaintPostponed)) ||
|
|
||||||
self.layout_blocker.get().layout_blocked()
|
|
||||||
},
|
|
||||||
"condition was {:?}",
|
|
||||||
condition
|
condition
|
||||||
);
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
debug!(
|
debug!(
|
||||||
"Document ({:?}) doesn't need reflow - skipping it (goal {reflow_goal:?})",
|
"Document ({:?}) doesn't need reflow - skipping it (goal {reflow_goal:?})",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue