mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
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:
parent
1fcd045e66
commit
5f868bebc7
@ -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;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,10 @@
|
||||
#include "TextUpdater.h"
|
||||
|
||||
#include "LocalAccessible-inl.h"
|
||||
#include "CacheConstants.h"
|
||||
#include "DocAccessible-inl.h"
|
||||
#include "mozilla/StaticPrefs_accessibility.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "TextLeafAccessible.h"
|
||||
#include <algorithm>
|
||||
|
||||
@ -30,6 +33,10 @@ void TextUpdater::Run(DocAccessible* aDocument, TextLeafAccessible* aTextLeaf,
|
||||
if (skipStart != minLen || oldLen != newLen) {
|
||||
TextUpdater updater(aDocument, aTextLeaf);
|
||||
updater.DoUpdate(aNewText, oldText, skipStart);
|
||||
if (IPCAccessibilityActive() &&
|
||||
StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
aDocument->QueueCacheUpdate(aTextLeaf, CacheDomain::Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user