LibWeb: Make CSS::ComputedProperties GC-allocated

This commit is contained in:
Andreas Kling 2024-12-20 16:35:12 +01:00 committed by Andreas Kling
commit 74469a0c1f
Notes: github-actions[bot] 2024-12-22 09:13:42 +00:00
138 changed files with 337 additions and 339 deletions

View file

@ -12,7 +12,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(AudioBox);
AudioBox::AudioBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style)
AudioBox::AudioBox(DOM::Document& document, DOM::Element& element, GC::Ref<CSS::ComputedProperties> style)
: ReplacedBox(document, element, move(style))
{
set_natural_width(300);

View file

@ -23,7 +23,7 @@ public:
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
private:
AudioBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties);
AudioBox(DOM::Document&, DOM::Element&, GC::Ref<CSS::ComputedProperties>);
};
}

View file

@ -9,7 +9,7 @@
namespace Web::Layout {
BlockContainer::BlockContainer(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties style)
BlockContainer::BlockContainer(DOM::Document& document, DOM::Node* node, GC::Ref<CSS::ComputedProperties> style)
: Box(document, node, move(style))
{
}

View file

@ -16,7 +16,7 @@ class BlockContainer : public Box {
GC_CELL(BlockContainer, Box);
public:
BlockContainer(DOM::Document&, DOM::Node*, CSS::ComputedProperties);
BlockContainer(DOM::Document&, DOM::Node*, GC::Ref<CSS::ComputedProperties>);
BlockContainer(DOM::Document&, DOM::Node*, NonnullOwnPtr<CSS::ComputedValues>);
virtual ~BlockContainer() override;

View file

@ -14,7 +14,7 @@
namespace Web::Layout {
Box::Box(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties style)
Box::Box(DOM::Document& document, DOM::Node* node, GC::Ref<CSS::ComputedProperties> style)
: NodeWithStyleAndBoxModelMetrics(document, node, move(style))
{
}

View file

@ -55,7 +55,7 @@ public:
virtual void visit_edges(Cell::Visitor&) override;
protected:
Box(DOM::Document&, DOM::Node*, CSS::ComputedProperties);
Box(DOM::Document&, DOM::Node*, GC::Ref<CSS::ComputedProperties>);
Box(DOM::Document&, DOM::Node*, NonnullOwnPtr<CSS::ComputedValues>);
private:

View file

@ -12,7 +12,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(BreakNode);
BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element, CSS::ComputedProperties style)
BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element, GC::Ref<CSS::ComputedProperties> style)
: Layout::NodeWithStyleAndBoxModelMetrics(document, &element, move(style))
{
}

View file

@ -16,7 +16,7 @@ class BreakNode final : public NodeWithStyleAndBoxModelMetrics {
GC_DECLARE_ALLOCATOR(BreakNode);
public:
BreakNode(DOM::Document&, HTML::HTMLBRElement&, CSS::ComputedProperties);
BreakNode(DOM::Document&, HTML::HTMLBRElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~BreakNode() override;
const HTML::HTMLBRElement& dom_node() const { return verify_cast<HTML::HTMLBRElement>(*Node::dom_node()); }

View file

@ -11,7 +11,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(CanvasBox);
CanvasBox::CanvasBox(DOM::Document& document, HTML::HTMLCanvasElement& element, CSS::ComputedProperties style)
CanvasBox::CanvasBox(DOM::Document& document, HTML::HTMLCanvasElement& element, GC::Ref<CSS::ComputedProperties> style)
: ReplacedBox(document, element, move(style))
{
}

View file

@ -16,7 +16,7 @@ class CanvasBox final : public ReplacedBox {
GC_DECLARE_ALLOCATOR(CanvasBox);
public:
CanvasBox(DOM::Document&, HTML::HTMLCanvasElement&, CSS::ComputedProperties);
CanvasBox(DOM::Document&, HTML::HTMLCanvasElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~CanvasBox() override;
virtual void prepare_for_replaced_layout() override;

View file

@ -13,7 +13,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(CheckBox);
CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, CSS::ComputedProperties style)
CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, GC::Ref<CSS::ComputedProperties> style)
: FormAssociatedLabelableNode(document, element, move(style))
{
set_natural_width(13);

View file

@ -16,7 +16,7 @@ class CheckBox final : public FormAssociatedLabelableNode {
GC_DECLARE_ALLOCATOR(CheckBox);
public:
CheckBox(DOM::Document&, HTML::HTMLInputElement&, CSS::ComputedProperties);
CheckBox(DOM::Document&, HTML::HTMLInputElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~CheckBox() override;
private:

View file

@ -14,7 +14,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(FieldSetBox);
FieldSetBox::FieldSetBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style)
FieldSetBox::FieldSetBox(DOM::Document& document, DOM::Element& element, GC::Ref<CSS::ComputedProperties> style)
: BlockContainer(document, &element, move(style))
{
}

View file

@ -16,7 +16,7 @@ class FieldSetBox final : public BlockContainer {
GC_DECLARE_ALLOCATOR(FieldSetBox);
public:
FieldSetBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties);
FieldSetBox(DOM::Document&, DOM::Element&, GC::Ref<CSS::ComputedProperties>);
virtual ~FieldSetBox() override;
DOM::Element& dom_node() { return static_cast<DOM::Element&>(*BlockContainer::dom_node()); }

View file

@ -21,7 +21,7 @@ public:
HTML::FormAssociatedElement& dom_node() { return dynamic_cast<HTML::FormAssociatedElement&>(LabelableNode::dom_node()); }
protected:
FormAssociatedLabelableNode(DOM::Document& document, HTML::FormAssociatedElement& element, CSS::ComputedProperties style)
FormAssociatedLabelableNode(DOM::Document& document, HTML::FormAssociatedElement& element, GC::Ref<CSS::ComputedProperties> style)
: LabelableNode(document, element.form_associated_element_to_html_element(), move(style))
{
}

View file

@ -15,7 +15,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(ImageBox);
ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style, ImageProvider const& image_provider)
ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, GC::Ref<CSS::ComputedProperties> style, ImageProvider const& image_provider)
: ReplacedBox(document, element, move(style))
, m_image_provider(image_provider)
{

View file

@ -16,7 +16,7 @@ class ImageBox final : public ReplacedBox {
GC_DECLARE_ALLOCATOR(ImageBox);
public:
ImageBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties, ImageProvider const&);
ImageBox(DOM::Document&, DOM::Element&, GC::Ref<CSS::ComputedProperties>, ImageProvider const&);
virtual ~ImageBox() override;
virtual void prepare_for_replaced_layout() override;

View file

@ -16,7 +16,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(InlineNode);
InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, CSS::ComputedProperties style)
InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, GC::Ref<CSS::ComputedProperties> style)
: Layout::NodeWithStyleAndBoxModelMetrics(document, element, move(style))
{
}

View file

@ -15,7 +15,7 @@ class InlineNode final : public NodeWithStyleAndBoxModelMetrics {
GC_DECLARE_ALLOCATOR(InlineNode);
public:
InlineNode(DOM::Document&, DOM::Element*, CSS::ComputedProperties);
InlineNode(DOM::Document&, DOM::Element*, GC::Ref<CSS::ComputedProperties>);
virtual ~InlineNode() override;
GC::Ptr<Painting::PaintableWithLines> create_paintable_for_line_with_index(size_t line_index) const;

View file

@ -17,7 +17,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(Label);
Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, CSS::ComputedProperties style)
Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, GC::Ref<CSS::ComputedProperties> style)
: BlockContainer(document, element, move(style))
{
}

View file

@ -16,7 +16,7 @@ class Label final : public BlockContainer {
GC_DECLARE_ALLOCATOR(Label);
public:
Label(DOM::Document&, HTML::HTMLLabelElement*, CSS::ComputedProperties);
Label(DOM::Document&, HTML::HTMLLabelElement*, GC::Ref<CSS::ComputedProperties>);
virtual ~Label() override;
static bool is_inside_associated_label(LabelableNode const&, CSSPixelPoint);

View file

@ -19,7 +19,7 @@ public:
Painting::LabelablePaintable const* paintable() const;
protected:
LabelableNode(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style)
LabelableNode(DOM::Document& document, DOM::Element& element, GC::Ref<CSS::ComputedProperties> style)
: ReplacedBox(document, element, move(style))
{
}

View file

@ -10,7 +10,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(LegendBox);
LegendBox::LegendBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style)
LegendBox::LegendBox(DOM::Document& document, DOM::Element& element, GC::Ref<CSS::ComputedProperties> style)
: BlockContainer(document, &element, move(style))
{
}

View file

@ -15,7 +15,7 @@ class LegendBox final : public BlockContainer {
GC_DECLARE_ALLOCATOR(LegendBox);
public:
LegendBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties);
LegendBox(DOM::Document&, DOM::Element&, GC::Ref<CSS::ComputedProperties>);
virtual ~LegendBox() override;
DOM::Element& dom_node() { return static_cast<DOM::Element&>(*Box::dom_node()); }

View file

@ -12,7 +12,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(ListItemBox);
ListItemBox::ListItemBox(DOM::Document& document, DOM::Element* element, CSS::ComputedProperties style)
ListItemBox::ListItemBox(DOM::Document& document, DOM::Element* element, GC::Ref<CSS::ComputedProperties> style)
: Layout::BlockContainer(document, element, move(style))
{
}

View file

@ -16,7 +16,7 @@ class ListItemBox final : public BlockContainer {
GC_DECLARE_ALLOCATOR(ListItemBox);
public:
ListItemBox(DOM::Document&, DOM::Element*, CSS::ComputedProperties);
ListItemBox(DOM::Document&, DOM::Element*, GC::Ref<CSS::ComputedProperties>);
virtual ~ListItemBox() override;
DOM::Element& dom_node() { return static_cast<DOM::Element&>(*BlockContainer::dom_node()); }

View file

@ -12,7 +12,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(ListItemMarkerBox);
ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, CSS::ListStylePosition style_position, size_t index, CSS::ComputedProperties style)
ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, CSS::ListStylePosition style_position, size_t index, GC::Ref<CSS::ComputedProperties> style)
: Box(document, nullptr, move(style))
, m_list_style_type(style_type)
, m_list_style_position(style_position)

