Skip to content

Commit

Permalink
Merge pull request #846 from replayio/kannan/use-stacking-context-for…
Browse files Browse the repository at this point in the history
…-opacity-lt0

Elements with opacity<1 get own stacking context.
  • Loading branch information
kannanvijayan committed Jul 31, 2023
2 parents 0b0d38f + 44edf0b commit 8df6206
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2530,6 +2530,15 @@ StackingContext.prototype = {
return;
}
// Elements with `opacity < 0` get their own stacking context.
const opacity = elem.style.getPropertyValue("opacity");
if (opacity) {
const opacityVal = +opacity | 0;
if (opacityVal < 1) {
this.addContext(elem);
}
}
const parentDisplay = elem.parent?.style?.getPropertyValue("display");
if (
position != "static" ||
Expand Down

0 comments on commit 8df6206

Please sign in to comment.