mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Remove reflow damage after reflowing table rows.
This commit is contained in:
parent
132810e739
commit
83a73a979e
1 changed files with 74 additions and 62 deletions
|
@ -21,6 +21,7 @@ use gfx_traits::print_tree::PrintTree;
|
||||||
use layout_debug;
|
use layout_debug;
|
||||||
use model::MaybeAuto;
|
use model::MaybeAuto;
|
||||||
use rustc_serialize::{Encodable, Encoder};
|
use rustc_serialize::{Encodable, Encoder};
|
||||||
|
use script_layout_interface::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW};
|
||||||
use std::cmp::max;
|
use std::cmp::max;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::iter::{Enumerate, IntoIterator, Peekable};
|
use std::iter::{Enumerate, IntoIterator, Peekable};
|
||||||
|
@ -106,14 +107,16 @@ impl TableRowFlow {
|
||||||
/// methods
|
/// methods
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn assign_block_size_table_row_base(&mut self, layout_context: &LayoutContext) {
|
fn assign_block_size_table_row_base(&mut self, layout_context: &LayoutContext) {
|
||||||
// Per CSS 2.1 § 17.5.3, find max_y = max(computed `block-size`, minimum block-size of all
|
if self.block_flow.base.restyle_damage.contains(REFLOW) {
|
||||||
// cells).
|
// Per CSS 2.1 § 17.5.3, find max_y = max(computed `block-size`, minimum block-size of
|
||||||
|
// all cells).
|
||||||
let mut max_block_size = Au(0);
|
let mut max_block_size = Au(0);
|
||||||
let thread_id = self.block_flow.base.thread_id;
|
let thread_id = self.block_flow.base.thread_id;
|
||||||
for kid in self.block_flow.base.child_iter_mut() {
|
for kid in self.block_flow.base.child_iter_mut() {
|
||||||
kid.place_float_if_applicable();
|
kid.place_float_if_applicable();
|
||||||
if !flow::base(kid).flags.is_float() {
|
if !flow::base(kid).flags.is_float() {
|
||||||
kid.assign_block_size_for_inorder_child_if_necessary(layout_context, thread_id);
|
kid.assign_block_size_for_inorder_child_if_necessary(layout_context,
|
||||||
|
thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -165,16 +168,25 @@ impl TableRowFlow {
|
||||||
// Now we know the cell height, vertical align the cell's children.
|
// Now we know the cell height, vertical align the cell's children.
|
||||||
child_table_cell.valign_children();
|
child_table_cell.valign_children();
|
||||||
|
|
||||||
// Write in the size of the relative containing block for children. (This information
|
// Write in the size of the relative containing block for children. (This
|
||||||
// is also needed to handle RTL.)
|
// information is also needed to handle RTL.)
|
||||||
child_table_cell.block_flow.base.early_absolute_position_info =
|
child_table_cell.block_flow.base.early_absolute_position_info =
|
||||||
EarlyAbsolutePositionInfo {
|
EarlyAbsolutePositionInfo {
|
||||||
relative_containing_block_size: self.block_flow.fragment.content_box().size,
|
relative_containing_block_size: self.block_flow
|
||||||
relative_containing_block_mode: self.block_flow.fragment.style().writing_mode,
|
.fragment
|
||||||
|
.content_box()
|
||||||
|
.size,
|
||||||
|
relative_containing_block_mode: self.block_flow
|
||||||
|
.fragment
|
||||||
|
.style()
|
||||||
|
.writing_mode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.block_flow.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn populate_collapsed_border_spacing<'a, I>(
|
pub fn populate_collapsed_border_spacing<'a, I>(
|
||||||
&mut self,
|
&mut self,
|
||||||
collapsed_inline_direction_border_widths_for_table: &[Au],
|
collapsed_inline_direction_border_widths_for_table: &[Au],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue