1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:37:34 +00:00

LibWeb: Create a basic layout node for HTMLVideoElement

This commit is contained in:
Timothy Flynn 2023-04-04 18:32:09 -04:00 committed by Linus Groh
parent 725d7c3699
commit f156d3d5e5
10 changed files with 338 additions and 0 deletions

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/ReplacedBox.h>
namespace Web::Layout {
class VideoBox final
: public ReplacedBox
, public HTML::BrowsingContext::ViewportClient {
JS_CELL(VideoBox, ReplacedBox);
public:
virtual void prepare_for_replaced_layout() override;
HTML::HTMLVideoElement& dom_node();
HTML::HTMLVideoElement const& dom_node() const;
virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
private:
VideoBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>);
// ^BrowsingContext::ViewportClient
virtual void browsing_context_did_set_viewport_rect(CSSPixelRect const&) final;
// ^JS::Cell
virtual void finalize() override;
int preferred_width() const;
int preferred_height() const;
};
}