Files
servo/components/script/dom/execcommand/contenteditable/document.rs
Tim van der Lippe ec513ff851 script: Split up contenteditable.rs into multiple files (#44110)
This file was getting way too big and too cluttered. Instead, split it
up into multiple files in a dedicated folder.

Part of #25005
Part of #43709

Testing: It compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-11 15:18:36 +00:00

25 lines
943 B
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 js::context::JSContext;
use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
DocumentMethods, ElementCreationOptions,
};
use crate::dom::bindings::codegen::UnionTypes::StringOrElementCreationOptions;
use crate::dom::bindings::root::DomRoot;
use crate::dom::document::Document;
use crate::dom::element::Element;
impl Document {
pub(crate) fn create_element(&self, cx: &mut JSContext, name: &str) -> DomRoot<Element> {
let element_options =
StringOrElementCreationOptions::ElementCreationOptions(ElementCreationOptions {
is: None,
});
self.CreateElement(cx, name.into(), element_options)
.expect("Must always be able to create element")
}
}