Changeset 288385 in webkit
- Timestamp:
- Jan 21, 2022 3:40:17 PM (6 months ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Views/AlignmentEditor.css (modified) (1 diff)
-
UserInterface/Views/AlignmentEditor.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r288266 r288385 1 2022-01-21 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: Make alignment editor accessible 4 https://bugs.webkit.org/show_bug.cgi?id=235395 5 <rdar://problem/87851989> 6 7 Reviewed by Patrick Angle. 8 9 Make alignment editor icons focusable, and annotate elements so VoiceOver could correctly read what is selected. 10 11 * UserInterface/Views/AlignmentEditor.css: 12 (.alignment-editor .glyph:focus): 13 (.alignment-editor .glyph:not(:focus-visible)): 14 * UserInterface/Views/AlignmentEditor.js: 15 (WI.AlignmentEditor): 16 (WI.AlignmentEditor.prototype.set alignment): 17 (WI.AlignmentEditor.prototype._removePreviouslySelected): 18 (WI.AlignmentEditor.prototype._updateSelected): 19 1 20 2022-01-19 Devin Rousso <drousso@apple.com> 2 21 -
trunk/Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.css
r287870 r288385 57 57 rotate: -90deg; 58 58 } 59 60 .alignment-editor .glyph:focus { 61 outline-offset: var(--focus-ring-outline-offset); 62 } -
trunk/Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js
r286885 r288385 35 35 this._element = document.createElement("div"); 36 36 this._element.className = "alignment-editor"; 37 this._element.role = "radiogroup"; 37 38 } 38 39 … … 100 101 for (let [value, path] of Object.entries(WI.AlignmentEditor._glyphsForType(alignment.type))) { 101 102 let glyphElement = WI.ImageUtilities.useSVGSymbol(path, "glyph", value); 103 glyphElement.role = "radio"; 104 glyphElement.tabIndex = 0; 102 105 this._element.append(glyphElement); 103 106 glyphElement.classList.toggle("rotate-left", shouldRotate); … … 123 126 let previousGlyphElement = this._valueToGlyphElement.get(this._alignment.text); 124 127 previousGlyphElement?.classList.remove("selected"); 128 previousGlyphElement?.removeAttribute("aria-checked"); 125 129 } 126 130 … … 129 133 let glyphElement = this._valueToGlyphElement.get(this._alignment.text); 130 134 glyphElement?.classList.add("selected"); 135 glyphElement?.setAttribute("aria-checked", true); 131 136 } 132 137 };
Note: See TracChangeset
for help on using the changeset viewer.