Skip to content

Commit

Permalink
Use the same SVG images, in the default viewer, regardless of the CSS…
Browse files Browse the repository at this point in the history
… theme

As mentioned in https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support, PDF.js version `2.6.347` is the last release with IE 11/Edge support.
Hence we should now be able to reduce unnecessary duplication in the default viewer image resources, note the files in the `web/images/` folder with a `-dark` suffix, by using only *one* SVG-image for each icon and letting the `background-color` depend on the CSS theme instead.

For the `gulp mozcentral` build-target, the resulting `web/images/` folder is reduced from `43 997` to `28 566` bytes (~35 percent).

*Please note:* I don't really know if this implementation is necessarily the *best* solution, but it seems to work well enough in e.g. Firefox Nightly and Google Chrome Beta as far as my testing goes.
  • Loading branch information
Snuffleupagus committed Nov 29, 2020
1 parent e072f1d commit d5df6d1
Show file tree
Hide file tree
Showing 35 changed files with 79 additions and 208 deletions.
6 changes: 0 additions & 6 deletions web/images/findbarButton-next-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/findbarButton-previous-dark.svg

This file was deleted.

16 changes: 0 additions & 16 deletions web/images/secondaryToolbarButton-documentProperties-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-firstPage-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-handTool-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-lastPage-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-rotateCcw-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/secondaryToolbarButton-rotateCw-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-scrollHorizontal-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-scrollVertical-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-scrollWrapped-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/secondaryToolbarButton-selectTool-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-spreadEven-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-spreadNone-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/secondaryToolbarButton-spreadOdd-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/toolbarButton-bookmark-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/toolbarButton-download-dark.svg

This file was deleted.

1 change: 0 additions & 1 deletion web/images/toolbarButton-menuArrow-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/toolbarButton-openFile-dark.svg

This file was deleted.

8 changes: 0 additions & 8 deletions web/images/toolbarButton-pageDown-dark.svg

This file was deleted.

13 changes: 0 additions & 13 deletions web/images/toolbarButton-pageUp-dark.svg

This file was deleted.

2 changes: 0 additions & 2 deletions web/images/toolbarButton-presentationMode-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/toolbarButton-print-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/toolbarButton-search-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/toolbarButton-secondaryToolbarToggle-dark.svg

This file was deleted.

5 changes: 0 additions & 5 deletions web/images/toolbarButton-sidebarToggle-dark.svg
Diff not rendered.
2 changes: 0 additions & 2 deletions web/images/toolbarButton-viewAttachments-dark.svg
Diff not rendered.
1 change: 0 additions & 1 deletion web/images/toolbarButton-viewLayers-dark.svg
Diff not rendered.
2 changes: 0 additions & 2 deletions web/images/toolbarButton-viewOutline-dark.svg
Diff not rendered.
5 changes: 0 additions & 5 deletions web/images/toolbarButton-viewThumbnail-dark.svg
Diff not rendered.
5 changes: 0 additions & 5 deletions web/images/toolbarButton-zoomIn-dark.svg
Diff not rendered.
5 changes: 0 additions & 5 deletions web/images/toolbarButton-zoomOut-dark.svg
Diff not rendered.
2 changes: 0 additions & 2 deletions web/images/treeitem-collapsed-dark.svg
Diff not rendered.
2 changes: 0 additions & 2 deletions web/images/treeitem-expanded-dark.svg
Diff not rendered.
Loading

0 comments on commit d5df6d1

Please sign in to comment.