Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(loading): Fix presentation performance issues in Big Sur Safari #1382

Merged
merged 2 commits into from
May 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/lib/viewers/doc/_docBase.scss
Original file line number Diff line number Diff line change
Expand Up @@ -256,29 +256,32 @@ $thumbnail-sidebar-width: 191px; // Extra pixel to account for sidebar border
border: 0;
border-image: none;

// Add shadow to an underlying element to avoid overlapping shadows on canvasWrapper and loadingIcon
&::before {
@include bp-DocShadow;
// Avoid showing loading states on invisible pages due to performance issues in Safari
&:not(.bp-is-invisible) {
// Add shadow to an underlying element to avoid overlapping shadows on canvasWrapper and loadingIcon
&::before {
@include bp-DocShadow;

position: absolute;
top: $pdfjs-page-padding;
right: 0;
bottom: $pdfjs-page-padding;
left: 0;
display: block;
content: '';
}

position: absolute;
top: $pdfjs-page-padding;
right: 0;
bottom: $pdfjs-page-padding;
left: 0;
display: block;
content: '';
// Display the ghost state only if the page does not already have rendered content (e.g. during a resize)
.loadingIcon:first-child {
@include bp-DocGhost;
}
}

// Override loading icon styles from pdf.js
.loadingIcon {
top: $pdfjs-page-padding;
bottom: $pdfjs-page-padding;
background: none;

// Display the ghost state only if the page does not already have rendered content (e.g. during a resize)
&:first-child {
@include bp-DocGhost;
}
}

// Fixes annotation icon broken src
Expand Down