rustdoc: clean up storage.js#109542
Conversation
This converts a few functions to more compact versions of themselves, and moves `RUSTDOC_MOBILE_BREAKPOINT` to main.js where it's actually used.
This is based on the compatibility data for `window.matchMedia` and `MediaQueryList`'s `EventTarget` implementation. https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#browser_compatibility https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia#browser_compatibility * EventTarget would require us to drop support for all Chrome versions before 39. However, we already require Chrome 49, because rustdoc requires [CSS variables]. * EventTarget would also limit us to Firefox 55, but since rust-lang#106502 rustdoc only supports Firefox > 68. * EventTarget limits us to Mobile Safari version 14, but rust-lang#102404 shows that our CSS is broken in Safari versions before 15.5. [CSS variables]: https://developer.mozilla.org/en-US/docs/Web/CSS/--*#browser_compatibility
|
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @Folyd, @jsha |
|
|
||
| /* This part handles the "default" theme being used depending on the system one. */ | ||
| html { | ||
| content: ""; |
There was a problem hiding this comment.
Do you remember what it was used for?
There was a problem hiding this comment.
There was a problem hiding this comment.
Ok I see. Why was it removed then? Or why did we add it in the first place? (Just so I can understand this change)
There was a problem hiding this comment.
It was added to support Safari back in 2020.
There was a problem hiding this comment.
It's not needed anymore?
There was a problem hiding this comment.
The current version of Safari supports window.matchMedia.
There was a problem hiding this comment.
Since 2012 apparently so we can remove it. Thanks for the explanations!
|
Thanks! @bors r+ rollup |
|
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#109355 (Fix bad suggestion for clone/is_some in field init shorthand) - rust-lang#109484 (Bugfix: avoid panic on invalid json output from libtest) - rust-lang#109539 (Refactor `find_*_stability` functions) - rust-lang#109542 (rustdoc: clean up `storage.js`) - rust-lang#109545 (Deeply check well-formedness of return-position `impl Trait` in trait) - rust-lang#109568 (miri: fix raw pointer dyn receivers) - rust-lang#109570 (Add GUI test for "Auto-hide item methods' documentation" setting) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.