Commit 3c76b36b authored by Chandani Shrestha's avatar Chandani Shrestha Committed by Commit Bot

Devtools: Add alt attribute to images in Network tool

Image captured using 'Capture Screenshot' in Network tool is missing alt attribute. This change adds the alt attribute.
Also, the images in name cell for each request in Network data-grid didn't had alt attribute instead it had aria-label. This change replaces aria-label with alt.
These images are shown when 'Use large request rows' checkbox is checked.

Following these guidelines:
https://www.w3.org/TR/UNDERSTANDING-WCAG20/text-equiv-all.html
https://www.w3.org/TR/WCAG20-TECHS/H37.html

Change-Id: Ieac4c89cf817a46d5a30a23f541eb416cd4a1628
Bug: 963183
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1794024Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Chandani Shrestha <chshrest@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#696887}
parent af603aee
......@@ -796,14 +796,14 @@ Network.NetworkRequestNode = class extends Network.NetworkNode {
let iconElement;
if (this._request.resourceType() === Common.resourceTypes.Image) {
const previewImage = createElementWithClass('img', 'image-network-icon-preview');
UI.ARIAUtils.setAccessibleName(previewImage, this._request.resourceType().title());
previewImage.alt = this._request.resourceType().title();
this._request.populateImageSource(previewImage);
iconElement = createElementWithClass('div', 'icon');
iconElement.appendChild(previewImage);
} else {
iconElement = createElementWithClass('img', 'icon');
UI.ARIAUtils.setAccessibleName(iconElement, this._request.resourceType().title());
iconElement.alt = this._request.resourceType().title();
}
iconElement.classList.add(this._request.resourceType().name());
......
......@@ -59,6 +59,7 @@ PerfUI.FilmStripView = class extends UI.HBox {
element.title = Common.UIString('Doubleclick to zoom image. Click to view preceding requests.');
element.createChild('div', 'time').textContent = Number.millisToString(time - this._zeroTime);
const imageElement = element.createChild('div', 'thumbnail').createChild('img');
imageElement.alt = ls`Screenshot`;
element.addEventListener(
'mousedown', this._onMouseEvent.bind(this, PerfUI.FilmStripView.Events.FrameSelected, time), false);
element.addEventListener(
......
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