mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:07:36 +00:00
LibWeb: Handle null values when making args for attributeChangedCallback
JS::PrimitiveString::create uses `is_empty()` on DeprecatedString to use the empty string cache on the VM. However, this also considers the DeprecatedString null state to be empty, giving an empty string instead of `null` for null DeprecatedStrings.
This commit is contained in:
parent
f816a24b86
commit
dc5f213fa0
1 changed files with 3 additions and 3 deletions
|
@ -99,9 +99,9 @@ void Attr::handle_attribute_changes(Element& element, DeprecatedString const& ol
|
|||
|
||||
JS::MarkedVector<JS::Value> arguments { vm.heap() };
|
||||
arguments.append(JS::PrimitiveString::create(vm, local_name()));
|
||||
arguments.append(JS::PrimitiveString::create(vm, old_value));
|
||||
arguments.append(JS::PrimitiveString::create(vm, new_value));
|
||||
arguments.append(JS::PrimitiveString::create(vm, namespace_uri()));
|
||||
arguments.append(old_value.is_null() ? JS::js_null() : JS::PrimitiveString::create(vm, old_value));
|
||||
arguments.append(new_value.is_null() ? JS::js_null() : JS::PrimitiveString::create(vm, new_value));
|
||||
arguments.append(namespace_uri().is_null() ? JS::js_null() : JS::PrimitiveString::create(vm, namespace_uri()));
|
||||
|
||||
element.enqueue_a_custom_element_callback_reaction(HTML::CustomElementReactionNames::attributeChangedCallback, move(arguments));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue