mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 18:02:54 +00:00
LibWeb: Don't load fallback icon for SVG documents
Skip loading a fallback favicon if Document represents a decoded SVG. Issue: #23405
This commit is contained in:
parent
44d3fd0546
commit
bdb8af94ee
Notes:
sideshowbarker
2024-07-17 20:19:08 +09:00
Author: https://github.com/mobounya
Commit: bdb8af94ee
Pull-request: https://github.com/SerenityOS/serenity/pull/23406
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/kalenikaliaksandr
Reviewed-by: https://github.com/trflynn89
4 changed files with 47 additions and 34 deletions
|
@ -25,39 +25,6 @@ namespace Web::SVG {
|
|||
|
||||
JS_DEFINE_ALLOCATOR(SVGDecodedImageData);
|
||||
|
||||
class SVGDecodedImageData::SVGPageClient final : public PageClient {
|
||||
JS_CELL(SVGDecodedImageData::SVGPageClient, PageClient);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<SVGPageClient> create(JS::VM& vm, Page& page)
|
||||
{
|
||||
return vm.heap().allocate_without_realm<SVGPageClient>(page);
|
||||
}
|
||||
|
||||
virtual ~SVGPageClient() override = default;
|
||||
|
||||
Page& m_host_page;
|
||||
Page* m_svg_page { nullptr };
|
||||
|
||||
virtual Page& page() override { return *m_svg_page; }
|
||||
virtual Page const& page() const override { return *m_svg_page; }
|
||||
virtual bool is_connection_open() const override { return false; }
|
||||
virtual Gfx::Palette palette() const override { return m_host_page.client().palette(); }
|
||||
virtual DevicePixelRect screen_rect() const override { return {}; }
|
||||
virtual double device_pixels_per_css_pixel() const override { return 1.0; }
|
||||
virtual CSS::PreferredColorScheme preferred_color_scheme() const override { return m_host_page.client().preferred_color_scheme(); }
|
||||
virtual void request_file(FileRequest) override { }
|
||||
virtual void paint(DevicePixelRect const&, Gfx::Bitmap&, Web::PaintOptions = {}) override { }
|
||||
virtual void schedule_repaint() override { }
|
||||
virtual bool is_ready_to_paint() const override { return true; }
|
||||
|
||||
private:
|
||||
explicit SVGPageClient(Page& host_page)
|
||||
: m_host_page(host_page)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
ErrorOr<JS::NonnullGCPtr<SVGDecodedImageData>> SVGDecodedImageData::create(JS::Realm& realm, JS::NonnullGCPtr<Page> host_page, URL::URL const& url, ByteBuffer data)
|
||||
{
|
||||
auto page_client = SVGPageClient::create(Bindings::main_thread_vm(), host_page);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue