diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs
index 1f92c521d46e5..2782e8e0058ca 100644
--- a/src/librustdoc/html/layout.rs
+++ b/src/librustdoc/html/layout.rs
@@ -8,6 +8,9 @@ use super::static_files::{STATIC_FILES, StaticFiles};
use crate::externalfiles::ExternalHtml;
use crate::html::render::{StylePath, ensure_trailing_slash};
+#[cfg(test)]
+mod tests;
+
pub(crate) struct Layout {
pub(crate) logo: String,
pub(crate) favicon: String,
@@ -68,6 +71,13 @@ struct PageLayout<'a> {
display_krate_version_extra: &'a str,
}
+impl PageLayout<'_> {
+ /// See [`may_remove_crossorigin`].
+ fn static_root_path_may_remove_crossorigin(&self) -> bool {
+ may_remove_crossorigin(&self.static_root_path)
+ }
+}
+
pub(crate) use crate::html::render::sidebar::filters;
pub(crate) fn render(
@@ -134,3 +144,22 @@ pub(crate) fn redirect(url: &str) -> String {