HTMLProgressElement.h 916 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. public:
  11. using WrapperType = Bindings::HTMLProgressElementWrapper;
  12. HTMLProgressElement(DOM::Document&, DOM::QualifiedName);
  13. virtual ~HTMLProgressElement() override;
  14. virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
  15. double value() const;
  16. void set_value(double);
  17. double max() const;
  18. void set_max(double value);
  19. double position() const;
  20. // ^HTMLElement
  21. // https://html.spec.whatwg.org/multipage/forms.html#category-label
  22. virtual bool is_labelable() const override { return true; }
  23. private:
  24. bool is_determinate() const { return has_attribute(HTML::AttributeNames::value); }
  25. };
  26. }