mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Place floats in layout 2020, but don't flow text around the floats yet.
This commit puts floats behind the `layout.floats.enabled` pref, because of the following issues and unimplemented features: * Inline formatting contexts don't take floats into account, so text doesn't flow around the floats yet. * Non-floated block formatting contexts don't take floats into account, so BFCs can overlap floats. * Block formatting contexts that contain floats don't expand vertically to contain all the floats. That is, floats can stick out the bottom of BFCs, contra spec.
This commit is contained in:
parent
053a0aa4fd
commit
cdec48328e
235 changed files with 1018 additions and 623 deletions
|
@ -251,6 +251,16 @@ impl<T> flow_relative::Sides<T> {
|
|||
self.block_start + self.block_end
|
||||
}
|
||||
|
||||
pub fn sum(&self) -> flow_relative::Vec2<T::Output>
|
||||
where
|
||||
T: Add + Copy,
|
||||
{
|
||||
flow_relative::Vec2 {
|
||||
inline: self.inline_sum(),
|
||||
block: self.block_sum(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_physical(&self, mode: WritingMode) -> PhysicalSides<T>
|
||||
where
|
||||
T: Clone,
|
||||
|
@ -290,6 +300,18 @@ impl<T> flow_relative::Sides<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> flow_relative::Sides<T>
|
||||
where
|
||||
T: Copy,
|
||||
{
|
||||
pub fn start_offset(&self) -> flow_relative::Vec2<T> {
|
||||
flow_relative::Vec2 {
|
||||
inline: self.inline_start,
|
||||
block: self.block_start,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl flow_relative::Sides<&'_ LengthPercentage> {
|
||||
pub fn percentages_relative_to(&self, basis: Length) -> flow_relative::Sides<Length> {
|
||||
self.map(|s| s.percentage_relative_to(basis))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue