mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
E-book viewer: Remove workaround for bug in old versions of WebKit that could cause incorrect rendering of chapter titles in some rare circumstances.
This commit is contained in:
parent
7d4676232b
commit
72a9cafdb5
Binary file not shown.
@ -179,13 +179,8 @@ class PagedDisplay
|
|||||||
# above the columns, which causes them to effectively be added to the
|
# above the columns, which causes them to effectively be added to the
|
||||||
# page margins (the margin collapse algorithm)
|
# page margins (the margin collapse algorithm)
|
||||||
bs.setProperty('-webkit-margin-collapse', 'separate')
|
bs.setProperty('-webkit-margin-collapse', 'separate')
|
||||||
# Remove any webkit specified default margin from the first child of body
|
|
||||||
# Otherwise, you could end up with an effective negative margin, I dont
|
|
||||||
# understand exactly why, but see:
|
|
||||||
# https://bugs.launchpad.net/calibre/+bug/1082640 for an example
|
|
||||||
c = first_child(document.body)
|
c = first_child(document.body)
|
||||||
if c != null
|
if c != null
|
||||||
c.style.setProperty('-webkit-margin-before', '0')
|
|
||||||
# Remove page breaks on the first few elements to prevent blank pages
|
# Remove page breaks on the first few elements to prevent blank pages
|
||||||
# at the start of a chapter
|
# at the start of a chapter
|
||||||
c.style.setProperty('-webkit-column-break-before', 'avoid')
|
c.style.setProperty('-webkit-column-break-before', 'avoid')
|
||||||
|
@ -142,13 +142,8 @@ def layout(is_single_page):
|
|||||||
# above the columns, which causes them to effectively be added to the
|
# above the columns, which causes them to effectively be added to the
|
||||||
# page margins (the margin collapse algorithm)
|
# page margins (the margin collapse algorithm)
|
||||||
document.body.style.setProperty('-webkit-margin-collapse', 'separate')
|
document.body.style.setProperty('-webkit-margin-collapse', 'separate')
|
||||||
# Remove any webkit specified default margin from the first child of body
|
|
||||||
# Otherwise, you could end up with an effective negative margin, I dont
|
|
||||||
# understand exactly why, but see:
|
|
||||||
# https://bugs.launchpad.net/calibre/+bug/1082640 for an example
|
|
||||||
c = first_child(document.body)
|
c = first_child(document.body)
|
||||||
if c:
|
if c:
|
||||||
c.style.setProperty('-webkit-margin-before', '0')
|
|
||||||
# Remove page breaks on the first few elements to prevent blank pages
|
# Remove page breaks on the first few elements to prevent blank pages
|
||||||
# at the start of a chapter
|
# at the start of a chapter
|
||||||
set_css(c, break_before='avoid')
|
set_css(c, break_before='avoid')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user