From c50ce2030d88bcae11c317fa02f690fef884d64d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 6 Jun 2023 07:07:27 +0200 Subject: [PATCH] LibWeb: Allow event handler attributes on HTMLLinkElement We were neglecting to set up event handlers for these due to a missing call to the base class in HTMLLinkElement::parse_attribute(). --- .../Text/expected/link-element-onload-attribute.txt | 1 + .../LibWeb/Text/input/link-element-onload-attribute.html | 9 +++++++++ Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/link-element-onload-attribute.txt create mode 100644 Tests/LibWeb/Text/input/link-element-onload-attribute.html diff --git a/Tests/LibWeb/Text/expected/link-element-onload-attribute.txt b/Tests/LibWeb/Text/expected/link-element-onload-attribute.txt new file mode 100644 index 0000000000..6c0a18f2b7 --- /dev/null +++ b/Tests/LibWeb/Text/expected/link-element-onload-attribute.txt @@ -0,0 +1 @@ +link element onload diff --git a/Tests/LibWeb/Text/input/link-element-onload-attribute.html b/Tests/LibWeb/Text/input/link-element-onload-attribute.html new file mode 100644 index 0000000000..67b7b5d4cd --- /dev/null +++ b/Tests/LibWeb/Text/input/link-element-onload-attribute.html @@ -0,0 +1,9 @@ + + diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index a19773178a..df314cb0dd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -79,6 +79,8 @@ bool HTMLLinkElement::has_loaded_icon() const void HTMLLinkElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) { + HTMLElement::parse_attribute(name, value); + // 4.6.7 Link types - https://html.spec.whatwg.org/multipage/links.html#linkTypes if (name == HTML::AttributeNames::rel) { m_relationship = 0;