mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
LibWeb: Move image viewport awareness from ImageBox to ImagePaintable
Images being aware of being visible inside the viewport is a painting concern, not a layout concern.
This commit is contained in:
parent
8da9ff24e4
commit
dbe961ca02
4 changed files with 26 additions and 26 deletions
|
@ -6,12 +6,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
#include <LibWeb/Layout/ImageBox.h>
|
||||
#include <LibWeb/Painting/PaintableBox.h>
|
||||
|
||||
namespace Web::Painting {
|
||||
|
||||
class ImagePaintable final : public PaintableBox {
|
||||
class ImagePaintable final
|
||||
: public PaintableBox
|
||||
, public HTML::BrowsingContext::ViewportClient {
|
||||
JS_CELL(ImagePaintable, PaintableBox);
|
||||
|
||||
public:
|
||||
|
@ -22,6 +25,12 @@ public:
|
|||
Layout::ImageBox const& layout_box() const;
|
||||
|
||||
private:
|
||||
// ^JS::Cell
|
||||
virtual void finalize() override;
|
||||
|
||||
// ^BrowsingContext::ViewportClient
|
||||
virtual void browsing_context_did_set_viewport_rect(CSSPixelRect const&) final;
|
||||
|
||||
ImagePaintable(Layout::ImageBox const&);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue