Changeset 288385 in webkit


Ignore:
Timestamp:
Jan 21, 2022 3:40:17 PM (6 months ago)
Author:
Nikita Vasilyev
Message:

Web Inspector: Make alignment editor accessible
https://bugs.webkit.org/show_bug.cgi?id=235395
<rdar://problem/87851989>

Reviewed by Patrick Angle.

Make alignment editor icons focusable, and annotate elements so VoiceOver could correctly read what is selected.

  • UserInterface/Views/AlignmentEditor.css:

(.alignment-editor .glyph:focus):
(.alignment-editor .glyph:not(:focus-visible)):

  • UserInterface/Views/AlignmentEditor.js:

(WI.AlignmentEditor):
(WI.AlignmentEditor.prototype.set alignment):
(WI.AlignmentEditor.prototype._removePreviouslySelected):
(WI.AlignmentEditor.prototype._updateSelected):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r288266 r288385  
     12022-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
    1202022-01-19  Devin Rousso  <drousso@apple.com>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.css

    r287870 r288385  
    5757    rotate: -90deg;
    5858}
     59
     60.alignment-editor .glyph:focus {
     61    outline-offset: var(--focus-ring-outline-offset);
     62}
  • trunk/Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js

    r286885 r288385  
    3535        this._element = document.createElement("div");
    3636        this._element.className = "alignment-editor";
     37        this._element.role = "radiogroup";
    3738    }
    3839
     
    100101            for (let [value, path] of Object.entries(WI.AlignmentEditor._glyphsForType(alignment.type))) {
    101102                let glyphElement = WI.ImageUtilities.useSVGSymbol(path, "glyph", value);
     103                glyphElement.role = "radio";
     104                glyphElement.tabIndex = 0;
    102105                this._element.append(glyphElement);
    103106                glyphElement.classList.toggle("rotate-left", shouldRotate);
     
    123126        let previousGlyphElement = this._valueToGlyphElement.get(this._alignment.text);
    124127        previousGlyphElement?.classList.remove("selected");
     128        previousGlyphElement?.removeAttribute("aria-checked");
    125129    }
    126130
     
    129133        let glyphElement = this._valueToGlyphElement.get(this._alignment.text);
    130134        glyphElement?.classList.add("selected");
     135        glyphElement?.setAttribute("aria-checked", true);
    131136    }
    132137};
Note: See TracChangeset for help on using the changeset viewer.