1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-10 11:32:08 +00:00

LibHTML: The document node should have a LayoutDocument representative.

This will be a special LayoutBlock that provides the ICB dimensions based
on the containing frame.
This commit is contained in:
Andreas Kling 2019-07-01 07:27:17 +02:00
parent 0bfa864021
commit f1a0e8b8e6

View file

@ -5,6 +5,7 @@
#include <LibHTML/Dump.h>
#include <LibHTML/Frame.h>
#include <LibHTML/Layout/LayoutBlock.h>
#include <LibHTML/Layout/LayoutDocument.h>
#include <LibHTML/Layout/LayoutInline.h>
#include <stdio.h>
@ -59,6 +60,8 @@ void Frame::layout()
auto styled_root = generate_style_tree();
auto create_layout_node = [](const StyledNode& styled_node) -> RefPtr<LayoutNode> {
if (styled_node.node() && styled_node.node()->is_document())
return adopt(*new LayoutDocument(static_cast<const Document&>(*styled_node.node())));
switch (styled_node.display()) {
case Display::None:
return nullptr;