mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Implement computation of table column widths (#31165)
* layout: Implement computation of table column widths This change implements the various steps of table column width computation, ignoring features that don't exist yet (such as separated borders, column elements, and colgroups). Co-authored-by: Oriol Brufau <obrufau@igalia.com> * Fix an issue with the assignment of column percent width * Respond to review comments --------- Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
dc34eec4d4
commit
d68c7e7881
16 changed files with 707 additions and 121 deletions
|
@ -308,7 +308,8 @@ fn calculate_inline_content_size_for_block_level_boxes(
|
|||
|
||||
impl AccumulatedData {
|
||||
fn max_size_including_uncleared_floats(&self) -> ContentSizes {
|
||||
self.max_size.max(self.left_floats.add(&self.right_floats))
|
||||
self.max_size
|
||||
.max(self.left_floats.union(&self.right_floats))
|
||||
}
|
||||
fn clear_floats(&mut self, clear: Clear) {
|
||||
match clear {
|
||||
|
@ -333,12 +334,12 @@ fn calculate_inline_content_size_for_block_level_boxes(
|
|||
let accumulate = |mut data: AccumulatedData, (size, float, clear)| {
|
||||
data.clear_floats(clear);
|
||||
match float {
|
||||
Float::Left => data.left_floats = data.left_floats.add(&size),
|
||||
Float::Right => data.right_floats = data.right_floats.add(&size),
|
||||
Float::Left => data.left_floats = data.left_floats.union(&size),
|
||||
Float::Right => data.right_floats = data.right_floats.union(&size),
|
||||
Float::None => {
|
||||
data.max_size = data
|
||||
.max_size
|
||||
.max(data.left_floats.add(&data.right_floats).add(&size));
|
||||
.max(data.left_floats.union(&data.right_floats).union(&size));
|
||||
data.left_floats = ContentSizes::zero();
|
||||
data.right_floats = ContentSizes::zero();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue