Bug 1396267 - Check that owner has content before aria-owns relocation. r=surkov

This commit is contained in:
Eitan Isaacson 2017-09-11 13:56:00 -04:00
Родитель c808773f55
Коммит 1f0f0ebd6c
2 изменённых файлов: 21 добавлений и 1 удалений

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

@ -809,7 +809,8 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
// Process relocation list.
for (uint32_t idx = 0; idx < mRelocations.Length(); idx++) {
if (mRelocations[idx]->IsInDocument()) {
// owner should be in a document and have na associated DOM node (docs sometimes don't)
if (mRelocations[idx]->IsInDocument() && mRelocations[idx]->HasOwnContent()) {
mDocument->DoARIAOwnsRelocation(mRelocations[idx]);
}
}

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

@ -147,3 +147,22 @@ addAccessibleTask(`
testChildrenIds(two, ["a", "b"]);
}
);
addAccessibleTask(`<div id="a"></div><div id="b"></div>`,
async function(browser, accDoc) {
testChildrenIds(accDoc, ["a", "b"]);
let waitFor = {
expected: [[ EVENT_REORDER, e => e.accessible == accDoc ]]
};
await contentSpawnMutation(browser, waitFor, function() {
document.documentElement.style.display = "none";
document.documentElement.getBoundingClientRect();
document.body.setAttribute("aria-owns", "b a");
document.documentElement.remove();
});
testChildrenIds(accDoc, []);
}
);