There have been several bugs discovered where native labels text is changed but those labels do not NotifyAccessibilityEvent, so accessibility services find out-dated text.
crbug.com/885326
crbug.com/876419
crbug.com/833668
A solution moving forward would be to remove all instances of label_->NotifyAccessibilityEvent and just have Label::SetText call NotifyAccessibilityEvent directly.
The pros are:
* All labels will always stay updated for Accessibility, and all additional undiscovered bugs of this nature will be fixed.
* Developers do not need to remember to to this going forward
The cons are:
* Need to ensure this does not cause any performance issues if NotifyAccessibilityEvent is called by the view or object holding the label, i.e. duplicate calls
* A solution would need to not NotifyAccessibilityEvent when a label is not yet added to a view, per tapted@: "this has the potential to cause performance regressions when Labels are being created for the first time (there's no point sending out these notifications then)."
Dominic was thinking about making NotifyAccessibilityEvent more light-weight so that it could be called multiple times without impacting performance, which would unblock implementation of this without worrying about the cons above.
Comment 1 by pkasting@chromium.org
, Sep 28