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:
Kovid Goyal 2016-06-11 09:59:48 +05:30
parent 7d4676232b
commit 72a9cafdb5
3 changed files with 0 additions and 10 deletions

Binary file not shown.

View File

@ -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')

View File

@ -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')