mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
0e78c8114b
commit
78fe461ff2
23 changed files with 439 additions and 160 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue