From 3e59ef8ff4ad5b1f627d4718814eb43b70a79fbc Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Wed, 21 Sep 2016 14:15:20 -0400 Subject: [PATCH] Bug 1280551 - Documents sometimes load with no child accessibles but all text merged into document, r=yzen --- accessible/base/TreeWalker.cpp | 4 +++ .../tests/mochitest/treeupdate/test_doc.html | 31 +++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/accessible/base/TreeWalker.cpp b/accessible/base/TreeWalker.cpp index 0f070e610dbe..8c04b5d6f740 100644 --- a/accessible/base/TreeWalker.cpp +++ b/accessible/base/TreeWalker.cpp @@ -81,6 +81,10 @@ TreeWalker::Seek(nsIContent* aChildNode) Reset(); + if (mAnchorNode == aChildNode) { + return true; + } + nsIContent* childNode = nullptr; nsINode* parentNode = aChildNode; do { diff --git a/accessible/tests/mochitest/treeupdate/test_doc.html b/accessible/tests/mochitest/treeupdate/test_doc.html index 254652c30c4f..05896e7b46fa 100644 --- a/accessible/tests/mochitest/treeupdate/test_doc.html +++ b/accessible/tests/mochitest/treeupdate/test_doc.html @@ -129,19 +129,38 @@ */ function replaceIFrameHTMLElm(aID) { - this.__proto__ = new rootContentReplaced(aID, "New Wave"); + this.eventSeq = [ + new invokerChecker(EVENT_SHOW, getDocChildNode, aID), + new invokerChecker(EVENT_REORDER, getDocNode, aID) + ]; this.invoke = function replaceIFrameHTMLElm_invoke() { var docNode = getDocNode(aID); var newHTMLNode = docNode.createElement("html"); - var newBodyNode = docNode.createElement("body"); - var newTextNode = docNode.createTextNode("New Wave"); - newBodyNode.appendChild(newTextNode); - newHTMLNode.appendChild(newBodyNode); + newHTMLNode.innerHTML = `

New Wave