Bug 1771736 part 2: Only push a cache update for text if the text actually changes. r=morgan

Layout sends a11y text update notifications during reflow even if the text hasn't changed.
TextUpdater already detects this case, so just move our cache update calls to TextUpdater.

Differential Revision: https://phabricator.services.mozilla.com/D147656
This commit is contained in:
James Teh
2022-06-01 00:35:26 +00:00
parent 7df4aab1dc
commit 5be7ad577b
2 changed files with 7 additions and 5 deletions

View File

@@ -5,7 +5,6 @@
#include "NotificationController.h"
#include "CacheConstants.h"
#include "DocAccessible-inl.h"
#include "DocAccessibleChild.h"
#include "nsEventShell.h"
@@ -745,10 +744,6 @@ void NotificationController::WillRefresh(mozilla::TimeStamp aTime) {
#endif
TextUpdater::Run(mDocument, textAcc->AsTextLeaf(), text.mString);
if (IPCAccessibilityActive() &&
StaticPrefs::accessibility_cache_enabled_AtStartup()) {
mDocument->QueueCacheUpdate(textAcc, CacheDomain::Text);
}
continue;
}