From c288100d9ea5c09efa14b0d4d32ee87b077b8588 Mon Sep 17 00:00:00 2001 From: gdh1995 Date: Thu, 22 Dec 2016 22:24:28 +0800 Subject: 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`. --- lib/dom_utils.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3