aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorgdh19952016-12-22 22:24:28 +0800
committergdh19952017-01-03 16:44:41 +0800
commitc288100d9ea5c09efa14b0d4d32ee87b077b8588 (patch)
tree6289e7846dd6317a1549865889a1920fb31adcff /lib
parent0338c08ed7a15e11363b6218da8cb495b769ecfa (diff)
downloadvimium-c288100d9ea5c09efa14b0d4d32ee87b077b8588.tar.bz2
getViewportTopLeft: consider the new style "contain"
If an element's `contain` is/contains `paint`, then it will be forced showing just as its `position` is `relative`.
Diffstat (limited to 'lib')
-rw-r--r--lib/dom_utils.coffee2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index d39ce1de..7232bb45 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -290,7 +290,7 @@ DomUtils =
getViewportTopLeft: ->
style = getComputedStyle document.documentElement
- if style.position == "static"
+ 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