mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Add initial support for row height distribution (#31421)
This change adds a version of row height distribution that follows the distribtuion algorithm used for tables in Blink's LayoutNG. This is just an intermediate step toward implementing a distribution algorithm for both rows and columns more similar to Layout NG. The CSS Table 3 specification is often wrong with regard to web compatability, which is why we have abandoned it in favor of the Layout NG algorithm for row height distribution. this work. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
31cfaf290d
commit
127aa657c2
49 changed files with 591 additions and 302 deletions
|
@ -24,13 +24,6 @@ pub(crate) struct ContentSizes {
|
|||
|
||||
/// <https://drafts.csswg.org/css-sizing/#intrinsic-sizes>
|
||||
impl ContentSizes {
|
||||
pub fn zero() -> Self {
|
||||
Self {
|
||||
min_content: Au::zero(),
|
||||
max_content: Au::zero(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn map(&self, f: impl Fn(Au) -> Au) -> Self {
|
||||
Self {
|
||||
min_content: f(self.min_content),
|
||||
|
@ -57,6 +50,19 @@ impl ContentSizes {
|
|||
}
|
||||
}
|
||||
|
||||
impl Zero for ContentSizes {
|
||||
fn zero() -> Self {
|
||||
Self {
|
||||
min_content: Au::zero(),
|
||||
max_content: Au::zero(),
|
||||
}
|
||||
}
|
||||
|
||||
fn is_zero(&self) -> bool {
|
||||
self.min_content.is_zero() && self.max_content.is_zero()
|
||||
}
|
||||
}
|
||||
|
||||
impl Add for ContentSizes {
|
||||
type Output = Self;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue