From 77610db58cd7297ab30d4fe58f5c604ce1c291cb Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Fri, 13 Sep 2024 11:44:35 +0200 Subject: [PATCH] LibWeb: Handle http-equiv pragmas without insertion requirements These pragmas are either ignored or handled elsewhere --- .../Libraries/LibWeb/HTML/HTMLMetaElement.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp index 1ac1f52b09b..10219129fa4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp @@ -90,6 +90,11 @@ void HTMLMetaElement::inserted() auto http_equiv = http_equiv_state(); if (http_equiv.has_value()) { switch (http_equiv.value()) { + case HttpEquivAttributeState::EncodingDeclaration: + // https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-content-type + // The Encoding declaration state is just an alternative form of setting the charset attribute: it is a character encoding declaration. + // This state's user agent requirements are all handled by the parsing section of the specification. + break; case HttpEquivAttributeState::Refresh: { // https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh // 1. If the meta element has no content attribute, or if that attribute's value is the empty string, then return. @@ -105,6 +110,17 @@ void HTMLMetaElement::inserted() document().shared_declarative_refresh_steps(input, this); break; } + case HttpEquivAttributeState::SetCookie: + // https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-set-cookie + // This pragma is non-conforming and has no effect. + // User agents are required to ignore this pragma. + break; + case HttpEquivAttributeState::XUACompatible: + // https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-x-ua-compatible + // In practice, this pragma encourages Internet Explorer to more closely follow the specifications. + // For meta elements with an http-equiv attribute in the X-UA-Compatible state, the content attribute must have a value that is an ASCII case-insensitive match for the string "IE=edge". + // User agents are required to ignore this pragma. + break; default: dbgln("FIXME: Implement '{}' http-equiv state", get_attribute_value(AttributeNames::http_equiv)); break;