script: Pass &mut JSContext to DOM apis that call Element::create (#43108)

Testing: No behaviour change, a successful build is enough.
Part of #40600

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
Gae24
2026-03-09 11:07:13 +01:00
committed by GitHub
parent c32d9f51af
commit fa86bbedbe
13 changed files with 154 additions and 99 deletions

View File

@@ -1747,9 +1747,9 @@ fn parse_a_sizes_attribute(value: &str) -> SourceSizeList {
impl HTMLImageElementMethods<crate::DomTypeHolder> for HTMLImageElement {
/// <https://html.spec.whatwg.org/multipage/#dom-image>
fn Image(
cx: &mut JSContext,
window: &Window,
proto: Option<HandleObject>,
can_gc: CanGc,
width: Option<u32>,
height: Option<u32>,
) -> Fallible<DomRoot<HTMLImageElement>> {
@@ -1765,7 +1765,7 @@ impl HTMLImageElementMethods<crate::DomTypeHolder> for HTMLImageElement {
ElementCreator::ScriptCreated,
CustomElementCreationMode::Synchronous,
proto,
can_gc,
CanGc::from_cx(cx),
);
let image = DomRoot::downcast::<HTMLImageElement>(element).unwrap();