aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/gecko/wrapper.rs
diff options
context:
space:
mode:
authorOriol Brufau <oriol-bugzilla@hotmail.com>2022-12-05 15:16:48 +0000
committerMartin Robinson <mrobinson@igalia.com>2023-11-04 08:17:09 +0100
commit748dd1eae2c734f7b6d7f986a0106a979c0fd824 (patch)
treed8f68e5abf51c05e1ea1f2dbc8ce0fc5c70a4385 /components/style/gecko/wrapper.rs
parentf11e232a538d6afca54a5d1a55fd327cd4f57d66 (diff)
downloadservo-748dd1eae2c734f7b6d7f986a0106a979c0fd824.tar.gz
servo-748dd1eae2c734f7b6d7f986a0106a979c0fd824.zip
style: Make container queries check content-box size
They were checking the border-box size (with paddings and borders), but https://drafts.csswg.org/css-contain-3/#size-container says it should be the content-box size. Differential Revision: https://phabricator.services.mozilla.com/D163784
Diffstat (limited to 'components/style/gecko/wrapper.rs')
-rw-r--r--components/style/gecko/wrapper.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs
index 92a532907f7..86a8d31d1d1 100644
--- a/components/style/gecko/wrapper.rs
+++ b/components/style/gecko/wrapper.rs
@@ -1041,7 +1041,7 @@ impl<'le> TElement for GeckoElement<'le> {
}
#[inline]
- fn primary_box_size(&self) -> Size2D<Au> {
+ fn primary_content_box_size(&self) -> Size2D<Au> {
if !self.as_node().is_connected() {
return Size2D::zero();
}
@@ -1058,7 +1058,10 @@ impl<'le> TElement for GeckoElement<'le> {
if frame.is_null() {
return Size2D::zero();
}
- Size2D::new(Au((**frame).mRect.width), Au((**frame).mRect.height))
+ let mut width = 0;
+ let mut height = 0;
+ bindings::Gecko_ContentSize(*frame, &mut width, &mut height);
+ Size2D::new(Au(width), Au(height))
}
}