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

@ -136,9 +136,11 @@ void HTMLTextAreaElement::clear_algorithm()
}
// https://html.spec.whatwg.org/multipage/forms.html#the-textarea-element:concept-node-clone-ext
WebIDL::ExceptionOr<void> HTMLTextAreaElement::cloned(DOM::Node& copy, bool)
WebIDL::ExceptionOr<void> HTMLTextAreaElement::cloned(DOM::Node& copy, bool subtree)
{
// The cloning steps for textarea elements must propagate the raw value and dirty value flag from the node being cloned to the copy.
TRY(Base::cloned(copy, subtree));
// The cloning steps for textarea elements given node, copy, and subtree are to propagate the raw value and dirty value flag from node to copy.
auto& textarea_copy = verify_cast<HTMLTextAreaElement>(copy);
textarea_copy.m_raw_value = m_raw_value;
textarea_copy.m_dirty_value = m_dirty_value;