diff options
| author | Jacob Hoffman-Andrews <github@hoffman-andrews.com> | 2022-06-20 12:41:11 -0700 |
|---|---|---|
| committer | Jacob Hoffman-Andrews <github@hoffman-andrews.com> | 2022-06-20 15:08:02 -0700 |
| commit | b37a05bd01a4f1fdcdfda77df4a9008d04236528 (patch) | |
| tree | c721c0c224e78af8a1526ff9d26c10878781888c /src/test/rustdoc-gui/source-code-page.goml | |
| parent | bb8c2f41174caceec00c28bc6c5c20ae9f9a175c (diff) | |
| download | rust-b37a05bd01a4f1fdcdfda77df4a9008d04236528.tar.gz rust-b37a05bd01a4f1fdcdfda77df4a9008d04236528.zip | |
rustdoc: optimize loading of source sidebar
The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster.
Diffstat (limited to 'src/test/rustdoc-gui/source-code-page.goml')
| -rw-r--r-- | src/test/rustdoc-gui/source-code-page.goml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/rustdoc-gui/source-code-page.goml b/src/test/rustdoc-gui/source-code-page.goml index 188b2605f0f..b45512601f2 100644 --- a/src/test/rustdoc-gui/source-code-page.goml +++ b/src/test/rustdoc-gui/source-code-page.goml @@ -32,7 +32,7 @@ assert-document-property: ({"URL": "/lib.rs.html"}, ENDS_WITH) // First we "open" it. click: "#sidebar-toggle" -assert: ".sidebar.expanded" +assert: ".source-sidebar-expanded" // We check that the first entry of the sidebar is collapsed (which, for whatever reason, // is number 2 and not 1...). |
