Fix the canvas element replacement for screen

The deprecated path in QScreen still allows to provide a
canvas as the screen element.

The order of parameters in replaceChild call was wrong there,
though.

Change-Id: Id499967e3c9cdc1652e2dc251e352b9564c99f70
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
bb10
Mikolaj Boc 2022-11-30 12:17:26 +01:00
parent 8bd2368fd4
commit 71c722c4a8
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ QWasmScreen::QWasmScreen(const emscripten::val &containerOrCanvas)
qWarning() << "Support for canvas elements as an element backing screen is deprecated. The "
"canvas provided for the screen will be transformed into a div.";
auto container = document.call<emscripten::val>("createElement", emscripten::val("div"));
m_container["parentNode"].call<void>("replaceChild", m_container, container);
m_container["parentNode"].call<void>("replaceChild", container, m_container);
m_container = container;
}
auto shadowOptions = emscripten::val::object();