diff options
author | Andreas Kling <kling@serenityos.org> | 2021-04-20 22:52:55 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-20 23:38:27 +0200 |
commit | e454e1a45d1fff812ec7a788a148ff0dc6b1fc28 (patch) | |
tree | dd596b303ab8f3069b62b3089df695b853ee3d67 /Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp | |
parent | c6b7b98b64175b54ba8318032699efdb75c15857 (diff) | |
download | serenity-e454e1a45d1fff812ec7a788a148ff0dc6b1fc28.zip |
LibWeb: Make HTMLSelectElement a FormAssociatedElement
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index 5309fe81b7..4965e1f927 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, The SerenityOS developers. + * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,6 +25,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLSelectElement.h> namespace Web::HTML { @@ -37,4 +39,14 @@ HTMLSelectElement::~HTMLSelectElement() { } +void HTMLSelectElement::inserted() +{ + set_form(first_ancestor_of_type<HTMLFormElement>()); +} + +void HTMLSelectElement::removed_from(DOM::Node*) +{ + set_form(nullptr); +} + } |