layout: Properly parent table-row and table-row-group (#31619)

Put table cell content fragments into a hieararchy of fragments that
include their table row and table row group fragments. This ensures that
things like relative positioning and transforms set on rows and row
groups properly affect cells and cell content.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2024-03-14 11:33:42 +01:00 committed by GitHub
parent 0e78c8114b
commit 78fe461ff2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 439 additions and 160 deletions

View file

@ -4,7 +4,7 @@
use std::convert::From;
use std::fmt;
use std::ops::{Add, AddAssign, Sub};
use std::ops::{Add, AddAssign, Sub, SubAssign};
use app_units::Au;
use serde::Serialize;
@ -26,7 +26,7 @@ pub type LengthOrAuto = AutoOr<Length>;
pub type AuOrAuto = AutoOr<Au>;
pub type LengthPercentageOrAuto<'a> = AutoOr<&'a LengthPercentage>;
#[derive(Clone, Serialize)]
#[derive(Clone, Copy, Serialize)]
pub struct LogicalVec2<T> {
pub inline: T,
pub block: T,
@ -117,6 +117,34 @@ where
}
}
impl<T> AddAssign<LogicalVec2<T>> for LogicalVec2<T>
where
T: AddAssign<T> + Copy,
{
fn add_assign(&mut self, other: LogicalVec2<T>) {
self.add_assign(&other);
}
}
impl<T> SubAssign<&'_ LogicalVec2<T>> for LogicalVec2<T>
where
T: SubAssign<T> + Copy,
{
fn sub_assign(&mut self, other: &'_ LogicalVec2<T>) {
self.inline -= other.inline;
self.block -= other.block;
}
}
impl<T> SubAssign<LogicalVec2<T>> for LogicalVec2<T>
where
T: SubAssign<T> + Copy,
{
fn sub_assign(&mut self, other: LogicalVec2<T>) {
self.sub_assign(&other);
}
}
impl<T: Zero> LogicalVec2<T> {
pub fn zero() -> Self {
Self {