@@ -45,6 +45,48 @@ TEST(YogaTest, absolute_node_cloned_with_static_parent) {
4545 YGNodeFreeRecursive (clonedRoot);
4646}
4747
48+ TEST (YogaTest, absolute_node_cloned_through_nested_display_contents) {
49+ YGNodeRef root = YGNodeNew ();
50+ YGNodeStyleSetWidth (root, 100 );
51+ YGNodeStyleSetHeight (root, 100 );
52+
53+ YGNodeRef wrapper = YGNodeNew ();
54+ YGNodeStyleSetPositionType (wrapper, YGPositionTypeStatic);
55+ YGNodeStyleSetWidth (wrapper, 50 );
56+ YGNodeStyleSetHeight (wrapper, 50 );
57+ YGNodeInsertChild (root, wrapper, 0 );
58+
59+ YGNodeRef static1 = YGNodeNew ();
60+ YGNodeStyleSetPositionType (static1, YGPositionTypeStatic);
61+ YGNodeStyleSetFlexGrow (static1, 1 );
62+ YGNodeInsertChild (wrapper, static1, 0 );
63+
64+ YGNodeRef contents1 = YGNodeNew ();
65+ YGNodeStyleSetDisplay (contents1, YGDisplayContents);
66+ YGNodeInsertChild (static1, contents1, 0 );
67+
68+ YGNodeRef contents2 = YGNodeNew ();
69+ YGNodeStyleSetDisplay (contents2, YGDisplayContents);
70+ YGNodeInsertChild (contents1, contents2, 0 );
71+
72+ YGNodeRef absolute = YGNodeNew ();
73+ YGNodeStyleSetPositionType (absolute, YGPositionTypeAbsolute);
74+ YGNodeStyleSetWidthPercent (absolute, 50 );
75+ YGNodeStyleSetHeight (absolute, 1 );
76+ YGNodeInsertChild (contents2, absolute, 0 );
77+
78+ YGNodeCalculateLayout (root, YGUndefined, YGUndefined, YGDirectionLTR);
79+
80+ YGNodeRef clonedRoot = YGNodeClone (root);
81+ YGNodeStyleSetWidth (clonedRoot, 200 );
82+ YGNodeCalculateLayout (clonedRoot, YGUndefined, YGUndefined, YGDirectionLTR);
83+
84+ recursivelyAssertProperNodeOwnership (clonedRoot);
85+
86+ YGNodeFreeRecursive (root);
87+ YGNodeFreeRecursive (clonedRoot);
88+ }
89+
4890TEST (YogaTest, absolute_node_cloned_with_static_ancestors) {
4991 YGNodeRef root = YGNodeNew ();
5092 YGNodeStyleSetWidth (root, 100 );
0 commit comments