mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
layout_2020: Use ArcRefCell in the fragment tree
This will allow mutability which is useful for things like animations.
This commit is contained in:
parent
07f6d783a3
commit
7cb0069be5
4 changed files with 133 additions and 114 deletions
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom_traversal::{Contents, NodeExt};
|
||||
use crate::formatting_contexts::IndependentFormattingContext;
|
||||
|
@ -282,7 +283,11 @@ impl PositioningContext {
|
|||
hoisted_boxes = take_hoisted_boxes_pending_layout(self);
|
||||
}
|
||||
|
||||
new_fragment.children.extend(laid_out_child_fragments);
|
||||
new_fragment.children.extend(
|
||||
laid_out_child_fragments
|
||||
.into_iter()
|
||||
.map(|fragment| ArcRefCell::new(fragment)),
|
||||
);
|
||||
}
|
||||
|
||||
pub(crate) fn push(&mut self, box_: HoistedAbsolutelyPositionedBox) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue