mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix jump_to_cfi() on Safari
This commit is contained in:
parent
757c9a5c9e
commit
e8cb8d45fe
@ -449,6 +449,7 @@ def scroll_to(cfi, callback, doc): # {{{
|
|||||||
span.setAttribute('style', 'border-width: 0; padding: 0; margin: 0')
|
span.setAttribute('style', 'border-width: 0; padding: 0; margin: 0')
|
||||||
r.surroundContents(span)
|
r.surroundContents(span)
|
||||||
scroll_viewport.scroll_into_view(span)
|
scroll_viewport.scroll_into_view(span)
|
||||||
|
scroll_viewport.reset_transforms() # needed for viewport_to_document()
|
||||||
fn = def():
|
fn = def():
|
||||||
# Remove the span and get the new position now that scrolling
|
# Remove the span and get the new position now that scrolling
|
||||||
# has (hopefully) completed
|
# has (hopefully) completed
|
||||||
@ -483,6 +484,7 @@ def scroll_to(cfi, callback, doc): # {{{
|
|||||||
else:
|
else:
|
||||||
node = point_.node
|
node = point_.node
|
||||||
scroll_viewport.scroll_into_view(node)
|
scroll_viewport.scroll_into_view(node)
|
||||||
|
scroll_viewport.reset_transforms() # needed for viewport_to_document()
|
||||||
|
|
||||||
fn = def():
|
fn = def():
|
||||||
r = node.getBoundingClientRect()
|
r = node.getBoundingClientRect()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user