2020-03-19 21:07:56 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-03-19 21:07:56 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-07-26 16:08:16 +03:00
|
|
|
#include <LibWeb/HTML/HTMLCanvasElement.h>
|
2020-11-22 17:53:01 +03:00
|
|
|
#include <LibWeb/Layout/ReplacedBox.h>
|
2020-03-19 21:07:56 +03:00
|
|
|
|
2020-11-22 17:53:01 +03:00
|
|
|
namespace Web::Layout {
|
2020-03-19 21:07:56 +03:00
|
|
|
|
2023-01-11 16:01:33 +03:00
|
|
|
class CanvasBox final : public ReplacedBox {
|
2022-10-17 15:41:50 +03:00
|
|
|
JS_CELL(CanvasBox, ReplacedBox);
|
|
|
|
|
2020-03-19 21:07:56 +03:00
|
|
|
public:
|
2020-11-22 17:53:01 +03:00
|
|
|
CanvasBox(DOM::Document&, HTML::HTMLCanvasElement&, NonnullRefPtr<CSS::StyleProperties>);
|
|
|
|
virtual ~CanvasBox() override;
|
2020-03-19 21:07:56 +03:00
|
|
|
|
2020-11-22 15:38:18 +03:00
|
|
|
virtual void prepare_for_replaced_layout() override;
|
2020-03-19 21:07:56 +03:00
|
|
|
|
2020-11-22 17:53:01 +03:00
|
|
|
const HTML::HTMLCanvasElement& dom_node() const { return static_cast<const HTML::HTMLCanvasElement&>(ReplacedBox::dom_node()); }
|
2022-03-10 16:02:25 +03:00
|
|
|
|
2023-01-11 14:51:49 +03:00
|
|
|
virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
|
2020-03-19 21:07:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|