mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
29
Libraries/LibHTML/Layout/LayoutNode.cpp
Normal file
29
Libraries/LibHTML/Layout/LayoutNode.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include <LibHTML/Layout/LayoutBlock.h>
|
||||
#include <LibHTML/Layout/LayoutNode.h>
|
||||
#include <LibHTML/CSS/StyledNode.h>
|
||||
|
||||
LayoutNode::LayoutNode(const Node* node, const StyledNode& styled_node)
|
||||
: m_node(node)
|
||||
, m_styled_node(styled_node)
|
||||
{
|
||||
}
|
||||
|
||||
LayoutNode::~LayoutNode()
|
||||
{
|
||||
}
|
||||
|
||||
void LayoutNode::layout()
|
||||
{
|
||||
for_each_child([](auto& child) {
|
||||
child.layout();
|
||||
});
|
||||
}
|
||||
|
||||
const LayoutBlock* LayoutNode::containing_block() const
|
||||
{
|
||||
for (auto* ancestor = parent(); ancestor; ancestor = ancestor->parent()) {
|
||||
if (ancestor->is_block())
|
||||
return static_cast<const LayoutBlock*>(ancestor);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue