IntersectionObserver.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/DOM/Element.h>
  8. #include <LibWeb/IntersectionObserver/IntersectionObserver.h>
  9. namespace Web::IntersectionObserver {
  10. // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-intersectionobserver
  11. JS::NonnullGCPtr<IntersectionObserver> IntersectionObserver::construct_impl(JS::Realm& realm, WebIDL::CallbackType* callback, IntersectionObserverInit const& options)
  12. {
  13. // FIXME: Implement
  14. (void)callback;
  15. (void)options;
  16. return *realm.heap().allocate<IntersectionObserver>(realm, realm);
  17. }
  18. IntersectionObserver::IntersectionObserver(JS::Realm& realm)
  19. : PlatformObject(realm)
  20. {
  21. set_prototype(&Bindings::cached_web_prototype(realm, "IntersectionObserver"));
  22. }
  23. IntersectionObserver::~IntersectionObserver() = default;
  24. // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-observe
  25. void IntersectionObserver::observe(DOM::Element& target)
  26. {
  27. // FIXME: Implement
  28. (void)target;
  29. }
  30. // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-unobserve
  31. void IntersectionObserver::unobserve(DOM::Element& target)
  32. {
  33. // FIXME: Implement
  34. (void)target;
  35. }
  36. // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-disconnect
  37. void IntersectionObserver::disconnect()
  38. {
  39. // FIXME: Implement
  40. }
  41. }