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

Remove redundant class names from the button DOM-elements #14854

Merged
merged 2 commits into from
Apr 30, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

No description provided.

@mozilla mozilla deleted a comment from pdfjsbot Apr 29, 2022
@mozilla mozilla deleted a comment from pdfjsbot Apr 29, 2022
Note how in the `viewer.html` file we're specifying class names for most buttons, despite that not really being necessary. First of all, in many cases those class names are *identical* to the element-ids. Secondly, looking through the CSS rules they are only ever used when specifying button icons.
All-in-all, we should be able to simplify the HTML-code and use the element-ids in the CSS rules instead. Obviously ids have a higher CSS specificity than classes, but given how the old classes were being used that shouldn't be a problem here.

Also, the patch generalizes the styling for buttons (e.g. `viewBookmark`) that are *actually* link-elements.

Finally, while slightly unrelated, this patch also removes a little bit of duplication when specifying the border for `toolbarField`s.
@Snuffleupagus Snuffleupagus force-pushed the viewer-rm-button-classes branch from 96366e1 to 776fd3a Compare April 29, 2022 07:36
@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/73cec2112460dd9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/73cec2112460dd9/output.txt

Total script time: 2.53 mins

Published

Currently we're using *both* ids and classes when specifying the button icons, which seems completely unnecessary and only serves to bloat the CSS code.
In general you always need to be careful about CSS specificity, but in these cases that should not actually be a problem.

Also, while not a button, this patch makes a similar simplification for the `pageNumber`-input.
@Snuffleupagus Snuffleupagus force-pushed the viewer-rm-button-classes branch from 776fd3a to 1e24fe9 Compare April 29, 2022 07:40
@timvandermeij timvandermeij merged commit e5e2941 into mozilla:master Apr 30, 2022
@timvandermeij
Copy link
Contributor

Looks good to me!

@Snuffleupagus Snuffleupagus deleted the viewer-rm-button-classes branch April 30, 2022 11:56
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.

3 participants