WebGLContextEvent.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/Bindings/WebGLContextEventPrototype.h>
  8. #include <LibWeb/WebGL/WebGLContextEvent.h>
  9. namespace Web::WebGL {
  10. GC_DEFINE_ALLOCATOR(WebGLContextEvent);
  11. GC::Ref<WebGLContextEvent> WebGLContextEvent::create(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init)
  12. {
  13. return realm.create<WebGLContextEvent>(realm, event_name, event_init);
  14. }
  15. WebIDL::ExceptionOr<GC::Ref<WebGLContextEvent>> WebGLContextEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init)
  16. {
  17. return create(realm, event_name, event_init);
  18. }
  19. WebGLContextEvent::WebGLContextEvent(JS::Realm& realm, FlyString const& type, WebGLContextEventInit const& event_init)
  20. : DOM::Event(realm, type, event_init)
  21. , m_status_message(event_init.status_message)
  22. {
  23. }
  24. WebGLContextEvent::~WebGLContextEvent() = default;
  25. void WebGLContextEvent::initialize(JS::Realm& realm)
  26. {
  27. Base::initialize(realm);
  28. WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLContextEvent);
  29. }
  30. }