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 regression affecting the horizontal viewerContainer offset for small window widths (PR 9816 follow-up) #9819

Conversation

Snuffleupagus
Copy link
Collaborator

The danger of fixing one bug is that it can, sometimes too easily, cause another one in the process; sorry for not catching this when testing PR #9816 locally.

When the entire viewer becomes narrow enough, as controlled by the @media all and (max-width: 840px) media query, the sidebar should (semi-transparently) overlay the viewerContainer instead of moving it horizontally. Unfortunately the changes made in PR #9816 caused the relevant CSS rules to be skipped, because of how the inheritance model works in CSS.

I'm well aware that !important is usually advised against, since it "breaks" the CSS inheritance model. However in this case it seemed reasonable to use it, to not only fix the bug at hand but to also prevent similar bugs from occurring in the future.

…small window widths (PR 9816 follow-up)

*The danger of fixing one bug is that it can, sometimes too easily, cause another one in the process; sorry for not catching this when testing PR 9816 locally.*

When the *entire* viewer becomes narrow enough, as controlled by the `@media all and (max-width: 840px)` media query, the sidebar should (semi-transparently) overlay the `viewerContainer` instead of moving it horizontally. Unfortunately the changes made in PR 9816 caused the relevant CSS rules to be skipped, because of how the inheritance model works in CSS.

I'm well aware that `!important` is usually advised against, since it "breaks" the CSS inheritance model. However in this case it seemed reasonable to use it, to not only fix the bug at hand but to also prevent similar bugs from occurring in the future.
@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.67.70.0:8877/0c22431a91b20a7/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/0c22431a91b20a7/output.txt

Total script time: 8.74 mins

Published

@timvandermeij timvandermeij merged commit 5dacc81 into mozilla:master Jun 15, 2018
@timvandermeij
Copy link
Contributor

Good catch, thanks!

@Snuffleupagus Snuffleupagus deleted the viewerContainer-offset-small-window branch June 15, 2018 22:22
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
…fset-small-window

Fix regression affecting the horizontal `viewerContainer` offset for small window widths (PR 9816 follow-up)
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