View file

@ -16,7 +16,7 @@ class ListItemMarkerBox final : public Box {
GC_DECLARE_ALLOCATOR(ListItemMarkerBox);
public:
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, size_t index, CSS::ComputedProperties);
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, size_t index, GC::Ref<CSS::ComputedProperties>);
virtual ~ListItemMarkerBox() override;
Optional<ByteString> const& text() const { return m_text; }

View file

@ -16,7 +16,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(NavigableContainerViewport);
NavigableContainerViewport::NavigableContainerViewport(DOM::Document& document, HTML::NavigableContainer& element, CSS::ComputedProperties style)
NavigableContainerViewport::NavigableContainerViewport(DOM::Document& document, HTML::NavigableContainer& element, GC::Ref<CSS::ComputedProperties> style)
: ReplacedBox(document, element, move(style))
{
}

View file

@ -16,7 +16,7 @@ class NavigableContainerViewport final : public ReplacedBox {
GC_DECLARE_ALLOCATOR(NavigableContainerViewport);
public:
NavigableContainerViewport(DOM::Document&, HTML::NavigableContainer&, CSS::ComputedProperties);
NavigableContainerViewport(DOM::Document&, HTML::NavigableContainer&, GC::Ref<CSS::ComputedProperties>);
virtual ~NavigableContainerViewport() override;
virtual void prepare_for_replaced_layout() override;

View file

@ -276,7 +276,7 @@ bool Node::is_sticky_position() const
return position == CSS::Positioning::Sticky;
}
NodeWithStyle::NodeWithStyle(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties computed_style)
NodeWithStyle::NodeWithStyle(DOM::Document& document, DOM::Node* node, GC::Ref<CSS::ComputedProperties> computed_style)
: Node(document, node)
, m_computed_values(make<CSS::ComputedValues>())
{

View file

@ -238,7 +238,7 @@ public:
virtual void visit_edges(Cell::Visitor& visitor) override;
protected:
NodeWithStyle(DOM::Document&, DOM::Node*, CSS::ComputedProperties);
NodeWithStyle(DOM::Document&, DOM::Node*, GC::Ref<CSS::ComputedProperties>);
NodeWithStyle(DOM::Document&, DOM::Node*, NonnullOwnPtr<CSS::ComputedValues>);
private:
@ -257,8 +257,8 @@ public:
BoxModelMetrics const& box_model() const { return m_box_model; }
protected:
NodeWithStyleAndBoxModelMetrics(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties style)
: NodeWithStyle(document, node, move(style))
NodeWithStyleAndBoxModelMetrics(DOM::Document& document, DOM::Node* node, GC::Ref<CSS::ComputedProperties> style)
: NodeWithStyle(document, node, style)
{
}

View file

@ -14,7 +14,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(RadioButton);
RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, CSS::ComputedProperties style)
RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, GC::Ref<CSS::ComputedProperties> style)
: FormAssociatedLabelableNode(document, element, move(style))
{
set_natural_width(12);

View file

@ -16,7 +16,7 @@ class RadioButton final : public FormAssociatedLabelableNode {
GC_DECLARE_ALLOCATOR(RadioButton);
public:
RadioButton(DOM::Document&, HTML::HTMLInputElement&, CSS::ComputedProperties);
RadioButton(DOM::Document&, HTML::HTMLInputElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~RadioButton() override;
private:

View file

@ -11,7 +11,7 @@
namespace Web::Layout {
ReplacedBox::ReplacedBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style)
ReplacedBox::ReplacedBox(DOM::Document& document, DOM::Element& element, GC::Ref<CSS::ComputedProperties> style)
: Box(document, &element, move(style))
{
}

View file

@ -15,7 +15,7 @@ class ReplacedBox : public Box {
GC_CELL(ReplacedBox, Box);
public:
ReplacedBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties);
ReplacedBox(DOM::Document&, DOM::Element&, GC::Ref<CSS::ComputedProperties>);
virtual ~ReplacedBox() override;
DOM::Element const& dom_node() const { return verify_cast<DOM::Element>(*Node::dom_node()); }

View file

@ -8,7 +8,7 @@
namespace Web::Layout {
SVGBox::SVGBox(DOM::Document& document, SVG::SVGElement& element, CSS::ComputedProperties style)
SVGBox::SVGBox(DOM::Document& document, SVG::SVGElement& element, GC::Ref<CSS::ComputedProperties> style)
: Box(document, &element, move(style))
{
}

View file

@ -16,7 +16,7 @@ class SVGBox : public Box {
GC_CELL(SVGBox, Box);
public:
SVGBox(DOM::Document&, SVG::SVGElement&, CSS::ComputedProperties);
SVGBox(DOM::Document&, SVG::SVGElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGBox() override = default;
SVG::SVGElement& dom_node() { return verify_cast<SVG::SVGElement>(*Box::dom_node()); }

View file

@ -12,8 +12,8 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(SVGClipBox);
SVGClipBox::SVGClipBox(DOM::Document& document, SVG::SVGClipPathElement& element, CSS::ComputedProperties properties)
: SVGBox(document, element, properties)
SVGClipBox::SVGClipBox(DOM::Document& document, SVG::SVGClipPathElement& element, GC::Ref<CSS::ComputedProperties> style)
: SVGBox(document, element, style)
{
}

View file

@ -17,7 +17,7 @@ class SVGClipBox : public SVGBox {
GC_DECLARE_ALLOCATOR(SVGClipBox);
public:
SVGClipBox(DOM::Document&, SVG::SVGClipPathElement&, CSS::ComputedProperties);
SVGClipBox(DOM::Document&, SVG::SVGClipPathElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGClipBox() override = default;
SVG::SVGClipPathElement& dom_node() { return verify_cast<SVG::SVGClipPathElement>(SVGBox::dom_node()); }

View file

@ -12,8 +12,8 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(SVGForeignObjectBox);
SVGForeignObjectBox::SVGForeignObjectBox(DOM::Document& document, SVG::SVGForeignObjectElement& element, CSS::ComputedProperties properties)
: BlockContainer(document, &element, properties)
SVGForeignObjectBox::SVGForeignObjectBox(DOM::Document& document, SVG::SVGForeignObjectElement& element, GC::Ref<CSS::ComputedProperties> style)
: BlockContainer(document, &element, style)
{
}

View file

@ -18,7 +18,7 @@ class SVGForeignObjectBox final : public BlockContainer {
GC_DECLARE_ALLOCATOR(SVGForeignObjectBox);
public:
SVGForeignObjectBox(DOM::Document&, SVG::SVGForeignObjectElement&, CSS::ComputedProperties);
SVGForeignObjectBox(DOM::Document&, SVG::SVGForeignObjectElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGForeignObjectBox() override = default;
SVG::SVGForeignObjectElement& dom_node() { return static_cast<SVG::SVGForeignObjectElement&>(*BlockContainer::dom_node()); }

View file

@ -14,8 +14,8 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(SVGGeometryBox);
SVGGeometryBox::SVGGeometryBox(DOM::Document& document, SVG::SVGGeometryElement& element, CSS::ComputedProperties properties)
: SVGGraphicsBox(document, element, properties)
SVGGeometryBox::SVGGeometryBox(DOM::Document& document, SVG::SVGGeometryElement& element, GC::Ref<CSS::ComputedProperties> style)
: SVGGraphicsBox(document, element, style)
{
}

View file

@ -17,7 +17,7 @@ class SVGGeometryBox final : public SVGGraphicsBox {
GC_DECLARE_ALLOCATOR(SVGGeometryBox);
public:
SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, CSS::ComputedProperties);
SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGGeometryBox() override = default;
SVG::SVGGeometryElement& dom_node() { return static_cast<SVG::SVGGeometryElement&>(SVGGraphicsBox::dom_node()); }

View file

@ -10,8 +10,8 @@
namespace Web::Layout {
SVGGraphicsBox::SVGGraphicsBox(DOM::Document& document, SVG::SVGGraphicsElement& element, CSS::ComputedProperties properties)
: SVGBox(document, element, properties)
SVGGraphicsBox::SVGGraphicsBox(DOM::Document& document, SVG::SVGGraphicsElement& element, GC::Ref<CSS::ComputedProperties> style)
: SVGBox(document, element, style)
{
}

View file

@ -16,7 +16,7 @@ class SVGGraphicsBox : public SVGBox {
GC_CELL(SVGGraphicsBox, SVGBox);
public:
SVGGraphicsBox(DOM::Document&, SVG::SVGGraphicsElement&, CSS::ComputedProperties);
SVGGraphicsBox(DOM::Document&, SVG::SVGGraphicsElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGGraphicsBox() override = default;
SVG::SVGGraphicsElement& dom_node() { return verify_cast<SVG::SVGGraphicsElement>(SVGBox::dom_node()); }

View file

@ -11,8 +11,8 @@
namespace Web::Layout {
SVGImageBox::SVGImageBox(DOM::Document& document, SVG::SVGGraphicsElement& element, CSS::ComputedProperties properties)
: SVGGraphicsBox(document, element, properties)
SVGImageBox::SVGImageBox(DOM::Document& document, SVG::SVGGraphicsElement& element, GC::Ref<CSS::ComputedProperties> style)
: SVGGraphicsBox(document, element, style)
{
}

View file

@ -16,7 +16,7 @@ class SVGImageBox : public SVGGraphicsBox {
GC_CELL(SVGImageBox, SVGGraphicsBox);
public:
SVGImageBox(DOM::Document&, SVG::SVGGraphicsElement&, CSS::ComputedProperties);
SVGImageBox(DOM::Document&, SVG::SVGGraphicsElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGImageBox() override = default;
SVG::SVGImageElement& dom_node() { return static_cast<SVG::SVGImageElement&>(SVGGraphicsBox::dom_node()); }

View file

@ -12,8 +12,8 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(SVGMaskBox);
SVGMaskBox::SVGMaskBox(DOM::Document& document, SVG::SVGMaskElement& element, CSS::ComputedProperties properties)
: SVGGraphicsBox(document, element, properties)
SVGMaskBox::SVGMaskBox(DOM::Document& document, SVG::SVGMaskElement& element, GC::Ref<CSS::ComputedProperties> style)
: SVGGraphicsBox(document, element, style)
{
}

View file

@ -17,7 +17,7 @@ class SVGMaskBox : public SVGGraphicsBox {
GC_DECLARE_ALLOCATOR(SVGMaskBox);
public:
SVGMaskBox(DOM::Document&, SVG::SVGMaskElement&, CSS::ComputedProperties);
SVGMaskBox(DOM::Document&, SVG::SVGMaskElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGMaskBox() override = default;
virtual bool is_svg_mask_box() const override { return true; }

View file

@ -15,8 +15,8 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(SVGSVGBox);
SVGSVGBox::SVGSVGBox(DOM::Document& document, SVG::SVGSVGElement& element, CSS::ComputedProperties properties)
: ReplacedBox(document, element, move(properties))
SVGSVGBox::SVGSVGBox(DOM::Document& document, SVG::SVGSVGElement& element, GC::Ref<CSS::ComputedProperties> style)
: ReplacedBox(document, element, style)
{
}

View file

@ -16,7 +16,7 @@ class SVGSVGBox final : public ReplacedBox {
GC_DECLARE_ALLOCATOR(SVGSVGBox);
public:
SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, CSS::ComputedProperties);
SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGSVGBox() override = default;
SVG::SVGSVGElement& dom_node() { return verify_cast<SVG::SVGSVGElement>(ReplacedBox::dom_node()); }

View file

@ -12,8 +12,8 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(SVGTextBox);
SVGTextBox::SVGTextBox(DOM::Document& document, SVG::SVGTextPositioningElement& element, CSS::ComputedProperties properties)
: SVGGraphicsBox(document, element, properties)
SVGTextBox::SVGTextBox(DOM::Document& document, SVG::SVGTextPositioningElement& element, GC::Ref<CSS::ComputedProperties> style)
: SVGGraphicsBox(document, element, style)
{
}

View file

@ -17,7 +17,7 @@ class SVGTextBox final : public SVGGraphicsBox {
GC_DECLARE_ALLOCATOR(SVGTextBox);
public:
SVGTextBox(DOM::Document&, SVG::SVGTextPositioningElement&, CSS::ComputedProperties);
SVGTextBox(DOM::Document&, SVG::SVGTextPositioningElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGTextBox() override = default;
SVG::SVGTextPositioningElement& dom_node() { return static_cast<SVG::SVGTextPositioningElement&>(SVGGraphicsBox::dom_node()); }

View file

@ -11,8 +11,8 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(SVGTextPathBox);
SVGTextPathBox::SVGTextPathBox(DOM::Document& document, SVG::SVGTextPathElement& element, CSS::ComputedProperties properties)
: SVGGraphicsBox(document, element, properties)
SVGTextPathBox::SVGTextPathBox(DOM::Document& document, SVG::SVGTextPathElement& element, GC::Ref<CSS::ComputedProperties> style)
: SVGGraphicsBox(document, element, style)
{
}

View file

@ -16,7 +16,7 @@ class SVGTextPathBox final : public SVGGraphicsBox {
GC_DECLARE_ALLOCATOR(SVGTextPathBox);
public:
SVGTextPathBox(DOM::Document&, SVG::SVGTextPathElement&, CSS::ComputedProperties);
SVGTextPathBox(DOM::Document&, SVG::SVGTextPathElement&, GC::Ref<CSS::ComputedProperties>);
virtual ~SVGTextPathBox() override = default;
SVG::SVGTextPathElement& dom_node() { return static_cast<SVG::SVGTextPathElement&>(SVGGraphicsBox::dom_node()); }

View file

@ -10,7 +10,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(TableWrapper);
TableWrapper::TableWrapper(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties style)
TableWrapper::TableWrapper(DOM::Document& document, DOM::Node* node, GC::Ref<CSS::ComputedProperties> style)
: BlockContainer(document, node, move(style))
{
}

View file

@ -15,7 +15,7 @@ class TableWrapper : public BlockContainer {
GC_DECLARE_ALLOCATOR(TableWrapper);
public:
TableWrapper(DOM::Document&, DOM::Node*, CSS::ComputedProperties);
TableWrapper(DOM::Document&, DOM::Node*, GC::Ref<CSS::ComputedProperties>);
TableWrapper(DOM::Document&, DOM::Node*, NonnullOwnPtr<CSS::ComputedValues>);
virtual ~TableWrapper() override;

View file

@ -196,8 +196,8 @@ void TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element, CSS::Se
{
auto& document = element.document();
auto pseudo_element_style = element.pseudo_element_computed_css_values(pseudo_element);
if (!pseudo_element_style.has_value())
auto pseudo_element_style = element.pseudo_element_computed_properties(pseudo_element);
if (!pseudo_element_style)
return;
auto initial_quote_nesting_level = m_quote_nesting_level;
@ -346,14 +346,14 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
auto& document = dom_node.document();
auto& style_computer = document.style_computer();
Optional<CSS::ComputedProperties> style;
GC::Ptr<CSS::ComputedProperties> style;
CSS::Display display;
if (is<DOM::Element>(dom_node)) {
auto& element = static_cast<DOM::Element&>(dom_node);
element.clear_pseudo_element_nodes({});
VERIFY(!element.needs_style_update());
style = element.computed_css_values();
style = element.computed_properties();
element.resolve_counters(*style);
display = style->display();
if (display.is_none())
@ -396,7 +396,7 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
auto element_has_content_visibility_hidden = [&dom_node]() {
if (is<DOM::Element>(dom_node)) {
auto& element = static_cast<DOM::Element&>(dom_node);
return element.computed_css_values()->content_visibility() == CSS::ContentVisibility::Hidden;
return element.computed_properties()->content_visibility() == CSS::ContentVisibility::Hidden;
}
return false;
}();
@ -443,7 +443,7 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
if (is<HTML::HTMLSlotElement>(dom_node)) {
auto& slot_element = static_cast<HTML::HTMLSlotElement&>(dom_node);
if (slot_element.computed_css_values()->content_visibility() == CSS::ContentVisibility::Hidden)
if (slot_element.computed_properties()->content_visibility() == CSS::ContentVisibility::Hidden)
return;
auto slottables = slot_element.assigned_nodes_internal();

View file

@ -12,7 +12,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(VideoBox);
VideoBox::VideoBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style)
VideoBox::VideoBox(DOM::Document& document, DOM::Element& element, GC::Ref<CSS::ComputedProperties> style)
: ReplacedBox(document, element, move(style))
{
document.register_viewport_client(*this);

View file

@ -27,7 +27,7 @@ public:
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
private:
VideoBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties);
VideoBox(DOM::Document&, DOM::Element&, GC::Ref<CSS::ComputedProperties>);
// ^Document::ViewportClient
virtual void did_set_viewport_rect(CSSPixelRect const&) final;

View file

@ -16,7 +16,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(Viewport);
Viewport::Viewport(DOM::Document& document, CSS::ComputedProperties style)
Viewport::Viewport(DOM::Document& document, GC::Ref<CSS::ComputedProperties> style)
: BlockContainer(document, &document, move(style))
{
}

View file

@ -16,7 +16,7 @@ class Viewport final : public BlockContainer {
GC_DECLARE_ALLOCATOR(Viewport);
public:
explicit Viewport(DOM::Document&, CSS::ComputedProperties);
explicit Viewport(DOM::Document&, GC::Ref<CSS::ComputedProperties>);
virtual ~Viewport() override;
struct TextPosition {