Repository: dart-lang/pub-dev (dart)

Issue:
dartdoc search.svg not found
When browsing the dartdoc-generated pages, the dartdoc CSS references the search icon `search.svg`, which is a relative URL to the CSS file. However, we are serving the dartdoc resources on a different URL.

`404 not found: https://pub.dev/static/hash-kubna8of/css/search.svg`

Note: I think I have seen this before, not a new regression with any of the recent dartdoc releases.

Pull request description:
Fixes #8467.

Patch:
diff --git a/pkg/web_css/lib/dartdoc.scss b/pkg/web_css/lib/dartdoc.scss
index 29f6050a6b..1d75e1a823 100644
--- a/pkg/web_css/lib/dartdoc.scss
+++ b/pkg/web_css/lib/dartdoc.scss
@@ -45,3 +45,8 @@
 .light-theme .markdown-body pre {
   background-color: #f6f8fa;
 }
+
+/* Note: override for the image path, as the dartdoc.css is served from /static/hash-<hash>/css/ */
+input.typeahead {
+  background-image: url('../dartdoc/resources/search.svg');
+}


Test patch:
diff --git a/pkg/pub_integration/lib/src/test_browser.dart b/pkg/pub_integration/lib/src/test_browser.dart
index 7484b2906a..7882c96f97 100644
--- a/pkg/pub_integration/lib/src/test_browser.dart
+++ b/pkg/pub_integration/lib/src/test_browser.dart
@@ -182,16 +182,6 @@ class TestBrowserSession {
         await rq.continueRequest();
         return;
       }
-      // TODO: this file is missing, we may need to fix it in the dartdoc stylesheet
-      if (rq.url.endsWith('/css/search.svg')) {
-        await rq.respond(
-          status: 200,
-          body: '',
-          contentType: 'image/svg+xml',
-          headers: {'Cache-Control': 'public, max-age=604800'},
-        );
-        return;
-      }
 
       final uri = Uri.parse(rq.url);
       if (uri.path.contains('//')) {