forked from mirrors/gecko-dev
Bug 1580292 - Check for pruned descendants of reframed body. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D45423 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
4b3b42e7be
commit
db60a948f1
2 changed files with 54 additions and 0 deletions
|
|
@ -1206,6 +1206,11 @@ Accessible* DocAccessible::GetAccessibleOrDescendant(nsINode* aNode) const {
|
||||||
if (acc) return acc;
|
if (acc) return acc;
|
||||||
|
|
||||||
acc = GetContainerAccessible(aNode);
|
acc = GetContainerAccessible(aNode);
|
||||||
|
if (acc == this && aNode == mContent) {
|
||||||
|
// The body node is the doc's content node.
|
||||||
|
return acc;
|
||||||
|
}
|
||||||
|
|
||||||
if (acc) {
|
if (acc) {
|
||||||
uint32_t childCnt = acc->ChildCount();
|
uint32_t childCnt = acc->ChildCount();
|
||||||
for (uint32_t idx = 0; idx < childCnt; idx++) {
|
for (uint32_t idx = 0; idx < childCnt; idx++) {
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,49 @@
|
||||||
window.windowUtils.restoreNormalRefresh();
|
window.windowUtils.restoreNormalRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check to see that a reframed body gets its children pruned correctly.
|
||||||
|
async function bodyReframe(argument) {
|
||||||
|
// Load sub-document in iframe.
|
||||||
|
let event = waitForEvent(EVENT_REORDER, "iframe", "bodyReframe");
|
||||||
|
getNode("iframe").src =
|
||||||
|
`data:text/html,<div>Hello</div><div style="display: none">World</div>`;
|
||||||
|
await event;
|
||||||
|
|
||||||
|
// Initial tree should have one section leaf.
|
||||||
|
testAccessibleTree("c10",{ SECTION: [
|
||||||
|
{ INTERNAL_FRAME: [
|
||||||
|
{ DOCUMENT: [
|
||||||
|
{ SECTION: [
|
||||||
|
{ role: ROLE_TEXT_LEAF, name: "Hello" }
|
||||||
|
] }
|
||||||
|
]}
|
||||||
|
] }
|
||||||
|
] });
|
||||||
|
|
||||||
|
|
||||||
|
let iframeDoc = getNode("iframe").contentWindow.document;
|
||||||
|
|
||||||
|
// Trigger coalesced reframing. Both the body node and its children
|
||||||
|
// will need reframing.
|
||||||
|
event = waitForEvent(EVENT_REORDER, iframeDoc, "bodyReframe");
|
||||||
|
iframeDoc.body.style.display = "inline-block";
|
||||||
|
iframeDoc.querySelector("div:first-child").style.display = "none";
|
||||||
|
iframeDoc.querySelector("div:last-child").style.display = "block";
|
||||||
|
|
||||||
|
await event;
|
||||||
|
|
||||||
|
// Only the second section should be showing
|
||||||
|
testAccessibleTree("c10",{ SECTION: [
|
||||||
|
{ INTERNAL_FRAME: [
|
||||||
|
{ DOCUMENT: [
|
||||||
|
{ SECTION: [
|
||||||
|
{ role: ROLE_TEXT_LEAF, name: "World" }
|
||||||
|
] }
|
||||||
|
]}
|
||||||
|
] }
|
||||||
|
] });
|
||||||
|
}
|
||||||
|
|
||||||
async function doTest() {
|
async function doTest() {
|
||||||
await hideDivFromInsideSpan();
|
await hideDivFromInsideSpan();
|
||||||
|
|
||||||
|
|
@ -234,6 +277,8 @@
|
||||||
|
|
||||||
listItemReframe();
|
listItemReframe();
|
||||||
|
|
||||||
|
await bodyReframe();
|
||||||
|
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -293,6 +338,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="c10">
|
||||||
|
<iframe id="iframe"></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="eventdump"></div>
|
<div id="eventdump"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue