ResizeObserver shouldn't always force a rendering update

This commit is contained in:
Martin Robinson 2025-08-01 22:50:12 +02:00
parent e340087b0c
commit 8ae1cd588c
2 changed files with 4 additions and 9 deletions

View file

@ -3670,9 +3670,6 @@ impl Document {
if self.has_pending_input_events() {
return true;
}
if self.has_resize_observers() {
return true;
}
if self.window().has_unhandled_resize_event() {
return true;
}

View file

@ -1377,12 +1377,10 @@ impl ScriptThread {
fn maybe_schedule_rendering_opportunity_after_rendering_update(&self, saw_any_reflows: bool) {
// If there are any pending reflows and we are not having rendering opportunities
// immediately after running "update the rendering," run it one more time.
if self
.documents
.borrow()
.iter()
.any(|(_, document)| document.needs_rendering_update())
{
if self.documents.borrow().iter().any(|(_, document)| {
document.needs_rendering_update() ||
(saw_any_reflows && document.has_resize_observers())
}) {
self.cancel_scheduled_update_the_rendering();
self.schedule_update_the_rendering_timer_if_necessary(Duration::ZERO);
}