mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
LibWeb: Move viewport subscriptions from BrowsingContext to Document
With this change, elements that want to receive viewport rect updates will need to register on document instead of the browsing context. This change solves the problem where a browsing context for a document is guaranteed to exist only while the document is active so browsing context might not exit by the time DOM node that want to register is constructed. This is a part of preparation work before switching to navigables where this issue becomes more visible.
This commit is contained in:
parent
48e9097aa4
commit
5ff7448fee
10 changed files with 66 additions and 61 deletions
|
@ -6,15 +6,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#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 {
|
||||
, public DOM::Document::ViewportClient {
|
||||
JS_CELL(VideoBox, ReplacedBox);
|
||||
|
||||
public:
|
||||
|
@ -28,8 +28,8 @@ public:
|
|||
private:
|
||||
VideoBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
||||
// ^BrowsingContext::ViewportClient
|
||||
virtual void browsing_context_did_set_viewport_rect(CSSPixelRect const&) final;
|
||||
// ^Document::ViewportClient
|
||||
virtual void did_set_viewport_rect(CSSPixelRect const&) final;
|
||||
|
||||
// ^JS::Cell
|
||||
virtual void finalize() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue