From 2ec72fa89f19dee3def6e4e3363995d561bc029b Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 27 Sep 2024 17:17:40 +0200 Subject: [PATCH] [mujs] added fragment.appendChild test case --- src/js/mujs/fragment.c | 2 +- test/js/assert/fragment.appendChild.html | 32 ++++++++++++++++++++++++ test/js/assert/meson.build | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 test/js/assert/fragment.appendChild.html diff --git a/src/js/mujs/fragment.c b/src/js/mujs/fragment.c index abc324456..a57dc959b 100644 --- a/src/js/mujs/fragment.c +++ b/src/js/mujs/fragment.c @@ -897,7 +897,7 @@ mjs_fragment_appendChild(js_State *J) js_error(J, "error"); return; } - dom_node *el2 = (dom_node *)(mjs_getprivate_fragment(J, 1)); + dom_node *el2 = (dom_node *)(mjs_getprivate_any(J, 1)); if (!el2) { js_error(J, "error"); diff --git a/test/js/assert/fragment.appendChild.html b/test/js/assert/fragment.appendChild.html new file mode 100644 index 000000000..1022bfd85 --- /dev/null +++ b/test/js/assert/fragment.appendChild.html @@ -0,0 +1,32 @@ + + + + + + +

Click the button to append an item to the end of the list.

+ + + + +

Note:
First create an LI node,
then create a Text node,
then append the Text node to the LI node.
Finally append the LI node to the list.

+ + + + diff --git a/test/js/assert/meson.build b/test/js/assert/meson.build index 65ac9ee42..28762b33f 100644 --- a/test/js/assert/meson.build +++ b/test/js/assert/meson.build @@ -74,6 +74,7 @@ took = [ #'event.html', 'eventListener.html', 'fetch.html', +'fragment.appendChild.html', 'fragment.getElementsByTagName.html', 'keyboardEvent.html', 'navigator.appCodeName.html',