layout_2020: Stop throwing away hoisted boxes in nested absolutes

We were previously throwing away some boxes hoisted to containing blocks
for all descendants when they were contained by absolutes. This prevents
panics in existing web platform tests that would otherwise be triggered
by the addition of the `unreachable!` statement.
This commit is contained in:
Martin Robinson 2020-03-27 17:43:54 +01:00
parent 7d66871a9f
commit ac2f402ae0
3 changed files with 3 additions and 8 deletions

View file

@ -736,10 +736,7 @@ impl AbsoluteOrFixedPositionedFragment {
let hoisted_fragment = self.hoisted_fragment.borrow();
let fragment_ref = match hoisted_fragment.as_ref() {
Some(fragment_ref) => fragment_ref,
None => {
warn!("Found hoisted box with missing fragment.");
return;
},
None => unreachable!("Found hoisted box with missing fragment."),
};
let containing_block = match self.position {

View file

@ -6,8 +6,6 @@
#![feature(arbitrary_self_types)]
#![feature(exact_size_is_empty)]
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde;

View file

@ -226,8 +226,8 @@ impl PositioningContext {
let mut new_fragment = fragment_layout_fn(&mut new_context);
new_context.layout_collected_children(layout_context, &mut new_fragment);
*for_nearest_containing_block_for_all_descendants =
new_context.for_nearest_containing_block_for_all_descendants;
for_nearest_containing_block_for_all_descendants
.extend(new_context.for_nearest_containing_block_for_all_descendants);
new_fragment
}