From 513cf054fc4fc6d3939969b93182cef3832b94fc Mon Sep 17 00:00:00 2001 From: Morgan Rae Reschenberg Date: Wed, 19 Apr 2023 22:55:38 +0000 Subject: [PATCH] Bug 1825611: Cache overflow r=Jamie Differential Revision: https://phabricator.services.mozilla.com/D175193 --- accessible/generic/LocalAccessible.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/accessible/generic/LocalAccessible.cpp b/accessible/generic/LocalAccessible.cpp index b09cf86b2588..21e1978b07c4 100644 --- a/accessible/generic/LocalAccessible.cpp +++ b/accessible/generic/LocalAccessible.cpp @@ -3619,6 +3619,17 @@ already_AddRefed LocalAccessible::BundleFieldsForCache( } else if (aUpdateType != CacheUpdateType::Initial) { fields->SetAttribute(nsGkAtoms::position, DeleteEntry()); } + + if (frame) { + nsAutoCString overflow; + frame->Style()->GetComputedPropertyValue(eCSSProperty_overflow, overflow); + RefPtr 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 oldAtom = NS_Atomize(oldOverflow); + RefPtr newAtom = NS_Atomize(newOverflow); + if (oldAtom == nsGkAtoms::hidden || newAtom == nsGkAtoms::hidden) { + mDoc->QueueCacheUpdate(this, CacheDomain::Style); + } + } + nsAutoCString oldDisplay, newDisplay; mOldComputedStyle->GetComputedPropertyValue(eCSSProperty_display, oldDisplay);