mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 07:18:51 +00:00
LibWeb: Rename LayoutNode classes and move them into Layout namespace
Bring the names of various boxes closer to spec language. This should hopefully make things easier to understand and hack on. :^) Some notable changes: - LayoutNode -> Layout::Node - LayoutBox -> Layout::Box - LayoutBlock -> Layout::BlockBox - LayoutReplaced -> Layout::ReplacedBox - LayoutDocument -> Layout::InitialContainingBlockBox - LayoutText -> Layout::TextNode - LayoutInline -> Layout::InlineNode Note that this is not strictly a "box tree" as we also hang inline/text nodes in the same tree, and they don't generate boxes. (Instead, they contribute line box fragments to their containing block!)
This commit is contained in:
parent
f358f2255f
commit
5aeab9878e
Notes:
sideshowbarker
2024-07-19 01:19:34 +09:00
Author: https://github.com/awesomekling
Commit: 5aeab9878e
114 changed files with 863 additions and 880 deletions
|
@ -30,7 +30,7 @@
|
|||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/HTML/HTMLObjectElement.h>
|
||||
#include <LibWeb/Layout/LayoutImage.h>
|
||||
#include <LibWeb/Layout/ImageBox.h>
|
||||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
@ -61,7 +61,7 @@ void HTMLObjectElement::parse_attribute(const FlyString& name, const String& val
|
|||
m_image_loader.load(document().complete_url(value));
|
||||
}
|
||||
|
||||
RefPtr<LayoutNode> HTMLObjectElement::create_layout_node(const CSS::StyleProperties* parent_style)
|
||||
RefPtr<Layout::Node> HTMLObjectElement::create_layout_node(const CSS::StyleProperties* parent_style)
|
||||
{
|
||||
if (m_should_show_fallback_content)
|
||||
return HTMLElement::create_layout_node(parent_style);
|
||||
|
@ -70,7 +70,7 @@ RefPtr<LayoutNode> HTMLObjectElement::create_layout_node(const CSS::StylePropert
|
|||
if (style->display() == CSS::Display::None)
|
||||
return nullptr;
|
||||
if (m_image_loader.has_image())
|
||||
return adopt(*new LayoutImage(document(), *this, move(style), m_image_loader));
|
||||
return adopt(*new Layout::ImageBox(document(), *this, move(style), m_image_loader));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue