Problem/Motivation
Split from #3512262: Move details.module.css to the collapse library.
This has only one line of CSS, which hasn't been updated since at least 2015.
I couldn't see any difference with or with out it. Asked in slack and got this detailed reply from @jacine.
I think this is related to a Safari bug (which may be fixed by now dunno)? IIRC the problem is accessibility related, and the contents of closed details elements were fully accessible via keyboard, which should not be the case. To test you would need:
A page that renders a closed details element with a focusable element inside the content, like a link (or form element).
In Safari (I think), navigate the page using keyboard only.
Expected result is that the link in the closed details element is not focused (you can't see it anyway, so you'd be tabbing to what visually seems like nowhere).
Actual result (what that CSS fixes) is the link is focusable
We should check if safari still has the bug, and if not, I think we could remove the file.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3512284
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:
- 3512284-remove-details-css
changes, plain diff MR !11449
Comments
Comment #3
catchComment #4
feuerwagenI can not reproduce this issue:
- Using Safari 18.3 on mac OS 15.3.1, full keyboard access active (otherwise Safari won't tab focus links at all)
- Codepen with three details elements, each with a paragraph of text and one with an additional link inside
- all collapsed: tab just highlights the three summaries, no additional invisible focus in between
- with the details with the link expanded: tab highlights the three summaries and also the link in between
Not sure when it got fixed though.
Comment #5
catchSo the CSS was preserved in 2013 when details support was added. There is no reference to why it was preserved, but not all browsers supported details at that point so we didn't even use the proper html5 element for it yet, was a JavaScript quasi-polyfill instead with a @todo to add a real html5 polyfill later.
This is the diff that preserved it:
That issue doesn't mention any safari accessibility bugs, and I just noticed now that the css uses the .js class which means it was specifically for the js implementation of details (not the browser-native one that came later).
Given all that and the testing from @feuerwagen I think it's safe to drop.
Comment #7
catchPostponed #3512262: Move details.module.css to the collapse library on this issue and put up an MR.
While this is a tiny amount of CSS, we duplicate individual CSS files quite a lot in aggregates still even after recent improvements, so files in the system/base library can end up getting downloaded multiple times by the same visitor from different pages. Also in situations like the installer where there's no aggregation, it's one less http request.
Comment #8
smustgrave commentedSeemed to cause a number of test failures.
Comment #9
catchCould only see one known random failure, but did a rebase anyway.
Comment #10
smustgrave commentedYea not sure what was happening when I looked but all seems good now.
Comment #13
nod_Committed 365250d and pushed to 11.x. Thanks!