Closed Bug 1722396 Opened 3 years ago Closed 3 years ago

Refactor DOM attribute change handling

Categories

(Core :: Disability Access APIs, task, P1)

task

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: eeejay, Assigned: eeejay)

Details

Attachments

(3 files)

Our current DOM attribute changed listener in DocAccessible is spaghetti code and touches on many different things. This includes changes in relations, aria-owns, states accessible attributes, and name/description changes. Some of these codepaths are specialized for specific accessible types (eg. a summary attribute is only relevant to tables).

In the past we were forced to store the old state of accessibles in the AttributeWillChange callback when we aren't able to determine for certain if an attribute change changes a state. Since we are already doing this, that technique could be used more broadly in many cases to give a proper state-change event, this will simplify and robustify our state-change code.

The AttributeChanged callback includes the old value, so there isn't a
reason to store this from AttributeWillChange.

Also folded ARIAAttributeChanged into DOMAttributeChanged temporarily.
Will streamline that further in the next patch where state changes are
done a bit better.

Depends on D120900

Needed to tweak tests a bit because the code is now more descerning
wheter to fire an event or not. Will do so only if the state actually
changes.

Depends on D120901

Attachment #9233199 - Attachment description: Bug 1722396 - P3: Compare old state bits with new ones to determine state change events. r?morgan,Jamie → Bug 1722396 - P3: Compare old state bits with new ones to determine state change events. r?morgan!,Jamie!
Pushed by eisaacson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a1cbf6bbf0c3 P1: Remove DocAccessible::mARIAAttrOldValue. r=morgan https://hg.mozilla.org/integration/autoland/rev/d953dc56b027 P2: Move AttributeChangedImpl into LocalAccessible::DOMAttributeChanged. r=morgan https://hg.mozilla.org/integration/autoland/rev/cda26075ae09 P3: Compare old state bits with new ones to determine state change events. r=morgan
Attachment #9233197 - Attachment description: Bug 1722396 - P1: Remove DocAccessible::mARIAAttrOldValue. r?morgan → Bug 1722396 - P1: Remove DocAccessible::mARIAAttrOldValue. r?morgan!
Attachment #9233198 - Attachment description: Bug 1722396 - P2: Move AttributeChangedImpl into LocalAccessible::DOMAttributeChanged. r?Jamie,morgan → Bug 1722396 - P2: Move AttributeChangedImpl into LocalAccessible::DOMAttributeChanged. r?Jamie!,morgan!
Pushed by eisaacson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e2cf9edf5d73 P1: Remove DocAccessible::mARIAAttrOldValue. r=morgan https://hg.mozilla.org/integration/autoland/rev/20b2120a002a P2: Move AttributeChangedImpl into LocalAccessible::DOMAttributeChanged. r=morgan https://hg.mozilla.org/integration/autoland/rev/52cc9f22fbd8 P3: Compare old state bits with new ones to determine state change events. r=morgan
Type: defect → task
Priority: -- → P1
Pushed by eisaacson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/22f85fd34b27 P1: Remove DocAccessible::mARIAAttrOldValue. r=morgan https://hg.mozilla.org/integration/autoland/rev/02dea4423d5d P2: Move AttributeChangedImpl into LocalAccessible::DOMAttributeChanged. r=morgan https://hg.mozilla.org/integration/autoland/rev/86fc719a7a94 P3: Compare old state bits with new ones to determine state change events. r=morgan
Pushed by eisaacson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9c723d30ef5f P1: Remove DocAccessible::mARIAAttrOldValue. r=morgan https://hg.mozilla.org/integration/autoland/rev/ea0639278659 P2: Move AttributeChangedImpl into LocalAccessible::DOMAttributeChanged. r=morgan https://hg.mozilla.org/integration/autoland/rev/086278457495 P3: Compare old state bits with new ones to determine state change events. r=morgan
Backout by mlaza@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a9d0f50e5a65 Backed out 3 changesets for causing gv-junit test failures. CLOSED TREE

Backed out 3 changesets (Bug 1722396) for causing gv-junit test failures.
Backout link
Failure Log
Push with failures - due to some build bustages, we triggered some tests on your try push.

Oof sorry for all of these failed landings, my try attempts have been to selective and I have missed some of these failures. Hope this next one sticks..

Flags: needinfo?(eitan)
Pushed by eisaacson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5bfab23542e1 P1: Remove DocAccessible::mARIAAttrOldValue. r=morgan https://hg.mozilla.org/integration/autoland/rev/57cba437be32 P2: Move AttributeChangedImpl into LocalAccessible::DOMAttributeChanged. r=morgan https://hg.mozilla.org/integration/autoland/rev/17cdb70e03a3 P3: Compare old state bits with new ones to determine state change events. r=morgan
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: