Remove the Node type parameter from Contents

We now pass the Node as an argument during DOM traversal in layout.
This commit is contained in:
Anthony Ramine 2019-12-12 11:33:28 +01:00
parent b2f6cc7144
commit 47944a39fc
6 changed files with 114 additions and 63 deletions

View file

@ -61,19 +61,19 @@ fn construct_for_root_element<'dom>(
Display::GeneratingBox(DisplayGeneratingBox::OutsideInside { inside, .. }) => inside,
};
let contents = replaced.map_or(Contents::OfElement(root_element), Contents::Replaced);
let contents = replaced.map_or(Contents::OfElement, Contents::Replaced);
if box_style.position.is_absolutely_positioned() {
(
ContainsFloats::No,
vec![Arc::new(BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(
AbsolutelyPositionedBox::construct(context, style, display_inside, contents),
AbsolutelyPositionedBox::construct(context, root_element, style, display_inside, contents),
))],
)
} else if box_style.float.is_floating() {
(
ContainsFloats::Yes,
vec![Arc::new(BlockLevelBox::OutOfFlowFloatBox(
FloatBox::construct(context, style, display_inside, contents),
FloatBox::construct(context, root_element, style, display_inside, contents),
))],
)
} else {
@ -82,6 +82,7 @@ fn construct_for_root_element<'dom>(
vec![Arc::new(BlockLevelBox::Independent(
IndependentFormattingContext::construct(
context,
root_element,
style,
display_inside,
contents,