diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2022-05-18 07:41:00 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-18 07:41:00 +0900 |
| commit | b8dd27079c93d71f9667edbe17d0037c32c299af (patch) | |
| tree | 284d143011d5442694cb9c120d175e416d967dae /src | |
| parent | 7361b22b4c57a446e042f8cbc95e17969a7301eb (diff) | |
| parent | 440bbce36d649a973a323ed5fd431e36f124fb59 (diff) | |
| download | rust-b8dd27079c93d71f9667edbe17d0037c32c299af.tar.gz rust-b8dd27079c93d71f9667edbe17d0037c32c299af.zip | |
Rollup merge of #97113 - GuillaumeGomez:search-ui-fixes, r=notriddle
Search GUI fixes The first fix is about the duplicated "in":  The second fix is about the `<select>` broken style:   You can test it [here](https://rustdoc.crud.net/imperio/search-ui-fixes/doc/foo/index.html?search=test). r? `@notriddle`
Diffstat (limited to 'src')
| -rw-r--r-- | src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/themes/ayu.css | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/themes/dark.css | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/themes/light.css | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/static/js/search.js | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/search-filter.goml | 34 |
7 files changed, 43 insertions, 9 deletions
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version index f514a2f0bd0..f76f9131742 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version @@ -1 +1 @@ -0.9.1 \ No newline at end of file +0.9.2 \ No newline at end of file diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 38e67c233d6..4eb8029ee2d 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -897,7 +897,7 @@ table, margin-left: 0.25em; padding-left: 0.3125em; padding-right: 23px; - border: 0; + border: 1px solid; border-radius: 4px; outline: none; cursor: pointer; @@ -2010,7 +2010,6 @@ details.rustdoc-toggle[open] > summary.hideme::after { #crate-search { border-radius: 4px; - border: 0; } .docblock { diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index ea0cb5e0726..d32bb4cf22d 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -236,8 +236,8 @@ details.undocumented > summary::before { #crate-search, .search-input { background-color: #141920; - border-color: #424c57; - color: #c5c5c5; + /* Without the `!important`, the border-color is ignored for `<select>`... */ + border-color: #424c57 !important; } .search-input { diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css index 1525163f502..4957f25bcf3 100644 --- a/src/librustdoc/html/static/css/themes/dark.css +++ b/src/librustdoc/html/static/css/themes/dark.css @@ -217,7 +217,8 @@ details.undocumented > summary::before { #crate-search, .search-input { color: #111; background-color: #f0f0f0; - border-color: #000; + /* Without the `!important`, the border-color is ignored for `<select>`... */ + border-color: #f0f0f0 !important; } .search-input { diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css index d36a088d38e..7d4acc6c611 100644 --- a/src/librustdoc/html/static/css/themes/light.css +++ b/src/librustdoc/html/static/css/themes/light.css @@ -209,9 +209,9 @@ details.undocumented > summary::before { } #crate-search, .search-input { - color: #555; background-color: white; - border-color: #e0e0e0; + /* Without the `!important`, the border-color is ignored for `<select>`... */ + border-color: #e0e0e0 !important; } .search-input:focus { diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index 80d904b843e..c784d69dcd6 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -1738,7 +1738,7 @@ function initSearch(rawSearchIndex) { let output = "<div id=\"search-settings\">" + `<h1 class="search-results-title">Results for ${escape(results.query.userQuery)}` + - `${typeFilter}</h1> in ${crates} </div>`; + `${typeFilter}</h1>${crates}</div>`; if (results.query.error !== null) { output += `<h3>Query parser error: "${results.query.error}".</h3>`; output += "<div id=\"titles\">" + diff --git a/src/test/rustdoc-gui/search-filter.goml b/src/test/rustdoc-gui/search-filter.goml index aca8390dfb3..d0b3175114c 100644 --- a/src/test/rustdoc-gui/search-filter.goml +++ b/src/test/rustdoc-gui/search-filter.goml @@ -45,3 +45,37 @@ goto: file://|DOC_PATH|/test_docs/index.html?search=test&filter-crate=lib2 wait-for: "#crate-search" assert-property: ("#crate-search", {"value": "lib2"}) assert-false: "#results .externcrate" + +// Checking that the text for the "title" is correct (the "All" comes from the "<select>"). +assert-text: ("#search-settings", "Results for test in All", STARTS_WITH) + +// Checking the display of the crate filter. +// We start with the light theme. +local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} +reload: + +timeout: 2000 +wait-for: "#crate-search" +assert-css: ("#crate-search", { + "border": "1px solid rgb(224, 224, 224)", + "color": "rgb(0, 0, 0)", + "background-color": "rgb(255, 255, 255)", +}) + +// We now check the dark theme. +click: "#settings-menu" +wait-for: "#settings" +click: "#theme-dark" +wait-for-css: ("#crate-search", { + "border": "1px solid rgb(240, 240, 240)", + "color": "rgb(17, 17, 17)", + "background-color": "rgb(240, 240, 240)", +}) + +// And finally we check the ayu theme. +click: "#theme-ayu" +wait-for-css: ("#crate-search", { + "border": "1px solid rgb(66, 76, 87)", + "color": "rgb(197, 197, 197)", + "background-color": "rgb(20, 25, 32)", +}) |
