-
-
Notifications
You must be signed in to change notification settings - Fork 4
Rebuild widgets screen (and equivalent in Customizer) to use details and summary tags #240
Conversation
This significantly improves accessibility while also updating the admin to use HTML5 and less JavaScript.
Enables all the media widgets (image, audio, video, etc) to work with more semantic markup and the `details` and `summary` elements.
…ore semantic markup
… is removed after dragging to sidebar.
…et dragged over or off them.
@KTS915 - I've been looking into the test failures and trying to fix what I can. There are 2 failing PHPUnit tests, once is a simple fix, the other links to the change in The test now fails for 2 reasons, a regular expression is looking for an The current code changes the tag, and also the quote type from single to double quotes and it also adds the |
Thanks very much for doing all that, @mattyrob! I remember I added the class |
@KTS915 - could you just double check that the JavaScript coding standards changes haven't broken anything in usage and we can consider this for merge later this week. |
@mattyrob I've just pushed a commit to eradicate an error message in the console. Other than that, I can't see any problems with your fixes (and I doubt that one was caused by anything you did anyway). However, I also found that the PHP change to using But I've now found a better way of addressing that by checking for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just read an article by Scott O'Hara (https://www.scottohara.me/blog/2022/09/12/details-summary.html), where he says that removing the native marker for the disclosure widget can cause accessibility problems because some assistive technology looks to the marker instead of the status of the `open` attribute to know whether the widget is open or not! Yes, it's completely crazy! So this commit goes back to using the native marker but makes it bigger. Which, really, I suppose is what I should have done in the first place. I will submit a PR to make a similar change for the dashboard widgets, post metaboxes, and menu items that we've already included.
@xxsimoxx I haven't got a way yet of testing on Safari directly, but I have installed GNOME Web, which uses the same rendering engine (and uses the same markup for the disclosure widget marker). I found much the same as you initially but, when I did a hard refresh, it worked properly. If a hard refresh doesn't work for you, I'll set up a site outside my desktop and test with Safari online. |
@KTS915 a (command line) cache reset made the trick on safari. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good on Windows.
This PR follows those for the menu screen, dashboard widgets, and post/page metaboxes in replacing widgets on the admin widgets screen with HTML5 disclosure widgets, which utilize the
details
andsummary
tags.Motivation and context
Addresses Issue #224.
Improves accessibility and reduces the use of JavaScript.
How has this been tested?
On my localhost test site
Screenshots
After
Types of changes