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 model::MaybeAuto;
|
||||
use rustc_serialize::{Encodable, Encoder};
|
||||
use script_layout_interface::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW};
|
||||
use std::cmp::max;
|
||||
use std::fmt;
|
||||
use std::iter::{Enumerate, IntoIterator, Peekable};
|
||||
|
@ -106,14 +107,16 @@ impl TableRowFlow {
|
|||
/// methods
|
||||
#[inline(always)]
|
||||
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
|
||||
// cells).
|
||||
if self.block_flow.base.restyle_damage.contains(REFLOW) {
|
||||
// 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 thread_id = self.block_flow.base.thread_id;
|
||||
for kid in self.block_flow.base.child_iter_mut() {
|
||||
kid.place_float_if_applicable();
|
||||
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.
|
||||
child_table_cell.valign_children();
|
||||
|
||||
// Write in the size of the relative containing block for children. (This information
|
||||
// is also needed to handle RTL.)
|
||||
// Write in the size of the relative containing block for children. (This
|
||||
// information is also needed to handle RTL.)
|
||||
child_table_cell.block_flow.base.early_absolute_position_info =
|
||||
EarlyAbsolutePositionInfo {
|
||||
relative_containing_block_size: self.block_flow.fragment.content_box().size,
|
||||
relative_containing_block_mode: self.block_flow.fragment.style().writing_mode,
|
||||
relative_containing_block_size: self.block_flow
|
||||
.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>(
|
||||
&mut self,
|
||||
collapsed_inline_direction_border_widths_for_table: &[Au],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue