-
Notifications
You must be signed in to change notification settings - Fork 765
Description
CSS Masking defines the (deprecated) clip property here: https://drafts.fxtf.org/css-masking/#clip-property
It notes that the property only applies to position:absolute elements (UAs also apply it to position:fixed so this could use clarification). However, the text does not say that clip only applies to containing-block descendants, nor does clip create a stacking context.
Given that, I'd expect in this example that the clip would NOT apply to the fixedpos child:
<style>
#absolute {
position: absolute;
background-color: chartreuse;
top: 100px;
left: 100px;
width: 200px;
height: 200px;
clip: rect(0, 200px, 20px, 0px);
}
#fixed {
position: fixed;
top: 50px;
left: 50px;
background-color: salmon;
width: 100px;
height: 100px;
}
</style>
<div id="absolute">
<div id="fixed"></div>
</div>
and yet all UAs agree that it does. This makes it different from the overflow property, which only clips containing-block descendants, and different from clip-path that triggers a stacking context. As an implementor, I'd prefer that clip isn't so special, but at least the spec should describe its implemented behavior.