AudioBox.cpp 872 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/HTML/HTMLAudioElement.h>
  7. #include <LibWeb/Layout/AudioBox.h>
  8. #include <LibWeb/Painting/AudioPaintable.h>
  9. namespace Web::Layout {
  10. AudioBox::AudioBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
  11. : ReplacedBox(document, element, move(style))
  12. {
  13. set_natural_width(300);
  14. set_natural_height(40);
  15. }
  16. HTML::HTMLAudioElement& AudioBox::dom_node()
  17. {
  18. return static_cast<HTML::HTMLAudioElement&>(ReplacedBox::dom_node());
  19. }
  20. HTML::HTMLAudioElement const& AudioBox::dom_node() const
  21. {
  22. return static_cast<HTML::HTMLAudioElement const&>(ReplacedBox::dom_node());
  23. }
  24. JS::GCPtr<Painting::Paintable> AudioBox::create_paintable() const
  25. {
  26. return Painting::AudioPaintable::create(*this);
  27. }
  28. }