(element, style)
| 894 | // WebKit returns document.body, while others return documentElement. |
| 895 | for (const scrollingElementProperty of ['body', 'documentElement']) { |
| 896 | function stubComputedStyleElementOnly(element, style) { |
| 897 | env.sandbox |
| 898 | .stub(env.win, 'getComputedStyle') |
| 899 | .callsFake((checkElement) => { |
| 900 | if (element === checkElement) { |
| 901 | return style; |
| 902 | } |
| 903 | return {}; |
| 904 | }); |
| 905 | } |
| 906 | |
| 907 | describe(`with scrollingElement = document.${scrollingElementProperty}`, () => { |
| 908 | let element; |