WebGLContextEvent.cpp 996 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/WebGL/WebGLContextEvent.h>
  8. namespace Web::WebGL {
  9. WebGLContextEvent* WebGLContextEvent::create(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init)
  10. {
  11. return realm.heap().allocate<WebGLContextEvent>(realm, realm, event_name, event_init);
  12. }
  13. WebGLContextEvent* WebGLContextEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init)
  14. {
  15. return create(realm, event_name, event_init);
  16. }
  17. WebGLContextEvent::WebGLContextEvent(JS::Realm& realm, FlyString const& type, WebGLContextEventInit const& event_init)
  18. : DOM::Event(realm, type, event_init)
  19. , m_status_message(event_init.status_message)
  20. {
  21. set_prototype(&Bindings::cached_web_prototype(realm, "WebGLContextEvent"));
  22. }
  23. WebGLContextEvent::~WebGLContextEvent() = default;
  24. }