Bug 1774708: Queue cache update for viewport cache when transform change detected r=nlapre

Differential Revision: https://phabricator.services.mozilla.com/D159529
This commit is contained in:
Morgan Rae Reschenberg 2022-10-20 20:48:35 +00:00
Родитель 0f31530407
Коммит f52164c7b8
2 изменённых файлов: 26 добавлений и 0 удалений

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

@ -3757,6 +3757,9 @@ void LocalAccessible::MaybeQueueCacheUpdateForStyleChanges() {
}
if (sendTransformUpdate) {
// If our transform matrix has changed, it's possible our
// viewport cache has also changed.
mDoc->SetViewportCacheDirty(true);
// Queuing a cache update for the TransformMatrix domain doesn't
// necessarily mean we'll send the matrix itself, we may
// send a DeleteEntry() instead. See BundleFieldsForCache for

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

@ -158,3 +158,26 @@ addAccessibleTask(
},
{ chrome: true, iframe: true, remoteIframe: true }
);
// test dynamic translation
addAccessibleTask(
`<div id="container" style="position: absolute; left: -300px; top: 100px;">Hello</div><button id="b" onclick="container.style.transform = 'translateX(400px)'">Move</button>`,
async function(browser, accDoc) {
const container = findAccessibleChildByID(accDoc, "container");
await untilCacheOk(
() => testVisibility(container, true, false),
"container should be off screen and visible"
);
await invokeContentTask(browser, [], () => {
let b = content.document.getElementById("b");
b.click();
});
await waitForContentPaint(browser);
await untilCacheOk(
() => testVisibility(container, false, false),
"container should be on screen and visible"
);
},
{ chrome: true, iframe: true, remoteIframe: true }
);