summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp
blob: bf02e1e1e6584a9c7c935f470e4f9258b4c681e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Copyright (c) 2020, the SerenityOS developers.
 * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <LibWeb/HTML/HTMLFormElement.h>
#include <LibWeb/HTML/HTMLSelectElement.h>

namespace Web::HTML {

HTMLSelectElement::HTMLSelectElement(DOM::Document& document, QualifiedName qualified_name)
    : HTMLElement(document, move(qualified_name))
{
}

HTMLSelectElement::~HTMLSelectElement()
{
}

void HTMLSelectElement::inserted()
{
    HTMLElement::inserted();
    set_form(first_ancestor_of_type<HTMLFormElement>());
}

void HTMLSelectElement::removed_from(DOM::Node* old_parent)
{
    HTMLElement::removed_from(old_parent);
    set_form(nullptr);
}

}