mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 06:27:35 +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
114 changed files with 863 additions and 880 deletions
|
@ -30,7 +30,7 @@
|
|||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/HTML/CanvasRenderingContext2D.h>
|
||||
#include <LibWeb/HTML/HTMLCanvasElement.h>
|
||||
#include <LibWeb/Layout/LayoutCanvas.h>
|
||||
#include <LibWeb/Layout/CanvasBox.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
|
@ -55,12 +55,12 @@ unsigned HTMLCanvasElement::height() const
|
|||
return attribute(HTML::AttributeNames::height).to_uint().value_or(150);
|
||||
}
|
||||
|
||||
RefPtr<LayoutNode> HTMLCanvasElement::create_layout_node(const CSS::StyleProperties* parent_style)
|
||||
RefPtr<Layout::Node> HTMLCanvasElement::create_layout_node(const CSS::StyleProperties* parent_style)
|
||||
{
|
||||
auto style = document().style_resolver().resolve_style(*this, parent_style);
|
||||
if (style->display() == CSS::Display::None)
|
||||
return nullptr;
|
||||
return adopt(*new LayoutCanvas(document(), *this, move(style)));
|
||||
return adopt(*new Layout::CanvasBox(document(), *this, move(style)));
|
||||
}
|
||||
|
||||
CanvasRenderingContext2D* HTMLCanvasElement::get_context(String type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue