mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
LibHTML: Rename HTMLImageElement::m_image_loader => m_image_decoder
This matches the new class name, ImageDecoder.
This commit is contained in:
parent
58f67c1ccb
commit
457e49f528
3 changed files with 10 additions and 10 deletions
|
@ -34,7 +34,7 @@ void HTMLImageElement::load_image(const String& src)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_image_data = data;
|
m_image_data = data;
|
||||||
m_image_loader = ImageDecoder::create(m_image_data.data(), m_image_data.size());
|
m_image_decoder = ImageDecoder::create(m_image_data.data(), m_image_data.size());
|
||||||
document().update_layout();
|
document().update_layout();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -46,8 +46,8 @@ int HTMLImageElement::preferred_width() const
|
||||||
if (ok)
|
if (ok)
|
||||||
return width;
|
return width;
|
||||||
|
|
||||||
if (m_image_loader)
|
if (m_image_decoder)
|
||||||
return m_image_loader->width();
|
return m_image_decoder->width();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,8 @@ int HTMLImageElement::preferred_height() const
|
||||||
if (ok)
|
if (ok)
|
||||||
return height;
|
return height;
|
||||||
|
|
||||||
if (m_image_loader)
|
if (m_image_decoder)
|
||||||
return m_image_loader->height();
|
return m_image_decoder->height();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ RefPtr<LayoutNode> HTMLImageElement::create_layout_node(const StyleProperties* p
|
||||||
|
|
||||||
const GraphicsBitmap* HTMLImageElement::bitmap() const
|
const GraphicsBitmap* HTMLImageElement::bitmap() const
|
||||||
{
|
{
|
||||||
if (!m_image_loader)
|
if (!m_image_decoder)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return m_image_loader->bitmap();
|
return m_image_decoder->bitmap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,14 +17,14 @@ public:
|
||||||
int preferred_height() const;
|
int preferred_height() const;
|
||||||
|
|
||||||
const GraphicsBitmap* bitmap() const;
|
const GraphicsBitmap* bitmap() const;
|
||||||
const ImageDecoder* image_loader() const { return m_image_loader; }
|
const ImageDecoder* image_decoder() const { return m_image_decoder; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void load_image(const String& src);
|
void load_image(const String& src);
|
||||||
|
|
||||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;
|
virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;
|
||||||
|
|
||||||
RefPtr<ImageDecoder> m_image_loader;
|
RefPtr<ImageDecoder> m_image_decoder;
|
||||||
mutable RefPtr<GraphicsBitmap> m_bitmap;
|
mutable RefPtr<GraphicsBitmap> m_bitmap;
|
||||||
ByteBuffer m_image_data;
|
ByteBuffer m_image_data;
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,5 +56,5 @@ void LayoutImage::render(RenderingContext& context)
|
||||||
|
|
||||||
bool LayoutImage::renders_as_alt_text() const
|
bool LayoutImage::renders_as_alt_text() const
|
||||||
{
|
{
|
||||||
return !node().image_loader();
|
return !node().image_decoder();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue