зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1260860 - stop illicit accessible stealing, r=yzen
This commit is contained in:
Родитель
946aff842c
Коммит
c9b15d3087
|
@ -1963,28 +1963,17 @@ Accessible::NativeName(nsString& aName)
|
|||
void
|
||||
Accessible::BindToParent(Accessible* aParent, uint32_t aIndexInParent)
|
||||
{
|
||||
NS_PRECONDITION(aParent, "This method isn't used to set null parent!");
|
||||
MOZ_ASSERT(aParent, "This method isn't used to set null parent");
|
||||
MOZ_ASSERT(!mParent, "The child was expected to be moved");
|
||||
|
||||
if (mParent) {
|
||||
if (mParent != aParent) {
|
||||
#ifdef A11Y_LOG
|
||||
if (mParent) {
|
||||
logging::TreeInfo("BindToParent: stealing accessible", 0,
|
||||
"old parent", mParent.get(),
|
||||
"new parent", aParent,
|
||||
"child", this, nullptr);
|
||||
}
|
||||
#endif
|
||||
// XXX: legalize adoption. As long as we don't invalidate the children,
|
||||
// the accessibles start to steal them.
|
||||
|
||||
AutoTreeMutation mt(mParent);
|
||||
mt.BeforeRemoval(this);
|
||||
mParent->RemoveChild(this);
|
||||
mt.Done();
|
||||
} else {
|
||||
NS_ERROR("Binding to the same parent!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
mParent = aParent;
|
||||
mIndexInParent = aIndexInParent;
|
||||
|
|
|
@ -2262,19 +2262,22 @@ DocAccessible::CacheChildrenInSubtree(Accessible* aRoot,
|
|||
FocusMgr()->HasDOMFocus(aRoot->GetContent()))
|
||||
*aFocusedAcc = aRoot;
|
||||
|
||||
aRoot->EnsureChildren();
|
||||
Accessible* root = aRoot->IsHTMLCombobox() ? aRoot->FirstChild() : aRoot;
|
||||
if (root->KidsFromDOM()) {
|
||||
AutoTreeMutation mt(root);
|
||||
TreeWalker walker(root);
|
||||
while (Accessible* child = walker.Next()) {
|
||||
if (child->IsBoundToParent()) {
|
||||
MoveChild(child, root, root->ChildCount());
|
||||
continue;
|
||||
}
|
||||
|
||||
root->AppendChild(child);
|
||||
mt.AfterInsertion(child);
|
||||
|
||||
// Make sure we create accessible tree defined in DOM only, i.e. if accessible
|
||||
// provides specific tree (like XUL trees) then tree creation is handled by
|
||||
// this accessible.
|
||||
uint32_t count = aRoot->ContentChildCount();
|
||||
for (uint32_t idx = 0; idx < count; idx++) {
|
||||
Accessible* child = aRoot->ContentChildAt(idx);
|
||||
NS_ASSERTION(child, "Illicit tree change while tree is created!");
|
||||
// Don't cross document boundaries.
|
||||
if (child && child->IsContent()) {
|
||||
CacheChildrenInSubtree(child, aFocusedAcc);
|
||||
}
|
||||
mt.Done();
|
||||
}
|
||||
|
||||
// Fire document load complete on ARIA documents.
|
||||
|
|
|
@ -51,6 +51,7 @@ HTMLLIAccessible::
|
|||
if (blockFrame && blockFrame->HasBullet()) {
|
||||
mBullet = new HTMLListBulletAccessible(mContent, mDoc);
|
||||
Document()->BindToDocument(mBullet, nullptr);
|
||||
AppendChild(mBullet);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -361,7 +361,7 @@
|
|||
function showHiddenParentOfVisibleChild()
|
||||
{
|
||||
this.eventSeq = [
|
||||
new todo_invokerChecker(EVENT_HIDE, getNode("c4_child")),
|
||||
new invokerChecker(EVENT_HIDE, getNode("c4_child")),
|
||||
new invokerChecker(EVENT_SHOW, getNode("c4_middle")),
|
||||
new invokerChecker(EVENT_REORDER, getNode("c4"))
|
||||
];
|
||||
|
|
|
@ -144,11 +144,11 @@
|
|||
<div id="t2_3" aria-owns="t2_1" role="heading"></div>
|
||||
|
||||
<!-- loop #2 -->
|
||||
<div id="t3_3" aria-owns="t3_1"></div>
|
||||
<div id="t3_1" aria-owns="t3_2" role="group"></div>
|
||||
<div id="t3_2" role="note">
|
||||
<div aria-owns="t3_3" role="heading"></div>
|
||||
</div>
|
||||
<div id="t3_3" aria-owns="t3_1"></div>
|
||||
|
||||
<!-- self loop -->
|
||||
<div id="t4_1"><div aria-owns="t4_1" role="group"></div></div>
|
||||
|
|
|
@ -50,6 +50,7 @@ XULLabelAccessible::
|
|||
nsAutoString text;
|
||||
textBoxFrame->GetCroppedTitle(text);
|
||||
mValueTextLeaf->SetText(text);
|
||||
AppendChild(mValueTextLeaf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче