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

Move the PDFBug-related CSS from viewer.css and into its own file #14788

Merged
merged 1 commit into from
Apr 19, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

Given that none of these CSS rules are used at all, unless debugging is enabled, it seems completely unnecessary to load them unconditionally for all users.[1]

Note that if both the textLayer and pdfBug debugging hash-parameters are specified simultaneously, we'll now load the PDFBug-file twice (since the code is simpler that way). However, given first of all that none of this is enabled by default and secondly that using those parameters together isn't helpful[2], potentially loading that file twice is hopefully not an issue.

For the gulp mozcentral target, the size of the built viewer.css file is reduced > 3% with this patch.


[1] For the Firefox built-in PDF Viewer, in order to even be able to access the PDFBug functionality, you need to first of all set pdfjs.pdfBugEnabled = true manually in about:config. Secondly, you then also need to append the pdfBug=... hash-parameter to the URL when initially loading the document.

[2] Note how the textLayer-settings are already, since essentially forever, overriding the highlighting-features of the "FontInspector"-tab.

Given that none of these CSS rules are used at all, unless debugging is enabled, it seems completely unnecessary to load them *unconditionally* for all users.[1]

Note that if *both* the `textLayer` and `pdfBug` debugging hash-parameters are specified simultaneously, we'll now load the `PDFBug`-file *twice* (since the code is simpler that way). However, given first of all that none of this is enabled by default and secondly that using those parameters together isn't helpful[2], potentially loading that file twice is hopefully not an issue.

For the `gulp mozcentral` target, the size of the *built* `viewer.css` file is reduced `> 3%` with this patch.

---
[1] For the Firefox built-in PDF Viewer, in order to even be able to access the `PDFBug` functionality, you need to first of all set `pdfjs.pdfBugEnabled = true` manually in `about:config`. Secondly, you then also need to append the `pdfBug=...` hash-parameter to the URL when *initially* loading the document.

[2] Note how the `textLayer`-settings are already, since essentially forever, overriding the highlighting-features of the "FontInspector"-tab.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/9615bb47ee2f605/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/9615bb47ee2f605/output.txt

Total script time: 2.76 mins

Published

@timvandermeij timvandermeij merged commit cf320f8 into mozilla:master Apr 19, 2022
@timvandermeij
Copy link
Contributor

Good idea to split this off; thanks!

@Snuffleupagus Snuffleupagus deleted the debugger-separate-css branch April 19, 2022 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants