Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.1

0.6.1 / src / web / html / html_document.lucb

#==============================================================================================
#
#   html_document - HTML::HTMLDocument: the Document interface of HTML documents
#
#   DESCRIPTION:
#       Port of LibWeb/HTML/HTMLDocument.cpp (lines 1-37): construction (which moves the
#       GlobalEventHandlers table to HTMLDocument's, as C++'s vptr moves), the IDL constructor,
#       create and initialize.
#
#==============================================================================================

## Ported from HTMLDocument.cpp:14 Web::HTML::HTMLDocument::HTMLDocument.
pub func html_document_construct(this: HtmlDocument*, realm: Realm*, url: web_url.Url):
    dom_document_construct(&this.document, realm, url)
    # The vptr of the GlobalEventHandlers mixin base moves to HTMLDocument's table.
    this.document.global_event_handlers.vtable = &html_document_global_event_handlers_vtable

## Ported from HTMLDocument.cpp:21 Web::HTML::HTMLDocument::construct_impl.
pub func html_document_construct_impl(this: HtmlDocument*, realm: Realm*) -> HtmlDocument*!:
    return html_document_create(realm, web_url.about_blank())

## Ported from HTMLDocument.cpp:26 Web::HTML::HTMLDocument::create.
## (C++'s `url` defaults to URL::about_blank(), which is not a constant: callers pass it.)
pub func html_document_create(realm: Realm*, url: web_url.Url) -> HtmlDocument*:
    return realm_create_html_document(realm, realm, url)

## Ported from HTMLDocument.cpp:31 Web::HTML::HTMLDocument::initialize (override).
pub func html_document_initialize_impl(base: JsCell*, realm: Realm*):
    web_set_prototype_for_interface(base, realm, BindInterfaceName.html_document)
    dom_document_initialize_impl(base, realm)