Skip to content

Commit

Permalink
EPUB: Fix invisible content in paginated mode in Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Oct 2, 2024
1 parent f9e37fd commit 3a80bb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dom/common/dom-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ abstract class DOMView<State extends DOMViewState, Data> {
style.innerHTML = injectCSS;
this._annotationShadowRoot.append(style);

this._iframeDocument.documentElement.classList.toggle('is-safari', isSafari);

// Pass options to setters that were delayed until iframe initialization
this.setAnnotations(this._options.annotations);
this.setTool(this._options.tool);
Expand Down
7 changes: 7 additions & 0 deletions src/dom/epub/stylesheets/layout/_paginated.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
&.hidden {
display: none;
}

:root.is-safari & {
// 'contain: paint' in a multi-column layout slows Safari to a crawl
// and causes content to disappear
contain: layout;
contain: layout style;
}
}
}

Expand Down

0 comments on commit 3a80bb3

Please sign in to comment.