ladybird/Libraries/LibWeb/Layout/VideoBox.h
Aliaksandr Kalenik 901cc28272 LibWeb: Reduce recompilation impact of DOM/Document.h
Remove 11 heavy includes from Document.h that were only needed for
pointer/reference types (already forward-declared in Forward.h), and
extract the nested ViewportClient interface to a standalone header.

This reduces Document.h's recompilation cascade from ~1228 files to
~717 files (42% reduction). Headers like BrowsingContext.h that were
previously transitively included see even larger improvements (from
~1228 down to ~73 dependents).
2026-02-11 20:02:28 +01:00

40 lines
963 B
C++

/*
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/DOM/ViewportClient.h>
#include <LibWeb/Forward.h>
#include <LibWeb/Layout/ReplacedBox.h>
namespace Web::Layout {
class VideoBox final
: public ReplacedBox
, public DOM::ViewportClient {
GC_CELL(VideoBox, ReplacedBox);
GC_DECLARE_ALLOCATOR(VideoBox);
public:
static constexpr bool OVERRIDES_FINALIZE = true;
HTML::HTMLVideoElement& dom_node();
HTML::HTMLVideoElement const& dom_node() const;
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
private:
VideoBox(DOM::Document&, DOM::Element&, GC::Ref<CSS::ComputedProperties>);
virtual CSS::SizeWithAspectRatio natural_size() const override;
// ^Document::ViewportClient
virtual void did_set_viewport_rect(CSSPixelRect const&) final;
// ^JS::Cell
virtual void finalize() override;
};
}