AbstractRange.cpp 1009 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/AbstractRangePrototype.h>
  7. #include <LibWeb/Bindings/Intrinsics.h>
  8. #include <LibWeb/DOM/AbstractRange.h>
  9. #include <LibWeb/DOM/Document.h>
  10. namespace Web::DOM {
  11. AbstractRange::AbstractRange(GC::Ref<Node> start_container, WebIDL::UnsignedLong start_offset, GC::Ref<Node> end_container, WebIDL::UnsignedLong end_offset)
  12. : Bindings::PlatformObject(start_container->realm())
  13. , m_start_container(start_container)
  14. , m_start_offset(start_offset)
  15. , m_end_container(end_container)
  16. , m_end_offset(end_offset)
  17. {
  18. }
  19. AbstractRange::~AbstractRange() = default;
  20. void AbstractRange::initialize(JS::Realm& realm)
  21. {
  22. Base::initialize(realm);
  23. WEB_SET_PROTOTYPE_FOR_INTERFACE(AbstractRange);
  24. }
  25. void AbstractRange::visit_edges(Cell::Visitor& visitor)
  26. {
  27. Base::visit_edges(visitor);
  28. visitor.visit(m_start_container);
  29. visitor.visit(m_end_container);
  30. }
  31. }