This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch edje-vector-intergration
in repository efl.
View the commit online.
commit 5ed0b9514a50c0bbc60a444d981ee5eb27b6d6fb
Author: [email protected] <[email protected]>
AuthorDate: Wed Apr 29 15:13:48 2026 -0600
edje: test override-side empty-string class clear (Task 6.3)
Regression test for spec §6.4 empty-string class clear semantics.
Phase 4.4's override-apply path uses eina_stringshare_replace, which
handles empty strings transparently, and Phase 6.2's _resolve_binding
short-circuits on !*cb->color_class. Together they implement the spec
correctly without production code changes.
The fixture ui/box_class_clear has two states: default (stroke bound
to vg_outline class: 30,30,30,255) and raw (class binding cleared via
empty string, raw stroke 100,200,50,255 used directly). Test asserts
on stroke color to avoid Task 6.4's materializer fill bug.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
src/tests/edje/data/test_vector_states.edc | 24 ++++++++
src/tests/edje/edje_test_vector_states.c | 99 ++++++++++++++++++++++++++++++
2 files changed, 123 insertions(+)
diff --git a/src/tests/edje/data/test_vector_states.edc b/src/tests/edje/data/test_vector_states.edc
index d3f3900a5c..fdf7d71416 100644
--- a/src/tests/edje/data/test_vector_states.edc
+++ b/src/tests/edje/data/test_vector_states.edc
@@ -112,6 +112,30 @@ collections {
}
} }
}
+ /* Task 6.3: override-side empty-string class clear.
+ * Default description inherits tile_classed (stroke bound to vg_outline).
+ * The "raw" description clears the stroke class binding ("") and sets an
+ * explicit raw RGBA (100 200 50 255), exercising §6.4 clear semantics. */
+ group { name: "ui/box_class_clear";
+ parts { part { name: "vg"; type: VECTOR;
+ description { state: "default" 0.0;
+ vector.use: "tile_classed"; /* stroke bound to vg_outline: (30,30,30,255) */
+ }
+ description { state: "raw" 0.0;
+ inherit: "default" 0.0;
+ vector.shape { target: "body";
+ stroke.color_class: ""; /* clear stroke class binding */
+ stroke.color: 100 200 50 255; /* raw RGBA used directly, no class */
+ }
+ }
+ } }
+ programs {
+ program { signal: "test,raw"; source: "test";
+ action: STATE_SET "raw" 0.0;
+ target: "vg";
+ }
+ }
+ }
/* Task 4.4: inherit + per-target merge fixture.
* The default description sets visible and stroke.width on "body".
* The active description inherits from default (getting those fields) and
diff --git a/src/tests/edje/edje_test_vector_states.c b/src/tests/edje/edje_test_vector_states.c
index 486b9c828c..6b058f8aad 100644
--- a/src/tests/edje/edje_test_vector_states.c
+++ b/src/tests/edje/edje_test_vector_states.c
@@ -1671,6 +1671,103 @@ EFL_START_TEST(edje_vg_runtime_class_retint)
}
EFL_END_TEST
+/*
+ * edje_vg_override_class_clear (Task 6.3)
+ *
+ * Regression test for §6.4 override-side empty-string class clear semantics.
+ *
+ * Fixture: ui/box_class_clear
+ * default state: tile_classed — stroke.color_class = "vg_outline" (30,30,30,255)
+ * raw stroke default = white (255,255,255,255)
+ * resolved stroke = 255*30/255 = 30 per channel → (30,30,30,255)
+ * raw state: inherits default, then:
+ * stroke.color_class: "" ← clears the class binding
+ * stroke.color: 100 200 50 255 ← explicit raw RGBA
+ * resolved stroke = raw RGBA used directly (no class multiplication) → (100,200,50,255)
+ *
+ * Stroke color is used for the assertion because Task 6.4 hasn't fixed the
+ * fill-vs-node-color materializer bug yet — stroke has its own independent
+ * getter unaffected by that bug.
+ */
+EFL_START_TEST(edje_vg_override_class_clear)
+{
+ const char *edj = TESTS_BUILD_DIR "/data/test_vector_states.edj";
+ Ecore_Evas *ee;
+ Evas *evas;
+ Evas_Object *obj;
+ Evas_Object *vg_part;
+ Efl_Canvas_Vg_Node *vg_root;
+ Efl_Canvas_Vg_Node *body_node;
+ int r, g, b, a;
+
+ /* --- Setup: buffer canvas, edje object, load group --- */
+ ee = ecore_evas_buffer_new(VG_RENDER_W, VG_RENDER_H);
+ fail_if(!ee);
+ ecore_evas_show(ee);
+ ecore_evas_manual_render_set(ee, EINA_TRUE);
+
+ evas = ecore_evas_get(ee);
+ fail_if(!evas);
+
+ obj = edje_object_add(evas);
+ fail_if(!obj);
+
+ fail_unless(edje_object_file_set(obj, edj, "ui/box_class_clear"));
+
+ evas_object_resize(obj, VG_RENDER_W, VG_RENDER_H);
+ evas_object_move(obj, 0, 0);
+ evas_object_show(obj);
+
+ edje_object_calc_force(obj);
+ ecore_evas_manual_render(ee);
+
+ /* --- Default state: stroke bound to vg_outline (30,30,30,255) --- */
+ vg_part = (Evas_Object *)edje_object_part_object_get(obj, "vg");
+ fail_if(!vg_part);
+
+ vg_root = efl_canvas_vg_object_root_node_get(vg_part);
+ fail_if(vg_root == NULL);
+ fail_if(!efl_isa(vg_root, EFL_CANVAS_VG_CONTAINER_CLASS));
+
+ body_node = efl_canvas_vg_container_child_get(vg_root, "body");
+ fail_if(body_node == NULL);
+ fail_if(!efl_isa(body_node, EFL_CANVAS_VG_SHAPE_CLASS));
+
+ /* Default: raw (255,255,255,255) * vg_outline (30,30,30,255) / 255 = (30,30,30,255) */
+ efl_gfx_shape_stroke_color_get(body_node, &r, &g, &b, &a);
+ ck_assert_msg(r == 30 && g == 30 && b == 30 && a == 255,
+ "Default state stroke (%d,%d,%d,%d) != expected (30,30,30,255)",
+ r, g, b, a);
+
+ /* --- Switch to "raw" state via signal --- */
+ edje_object_signal_emit(obj, "test,raw", "test");
+ edje_object_message_signal_process(obj);
+ edje_object_calc_force(obj);
+ ecore_evas_manual_render(ee);
+
+ /* After state switch the vg hierarchy is rematerialised; re-fetch nodes. */
+ vg_root = efl_canvas_vg_object_root_node_get(vg_part);
+ fail_if(vg_root == NULL);
+ fail_if(!efl_isa(vg_root, EFL_CANVAS_VG_CONTAINER_CLASS));
+
+ body_node = efl_canvas_vg_container_child_get(vg_root, "body");
+ fail_if(body_node == NULL);
+ fail_if(!efl_isa(body_node, EFL_CANVAS_VG_SHAPE_CLASS));
+
+ /* "raw" state: class cleared ("") — _resolve_binding short-circuits,
+ * raw RGBA (100,200,50,255) is used directly without class multiplication. */
+ efl_gfx_shape_stroke_color_get(body_node, &r, &g, &b, &a);
+ ck_assert_msg(r == 100 && g == 200 && b == 50 && a == 255,
+ "Raw state stroke (%d,%d,%d,%d) != expected (100,200,50,255) — "
+ "class clear did not short-circuit resolve",
+ r, g, b, a);
+
+ /* --- Cleanup --- */
+ evas_object_del(obj);
+ ecore_evas_free(ee);
+}
+EFL_END_TEST
+
void
edje_test_vector_states(TCase *tc)
{
@@ -1704,4 +1801,6 @@ edje_test_vector_states(TCase *tc)
tcase_add_test(tc, edje_vg_class_member_registered);
/* Phase 6.2 runtime color-class resolution */
tcase_add_test(tc, edje_vg_runtime_class_retint);
+ /* Phase 6.3 override-side empty-string class clear */
+ tcase_add_test(tc, edje_vg_override_class_clear);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.