mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix panic when html element has display: table.
This commit is contained in:
parent
e458dca65b
commit
7dbffeed20
5 changed files with 24 additions and 1 deletions
|
@ -295,7 +295,10 @@ pub trait Flow: fmt::Debug + Sync {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Marks this flow as the root flow. The default implementation is a no-op.
|
/// Marks this flow as the root flow. The default implementation is a no-op.
|
||||||
fn mark_as_root(&mut self) {}
|
fn mark_as_root(&mut self) {
|
||||||
|
debug!("called mark_as_root() on a flow of type {:?}", self.class());
|
||||||
|
panic!("called mark_as_root() on an unhandled flow");
|
||||||
|
}
|
||||||
|
|
||||||
// Note that the following functions are mostly called using static method
|
// Note that the following functions are mostly called using static method
|
||||||
// dispatch, so it's ok to have them in this trait. Plus, they have
|
// dispatch, so it's ok to have them in this trait. Plus, they have
|
||||||
|
|
|
@ -74,6 +74,10 @@ impl Flow for ListItemFlow {
|
||||||
&mut self.block_flow
|
&mut self.block_flow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn as_immutable_block<'a>(&'a self) -> &'a BlockFlow {
|
||||||
|
&self.block_flow
|
||||||
|
}
|
||||||
|
|
||||||
fn bubble_inline_sizes(&mut self) {
|
fn bubble_inline_sizes(&mut self) {
|
||||||
// The marker contributes no intrinsic inline-size, so…
|
// The marker contributes no intrinsic inline-size, so…
|
||||||
self.block_flow.bubble_inline_sizes()
|
self.block_flow.bubble_inline_sizes()
|
||||||
|
|
|
@ -48,6 +48,10 @@ impl Flow for MulticolFlow {
|
||||||
&mut self.block_flow
|
&mut self.block_flow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn as_immutable_block<'a>(&'a self) -> &'a BlockFlow {
|
||||||
|
&self.block_flow
|
||||||
|
}
|
||||||
|
|
||||||
fn bubble_inline_sizes(&mut self) {
|
fn bubble_inline_sizes(&mut self) {
|
||||||
// FIXME(SimonSapin) http://dev.w3.org/csswg/css-sizing/#multicol-intrinsic
|
// FIXME(SimonSapin) http://dev.w3.org/csswg/css-sizing/#multicol-intrinsic
|
||||||
self.block_flow.bubble_inline_sizes();
|
self.block_flow.bubble_inline_sizes();
|
||||||
|
|
|
@ -210,6 +210,10 @@ impl Flow for TableFlow {
|
||||||
&self.block_flow
|
&self.block_flow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn mark_as_root(&mut self) {
|
||||||
|
self.block_flow.mark_as_root();
|
||||||
|
}
|
||||||
|
|
||||||
fn column_intrinsic_inline_sizes<'a>(&'a mut self) -> &'a mut Vec<ColumnIntrinsicInlineSize> {
|
fn column_intrinsic_inline_sizes<'a>(&'a mut self) -> &'a mut Vec<ColumnIntrinsicInlineSize> {
|
||||||
&mut self.column_intrinsic_inline_sizes
|
&mut self.column_intrinsic_inline_sizes
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,6 +273,14 @@ impl Flow for TableWrapperFlow {
|
||||||
&mut self.block_flow
|
&mut self.block_flow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn as_immutable_block<'a>(&'a self) -> &'a BlockFlow {
|
||||||
|
&self.block_flow
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mark_as_root(&mut self) {
|
||||||
|
self.block_flow.mark_as_root();
|
||||||
|
}
|
||||||
|
|
||||||
fn bubble_inline_sizes(&mut self) {
|
fn bubble_inline_sizes(&mut self) {
|
||||||
// Get the intrinsic column inline-sizes info from the table flow.
|
// Get the intrinsic column inline-sizes info from the table flow.
|
||||||
for kid in self.block_flow.base.child_iter() {
|
for kid in self.block_flow.base.child_iter() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue