summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.h
blob: e66b3a918a588220eb4b568f5e8e916a1311ec31 (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
/*
 * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/WeakPtr.h>
#include <LibWeb/Forward.h>

namespace Web::HTML {

class FormAssociatedElement {
public:
    HTMLFormElement* form() { return m_form; }
    HTMLFormElement const* form() const { return m_form; }

    void set_form(HTMLFormElement*);

protected:
    FormAssociatedElement() = default;
    virtual ~FormAssociatedElement() = default;

    virtual HTMLElement& form_associated_element_to_html_element() = 0;

private:
    WeakPtr<HTMLFormElement> m_form;
};

}