misc cleanups, mostly whitespace

This commit is contained in:
Kovid Goyal 2020-08-13 19:58:26 +05:30
parent 6141113d5b
commit 2076c92ab5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 8 deletions

View File

@ -250,10 +250,7 @@ def layout(is_single_page):
# scroll viewport needs to know if we're in vertical mode,
# since that will cause scrolling to happen left and right
scroll_viewport.initialize_on_layout(body_style)
document.documentElement.style.overflow = 'hidden'
if scroll_viewport.vertical_writing_mode:
document.documentElement.style.overflow = 'visible'
document.documentElement.style.overflow = 'visible' if scroll_viewport.vertical_writing_mode else 'hidden'
def auto_scroll_resume():
scroll_animator.wait = False
@ -578,7 +575,7 @@ anchor_funcs = {
# as the value that the scroll viewport returns is negated
if scroll_viewport.vertical_writing_mode and scroll_viewport.rtl:
pos = -pos
if pos < scroll_viewport.block_pos():
return -1
if pos <= scroll_viewport.block_pos() + scroll_viewport.block_size():

View File

@ -72,7 +72,7 @@ class ScrollViewport:
else:
window.scrollTo(x, y)
def scroll_to_in_inline_direction(self, pos):
def scroll_to_in_inline_direction(self, pos):
# Lines flow vertically, so inline is vertical.
if self.vertical_writing_mode:
self.scroll_to(0, pos)
@ -214,7 +214,7 @@ class ScrollViewport:
if self.horizontal_writing_mode:
return rect.width
return rect.height
def rect_block_size(self, rect):
# The block is vertical in horizontal writing, so use height
if self.horizontal_writing_mode:
@ -241,7 +241,7 @@ class ScrollViewport:
if self.horizontal_writing_mode:
return self.viewport_to_document(inline, block)
return self.viewport_to_document(block, inline)
def element_from_point(self, doc, x, y):
if self.rtl:
return doc.elementFromPoint(-x, y)