dymokomi/luce-browser-engine
Source of release 0.6.1
0.6.1 / src / web / dom / comment.lucb
#==============================================================================================
#
# comment - DOM::Comment: comment nodes
#
# DESCRIPTION:
# Port of LibWeb/DOM/Comment.cpp (lines 1-34) and the inline functions of Comment.h.
#
#==============================================================================================
## Ported from Comment.cpp:16 Web::DOM::Comment::Comment.
pub func dom_comment_construct(this: DomComment*, document: DomDocument*, data: ak.Utf16String):
dom_character_data_construct(this.dom_character_data(), document, DomNodeType.comment_node, data)
## Ported from Comment.cpp:22 Web::DOM::Comment::construct_impl.
# https://dom.spec.whatwg.org/#dom-comment-comment
pub func dom_comment_construct_impl(realm: Realm*, data: ak.Utf16String) -> DomComment*!:
let window = as_html_window((gc.Cell*)realm_global_object(realm))
return realm_create_dom_comment(realm, html_window_associated_document(window), data)
## Ported from Comment.cpp:28 Web::DOM::Comment::initialize (override).
pub func dom_comment_initialize_impl(base: JsCell*, realm: Realm*):
web_set_prototype_for_interface(base, realm, BindInterfaceName.comment)
dom_character_data_initialize_impl(base, realm)
## Ported from Comment.h:21 Web::DOM::Comment::node_name (override).
pub func dom_comment_node_name_impl(base: DomNode*) -> ak.FlyString:
return ak.fly_string_from_str("#comment")