Remove use of some other unstable features

This commit is contained in:
Simon Sapin 2020-04-15 15:17:52 +02:00
parent 7861b0be79
commit 7f975c3d5d
4 changed files with 11 additions and 8 deletions

View file

@ -303,7 +303,11 @@ impl InlineFormattingContext {
panic!("display:none does not generate an abspos box") panic!("display:none does not generate an abspos box")
}, },
}; };
let hoisted_box = box_.clone().to_hoisted(initial_start_corner, tree_rank); let hoisted_box = AbsolutelyPositionedBox::to_hoisted(
box_.clone(),
initial_start_corner,
tree_rank,
);
let hoisted_fragment = hoisted_box.fragment.clone(); let hoisted_fragment = hoisted_box.fragment.clone();
ifc.push_hoisted_box_to_positioning_context(hoisted_box); ifc.push_hoisted_box_to_positioning_context(hoisted_box);
ifc.current_nesting_level.fragments_so_far.push( ifc.current_nesting_level.fragments_so_far.push(
@ -786,7 +790,7 @@ impl TextRun {
glyphs, glyphs,
text_decoration_line: ifc.current_nesting_level.text_decoration_line, text_decoration_line: ifc.current_nesting_level.text_decoration_line,
})); }));
if runs.is_empty() { if runs.as_slice().is_empty() {
break; break;
} else { } else {
// New line // New line

View file

@ -315,7 +315,8 @@ impl BlockLevelBox {
)) ))
}, },
BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(box_) => { BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(box_) => {
let hoisted_box = box_.clone().to_hoisted(Vec2::zero(), tree_rank); let hoisted_box =
AbsolutelyPositionedBox::to_hoisted(box_.clone(), Vec2::zero(), tree_rank);
let hoisted_fragment = hoisted_box.fragment.clone(); let hoisted_fragment = hoisted_box.fragment.clone();
positioning_context.push(hoisted_box); positioning_context.push(hoisted_box);
Fragment::AbsoluteOrFixedPositioned(AbsoluteOrFixedPositionedFragment { Fragment::AbsoluteOrFixedPositioned(AbsoluteOrFixedPositionedFragment {

View file

@ -3,8 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#![deny(unsafe_code)] #![deny(unsafe_code)]
#![feature(arbitrary_self_types)]
#![feature(exact_size_is_empty)]
#[macro_use] #[macro_use]
extern crate serde; extern crate serde;

View file

@ -100,7 +100,7 @@ impl AbsolutelyPositionedBox {
} }
pub(crate) fn to_hoisted( pub(crate) fn to_hoisted(
self: Arc<Self>, self_: Arc<Self>,
initial_start_corner: Vec2<Length>, initial_start_corner: Vec2<Length>,
tree_rank: usize, tree_rank: usize,
) -> HoistedAbsolutelyPositionedBox { ) -> HoistedAbsolutelyPositionedBox {
@ -124,7 +124,7 @@ impl AbsolutelyPositionedBox {
} }
} }
let box_offsets = self.contents.style.box_offsets(); let box_offsets = self_.contents.style.box_offsets();
HoistedAbsolutelyPositionedBox { HoistedAbsolutelyPositionedBox {
tree_rank, tree_rank,
box_offsets: Vec2 { box_offsets: Vec2 {
@ -140,7 +140,7 @@ impl AbsolutelyPositionedBox {
), ),
}, },
fragment: ArcRefCell::new(None), fragment: ArcRefCell::new(None),
absolutely_positioned_box: self, absolutely_positioned_box: self_,
} }
} }
} }