Bug 235395 - Web Inspector: Make alignment editor accessible
Summary: Web Inspector: Make alignment editor accessible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-19 23:21 PST by Nikita Vasilyev
Modified: 2022-01-21 15:41 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.62 KB, patch)
2022-01-20 00:20 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
[Image] With patch applied, VoiceOver on (85.05 KB, image/png)
2022-01-20 00:20 PST, Nikita Vasilyev
no flags Details
Patch (3.21 KB, patch)
2022-01-21 12:10 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2022-01-19 23:21:47 PST
Currently, VoiceOver:
- doesn't read anything when switching alignment by clicking on one of the icons
- can't focus on any alignment editor icons
Comment 1 Nikita Vasilyev 2022-01-20 00:20:04 PST
Created attachment 449557 [details]
Patch
Comment 2 Nikita Vasilyev 2022-01-20 00:20:42 PST
Created attachment 449558 [details]
[Image] With patch applied, VoiceOver on
Comment 3 Radar WebKit Bug Importer 2022-01-20 15:04:57 PST
<rdar://problem/87851989>
Comment 4 Patrick Angle 2022-01-21 11:49:12 PST
Comment on attachment 449557 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449557&action=review

> Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js:40
> +        // FIXME: <https://webkit.org/b/233055> Web Inspector: adapt :focus-visible internally

Nit: This link is for a different bug, not the one you call out. 224026 is the correct bug, I think?

Also it's not clear to me how we are blocked by /that/ bug here. It sounds like the proposed style from that bug was added to the UA in 221925, and :focus-visible appears to be on by default now. Shouldn't we just add the appropriate style instead of stopping propagating the mouse event?

> Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js:134
> -        previousGlyphElement?.classList.remove("selected");
> +        if (previousGlyphElement) {
> +            previousGlyphElement.classList.remove("selected");
> +            previousGlyphElement.removeAttribute("aria-checked");
> +        }

Why not just stick with optional chaining here?

> Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js:143
> -        glyphElement?.classList.add("selected");
> +        if (glyphElement) {
> +            glyphElement.classList.add("selected");
> +            glyphElement.setAttribute("aria-checked", true);
> +        }

Ditto :131-134
Comment 5 Nikita Vasilyev 2022-01-21 11:53:04 PST
Comment on attachment 449557 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449557&action=review

>> Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js:40
>> +        // FIXME: <https://webkit.org/b/233055> Web Inspector: adapt :focus-visible internally
> 
> Nit: This link is for a different bug, not the one you call out. 224026 is the correct bug, I think?
> 
> Also it's not clear to me how we are blocked by /that/ bug here. It sounds like the proposed style from that bug was added to the UA in 221925, and :focus-visible appears to be on by default now. Shouldn't we just add the appropriate style instead of stopping propagating the mouse event?

Oh oops. Yes, we should.

>> Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js:134
>> +        }
> 
> Why not just stick with optional chaining here?

Sounds good.
Comment 6 Nikita Vasilyev 2022-01-21 12:08:01 PST
Comment on attachment 449557 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449557&action=review

>>> Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js:40
>>> +        // FIXME: <https://webkit.org/b/233055> Web Inspector: adapt :focus-visible internally
>> 
>> Nit: This link is for a different bug, not the one you call out. 224026 is the correct bug, I think?
>> 
>> Also it's not clear to me how we are blocked by /that/ bug here. It sounds like the proposed style from that bug was added to the UA in 221925, and :focus-visible appears to be on by default now. Shouldn't we just add the appropriate style instead of stopping propagating the mouse event?
> 
> Oh oops. Yes, we should.

"... the proposed style from that bug was added to the UA in 221925, and :focus-visible appears to be on by default now."
I just verified it, and it works. We don't even need to add any :focus-visible styling at all, the UA defaults are great now!
Comment 7 Nikita Vasilyev 2022-01-21 12:10:53 PST
Created attachment 449682 [details]
Patch
Comment 8 Devin Rousso 2022-01-21 13:52:35 PST
Comment on attachment 449557 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449557&action=review

>>> Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js:134
>>> +        }
>> 
>> Why not just stick with optional chaining here?
> 
> Sounds good.

I don't have a strong opinion on this here, but I personally would've done the same to avoid a second falsy check.  It also makes it easier to add additional things in the future without having to restructure the code then.
Comment 9 Patrick Angle 2022-01-21 14:38:04 PST
(In reply to Devin Rousso from comment #8)
> Comment on attachment 449557 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=449557&action=review
> 
> >>> Source/WebInspectorUI/UserInterface/Views/AlignmentEditor.js:134
> >>> +        }
> >> 
> >> Why not just stick with optional chaining here?
> > 
> > Sounds good.
> 
> I don't have a strong opinion on this here, but I personally would've done
> the same to avoid a second falsy check.  It also makes it easier to add
> additional things in the future without having to restructure the code then.

I'm happy either way - you make a good point. I'll leave it up to Nikita.
Comment 10 Patrick Angle 2022-01-21 14:38:41 PST
Comment on attachment 449682 [details]
Patch

r=me
Comment 11 EWS 2022-01-21 15:41:32 PST
Committed r288385 (246282@main): <https://commits.webkit.org/246282@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449682 [details].