Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify AXAPI behaviour for low, high, and optimum meter attributes. #538

Closed
wants to merge 2 commits into from

Conversation

MReschenberg
Copy link

@MReschenberg MReschenberg commented Mar 19, 2024

Closes #536

Specification based on Safari behaviour/attributes exposed.


Preview | Diff

Copy link
Member

@jnurthen jnurthen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is as simple as this. As I understand it <meter> can have 3 segments,

  • (1) below low,
  • (2) between low and high
  • (3) above high.
    If the optimum value fits into (1) then all values within this segment are optimal, values in (2) are suboptimal and values in (3) are critical
    If the optimal value is in (2) then values in (1) and (3) are both suboptimal
    If it is (3) then values in (1) are critical, (2) suboptimal and (3) optimal.

These correspond to the visual coloring of green (optimal), orange (suboptimal) and red (critical).

If no optimum value is specified then the optimal segment is segment (2)

Here is the webkit logic https://github.com/WebKit/WebKit/blob/c330ea99229f6bb478dde74497ee652e44a3d7d5/Source/WebCore/html/HTMLMeterElement.cpp#L156

index.html Outdated Show resolved Hide resolved
Co-authored-by: James Nurthen <[email protected]>
@jnurthen jnurthen requested a review from rahimabdi March 21, 2024 17:24
Copy link
Contributor

@rahimabdi rahimabdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @MReschenberg, I've added comments and recommendations that largely align with @jnurthen's assessment of optimum treatment.

@@ -11709,7 +11709,7 @@ <h4 id=att-high>`high`</h4>
<tr>
<th><a href="https://developer.apple.com/reference/appkit/nsaccessibility">AX</a></th>
<td>
<div class="general">Not mapped</div>
<div class="general">Expose "optimal value" via `AXValueDescription` if &lt;value&gt; is greater than or equal to &lt;high&gt;. Expose "suboptimal value" if &lt;value&gt; is less than &lt;high&gt; and greater than or equal to &lt;low&gt;.</div>
Copy link
Contributor

@rahimabdi rahimabdi May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant WebKit code: https://github.com/WebKit/WebKit/blob/c330ea99229f6bb478dde74497ee652e44a3d7d5/Source/WebCore/html/HTMLMeterElement.cpp#L172

This looks correct for high. We'll also need to add the case for when the value is less than "low" (for which this is exposed as "critical value").

@@ -12739,7 +12739,7 @@ <h4 id=att-low>`low`</h4>
<tr>
<th><a href="https://developer.apple.com/reference/appkit/nsaccessibility">AX</a></th>
<td>
<div class="general">Not mapped</div>
<div class="general">Expose "suboptial value" via `AXValueDescription` if &lt;value&gt; is greater than or equal to &lt;low&gt; and less than &lt;high&gt;. If &lt;value&gt; is less than &lt;low&gt;, expose "critical value".</div>
Copy link
Contributor

@rahimabdi rahimabdi May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant WebKit code: https://github.com/WebKit/WebKit/blob/c330ea99229f6bb478dde74497ee652e44a3d7d5/Source/WebCore/html/HTMLMeterElement.cpp#L163

For low:

  • If value is less than or equal to low, then value is "optimal value"
  • if value is less than or equal to high (but greater than low), then value is "suboptimal value"
  • else, value is "critical value"

Also, looks like there is a typo for the word "suboptimal" here.

@@ -13995,7 +13995,7 @@ <h4 id=att-optimum>`optimum`</h4>
<tr>
<th><a href="https://developer.apple.com/reference/appkit/nsaccessibility">AX</a></th>
<td>
<div class="general">Not mapped</div>
<div class="general">Expose "optimal value" via `AXValueDescription` if &lt;value&gt; is greater than or equal to &lt;optimum&gt;.</div>
Copy link
Contributor

@rahimabdi rahimabdi May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant WebKit code: https://github.com/WebKit/WebKit/blob/c330ea99229f6bb478dde74497ee652e44a3d7d5/Source/WebCore/html/HTMLMeterElement.cpp#L184

For optimum:

  • If value is greater than or equal to low AND value is less than or equal to high then value is "optimal value"
  • Else, value is "suboptimal value"

Note that in this case, there is no "critical value".

Copy link
Collaborator

@cookiecrook cookiecrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue should have an active test case showing this in a more common use case, like an audio meter bouncing quickly and showing critical peak line clipping.

I’m not sure if this will need new API, or if there is existing API, but I’m reasonably sure AXValueDescription is not the ideal way to vend this to AT like VO.

Update: dynamic meter test case added to a new WebKit Accessibility bug.

@MReschenberg
Copy link
Author

I’m not sure if this will need new API, or if there is existing API, but I’m reasonably sure AXValueDescription is not the ideal way to vend this to AT like VO.

Do you have an alternative attribute in mind?
It sounds like there's not enough info at this point to make this spec decision, so I'm leaning towards updating firefox's VO implementation to match safari temporarily and leaving this open for discussion.

@cookiecrook
Copy link
Collaborator

cookiecrook commented May 2, 2024

Role/Subrole is already AXLevelIndicator/AXMeter but other attrs TBD based on the outcome of the linked issue.

@rahimabdi
Copy link
Contributor

Closing, this PR has been migrated to the ARIA monorepo:

@rahimabdi rahimabdi closed this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML AAM: VoiceOver (AXAPI) mapping for optimum, low <meter> attributes
5 participants