Problem/Motivation
We have a workaround for the details focus effect to make it more consistent with Chrome. However, this makes the details element focus inconsistent with some other elements on the same browser. Since this is presumably expected behavior in Firefox (on OS X) and not a bug, we should consider whether we want to have this workaround or not.
The motivation is to make the focus effect behavior consistent across websites visited with the same browsers .
There aren't any macOS system settings that make a difference.
Steps to reproduce
- Install Drupal, log in with an admin user and visit
/admin/config/system/site-information'. - Click on the Site details summary, collapse and expand it. Using 'Stable' or 'Stark' themes, you will see the (browser-default) focus effect of the
<summary>element in browsers, but not in Firefox on OS X operating system. With Claro theme, you will see the focus effect. - Now focus the Site details summary with keyboard. You will see the focus effect of the
<summary>element with every browser.
Proposed resolution
Remove Claro's details summary workaround and rely on Firefox's default behavior when it comes to details focus effects.
Remaining tasks
patch- review
- commit
User interface changes
Users using Firefox on OS X operating system won't see the focus effect of details summary if they are using their pointer device for collapsing or expanding the <details> element.
API changes
Nothing.
Data model changes
Nothing.
| Comment | File | Size | Author |
|---|---|---|---|
| #58 | 3085794-nr-bot.txt | 144 bytes | needs-review-queue-bot |
| #54 | After Patch 3085794.mp4 | 1.38 MB | chetanbharambe |
| #54 | Before Pathc 3085794.mp4 | 1.83 MB | chetanbharambe |
| #53 | Screen Recording 2021-06-01 at 20.10.01.mov | 1.64 MB | gauravvvv |
| #53 | with-workaround.mov | 1.12 MB | gauravvvv |
Issue fork drupal-3085794
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
wim leers?
Comment #3
lauriiiWe could benefit from an accessibility review for sure.
Comment #4
huzookaThe workaround I wrote is only needed for iOS.
And the case I was working around there is not a Firefox error or bug. It is a feature!
Firefox simply follows the operating system settings (that are ignored by Google Chrome for example).
https://bugzilla.mozilla.org/show_bug.cgi?id=756028#c1
I think we can remove it without worries.
Comment #5
wim leersWow, so a "Firefox on iOS"-only work-around?!
🥳
Comment #6
huzookaSorry, I was wrong. Not iOS. OS X. (The desktop.)
Comment #7
fhaeberleComment #8
huzookaComment #9
chrisdarke commentedUpdating tags to change the DrupalCon Amsterdam 2019 to 'Amsterdam2019' and temporarily removing 'novice' tag to reserve this for Contribution Day
Comment #10
chrisdarke commentedAdded the 'needs issue summary update' tag because there is little information about what the changes should be, missing information from the standard issue summary template.
Comment #11
jepster_In the attached patch the firefox workaround is being removed. The different behavior cannot be reproduced anymore via a comparison of latest Chrome (77.0.3865.120) to Firefox (70.0).
Comment #12
huzookaRe #11:
As I see, the patch removes all the focus styles.
We only want to remove the Firefox (and Safari) workaround which is here.
Comment #13
jepster_Removed the mentioned code in #12.
Comment #14
huzookaRe #13:
@Peter Majmesku, you missed compiling the es6. See https://www.drupal.org/node/2815083
Comment #15
fcobbaert commentedI have built the js and can confirm there is now a small difference between Firefox on OSX and other browsers. It seems the focus effect is now applied for a short moment when the summary is clicked and then the outline disappears again.
Comment #16
fcobbaert commentedComment #17
jepster_@fcobbaert: Yep, the display in Firefox is different now. The outline disappears quickly on Firefox. In Chrome it does not. See Gif below (Chrome on the left, Firefox on the right).
It looks like the Firefox workaround is not really a workaround and should be kept. Shall we better close this issue?
Comment #18
huzookaIt IS a workaround, but only for Firefox on OS X :)
(If you reach the focusable summary with keyboard, it works the way you expect it to.)
Comment #19
john cook commentedI've had a look at the patch from comment #15. Only the workaround has been removed.
When manually testing on Firefox (Mac OS) the focus is removed when the summary elements are clicked.
I've uploaded a video of a Chrome and Firefox comparison.
Changing to RTBC.
Comment #20
lauriiiIt seems like the focus ring is visible still on active state. It seems redundant to me but it would be nice to hear from designers and accessibility folks whether we should remove that.
Comment #21
huzookaRe #20:
If you thoroughly check the desings you will notice that the focus ring belongs to the focus state, regardless of other states are present or not.
May proposal: if this is the only issue you noticed, lets open a separate issue for it and discuss it there.
This task is about the OS X Firefox workaround removal 🙂.
Comment #22
huzookaAs discussed with @lauriii:
We also have to remove the flickering green focus of Firefox on OSX that can be seen in #17.
But only for Firefox, and only on OSX.
The behavior of other browsers and even Firefox on other operating systems must not change.
Comment #23
huzookaComment #24
huzookaComment #25
huzookaTested with Firefox, Chrome and Safari, but only with OS X host, so further testing needed.
Comment #26
huzookaComment #27
lauriiiThank you! Moving to needs review and tagging with needs manual testing.
Comment #28
huzookaI tested #25 also with:
Windows 10:
Windows 8.1:
Ubuntu 18.04:
It works as expected :) Could also anyone else confirm this?
Comment #29
jepster_Tested successfully in firefox on macos. I could reach the focusable summary with the keyboard. Also I could reach all advanced widgets with the tabulator key and enter key. So it LGTM.
Comment #30
andrewmacpherson commented@lauriii just asked for an accessibility review on Slack. The issue summary is vague, and doesn't describe the behaviour you're concerned with. So I'll take some time to read all the comments.
Comment #31
lauriiiComment #32
andrewmacpherson commentedI chatted with @lauriii on Slack about this, but I'm still confused about exactly what the problem and resolution are.
This is tricky for me to review, because I don't have a working mac just now. (I normally do, but it stopped booting after the 10.15.1 upgrade.)
This issue needs more detail, please:
Comment #33
andrewmacpherson commentedAre any other elements affected? The bugzilla report linked in #4 mentions checkboxes and radios.
How does Safari behave? The issue summary talks about inconsistency between Firefox and Chrome.
What is actually proposed here? #28 says it works as expected, but I can't tell what behaviour you are looking for.
Comment #34
huzookaComment #35
huzookaRe-rolled #25.
Comment #36
huzookaUploading videos taken about W3Schools demo.
Pointer clicks are visible, every other actions are [tab/space/enter] key hits.
What you will notice:
Firefox on OS X shows summary's focus only if the summary was reached by keyboard navigation, and if it was expanded/collapsed by key events (hitting Space or Enter).
Even if the summary had the focus indication before, if the user clicks on it, the focus indication will be removed.
Every other browser, and even Firefox on other platforms (Windows, Ubuntu), this focus indication is visible for pointer events as well.
Comment #37
huzookaComment #38
huzookaAttached two more videos.
Other browsers and Firefox on other operating systems will keep having the same behavior that is illustrated by the previous point.
Comment #39
huzookaRe-rolled #35 and updated IS (#32).
Re #32:
I added some videos in #36 and in #38 that should clarify what this issue is about.
Re #33:
Comment #40
huzookaThis is a lie.
Comment #41
huzookaComment #42
lauriiiI walked through this with @andrewmacpherson earlier today. One of the concerns on this change was that whether the summary would be still focused after removing this code. We confirmed that the element is focused by moving focus elsewhere, opening a details element by clicking the summary, and continuing navigation by tabbing. The result was that I was able to continue tabbing inside the details element as expected even though the focus event didn't trigger. Therefore the normalization code isn't critical because the functionality works as expected. However, @andrewmacpherson thinks that having this normalization in place might be still desirable.
We agreed to open issue in the Firefox issue queue to try to see if there's a reason behind this inconsistency in Firefox. Based on that we could decide whether we wanted to keep this normalization in place or not. If we wanted to keep this, it should be moved from Claro to core so that all themes could benefit from it. From @andrewmacpherson / accessibility point of view, this doesn't have to be a stable blocker but instead, a should have.
Link to the Firefox issue I opened: https://bugzilla.mozilla.org/show_bug.cgi?id=1599415
Comment #43
kostyashupenkoComment #44
andrewmacpherson commented#42 Thanks for the summary of our test session @lauriii, both here and the new upstream Mozilla issue.
Comment #4 (and the Mozilla issue li) suggests that it's following an established macOS behaviour (and/or a setting), but I've not been able to verify what policy it's following (or which setting). The new issue you filed includes the important observation that Firefox is behaving differently to Safari, which casts doubt on the "following mac convention" claim.
Supporting user-agent and/or OS behaviours is generally a good idea, but in this case I think it's a poor experience for people who make mixed use of keyboard and mouse. So I think we should continue to normalize this across browsers. If we find a clearer explanation (or the name of a user setting) for Firefox's behaviour, that would be a different matter.
I suggest we keep the Claro workaround for now, and look at the best way to make it generic and robust.
I'm a little concerned that the current code might lead to focus events being fired twice in some cases. Focus usually comes after mousedown, but before click, so we could put in a check for the activeElement to avoid firing focus twice?
Comment #46
lauriiiIt seems like the upstream bug has been addressed: https://bugzilla.mozilla.org/show_bug.cgi?id=1599415. We can probably get rid of the workaround once there is a Firefox ESR release that ships with the bug fix.
Comment #47
lauriiiIt seems like FF 78 is an ESR so we could remove the workaround now.
Comment #48
bnjmnmThis is a reroll of #41, which I manually confirmed still works, and can be seen in the attached gif.
Comment #51
sakthivel m commented#48 Patch Failed
Comment #52
sakthivel m commented#52 Please review the patch
Comment #53
gauravvvv commentedI have added with a workaround and without workaround screen recording after patch #52.
I don't find any difference. Please let me know if I am doing something wrong.
Comment #54
chetanbharambe commentedI have tested this issue on Firefox.
The issue is not reproducible on the 9.3.x-dev version.
I have attached the video before and after applying the patch #52.
I don't find any difference. Please let me know if anything missed from my side.
Need +1 RTBC
Comment #58
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #61
tom kondaI created issue fork branch and rerolled patch #52.
Comment #63
tom kondaChange from patch #52:
I cannot reproduce comment #17 on 11.x branch and Firefox 146
Please review.
Comment #65
smustgrave commentedThis one needs a rebase and manual testing. May be a good contribution item for fldc26