(el, prop)
| 6 | import { getParams } from './utils'; |
| 7 | |
| 8 | function computedStyle(el, prop) { |
| 9 | const getComputedStyle = window.getComputedStyle; |
| 10 | const style = |
| 11 | // If we have getComputedStyle |
| 12 | getComputedStyle ? |
| 13 | // Query it |
| 14 | // TODO: From CSS-Query notes, we might need (node, null) for FF |
| 15 | getComputedStyle(el) : |
| 16 | |
| 17 | // Otherwise, we are in IE and use currentStyle |
| 18 | el.currentStyle; |
| 19 | if (style) { |
| 20 | return style |
| 21 | [ |
| 22 | // Switch to camelCase for CSSOM |
| 23 | // DEV: Grabbed from jQuery |
| 24 | // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 |
| 25 | // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 |
| 26 | prop.replace(/-(\w)/gi, (word, letter) => { |
| 27 | return letter.toUpperCase(); |
| 28 | }) |
| 29 | ]; |
| 30 | } |
| 31 | return undefined; |
| 32 | } |
| 33 | |
| 34 | function getScrollableContainer(n) { |
| 35 | let node = n; |
no outgoing calls
no test coverage detected