layout: Respect alignment when sizing replaced abspos (#35085)

If an absolutely position element which is replaced has `justify-self`
or `align-self` set to `stretch`, and no inset is `auto` on that axis,
then an automatic size should behave as `stretch`, not as `fit-content`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-01-20 05:25:00 -08:00 committed by GitHub
parent 2965b2fda7
commit f6c166533e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 92 additions and 69 deletions

View file

@ -68,7 +68,23 @@ impl<T: Default> Default for LogicalVec2<T> {
}
}
impl<T: Copy> From<T> for LogicalVec2<T> {
fn from(value: T) -> Self {
Self {
inline: value,
block: value,
}
}
}
impl<T> LogicalVec2<T> {
pub(crate) fn as_ref(&self) -> LogicalVec2<&T> {
LogicalVec2 {
inline: &self.inline,
block: &self.block,
}
}
pub fn map_inline_and_block_axes<U>(
&self,
inline_f: impl FnOnce(&T) -> U,