HTMLProgressElement.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2020-2022, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/HTML/HTMLElement.h>
  8. namespace Web::HTML {
  9. class HTMLProgressElement final : public HTMLElement {
  10. WEB_PLATFORM_OBJECT(HTMLProgressElement, HTMLElement);
  11. public:
  12. virtual ~HTMLProgressElement() override;
  13. virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
  14. double value() const;
  15. void set_value(double);
  16. double max() const;
  17. void set_max(double value);
  18. double position() const;
  19. // ^HTMLElement
  20. // https://html.spec.whatwg.org/multipage/forms.html#category-label
  21. virtual bool is_labelable() const override { return true; }
  22. bool using_system_appearance() const;
  23. private:
  24. HTMLProgressElement(DOM::Document&, DOM::QualifiedName);
  25. void progress_position_updated();
  26. bool is_determinate() const { return has_attribute(HTML::AttributeNames::value); }
  27. };
  28. }
  29. WRAPPER_HACK(HTMLProgressElement, Web::HTML)