LibWeb/HTML: Update cloning steps to current spec algorithms

Reflects the changes in https://github.com/whatwg/html/pull/10859

I've also added missing calls to the Base::cloned() method, and modified
a couple of spec links to point to the multipage version.

I took the liberty to fix a spec typo, and submitted a PR for it:
https://github.com/whatwg/html/pull/10892
This commit is contained in:
Sam Atkins 2025-01-05 15:46:37 +00:00 committed by Tim Ledbetter
parent 172d5f6987
commit 2e96ba11e4
Notes: github-actions[bot] 2025-01-05 21:12:56 +00:00
4 changed files with 26 additions and 18 deletions

View file

@ -1660,9 +1660,11 @@ void HTMLInputElement::apply_presentational_hints(GC::Ref<CSS::CascadedPropertie
}
// https://html.spec.whatwg.org/multipage/input.html#the-input-element%3Aconcept-node-clone-ext
WebIDL::ExceptionOr<void> HTMLInputElement::cloned(DOM::Node& copy, bool)
WebIDL::ExceptionOr<void> HTMLInputElement::cloned(DOM::Node& copy, bool subtree)
{
// The cloning steps for input elements must propagate the value, dirty value flag, checkedness, and dirty checkedness flag from the node being cloned to the copy.
TRY(Base::cloned(copy, subtree));
// The cloning steps for input elements given node, copy, and subtree are to propagate the value, dirty value flag, checkedness, and dirty checkedness flag from node to copy.
auto& input_clone = verify_cast<HTMLInputElement>(copy);
input_clone.m_value = m_value;
input_clone.m_dirty_value = m_dirty_value;