dymokomi/luce-browser-engine
Source of release 0.6.1
0.6.1 / src / web / dom / node_list.lucb
#==============================================================================================
#
# node_list - DOM::NodeList: the abstract base of StaticNodeList and LiveNodeList
#
# DESCRIPTION:
# Port of LibWeb/DOM/NodeList.cpp (lines 1-36) and the inline functions of NodeList.h.
#
#==============================================================================================
## Ported from NodeList.cpp:14 Web::DOM::NodeList::NodeList.
pub func dom_node_list_construct(this: DomNodeList*, realm: Realm*):
bind_platform_object_construct_realm(this.bind_platform_object(), realm)
this.platform_object.m_legacy_platform_object_flags = BindPlatformObjectLegacyPlatformObjectFlags(supports_indexed_properties = 1)
## Ported from NodeList.cpp:22 Web::DOM::NodeList::initialize (override).
pub func dom_node_list_initialize_impl(base: JsCell*, realm: Realm*):
web_set_prototype_for_interface(base, realm, BindInterfaceName.node_list)
# Base::initialize(realm): PlatformObject inherits JS::Object's.
js_cell_initialize_impl(base, realm)
## Ported from NodeList.cpp:28 Web::DOM::NodeList::item_value (override).
pub func dom_node_list_item_value_impl(base: BindPlatformObject*, index: usize) -> JsValue?:
let node = dom_node_list_item((DomNodeList*)base, (u32)index) else return none
return bind_platform_object_wrapper(node.bind_platform_object())
# mark: NodeList.h ==============================================================================
## Ported from NodeList.h:22 Web::DOM::NodeList::length (virtual).
pub func dom_node_list_length_impl(this: DomNodeList*) -> u32:
trap("pure virtual: Web::DOM::NodeList::length")
## Ported from NodeList.h:23 Web::DOM::NodeList::item (virtual).
pub func dom_node_list_item_impl(this: DomNodeList*, index: u32) -> DomNode*?:
trap("pure virtual: Web::DOM::NodeList::item")