/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; use js::rust::HandleObject; use script_bindings::codegen::GenericBindings::HTMLHtmlElementBinding::HTMLHtmlElementMethods; use crate::dom::bindings::inheritance::Castable; use crate::dom::bindings::root::DomRoot; use crate::dom::bindings::str::DOMString; use crate::dom::document::Document; use crate::dom::html::htmlelement::HTMLElement; use crate::dom::node::Node; #[dom_struct] pub(crate) struct HTMLHtmlElement { htmlelement: HTMLElement, } #[expect(non_snake_case)] impl HTMLHtmlElement { fn new_inherited( localName: LocalName, prefix: Option, document: &Document, ) -> HTMLHtmlElement { HTMLHtmlElement { htmlelement: HTMLElement::new_inherited(localName, prefix, document), } } pub(crate) fn new( cx: &mut js::context::JSContext, local_name: LocalName, prefix: Option, document: &Document, proto: Option, ) -> DomRoot { let n = Node::reflect_node_with_proto( cx, Box::new(HTMLHtmlElement::new_inherited(local_name, prefix, document)), document, proto, ); n.upcast::().set_weird_parser_insertion_mode(); n } } impl HTMLHtmlElementMethods for HTMLHtmlElement { make_getter!(Version, "version"); make_setter!(SetVersion, "version"); }