mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Eliminate the virtual is_float()
in favor of the flow flags
This commit is contained in:
parent
f5c6146de0
commit
be36fcd3b1
4 changed files with 20 additions and 26 deletions
|
@ -191,7 +191,7 @@ impl TableWrapperFlow {
|
|||
layout_context: &LayoutContext,
|
||||
parent_flow_inline_size: Au) {
|
||||
// Delegate to the appropriate inline size computer to find the constraint inputs.
|
||||
let input = if self.is_float() {
|
||||
let input = if self.block_flow.base.flags.is_float() {
|
||||
FloatNonReplaced.compute_inline_size_constraint_inputs(&mut self.block_flow,
|
||||
parent_flow_inline_size,
|
||||
layout_context)
|
||||
|
@ -202,7 +202,7 @@ impl TableWrapperFlow {
|
|||
};
|
||||
|
||||
// Delegate to the appropriate inline size computer to write the constraint solutions in.
|
||||
if self.is_float() {
|
||||
if self.block_flow.base.flags.is_float() {
|
||||
let solution = FloatNonReplaced.solve_inline_size_constraints(&mut self.block_flow,
|
||||
&input);
|
||||
FloatNonReplaced.set_inline_size_constraint_solutions(&mut self.block_flow, solution);
|
||||
|
@ -221,10 +221,6 @@ impl Flow for TableWrapperFlow {
|
|||
TableWrapperFlowClass
|
||||
}
|
||||
|
||||
fn is_float(&self) -> bool {
|
||||
self.block_flow.is_float()
|
||||
}
|
||||
|
||||
fn as_table_wrapper<'a>(&'a mut self) -> &'a mut TableWrapperFlow {
|
||||
self
|
||||
}
|
||||
|
@ -251,7 +247,7 @@ impl Flow for TableWrapperFlow {
|
|||
|
||||
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
debug!("assign_inline_sizes({}): assigning inline_size for flow",
|
||||
if self.is_float() {
|
||||
if self.block_flow.base.flags.is_float() {
|
||||
"floated table_wrapper"
|
||||
} else {
|
||||
"table_wrapper"
|
||||
|
@ -267,7 +263,7 @@ impl Flow for TableWrapperFlow {
|
|||
// Our inline-size was set to the inline-size of the containing block by the flow's parent.
|
||||
// Now compute the real value.
|
||||
let containing_block_inline_size = self.block_flow.base.block_container_inline_size;
|
||||
if self.is_float() {
|
||||
if self.block_flow.base.flags.is_float() {
|
||||
self.block_flow.float.as_mut().unwrap().containing_inline_size =
|
||||
containing_block_inline_size;
|
||||
}
|
||||
|
@ -308,7 +304,7 @@ impl Flow for TableWrapperFlow {
|
|||
fn assign_block_size_for_inorder_child_if_necessary<'a>(&mut self,
|
||||
layout_context: &'a LayoutContext<'a>)
|
||||
-> bool {
|
||||
if self.block_flow.is_float() {
|
||||
if self.block_flow.base.flags.is_float() {
|
||||
self.block_flow.place_float();
|
||||
return true
|
||||
}
|
||||
|
@ -343,7 +339,7 @@ impl Flow for TableWrapperFlow {
|
|||
|
||||
impl fmt::Show for TableWrapperFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if self.is_float() {
|
||||
if self.block_flow.base.flags.is_float() {
|
||||
write!(f, "TableWrapperFlow(Float): {}", self.block_flow.fragment)
|
||||
} else {
|
||||
write!(f, "TableWrapperFlow: {}", self.block_flow.fragment)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue