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

Refactor the toolbar html & css to improve its overall accessibility (bug 1171799, bug 1855695) #18385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

calixteman
Copy link
Contributor

The first goal of this patch was to remove the tabindex because it helps to improve overall a11y. That led to move some html elements associated with the buttons which helped to position these elements relatively to their buttons.
Consequently it was easy to change the toolbar height (configurable in Firefox with the pref browser.uidensity): it's the second goal of this patch. For a11y reasons we want to be able to change the height of the toolbar to make the buttons larger.

@calixteman calixteman requested review from Snuffleupagus and timvandermeij and removed request for Snuffleupagus July 4, 2024 16:47
web/viewer.css Outdated Show resolved Hide resolved
web/viewer.css Outdated Show resolved Hide resolved
web/viewer.css Outdated Show resolved Hide resolved
web/toolbar.js Outdated Show resolved Hide resolved
web/ui_utils.js Outdated Show resolved Hide resolved
calixteman added a commit to calixteman/pdf.js that referenced this pull request Jul 5, 2024
…sity in Firefox (bug 1171799)

It's a first step to just dispatch the pref change to the toolbar.
The second one, to effectively use it, will come after PR mozilla#18385 is merged.
calixteman added a commit to calixteman/pdf.js that referenced this pull request Jul 5, 2024
…sity in Firefox (bug 1171799)

It's a first step to just dispatch the pref change to the toolbar.
The second one, to effectively use it, will come after PR mozilla#18385 is merged.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/5f907b0b00fc09a/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/5f907b0b00fc09a/output.txt

Total script time: 1.03 mins

Published

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Jul 8, 2024

A couple of quick observations, with master on the left and this patch on the right, see also the markings in the image attached below:

  • The sidebar buttons are now (a lot) larger than the other buttons.
  • The toolbar bottom border is too dark when the sidebar is open.
  • The toolbar bottom border is no longer visible where it "meets" the pages of the document.

1

Other observations, with master on the left and this patch on the right, see also the markings in the image attached below:

  • There's less horizontal space around the toolbar separators, is this intentional?
  • The secondaryToolbar, also applies to the findbar and the editorToolbars, no longer have an outlined "arrow" which means that it blends in with the document.

2

calixteman added a commit to calixteman/pdf.js that referenced this pull request Sep 17, 2024
which can then be used for their future parent container.
This patch aims to simplify a bit the patch in mozilla#18385.
calixteman added a commit to calixteman/pdf.js that referenced this pull request Sep 17, 2024
which can then be used for their future parent container.
This patch aims to simplify a bit the patch in mozilla#18385.
…(bug 1171799, bug 1855695)

The first goal of this patch was to remove the tabindex because it helps
to improve overall a11y. That led to move some html elements associated
with the buttons which helped to position these elements relatively to their
buttons.
Consequently it was easy to change the toolbar height (configurable in Firefox
with the pref browser.uidensity): it's the second goal of this patch.
For a11y reasons we want to be able to change the height of the toolbar to make
the buttons larger.
@calixteman
Copy link
Contributor Author

@Snuffleupagus I addressed the issues you found and shew on the screenshots.

Of course, I'll address any obvious issues before merging that stuff and then we'd like to land it asap, to ask to QA to verify that there are no regressions.

@calixteman
Copy link
Contributor Author

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/ad665e7896265e5/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/ad665e7896265e5/output.txt

Total script time: 1.02 mins

Published

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately there's still a number of (easily) spotted issues here:

  • The findbar resizing looks really bad with a lot of wasted space, please revert those changes!
    Quite frankly this doesn't belong in this PR, and generally speaking if a CSS-only solution cannot be made to work/look as good as the current solution then we need to keep the JS-code.
  • All dropdown menus seem to be slightly off horizontally. The screen-shot shows the findbar, but the secondaryToolbar and the editing-toolbars are similarly affected.

findbar


  • The dropdown-arrows still don't have an outline all around; note the right-hand side in the (zoomed in) screen-shot below.

dropdown


  • There's no longer any visible separators in the secondaryToolbar.

separators

@calixteman
Copy link
Contributor Author

calixteman commented Sep 19, 2024

About the separators on the secondary toolbar, it's a pre-existing bug.
The color of the separator depends on its position, a way to see it (at least for me), is to add position: relative; top: 1px and increase the top in devtools: I can see the color of the separators changing. It's probably why I can see it but you can't.
I'll fix it (I think I've a fix).

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.

4 participants