2021-04-20 11:50:29 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-04-20 11:50:29 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/HTML/FormAssociatedElement.h>
|
|
|
|
#include <LibWeb/HTML/HTMLFormElement.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
void FormAssociatedElement::set_form(HTMLFormElement* form)
|
|
|
|
{
|
2021-04-20 23:34:49 +02:00
|
|
|
if (m_form)
|
2021-10-14 16:18:49 +01:00
|
|
|
m_form->remove_associated_element({}, *this);
|
2021-04-20 11:50:29 +02:00
|
|
|
m_form = form;
|
2021-04-20 23:34:49 +02:00
|
|
|
if (m_form)
|
2021-10-14 16:18:49 +01:00
|
|
|
m_form->add_associated_element({}, *this);
|
2021-04-20 11:50:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|