mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:27:35 +00:00
LibHTML: Create anonymous blocks around inline children of blocks.
This commit is contained in:
parent
2caec95d30
commit
fc127eb769
9 changed files with 33 additions and 17 deletions
|
@ -1,8 +1,8 @@
|
|||
#include <LibHTML/DOM/Element.h>
|
||||
#include <LibHTML/Layout/LayoutBlock.h>
|
||||
|
||||
LayoutBlock::LayoutBlock(const Node& node, const StyledNode& styled_node)
|
||||
: LayoutNode(&node, styled_node)
|
||||
LayoutBlock::LayoutBlock(const Node* node, const StyledNode* styled_node)
|
||||
: LayoutNode(node, styled_node)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,14 @@ LayoutBlock::~LayoutBlock()
|
|||
{
|
||||
}
|
||||
|
||||
LayoutNode& LayoutBlock::inline_wrapper()
|
||||
{
|
||||
if (!last_child() || !last_child()->is_block()) {
|
||||
append_child(adopt(*new LayoutBlock(nullptr, nullptr)));
|
||||
}
|
||||
return *last_child();
|
||||
}
|
||||
|
||||
void LayoutBlock::layout()
|
||||
{
|
||||
compute_width();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue