1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| // 要素のスタッキングコンテキストを確認
function getStackingContext(element) {
const style = getComputedStyle(element);
const creates = [
style.position !== 'static' && style.zIndex !== 'auto',
style.opacity !== '1',
style.transform !== 'none',
style.filter !== 'none',
style.isolation === 'isolate',
style.willChange === 'transform' || style.willChange === 'opacity'
];
return {
element: element.tagName,
className: element.className,
createsContext: creates.some(Boolean),
zIndex: style.zIndex
};
}
|