From 834b3217f4fffc4c335775d17d76fdca6bf35512 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 10 Nov 2015 23:07:28 +0530 Subject: [PATCH] Workaround for WebKit bug in layout of transformed images on window resize --- src/pyj/book_list/views.pyj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/views.pyj b/src/pyj/book_list/views.pyj index 8d72c07d79..2127269db8 100644 --- a/src/pyj/book_list/views.pyj +++ b/src/pyj/book_list/views.pyj @@ -22,8 +22,11 @@ class BooksView: self.is_fetching = False self.shown_book_ids = {} self.container_id = 'books-view-' + bv_counter - style = build_rule('#' + self.container_id + ' .cover_grid img:hover', transform='scale(1.2)') - style += build_rule('#' + self.container_id + ' .cover_grid img:active', transform='scale(2.0)') + # We have to apply the transform ont he containing div not the img because of a bug in WebKit + # that causes img aspect ratios to be messed up on window resize if the transform is specified + # on the img itself + style = build_rule('#' + self.container_id + ' .cover_grid > div:hover', transform='scale(1.2)') + style += build_rule('#' + self.container_id + ' .cover_grid > div:active', transform='scale(2.0)') div = E.div( id=self.container_id, style='display:block', E.style(style),