Skip to content

Don't unconditionally report aria-current for all property changes.#10523

Merged
michaelDCurran merged 1 commit into
nvaccess:masterfrom
jcsteh:fixAriaCurrent
Nov 21, 2019
Merged

Don't unconditionally report aria-current for all property changes.#10523
michaelDCurran merged 1 commit into
nvaccess:masterfrom
jcsteh:fixAriaCurrent

Conversation

@jcsteh

@jcsteh jcsteh commented Nov 20, 2019

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #8960.

Summary of the issue:

aria-current changes are spoken multiple times. In addition, other property changes, such as a name change, incorrectly spoke aria-current.

Description of how this pull request fixes the issue:

  1. Previously, speech.speakObjectProperties unconditionally forced reporting of aria-current, regardless of whether it was enabled in the allowedProperties argument. This meant it was reported for all property changes, including name and state changes. aria-current also wasn't checking the cache for property changes, so we couldn't determine whether it had changed or not, resulting in double reporting in some cases. This has been fixed and speakObject enables this so it's still reported on focus, query, etc.
  2. Now that aria-current is no longer unconditionally reported, the call from event_IA2AttributeChange to event_stateChange no longer reports aria-current. This wasn't appropriate anyway. Now, Ia2Web.event_IA2AttributeChange explicitly requests that aria-current changes be spoken.

Testing performed:

Test case:
data:text/html,<button onclick="this.setAttribute('aria-current', 'page');">Make current</button><hr><button aria-current="page" onClick="this.setAttribute('aria-label', 'New label');">Change label</button>
Tests performed in Firefox (other browsers don't report aria-current changes).

  1. Press the Make current button.
    • Before patch: "current page" is spoken twice.
    • After patch: "current page" is spoken only once.
    • Both: Braille is updated correctly.
  2. press the "Change label" button.
    • Before patch: NVDA says "New label current page"
    • After patch: NVDA says just "current page"
    • Both: Braille is updated correctly.

Known issues with pull request:

None.

Change log entry:

Bug fixes:
- In Mozilla Firefox, when the focused element becomes marked as current (aria-current), this change is no longer spoken multiple times. (#8960)

@AppVeyorBot

Copy link
Copy Markdown

PR introduces Flake8 errors 😲

See test results for Failed build of commit fcd86d6969

@michaelDCurran michaelDCurran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was too quick. There are linting issues it seems.

1. Previously, speech.speakObjectProperties unconditionally forced reporting of aria-current, regardless of whether it was enabled in the allowedProperties argument.
    This meant it was reported for all property changes, including name and state changes.
    aria-current also wasn't checking the cache for property changes, so we couldn't determine whether it had changed or not, resulting in double reporting in some cases.
    This has been fixed and speakObject enables this so it's still reported on focus, query, etc.

2. Now that aria-current is no longer unconditionally reported, the call from event_IA2AttributeChange to event_stateChange no longer reports aria-current.
    This wasn't appropriate anyway.
    Now, Ia2Web.event_IA2AttributeChange explicitly requests that aria-current changes be spoken.
@michaelDCurran michaelDCurran merged commit d5aeb23 into nvaccess:master Nov 21, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Nov 21, 2019
michaelDCurran added a commit that referenced this pull request Nov 21, 2019
@jcsteh jcsteh deleted the fixAriaCurrent branch November 21, 2019 09:28
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.

current status is announced multiple times by NVDA

4 participants