style: @container(width:0) shouldn't match elements with no box

Depends on D163879

Differential Revision: https://phabricator.services.mozilla.com/D163844
This commit is contained in:
Oriol Brufau 2022-12-06 12:57:50 +00:00 committed by Martin Robinson
parent 6c02e9fdaa
commit 647d813c6b
3 changed files with 17 additions and 16 deletions

View file

@ -1041,9 +1041,9 @@ impl<'le> TElement for GeckoElement<'le> {
}
#[inline]
fn primary_content_box_size(&self) -> Size2D<Au> {
fn primary_content_box_size(&self) -> Size2D<Option<Au>> {
if !self.as_node().is_connected() {
return Size2D::zero();
return Size2D::new(None, None)
}
unsafe {
@ -1056,12 +1056,13 @@ impl<'le> TElement for GeckoElement<'le> {
.mPrimaryFrame
.as_ref();
if frame.is_null() {
return Size2D::zero();
return Size2D::new(None, None)
}
let mut width = 0;
let mut height = 0;
bindings::Gecko_ContentSize(*frame, &mut width, &mut height);
Size2D::new(Au(width), Au(height))
// FIXME: Should use None if there isn't size containment.
Size2D::new(Some(Au(width)), Some(Au(height)))
}
}