Bug 1825611: Cache overflow r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D175193
This commit is contained in:
Morgan Rae Reschenberg 2023-04-19 22:55:38 +00:00
Родитель b8f531e854
Коммит 513cf054fc
1 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -3619,6 +3619,17 @@ already_AddRefed<AccAttributes> LocalAccessible::BundleFieldsForCache(
} else if (aUpdateType != CacheUpdateType::Initial) {
fields->SetAttribute(nsGkAtoms::position, DeleteEntry());
}
if (frame) {
nsAutoCString overflow;
frame->Style()->GetComputedPropertyValue(eCSSProperty_overflow, overflow);
RefPtr<nsAtom> overflowAtom = NS_Atomize(overflow);
if (overflowAtom == nsGkAtoms::hidden) {
fields->SetAttribute(nsGkAtoms::overflow, nsGkAtoms::hidden);
} else if (aUpdateType != CacheUpdateType::Initial) {
fields->SetAttribute(nsGkAtoms::overflow, DeleteEntry());
}
}
}
if (aCacheDomain & CacheDomain::Table) {
@ -3823,6 +3834,19 @@ void LocalAccessible::MaybeQueueCacheUpdateForStyleChanges() {
if (nsIFrame* frame = GetFrame()) {
const ComputedStyle* newStyle = frame->Style();
nsAutoCString oldOverflow, newOverflow;
mOldComputedStyle->GetComputedPropertyValue(eCSSProperty_overflow,
oldOverflow);
newStyle->GetComputedPropertyValue(eCSSProperty_overflow, newOverflow);
if (oldOverflow != newOverflow) {
RefPtr<nsAtom> oldAtom = NS_Atomize(oldOverflow);
RefPtr<nsAtom> newAtom = NS_Atomize(newOverflow);
if (oldAtom == nsGkAtoms::hidden || newAtom == nsGkAtoms::hidden) {
mDoc->QueueCacheUpdate(this, CacheDomain::Style);
}
}
nsAutoCString oldDisplay, newDisplay;
mOldComputedStyle->GetComputedPropertyValue(eCSSProperty_display,
oldDisplay);