LibWeb: Support for Content-Language HTTP header

This commit is contained in:
Piotr 2025-01-14 20:31:44 +01:00 committed by Tim Ledbetter
commit c9edb6ffc4
Notes: github-actions[bot] 2025-02-19 10:54:32 +00:00
5 changed files with 51 additions and 0 deletions

View file

@ -3670,6 +3670,10 @@ Optional<String> Element::lang() const
}
// - If there is no pragma-set default language set, then language information from a higher-level protocol (such as HTTP),
if (document().http_content_language().has_value()) {
return document().http_content_language();
}
// if any, must be used as the final fallback language instead.
// - In the absence of any such language information, and in cases where the higher-level protocol reports multiple languages,
// the language of the node is unknown, and the corresponding language tag is the empty string.