mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 12:05:08 +00:00
LibWeb: Make HTMLSelectElement a FormAssociatedElement
This commit is contained in:
parent
c6b7b98b64
commit
e454e1a45d
2 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, The SerenityOS developers.
|
* Copyright (c) 2020, The SerenityOS developers.
|
||||||
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <LibWeb/HTML/HTMLFormElement.h>
|
||||||
#include <LibWeb/HTML/HTMLSelectElement.h>
|
#include <LibWeb/HTML/HTMLSelectElement.h>
|
||||||
|
|
||||||
namespace Web::HTML {
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, The SerenityOS developers.
|
* Copyright (c) 2020, The SerenityOS developers.
|
||||||
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -26,16 +27,23 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibWeb/HTML/FormAssociatedElement.h>
|
||||||
#include <LibWeb/HTML/HTMLElement.h>
|
#include <LibWeb/HTML/HTMLElement.h>
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
class HTMLSelectElement final : public HTMLElement {
|
class HTMLSelectElement final
|
||||||
|
: public HTMLElement
|
||||||
|
, public FormAssociatedElement {
|
||||||
public:
|
public:
|
||||||
using WrapperType = Bindings::HTMLSelectElementWrapper;
|
using WrapperType = Bindings::HTMLSelectElementWrapper;
|
||||||
|
|
||||||
HTMLSelectElement(DOM::Document&, QualifiedName);
|
HTMLSelectElement(DOM::Document&, QualifiedName);
|
||||||
virtual ~HTMLSelectElement() override;
|
virtual ~HTMLSelectElement() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual void inserted() override;
|
||||||
|
virtual void removed_from(DOM::Node*) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue