mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibWeb: Only use lowercase attributes on toggle for HTML documents
This commit is contained in:
parent
89a536b57a
commit
e5206f5529
Notes:
sideshowbarker
2024-07-17 08:38:37 +09:00
Author: https://github.com/shannonbooth
Commit: e5206f5529
Pull-request: https://github.com/SerenityOS/serenity/pull/24291
3 changed files with 20 additions and 2 deletions
|
@ -342,8 +342,7 @@ WebIDL::ExceptionOr<bool> Element::toggle_attribute(FlyString const& name, Optio
|
|||
return WebIDL::InvalidCharacterError::create(realm(), "Attribute name must not be empty"_fly_string);
|
||||
|
||||
// 2. If this is in the HTML namespace and its node document is an HTML document, then set qualifiedName to qualifiedName in ASCII lowercase.
|
||||
// FIXME: Handle the second condition, assume it is an HTML document for now.
|
||||
bool insert_as_lowercase = namespace_uri() == Namespace::HTML;
|
||||
bool insert_as_lowercase = namespace_uri() == Namespace::HTML && document().document_type() == Document::Type::HTML;
|
||||
|
||||
// 3. Let attribute be the first attribute in this’s attribute list whose qualified name is qualifiedName, and null otherwise.
|
||||
auto* attribute = m_attributes->get_attribute(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue