mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:58:12 +00:00
LibWeb: Visit ImageProvider from Layout::ImageBox
Adds missing visit of HTMLElement that serves as image provider of image layout node.
This commit is contained in:
parent
9fa22b60cf
commit
ef01c735cd
6 changed files with 13 additions and 0 deletions
|
@ -91,6 +91,7 @@ public:
|
|||
virtual Optional<CSSPixelFraction> intrinsic_aspect_ratio() const override;
|
||||
virtual RefPtr<Gfx::ImmutableBitmap> current_image_bitmap(Gfx::IntSize = {}) const override;
|
||||
virtual void set_visible_in_viewport(bool) override;
|
||||
virtual JS::NonnullGCPtr<DOM::Element const> to_html_element() const override { return *this; }
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
|
|
|
@ -205,6 +205,7 @@ private:
|
|||
virtual Optional<CSSPixelFraction> intrinsic_aspect_ratio() const override;
|
||||
virtual RefPtr<Gfx::ImmutableBitmap> current_image_bitmap(Gfx::IntSize = {}) const override;
|
||||
virtual void set_visible_in_viewport(bool) override;
|
||||
virtual JS::NonnullGCPtr<DOM::Element const> to_html_element() const override { return *this; }
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
|
|
@ -81,6 +81,7 @@ private:
|
|||
virtual Optional<CSSPixelFraction> intrinsic_aspect_ratio() const override;
|
||||
virtual RefPtr<Gfx::ImmutableBitmap> current_image_bitmap(Gfx::IntSize = {}) const override;
|
||||
virtual void set_visible_in_viewport(bool) override;
|
||||
virtual JS::NonnullGCPtr<DOM::Element const> to_html_element() const override { return *this; }
|
||||
|
||||
Representation m_representation { Representation::Unknown };
|
||||
|
||||
|
|
|
@ -22,6 +22,12 @@ ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr
|
|||
|
||||
ImageBox::~ImageBox() = default;
|
||||
|
||||
void ImageBox::visit_edges(JS::Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_image_provider.to_html_element());
|
||||
}
|
||||
|
||||
void ImageBox::prepare_for_replaced_layout()
|
||||
{
|
||||
set_natural_width(m_image_provider.intrinsic_width());
|
||||
|
|
|
@ -32,6 +32,8 @@ public:
|
|||
void dom_node_did_update_alt_text(Badge<ImageProvider>);
|
||||
|
||||
private:
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
ImageProvider const& m_image_provider;
|
||||
|
||||
Optional<CSSPixels> m_cached_alt_text_width;
|
||||
|
|
|
@ -25,6 +25,8 @@ public:
|
|||
virtual RefPtr<Gfx::ImmutableBitmap> current_image_bitmap(Gfx::IntSize) const = 0;
|
||||
virtual void set_visible_in_viewport(bool) = 0;
|
||||
|
||||
virtual JS::NonnullGCPtr<DOM::Element const> to_html_element() const = 0;
|
||||
|
||||
protected:
|
||||
static void did_update_alt_text(ImageBox&);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue