mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibWeb/DOM: Stop moving is_value
in create_element()
Clangd points out that 1) `set_is_value()` takes a reference so moving isn't useful, and 2) we're reading `is_value` in step 3 after moving it.
This commit is contained in:
parent
91fe0e1a1a
commit
c4889f3c5c
Notes:
github-actions[bot]
2025-02-20 21:56:45 +00:00
Author: https://github.com/AtkinsSJ
Commit: c4889f3c5c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3560
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 3 additions and 3 deletions
|
@ -656,7 +656,7 @@ WebIDL::ExceptionOr<GC::Ref<Element>> create_element(Document& document, FlyStri
|
|||
|
||||
if (namespace_ == Namespace::HTML) {
|
||||
auto element = create_html_element(realm, document, move(qualified_name));
|
||||
element->set_is_value(move(is_value));
|
||||
element->set_is_value(is_value);
|
||||
element->set_custom_element_state(CustomElementState::Uncustomized);
|
||||
|
||||
// 3. If namespace is the HTML namespace, and either localName is a valid custom element name or is is non-null,
|
||||
|
@ -669,14 +669,14 @@ WebIDL::ExceptionOr<GC::Ref<Element>> create_element(Document& document, FlyStri
|
|||
|
||||
if (namespace_ == Namespace::SVG) {
|
||||
auto element = create_svg_element(realm, document, qualified_name);
|
||||
element->set_is_value(move(is_value));
|
||||
element->set_is_value(is_value);
|
||||
element->set_custom_element_state(CustomElementState::Uncustomized);
|
||||
return element;
|
||||
}
|
||||
|
||||
if (namespace_ == Namespace::MathML) {
|
||||
auto element = create_mathml_element(realm, document, qualified_name);
|
||||
element->set_is_value(move(is_value));
|
||||
element->set_is_value(is_value);
|
||||
element->set_custom_element_state(CustomElementState::Uncustomized);
|
||||
return element;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue