aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/gecko/wrapper.rs
diff options
context:
space:
mode:
authorOriol Brufau <oriol-bugzilla@hotmail.com>2022-12-14 01:55:11 +0000
committerMartin Robinson <mrobinson@igalia.com>2023-11-04 08:17:09 +0100
commitc4b8e451ed25cba70a33e6f91406d5fd443959e1 (patch)
treeb339f647e9de57a625b07dc16d5e905ce3e7e0f2 /components/style/gecko/wrapper.rs
parentcd50d30c31f24452c7edcda53c0d906e910c0a54 (diff)
downloadservo-c4b8e451ed25cba70a33e6f91406d5fd443959e1.tar.gz
servo-c4b8e451ed25cba70a33e6f91406d5fd443959e1.zip
style: Re-evaluate container queries when container gets display:contents
Differential Revision: https://phabricator.services.mozilla.com/D164234
Diffstat (limited to 'components/style/gecko/wrapper.rs')
-rw-r--r--components/style/gecko/wrapper.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs
index 69272b15417..bf06761d6f0 100644
--- a/components/style/gecko/wrapper.rs
+++ b/components/style/gecko/wrapper.rs
@@ -63,6 +63,7 @@ use crate::shared_lock::{Locked, SharedRwLock};
use crate::string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
use crate::stylist::CascadeData;
use crate::values::{AtomIdent, AtomString};
+use crate::values::computed::Display;
use crate::CaseSensitivityExt;
use crate::LocalName;
use app_units::Au;
@@ -1036,7 +1037,14 @@ impl<'le> TElement for GeckoElement<'le> {
}
#[inline]
- fn query_container_size(&self) -> Size2D<Option<Au>> {
+ fn query_container_size(&self, display: &Display) -> Size2D<Option<Au>> {
+ // If an element gets 'display: contents' and its nsIFrame has not been removed yet,
+ // Gecko_GetQueryContainerSize will not notice that it can't have size containment.
+ // Other cases like 'display: inline' will be handled once the new nsIFrame is created.
+ if display.is_contents() {
+ return Size2D::new(None, None);
+ }
+
let mut width = -1;
let mut height = -1;
unsafe {