Commit dbb205b9 authored by flandy's avatar flandy Committed by Commit bot

DevTools: Added styling to checkboxes so that a focus state is displayed when...

DevTools: Added styling to checkboxes so that a focus state is displayed when tabbing through the checkboxes (for keyboard accessibility).

BUG=580199

Review-Url: https://codereview.chromium.org/2096183002
Cr-Commit-Position: refs/heads/master@{#405215}
parent 08a8c723
...@@ -100,6 +100,7 @@ WebInspector.ClassesPaneWidget.prototype = { ...@@ -100,6 +100,7 @@ WebInspector.ClassesPaneWidget.prototype = {
for (var i = 0; i < keys.length; ++i) { for (var i = 0; i < keys.length; ++i) {
var className = keys[i]; var className = keys[i];
var label = createCheckboxLabel(className, classes.get(className)); var label = createCheckboxLabel(className, classes.get(className));
label.visualizeFocus = true;
label.classList.add("monospace"); label.classList.add("monospace");
label.checkboxElement.addEventListener("click", this._onClick.bind(this, className), false); label.checkboxElement.addEventListener("click", this._onClick.bind(this, className), false);
this._classesContainer.appendChild(label); this._classesContainer.appendChild(label);
......
...@@ -1504,6 +1504,15 @@ WebInspector.appendStyle = function(node, cssFile) ...@@ -1504,6 +1504,15 @@ WebInspector.appendStyle = function(node, cssFile)
this.checkboxElement.style.borderColor = color; this.checkboxElement.style.borderColor = color;
}, },
/**
* @param {boolean} focus
* @this {Element}
*/
set visualizeFocus(focus)
{
this.checkboxElement.classList.toggle("dt-checkbox-visualize-focus", focus);
},
__proto__: HTMLLabelElement.prototype __proto__: HTMLLabelElement.prototype
}); });
......
...@@ -18,6 +18,10 @@ input { ...@@ -18,6 +18,10 @@ input {
flex-shrink: 0; flex-shrink: 0;
} }
input.dt-checkbox-visualize-focus:focus {
outline: auto 5px -webkit-focus-ring-color;
}
input.dt-checkbox-themed { input.dt-checkbox-themed {
-webkit-appearance: none; -webkit-appearance: none;
margin: 0 5px auto 2px; margin: 0 5px auto 2px;
......
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