mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +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
|
@ -107,6 +107,7 @@
|
|||
#include <LibWeb/PermissionsPolicy/AutoplayAllowlist.h>
|
||||
#include <LibWeb/ResizeObserver/ResizeObserver.h>
|
||||
#include <LibWeb/ResizeObserver/ResizeObserverEntry.h>
|
||||
#include <LibWeb/SVG/SVGDecodedImageData.h>
|
||||
#include <LibWeb/SVG/SVGElement.h>
|
||||
#include <LibWeb/SVG/SVGTitleElement.h>
|
||||
#include <LibWeb/SVG/TagNames.h>
|
||||
|
@ -2154,6 +2155,9 @@ void Document::update_readiness(HTML::DocumentReadyState readiness_value)
|
|||
if (readiness_value == HTML::DocumentReadyState::Complete) {
|
||||
auto navigable = this->navigable();
|
||||
if (navigable && navigable->is_traversable()) {
|
||||
if (!is_decoded_svg()) {
|
||||
HTML::HTMLLinkElement::load_fallback_favicon_if_needed(*this).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
HTML::HTMLLinkElement::load_fallback_favicon_if_needed(*this).release_value_but_fixme_should_propagate_errors();
|
||||
navigable->traversable_navigable()->page().client().page_did_finish_loading(url());
|
||||
} else {
|
||||
|
@ -4803,6 +4807,11 @@ void Document::for_each_shadow_root(Function<void(DOM::ShadowRoot&)>&& callback)
|
|||
callback(shadow_root);
|
||||
}
|
||||
|
||||
bool Document::is_decoded_svg() const
|
||||
{
|
||||
return is<Web::SVG::SVGDecodedImageData::SVGPageClient>(page().client());
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-position-4/#add-an-element-to-the-top-layer
|
||||
void Document::add_an_element_to_the_top_layer(JS::NonnullGCPtr<Element> element)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue