Browser viewer: Restore the default font as sans-serif

But it can now be easily overriden by either user-stylesheet
or book style sheet
This commit is contained in:
Kovid Goyal 2017-11-04 05:11:49 +05:30
parent 8561f82898
commit d49fab5ace
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View File

@ -198,6 +198,7 @@ class PopupIframeBoss:
self.frag = data.frag
for name in self.blob_url_map:
window.URL.revokeObjectURL(self.blob_url_map[name])
document.body.style.removeProperty('font-family')
root_data, self.mathjax, self.blob_url_map = finalize_resources(self.book, data.name, data.resource_data)
self.resource_urls = unserialize_html(root_data, self.content_loaded, self.show_only_footnote)
update_settings(data.settings)

View File

@ -2,9 +2,11 @@
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import hash_literals
from dom import clear
from elementmaker import E
from encodings import base64decode, utf8_decode
from dom import clear
JSON_XHTML_MIMETYPE = 'application/calibre+xhtml+json'
def decode_component(x):
@ -228,6 +230,7 @@ def unserialize_html(serialized_data, proceed, postprocess_dom):
apply_attributes(html, document.documentElement, ns_map)
head, body = tree[1], tree[2] # noqa: unused-local
clear(document.head, document.body)
document.head.appendChild(E.style('html { font-family: sans-serif }'))
resource_urls = {}
load_required = set()
proceeded = False