Check if we still need details.css

Created on 11 March 2025, 2 months ago

Problem/Motivation

Split from πŸ“Œ Move details.css to the collapse library Active .

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

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

CSS

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @catch
  • πŸ‡ΊπŸ‡ΈUnited States jacine New York
  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡©πŸ‡ͺGermany Feuerwagen Bonn πŸ‡©πŸ‡ͺπŸ‡ͺπŸ‡Ί

    I 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.

  • πŸ‡¬πŸ‡§United Kingdom catch

    So 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:

    --- a/core/modules/system/system.base.css
    +++ b/core/modules/system/system.base.css
    @@ -38,25 +38,13 @@
     }
     
     /**
    - * Collapsible fieldsets.
    + * Collapsible details.
      *
      * @see collapse.js
      */
    -.js fieldset.collapsed {
    -  border-bottom-width: 0;
    -  border-left-width: 0;
    -  border-right-width: 0;
    -  height: 1em;
    -}
    -.js fieldset.collapsed .fieldset-wrapper {
    +.js details:not([open]) .details-wrapper {
       display: none;
     }
    

    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.

  • Merge request !11449Remove details.module.css β†’ (Closed) created by catch
  • πŸ‡¬πŸ‡§United Kingdom catch

    Postponed πŸ“Œ Move details.css to the collapse library Active 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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Seemed to cause a number of test failures.

  • Pipeline finished with Canceled
    2 months ago
    Total: 530130s
    #446532
  • πŸ‡¬πŸ‡§United Kingdom catch

    Could only see one known random failure, but did a rebase anyway.

  • Pipeline finished with Success
    2 months ago
    Total: 5163s
    #451306
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Yea not sure what was happening when I looked but all seems good now.

    • nod_ β†’ committed 365250d1 on 11.x
      Issue #3512284 by catch, jacine, feuerwagen: Remove details.css since it...
  • πŸ‡«πŸ‡·France nod_ Lille

    Committed 365250d and pushed to 11.x. Thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024