WebKit / Speedometer

An open source repository for the Speedometer benchmark
Other
592 stars 68 forks source link

Avoid :has selector in CSS. #395

Closed mstange closed 6 months ago

mstange commented 6 months ago

Fixes #394.

This changes how section visibility is controlled. All sections are still display:none by default. Rather than becoming display:block when they match :target, they now become display:block if their ID matches the value of the root element's data-visible-section attribute - we hardcode the four section names "home", "running", "summary" and "details".

This lets us default to the home section just by setting <html data-visible-section="home"> in index.html, and we can avoid the :has selector.

Now Speedometer can run in older browsers which don't support :has.