Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.0

0.6.0 / src / web / dom / mutation_record.lucb

#==============================================================================================
#
#   mutation_record - DOM::MutationRecord
#
#   DESCRIPTION:
#       Port of LibWeb/DOM/MutationRecord.cpp (lines 1-55) and the inline functions of
#       MutationRecord.h. C++ holds the target and siblings in GC::Roots; here they are cell
#       pointers that visit_edges visits, as it does in C++ (DESIGN.md ยง2.6).
#
#==============================================================================================

## Ported from MutationRecord.cpp:18 Web::DOM::MutationRecord::create.
pub func dom_mutation_record_create(realm: Realm*, type_: ak.FlyString, target: DomNode*, added_nodes: DomNodeList*, removed_nodes: DomNodeList*, previous_sibling: DomNode*?, next_sibling: DomNode*?, attribute_name: ak.String?, attribute_namespace: ak.String?, old_value: ak.String?) -> DomMutationRecord*:
    return realm_create_dom_mutation_record(realm, realm, type_, target, added_nodes, removed_nodes, previous_sibling, next_sibling, attribute_name, attribute_namespace, old_value)

## Ported from MutationRecord.cpp:23 Web::DOM::MutationRecord::MutationRecord.
pub func dom_mutation_record_construct(this: DomMutationRecord*, realm: Realm*, type_: ak.FlyString, target: DomNode*, added_nodes: DomNodeList*, removed_nodes: DomNodeList*, previous_sibling: DomNode*?, next_sibling: DomNode*?, attribute_name: ak.String?, attribute_namespace: ak.String?, old_value: ak.String?):
    bind_platform_object_construct_realm(this.bind_platform_object(), realm)
    this.m_type = type_
    this.m_target = target
    this.m_added_nodes = added_nodes
    this.m_removed_nodes = removed_nodes
    this.m_previous_sibling = previous_sibling
    this.m_next_sibling = next_sibling
    this.m_attribute_name = attribute_name
    this.m_attribute_namespace = attribute_namespace
    this.m_old_value = old_value

## Ported from MutationRecord.cpp:39 Web::DOM::MutationRecord::initialize (override).
pub func dom_mutation_record_initialize_impl(base: JsCell*, realm: Realm*):
    web_set_prototype_for_interface(base, realm, BindInterfaceName.mutation_record)
    # Base::initialize(realm): PlatformObject inherits JS::Object's.
    js_cell_initialize_impl(base, realm)

## Ported from MutationRecord.cpp:45 Web::DOM::MutationRecord::visit_edges (override).
pub func dom_mutation_record_visit_edges_impl(base: gc.Cell*, visitor: gc.CellVisitor*):
    let this = (DomMutationRecord*)base
    bind_platform_object_visit_edges_impl(base, visitor)
    gc.cell_visitor_visit_t(visitor, this.m_target)
    gc.cell_visitor_visit_t(visitor, this.m_added_nodes)
    gc.cell_visitor_visit_t(visitor, this.m_removed_nodes)
    gc.cell_visitor_visit_t(visitor, this.m_previous_sibling)
    gc.cell_visitor_visit_t(visitor, this.m_next_sibling)

# mark: MutationRecord.h ========================================================================

## Ported from MutationRecord.h:24 Web::DOM::MutationRecord::type.
pub func dom_mutation_record_type(this: DomMutationRecord*) -> ak.FlyString:
    return this.m_type

## Ported from MutationRecord.h:25 Web::DOM::MutationRecord::target.
pub func dom_mutation_record_target(this: DomMutationRecord*) -> DomNode*?:
    return this.m_target

## Ported from MutationRecord.h:26 Web::DOM::MutationRecord::added_nodes.
pub func dom_mutation_record_added_nodes(this: DomMutationRecord*) -> DomNodeList*?:
    return this.m_added_nodes

## Ported from MutationRecord.h:27 Web::DOM::MutationRecord::removed_nodes.
pub func dom_mutation_record_removed_nodes(this: DomMutationRecord*) -> DomNodeList*?:
    return this.m_removed_nodes

## Ported from MutationRecord.h:28 Web::DOM::MutationRecord::previous_sibling.
pub func dom_mutation_record_previous_sibling(this: DomMutationRecord*) -> DomNode*?:
    return this.m_previous_sibling

## Ported from MutationRecord.h:29 Web::DOM::MutationRecord::next_sibling.
pub func dom_mutation_record_next_sibling(this: DomMutationRecord*) -> DomNode*?:
    return this.m_next_sibling

## Ported from MutationRecord.h:30 Web::DOM::MutationRecord::attribute_name.
pub func dom_mutation_record_attribute_name(this: DomMutationRecord*) -> ak.String?:
    return this.m_attribute_name

## Ported from MutationRecord.h:31 Web::DOM::MutationRecord::attribute_namespace.
pub func dom_mutation_record_attribute_namespace(this: DomMutationRecord*) -> ak.String?:
    return this.m_attribute_namespace

## Ported from MutationRecord.h:32 Web::DOM::MutationRecord::old_value.
pub func dom_mutation_record_old_value(this: DomMutationRecord*) -> ak.String?:
    return this.m_old_value