HTMLImageElement.h 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/ByteBuffer.h>
  8. #include <AK/OwnPtr.h>
  9. #include <LibGfx/Forward.h>
  10. #include <LibWeb/HTML/HTMLElement.h>
  11. #include <LibWeb/Loader/ImageLoader.h>
  12. namespace Web::HTML {
  13. class HTMLImageElement final : public HTMLElement {
  14. public:
  15. using WrapperType = Bindings::HTMLImageElementWrapper;
  16. HTMLImageElement(DOM::Document&, QualifiedName);
  17. virtual ~HTMLImageElement() override;
  18. virtual void parse_attribute(const FlyString& name, const String& value) override;
  19. String alt() const { return attribute(HTML::AttributeNames::alt); }
  20. String src() const { return attribute(HTML::AttributeNames::src); }
  21. const Gfx::Bitmap* bitmap() const;
  22. private:
  23. virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
  24. void animate();
  25. virtual RefPtr<Layout::Node> create_layout_node() override;
  26. ImageLoader m_image_loader;
  27. };
  28. }