diff --git a/Libraries/LibWeb/Layout/LayoutBlock.cpp b/Libraries/LibWeb/Layout/LayoutBlock.cpp index 31f2a9ae80..0a702f197f 100644 --- a/Libraries/LibWeb/Layout/LayoutBlock.cpp +++ b/Libraries/LibWeb/Layout/LayoutBlock.cpp @@ -38,7 +38,7 @@ namespace Web { -LayoutBlock::LayoutBlock(DOM::Document& document, const DOM::Node* node, NonnullRefPtr style) +LayoutBlock::LayoutBlock(DOM::Document& document, DOM::Node* node, NonnullRefPtr style) : LayoutBox(document, node, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutBlock.h b/Libraries/LibWeb/Layout/LayoutBlock.h index 68f69008a0..5b31fbf585 100644 --- a/Libraries/LibWeb/Layout/LayoutBlock.h +++ b/Libraries/LibWeb/Layout/LayoutBlock.h @@ -33,7 +33,7 @@ namespace Web { class LayoutBlock : public LayoutBox { public: - LayoutBlock(DOM::Document&, const DOM::Node*, NonnullRefPtr); + LayoutBlock(DOM::Document&, DOM::Node*, NonnullRefPtr); virtual ~LayoutBlock() override; virtual const char* class_name() const override { return "LayoutBlock"; } diff --git a/Libraries/LibWeb/Layout/LayoutBox.h b/Libraries/LibWeb/Layout/LayoutBox.h index 8fdc1397e1..93e9fb4287 100644 --- a/Libraries/LibWeb/Layout/LayoutBox.h +++ b/Libraries/LibWeb/Layout/LayoutBox.h @@ -71,7 +71,7 @@ public: virtual void paint(PaintContext&, PaintPhase) override; protected: - LayoutBox(DOM::Document& document, const DOM::Node* node, NonnullRefPtr style) + LayoutBox(DOM::Document& document, DOM::Node* node, NonnullRefPtr style) : LayoutNodeWithStyleAndBoxModelMetrics(document, node, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutBreak.cpp b/Libraries/LibWeb/Layout/LayoutBreak.cpp index 6f4a57d2c9..5fd401892f 100644 --- a/Libraries/LibWeb/Layout/LayoutBreak.cpp +++ b/Libraries/LibWeb/Layout/LayoutBreak.cpp @@ -29,7 +29,7 @@ namespace Web { -LayoutBreak::LayoutBreak(DOM::Document& document, const HTML::HTMLBRElement& element) +LayoutBreak::LayoutBreak(DOM::Document& document, HTML::HTMLBRElement& element) : LayoutNodeWithStyleAndBoxModelMetrics(document, &element, CSS::StyleProperties::create()) { set_inline(true); diff --git a/Libraries/LibWeb/Layout/LayoutBreak.h b/Libraries/LibWeb/Layout/LayoutBreak.h index e54115cd8b..7f4d973c91 100644 --- a/Libraries/LibWeb/Layout/LayoutBreak.h +++ b/Libraries/LibWeb/Layout/LayoutBreak.h @@ -33,7 +33,7 @@ namespace Web { class LayoutBreak final : public LayoutNodeWithStyleAndBoxModelMetrics { public: - LayoutBreak(DOM::Document&, const HTML::HTMLBRElement&); + LayoutBreak(DOM::Document&, HTML::HTMLBRElement&); virtual ~LayoutBreak() override; const HTML::HTMLBRElement& node() const { return downcast(*LayoutNode::node()); } diff --git a/Libraries/LibWeb/Layout/LayoutCanvas.cpp b/Libraries/LibWeb/Layout/LayoutCanvas.cpp index 3f864be0cd..cca04e6ac0 100644 --- a/Libraries/LibWeb/Layout/LayoutCanvas.cpp +++ b/Libraries/LibWeb/Layout/LayoutCanvas.cpp @@ -31,7 +31,7 @@ namespace Web { -LayoutCanvas::LayoutCanvas(DOM::Document& document, const HTML::HTMLCanvasElement& element, NonnullRefPtr style) +LayoutCanvas::LayoutCanvas(DOM::Document& document, HTML::HTMLCanvasElement& element, NonnullRefPtr style) : LayoutReplaced(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutCanvas.h b/Libraries/LibWeb/Layout/LayoutCanvas.h index db25e1cc27..b42f0f463b 100644 --- a/Libraries/LibWeb/Layout/LayoutCanvas.h +++ b/Libraries/LibWeb/Layout/LayoutCanvas.h @@ -33,7 +33,7 @@ namespace Web { class LayoutCanvas : public LayoutReplaced { public: - LayoutCanvas(DOM::Document&, const HTML::HTMLCanvasElement&, NonnullRefPtr); + LayoutCanvas(DOM::Document&, HTML::HTMLCanvasElement&, NonnullRefPtr); virtual ~LayoutCanvas() override; virtual void layout(LayoutMode = LayoutMode::Default) override; diff --git a/Libraries/LibWeb/Layout/LayoutFrame.cpp b/Libraries/LibWeb/Layout/LayoutFrame.cpp index f63a9e8109..88255d88e2 100644 --- a/Libraries/LibWeb/Layout/LayoutFrame.cpp +++ b/Libraries/LibWeb/Layout/LayoutFrame.cpp @@ -37,7 +37,7 @@ namespace Web { -LayoutFrame::LayoutFrame(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style) +LayoutFrame::LayoutFrame(DOM::Document& document, DOM::Element& element, NonnullRefPtr style) : LayoutReplaced(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutFrame.h b/Libraries/LibWeb/Layout/LayoutFrame.h index 3679c026c6..9fdad0f680 100644 --- a/Libraries/LibWeb/Layout/LayoutFrame.h +++ b/Libraries/LibWeb/Layout/LayoutFrame.h @@ -33,7 +33,7 @@ namespace Web { class LayoutFrame final : public LayoutReplaced { public: - LayoutFrame(DOM::Document&, const DOM::Element&, NonnullRefPtr); + LayoutFrame(DOM::Document&, DOM::Element&, NonnullRefPtr); virtual ~LayoutFrame() override; virtual void paint(PaintContext&, PaintPhase) override; diff --git a/Libraries/LibWeb/Layout/LayoutImage.cpp b/Libraries/LibWeb/Layout/LayoutImage.cpp index d4d658d9cf..061675a8a1 100644 --- a/Libraries/LibWeb/Layout/LayoutImage.cpp +++ b/Libraries/LibWeb/Layout/LayoutImage.cpp @@ -32,7 +32,7 @@ namespace Web { -LayoutImage::LayoutImage(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style, const ImageLoader& image_loader) +LayoutImage::LayoutImage(DOM::Document& document, DOM::Element& element, NonnullRefPtr style, const ImageLoader& image_loader) : LayoutReplaced(document, element, move(style)) , m_image_loader(image_loader) { diff --git a/Libraries/LibWeb/Layout/LayoutImage.h b/Libraries/LibWeb/Layout/LayoutImage.h index d953f257c8..6eefa962a9 100644 --- a/Libraries/LibWeb/Layout/LayoutImage.h +++ b/Libraries/LibWeb/Layout/LayoutImage.h @@ -33,7 +33,7 @@ namespace Web { class LayoutImage : public LayoutReplaced { public: - LayoutImage(DOM::Document&, const DOM::Element&, NonnullRefPtr, const ImageLoader&); + LayoutImage(DOM::Document&, DOM::Element&, NonnullRefPtr, const ImageLoader&); virtual ~LayoutImage() override; virtual void layout(LayoutMode = LayoutMode::Default) override; diff --git a/Libraries/LibWeb/Layout/LayoutInline.cpp b/Libraries/LibWeb/Layout/LayoutInline.cpp index 3b62c35438..ce77bc8631 100644 --- a/Libraries/LibWeb/Layout/LayoutInline.cpp +++ b/Libraries/LibWeb/Layout/LayoutInline.cpp @@ -30,7 +30,7 @@ namespace Web { -LayoutInline::LayoutInline(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style) +LayoutInline::LayoutInline(DOM::Document& document, DOM::Element& element, NonnullRefPtr style) : LayoutNodeWithStyleAndBoxModelMetrics(document, &element, move(style)) { set_inline(true); diff --git a/Libraries/LibWeb/Layout/LayoutInline.h b/Libraries/LibWeb/Layout/LayoutInline.h index 1891fee6ca..30bc455f15 100644 --- a/Libraries/LibWeb/Layout/LayoutInline.h +++ b/Libraries/LibWeb/Layout/LayoutInline.h @@ -34,7 +34,7 @@ class LayoutBlock; class LayoutInline : public LayoutNodeWithStyleAndBoxModelMetrics { public: - LayoutInline(DOM::Document&, const DOM::Element&, NonnullRefPtr); + LayoutInline(DOM::Document&, DOM::Element&, NonnullRefPtr); virtual ~LayoutInline() override; virtual const char* class_name() const override { return "LayoutInline"; } }; diff --git a/Libraries/LibWeb/Layout/LayoutListItem.cpp b/Libraries/LibWeb/Layout/LayoutListItem.cpp index fb1565a5cc..67e1b506f8 100644 --- a/Libraries/LibWeb/Layout/LayoutListItem.cpp +++ b/Libraries/LibWeb/Layout/LayoutListItem.cpp @@ -29,7 +29,7 @@ namespace Web { -LayoutListItem::LayoutListItem(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style) +LayoutListItem::LayoutListItem(DOM::Document& document, DOM::Element& element, NonnullRefPtr style) : LayoutBlock(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutListItem.h b/Libraries/LibWeb/Layout/LayoutListItem.h index d4e425b811..bb5cff174e 100644 --- a/Libraries/LibWeb/Layout/LayoutListItem.h +++ b/Libraries/LibWeb/Layout/LayoutListItem.h @@ -35,7 +35,7 @@ class LayoutListItemMarker; class LayoutListItem final : public LayoutBlock { public: - LayoutListItem(DOM::Document&, const DOM::Element&, NonnullRefPtr); + LayoutListItem(DOM::Document&, DOM::Element&, NonnullRefPtr); virtual ~LayoutListItem() override; virtual void layout(LayoutMode = LayoutMode::Default) override; diff --git a/Libraries/LibWeb/Layout/LayoutNode.cpp b/Libraries/LibWeb/Layout/LayoutNode.cpp index 658abdab1d..04b9f5eff8 100644 --- a/Libraries/LibWeb/Layout/LayoutNode.cpp +++ b/Libraries/LibWeb/Layout/LayoutNode.cpp @@ -35,7 +35,7 @@ namespace Web { -LayoutNode::LayoutNode(DOM::Document& document, const DOM::Node* node) +LayoutNode::LayoutNode(DOM::Document& document, DOM::Node* node) : m_document(document) , m_node(node) { @@ -208,7 +208,7 @@ bool LayoutNode::is_fixed_position() const return position == CSS::Position::Fixed; } -LayoutNodeWithStyle::LayoutNodeWithStyle(DOM::Document& document, const DOM::Node* node, NonnullRefPtr specified_style) +LayoutNodeWithStyle::LayoutNodeWithStyle(DOM::Document& document, DOM::Node* node, NonnullRefPtr specified_style) : LayoutNode(document, node) , m_specified_style(move(specified_style)) { diff --git a/Libraries/LibWeb/Layout/LayoutNode.h b/Libraries/LibWeb/Layout/LayoutNode.h index ad9645fd4d..872521edc0 100644 --- a/Libraries/LibWeb/Layout/LayoutNode.h +++ b/Libraries/LibWeb/Layout/LayoutNode.h @@ -53,7 +53,7 @@ public: bool is_anonymous() const { return !m_node; } const DOM::Node* node() const { return m_node; } - DOM::Node* node() { return const_cast(m_node); } + DOM::Node* node() { return m_node; } DOM::Document& document() { return m_document; } const DOM::Document& document() const { return m_document; } @@ -195,13 +195,13 @@ public: float font_size() const; protected: - LayoutNode(DOM::Document&, const DOM::Node*); + LayoutNode(DOM::Document&, DOM::Node*); private: friend class LayoutNodeWithStyle; DOM::Document& m_document; - const DOM::Node* m_node { nullptr }; + DOM::Node* m_node { nullptr }; bool m_inline { false }; bool m_has_style { false }; @@ -221,7 +221,7 @@ public: void apply_style(const CSS::StyleProperties&); protected: - LayoutNodeWithStyle(DOM::Document&, const DOM::Node*, NonnullRefPtr); + LayoutNodeWithStyle(DOM::Document&, DOM::Node*, NonnullRefPtr); private: LayoutStyle m_style; @@ -237,7 +237,7 @@ public: const BoxModelMetrics& box_model() const { return m_box_model; } protected: - LayoutNodeWithStyleAndBoxModelMetrics(DOM::Document& document, const DOM::Node* node, NonnullRefPtr style) + LayoutNodeWithStyleAndBoxModelMetrics(DOM::Document& document, DOM::Node* node, NonnullRefPtr style) : LayoutNodeWithStyle(document, node, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutReplaced.cpp b/Libraries/LibWeb/Layout/LayoutReplaced.cpp index a4d13faacf..c5200dd3ab 100644 --- a/Libraries/LibWeb/Layout/LayoutReplaced.cpp +++ b/Libraries/LibWeb/Layout/LayoutReplaced.cpp @@ -30,7 +30,7 @@ namespace Web { -LayoutReplaced::LayoutReplaced(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style) +LayoutReplaced::LayoutReplaced(DOM::Document& document, DOM::Element& element, NonnullRefPtr style) : LayoutBox(document, &element, move(style)) { // FIXME: Allow non-inline replaced elements. diff --git a/Libraries/LibWeb/Layout/LayoutReplaced.h b/Libraries/LibWeb/Layout/LayoutReplaced.h index bfe71b5e1c..e77c3b866a 100644 --- a/Libraries/LibWeb/Layout/LayoutReplaced.h +++ b/Libraries/LibWeb/Layout/LayoutReplaced.h @@ -33,7 +33,7 @@ namespace Web { class LayoutReplaced : public LayoutBox { public: - LayoutReplaced(DOM::Document&, const DOM::Element&, NonnullRefPtr); + LayoutReplaced(DOM::Document&, DOM::Element&, NonnullRefPtr); virtual ~LayoutReplaced() override; const DOM::Element& node() const { return downcast(*LayoutNode::node()); } diff --git a/Libraries/LibWeb/Layout/LayoutSVG.cpp b/Libraries/LibWeb/Layout/LayoutSVG.cpp index bd0f188ba5..beac60417b 100644 --- a/Libraries/LibWeb/Layout/LayoutSVG.cpp +++ b/Libraries/LibWeb/Layout/LayoutSVG.cpp @@ -31,7 +31,7 @@ namespace Web { -LayoutSVG::LayoutSVG(DOM::Document& document, const SVG::SVGSVGElement& element, NonnullRefPtr style) +LayoutSVG::LayoutSVG(DOM::Document& document, SVG::SVGSVGElement& element, NonnullRefPtr style) : LayoutReplaced(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutSVG.h b/Libraries/LibWeb/Layout/LayoutSVG.h index b81e593700..d5deb38f6e 100644 --- a/Libraries/LibWeb/Layout/LayoutSVG.h +++ b/Libraries/LibWeb/Layout/LayoutSVG.h @@ -26,17 +26,14 @@ #pragma once -#include #include #include namespace Web { -class SVGSVGElement; - class LayoutSVG : public LayoutReplaced { public: - LayoutSVG(DOM::Document&, const SVG::SVGSVGElement&, NonnullRefPtr); + LayoutSVG(DOM::Document&, SVG::SVGSVGElement&, NonnullRefPtr); virtual ~LayoutSVG() override = default; virtual void layout(LayoutMode = LayoutMode::Default) override; virtual void paint(PaintContext&, PaintPhase) override; diff --git a/Libraries/LibWeb/Layout/LayoutTable.cpp b/Libraries/LibWeb/Layout/LayoutTable.cpp index cee79c0de4..19b46a1461 100644 --- a/Libraries/LibWeb/Layout/LayoutTable.cpp +++ b/Libraries/LibWeb/Layout/LayoutTable.cpp @@ -30,7 +30,7 @@ namespace Web { -LayoutTable::LayoutTable(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style) +LayoutTable::LayoutTable(DOM::Document& document, DOM::Element& element, NonnullRefPtr style) : LayoutBlock(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutTable.h b/Libraries/LibWeb/Layout/LayoutTable.h index 2b7fa017de..8134bcf792 100644 --- a/Libraries/LibWeb/Layout/LayoutTable.h +++ b/Libraries/LibWeb/Layout/LayoutTable.h @@ -30,11 +30,9 @@ namespace Web { -class LayoutTableRow; - class LayoutTable final : public LayoutBlock { public: - LayoutTable(DOM::Document&, const DOM::Element&, NonnullRefPtr); + LayoutTable(DOM::Document&, DOM::Element&, NonnullRefPtr); virtual ~LayoutTable() override; virtual void layout(LayoutMode = LayoutMode::Default) override; diff --git a/Libraries/LibWeb/Layout/LayoutTableCell.cpp b/Libraries/LibWeb/Layout/LayoutTableCell.cpp index 074552887f..d082d86d84 100644 --- a/Libraries/LibWeb/Layout/LayoutTableCell.cpp +++ b/Libraries/LibWeb/Layout/LayoutTableCell.cpp @@ -30,7 +30,7 @@ namespace Web { -LayoutTableCell::LayoutTableCell(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style) +LayoutTableCell::LayoutTableCell(DOM::Document& document, DOM::Element& element, NonnullRefPtr style) : LayoutBlock(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutTableCell.h b/Libraries/LibWeb/Layout/LayoutTableCell.h index 681e967978..5ce5dc7462 100644 --- a/Libraries/LibWeb/Layout/LayoutTableCell.h +++ b/Libraries/LibWeb/Layout/LayoutTableCell.h @@ -32,7 +32,7 @@ namespace Web { class LayoutTableCell final : public LayoutBlock { public: - LayoutTableCell(DOM::Document&, const DOM::Element&, NonnullRefPtr); + LayoutTableCell(DOM::Document&, DOM::Element&, NonnullRefPtr); virtual ~LayoutTableCell() override; LayoutTableCell* next_cell() { return next_sibling_of_type(); } diff --git a/Libraries/LibWeb/Layout/LayoutTableRow.cpp b/Libraries/LibWeb/Layout/LayoutTableRow.cpp index 6e82323453..c2110db37e 100644 --- a/Libraries/LibWeb/Layout/LayoutTableRow.cpp +++ b/Libraries/LibWeb/Layout/LayoutTableRow.cpp @@ -31,7 +31,7 @@ namespace Web { -LayoutTableRow::LayoutTableRow(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style) +LayoutTableRow::LayoutTableRow(DOM::Document& document, DOM::Element& element, NonnullRefPtr style) : LayoutBox(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutTableRow.h b/Libraries/LibWeb/Layout/LayoutTableRow.h index d289cd6e6d..41dbe6c734 100644 --- a/Libraries/LibWeb/Layout/LayoutTableRow.h +++ b/Libraries/LibWeb/Layout/LayoutTableRow.h @@ -34,7 +34,7 @@ class LayoutTableCell; class LayoutTableRow final : public LayoutBox { public: - LayoutTableRow(DOM::Document&, const DOM::Element&, NonnullRefPtr); + LayoutTableRow(DOM::Document&, DOM::Element&, NonnullRefPtr); virtual ~LayoutTableRow() override; void layout_row(const Vector& column_widths); diff --git a/Libraries/LibWeb/Layout/LayoutTableRowGroup.cpp b/Libraries/LibWeb/Layout/LayoutTableRowGroup.cpp index f78195651a..2b12e8e523 100644 --- a/Libraries/LibWeb/Layout/LayoutTableRowGroup.cpp +++ b/Libraries/LibWeb/Layout/LayoutTableRowGroup.cpp @@ -31,7 +31,7 @@ namespace Web { -LayoutTableRowGroup::LayoutTableRowGroup(DOM::Document& document, const DOM::Element& element, NonnullRefPtr style) +LayoutTableRowGroup::LayoutTableRowGroup(DOM::Document& document, DOM::Element& element, NonnullRefPtr style) : LayoutBlock(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutTableRowGroup.h b/Libraries/LibWeb/Layout/LayoutTableRowGroup.h index 8a5fe297d1..5cb15a33d3 100644 --- a/Libraries/LibWeb/Layout/LayoutTableRowGroup.h +++ b/Libraries/LibWeb/Layout/LayoutTableRowGroup.h @@ -32,7 +32,7 @@ namespace Web { class LayoutTableRowGroup final : public LayoutBlock { public: - LayoutTableRowGroup(DOM::Document&, const DOM::Element&, NonnullRefPtr); + LayoutTableRowGroup(DOM::Document&, DOM::Element&, NonnullRefPtr); virtual ~LayoutTableRowGroup() override; virtual void layout(LayoutMode = LayoutMode::Default) override; diff --git a/Libraries/LibWeb/Layout/LayoutText.cpp b/Libraries/LibWeb/Layout/LayoutText.cpp index 7d8663f176..7a4cc81885 100644 --- a/Libraries/LibWeb/Layout/LayoutText.cpp +++ b/Libraries/LibWeb/Layout/LayoutText.cpp @@ -36,7 +36,7 @@ namespace Web { -LayoutText::LayoutText(DOM::Document& document, const DOM::Text& text) +LayoutText::LayoutText(DOM::Document& document, DOM::Text& text) : LayoutNode(document, &text) { set_inline(true); diff --git a/Libraries/LibWeb/Layout/LayoutText.h b/Libraries/LibWeb/Layout/LayoutText.h index 3940271c6a..66b3bf0cad 100644 --- a/Libraries/LibWeb/Layout/LayoutText.h +++ b/Libraries/LibWeb/Layout/LayoutText.h @@ -35,7 +35,7 @@ class LineBoxFragment; class LayoutText : public LayoutNode { public: - LayoutText(DOM::Document&, const DOM::Text&); + LayoutText(DOM::Document&, DOM::Text&); virtual ~LayoutText() override; const DOM::Text& node() const { return static_cast(*LayoutNode::node()); } diff --git a/Libraries/LibWeb/Layout/LayoutWidget.cpp b/Libraries/LibWeb/Layout/LayoutWidget.cpp index e77a9b623a..f55828c748 100644 --- a/Libraries/LibWeb/Layout/LayoutWidget.cpp +++ b/Libraries/LibWeb/Layout/LayoutWidget.cpp @@ -36,7 +36,7 @@ namespace Web { -LayoutWidget::LayoutWidget(DOM::Document& document, const DOM::Element& element, GUI::Widget& widget) +LayoutWidget::LayoutWidget(DOM::Document& document, DOM::Element& element, GUI::Widget& widget) : LayoutReplaced(document, element, CSS::StyleProperties::create()) , m_widget(widget) { diff --git a/Libraries/LibWeb/Layout/LayoutWidget.h b/Libraries/LibWeb/Layout/LayoutWidget.h index bc9d6f4857..90051f9810 100644 --- a/Libraries/LibWeb/Layout/LayoutWidget.h +++ b/Libraries/LibWeb/Layout/LayoutWidget.h @@ -32,7 +32,7 @@ namespace Web { class LayoutWidget final : public LayoutReplaced { public: - LayoutWidget(DOM::Document&, const DOM::Element&, GUI::Widget&); + LayoutWidget(DOM::Document&, DOM::Element&, GUI::Widget&); virtual ~LayoutWidget() override; GUI::Widget& widget() { return m_widget; }