Skip to content

Prefer the UIA value over the UIA range value when reporting value, and respect minum and maximum values for ranges#12727

Merged
michaelDCurran merged 9 commits into
nvaccess:masterfrom
LeonarddeR:rangeValuePattern
Aug 25, 2021
Merged

Prefer the UIA value over the UIA range value when reporting value, and respect minum and maximum values for ranges#12727
michaelDCurran merged 9 commits into
nvaccess:masterfrom
LeonarddeR:rangeValuePattern

Conversation

@LeonarddeR

@LeonarddeR LeonarddeR commented Aug 11, 2021

Copy link
Copy Markdown
Collaborator

Link to issue number:

Fixes #12724

Summary of the issue:

  1. For UIA controls that implement a RangeValuePattern and a ValuePattern, the RangeValuePattern gives a numerical presentation of the value in a range whereas the value could also have a textual representation exposed in the ValuePattern. NVDA prefered the numerical representation, which doesn't make much sense and isn't according to how Narrator, JAWS and LeagcyIAccessiblePattern expose the value.
  2. NVDA insisted on correcting every range to a 0--100 range, even though UIA could specify different minimum and maximum values in the rangeValue pattern.
  3. Range value patterns where rounded up to 4 digits and then converted to an integer. This resulted in 4.9998 resulting into an integer value of 4 instead of a rounded value of 5.

Description of how this pull request fixes the issue:

  1. Swapped the order of methods the value is constructed. NVDA first tries the ValuePattern, than if that's empty, it uses the RangeValuePattern.
  2. No longer take the minimum and maximum value into account when working with a range value and report the value as a percentage, but report the real value exposed by the pattern.
  3. The range value pattern value is now rounded properly

Testing strategy:

Tested the sliders as mentioned in #12724 as well as the sliders in Windows settings.

Known issues with pull request:

It could be that the range correction (from 0 to 100) was intentional, but it looks like it was there from the beginning, at least since 2009.

Change log entries:

Bug fixes

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual testing.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers

@LeonarddeR LeonarddeR requested a review from a team as a code owner August 11, 2021 07:51
@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

@josephsl raised the point of progress bars. I assume proper progress bars have a min value of 0.0 and a max value of 100.0, so they'll just work.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 9ba890b052

@michaelDCurran

Copy link
Copy Markdown
Member

In a purfect world, yes, progressBars would be already between 0 and 100. But as in the past NVDA has used the min and max of the value to normalize to a percentage, we wouldn't really know if they were already correct or not. Changing this now would break announcement of any progress bar which happened to not conform to what we think is correct. We can either just take the risk and fix broken progress bars as we find them, or my preferrred option would be to make a ProgresssBar overlay class for UIA, which normalized the value property to between 0 and 100 like the old code did.

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

I created a new overlay for progress bars.

@michaelDCurran michaelDCurran merged commit 3942506 into nvaccess:master Aug 25, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.3 milestone Aug 25, 2021
@LeonarddeR LeonarddeR deleted the rangeValuePattern branch August 23, 2025 06:27
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.

In cases where UIA element both has ValuePattern and RangeValuePattern, NVDA uses the latter whereas this might be incorrect

4 participants