diff options
Diffstat (limited to 'Libraries/LibWeb/DOM')
-rw-r--r-- | Libraries/LibWeb/DOM/Comment.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Document.cpp | 22 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Document.h | 8 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Element.cpp | 36 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Element.h | 8 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Node.cpp | 14 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Node.h | 10 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Text.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Text.h | 2 |
9 files changed, 54 insertions, 54 deletions
diff --git a/Libraries/LibWeb/DOM/Comment.cpp b/Libraries/LibWeb/DOM/Comment.cpp index 0814bd0bf6..7e3f0ab8d2 100644 --- a/Libraries/LibWeb/DOM/Comment.cpp +++ b/Libraries/LibWeb/DOM/Comment.cpp @@ -25,7 +25,7 @@ */ #include <LibWeb/DOM/Comment.h> -#include <LibWeb/Layout/LayoutText.h> +#include <LibWeb/Layout/TextNode.h> namespace Web::DOM { diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 0a1fe0e506..c7b00c14ee 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -54,7 +54,7 @@ #include <LibWeb/HTML/HTMLTitleElement.h> #include <LibWeb/InProcessWebView.h> #include <LibWeb/Layout/BlockFormattingContext.h> -#include <LibWeb/Layout/LayoutDocument.h> +#include <LibWeb/Layout/InitialContainingBlockBox.h> #include <LibWeb/Layout/LayoutTreeBuilder.h> #include <LibWeb/Namespace.h> #include <LibWeb/Origin.h> @@ -271,7 +271,7 @@ void Document::tear_down_layout_tree() // Gather up all the layout nodes in a vector and detach them from parents // while the vector keeps them alive. - NonnullRefPtrVector<LayoutNode> layout_nodes; + NonnullRefPtrVector<Layout::Node> layout_nodes; m_layout_root->for_each_in_subtree([&](auto& layout_node) { layout_nodes.append(layout_node); @@ -347,12 +347,12 @@ void Document::layout() return; if (!m_layout_root) { - LayoutTreeBuilder tree_builder; - m_layout_root = static_ptr_cast<LayoutDocument>(tree_builder.build(*this)); + Layout::LayoutTreeBuilder tree_builder; + m_layout_root = static_ptr_cast<Layout::InitialContainingBlockBox>(tree_builder.build(*this)); } Layout::BlockFormattingContext root_formatting_context(*m_layout_root); - root_formatting_context.run(LayoutMode::Default); + root_formatting_context.run(Layout::LayoutMode::Default); m_layout_root->set_needs_display(); @@ -380,9 +380,9 @@ void Document::update_layout() layout(); } -RefPtr<LayoutNode> Document::create_layout_node(const CSS::StyleProperties*) +RefPtr<Layout::Node> Document::create_layout_node(const CSS::StyleProperties*) { - return adopt(*new LayoutDocument(*this, CSS::StyleProperties::create())); + return adopt(*new Layout::InitialContainingBlockBox(*this, CSS::StyleProperties::create())); } void Document::set_link_color(Color color) @@ -400,14 +400,14 @@ void Document::set_visited_link_color(Color color) m_visited_link_color = color; } -const LayoutDocument* Document::layout_node() const +const Layout::InitialContainingBlockBox* Document::layout_node() const { - return static_cast<const LayoutDocument*>(Node::layout_node()); + return static_cast<const Layout::InitialContainingBlockBox*>(Node::layout_node()); } -LayoutDocument* Document::layout_node() +Layout::InitialContainingBlockBox* Document::layout_node() { - return static_cast<LayoutDocument*>(Node::layout_node()); + return static_cast<Layout::InitialContainingBlockBox*>(Node::layout_node()); } void Document::set_inspected_node(Node* node) diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h index c3d4dc523c..cb400bd6e2 100644 --- a/Libraries/LibWeb/DOM/Document.h +++ b/Libraries/LibWeb/DOM/Document.h @@ -125,8 +125,8 @@ public: virtual bool is_child_allowed(const Node&) const override; - const LayoutDocument* layout_node() const; - LayoutDocument* layout_node(); + const Layout::InitialContainingBlockBox* layout_node() const; + Layout::InitialContainingBlockBox* layout_node(); void schedule_style_update(); @@ -212,7 +212,7 @@ public: private: explicit Document(const URL&); - virtual RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style) override; + virtual RefPtr<Layout::Node> create_layout_node(const CSS::StyleProperties* parent_style) override; void tear_down_layout_tree(); @@ -244,7 +244,7 @@ private: RefPtr<Window> m_window; - RefPtr<LayoutDocument> m_layout_root; + RefPtr<Layout::InitialContainingBlockBox> m_layout_root; Optional<Color> m_link_color; Optional<Color> m_active_link_color; diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 51b77ea9f7..7e0ab56d8f 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -34,14 +34,14 @@ #include <LibWeb/DOM/Text.h> #include <LibWeb/Dump.h> #include <LibWeb/HTML/Parser/HTMLDocumentParser.h> -#include <LibWeb/Layout/LayoutBlock.h> -#include <LibWeb/Layout/LayoutInline.h> -#include <LibWeb/Layout/LayoutListItem.h> -#include <LibWeb/Layout/LayoutTable.h> -#include <LibWeb/Layout/LayoutTableCell.h> -#include <LibWeb/Layout/LayoutTableRow.h> -#include <LibWeb/Layout/LayoutTableRowGroup.h> +#include <LibWeb/Layout/BlockBox.h> +#include <LibWeb/Layout/InlineNode.h> #include <LibWeb/Layout/LayoutTreeBuilder.h> +#include <LibWeb/Layout/ListItemBox.h> +#include <LibWeb/Layout/TableBox.h> +#include <LibWeb/Layout/TableCellBox.h> +#include <LibWeb/Layout/TableRowBox.h> +#include <LibWeb/Layout/TableRowGroupBox.h> namespace Web::DOM { @@ -112,7 +112,7 @@ bool Element::has_class(const FlyString& class_name) const return false; } -RefPtr<LayoutNode> Element::create_layout_node(const CSS::StyleProperties* parent_style) +RefPtr<Layout::Node> Element::create_layout_node(const CSS::StyleProperties* parent_style) { auto style = document().style_resolver().resolve_style(*this, parent_style); const_cast<Element&>(*this).m_resolved_style = style; @@ -125,26 +125,26 @@ RefPtr<LayoutNode> Element::create_layout_node(const CSS::StyleProperties* paren return nullptr; if (display == CSS::Display::Block) - return adopt(*new LayoutBlock(document(), this, move(style))); + return adopt(*new Layout::BlockBox(document(), this, move(style))); if (display == CSS::Display::Inline) { if (style->float_().value_or(CSS::Float::None) != CSS::Float::None) - return adopt(*new LayoutBlock(document(), this, move(style))); - return adopt(*new LayoutInline(document(), *this, move(style))); + return adopt(*new Layout::BlockBox(document(), this, move(style))); + return adopt(*new Layout::InlineNode(document(), *this, move(style))); } if (display == CSS::Display::ListItem) - return adopt(*new LayoutListItem(document(), *this, move(style))); + return adopt(*new Layout::ListItemBox(document(), *this, move(style))); if (display == CSS::Display::Table) - return adopt(*new LayoutTable(document(), *this, move(style))); + return adopt(*new Layout::TableBox(document(), *this, move(style))); if (display == CSS::Display::TableRow) - return adopt(*new LayoutTableRow(document(), *this, move(style))); + return adopt(*new Layout::TableRowBox(document(), *this, move(style))); if (display == CSS::Display::TableCell) - return adopt(*new LayoutTableCell(document(), *this, move(style))); + return adopt(*new Layout::TableCellBox(document(), *this, move(style))); if (display == CSS::Display::TableRowGroup || display == CSS::Display::TableHeaderGroup || display == CSS::Display::TableFooterGroup) - return adopt(*new LayoutTableRowGroup(document(), *this, move(style))); + return adopt(*new Layout::TableRowGroupBox(document(), *this, move(style))); if (display == CSS::Display::InlineBlock) { - auto inline_block = adopt(*new LayoutBlock(document(), this, move(style))); + auto inline_block = adopt(*new Layout::BlockBox(document(), this, move(style))); inline_block->set_inline(true); return inline_block; } @@ -206,7 +206,7 @@ void Element::recompute_style() if (style->display() == CSS::Display::None) return; // We need a new layout tree here! - LayoutTreeBuilder tree_builder; + Layout::LayoutTreeBuilder tree_builder; tree_builder.build(*this); return; } diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index 467ca8263e..d9b704f841 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -33,7 +33,7 @@ #include <LibWeb/DOM/ParentNode.h> #include <LibWeb/DOM/TagNames.h> #include <LibWeb/HTML/AttributeNames.h> -#include <LibWeb/Layout/LayoutNode.h> +#include <LibWeb/Layout/Node.h> #include <LibWeb/QualifiedName.h> namespace Web::DOM { @@ -82,8 +82,8 @@ public: void recompute_style(); - LayoutNodeWithStyle* layout_node() { return static_cast<LayoutNodeWithStyle*>(Node::layout_node()); } - const LayoutNodeWithStyle* layout_node() const { return static_cast<const LayoutNodeWithStyle*>(Node::layout_node()); } + Layout::NodeWithStyle* layout_node() { return static_cast<Layout::NodeWithStyle*>(Node::layout_node()); } + const Layout::NodeWithStyle* layout_node() const { return static_cast<const Layout::NodeWithStyle*>(Node::layout_node()); } String name() const { return attribute(HTML::AttributeNames::name); } @@ -97,7 +97,7 @@ public: virtual bool is_focusable() const { return false; } protected: - RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style) override; + RefPtr<Layout::Node> create_layout_node(const CSS::StyleProperties* parent_style) override; private: Attribute* find_attribute(const FlyString& name); diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp index c81bebf7b8..318e8ebf98 100644 --- a/Libraries/LibWeb/DOM/Node.cpp +++ b/Libraries/LibWeb/DOM/Node.cpp @@ -39,11 +39,11 @@ #include <LibWeb/DOM/EventListener.h> #include <LibWeb/DOM/Node.h> #include <LibWeb/HTML/HTMLAnchorElement.h> -#include <LibWeb/Layout/LayoutBlock.h> -#include <LibWeb/Layout/LayoutDocument.h> -#include <LibWeb/Layout/LayoutInline.h> -#include <LibWeb/Layout/LayoutNode.h> -#include <LibWeb/Layout/LayoutText.h> +#include <LibWeb/Layout/BlockBox.h> +#include <LibWeb/Layout/InitialContainingBlockBox.h> +#include <LibWeb/Layout/InlineNode.h> +#include <LibWeb/Layout/Node.h> +#include <LibWeb/Layout/TextNode.h> //#define EVENT_DEBUG @@ -105,7 +105,7 @@ void Node::set_text_content(const String& content) document().invalidate_layout(); } -RefPtr<LayoutNode> Node::create_layout_node(const CSS::StyleProperties*) +RefPtr<Layout::Node> Node::create_layout_node(const CSS::StyleProperties*) { return nullptr; } @@ -230,7 +230,7 @@ void Node::removed_last_ref() delete this; } -void Node::set_layout_node(Badge<LayoutNode>, LayoutNode* layout_node) const +void Node::set_layout_node(Badge<Layout::Node>, Layout::Node* layout_node) const { if (layout_node) m_layout_node = layout_node->make_weak_ptr(); diff --git a/Libraries/LibWeb/DOM/Node.h b/Libraries/LibWeb/DOM/Node.h index 9b2573c3fc..a415b17d4b 100644 --- a/Libraries/LibWeb/DOM/Node.h +++ b/Libraries/LibWeb/DOM/Node.h @@ -84,7 +84,7 @@ public: RefPtr<Node> insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool notify = true); void remove_all_children(); - virtual RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style); + virtual RefPtr<Layout::Node> create_layout_node(const CSS::StyleProperties* parent_style); virtual FlyString node_name() const = 0; @@ -115,10 +115,10 @@ public: virtual void removed_from(Node&) { } virtual void children_changed() { } - const LayoutNode* layout_node() const { return m_layout_node; } - LayoutNode* layout_node() { return m_layout_node; } + const Layout::Node* layout_node() const { return m_layout_node; } + Layout::Node* layout_node() { return m_layout_node; } - void set_layout_node(Badge<LayoutNode>, LayoutNode*) const; + void set_layout_node(Badge<Layout::Node>, Layout::Node*) const; virtual bool is_child_allowed(const Node&) const { return true; } @@ -138,7 +138,7 @@ protected: Node(Document&, NodeType); Document* m_document { nullptr }; - mutable WeakPtr<LayoutNode> m_layout_node; + mutable WeakPtr<Layout::Node> m_layout_node; NodeType m_type { NodeType::INVALID }; bool m_needs_style_update { true }; }; diff --git a/Libraries/LibWeb/DOM/Text.cpp b/Libraries/LibWeb/DOM/Text.cpp index 043998538e..a0c6ba9dab 100644 --- a/Libraries/LibWeb/DOM/Text.cpp +++ b/Libraries/LibWeb/DOM/Text.cpp @@ -25,7 +25,7 @@ */ #include <LibWeb/DOM/Text.h> -#include <LibWeb/Layout/LayoutText.h> +#include <LibWeb/Layout/TextNode.h> namespace Web::DOM { @@ -38,9 +38,9 @@ Text::~Text() { } -RefPtr<LayoutNode> Text::create_layout_node(const CSS::StyleProperties*) +RefPtr<Layout::Node> Text::create_layout_node(const CSS::StyleProperties*) { - return adopt(*new LayoutText(document(), *this)); + return adopt(*new Layout::TextNode(document(), *this)); } } diff --git a/Libraries/LibWeb/DOM/Text.h b/Libraries/LibWeb/DOM/Text.h index 8ba78b7179..1b73543974 100644 --- a/Libraries/LibWeb/DOM/Text.h +++ b/Libraries/LibWeb/DOM/Text.h @@ -42,7 +42,7 @@ public: virtual FlyString node_name() const override { return "#text"; } private: - virtual RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style) override; + virtual RefPtr<Layout::Node> create_layout_node(const CSS::StyleProperties* parent_style) override; }; } |