2022-08-08 20:06:47 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2022-08-08 20:06:47 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2024-04-26 21:09:58 -03:00
|
|
|
#include <LibWeb/Bindings/AbstractRangePrototype.h>
|
2022-09-25 19:15:49 -03:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2022-08-08 20:06:47 -03:00
|
|
|
#include <LibWeb/DOM/AbstractRange.h>
|
|
|
|
|
#include <LibWeb/DOM/Document.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
|
|
2024-11-30 06:32:32 -03: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-08 20:06:47 -03: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 03:41:28 -03:00
|
|
|
void AbstractRange::initialize(JS::Realm& realm)
|
2023-01-10 08:56:59 -03:00
|
|
|
{
|
2024-03-16 09:13:08 -03:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(AbstractRange);
|
2025-04-20 11:22:57 -03:00
|
|
|
Base::initialize(realm);
|
2023-01-10 08:56:59 -03:00
|
|
|
}
|
|
|
|
|
|
2022-08-28 08:42:07 -03:00
|
|
|
void AbstractRange::visit_edges(Cell::Visitor& visitor)
|
|
|
|
|
{
|
|
|
|
|
Base::visit_edges(visitor);
|
2023-11-19 00:18:00 -03:00
|
|
|
visitor.visit(m_start_container);
|
|
|
|
|
visitor.visit(m_end_container);
|
2022-08-28 08:42:07 -03:00
|
|
|
}
|
|
|
|
|
|
2022-08-08 20:06:47 -03:00
|
|
|
}
|