| 710 | |
| 711 | // Return the x and y overflow styles for the given element. |
| 712 | function getOverflowStyles(e) { |
| 713 | // When the <html> element has an overflow style of 'visible', it assumes |
| 714 | // the overflow style of the body, and the body is really overflow:visible. |
| 715 | var overflowElem = e; |
| 716 | if (htmlOverflowStyle == 'visible') { |
| 717 | // Note: bodyElem will be null/undefined in SVG documents. |
| 718 | if (e == htmlElem && bodyElem) { |
| 719 | overflowElem = bodyElem; |
| 720 | } else if (e == bodyElem) { |
| 721 | return { x: 'visible', y: 'visible' }; |
| 722 | } |
| 723 | } |
| 724 | var overflow = { |
| 725 | x: bot.dom.getEffectiveStyle(overflowElem, 'overflow-x'), |
| 726 | y: bot.dom.getEffectiveStyle(overflowElem, 'overflow-y') |
| 727 | }; |
| 728 | // The <html> element cannot have a genuine 'visible' overflow style, |
| 729 | // because the viewport can't expand; 'visible' is really 'auto'. |
| 730 | if (e == htmlElem) { |
| 731 | overflow.x = overflow.x == 'visible' ? 'auto' : overflow.x; |
| 732 | overflow.y = overflow.y == 'visible' ? 'auto' : overflow.y; |
| 733 | } |
| 734 | return overflow; |
| 735 | } |
| 736 | |
| 737 | // Returns the scroll offset of the given element. |
| 738 | function getScroll(e) { |