1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

LibWeb: Only uppercase qualified names in HTML documents

This takes care of an old FIXME now that we can distinguish between HTML
and non-HTML documents.
This commit is contained in:
Andreas Kling 2022-09-18 00:53:26 +02:00
parent dc6e625680
commit 3c3ae3a768

View file

@ -545,7 +545,7 @@ CSS::CSSStyleDeclaration* Element::style_for_bindings()
void Element::make_html_uppercased_qualified_name()
{
// This is allowed by the spec: "User agents could optimize qualified name and HTML-uppercased qualified name by storing them in internal slots."
if (namespace_() == Namespace::HTML /* FIXME: and its node document is an HTML document */)
if (namespace_() == Namespace::HTML && document().document_type() == Document::Type::HTML)
m_html_uppercased_qualified_name = qualified_name().to_uppercase();
else
m_html_uppercased_qualified_name = qualified_name();