diff options
author | Oriol Brufau <obrufau@igalia.com> | 2024-01-30 13:38:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-30 12:38:20 +0000 |
commit | a4cc0c563eb4ff391ae4d5a64f147b8062531b07 (patch) | |
tree | aa4d9dacb605c5a8d3b48118b30e86ba4fe09d7a /components/script/dom/element.rs | |
parent | a07ad85eaa8d918c12244da61e07ff6822326abe (diff) | |
download | servo-a4cc0c563eb4ff391ae4d5a64f147b8062531b07.tar.gz servo-a4cc0c563eb4ff391ae4d5a64f147b8062531b07.zip |
Allow using cached client_rect() for paint-only reflow (#31219)
PR #31210 avoided the cache for all kinds of reflow, but it's actually
fine to use it for ReflowTriggerCondition::PaintPostponed.
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 6348bb412a9..7d2c9afb2aa 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -94,7 +94,9 @@ use crate::dom::create::create_element; use crate::dom::customelementregistry::{ CallbackReaction, CustomElementDefinition, CustomElementReaction, CustomElementState, }; -use crate::dom::document::{determine_policy_for_token, Document, LayoutDocumentHelpers}; +use crate::dom::document::{ + determine_policy_for_token, Document, LayoutDocumentHelpers, ReflowTriggerCondition, +}; use crate::dom::documentfragment::DocumentFragment; use crate::dom::domrect::DOMRect; use crate::dom::domtokenlist::DOMTokenList; @@ -3380,7 +3382,10 @@ impl Element { .and_then(|data| data.client_rect.as_ref()) .and_then(|rect| rect.get().ok()) { - if doc.needs_reflow().is_none() { + if matches!( + doc.needs_reflow(), + None | Some(ReflowTriggerCondition::PaintPostponed) + ) { return rect; } } |