mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Add support for table rows, columns, rowgroups and colgroups (#31341)
This adds support for table rows, columns, rowgroups and colgroups. There are few additions here: 1. The createion of fragments, which allows script queries and hit testing to work properly. These fragments are empty as all cells are still direct descendants of the table fragment. 2. Properly handling size information from tracks and track groups as well as frustrating rules about reordering rowgroups. 3. Painting a background seemlessly across track groups and groups. This is a thing that isn't done in legacy layout (nor WebKit)! Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
74c07db56c
commit
02ae1f448e
57 changed files with 4274 additions and 21000 deletions
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use serde::Serialize;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
|
@ -20,6 +21,11 @@ use crate::geom::{
|
|||
};
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
|
||||
pub(crate) struct ExtraBackground {
|
||||
pub style: ServoArc<ComputedValues>,
|
||||
pub rect: LogicalRect<Au>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub(crate) struct BoxFragment {
|
||||
pub base: BaseFragment,
|
||||
|
@ -62,6 +68,9 @@ pub(crate) struct BoxFragment {
|
|||
/// during stacking context tree construction because they rely on the size of the
|
||||
/// scroll container.
|
||||
pub(crate) resolved_sticky_insets: Option<PhysicalSides<LengthOrAuto>>,
|
||||
|
||||
#[serde(skip_serializing)]
|
||||
pub extra_backgrounds: Vec<ExtraBackground>,
|
||||
}
|
||||
|
||||
impl BoxFragment {
|
||||
|
@ -149,6 +158,7 @@ impl BoxFragment {
|
|||
scrollable_overflow_from_children,
|
||||
overconstrained,
|
||||
resolved_sticky_insets: None,
|
||||
extra_backgrounds: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,6 +175,10 @@ impl BoxFragment {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn add_extra_background(&mut self, extra_background: ExtraBackground) {
|
||||
self.extra_backgrounds.push(extra_background);
|
||||
}
|
||||
|
||||
pub fn scrollable_overflow(
|
||||
&self,
|
||||
containing_block: &PhysicalRect<Length>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue