Source Order Viewer is an experiment that displays the order of elements in the page source. The on-screen display order may differ from the order of the source, which confuses screen reader and keyboard users. Use the Source Order Viewer experiment to find the differences between on-screen display order and the order of the source.
After enabling the experiment, ensure you restart the DevTools. To use Source Order Viewer:
Open the Elements pane.
Open the Accessibility pane in the drawer (bottom) panel.
Under the Source Order Viewer section, select the Show Source Order checkbox.
Highlight any HTML element to display an overlay that the order in the page source.
Grab Edge Dev (or, if you are reading this in October, Edge 86) and enable the feature:
Then visit a page that is familiar to you and uses CSS to control the layout — ideally something like CSS grid, flex, float, or (ugh) even tabled layouts. Just like in my bookmarklet you will need to choose a node that contains the nodes whose order you want to see (except here you can click it).
The Microsoft Edge team added this as a result of my years’ long campaign for a source order viewer to be built into the browser dev tools.
I made this video pitch in late 2019 for Microsoft’s “The Web We Want” initiative and it was picked by the audience and the judges (YouTube version if the embed does not load):
Jump to roughly 3:46 in the video above to see how my bookmarklet corresponds to the screen shots just before the video. Cool, huh?
Links to the sites and pages referenced in the video:
While this feature has been available in Chrome as an experiment for some time, it is getting a proper release as of Chrome 92:
The order of content in an HTML document is important for search engine optimization and accessibility. The newer CSS features allow developers to create content that looks very different in its on-screen order than what is in the HTML document. This is a big accessibility problem as screen reader users would get a different, most likely confusing experience than sighted users.
I may have worded that differently, but what is important is that the Chrome team saw enough value to keep it.
This is incredible, thank you for pushing that. I always knew DOM order was important and I was skeptical about rearrangements or miswriting content even without flexbox, but that demo you put together tells the problem exactly. Even if someone have no idea what the problem is, it’s now shining in our face
Leave a Comment or Response