Skip to content

rustdoc: clean up storage.js #109542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2023
Merged

Conversation

notriddle
Copy link
Contributor

No description provided.

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
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 23, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 23, 2023

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@@ -87,21 +87,6 @@
box-sizing: border-box;
}

/* This part handles the "default" theme being used depending on the system one. */
html {
content: "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you remember what it was used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added to support Safari back in 2020.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current version of Safari supports window.matchMedia.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since 2012 apparently so we can remove it. Thanks for the explanations!

@GuillaumeGomez
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Mar 24, 2023

📌 Commit 95ef91c has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 24, 2023

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 24, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 25, 2023
…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
@bors bors merged commit 8c83058 into rust-lang:master Mar 25, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 25, 2023
@notriddle notriddle deleted the notriddle/storage-js branch March 25, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants