mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Auto merge of #26832 - servo:layout-2020-borrow-mut-independent-contexts, r=SimonSapin
Mutably borrow to do layout of independent formatting contexts We want to compute content sizes on demand rather than eagerly so we will need to mutate the independent formatting contexts that own the content sizes.
This commit is contained in:
commit
e044d8582c
2 changed files with 5 additions and 5 deletions
|
@ -275,7 +275,7 @@ impl InlineFormattingContext {
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
if let Some(child) = ifc.current_nesting_level.remaining_boxes.next() {
|
if let Some(child) = ifc.current_nesting_level.remaining_boxes.next() {
|
||||||
match &*child.borrow() {
|
match &mut *child.borrow_mut() {
|
||||||
InlineLevelBox::InlineBox(inline) => {
|
InlineLevelBox::InlineBox(inline) => {
|
||||||
let partial = inline.start_layout(child.clone(), &mut ifc);
|
let partial = inline.start_layout(child.clone(), &mut ifc);
|
||||||
ifc.partial_inline_boxes_stack.push(partial)
|
ifc.partial_inline_boxes_stack.push(partial)
|
||||||
|
@ -529,7 +529,7 @@ impl<'box_tree> PartialInlineBoxFragment<'box_tree> {
|
||||||
fn layout_atomic(
|
fn layout_atomic(
|
||||||
layout_context: &LayoutContext,
|
layout_context: &LayoutContext,
|
||||||
ifc: &mut InlineFormattingContextState,
|
ifc: &mut InlineFormattingContextState,
|
||||||
atomic: &IndependentFormattingContext,
|
atomic: &mut IndependentFormattingContext,
|
||||||
) {
|
) {
|
||||||
let pbm = atomic.style.padding_border_margin(&ifc.containing_block);
|
let pbm = atomic.style.padding_border_margin(&ifc.containing_block);
|
||||||
let margin = pbm.margin.auto_is(Length::zero);
|
let margin = pbm.margin.auto_is(Length::zero);
|
||||||
|
|
|
@ -206,7 +206,7 @@ fn layout_block_level_children(
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(tree_rank, box_)| {
|
.map(|(tree_rank, box_)| {
|
||||||
let mut fragment = box_.borrow().layout(
|
let mut fragment = box_.borrow_mut().layout(
|
||||||
layout_context,
|
layout_context,
|
||||||
positioning_context,
|
positioning_context,
|
||||||
containing_block,
|
containing_block,
|
||||||
|
@ -226,7 +226,7 @@ fn layout_block_level_children(
|
||||||
.mapfold_reduce_into(
|
.mapfold_reduce_into(
|
||||||
positioning_context,
|
positioning_context,
|
||||||
|positioning_context, (tree_rank, box_)| {
|
|positioning_context, (tree_rank, box_)| {
|
||||||
box_.borrow().layout(
|
box_.borrow_mut().layout(
|
||||||
layout_context,
|
layout_context,
|
||||||
positioning_context,
|
positioning_context,
|
||||||
containing_block,
|
containing_block,
|
||||||
|
@ -259,7 +259,7 @@ fn layout_block_level_children(
|
||||||
|
|
||||||
impl BlockLevelBox {
|
impl BlockLevelBox {
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&mut self,
|
||||||
layout_context: &LayoutContext,
|
layout_context: &LayoutContext,
|
||||||
positioning_context: &mut PositioningContext,
|
positioning_context: &mut PositioningContext,
|
||||||
containing_block: &ContainingBlock,
|
containing_block: &ContainingBlock,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue