mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
LibWeb: Check that there's a head element before looking for favicons
This commit is contained in:
parent
1d0fe2325c
commit
dfad2d4c13
1 changed files with 4 additions and 1 deletions
|
@ -1963,7 +1963,10 @@ void Document::check_favicon_after_loading_link_resource()
|
||||||
{
|
{
|
||||||
// https://html.spec.whatwg.org/multipage/links.html#rel-icon
|
// https://html.spec.whatwg.org/multipage/links.html#rel-icon
|
||||||
// NOTE: firefox also load favicons outside the head tag, which is against spec (see table 4.6.7)
|
// NOTE: firefox also load favicons outside the head tag, which is against spec (see table 4.6.7)
|
||||||
auto head_element = head();
|
auto* head_element = head();
|
||||||
|
if (!head_element)
|
||||||
|
return;
|
||||||
|
|
||||||
auto favicon_link_elements = HTMLCollection::create(*head_element, [](Element const& element) {
|
auto favicon_link_elements = HTMLCollection::create(*head_element, [](Element const& element) {
|
||||||
if (!is<HTML::HTMLLinkElement>(element))
|
if (!is<HTML::HTMLLinkElement>(element))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue