mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Rename contents to context in AbsolutelyPositionedBox
This commit is contained in:
parent
264b4344fb
commit
b66dd66403
3 changed files with 12 additions and 12 deletions
|
@ -294,7 +294,7 @@ impl InlineFormattingContext {
|
||||||
InlineLevelBox::TextRun(run) => run.layout(layout_context, &mut ifc),
|
InlineLevelBox::TextRun(run) => run.layout(layout_context, &mut ifc),
|
||||||
InlineLevelBox::Atomic(a) => layout_atomic(layout_context, &mut ifc, a),
|
InlineLevelBox::Atomic(a) => layout_atomic(layout_context, &mut ifc, a),
|
||||||
InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(box_) => {
|
InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(box_) => {
|
||||||
let style = AtomicRef::map(box_.borrow(), |box_| &box_.contents.style);
|
let style = AtomicRef::map(box_.borrow(), |box_| &box_.context.style);
|
||||||
let initial_start_corner =
|
let initial_start_corner =
|
||||||
match Display::from(style.get_box().original_display) {
|
match Display::from(style.get_box().original_display) {
|
||||||
Display::GeneratingBox(DisplayGeneratingBox::OutsideInside {
|
Display::GeneratingBox(DisplayGeneratingBox::OutsideInside {
|
||||||
|
|
|
@ -326,7 +326,7 @@ impl BlockLevelBox {
|
||||||
positioning_context.push(hoisted_box);
|
positioning_context.push(hoisted_box);
|
||||||
Fragment::AbsoluteOrFixedPositioned(AbsoluteOrFixedPositionedFragment {
|
Fragment::AbsoluteOrFixedPositioned(AbsoluteOrFixedPositionedFragment {
|
||||||
hoisted_fragment,
|
hoisted_fragment,
|
||||||
position: box_.borrow().contents.style.clone_position(),
|
position: box_.borrow().context.style.clone_position(),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
BlockLevelBox::OutOfFlowFloatBox(_box_) => {
|
BlockLevelBox::OutOfFlowFloatBox(_box_) => {
|
||||||
|
|
|
@ -22,7 +22,7 @@ use style::Zero;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
pub(crate) struct AbsolutelyPositionedBox {
|
pub(crate) struct AbsolutelyPositionedBox {
|
||||||
pub contents: IndependentFormattingContext,
|
pub context: IndependentFormattingContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) struct PositioningContext {
|
pub(crate) struct PositioningContext {
|
||||||
|
@ -84,7 +84,7 @@ impl AbsolutelyPositionedBox {
|
||||||
!node_info.style.inline_box_offsets_are_both_non_auto(),
|
!node_info.style.inline_box_offsets_are_both_non_auto(),
|
||||||
);
|
);
|
||||||
Self {
|
Self {
|
||||||
contents: IndependentFormattingContext::construct(
|
context: IndependentFormattingContext::construct(
|
||||||
context,
|
context,
|
||||||
node_info,
|
node_info,
|
||||||
display_inside,
|
display_inside,
|
||||||
|
@ -124,7 +124,7 @@ impl AbsolutelyPositionedBox {
|
||||||
|
|
||||||
let box_offsets = {
|
let box_offsets = {
|
||||||
let box_ = self_.borrow();
|
let box_ = self_.borrow();
|
||||||
let box_offsets = box_.contents.style.box_offsets(containing_block);
|
let box_offsets = box_.context.style.box_offsets(containing_block);
|
||||||
Vec2 {
|
Vec2 {
|
||||||
inline: absolute_box_offsets(
|
inline: absolute_box_offsets(
|
||||||
initial_start_corner.inline,
|
initial_start_corner.inline,
|
||||||
|
@ -288,7 +288,7 @@ impl PositioningContext {
|
||||||
let position = box_
|
let position = box_
|
||||||
.absolutely_positioned_box
|
.absolutely_positioned_box
|
||||||
.borrow()
|
.borrow()
|
||||||
.contents
|
.context
|
||||||
.style
|
.style
|
||||||
.clone_position();
|
.clone_position();
|
||||||
match position {
|
match position {
|
||||||
|
@ -417,12 +417,12 @@ impl HoistedAbsolutelyPositionedBox {
|
||||||
let cbis = containing_block.size.inline;
|
let cbis = containing_block.size.inline;
|
||||||
let cbbs = containing_block.size.block;
|
let cbbs = containing_block.size.block;
|
||||||
let absolutely_positioned_box = self.absolutely_positioned_box.borrow_mut();
|
let absolutely_positioned_box = self.absolutely_positioned_box.borrow_mut();
|
||||||
let style = &absolutely_positioned_box.contents.style;
|
let style = &absolutely_positioned_box.context.style;
|
||||||
let pbm = style.padding_border_margin(&containing_block.into());
|
let pbm = style.padding_border_margin(&containing_block.into());
|
||||||
|
|
||||||
let size;
|
let size;
|
||||||
let replaced_used_size;
|
let replaced_used_size;
|
||||||
match absolutely_positioned_box.contents.as_replaced() {
|
match absolutely_positioned_box.context.as_replaced() {
|
||||||
Ok(replaced) => {
|
Ok(replaced) => {
|
||||||
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
|
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
|
||||||
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
|
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
|
||||||
|
@ -474,11 +474,11 @@ impl HoistedAbsolutelyPositionedBox {
|
||||||
|positioning_context| {
|
|positioning_context| {
|
||||||
let size;
|
let size;
|
||||||
let fragments;
|
let fragments;
|
||||||
match absolutely_positioned_box.contents.as_replaced() {
|
match absolutely_positioned_box.context.as_replaced() {
|
||||||
Ok(replaced) => {
|
Ok(replaced) => {
|
||||||
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
|
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
|
||||||
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
|
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
|
||||||
let style = &absolutely_positioned_box.contents.style;
|
let style = &absolutely_positioned_box.context.style;
|
||||||
size = replaced_used_size.unwrap();
|
size = replaced_used_size.unwrap();
|
||||||
fragments = replaced.make_fragments(style, size.clone());
|
fragments = replaced.make_fragments(style, size.clone());
|
||||||
},
|
},
|
||||||
|
@ -495,7 +495,7 @@ impl HoistedAbsolutelyPositionedBox {
|
||||||
pbm.padding_border_sums.inline -
|
pbm.padding_border_sums.inline -
|
||||||
margin.inline_sum();
|
margin.inline_sum();
|
||||||
absolutely_positioned_box
|
absolutely_positioned_box
|
||||||
.contents
|
.context
|
||||||
.content_sizes
|
.content_sizes
|
||||||
.shrink_to_fit(available_size)
|
.shrink_to_fit(available_size)
|
||||||
});
|
});
|
||||||
|
@ -550,7 +550,7 @@ impl HoistedAbsolutelyPositionedBox {
|
||||||
};
|
};
|
||||||
|
|
||||||
BoxFragment::new(
|
BoxFragment::new(
|
||||||
absolutely_positioned_box.contents.tag,
|
absolutely_positioned_box.context.tag,
|
||||||
style.clone(),
|
style.clone(),
|
||||||
fragments,
|
fragments,
|
||||||
content_rect,
|
content_rect,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue