From cc52e5a168a3bfb1eba299bbe00db946b83b479d Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Mon, 30 Sep 2024 19:31:47 +0200 Subject: [PATCH] [js] Added background-clip to mujs and quickjs To be consistent with spidermonkey --- src/js/mujs/mapa.c | 1 + src/js/quickjs/css.c | 6 +++--- src/js/quickjs/mapa.c | 1 + test/js/assert/meson.build | 1 + test/js/assert/style.backgroundClip.html | 19 +++++++++++++++++++ 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 test/js/assert/style.backgroundClip.html diff --git a/src/js/mujs/mapa.c b/src/js/mujs/mapa.c index 7fe70f413..fecbbbf47 100644 --- a/src/js/mujs/mapa.c +++ b/src/js/mujs/mapa.c @@ -339,6 +339,7 @@ get_output_header(const char *header_name, struct mjs_xhr *x) } const char *good[] = { "background", + "background-clip", "background-color", "color", "display", diff --git a/src/js/quickjs/css.c b/src/js/quickjs/css.c index dfafa0368..abe172113 100644 --- a/src/js/quickjs/css.c +++ b/src/js/quickjs/css.c @@ -134,9 +134,9 @@ js_CSSStyleDeclaration_set_items(JSContext *ctx, JSValue this_val, void *node) #endif REF_JS(this_val); - JS_DefinePropertyValueStr(ctx, this_val, "marginTop", JS_NewString(ctx, "0"), 0); - JS_DefinePropertyValueStr(ctx, this_val, "marginLeft", JS_NewString(ctx, "0"), 0); - JS_DefinePropertyValueStr(ctx, this_val, "marginRight", JS_NewString(ctx, "0"), 0); + JS_DefinePropertyValueStr(ctx, this_val, "marginTop", JS_NewString(ctx, "0"), JS_PROP_ENUMERABLE); + JS_DefinePropertyValueStr(ctx, this_val, "marginLeft", JS_NewString(ctx, "0"), JS_PROP_ENUMERABLE); + JS_DefinePropertyValueStr(ctx, this_val, "marginRight", JS_NewString(ctx, "0"), JS_PROP_ENUMERABLE); } static JSValue diff --git a/src/js/quickjs/mapa.c b/src/js/quickjs/mapa.c index dc076460e..13664b2ab 100644 --- a/src/js/quickjs/mapa.c +++ b/src/js/quickjs/mapa.c @@ -597,6 +597,7 @@ get_output_header(const char *header_name, struct Xhr *x) } const char *good[] = { "background", + "background-clip", "background-color", "color", "display", diff --git a/test/js/assert/meson.build b/test/js/assert/meson.build index 948e4a79c..b704d31e1 100644 --- a/test/js/assert/meson.build +++ b/test/js/assert/meson.build @@ -81,6 +81,7 @@ took = [ 'navigator.appCodeName.html', 'node.nodeType.html', 'nodelist.forEach.html', +'style.backgroundClip.html', 'window.setTimeout.html', 'URL.html', 'URLSearchParams.html' diff --git a/test/js/assert/style.backgroundClip.html b/test/js/assert/style.backgroundClip.html new file mode 100644 index 000000000..20d3f75be --- /dev/null +++ b/test/js/assert/style.backgroundClip.html @@ -0,0 +1,19 @@ + + + + + +

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.

+ + + +