HTMLOptionElement.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibWeb/HTML/HTMLElement.h>
  9. namespace Web::HTML {
  10. class HTMLOptionElement final : public HTMLElement {
  11. public:
  12. using WrapperType = Bindings::HTMLOptionElementWrapper;
  13. HTMLOptionElement(DOM::Document&, DOM::QualifiedName);
  14. virtual ~HTMLOptionElement() override;
  15. bool selected() const { return m_selected; }
  16. void set_selected(bool);
  17. private:
  18. friend class Bindings::OptionConstructor;
  19. friend class HTMLSelectElement;
  20. void parse_attribute(FlyString const& name, String const& value) override;
  21. void did_remove_attribute(FlyString const& name) override;
  22. void ask_for_a_reset();
  23. // https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
  24. bool m_selected { false };
  25. // https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-dirtiness
  26. bool m_dirty { false };
  27. };
  28. }