Skip to content

Commit

Permalink
Remove invalid usage of aria-level
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 1, 2021
1 parent 9077d54 commit 93389b5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
12 changes: 6 additions & 6 deletions src/librustdoc/html/render/mod.rs
Expand Up @@ -1371,7 +1371,7 @@ fn render_impl(
.map(|item| format!("{}.{}", item.type_(), name));
write!(
w,
"<div id=\"{}\" class=\"{}{}\" role=\"heading\" aria-level=\"4\">",
"<div id=\"{}\" class=\"{}{}\" data-level=\"2\">",
id, item_type, in_trait_class,
);
w.write_str("<code>");
Expand Down Expand Up @@ -1400,7 +1400,7 @@ fn render_impl(
let id = cx.derive_id(source_id.clone());
write!(
w,
"<div id=\"{}\" class=\"{}{}\" role=\"heading\" aria-level=\"4\"><code>",
"<div id=\"{}\" class=\"{}{}\" data-level=\"2\"><code>",
id, item_type, in_trait_class
);
assoc_type(
Expand All @@ -1421,7 +1421,7 @@ fn render_impl(
let id = cx.derive_id(source_id.clone());
write!(
w,
"<div id=\"{}\" class=\"{}{}\" role=\"heading\" aria-level=\"4\"><code>",
"<div id=\"{}\" class=\"{}{}\" data-level=\"2\"><code>",
id, item_type, in_trait_class
);
assoc_const(
Expand Down Expand Up @@ -1450,7 +1450,7 @@ fn render_impl(
let id = cx.derive_id(source_id.clone());
write!(
w,
"<div id=\"{}\" class=\"{}{}\" role=\"heading\" aria-level=\"4\"><code>",
"<div id=\"{}\" class=\"{}{}\" data-level=\"2\"><code>",
id, item_type, in_trait_class,
);
assoc_type(
Expand Down Expand Up @@ -1593,7 +1593,7 @@ fn render_impl(
if let Some(use_absolute) = use_absolute {
write!(
w,
"{}<div id=\"{}\" class=\"impl\"{} role=\"heading\" aria-level=\"3\">\
"{}<div id=\"{}\" class=\"impl\"{} data-level=\"1\">\
<code class=\"in-band\">",
open_details(&mut close_tags, is_implementing_trait),
id,
Expand Down Expand Up @@ -1621,7 +1621,7 @@ fn render_impl(
} else {
write!(
w,
"{}<div id=\"{}\" class=\"impl\"{} role=\"heading\" aria-level=\"3\">\
"{}<div id=\"{}\" class=\"impl\"{} data-level=\"1\">\
<code class=\"in-band\">{}</code>",
open_details(&mut close_tags, is_implementing_trait),
id,
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/print_item.rs
Expand Up @@ -585,7 +585,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
if toggled {
write!(w, "<details class=\"rustdoc-toggle\" open><summary>");
}
write!(w, "<div id=\"{}\" class=\"method\" role=\"heading\" aria-level=\"3\"><code>", id);
write!(w, "<div id=\"{}\" class=\"method\" data-level=\"1\"><code>", id);
render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl, cx);
w.write_str("</code>");
render_stability_since(w, m, t, cx.tcx());
Expand Down
36 changes: 18 additions & 18 deletions src/librustdoc/html/static/rustdoc.css
Expand Up @@ -137,19 +137,19 @@ h1.fqn > .in-band > a:hover {
h2, h3, h4 {
border-bottom: 1px solid;
}
div[aria-level="3"].impl, div[aria-level="3"].method, div[aria-level="4"].method,
div[aria-level="3"].type, div[aria-level="4"].type, div[aria-level="4"].associatedconstant,
div[aria-level="4"].associatedtype {
div[data-level="1"].impl, div[data-level="1"].method, div[data-level="2"].method,
div[data-level="1"].type, div[data-level="2"].type, div[data-level="2"].associatedconstant,
div[data-level="2"].associatedtype {
flex-basis: 100%;
font-weight: 600;
margin-top: 16px;
margin-bottom: 10px;
position: relative;
}
div[aria-level="3"].impl, div[aria-level="3"].method, div[aria-level="4"].method.trait-impl,
div[aria-level="3"].type, div[aria-level="4"].type.trait-impl,
div[aria-level="4"].associatedconstant.trait-impl,
div[aria-level="4"].associatedtype.trait-impl {
div[data-level="1"].impl, div[data-level="1"].method, div[data-level="2"].method.trait-impl,
div[data-level="1"].type, div[data-level="2"].type.trait-impl,
div[data-level="2"].associatedconstant.trait-impl,
div[data-level="2"].associatedtype.trait-impl {
padding-left: 15px;
}

Expand Down Expand Up @@ -467,15 +467,15 @@ nav.sub {
font-weight: normal;
}

div[aria-level="3"].impl > .out-of-band {
div[data-level="1"].impl > .out-of-band {
font-size: 21px;
}

div[aria-level="4"].method > .out-of-band {
div[data-level="2"].method > .out-of-band {
font-size: 19px;
}

div[aria-level="3"] > code, div[aria-level="4"] > code, .invisible > code {
div[data-level="1"] > code, div[data-level="2"] > code, .invisible > code {
max-width: calc(100% - 41px);
display: block;
}
Expand Down Expand Up @@ -569,7 +569,7 @@ div[aria-level="3"] > code, div[aria-level="4"] > code, .invisible > code {
margin-left: 20px;
margin-top: -34px;
}
.content .docblock > .impl-items > div[aria-level="4"] {
.content .docblock > .impl-items > div[data-level="2"] {
border-bottom: 0;
}
.content .docblock >.impl-items .table-display {
Expand Down Expand Up @@ -694,7 +694,7 @@ a {
}

.invisible > .srclink,
div[aria-level="3"] > code + .srclink, div[aria-level="4"] > code + .srclink {
div[data-level="1"] > code + .srclink, div[data-level="2"] > code + .srclink {
position: absolute;
top: 0;
right: 0;
Expand Down Expand Up @@ -929,8 +929,8 @@ body.blur > :not(#help) {
flex-grow: 1;
}

.impl-items div[aria-level="4"], div[aria-level="4"].impl, div[aria-level="3"].impl,
.methods div[aria-level="3"] {
.impl-items div[data-level="2"], div[data-level="2"].impl, div[data-level="1"].impl,
.methods div[data-level="1"] {
display: flex;
flex-basis: 100%;
font-size: 16px;
Expand Down Expand Up @@ -999,7 +999,7 @@ a.test-arrow:hover{
top: 0;
}

div[aria-level="3"] > .collapse-toggle, div[aria-level="4"] > .collapse-toggle {
div[data-level="1"] > .collapse-toggle, div[data-level="2"] > .collapse-toggle {
font-size: 0.8em;
top: 5px;
}
Expand Down Expand Up @@ -1243,7 +1243,7 @@ pre.rust {
margin-left: 5px;
}

div[aria-level="4"] > .notable-traits {
div[data-level="2"] > .notable-traits {
position: absolute;
left: -44px;
top: 2px;
Expand Down Expand Up @@ -1661,7 +1661,7 @@ details.undocumented[open] > summary::before {
padding: 0;
}

.content div[aria-level="4"] > .out-of-band {
.content div[data-level="2"] > .out-of-band {
position: inherit;
}

Expand All @@ -1684,7 +1684,7 @@ details.undocumented[open] > summary::before {
z-index: 1;
}

div[aria-level="4"] > .notable-traits {
div[data-level="2"] > .notable-traits {
position: absolute;
left: -22px;
top: 24px;
Expand Down

0 comments on commit 93389b5

Please sign in to comment.