Commit 6b3d5e7c authored by Carlos IL's avatar Carlos IL Committed by Chromium LUCI CQ

Add aria-expanded label to advanced button in interstitials

Bug: 1061611
Change-Id: I3498e5c4c13657d573128c081f1a80097610792d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2583137
Auto-Submit: Carlos IL <carlosil@chromium.org>
Commit-Queue: Emily Stark <estark@chromium.org>
Reviewed-by: default avatarEmily Stark <estark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835552}
parent e5798b2c
...@@ -59,7 +59,8 @@ function appendDebuggingField(title, value, fixedWidth) { ...@@ -59,7 +59,8 @@ function appendDebuggingField(title, value, fixedWidth) {
} }
function toggleDebuggingInfo() { function toggleDebuggingInfo() {
$('error-debugging-info').classList.toggle(HIDDEN_CLASS); const hiddenDebug = $('error-debugging-info').classList.toggle(HIDDEN_CLASS);
$('error-code').setAttribute('aria-expanded', !hiddenDebug);
} }
function setupEvents() { function setupEvents() {
...@@ -201,8 +202,12 @@ function setupEvents() { ...@@ -201,8 +202,12 @@ function setupEvents() {
// interstitials don't have details buttons. // interstitials don't have details buttons.
$('details-button').classList.add('hidden'); $('details-button').classList.add('hidden');
} else { } else {
$('details-button')
.setAttribute(
'aria-expanded', !$('details').classList.contains(HIDDEN_CLASS));
$('details-button').addEventListener('click', function(event) { $('details-button').addEventListener('click', function(event) {
const hiddenDetails = $('details').classList.toggle(HIDDEN_CLASS); const hiddenDetails = $('details').classList.toggle(HIDDEN_CLASS);
$('details-button').setAttribute('aria-expanded', !hiddenDetails);
if (mobileNav) { if (mobileNav) {
// Details appear over the main content on small screens. // Details appear over the main content on small screens.
......
...@@ -21,4 +21,5 @@ function setupSSLDebuggingInfo() { ...@@ -21,4 +21,5 @@ function setupSSLDebuggingInfo() {
} }
$('error-code').addEventListener('click', toggleDebuggingInfo); $('error-code').addEventListener('click', toggleDebuggingInfo);
$('error-code').setAttribute('aria-expanded', false);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment