/* * Copyright (c) 2018-2023, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Web::Layout { class Viewport final : public BlockContainer { JS_CELL(Viewport, BlockContainer); public: explicit Viewport(DOM::Document&, NonnullRefPtr); virtual ~Viewport() override; const DOM::Document& dom_node() const { return static_cast(*Node::dom_node()); } void paint_all_phases(PaintContext&); JS::GCPtr selection() const; void build_stacking_context_tree_if_needed(); void recompute_selection_states(); private: void build_stacking_context_tree(); virtual bool is_viewport() const override { return true; } }; template<> inline bool Node::fast_is() const { return is_viewport(); } }