Only use workaround if boundingrect is actuall negative topped

This commit is contained in:
Kovid Goyal 2021-03-11 08:15:58 +05:30
parent 2ad7fdc33f
commit 611613681f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -515,7 +515,7 @@ def scrollable_element(elem):
# for a test case. # for a test case.
if not in_paged_mode() or window.getComputedStyle(elem).display.indexOf('inline') < 0 or not elem.firstElementChild: if not in_paged_mode() or window.getComputedStyle(elem).display.indexOf('inline') < 0 or not elem.firstElementChild:
return elem return elem
if window.getComputedStyle(elem.firstElementChild).display.indexOf('block') > -1: if window.getComputedStyle(elem.firstElementChild).display.indexOf('block') > -1 and elem.getBoundingClientRect().top < -100:
return elem.firstElementChild return elem.firstElementChild
return elem return elem