diff options
| author | gdh1995 | 2016-12-22 22:28:24 +0800 | 
|---|---|---|
| committer | gdh1995 | 2017-01-03 16:44:41 +0800 | 
| commit | a6ee639ecaf758fbe4652b5d70beaa607821ca04 (patch) | |
| tree | fe7d060b0adbfea79f3e6ab01ec16d66316811d9 /lib | |
| parent | c288100d9ea5c09efa14b0d4d32ee87b077b8588 (diff) | |
| download | vimium-a6ee639ecaf758fbe4652b5d70beaa607821ca04.tar.bz2 | |
take documentElement's border into consideration
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dom_utils.coffee | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index 7232bb45..e6616f51 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -289,13 +289,14 @@ DomUtils =      setTimeout((-> DomUtils.removeElement flashEl), 400)    getViewportTopLeft: -> -    style = getComputedStyle document.documentElement +    box = document.documentElement +    style = getComputedStyle box      if style.position == "static" and not /content|paint|strict/.test(style.contain or "")        zoom = +style.zoom || 1        top: Math.ceil(window.scrollY / zoom), left: Math.ceil(window.scrollX / zoom)      else -      rect = document.documentElement.getBoundingClientRect() -      top: -rect.top, left: -rect.left +      rect = box.getBoundingClientRect() +      top: -rect.top - box.clientTop, left: -rect.left - box.clientLeft    suppressPropagation: (event) ->      event.stopImmediatePropagation() | 
