Nacre/vendor/servo-script/dom/html/document_structure/htmlhtmlelement.rs
astar76 1c078655e2 S022: MSE prototype on gst_mse (vendored script, script-bindings, servo-media*)
MediaSource, SourceBuffer, SourceBufferList over GStreamer's MSE library;
URL.createObjectURL(MediaSource); HTMLMediaElement attaches via mse://.
tests/smoke/mse.txt plays chunk-appended fMP4 and WebM.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 10:21:01 -06:00

56 lines
1.7 KiB
Rust

/* 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<Prefix>,
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<Prefix>,
document: &Document,
proto: Option<HandleObject>,
) -> DomRoot<HTMLHtmlElement> {
let n = Node::reflect_node_with_proto(
cx,
Box::new(HTMLHtmlElement::new_inherited(local_name, prefix, document)),
document,
proto,
);
n.upcast::<Node>().set_weird_parser_insertion_mode();
n
}
}
impl HTMLHtmlElementMethods<crate::DomTypeHolder> for HTMLHtmlElement {
make_getter!(Version, "version");
make_setter!(SetVersion, "version");
}