about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-05 00:02:06 +0100
committerGitHub <noreply@github.com>2022-11-05 00:02:06 +0100
commitded8d0332ed78138b5e3a273aba066e034e05751 (patch)
tree9bc9c036986a2b55b0a0fdf4056a03f01c3ebbda /src/test
parentf6ca5aa19a567f6cb95a0c568cac148f8eb443fb (diff)
parent4bd6748bb9b73c210558498070ae0b7ed8193ddf (diff)
downloadrust-ded8d0332ed78138b5e3a273aba066e034e05751.tar.gz
rust-ded8d0332ed78138b5e3a273aba066e034e05751.zip
Rollup merge of #103980 - notriddle:notriddle/search-results, r=GuillaumeGomez
rustdoc: simplify search results CSS and DOM

Preview: http://notriddle.com/notriddle-rustdoc-demos/search-results/std/index.html?search=vec

There is a layout change caused by this commit, but it's subtle. You won't notice it unless you're looking for it.

## Before

![image](https://user-images.githubusercontent.com/1593513/200060877-05ae4135-db8d-4d24-8dfa-4c06b8ef671c.png)

## After

![image](https://user-images.githubusercontent.com/1593513/200061474-b0ea9e8d-72c3-401f-9106-072307d9e2ff.png)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/search-result-color.goml8
-rw-r--r--src/test/rustdoc-gui/search-result-display.goml2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/test/rustdoc-gui/search-result-color.goml b/src/test/rustdoc-gui/search-result-color.goml
index 37d7b03a099..0c3b1119074 100644
--- a/src/test/rustdoc-gui/search-result-color.goml
+++ b/src/test/rustdoc-gui/search-result-color.goml
@@ -67,7 +67,7 @@ reload:
 // Waiting for the search results to appear...
 wait-for: "#titles"
 assert-css: (
-    "//*[@class='desc']//*[text()='Just a normal struct.']",
+    "//*[@class='desc'][text()='Just a normal struct.']",
     {"color": "rgb(197, 197, 197)"},
 )
 assert-css: (
@@ -159,7 +159,7 @@ assert-css: (
 )
 
 // Checking color and background on hover.
-move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
+move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
 assert-css: (
     "//*[@class='result-name']/*[text()='test_docs::']",
     {"color": "rgb(255, 255, 255)"},
@@ -179,7 +179,7 @@ reload:
 // Waiting for the search results to appear...
 wait-for: "#titles"
 assert-css: (
-    "//*[@class='desc']//*[text()='Just a normal struct.']",
+    "//*[@class='desc'][text()='Just a normal struct.']",
     {"color": "rgb(221, 221, 221)"},
 )
 assert-css: (
@@ -276,7 +276,7 @@ reload:
 // Waiting for the search results to appear...
 wait-for: "#titles"
 assert-css: (
-    "//*[@class='desc']//*[text()='Just a normal struct.']",
+    "//*[@class='desc'][text()='Just a normal struct.']",
     {"color": "rgb(0, 0, 0)"},
 )
 assert-css: (
diff --git a/src/test/rustdoc-gui/search-result-display.goml b/src/test/rustdoc-gui/search-result-display.goml
index 053bfd8c905..b8abd9f9062 100644
--- a/src/test/rustdoc-gui/search-result-display.goml
+++ b/src/test/rustdoc-gui/search-result-display.goml
@@ -7,7 +7,7 @@ press-key: 'Enter'
 wait-for: "#crate-search"
 // The width is returned by "getComputedStyle" which returns the exact number instead of the
 // CSS rule which is "50%"...
-assert-css: (".search-results div.desc", {"width": "318px"})
+assert-css: (".search-results div.desc", {"width": "310px"})
 size: (600, 100)
 // As counter-intuitive as it may seem, in this width, the width is "100%", which is why
 // when computed it's larger.