2021-10-13 14:20:50 -04:00
|
|
|
/*
|
2022-01-31 13:07:22 -05:00
|
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
2021-10-13 14:20:50 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
LibWeb: Remove unecessary dependence on Window from assorted classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Crypto, Encoding, HRT, IntersectionObserver,
NavigationTiming, Page, RequestIdleCallback, Selection, Streams, URL,
and XML classes.
2022-09-25 18:11:21 -06:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2021-10-13 14:20:50 -04:00
|
|
|
#include <LibWeb/DOM/Element.h>
|
|
|
|
#include <LibWeb/IntersectionObserver/IntersectionObserver.h>
|
|
|
|
|
|
|
|
namespace Web::IntersectionObserver {
|
|
|
|
|
|
|
|
// https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-intersectionobserver
|
LibWeb: Remove unecessary dependence on Window from assorted classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Crypto, Encoding, HRT, IntersectionObserver,
NavigationTiming, Page, RequestIdleCallback, Selection, Streams, URL,
and XML classes.
2022-09-25 18:11:21 -06:00
|
|
|
JS::NonnullGCPtr<IntersectionObserver> IntersectionObserver::construct_impl(JS::Realm& realm, WebIDL::CallbackType* callback, IntersectionObserverInit const& options)
|
2021-10-13 14:20:50 -04:00
|
|
|
{
|
|
|
|
// FIXME: Implement
|
|
|
|
(void)callback;
|
|
|
|
(void)options;
|
|
|
|
|
2022-12-14 17:40:33 +00:00
|
|
|
return realm.heap().allocate<IntersectionObserver>(realm, realm);
|
2021-10-13 14:20:50 -04:00
|
|
|
}
|
|
|
|
|
LibWeb: Remove unecessary dependence on Window from assorted classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Crypto, Encoding, HRT, IntersectionObserver,
NavigationTiming, Page, RequestIdleCallback, Selection, Streams, URL,
and XML classes.
2022-09-25 18:11:21 -06:00
|
|
|
IntersectionObserver::IntersectionObserver(JS::Realm& realm)
|
|
|
|
: PlatformObject(realm)
|
2022-09-04 14:14:22 +02:00
|
|
|
{
|
LibWeb: Remove unecessary dependence on Window from assorted classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Crypto, Encoding, HRT, IntersectionObserver,
NavigationTiming, Page, RequestIdleCallback, Selection, Streams, URL,
and XML classes.
2022-09-25 18:11:21 -06:00
|
|
|
set_prototype(&Bindings::cached_web_prototype(realm, "IntersectionObserver"));
|
2022-09-04 14:14:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
IntersectionObserver::~IntersectionObserver() = default;
|
|
|
|
|
2021-10-13 14:20:50 -04:00
|
|
|
// https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-observe
|
|
|
|
void IntersectionObserver::observe(DOM::Element& target)
|
|
|
|
{
|
|
|
|
// FIXME: Implement
|
|
|
|
(void)target;
|
|
|
|
}
|
|
|
|
|
|
|
|
// https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-unobserve
|
|
|
|
void IntersectionObserver::unobserve(DOM::Element& target)
|
|
|
|
{
|
|
|
|
// FIXME: Implement
|
|
|
|
(void)target;
|
|
|
|
}
|
|
|
|
|
|
|
|
// https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-disconnect
|
|
|
|
void IntersectionObserver::disconnect()
|
|
|
|
{
|
|
|
|
// FIXME: Implement
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|