2020-03-19 15:07:56 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
2020-03-19 15:07:56 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-03-19 15:07:56 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-07-26 10:08:16 -03:00
|
|
|
#include <LibWeb/HTML/HTMLCanvasElement.h>
|
2020-11-22 11:53:01 -03:00
|
|
|
#include <LibWeb/Layout/ReplacedBox.h>
|
2020-03-19 15:07:56 -03:00
|
|
|
|
2020-11-22 11:53:01 -03:00
|
|
|
namespace Web::Layout {
|
2020-03-19 15:07:56 -03:00
|
|
|
|
2023-01-11 10:01:33 -03:00
|
|
|
class CanvasBox final : public ReplacedBox {
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_CELL(CanvasBox, ReplacedBox);
|
|
|
|
|
GC_DECLARE_ALLOCATOR(CanvasBox);
|
2022-10-17 09:41:50 -03:00
|
|
|
|
2020-03-19 15:07:56 -03:00
|
|
|
public:
|
2024-12-20 12:35:12 -03:00
|
|
|
CanvasBox(DOM::Document&, HTML::HTMLCanvasElement&, GC::Ref<CSS::ComputedProperties>);
|
2020-11-22 11:53:01 -03:00
|
|
|
virtual ~CanvasBox() override;
|
2020-03-19 15:07:56 -03:00
|
|
|
|
2020-11-22 09:38:18 -03:00
|
|
|
virtual void prepare_for_replaced_layout() override;
|
2020-03-19 15:07:56 -03:00
|
|
|
|
2025-07-26 09:22:50 -03:00
|
|
|
HTML::HTMLCanvasElement const& dom_node() const { return static_cast<HTML::HTMLCanvasElement const&>(*ReplacedBox::dom_node()); }
|
2022-03-10 10:02:25 -03:00
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
|
2020-03-19 15:07:56 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|