mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Store SharedStyleContext in AbsoluteAssignBSizesTraversal.
This commit is contained in:
parent
e142b78850
commit
6f4b8f2505
2 changed files with 5 additions and 4 deletions
|
@ -452,7 +452,7 @@ fn translate_including_floats(cur_b: &mut Au, delta: Au, floats: &mut Floats) {
|
||||||
///
|
///
|
||||||
/// Note that flows with position 'fixed' just form a flat list as they all
|
/// Note that flows with position 'fixed' just form a flat list as they all
|
||||||
/// have the Root flow as their CB.
|
/// have the Root flow as their CB.
|
||||||
pub struct AbsoluteAssignBSizesTraversal<'a>(pub &'a LayoutContext<'a>);
|
pub struct AbsoluteAssignBSizesTraversal<'a>(pub &'a SharedStyleContext);
|
||||||
|
|
||||||
impl<'a> PreorderFlowTraversal for AbsoluteAssignBSizesTraversal<'a> {
|
impl<'a> PreorderFlowTraversal for AbsoluteAssignBSizesTraversal<'a> {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -475,7 +475,7 @@ impl<'a> PreorderFlowTraversal for AbsoluteAssignBSizesTraversal<'a> {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
block.calculate_absolute_block_size_and_margins(self.0.shared_context());
|
block.calculate_absolute_block_size_and_margins(self.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1046,7 +1046,7 @@ impl BlockFlow {
|
||||||
// This is preorder because the block-size of an absolute flow may depend on
|
// This is preorder because the block-size of an absolute flow may depend on
|
||||||
// the block-size of its containing block, which may also be an absolute flow.
|
// the block-size of its containing block, which may also be an absolute flow.
|
||||||
(&mut *self as &mut Flow).traverse_preorder_absolute_flows(
|
(&mut *self as &mut Flow).traverse_preorder_absolute_flows(
|
||||||
&mut AbsoluteAssignBSizesTraversal(layout_context));
|
&mut AbsoluteAssignBSizesTraversal(layout_context.shared_context()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't remove the dirty bits yet if we're absolutely-positioned, since our final size
|
// Don't remove the dirty bits yet if we're absolutely-positioned, since our final size
|
||||||
|
|
|
@ -33,6 +33,7 @@ use std::sync::Arc;
|
||||||
use std::{fmt, i32, isize, mem};
|
use std::{fmt, i32, isize, mem};
|
||||||
use style::computed_values::{display, overflow_x, position, text_align, text_justify};
|
use style::computed_values::{display, overflow_x, position, text_align, text_justify};
|
||||||
use style::computed_values::{text_overflow, vertical_align, white_space};
|
use style::computed_values::{text_overflow, vertical_align, white_space};
|
||||||
|
use style::context::StyleContext;
|
||||||
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||||
use style::properties::{ComputedValues, ServoComputedValues};
|
use style::properties::{ComputedValues, ServoComputedValues};
|
||||||
use style::values::computed::LengthOrPercentage;
|
use style::values::computed::LengthOrPercentage;
|
||||||
|
@ -1466,7 +1467,7 @@ impl Flow for InlineFlow {
|
||||||
// This is preorder because the block-size of an absolute flow may depend on
|
// This is preorder because the block-size of an absolute flow may depend on
|
||||||
// the block-size of its containing block, which may also be an absolute flow.
|
// the block-size of its containing block, which may also be an absolute flow.
|
||||||
(&mut *self as &mut Flow).traverse_preorder_absolute_flows(
|
(&mut *self as &mut Flow).traverse_preorder_absolute_flows(
|
||||||
&mut AbsoluteAssignBSizesTraversal(layout_context));
|
&mut AbsoluteAssignBSizesTraversal(layout_context.shared_context()));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.base.position.size.block = match self.lines.last() {
|
self.base.position.size.block = match self.lines.last() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue