2022-08-09 01:06:47 +02:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2022-08-09 01:06:47 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2024-04-27 12:09:58 +12:00
|
|
|
#include <LibWeb/Bindings/AbstractRangePrototype.h>
|
2022-09-25 16:15:49 -06:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2022-08-09 01:06:47 +02:00
|
|
|
#include <LibWeb/DOM/AbstractRange.h>
|
|
|
|
#include <LibWeb/DOM/Document.h>
|
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
|
2024-11-30 10:32:32 +01:00
|
|
|
AbstractRange::AbstractRange(GC::Ref<Node> start_container, WebIDL::UnsignedLong start_offset, GC::Ref<Node> end_container, WebIDL::UnsignedLong end_offset)
|
|
|
|
: Bindings::PlatformObject(start_container->realm())
|
2022-08-09 01:06:47 +02:00
|
|
|
, m_start_container(start_container)
|
|
|
|
, m_start_offset(start_offset)
|
|
|
|
, m_end_container(end_container)
|
|
|
|
, m_end_offset(end_offset)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
AbstractRange::~AbstractRange() = default;
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
void AbstractRange::initialize(JS::Realm& realm)
|
2023-01-10 06:56:59 -05:00
|
|
|
{
|
2024-03-16 13:13:08 +01:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(AbstractRange);
|
2025-04-20 16:22:57 +02:00
|
|
|
Base::initialize(realm);
|
2023-01-10 06:56:59 -05:00
|
|
|
}
|
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
void AbstractRange::visit_edges(Cell::Visitor& visitor)
|
|
|
|
{
|
|
|
|
Base::visit_edges(visitor);
|
2023-11-19 16:18:00 +13:00
|
|
|
visitor.visit(m_start_container);
|
|
|
|
visitor.visit(m_end_container);
|
2022-08-28 13:42:07 +02:00
|
|
|
}
|
|
|
|
|
2022-08-09 01:06:47 +02:00
|
|
|
}
|