Flow inlines around floats (#30243)

This implements the rest of the bulk of float support. Now inline
element flow around floats and floats can be pushed down by inline
elements before them.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2023-08-31 12:54:54 +02:00 committed by GitHub
parent cb2c876919
commit 96c51ba2e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 410 additions and 220 deletions

View file

@ -105,11 +105,11 @@ where
}
}
impl flow_relative::Vec2<Length> {
impl<T: Zero> flow_relative::Vec2<T> {
pub fn zero() -> Self {
Self {
inline: Length::zero(),
block: Length::zero(),
inline: T::zero(),
block: T::zero(),
}
}
}
@ -155,7 +155,7 @@ impl flow_relative::Vec2<Option<&'_ LengthPercentage>> {
}
}
impl flow_relative::Rect<Length> {
impl<T: Zero> flow_relative::Rect<T> {
pub fn zero() -> Self {
Self {
start_corner: flow_relative::Vec2::zero(),
@ -346,6 +346,17 @@ where
}
}
impl<T: Zero> flow_relative::Sides<T> {
pub(crate) fn zero() -> flow_relative::Sides<T> {
flow_relative::Sides {
inline_start: T::zero(),
inline_end: T::zero(),
block_start: T::zero(),
block_end: T::zero(),
}
}
}
impl<T> flow_relative::Rect<T> {
pub fn max_inline_position(&self) -> T
where