diff --git a/src/render/stacking-context.ts b/src/render/stacking-context.ts index 7136709..32497e3 100644 --- a/src/render/stacking-context.ts +++ b/src/render/stacking-context.ts @@ -104,8 +104,11 @@ const parseStackTree = ( parentStack.negativeZIndex.some((current, i) => { if (order > current.element.container.styles.zIndex.order) { index = i; + return false; + } else if (index > 0) { return true; } + return false; }); parentStack.negativeZIndex.splice(index, 0, stack); @@ -114,6 +117,8 @@ const parseStackTree = ( parentStack.positiveZIndex.some((current, i) => { if (order > current.element.container.styles.zIndex.order) { index = i + 1; + return false; + } else if (index > 0) { return true; } diff --git a/tests/reftests/zindex/z-index19.html b/tests/reftests/zindex/z-index19.html new file mode 100644 index 0000000..0db6949 --- /dev/null +++ b/tests/reftests/zindex/z-index19.html @@ -0,0 +1,71 @@ + + + + + z-index19 + + + + +
+
+
+
+
+
+
+
+ +